Skip to content

Commit

Permalink
Merge pull request #914 from EyeSeeTea/development
Browse files Browse the repository at this point in the history
Release 2.13.0
  • Loading branch information
adrianq authored Nov 17, 2021
2 parents 9188a6e + c243f3f commit a99ab73
Show file tree
Hide file tree
Showing 91 changed files with 3,175 additions and 2,502 deletions.
6 changes: 5 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
BROWSER=false
PORT=8081
SKIP_PREFLIGHT_CHECK=true
REACT_APP_DHIS2_BASE_URL=https://dev.eyeseetea.com/play/
REACT_APP_DHIS2_BASE_URL=https://dev.eyeseetea.com/play

CYPRESS_DHIS2_AUTH='admin:district'
CYPRESS_EXTERNAL_API="https://dev.eyeseetea.com/play"
CYPRESS_ROOT_URL=http://localhost:8081
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/**/*.d.ts
/src/locales
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module.exports = {
"no-console": ["warn", { allow: ["debug", "warn", "error"] }],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": ["off"],
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"react/prop-types": "off",
"react/display-name": "off",
Expand Down Expand Up @@ -42,7 +43,7 @@ module.exports = {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
plugins: ["cypress", "@typescript-eslint", "react-hooks"],
plugins: ["cypress", "@typescript-eslint", "react-hooks", "unused-imports"],
env: { "cypress/globals": true },
settings: {
react: {
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Application testing
on:
push:
workflow_dispatch:
jobs:
unit-tests:
name: Unit tests
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "12.x"

- name: Install yarn
run: npm install -g yarn

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"

- name: Cache yarn dependencies
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Installing Dependencies
run: yarn install --frozen-lockfile --silent

- name: Install translations
run: yarn localize

- name: Run jest tests
run: yarn test

- name: Run typescript tests
run: npx tsc
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
manifest.webapp
/build
/dist
*.zip
metadata-synchronization-server.js


# misc
.DS_Store
.env.local
Expand All @@ -22,7 +22,7 @@ metadata-synchronization-server.js
*.sublime-project
*.sublime-workspace
*.code-workspace
src/react-app*.d.ts
*.zip

npm-debug.log*
yarn-debug.log*
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
*.min.js
*.min.css
dist
metadata-synchronization-server.js
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,19 @@ To connect to the destination instance, it requires a configuration file. If no
$ yarn start
```

This will open the development server for the main application at port 8081 and will connect to DHIS 2 instance http://localhost:8080.
Now in your browser, go to `http://localhost:8081`.

Notes:

- Requests to DHIS2 will be transparently proxied (see `src/setupProxy.js`) from `http://localhost:8081/dhis2/path` to `http://localhost:8080/path` to avoid CORS and cross-domain problems.

- The optional environment variable `REACT_APP_DHIS2_AUTH=USERNAME:PASSWORD` forces some credentials to be used by the proxy. This variable is usually not set, so the app has the same user logged in at `REACT_APP_DHIS2_BASE_URL`.

- The optional environment variable `REACT_APP_PROXY_LOG_LEVEL` can be helpful to debug the proxyfied requests (accepts: "warn" | "debug" | "info" | "error" | "silent")

- Create a file `.env.local` (copy it from `.env`) to customize environment variables so you can simply run `yarn start`.

- [why-did-you-render](https://github.com/welldone-software/why-did-you-render) is installed, but it does not work when using standard react scripts (`yarn start`). Instead, use `yarn craco-start` to debug re-renders with WDYR. Note that hot reloading does not work out-of-the-box with [craco](https://github.com/gsoft-inc/craco).

### Customization of the development server:

Expand Down
8 changes: 3 additions & 5 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
module.exports = process.env.CYPRESS_E2E
? {}
: {
presets: ["@babel/typescript", ["babel-preset-react-app", { runtime: "automatic" }]],
};
module.exports = {
presets: ["@babel/typescript", ["babel-preset-react-app", { runtime: "automatic" }]],
};
30 changes: 30 additions & 0 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* Required for CRA 4, see https://github.com/welldone-software/why-did-you-render/issues/154#issuecomment-773905769 */

module.exports = {
babel: {
loaderOptions: babelLoaderOptions => {
const origBabelPresetCRAIndex = babelLoaderOptions.presets.findIndex(preset => {
return preset[0].includes("babel-preset-react-app");
});

const origBabelPresetCRA = babelLoaderOptions.presets[origBabelPresetCRAIndex];

babelLoaderOptions.presets[origBabelPresetCRAIndex] = function overridenPresetCRA(api, opts, env) {
const babelPresetCRAResult = require(origBabelPresetCRA[0])(api, origBabelPresetCRA[1], env);

babelPresetCRAResult.presets.forEach(preset => {
// detect @babel/preset-react with {development: true, runtime: 'automatic'}
const isReactPreset =
preset && preset[1] && preset[1].runtime === "automatic" && preset[1].development === true;
if (isReactPreset) {
preset[1].importSource = "@welldone-software/why-did-you-render";
}
});

return babelPresetCRAResult;
};

return babelLoaderOptions;
},
},
};
49 changes: 19 additions & 30 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2021-09-07T19:05:23.568Z\n"
"PO-Revision-Date: 2021-09-07T19:05:23.568Z\n"
"POT-Creation-Date: 2021-11-10T11:18:59.186Z\n"
"PO-Revision-Date: 2021-11-10T11:18:59.186Z\n"

msgid ""
"THIS NEW RELEASE INCLUDES SHARING SETTINGS PER INSTANCES. FOR THIS VERSION "
Expand Down Expand Up @@ -282,21 +282,17 @@ msgstr ""
msgid "Deleting History Notifications"
msgstr ""

msgid "Successfully deleted {{count}} history notifications"
msgid_plural "Successfully deleted {{count}} history notifications"
msgstr[0] ""
msgstr[1] ""
msgid "Successfully deleted {{total}} history notifications"
msgstr ""

msgid "Synchronization status"
msgstr ""

msgid "Delete History Notifications?"
msgstr ""

msgid "Are you sure you want to delete {{count}} history notifications?"
msgid_plural "Are you sure you want to delete {{count}} history notifications?"
msgstr[0] ""
msgstr[1] ""
msgid "Are you sure you want to delete {{total}} history notifications?"
msgstr ""

msgid "Ok"
msgstr ""
Expand Down Expand Up @@ -942,6 +938,9 @@ msgstr ""
msgid "Custodians for {{name}}"
msgstr ""

msgid "Scheduler"
msgstr ""

msgid "The token is empty"
msgstr ""

Expand Down Expand Up @@ -1609,10 +1608,8 @@ msgstr ""
msgid "Failed to delete some instances"
msgstr ""

msgid "Successfully deleted {{count}} instances"
msgid_plural "Successfully deleted {{count}} instances"
msgstr[0] ""
msgstr[1] ""
msgid "Successfully deleted {{total}} instances"
msgstr ""

msgid "Server name"
msgstr ""
Expand All @@ -1632,10 +1629,8 @@ msgstr ""
msgid "Delete Instances?"
msgstr ""

msgid "Are you sure you want to delete {{count}} instances?"
msgid_plural "Are you sure you want to delete {{count}} instances?"
msgstr[0] ""
msgstr[1] ""
msgid "Are you sure you want to delete {{total}} instances?"
msgstr ""

msgid "Instance Settings"
msgstr ""
Expand Down Expand Up @@ -1859,10 +1854,8 @@ msgstr ""
msgid "Delete Stores?"
msgstr ""

msgid "Are you sure you want to delete {{count}} stores?"
msgid_plural "Are you sure you want to delete {{count}} stores?"
msgstr[0] ""
msgstr[1] ""
msgid "Are you sure you want to delete {{total}} stores?"
msgstr ""

msgid "New {{type}} synchronization rule"
msgstr ""
Expand Down Expand Up @@ -1909,10 +1902,8 @@ msgstr ""
msgid "Deleting Sync Rules"
msgstr ""

msgid "Successfully deleted {{count}} rules"
msgid_plural "Successfully deleted {{count}} rules"
msgstr[0] ""
msgstr[1] ""
msgid "Successfully deleted {{total}} rules"
msgstr ""

msgid "Synchronizing {{name}}"
msgstr ""
Expand Down Expand Up @@ -1959,10 +1950,8 @@ msgstr ""
msgid "Delete Rules?"
msgstr ""

msgid "Are you sure you want to delete {{count}} rules?"
msgid_plural "Are you sure you want to delete {{count}} rules?"
msgstr[0] ""
msgstr[1] ""
msgid "Are you sure you want to delete {{total}} rules?"
msgstr ""

msgid "Synchronization History"
msgstr ""
Expand Down
Loading

0 comments on commit a99ab73

Please sign in to comment.