Skip to content

Commit

Permalink
Merge pull request #59 from EyeSeeTea/development
Browse files Browse the repository at this point in the history
MAL Data Approval report & App
  • Loading branch information
ifoche authored Sep 27, 2022
2 parents 6d95ec6 + 1f7f198 commit f2ec66d
Show file tree
Hide file tree
Showing 137 changed files with 16,479 additions and 8,266 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
BROWSER=false
PORT=8081
SKIP_PREFLIGHT_CHECK=true
REACT_APP_DHIS2_BASE_URL=http://dev2.eyeseetea.com:8085/
REACT_APP_DHIS2_BASE_URL=https://dev.eyeseetea.com/play
REACT_APP_DHIS2_AUTH='admin:district'
REACT_APP_REPORT_VARIANT=admin
24 changes: 9 additions & 15 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
/** @format */

module.exports = {
extends: [
"react-app",
"prettier",
"eslint:recommended",
"plugin:react/recommended",
"plugin:cypress/recommended",
"plugin:@typescript-eslint/recommended",
"prettier/@typescript-eslint",
"plugin:prettier/recommended",
],
extends: ["react-app", "eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended"],
parser: "@typescript-eslint/parser",
rules: {
"no-console": "off",
"no-console": ["warn", { allow: ["debug", "warn", "error"] }],
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/explicit-function-return-type": ["off"],
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"unused-imports/no-unused-imports": "warn",
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"react/prop-types": "off",
"react/display-name": "off",
"react/react-in-jsx-scope": "off",
"no-unused-expressions": "off",
"no-useless-concat": "off",
"no-useless-constructor": "off",
Expand All @@ -35,15 +29,15 @@ module.exports = {
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/type-annotation-spacing": "off",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/explicit-function-return-type": "off",
"no-use-before-define": "off",
"no-debugger": "warn",
"no-extra-semi": "off",
"no-mixed-spaces-and-tabs": "off",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
plugins: ["cypress", "@typescript-eslint", "react-hooks"],
env: { "cypress/globals": true },
plugins: ["@typescript-eslint", "react-hooks", "unused-imports"],
settings: {
react: {
pragma: "React",
Expand Down
4 changes: 3 additions & 1 deletion .githooks/dep-check
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
function changed {
#!/bin/sh

changed () {
git diff --name-only HEAD@{1} HEAD | grep "^$1" > /dev/null 2>&1
}

Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# production
manifest.webapp
/build
*.zip

# misc
.DS_Store
Expand All @@ -29,10 +30,6 @@ src/react-app.d.ts
src/react-app-env.d.ts
dist

# cypress
cypress/screenshots/
cypress/videos/

# IntelliJ
.idea/*

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.14.0
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build
node_modules
*.min.js
*.min.css
10 changes: 5 additions & 5 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
/** @format */

module.exports = {
printWidth: 100,
printWidth: 120,
tabWidth: 4,
useTabs: false,
semi: true,
singleQuote: false,
trailingComma: 'es5',
trailingComma: "es5",
bracketSpacing: true,
jsxBracketSameLine: false,
arrowParens: 'avoid',
arrowParens: "avoid",
rangeStart: 0,
rangeEnd: Infinity,
proseWrap: 'preserve',
proseWrap: "preserve",
requirePragma: false,
insertPragma: false,
}
};
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ Create an standard report:

```
$ yarn build-report # Creates dist/index.html
$ yarn build-metadata -u 'user:pass' http://dhis2-server.org # Creates dist/metadata.json
$ yarn post-metadata -u 'user:pass' http://dhis2-server.org # Posts dist/metadata.json
$ yarn build-<key>-metadata -u 'user:pass' --url http://dhis2-server.org # Creates dist/metadata.json (key is a particular report group, e.g. nhwa)
$ yarn post-<key>-metadata -u 'user:pass' --url http://dhis2-server.org # Posts dist/metadata.json (key is a particular report group, e.g. nhwa)
```

Create an standalone DHIS2 webapp app:
Expand Down
6 changes: 3 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = process.env.CYPRESS_ENV ? {} : {
"presets": ["babel-preset-react-app"]
}
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;
},
},
};
4 changes: 0 additions & 4 deletions cypress.json

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/fixtures/example.json

This file was deleted.

18 changes: 0 additions & 18 deletions cypress/integration/example-page.spec.js

This file was deleted.

23 changes: 0 additions & 23 deletions cypress/plugins/index.js

This file was deleted.

97 changes: 0 additions & 97 deletions cypress/support/commands.js

This file was deleted.

18 changes: 0 additions & 18 deletions cypress/support/index.js

This file was deleted.

Loading

0 comments on commit f2ec66d

Please sign in to comment.