-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
519 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/build/** | ||
tailwind.css | ||
/src/locales/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
{ | ||
"parserOptions": { | ||
"ecmaVersion": "latest", | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"react", | ||
"react-hooks" | ||
], | ||
"extends": [ | ||
"airbnb", | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"env": { | ||
"browser": true, | ||
"es2021": true | ||
}, | ||
"globals": { | ||
"cy": true, | ||
"before": true, | ||
"beforeEach": true, | ||
"describe": true, | ||
"document": true, | ||
"window": true, | ||
"it": true, | ||
"expect": true, | ||
"appPackage": true, | ||
"Cypress": true | ||
}, | ||
"settings": { | ||
"import/core-modules": ["@dhis2/d2-i18n", "react"], | ||
"import/resolver": { | ||
"node": { | ||
"extensions": [".js", ".jsx", ".ts", ".tsx"] | ||
} | ||
}, | ||
"import/ignore": [ | ||
"node_modules", | ||
".(json|css)$" | ||
] | ||
}, | ||
"rules": { | ||
"indent": [2, 4], | ||
"complexity": "off", | ||
"no-prototype-builtins": "off", | ||
"no-redeclare": "error", | ||
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }], | ||
"jsx-quotes": ["error", "prefer-single"], | ||
"no-console": ["error", { | ||
"allow": ["warn", "error"] | ||
}], | ||
"comma-dangle": [ | ||
"error", | ||
{ | ||
"arrays": "always-multiline", | ||
"objects": "always-multiline", | ||
"imports": "always-multiline", | ||
"exports": "always-multiline", | ||
"functions": "always-multiline" | ||
} | ||
], | ||
"no-multi-spaces": ["error", { "ignoreEOLComments": true }], | ||
"no-return-assign": ["error", "except-parens"], | ||
"react/jsx-indent": [1, 4], | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"implicit-arrow-linebreak": "off", | ||
"react/jsx-indent-props": [2, 4], | ||
"react/prefer-es6-class": [1, "always"], | ||
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }], | ||
"react/no-unused-prop-types": [2, { "skipShapeProps": true }], | ||
"react/forbid-prop-types": [0], | ||
"@typescript-eslint/no-unnecessary-type-constraint": "warn", | ||
"no-param-reassign": 0, | ||
"react/prop-types": 0, | ||
"import/prefer-default-export": 0, | ||
"react/prefer-stateless-function": 0, | ||
"no-unused-expressions": 0, | ||
"linebreak-style": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"react/jsx-no-bind": 0, | ||
"react/require-default-props": 0, | ||
"react/jsx-curly-brace-presence": 0, | ||
"react/function-component-definition": 0, | ||
"@typescript-eslint/no-empty-function": "off", | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": [ | ||
"**/*.test.js", | ||
"cypress/**", | ||
"cypress.config.ts" | ||
], | ||
"optionalDependencies": false, | ||
"peerDependencies": true | ||
} | ||
], | ||
"react/button-has-type": 0, | ||
"react/sort-comp": [ | ||
2, | ||
{ | ||
"order": [ | ||
"static-methods", | ||
"type-annotations", | ||
"lifecycle", | ||
"everything-else", | ||
"render" | ||
], | ||
"groups": { | ||
"lifecycle": [ | ||
"displayName", | ||
"propTypes", | ||
"contextTypes", | ||
"childContextTypes", | ||
"mixins", | ||
"statics", | ||
"defaultProps", | ||
"constructor", | ||
"getDefaultProps", | ||
"getInitialState", | ||
"state", | ||
"getChildContext", | ||
"UNSAFE_componentWillMount", | ||
"componentDidMount", | ||
"UNSAFE_componentWillReceiveProps", | ||
"shouldComponentUpdate", | ||
"UNSAFE_componentWillUpdate", | ||
"componentDidUpdate", | ||
"componentWillUnmount" | ||
] | ||
} | ||
} | ||
], | ||
"eol-last": ["error", "always"], | ||
"react-hooks/exhaustive-deps": "error", | ||
"object-curly-newline": [ | ||
"error", | ||
{ | ||
"ObjectExpression": { "multiline": true, "minProperties": 3 }, | ||
"ObjectPattern": { "multiline": true, "minProperties": 4 }, | ||
"ImportDeclaration": "never", | ||
"ExportDeclaration": { "multiline": true, "minProperties": 3 } | ||
} | ||
], | ||
"max-len": ["error", { "code": 120 }], | ||
"no-shadow": "off", | ||
"react/jsx-props-no-spreading": "off", | ||
"camelcase": "off", | ||
"import/extensions": ["error", "never"] | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 5 | ||
target-branch: master | ||
versioning-strategy: increase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: 'Capture Growth Chart: verify app' | ||
|
||
on: | ||
push: | ||
branches: | ||
|
||
env: | ||
NODE_VERSION: 18.x | ||
|
||
jobs: | ||
install_dependencies: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Install Dependencies | ||
if: steps.yarn-cache.outputs.cache-hit != 'true' | ||
run: yarn install --frozen-lockfile | ||
|
||
lint_code: | ||
runs-on: ubuntu-latest | ||
needs: install_dependencies | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Lint Code | ||
run: yarn lint | ||
|
||
typescript_check: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, '[skip ci]')" | ||
needs: install_dependencies | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- uses: actions/cache@v2 | ||
id: yarn-cache | ||
with: | ||
path: '**/node_modules' | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
|
||
- name: Typescript Check | ||
run: yarn tsc:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
const config = { | ||
type: 'app', | ||
|
||
entryPoints: { | ||
plugin: './src/Plugin.tsx' | ||
}, | ||
} | ||
entryPoints: { plugin: './src/Plugin.tsx' }, | ||
}; | ||
|
||
module.exports = config | ||
module.exports = config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
import React from 'react' | ||
import Plugin from "./Plugin"; | ||
import React from 'react'; | ||
import Plugin from './Plugin'; | ||
import './tailwind.css'; | ||
import './index.css'; | ||
|
||
const query = { | ||
me: { | ||
resource: 'me', | ||
}, | ||
} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const query = { me: { resource: 'me' } }; | ||
|
||
const MyApp = () => ( | ||
// eslint-disable-next-line react/jsx-filename-extension | ||
<div> | ||
<Plugin | ||
pluginSource={'http://localhost:3002/plugin.html'} | ||
/> | ||
</div> | ||
) | ||
); | ||
|
||
export default MyApp | ||
export default MyApp; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { GrowthChartBuilder } from './GrowthChartBuilder' | ||
export { useRangeTimePeriod } from './useRangeTimePeriod' | ||
export { useRangeTimePeriod } from './useRangeTimePeriod' |
7 changes: 4 additions & 3 deletions
7
src/Components/GrowthChart/GrowthChartBuilder/useRangeTimePeriod.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const useRangeTimePeriod = (start: number, end: number) => { | ||
return Array.from({ length: end - start + 1 }, (_, index) => start + index); | ||
}; | ||
export const useRangeTimePeriod = (start: number, end: number) => Array.from( | ||
{ length: end - start + 1 }, | ||
(_, index) => start + index, | ||
); |
Oops, something went wrong.