@openmrs/esm-fast-data-entry-app 1.0.0-pre.48 → 1.0.0-pre.51
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/.eslintrc.js +10 -0
- package/.husky/pre-push +1 -0
- package/README.md +4 -1
- package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +9 -9
- package/package.json +5 -4
- package/src/FormBootstrap.tsx +2 -2
- package/src/config-schema.ts +3 -3
- package/src/context/FormWorkflowContext.tsx +7 -7
- package/src/form-entry-workflow/FormEntryWorkflow.tsx +0 -4
- package/src/forms-app-menu-link.tsx +1 -0
- package/src/forms-page/FormsPage.tsx +1 -1
- package/src/hooks/useGetEncounter.ts +1 -2
- package/src/patient-card/PatientCard.tsx +2 -2
- package/src/workflow-review/WorkflowReview.tsx +0 -1
- package/.eslintrc +0 -4
package/.eslintrc.js
ADDED
package/.husky/pre-push
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yarn verify
|
package/README.md
CHANGED
|
@@ -14,8 +14,11 @@ The Forms page lists all forms able to be seen by a user, filtered by that user'
|
|
|
14
14
|
Forms can be entered quickly with the Form Entry Workflow. This workflow depends on a state machine managed by the [FormWorkflowReducer](src/context/FormWorkflowReducer.ts).
|
|
15
15
|
|
|
16
16
|
See the video below of a normal workflow.
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
https://user-images.githubusercontent.com/5445264/181378774-341b2a2f-3ecc-4052-b960-d61ba07980fb.mov
|
|
19
|
+
|
|
18
20
|
State diagram for the Form Workflow.
|
|
21
|
+
|
|
19
22
|

|
|
20
23
|
|
|
21
24
|
## Running this code
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
"initial": false,
|
|
6
6
|
"entry": false,
|
|
7
7
|
"recorded": false,
|
|
8
|
-
"size":
|
|
8
|
+
"size": 94054,
|
|
9
9
|
"sizes": {
|
|
10
|
-
"javascript":
|
|
10
|
+
"javascript": 94054
|
|
11
11
|
},
|
|
12
12
|
"names": [],
|
|
13
13
|
"idHints": [],
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"61.js"
|
|
19
19
|
],
|
|
20
20
|
"auxiliaryFiles": [],
|
|
21
|
-
"hash": "
|
|
21
|
+
"hash": "6d75057e80778c7da82c",
|
|
22
22
|
"childrenByOrder": {}
|
|
23
23
|
},
|
|
24
24
|
{
|
|
@@ -275,9 +275,9 @@
|
|
|
275
275
|
"initial": false,
|
|
276
276
|
"entry": false,
|
|
277
277
|
"recorded": false,
|
|
278
|
-
"size":
|
|
278
|
+
"size": 397,
|
|
279
279
|
"sizes": {
|
|
280
|
-
"javascript":
|
|
280
|
+
"javascript": 397
|
|
281
281
|
},
|
|
282
282
|
"names": [],
|
|
283
283
|
"idHints": [],
|
|
@@ -288,7 +288,7 @@
|
|
|
288
288
|
"776.js"
|
|
289
289
|
],
|
|
290
290
|
"auxiliaryFiles": [],
|
|
291
|
-
"hash": "
|
|
291
|
+
"hash": "272eaf44225e70b8c5af",
|
|
292
292
|
"childrenByOrder": {}
|
|
293
293
|
},
|
|
294
294
|
{
|
|
@@ -366,9 +366,9 @@
|
|
|
366
366
|
"initial": false,
|
|
367
367
|
"entry": false,
|
|
368
368
|
"recorded": false,
|
|
369
|
-
"size":
|
|
369
|
+
"size": 44083,
|
|
370
370
|
"sizes": {
|
|
371
|
-
"javascript":
|
|
371
|
+
"javascript": 44041,
|
|
372
372
|
"consume-shared": 42
|
|
373
373
|
},
|
|
374
374
|
"names": [],
|
|
@@ -380,7 +380,7 @@
|
|
|
380
380
|
"990.js"
|
|
381
381
|
],
|
|
382
382
|
"auxiliaryFiles": [],
|
|
383
|
-
"hash": "
|
|
383
|
+
"hash": "9693925128d586be8781",
|
|
384
384
|
"childrenByOrder": {}
|
|
385
385
|
}
|
|
386
386
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openmrs/esm-fast-data-entry-app",
|
|
3
|
-
"version": "1.0.0-pre.
|
|
3
|
+
"version": "1.0.0-pre.51",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "An OpenMRS 3.x microfrontend",
|
|
6
6
|
"browser": "dist/openmrs-esm-fast-data-entry-app.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"serve": "webpack serve --mode=development",
|
|
12
12
|
"build": "webpack --mode production",
|
|
13
13
|
"analyze": "webpack --mode=production --env.analyze=true",
|
|
14
|
-
"lint": "eslint src --
|
|
14
|
+
"lint": "eslint \"src/**/*.ts\" \"src/**/*.tsx\" --fix --max-warnings=0 -c .eslintrc.js",
|
|
15
15
|
"prettier": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
16
16
|
"typescript": "tsc",
|
|
17
17
|
"test": "jest --config jest.config.json --passWithNoTests",
|
|
@@ -80,10 +80,11 @@
|
|
|
80
80
|
"babel-jest": "^27.0.2",
|
|
81
81
|
"babel-preset-minify": "^0.5.1",
|
|
82
82
|
"concurrently": "^6.2.0",
|
|
83
|
-
"eslint": "^
|
|
83
|
+
"eslint": "^8.20.0",
|
|
84
84
|
"eslint-config-prettier": "^8.3.0",
|
|
85
|
+
"eslint-config-react-app": "^7.0.1",
|
|
85
86
|
"eslint-config-ts-react-important-stuff": "^3.0.0",
|
|
86
|
-
"eslint-plugin-prettier": "^
|
|
87
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
87
88
|
"husky": "^8.0.1",
|
|
88
89
|
"identity-obj-proxy": "^3.0.0",
|
|
89
90
|
"jest": "^26.4.2",
|
package/src/FormBootstrap.tsx
CHANGED
|
@@ -69,7 +69,7 @@ export interface Observation {
|
|
|
69
69
|
display: string;
|
|
70
70
|
};
|
|
71
71
|
}>;
|
|
72
|
-
value:
|
|
72
|
+
value: unknown;
|
|
73
73
|
obsDatetime: string;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -131,7 +131,7 @@ const FormBootstrap = ({
|
|
|
131
131
|
patientUuid,
|
|
132
132
|
patient,
|
|
133
133
|
encounterUuid: encounterUuid ?? "",
|
|
134
|
-
closeWorkspace: () =>
|
|
134
|
+
closeWorkspace: () => undefined,
|
|
135
135
|
handlePostResponse,
|
|
136
136
|
showDiscardSubmitButtons: false,
|
|
137
137
|
}}
|
package/src/config-schema.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Type
|
|
1
|
+
import { Type } from "@openmrs/esm-framework";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This is the config schema.
|
|
@@ -68,11 +68,11 @@ export type Form = {
|
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
export type Category = {
|
|
71
|
-
name:
|
|
71
|
+
name: string;
|
|
72
72
|
forms: Array<Form>;
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
export type Config = {
|
|
76
76
|
formCategories: Array<Category>;
|
|
77
|
-
formCategoriesToShow: Array<
|
|
77
|
+
formCategoriesToShow: Array<string>;
|
|
78
78
|
};
|
|
@@ -12,13 +12,13 @@ const initialState = {
|
|
|
12
12
|
activeEncounterUuid: null,
|
|
13
13
|
encounters: {},
|
|
14
14
|
workflowState: null,
|
|
15
|
-
addPatient: (uuid: string | number) =>
|
|
16
|
-
openPatientSearch: () =>
|
|
17
|
-
saveEncounter: (encounterUuid: string | number) =>
|
|
18
|
-
editEncounter: (patientUuid: string | number) =>
|
|
19
|
-
submitForNext: () =>
|
|
20
|
-
submitForReview: () =>
|
|
21
|
-
goToReview: () =>
|
|
15
|
+
addPatient: (uuid: string | number) => undefined,
|
|
16
|
+
openPatientSearch: () => undefined,
|
|
17
|
+
saveEncounter: (encounterUuid: string | number) => undefined,
|
|
18
|
+
editEncounter: (patientUuid: string | number) => undefined,
|
|
19
|
+
submitForNext: () => undefined,
|
|
20
|
+
submitForReview: () => undefined,
|
|
21
|
+
goToReview: () => undefined,
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
const FormWorkflowContext = React.createContext(initialState);
|
|
@@ -17,10 +17,6 @@ import FormWorkflowContext, {
|
|
|
17
17
|
} from "../context/FormWorkflowContext";
|
|
18
18
|
import WorkflowReview from "../workflow-review";
|
|
19
19
|
|
|
20
|
-
interface ParamTypes {
|
|
21
|
-
formUuid: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
const formStore = getGlobalStore("ampath-form-state");
|
|
25
21
|
|
|
26
22
|
const WorkflowNavigationButtons = () => {
|
|
@@ -5,6 +5,7 @@ import { ConfigurableLink } from "@openmrs/esm-framework";
|
|
|
5
5
|
export default function OfflineToolsAppMenuLink() {
|
|
6
6
|
const { t } = useTranslation();
|
|
7
7
|
return (
|
|
8
|
+
// eslint-disable-next-line
|
|
8
9
|
<ConfigurableLink to="${openmrsSpaBase}/forms">
|
|
9
10
|
{t("formsAppMenuLink", "Forms")}
|
|
10
11
|
</ConfigurableLink>
|
|
@@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
|
|
|
10
10
|
// helper function useful for debugging
|
|
11
11
|
// given a list of forms, it will organize into permissions
|
|
12
12
|
// and list which forms are associated with that permission
|
|
13
|
-
const getFormPermissions = (forms) => {
|
|
13
|
+
export const getFormPermissions = (forms) => {
|
|
14
14
|
const output = {};
|
|
15
15
|
forms?.forEach(
|
|
16
16
|
(form) =>
|
|
@@ -8,7 +8,7 @@ const CardContainer = ({ active, onClick, children }) => {
|
|
|
8
8
|
return (
|
|
9
9
|
<div
|
|
10
10
|
className={`${styles.cardContainer} ${!active && styles.inactiveCard}`}
|
|
11
|
-
onClick={active ? onClick : () =>
|
|
11
|
+
onClick={active ? onClick : () => undefined}
|
|
12
12
|
role="button"
|
|
13
13
|
tabIndex={0}
|
|
14
14
|
>
|
|
@@ -26,7 +26,7 @@ const PatientCard = ({ patientUuid }) => {
|
|
|
26
26
|
|
|
27
27
|
if (!patient) {
|
|
28
28
|
return (
|
|
29
|
-
<CardContainer onClick={() =>
|
|
29
|
+
<CardContainer onClick={() => undefined} active={true}>
|
|
30
30
|
<SkeletonText className={styles.skeletonText} />
|
|
31
31
|
</CardContainer>
|
|
32
32
|
);
|
|
@@ -3,7 +3,6 @@ import React, { useContext } from "react";
|
|
|
3
3
|
import { useHistory } from "react-router-dom";
|
|
4
4
|
import FormWorkflowContext from "../context/FormWorkflowContext";
|
|
5
5
|
import FormReviewCard from "../form-review-card";
|
|
6
|
-
import PatientCard from "../patient-card";
|
|
7
6
|
import styles from "./styles.scss";
|
|
8
7
|
|
|
9
8
|
const WorkflowReview = () => {
|
package/.eslintrc
DELETED