@mherman22/esm-act-app 1.0.1-pre.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +12 -0
- package/.husky/pre-commit +7 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +14 -0
- package/.turbo.json +18 -0
- package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
- package/LICENSE +401 -0
- package/README.md +115 -0
- package/SECURITY.md +12 -0
- package/__mocks__/react-i18next.js +50 -0
- package/dist/117.js +1 -0
- package/dist/117.js.map +1 -0
- package/dist/131.css +1 -0
- package/dist/131.css.map +1 -0
- package/dist/131.js +1 -0
- package/dist/131.js.map +1 -0
- package/dist/197.js +1 -0
- package/dist/197.js.map +1 -0
- package/dist/237.js +1 -0
- package/dist/237.js.map +1 -0
- package/dist/29.js +1 -0
- package/dist/29.js.map +1 -0
- package/dist/338.css +1 -0
- package/dist/338.css.map +1 -0
- package/dist/338.js +1 -0
- package/dist/338.js.map +1 -0
- package/dist/362.js +1 -0
- package/dist/362.js.map +1 -0
- package/dist/379.js +1 -0
- package/dist/379.js.map +1 -0
- package/dist/410.js +1 -0
- package/dist/410.js.map +1 -0
- package/dist/430.css +1 -0
- package/dist/430.css.map +1 -0
- package/dist/430.js +1 -0
- package/dist/430.js.map +1 -0
- package/dist/450.css +1 -0
- package/dist/450.css.map +1 -0
- package/dist/450.js +1 -0
- package/dist/450.js.map +1 -0
- package/dist/517.js +1 -0
- package/dist/517.js.map +1 -0
- package/dist/538.js +1 -0
- package/dist/538.js.map +1 -0
- package/dist/578.js +1 -0
- package/dist/578.js.map +1 -0
- package/dist/638.js +1 -0
- package/dist/638.js.map +1 -0
- package/dist/708.css +1 -0
- package/dist/708.css.map +1 -0
- package/dist/708.js +1 -0
- package/dist/708.js.map +1 -0
- package/dist/749.js +1 -0
- package/dist/749.js.map +1 -0
- package/dist/823.css +1 -0
- package/dist/823.css.map +1 -0
- package/dist/823.js +1 -0
- package/dist/823.js.map +1 -0
- package/dist/898.js +1 -0
- package/dist/898.js.map +1 -0
- package/dist/943.js +1 -0
- package/dist/943.js.map +1 -0
- package/dist/957.css +1 -0
- package/dist/957.css.map +1 -0
- package/dist/957.js +43 -0
- package/dist/957.js.map +1 -0
- package/dist/977.js +1 -0
- package/dist/977.js.map +1 -0
- package/dist/98.js +1 -0
- package/dist/98.js.map +1 -0
- package/dist/997.js +1 -0
- package/dist/997.js.map +1 -0
- package/dist/999.js +6 -0
- package/dist/999.js.map +1 -0
- package/dist/mherman22-esm-act-app.js +3 -0
- package/dist/mherman22-esm-act-app.js.buildmanifest.json +781 -0
- package/dist/mherman22-esm-act-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/eslint.config.mjs +20 -0
- package/package.json +99 -0
- package/prettier.config.js +8 -0
- package/rspack.config.js +1 -0
- package/src/access/act-dashboard-link.component.tsx +16 -0
- package/src/access/screen-access.component.tsx +15 -0
- package/src/access/screen-access.test.tsx +81 -0
- package/src/access/sign-in.test-helper.ts +24 -0
- package/src/act-home/act-home-card.component.tsx +27 -0
- package/src/act-home/act-home-card.scss +25 -0
- package/src/act-home/act-home-dashboard-link.component.tsx +7 -0
- package/src/act-home/act-home-dashboard-link.test.tsx +32 -0
- package/src/act-home/act-home-dashboard.component.tsx +30 -0
- package/src/act-home/act-home-dashboard.test.tsx +43 -0
- package/src/act-home/act-home.meta.ts +8 -0
- package/src/act-home/act-home.scss +22 -0
- package/src/act-home/care-cascade.component.tsx +77 -0
- package/src/act-home/care-cascade.scss +42 -0
- package/src/act-home/care-cascade.test.tsx +128 -0
- package/src/act-home/quick-actions.component.tsx +32 -0
- package/src/act-home/quick-actions.scss +32 -0
- package/src/act-home/quick-actions.test.tsx +51 -0
- package/src/act-home/worklist-tiles.component.tsx +69 -0
- package/src/act-home/worklist-tiles.scss +50 -0
- package/src/act-home/worklist-tiles.test.tsx +133 -0
- package/src/config-schema.test.ts +83 -0
- package/src/config-schema.ts +129 -0
- package/src/declarations.d.ts +19 -0
- package/src/fetch-all.ts +20 -0
- package/src/flag-gaps/flag-gaps.resource.test.ts +57 -0
- package/src/flag-gaps/flag-gaps.resource.ts +69 -0
- package/src/flag-gaps/flag-gaps.scss +19 -0
- package/src/flag-gaps/flag-gaps.workspace.test.tsx +208 -0
- package/src/flag-gaps/flag-gaps.workspace.tsx +149 -0
- package/src/index.ts +33 -0
- package/src/registry/csv.ts +16 -0
- package/src/registry/registry-bpg.test.tsx +84 -0
- package/src/registry/registry-csv.test.tsx +100 -0
- package/src/registry/registry-dashboard-link.component.tsx +7 -0
- package/src/registry/registry-dashboard-link.test.tsx +32 -0
- package/src/registry/registry-filters.test.tsx +218 -0
- package/src/registry/registry-filters.ts +81 -0
- package/src/registry/registry-flags.test.tsx +67 -0
- package/src/registry/registry.component.tsx +255 -0
- package/src/registry/registry.fixture.ts +14 -0
- package/src/registry/registry.meta.ts +6 -0
- package/src/registry/registry.scss +41 -0
- package/src/registry/registry.test.tsx +147 -0
- package/src/reports/report-dataset.resource.test.tsx +189 -0
- package/src/reports/report-dataset.resource.ts +51 -0
- package/src/reports/report-date.test.ts +18 -0
- package/src/reports/report-date.ts +12 -0
- package/src/rhd-flags/rhd-flag-lists.resource.test.tsx +240 -0
- package/src/rhd-flags/rhd-flag-lists.resource.ts +88 -0
- package/src/routes.json +66 -0
- package/src/routes.test.ts +32 -0
- package/tools/i18next-parser.config.js +89 -0
- package/tools/setup-tests.ts +5 -0
- package/tools/update-openmrs-deps.mjs +42 -0
- package/translations/en.json +52 -0
- package/tsconfig.json +24 -0
- package/vitest.config.ts +21 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import routes from './routes.json';
|
|
4
|
+
import { actHomeDashboardMeta, actHomeWidgetsSlot } from './act-home/act-home.meta';
|
|
5
|
+
import { registryDashboardMeta } from './registry/registry.meta';
|
|
6
|
+
|
|
7
|
+
describe('routes.json', () => {
|
|
8
|
+
it('registers every component it names', () => {
|
|
9
|
+
const entry = readFileSync('src/index.ts', 'utf8');
|
|
10
|
+
const exported = [...entry.matchAll(/^export const (\w+) =/gm)].map(([, name]) => name);
|
|
11
|
+
const components = [...routes.extensions, ...routes.workspaces2].map((registration) => registration.component);
|
|
12
|
+
|
|
13
|
+
expect(components.filter((component) => !exported.includes(component))).toEqual([]);
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
it('adds ACT home to the home app under the name and slot its dashboard renders', () => {
|
|
17
|
+
const link = routes.extensions.find((extension) => extension.slot === 'homepage-dashboard-slot');
|
|
18
|
+
const dashboard = routes.extensions.find((extension) => extension.slot === actHomeDashboardMeta.slot);
|
|
19
|
+
|
|
20
|
+
expect(link.meta).toEqual(actHomeDashboardMeta);
|
|
21
|
+
expect(dashboard.component).toBe('actHomeDashboard');
|
|
22
|
+
expect(actHomeWidgetsSlot).not.toBe(actHomeDashboardMeta.slot);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('adds the registry to the home app under the name and slot its page renders', () => {
|
|
26
|
+
const link = routes.extensions.find((extension) => extension.component === 'registryDashboardLink');
|
|
27
|
+
const page = routes.extensions.find((extension) => extension.slot === registryDashboardMeta.slot);
|
|
28
|
+
|
|
29
|
+
expect(link.meta).toEqual(registryDashboardMeta);
|
|
30
|
+
expect(page.component).toBe('registryDashboard');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
contextSeparator: '_',
|
|
3
|
+
// Key separator used in your translation keys
|
|
4
|
+
|
|
5
|
+
createOldCatalogs: false,
|
|
6
|
+
// Save the \_old files
|
|
7
|
+
|
|
8
|
+
defaultNamespace: 'translations',
|
|
9
|
+
// Default namespace used in your i18next config
|
|
10
|
+
|
|
11
|
+
defaultValue: '',
|
|
12
|
+
// Default value to give to empty keys
|
|
13
|
+
// You may also specify a function accepting the locale, namespace, and key as arguments
|
|
14
|
+
|
|
15
|
+
indentation: 2,
|
|
16
|
+
// Indentation of the catalog files
|
|
17
|
+
|
|
18
|
+
keepRemoved: false,
|
|
19
|
+
// Keep keys from the catalog that are no longer in code
|
|
20
|
+
|
|
21
|
+
keySeparator: '.',
|
|
22
|
+
// Key separator used in your translation keys
|
|
23
|
+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
|
24
|
+
|
|
25
|
+
// see below for more details
|
|
26
|
+
lexers: {
|
|
27
|
+
hbs: ['HandlebarsLexer'],
|
|
28
|
+
handlebars: ['HandlebarsLexer'],
|
|
29
|
+
|
|
30
|
+
htm: ['HTMLLexer'],
|
|
31
|
+
html: ['HTMLLexer'],
|
|
32
|
+
|
|
33
|
+
mjs: ['JavascriptLexer'],
|
|
34
|
+
js: ['JavascriptLexer'], // if you're writing jsx inside .js files, change this to JsxLexer
|
|
35
|
+
ts: ['JavascriptLexer'],
|
|
36
|
+
jsx: ['JsxLexer'],
|
|
37
|
+
tsx: ['JsxLexer'],
|
|
38
|
+
|
|
39
|
+
default: ['JavascriptLexer'],
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
lineEnding: 'auto',
|
|
43
|
+
// Control the line ending. See options at https://github.com/ryanve/eol
|
|
44
|
+
|
|
45
|
+
locales: ['en'],
|
|
46
|
+
// An array of the locales in your applications
|
|
47
|
+
|
|
48
|
+
namespaceSeparator: ':',
|
|
49
|
+
// Namespace separator used in your translation keys
|
|
50
|
+
// If you want to use plain english keys, separators such as `.` and `:` will conflict. You might want to set `keySeparator: false` and `namespaceSeparator: false`. That way, `t('Status: Loading...')` will not think that there are a namespace and three separator dots for instance.
|
|
51
|
+
|
|
52
|
+
output: '$NAMESPACE/$LOCALE.json',
|
|
53
|
+
// Supports $LOCALE and $NAMESPACE injection
|
|
54
|
+
// Supports JSON (.json) and YAML (.yml) file formats
|
|
55
|
+
// Where to write the locale files relative to process.cwd()
|
|
56
|
+
|
|
57
|
+
pluralSeparator: '_',
|
|
58
|
+
// Plural separator used in your translation keys
|
|
59
|
+
// If you want to use plain english keys, separators such as `_` might conflict. You might want to set `pluralSeparator` to a different string that does not occur in your keys.
|
|
60
|
+
|
|
61
|
+
input: undefined,
|
|
62
|
+
// An array of globs that describe where to look for source files
|
|
63
|
+
// relative to the location of the configuration file
|
|
64
|
+
|
|
65
|
+
sort: true,
|
|
66
|
+
// Whether or not to sort the catalog
|
|
67
|
+
|
|
68
|
+
useKeysAsDefaultValue: false,
|
|
69
|
+
// Whether to use the keys as the default value; ex. "Hello": "Hello", "World": "World"
|
|
70
|
+
// This option takes precedence over the `defaultValue` and `skipDefaultValues` options
|
|
71
|
+
// You may also specify a function accepting the locale and namespace as arguments
|
|
72
|
+
|
|
73
|
+
verbose: false,
|
|
74
|
+
// Display info about the parsing including some stats
|
|
75
|
+
|
|
76
|
+
failOnWarnings: false,
|
|
77
|
+
// Exit with an exit code of 1 on warnings
|
|
78
|
+
|
|
79
|
+
customValueTemplate: null,
|
|
80
|
+
// If you wish to customize the value output the value as an object, you can set your own format.
|
|
81
|
+
// ${defaultValue} is the default value you set in your translation function.
|
|
82
|
+
// Any other custom property will be automatically extracted.
|
|
83
|
+
//
|
|
84
|
+
// Example:
|
|
85
|
+
// {
|
|
86
|
+
// message: "${defaultValue}",
|
|
87
|
+
// description: "${maxLength}", // t('my-key', {maxLength: 150})
|
|
88
|
+
// }
|
|
89
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
|
|
3
|
+
try {
|
|
4
|
+
execSync(`yarn up --fixed '@openmrs/esm-framework@next' '@openmrs/esm-styleguide@next' 'openmrs@next'`, {
|
|
5
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
6
|
+
windowsHide: true,
|
|
7
|
+
});
|
|
8
|
+
} catch (error) {
|
|
9
|
+
console.error(`Error while updating dependencies: ${error.message ?? error}`);
|
|
10
|
+
process.exit(1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
execSync(`yarn dedupe`, {
|
|
15
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
16
|
+
windowsHide: true,
|
|
17
|
+
});
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error(`Error while deduplicating dependencies: ${error.message ?? error}`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
execSync(`git diff-index --quiet HEAD --`, {
|
|
25
|
+
stdio: 'ignore',
|
|
26
|
+
windowsHide: true,
|
|
27
|
+
});
|
|
28
|
+
process.exit(0);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
// git diff-index --quite HEAD --
|
|
31
|
+
// exits with status 1 if there are changes; we only need to run yarn verify if there are changes
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
try {
|
|
35
|
+
execSync(`yarn verify`, {
|
|
36
|
+
stdio: ['ignore', 'inherit', 'inherit'],
|
|
37
|
+
windowsHide: true,
|
|
38
|
+
});
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.error(`Error while running yarn verify: ${error.message ?? error}. Updates require manual intervention.`);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"actHome": "ACT home",
|
|
3
|
+
"actId": "ACT ID",
|
|
4
|
+
"actions": "Actions",
|
|
5
|
+
"adherence": "Adherence",
|
|
6
|
+
"age": "Age",
|
|
7
|
+
"all": "All",
|
|
8
|
+
"allLists": "All lists",
|
|
9
|
+
"bpgStatus": "BPG status",
|
|
10
|
+
"cardiacClinic": "Cardiac clinic",
|
|
11
|
+
"careCascade": "Care cascade",
|
|
12
|
+
"cascadeReportDate": "Report date: {{date}}",
|
|
13
|
+
"categoryAtDiagnosis": "Category at diagnosis",
|
|
14
|
+
"couldNotLoadCareCascade": "Could not load the care cascade",
|
|
15
|
+
"couldNotLoadGaps": "Could not load the missing data",
|
|
16
|
+
"couldNotLoadRegistry": "Could not load the registry",
|
|
17
|
+
"couldNotLoadWorklists": "Could not load the worklists",
|
|
18
|
+
"couldNotOpenForm": "Could not open the form",
|
|
19
|
+
"date": "Date",
|
|
20
|
+
"daysPending": "Days pending",
|
|
21
|
+
"diagnosisCategory": "Diagnosis category",
|
|
22
|
+
"downloadCsv": "Download CSV",
|
|
23
|
+
"enterProphylaxis": "Enter prophylaxis",
|
|
24
|
+
"findPatient": "Find a patient",
|
|
25
|
+
"flags": "Flags",
|
|
26
|
+
"form": "Form",
|
|
27
|
+
"missing": "Missing",
|
|
28
|
+
"missingData": "Missing data",
|
|
29
|
+
"name": "Name",
|
|
30
|
+
"nextConsultation": "Next consultation",
|
|
31
|
+
"noAccessToActHome": "You do not have access to ACT home.",
|
|
32
|
+
"noAccessToRegistry": "You do not have access to the registry.",
|
|
33
|
+
"noActHomeWidgets": "No widgets have been added to ACT home yet.",
|
|
34
|
+
"noCareCascadeData": "No care cascade data",
|
|
35
|
+
"noGapList": "This flag does not list its missing data.",
|
|
36
|
+
"noGapLists": "None of this patient's flags lists its missing data.",
|
|
37
|
+
"noRegistryMatches": "No patients match these filters.",
|
|
38
|
+
"noRegistryPatients": "No patients are enrolled in the registry.",
|
|
39
|
+
"noRhdFlagLists": "No RHD flag lists found",
|
|
40
|
+
"noSavedForm": "No saved form is waiting to be completed. Record the missing data on a new form.",
|
|
41
|
+
"openClinicalForms": "Open clinical forms",
|
|
42
|
+
"openForm": "Open form",
|
|
43
|
+
"primaryCareClinic": "Primary care clinic",
|
|
44
|
+
"prophylaxisRegimen": "Prophylaxis regimen",
|
|
45
|
+
"registerPatient": "Register patient",
|
|
46
|
+
"registry": "Registry",
|
|
47
|
+
"report": "Report",
|
|
48
|
+
"searchRegistry": "Search by name or ACT ID",
|
|
49
|
+
"sex": "Sex",
|
|
50
|
+
"status": "Status",
|
|
51
|
+
"worklists": "Worklists"
|
|
52
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"esModuleInterop": true,
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"allowSyntheticDefaultImports": true,
|
|
6
|
+
"jsx": "react",
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"lib": [
|
|
10
|
+
"dom",
|
|
11
|
+
"es5",
|
|
12
|
+
"scripthost",
|
|
13
|
+
"es2015",
|
|
14
|
+
"es2015.promise",
|
|
15
|
+
"es2016.array.include",
|
|
16
|
+
"es2018",
|
|
17
|
+
"es2020",
|
|
18
|
+
"es2022",
|
|
19
|
+
],
|
|
20
|
+
"resolveJsonModule": true,
|
|
21
|
+
"noEmit": true,
|
|
22
|
+
"target": "esnext"
|
|
23
|
+
}
|
|
24
|
+
}
|
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineConfig } from 'vitest/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
test: {
|
|
5
|
+
environment: 'happy-dom',
|
|
6
|
+
globals: true,
|
|
7
|
+
mockReset: true,
|
|
8
|
+
setupFiles: ['./tools/setup-tests.ts'],
|
|
9
|
+
exclude: ['**/node_modules/**', '**/e2e/**', '**/dist/**'],
|
|
10
|
+
server: {
|
|
11
|
+
deps: {
|
|
12
|
+
inline: [/@openmrs/],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
alias: {
|
|
16
|
+
'@openmrs/esm-framework/src/internal': '@openmrs/esm-framework/mock',
|
|
17
|
+
'@openmrs/esm-framework': '@openmrs/esm-framework/mock',
|
|
18
|
+
'react-i18next': new URL('./__mocks__/react-i18next.js', import.meta.url).pathname,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|