@pih/esm-referrals-queue-app 1.0.5 → 2.0.0-pre.10
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 +2 -1
- package/.eslintignore +2 -1
- package/.eslintrc +1 -2
- package/.github/workflows/node.js.yml +17 -17
- package/.husky/pre-commit +7 -0
- package/.prettierignore +13 -3
- package/README.md +14 -3
- package/__mocks__/react-i18next.js +51 -0
- package/dist/132.js +1 -0
- package/dist/147.js +2 -0
- package/dist/147.js.LICENSE.txt +47 -0
- package/dist/281.js +1 -0
- package/dist/294.js +2 -0
- package/dist/294.js.LICENSE.txt +9 -0
- package/dist/574.js +1 -0
- package/dist/595.js +2 -0
- package/dist/595.js.LICENSE.txt +1 -0
- package/dist/879.js +2 -0
- package/dist/879.js.LICENSE.txt +21 -0
- package/dist/90.js +1 -0
- package/dist/main.js +1 -0
- package/dist/pih-esm-referrals-queue-app.js +1 -2
- package/dist/pih-esm-referrals-queue-app.js.buildmanifest.json +265 -0
- package/dist/pih-esm-referrals-queue-app.old +1 -0
- package/jest.config.json +19 -0
- package/package.json +68 -78
- package/src/config-schema.ts +63 -0
- package/src/constants.ts +3 -0
- package/src/declarations.d.tsx +1 -2
- package/src/index.ts +57 -53
- package/src/referrals-queue/referrals-queue.component.tsx +22 -17
- package/src/referrals-queue/{referrals-queue.resource.ts → referrals-queue.resource.tsx} +1 -1
- package/src/referrals-queue/referrals-queue.test.tsx +12 -11
- package/src/root.component.test.tsx +1 -1
- package/src/root.component.tsx +8 -5
- package/src/setup-tests.ts +24 -0
- package/src/table/table.component.tsx +5 -4
- package/src/util.ts +1 -3
- package/translations/en.json +2 -11
- package/tsconfig.json +3 -2
- package/webpack.config.js +1 -71
- package/.babelrc +0 -10
- package/.gitattributes +0 -1
- package/.tx/config +0 -10
- package/.vscode/launch.json +0 -35
- package/__mocks__/openmrs-esm-framework.mock.tsx +0 -64
- package/design-mockup.png +0 -0
- package/dist/1.pih-esm-referrals-queue-app.js +0 -297
- package/dist/1.pih-esm-referrals-queue-app.js.map +0 -1
- package/dist/2.pih-esm-referrals-queue-app.js +0 -2
- package/dist/2.pih-esm-referrals-queue-app.js.map +0 -1
- package/dist/3.pih-esm-referrals-queue-app.js +0 -2
- package/dist/3.pih-esm-referrals-queue-app.js.map +0 -1
- package/dist/4.pih-esm-referrals-queue-app.js +0 -2
- package/dist/4.pih-esm-referrals-queue-app.js.map +0 -1
- package/dist/5.pih-esm-referrals-queue-app.js +0 -2
- package/dist/5.pih-esm-referrals-queue-app.js.map +0 -1
- package/dist/pih-esm-referrals-queue-app.js.map +0 -1
- package/jest.config.js +0 -11
- package/src/set-public-path.ts +0 -3
- package/src/setup-tests.js +0 -13
- package/translations/es.json +0 -13
- package/translations/fr.json +0 -13
package/.editorconfig
CHANGED
package/.eslintignore
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
src/**/*.test.tsx
|
|
2
|
+
**/*.d.tsx
|
package/.eslintrc
CHANGED
|
@@ -2,16 +2,16 @@ name: Node.js CI
|
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
|
-
branches: [
|
|
5
|
+
branches: [main]
|
|
6
6
|
pull_request:
|
|
7
|
-
branches: [
|
|
7
|
+
branches: [main]
|
|
8
8
|
release:
|
|
9
9
|
types:
|
|
10
10
|
- created
|
|
11
11
|
|
|
12
12
|
env:
|
|
13
13
|
ESM_NAME: "@pih/esm-referrals-queue-app"
|
|
14
|
-
JS_NAME: "
|
|
14
|
+
JS_NAME: "esm-referrals-queue-app.js"
|
|
15
15
|
|
|
16
16
|
jobs:
|
|
17
17
|
build:
|
|
@@ -22,12 +22,12 @@ jobs:
|
|
|
22
22
|
- name: Use Node.js
|
|
23
23
|
uses: actions/setup-node@v1
|
|
24
24
|
with:
|
|
25
|
-
node-version: "
|
|
26
|
-
- run:
|
|
27
|
-
- run:
|
|
28
|
-
- run:
|
|
29
|
-
- run:
|
|
30
|
-
- run:
|
|
25
|
+
node-version: "16.x"
|
|
26
|
+
- run: yarn
|
|
27
|
+
- run: yarn lint
|
|
28
|
+
- run: yarn coverage
|
|
29
|
+
- run: yarn typescript
|
|
30
|
+
- run: yarn build
|
|
31
31
|
- name: Upload Artifacts
|
|
32
32
|
uses: actions/upload-artifact@v2
|
|
33
33
|
with:
|
|
@@ -49,11 +49,11 @@ jobs:
|
|
|
49
49
|
- name: Use Node.js
|
|
50
50
|
uses: actions/setup-node@v1
|
|
51
51
|
with:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- run:
|
|
52
|
+
node-version: "16.x"
|
|
53
|
+
registry-url: "https://registry.npmjs.org"
|
|
54
|
+
- run: yarn install
|
|
55
55
|
- run: sed -i -e "s/\(\"version\":\\s\+\"\([0-9]\+\.\?\)\+\)/\1-pre.${{ github.run_number }}/" 'package.json'
|
|
56
|
-
- run:
|
|
56
|
+
- run: yarn publish --access public --tag next
|
|
57
57
|
env:
|
|
58
58
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
|
59
59
|
|
|
@@ -71,9 +71,9 @@ jobs:
|
|
|
71
71
|
- name: Use Node.js
|
|
72
72
|
uses: actions/setup-node@v1
|
|
73
73
|
with:
|
|
74
|
-
node-version: "
|
|
75
|
-
registry-url:
|
|
76
|
-
- run:
|
|
77
|
-
- run:
|
|
74
|
+
node-version: "16.x"
|
|
75
|
+
registry-url: 'https://registry.npmjs.org'
|
|
76
|
+
- run: yarn
|
|
77
|
+
- run: yarn publish --access public
|
|
78
78
|
env:
|
|
79
79
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
|
package/.prettierignore
CHANGED
package/README.md
CHANGED
|
@@ -6,15 +6,26 @@ A page for viewing the J9 Home Visits from CommCare
|
|
|
6
6
|
|
|
7
7
|
## Design Notes
|
|
8
8
|
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-

|
|
9
|
+
*See from [PIH Confluence](https://pihemr.atlassian.net/wiki/spaces/DSS/pages/538116104/PIH+EMR+Referrals+Queue)*
|
|
12
10
|
|
|
13
11
|
There should be one row per referral in this list (not one per encounter). Some encounters may result in multiple referrals. See the Referral Type logic below.
|
|
14
12
|
|
|
15
13
|
Note that the basic referrals workflow would be for J9 clinicians/managers to view the list of referrals here, then take action upon them one by one by clicking on the “pending” referrals. This will bring them into editing the Home Visit form from which the referral came. From there they specify any action taken on the referral and navigate back to this list.
|
|
16
14
|
Check out the [design doc](https://pihemr.atlassian.net/wiki/spaces/DSS/pages/538116104/PIH+EMR+Referrals+Queue).
|
|
17
15
|
|
|
16
|
+
## Development
|
|
17
|
+
```sh
|
|
18
|
+
# to install dependencies
|
|
19
|
+
yarn
|
|
20
|
+
|
|
21
|
+
# will run against a local OpenMRS server at localhost:8080, serving the frontend from 8081
|
|
22
|
+
yarn start --backend "http://localhost:8080/" --port 8081
|
|
23
|
+
|
|
24
|
+
# run against HUM-CI, serving the frontend from 8080
|
|
25
|
+
yarn start --backend "http://humci.pih-emr.org/" --api-url /mirebalais/
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
|
|
18
29
|
|
|
19
30
|
## Configuration
|
|
20
31
|
<!-- GENERATED BY OPENMRS CONFIG CLI -->
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/** At present, this entire mock is boilerplate. */
|
|
2
|
+
|
|
3
|
+
const React = require('react');
|
|
4
|
+
const reactI18next = require('react-i18next');
|
|
5
|
+
|
|
6
|
+
const hasChildren = node => node && (node.children || (node.props && node.props.children));
|
|
7
|
+
|
|
8
|
+
const getChildren = node => (node && node.children ? node.children : node.props && node.props.children);
|
|
9
|
+
|
|
10
|
+
const renderNodes = reactNodes => {
|
|
11
|
+
if (typeof reactNodes === 'string') {
|
|
12
|
+
return reactNodes;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return Object.keys(reactNodes).map((key, i) => {
|
|
16
|
+
const child = reactNodes[key];
|
|
17
|
+
const isElement = React.isValidElement(child);
|
|
18
|
+
|
|
19
|
+
if (typeof child === 'string') {
|
|
20
|
+
return child;
|
|
21
|
+
}
|
|
22
|
+
if (hasChildren(child)) {
|
|
23
|
+
const inner = renderNodes(getChildren(child));
|
|
24
|
+
return React.cloneElement(child, { ...child.props, key: i }, inner);
|
|
25
|
+
}
|
|
26
|
+
if (typeof child === 'object' && !isElement) {
|
|
27
|
+
return Object.keys(child).reduce((str, childKey) => `${str}${child[childKey]}`, '');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return child;
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const useMock = [k => k, {}];
|
|
35
|
+
useMock.t = (k, o) => (o && o.defaultValue) || (typeof o === 'string' ? o : k);
|
|
36
|
+
useMock.i18n = {};
|
|
37
|
+
|
|
38
|
+
module.exports = {
|
|
39
|
+
// this mock makes sure any components using the translate HoC receive the t function as a prop
|
|
40
|
+
Trans: ({ children }) => renderNodes(children),
|
|
41
|
+
Translation: ({ children }) => children(k => k, { i18n: {} }),
|
|
42
|
+
useTranslation: () => useMock,
|
|
43
|
+
|
|
44
|
+
// mock if needed
|
|
45
|
+
I18nextProvider: reactI18next.I18nextProvider,
|
|
46
|
+
initReactI18next: reactI18next.initReactI18next,
|
|
47
|
+
setDefaults: reactI18next.setDefaults,
|
|
48
|
+
getDefaults: reactI18next.getDefaults,
|
|
49
|
+
setI18n: reactI18next.setI18n,
|
|
50
|
+
getI18n: reactI18next.getI18n,
|
|
51
|
+
};
|
package/dist/132.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_pih_esm_referrals_queue_app=self.webpackChunk_pih_esm_referrals_queue_app||[]).push([[132],{8132:(e,i,t)=>{"use strict";t.r(i),t.d(i,{backendDependencies:()=>p,importTranslation:()=>s,setupOpenMRS:()=>u,version:()=>n});var r=t(311),a={links:{patientDash:{_type:r.Type.String,_default:"${openmrsBase}/coreapps/clinicianfacing/patient.page?patientId=${patientUuid}&app=pih.app.clinicianDashboard",_validators:[r.validators.isUrlWithTemplateParameters(["patientUuid"])]},visitPage:{_type:r.Type.String,_default:"${openmrsBase}/pihcore/visit/visit.page?patient=${patientUuid}&visit=${visitUuid}&suppressActions=true#/overview",_validators:[r.validators.isUrlWithTemplateParameters(["patientUuid","visitUuid"])]},homeVisitForm:{_type:r.Type.String,_default:"${openmrsBase}/htmlformentryui/htmlform/editHtmlFormWithStandardUi.page?patientId=${patientUuid}&visitId=${visitUuid}&encounterId=${encounterUuid}&definitionUiResource=file:configuration/pih/htmlforms/section-mch-referral.xml&returnUrl=/mirebalais/spa/referrals-queue",_validators:[r.validators.isUrlWithTemplateParameters(["patientUuid","visitUuid","encounterUuid"])]}},pendingStatuses:{_type:r.Type.Array,_default:["Pending status","Referral unmet"],_elements:{_type:r.Type.String}}},n="2.0.0",s=t(3979),p={};function u(){var e="@pih/esm-referrals-queue-app",i={featureName:"referrals-queue",moduleName:e};return(0,r.defineConfigSchema)(e,a),(0,r.registerBreadcrumbs)([{path:"".concat(window.spaBase,"/referrals-queue"),title:"Referrals Queue"}]),{pages:[{load:(0,r.getAsyncLifecycle)((function(){return Promise.all([t.e(147),t.e(672),t.e(281)]).then(t.bind(t,4605))}),i),route:"referrals-queue"}]}}},3979:(e,i,t)=>{var r={"./en.json":[3574,574]};function a(e){if(!t.o(r,e))return Promise.resolve().then((()=>{var i=new Error("Cannot find module '"+e+"'");throw i.code="MODULE_NOT_FOUND",i}));var i=r[e],a=i[0];return t.e(i[1]).then((()=>t(a)))}a.keys=()=>Object.keys(r),a.id=3979,e.exports=a}}]);
|