@openmrs/esm-fast-data-entry-app 1.0.1-pre.15 → 1.0.1-pre.154
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/README.md +21 -2
- package/dist/101.js +1 -0
- package/dist/101.js.map +1 -0
- package/dist/132.js +1 -0
- package/dist/143.js +1 -0
- package/dist/143.js.map +1 -0
- package/dist/188.js +1 -0
- package/dist/188.js.map +1 -0
- package/dist/197.js +1 -0
- package/dist/219.js +1 -0
- package/dist/219.js.map +1 -0
- package/dist/221.js +1 -0
- package/dist/221.js.map +1 -0
- package/dist/259.js +1 -0
- package/dist/259.js.map +1 -0
- package/dist/29.js +2 -0
- package/dist/29.js.LICENSE.txt +3 -0
- package/dist/29.js.map +1 -0
- package/dist/300.js +1 -0
- package/dist/31.js +2 -0
- package/dist/31.js.LICENSE.txt +30 -0
- package/dist/31.js.map +1 -0
- package/dist/326.js +1 -0
- package/dist/326.js.map +1 -0
- package/dist/335.js +1 -0
- package/dist/367.js +1 -0
- package/dist/367.js.map +1 -0
- package/dist/480.js +1 -0
- package/dist/491.js +1 -0
- package/dist/491.js.map +1 -0
- package/dist/540.js +2 -0
- package/dist/540.js.LICENSE.txt +9 -0
- package/dist/540.js.map +1 -0
- package/dist/55.js +1 -0
- package/dist/564.js +1 -0
- package/dist/564.js.map +1 -0
- package/dist/602.js +1 -0
- package/dist/602.js.map +1 -0
- package/dist/626.js +2 -0
- package/dist/626.js.LICENSE.txt +9 -0
- package/dist/626.js.map +1 -0
- package/dist/652.js +1 -0
- package/dist/685.js +1 -0
- package/dist/685.js.map +1 -0
- package/dist/773.js +2 -0
- package/dist/773.js.LICENSE.txt +32 -0
- package/dist/773.js.map +1 -0
- package/dist/91.js +1 -0
- package/dist/91.js.map +1 -0
- package/dist/961.js +2 -0
- package/dist/961.js.LICENSE.txt +19 -0
- package/dist/961.js.map +1 -0
- package/dist/99.js +1 -0
- package/dist/99.js.map +1 -0
- package/dist/main.js +1 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
- package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +811 -0
- package/dist/openmrs-esm-fast-data-entry-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.json +2 -1
- package/package.json +42 -37
- package/src/CancelModal.tsx +48 -0
- package/src/CompleteModal.tsx +46 -0
- package/src/FormBootstrap.tsx +30 -3
- package/src/add-group-modal/AddGroupModal.tsx +77 -52
- package/src/add-group-modal/styles.scss +7 -3
- package/src/config-schema.ts +57 -0
- package/src/context/FormWorkflowContext.tsx +13 -1
- package/src/context/FormWorkflowReducer.ts +13 -3
- package/src/context/GroupFormWorkflowContext.tsx +43 -6
- package/src/context/GroupFormWorkflowReducer.ts +154 -10
- package/src/declarations.d.ts +4 -0
- package/src/empty-state/styles.scss +14 -14
- package/src/form-entry-workflow/FormEntryWorkflow.tsx +74 -102
- package/src/form-entry-workflow/form-review-card/styles.scss +9 -11
- package/src/form-entry-workflow/patient-banner/styles.scss +11 -12
- package/src/form-entry-workflow/patient-search-header/PatientSearchHeader.tsx +2 -2
- package/src/form-entry-workflow/patient-search-header/styles.scss +13 -10
- package/src/form-entry-workflow/styles.scss +13 -14
- package/src/form-entry-workflow/workflow-review/WorkflowReview.tsx +5 -3
- package/src/form-entry-workflow/workflow-review/styles.scss +0 -4
- package/src/forms-page/FormsPage.tsx +10 -5
- package/src/forms-page/forms-table/FormsTable.tsx +11 -5
- package/src/forms-page/forms-table/styles.scss +4 -5
- package/src/forms-page/styles.scss +3 -5
- package/src/group-form-entry-workflow/GroupFormEntryWorkflow.tsx +12 -399
- package/src/group-form-entry-workflow/GroupSessionWorkspace.tsx +238 -0
- package/src/group-form-entry-workflow/SessionDetailsForm.tsx +177 -0
- package/src/group-form-entry-workflow/SessionMetaWorkspace.tsx +107 -0
- package/src/group-form-entry-workflow/attendance-table/AttendanceTable.tsx +144 -0
- package/src/group-form-entry-workflow/attendance-table/index.ts +1 -0
- package/src/group-form-entry-workflow/configurable-questions/ConfigurableQuestionsSection.tsx +47 -0
- package/src/group-form-entry-workflow/group-display-header/GroupDisplayHeader.tsx +1 -9
- package/src/group-form-entry-workflow/group-display-header/styles.scss +20 -20
- package/src/group-form-entry-workflow/group-search/CompactGroupSearch.tsx +1 -1
- package/src/group-form-entry-workflow/group-search/GroupSearch.tsx +1 -1
- package/src/group-form-entry-workflow/group-search/compact-group-result.scss +16 -17
- package/src/group-form-entry-workflow/group-search/compact-group-search.scss +7 -8
- package/src/group-form-entry-workflow/group-search/group-search.scss +20 -23
- package/src/group-form-entry-workflow/group-search-header/GroupSearchHeader.tsx +30 -6
- package/src/group-form-entry-workflow/group-search-header/styles.scss +8 -8
- package/src/group-form-entry-workflow/styles.scss +15 -17
- package/src/hooks/index.ts +8 -1
- package/src/hooks/useForm.ts +73 -0
- package/src/hooks/useGetAllForms.ts +3 -2
- package/src/hooks/useGetEncounter.ts +2 -2
- package/src/hooks/useGetPatient.ts +1 -1
- package/src/hooks/useGetPatients.ts +34 -0
- package/src/hooks/useGetSystemSetting.ts +38 -0
- package/src/hooks/usePostEndpoint.ts +10 -4
- package/src/hooks/useSearchEndpoint.ts +14 -8
- package/src/hooks/useStartVisit.ts +93 -0
- package/src/index.ts +13 -65
- package/src/patient-card/styles.scss +3 -4
- package/src/routes.json +24 -0
- package/src/types.ts +20 -0
- package/tools/i18next-parser.config.js +93 -0
- package/translations/am.json +75 -0
- package/translations/ar.json +75 -0
- package/translations/en.json +32 -11
- package/translations/es.json +75 -0
- package/translations/fr.json +75 -0
- package/translations/he.json +75 -0
- package/translations/km.json +75 -0
- package/turbo.json +18 -0
- package/.editorconfig +0 -12
- package/.eslintignore +0 -2
- package/.eslintrc.js +0 -10
- package/.husky/pre-push +0 -1
- package/.prettierignore +0 -14
- package/.tx/config +0 -9
- package/.yarn/plugins/@yarnpkg/plugin-version.cjs +0 -550
- package/.yarn/versions/c1451405.yml +0 -0
- package/src/declarations.d.tsx +0 -2
|
@@ -1,107 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
useStore,
|
|
5
|
-
} from "@openmrs/esm-framework";
|
|
6
|
-
import {
|
|
7
|
-
Button,
|
|
8
|
-
ComposedModal,
|
|
9
|
-
ModalBody,
|
|
10
|
-
ModalFooter,
|
|
11
|
-
ModalHeader,
|
|
12
|
-
} from "@carbon/react";
|
|
13
|
-
import React, { useContext, useState } from "react";
|
|
14
|
-
import { useNavigate } from "react-router-dom";
|
|
1
|
+
import { ExtensionSlot, useSession } from "@openmrs/esm-framework";
|
|
2
|
+
import { Button } from "@carbon/react";
|
|
3
|
+
import React, { useCallback, useContext, useEffect, useState } from "react";
|
|
15
4
|
import FormBootstrap from "../FormBootstrap";
|
|
16
5
|
import PatientCard from "../patient-card/PatientCard";
|
|
17
6
|
import styles from "./styles.scss";
|
|
18
7
|
import PatientSearchHeader from "./patient-search-header";
|
|
19
8
|
import { useTranslation } from "react-i18next";
|
|
9
|
+
import { v4 as uuid } from "uuid";
|
|
20
10
|
import FormWorkflowContext, {
|
|
21
11
|
FormWorkflowProvider,
|
|
22
12
|
} from "../context/FormWorkflowContext";
|
|
23
13
|
import WorkflowReview from "./workflow-review";
|
|
24
14
|
import PatientBanner from "./patient-banner";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const CancelModal = ({ open, setOpen }) => {
|
|
29
|
-
const { destroySession, closeSession } = useContext(FormWorkflowContext);
|
|
30
|
-
const { t } = useTranslation();
|
|
31
|
-
const navigate = useNavigate();
|
|
32
|
-
|
|
33
|
-
const discard = async () => {
|
|
34
|
-
await destroySession();
|
|
35
|
-
setOpen(false);
|
|
36
|
-
navigate("../");
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const saveAndClose = async () => {
|
|
40
|
-
await closeSession();
|
|
41
|
-
setOpen(false);
|
|
42
|
-
navigate("../");
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return (
|
|
46
|
-
<ComposedModal open={open}>
|
|
47
|
-
<ModalHeader>{t("areYouSure", "Are you sure?")}</ModalHeader>
|
|
48
|
-
<ModalBody>
|
|
49
|
-
{t(
|
|
50
|
-
"cancelExplanation",
|
|
51
|
-
"You will lose any unsaved changes on the current form. Do you want to discard the current session?"
|
|
52
|
-
)}
|
|
53
|
-
</ModalBody>
|
|
54
|
-
<ModalFooter>
|
|
55
|
-
<Button kind="secondary" onClick={() => setOpen(false)}>
|
|
56
|
-
{t("cancel", "Cancel")}
|
|
57
|
-
</Button>
|
|
58
|
-
<Button kind="danger" onClick={discard}>
|
|
59
|
-
{t("discard", "Discard")}
|
|
60
|
-
</Button>
|
|
61
|
-
<Button kind="primary" onClick={saveAndClose}>
|
|
62
|
-
{t("saveSession", "Save Session")}
|
|
63
|
-
</Button>
|
|
64
|
-
</ModalFooter>
|
|
65
|
-
</ComposedModal>
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const CompleteModal = ({ open, setOpen }) => {
|
|
70
|
-
const { submitForComplete } = useContext(FormWorkflowContext);
|
|
71
|
-
const { t } = useTranslation();
|
|
72
|
-
|
|
73
|
-
const completeSession = () => {
|
|
74
|
-
submitForComplete();
|
|
75
|
-
setOpen(false);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<ComposedModal open={open}>
|
|
80
|
-
<ModalHeader>{t("areYouSure", "Are you sure?")}</ModalHeader>
|
|
81
|
-
<ModalBody>
|
|
82
|
-
{t(
|
|
83
|
-
"saveExplanation",
|
|
84
|
-
"Do you want to save the current form and exit the workflow?"
|
|
85
|
-
)}
|
|
86
|
-
</ModalBody>
|
|
87
|
-
<ModalFooter>
|
|
88
|
-
<Button kind="secondary" onClick={() => setOpen(false)}>
|
|
89
|
-
{t("cancel", "Cancel")}
|
|
90
|
-
</Button>
|
|
91
|
-
<Button kind="primary" onClick={completeSession}>
|
|
92
|
-
{t("complete", "Complete")}
|
|
93
|
-
</Button>
|
|
94
|
-
</ModalFooter>
|
|
95
|
-
</ComposedModal>
|
|
96
|
-
);
|
|
97
|
-
};
|
|
15
|
+
import CompleteModal from "../CompleteModal";
|
|
16
|
+
import CancelModal from "../CancelModal";
|
|
17
|
+
import useStartVisit from "../hooks/useStartVisit";
|
|
98
18
|
|
|
99
19
|
const WorkflowNavigationButtons = () => {
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
const store = useStore(formStore);
|
|
103
|
-
const formState = store[activeFormUuid];
|
|
104
|
-
const navigationDisabled = formState !== "ready";
|
|
20
|
+
const context = useContext(FormWorkflowContext);
|
|
21
|
+
const { workflowState, destroySession } = context;
|
|
105
22
|
const [cancelModalOpen, setCancelModalOpen] = useState(false);
|
|
106
23
|
const [completeModalOpen, setCompleteModalOpen] = useState(false);
|
|
107
24
|
const { t } = useTranslation();
|
|
@@ -111,13 +28,6 @@ const WorkflowNavigationButtons = () => {
|
|
|
111
28
|
return (
|
|
112
29
|
<>
|
|
113
30
|
<div className={styles.rightPanelActionButtons}>
|
|
114
|
-
<Button
|
|
115
|
-
kind="primary"
|
|
116
|
-
onClick={() => submitForNext()}
|
|
117
|
-
disabled={navigationDisabled || workflowState === "NEW_PATIENT"}
|
|
118
|
-
>
|
|
119
|
-
{t("nextPatient", "Next Patient")}
|
|
120
|
-
</Button>
|
|
121
31
|
<Button
|
|
122
32
|
kind="secondary"
|
|
123
33
|
onClick={
|
|
@@ -132,8 +42,16 @@ const WorkflowNavigationButtons = () => {
|
|
|
132
42
|
{t("cancel", "Cancel")}
|
|
133
43
|
</Button>
|
|
134
44
|
</div>
|
|
135
|
-
<CancelModal
|
|
136
|
-
|
|
45
|
+
<CancelModal
|
|
46
|
+
open={cancelModalOpen}
|
|
47
|
+
setOpen={setCancelModalOpen}
|
|
48
|
+
context={context}
|
|
49
|
+
/>
|
|
50
|
+
<CompleteModal
|
|
51
|
+
open={completeModalOpen}
|
|
52
|
+
setOpen={setCompleteModalOpen}
|
|
53
|
+
context={context}
|
|
54
|
+
/>
|
|
137
55
|
</>
|
|
138
56
|
);
|
|
139
57
|
};
|
|
@@ -147,15 +65,68 @@ const FormWorkspace = () => {
|
|
|
147
65
|
activeFormUuid,
|
|
148
66
|
editEncounter,
|
|
149
67
|
encounters,
|
|
68
|
+
singleSessionVisitTypeUuid,
|
|
150
69
|
} = useContext(FormWorkflowContext);
|
|
151
70
|
const { t } = useTranslation();
|
|
152
71
|
|
|
72
|
+
const [encounter, setEncounter] = useState(null);
|
|
73
|
+
const [visit, setVisit] = useState(null);
|
|
74
|
+
const { sessionLocation } = useSession();
|
|
75
|
+
|
|
76
|
+
const { updateEncounter, success: visitSaveSuccess } = useStartVisit({
|
|
77
|
+
showSuccessNotification: false,
|
|
78
|
+
showErrorNotification: true,
|
|
79
|
+
});
|
|
80
|
+
|
|
153
81
|
const handlePostResponse = (encounter) => {
|
|
154
82
|
if (encounter && encounter.uuid) {
|
|
155
83
|
saveEncounter(encounter.uuid);
|
|
84
|
+
setEncounter(encounter);
|
|
156
85
|
}
|
|
157
86
|
};
|
|
158
87
|
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (encounter && visit) {
|
|
90
|
+
// Update encounter so that it belongs to the created visit
|
|
91
|
+
updateEncounter({ uuid: encounter.uuid, visit: visit.uuid });
|
|
92
|
+
}
|
|
93
|
+
}, [encounter, visit, updateEncounter]);
|
|
94
|
+
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (visitSaveSuccess) {
|
|
97
|
+
setVisit(visitSaveSuccess.data);
|
|
98
|
+
}
|
|
99
|
+
}, [visitSaveSuccess]);
|
|
100
|
+
|
|
101
|
+
const handleEncounterCreate = useCallback(
|
|
102
|
+
(payload) => {
|
|
103
|
+
payload.location = sessionLocation?.uuid;
|
|
104
|
+
payload.encounterDatetime = payload.encounterDatetime
|
|
105
|
+
? payload.encounterDatetime
|
|
106
|
+
: new Date().toISOString();
|
|
107
|
+
// Create a visit with the same date as the encounter being saved
|
|
108
|
+
const visitStartDatetime = new Date(payload.encounterDatetime);
|
|
109
|
+
const visitStopDatetime = new Date(payload.encounterDatetime);
|
|
110
|
+
const visitInfo = {
|
|
111
|
+
startDatetime: visitStartDatetime,
|
|
112
|
+
stopDatetime: visitStopDatetime,
|
|
113
|
+
uuid: uuid(),
|
|
114
|
+
patient: {
|
|
115
|
+
uuid: activePatientUuid,
|
|
116
|
+
},
|
|
117
|
+
location: {
|
|
118
|
+
uuid: sessionLocation?.uuid,
|
|
119
|
+
},
|
|
120
|
+
visitType: {
|
|
121
|
+
uuid: singleSessionVisitTypeUuid,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
payload.visit = visitInfo;
|
|
126
|
+
},
|
|
127
|
+
[activePatientUuid, singleSessionVisitTypeUuid, sessionLocation]
|
|
128
|
+
);
|
|
129
|
+
|
|
159
130
|
return (
|
|
160
131
|
<div className={styles.workspace}>
|
|
161
132
|
{!patientUuids.length && (
|
|
@@ -172,11 +143,12 @@ const FormWorkspace = () => {
|
|
|
172
143
|
{...{
|
|
173
144
|
formUuid: activeFormUuid,
|
|
174
145
|
handlePostResponse,
|
|
146
|
+
handleEncounterCreate,
|
|
175
147
|
}}
|
|
176
148
|
/>
|
|
177
149
|
</div>
|
|
178
150
|
<div className={styles.rightPanel}>
|
|
179
|
-
<h4>Forms filled</h4>
|
|
151
|
+
<h4>{t("formsFilled", "Forms filled")}</h4>
|
|
180
152
|
<div className={styles.patientCardsSection}>
|
|
181
153
|
{patientUuids.map((patientUuid) => (
|
|
182
154
|
<PatientCard
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
5
|
-
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
6
4
|
|
|
7
5
|
.formReviewCard {
|
|
8
|
-
background-color:
|
|
9
|
-
padding:
|
|
6
|
+
background-color: colors.$white-0;
|
|
7
|
+
padding: layout.$spacing-02;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
.formReviewCard :global(.cds--accordion) :global(.cds--accordion__item) {
|
|
@@ -16,17 +14,17 @@
|
|
|
16
14
|
.formReviewCard :global(.cds--accordion__title) {
|
|
17
15
|
display: flex;
|
|
18
16
|
align-items: baseline;
|
|
19
|
-
column-gap:
|
|
17
|
+
column-gap: layout.$spacing-05;
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.formReviewCard :global(.cds--accordion__content) {
|
|
23
|
-
padding:
|
|
21
|
+
padding: layout.$spacing-03;
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
.dataField {
|
|
27
25
|
@include type.type-style('code-02');
|
|
28
|
-
background-color:
|
|
29
|
-
padding:
|
|
26
|
+
background-color: colors.$gray-10;
|
|
27
|
+
padding: layout.$spacing-03;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
.displayName {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
5
4
|
|
|
6
5
|
.container {
|
|
7
|
-
height:
|
|
6
|
+
height: layout.$spacing-11;
|
|
8
7
|
display: flex;
|
|
9
8
|
align-items: center;
|
|
10
|
-
background-color:
|
|
11
|
-
border-top: 0.0125rem solid
|
|
12
|
-
border-bottom: 0.0125rem solid
|
|
13
|
-
padding: 0
|
|
9
|
+
background-color: colors.$white-0;
|
|
10
|
+
border-top: 0.0125rem solid colors.$gray-20;
|
|
11
|
+
border-bottom: 0.0125rem solid colors.$gray-20;
|
|
12
|
+
padding: 0 layout.$spacing-05;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.photoPlaceholder {
|
|
@@ -35,11 +34,11 @@
|
|
|
35
34
|
min-height: 2rem;
|
|
36
35
|
}
|
|
37
36
|
@include type.type-style('body-compact-02');
|
|
38
|
-
color:
|
|
37
|
+
color: colors.$gray-70;
|
|
39
38
|
column-gap: 0.8rem;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
41
|
.patientEditBtn {
|
|
43
|
-
color:
|
|
44
|
-
margin:
|
|
42
|
+
color: colors.$gray-100;
|
|
43
|
+
margin: layout.$spacing-03;
|
|
45
44
|
}
|
|
@@ -15,7 +15,7 @@ const PatientSearchHeader = () => {
|
|
|
15
15
|
const { addPatient, workflowState, activeFormUuid } =
|
|
16
16
|
useContext(FormWorkflowContext);
|
|
17
17
|
const handleSelectPatient = (patient) => {
|
|
18
|
-
addPatient(patient
|
|
18
|
+
addPatient(patient);
|
|
19
19
|
};
|
|
20
20
|
const { t } = useTranslation();
|
|
21
21
|
|
|
@@ -33,7 +33,7 @@ const PatientSearchHeader = () => {
|
|
|
33
33
|
<span className={styles.padded}>{t("nextPatient", "Next patient")}:</span>
|
|
34
34
|
<span className={styles.searchBarWrapper}>
|
|
35
35
|
<ExtensionSlot
|
|
36
|
-
|
|
36
|
+
name="patient-search-bar-slot"
|
|
37
37
|
state={{
|
|
38
38
|
selectPatientAction: handleSelectPatient,
|
|
39
39
|
buttonProps: {
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
@import '~@openmrs/esm-styleguide/src/vars';
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
5
4
|
|
|
6
5
|
.searchHeaderContainer {
|
|
7
|
-
height:
|
|
6
|
+
height: layout.$spacing-11;
|
|
8
7
|
display: flex;
|
|
9
8
|
align-items: center;
|
|
10
|
-
background-color:
|
|
11
|
-
border-top: 0.0125rem solid
|
|
12
|
-
border-bottom: 0.0125rem solid
|
|
13
|
-
padding: 0
|
|
9
|
+
background-color: colors.$white-0;
|
|
10
|
+
border-top: 0.0125rem solid colors.$gray-20;
|
|
11
|
+
border-bottom: 0.0125rem solid colors.$gray-20;
|
|
12
|
+
padding: 0 layout.$spacing-05;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.searchBarWrapper {
|
|
17
16
|
min-width: 35rem;
|
|
18
17
|
}
|
|
19
18
|
|
|
19
|
+
.searchBarWrapper > div button {
|
|
20
|
+
height: auto;
|
|
21
|
+
}
|
|
22
|
+
|
|
20
23
|
.padded {
|
|
21
|
-
padding:
|
|
24
|
+
padding: layout.$spacing-05;
|
|
22
25
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
@use '@carbon/styles/scss/spacing';
|
|
2
1
|
@use '@carbon/colors';
|
|
3
|
-
@use '@carbon/
|
|
4
|
-
@
|
|
5
|
-
|
|
2
|
+
@use '@carbon/layout';
|
|
3
|
+
@use '@carbon/type';
|
|
6
4
|
|
|
7
5
|
.breadcrumbsContainer > div > div > nav {
|
|
8
|
-
background-color:
|
|
9
|
-
padding:
|
|
10
|
-
height:
|
|
6
|
+
background-color: colors.$white-0;
|
|
7
|
+
padding: layout.$spacing-04 layout.$spacing-05;
|
|
8
|
+
height: layout.$spacing-08;
|
|
11
9
|
}
|
|
12
10
|
|
|
13
11
|
.workspaceWrapper {
|
|
@@ -20,22 +18,23 @@
|
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.selectPatientMessage {
|
|
23
|
-
@include type.type-style('
|
|
24
|
-
margin:
|
|
21
|
+
@include type.type-style('heading-03');
|
|
22
|
+
margin: layout.$spacing-07;
|
|
25
23
|
text-align: center;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
.formMainContent {
|
|
29
27
|
display: flex;
|
|
30
28
|
text-align: center;
|
|
31
|
-
margin-top:
|
|
32
|
-
column-gap:
|
|
29
|
+
margin-top: layout.$spacing-05;
|
|
30
|
+
column-gap: layout.$spacing-05;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
.formContainer {
|
|
36
34
|
flex-grow: 1;
|
|
37
35
|
max-height: calc(100vh - 14rem);
|
|
38
36
|
overflow-y: scroll;
|
|
37
|
+
text-align: left;
|
|
39
38
|
}
|
|
40
39
|
|
|
41
40
|
.formContainer :global(.cds--form-item) :global(.question-area) {
|
|
@@ -43,20 +42,20 @@
|
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
.rightPanel {
|
|
46
|
-
width: 13rem;
|
|
45
|
+
min-width: 13rem;
|
|
47
46
|
text-align: left;
|
|
48
47
|
overflow-y: scroll;
|
|
49
48
|
}
|
|
50
49
|
|
|
51
50
|
.patientCardsSection {
|
|
52
|
-
margin:
|
|
51
|
+
margin: layout.$spacing-05 0;
|
|
53
52
|
border-bottom: 1px solid colors.$gray-10;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
.rightPanelActionButtons {
|
|
57
56
|
display: flex;
|
|
58
57
|
flex-direction: column;
|
|
59
|
-
row-gap:
|
|
58
|
+
row-gap: layout.$spacing-03;
|
|
60
59
|
& button {
|
|
61
60
|
width: 100%;
|
|
62
61
|
text-decoration: "none";
|
|
@@ -4,21 +4,23 @@ import { useNavigate } from "react-router-dom";
|
|
|
4
4
|
import FormWorkflowContext from "../../context/FormWorkflowContext";
|
|
5
5
|
import FormReviewCard from "../form-review-card";
|
|
6
6
|
import styles from "./styles.scss";
|
|
7
|
+
import { useTranslation } from "react-i18next";
|
|
7
8
|
|
|
8
9
|
const WorkflowReview = () => {
|
|
9
10
|
const { patientUuids } = useContext(FormWorkflowContext);
|
|
11
|
+
const { t } = useTranslation();
|
|
10
12
|
const navigate = useNavigate();
|
|
11
13
|
return (
|
|
12
14
|
<div className={styles.workspaceWrapper}>
|
|
13
15
|
<div className={styles.workspace}>
|
|
14
16
|
<div className={styles.leftPanel}>
|
|
15
|
-
<h4>Review</h4>
|
|
17
|
+
<h4>{t("review", "Review")}</h4>
|
|
16
18
|
<div className={styles.navButtons}>
|
|
17
19
|
<Button kind="primary" onClick={() => navigate("/")}>
|
|
18
|
-
Save & Close
|
|
20
|
+
{t("save&close", "Save & Close")}
|
|
19
21
|
</Button>
|
|
20
22
|
<Button kind="tertiary" onClick={() => navigate("/")}>
|
|
21
|
-
Cancel
|
|
23
|
+
{t("cancel", "Cancel")}
|
|
22
24
|
</Button>
|
|
23
25
|
</div>
|
|
24
26
|
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { useConfig } from "@openmrs/esm-framework";
|
|
1
|
+
import { useConfig, useSession } from "@openmrs/esm-framework";
|
|
2
2
|
import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@carbon/react";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { Config } from "../config-schema";
|
|
4
|
+
import { type Config } from "../config-schema";
|
|
5
5
|
import { useGetAllForms } from "../hooks";
|
|
6
6
|
import FormsTable from "./forms-table";
|
|
7
7
|
import styles from "./styles.scss";
|
|
@@ -44,13 +44,18 @@ const prepareRowsForTable = (rawFormData) => {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
const FormsPage = () => {
|
|
47
|
-
const config = useConfig()
|
|
47
|
+
const config = useConfig();
|
|
48
48
|
const { t } = useTranslation();
|
|
49
49
|
const { formCategories, formCategoriesToShow } = config;
|
|
50
50
|
const { forms, isLoading, error } = useGetAllForms();
|
|
51
51
|
const cleanRows = prepareRowsForTable(forms);
|
|
52
|
-
const
|
|
53
|
-
const
|
|
52
|
+
const { user } = useSession();
|
|
53
|
+
const savedFormsData = localStorage.getItem(
|
|
54
|
+
fdeWorkflowStorageName + ":" + user?.uuid
|
|
55
|
+
);
|
|
56
|
+
const savedGroupFormsData = localStorage.getItem(
|
|
57
|
+
fdeGroupWorkflowStorageName + ":" + user?.uuid
|
|
58
|
+
);
|
|
54
59
|
const activeForms = [];
|
|
55
60
|
const activeGroupForms = [];
|
|
56
61
|
|
|
@@ -28,10 +28,11 @@ const FormsTable = ({
|
|
|
28
28
|
}) => {
|
|
29
29
|
const { t } = useTranslation();
|
|
30
30
|
|
|
31
|
-
const
|
|
31
|
+
const tableHeaders = [
|
|
32
32
|
{
|
|
33
33
|
key: "display",
|
|
34
34
|
header: t("formName", "Form Name"),
|
|
35
|
+
isSortable: true,
|
|
35
36
|
},
|
|
36
37
|
{
|
|
37
38
|
key: "actions",
|
|
@@ -43,7 +44,7 @@ const FormsTable = ({
|
|
|
43
44
|
},
|
|
44
45
|
];
|
|
45
46
|
|
|
46
|
-
const
|
|
47
|
+
const augmentedRows = rows?.map((row) => ({
|
|
47
48
|
...row,
|
|
48
49
|
actions: (
|
|
49
50
|
<Link to={`form/${row.uuid}`}>
|
|
@@ -70,7 +71,7 @@ const FormsTable = ({
|
|
|
70
71
|
/>
|
|
71
72
|
);
|
|
72
73
|
}
|
|
73
|
-
if (
|
|
74
|
+
if (augmentedRows.length === 0) {
|
|
74
75
|
return (
|
|
75
76
|
<EmptyState
|
|
76
77
|
headerTitle={t("noFormsFound", "No Forms To Show")}
|
|
@@ -82,7 +83,7 @@ const FormsTable = ({
|
|
|
82
83
|
);
|
|
83
84
|
}
|
|
84
85
|
return (
|
|
85
|
-
<DataTable rows={
|
|
86
|
+
<DataTable rows={augmentedRows} headers={tableHeaders}>
|
|
86
87
|
{({
|
|
87
88
|
rows,
|
|
88
89
|
headers,
|
|
@@ -104,7 +105,12 @@ const FormsTable = ({
|
|
|
104
105
|
<TableHead>
|
|
105
106
|
<TableRow>
|
|
106
107
|
{headers.map((header) => (
|
|
107
|
-
<TableHeader
|
|
108
|
+
<TableHeader
|
|
109
|
+
{...getHeaderProps({
|
|
110
|
+
header,
|
|
111
|
+
isSortable: header.isSortable,
|
|
112
|
+
})}
|
|
113
|
+
>
|
|
108
114
|
{header.header}
|
|
109
115
|
</TableHeader>
|
|
110
116
|
))}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
@
|
|
2
|
-
@
|
|
3
|
-
@import "~carbon-components/src/globals/scss/mixins";
|
|
1
|
+
@use '@carbon/colors';
|
|
2
|
+
@use '@carbon/layout';
|
|
4
3
|
|
|
5
4
|
.toolbarWrapper {
|
|
6
5
|
position: relative;
|
|
7
6
|
display: flex;
|
|
8
|
-
height:
|
|
7
|
+
height: layout.$spacing-09;
|
|
9
8
|
justify-content: flex-end;
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -15,6 +14,6 @@
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
.inactiveLink {
|
|
18
|
-
color:
|
|
17
|
+
color: colors.$gray-40;
|
|
19
18
|
cursor: not-allowed;
|
|
20
19
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
@use '@carbon/
|
|
2
|
-
// @use '@carbon/styles/scss/type';
|
|
3
|
-
// @import '~@openmrs/esm-styleguide/src/vars';
|
|
1
|
+
@use '@carbon/layout';
|
|
4
2
|
|
|
5
3
|
.mainContent {
|
|
6
|
-
padding:
|
|
4
|
+
padding: layout.$spacing-07;
|
|
7
5
|
}
|
|
8
6
|
|
|
9
7
|
.pageTitle {
|
|
10
|
-
margin-bottom:
|
|
8
|
+
margin-bottom: layout.$spacing-06;
|
|
11
9
|
}
|