@openmrs/esm-fast-data-entry-app 1.0.0-pre.59 → 1.0.0

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.
Files changed (193) hide show
  1. package/README.md +21 -2
  2. package/__mocks__/react-i18next.js +9 -14
  3. package/dist/101.js +1 -0
  4. package/dist/101.js.map +1 -0
  5. package/dist/132.js +1 -1
  6. package/dist/188.js +1 -0
  7. package/dist/188.js.map +1 -0
  8. package/dist/197.js +1 -0
  9. package/dist/219.js +1 -0
  10. package/dist/219.js.map +1 -0
  11. package/dist/221.js +1 -0
  12. package/dist/221.js.map +1 -0
  13. package/dist/259.js +1 -0
  14. package/dist/259.js.map +1 -0
  15. package/dist/29.js +2 -0
  16. package/dist/29.js.LICENSE.txt +3 -0
  17. package/dist/29.js.map +1 -0
  18. package/dist/300.js +1 -0
  19. package/dist/326.js +1 -0
  20. package/dist/326.js.map +1 -0
  21. package/dist/335.js +1 -0
  22. package/dist/367.js +1 -0
  23. package/dist/367.js.map +1 -0
  24. package/dist/480.js +1 -0
  25. package/dist/540.js +2 -0
  26. package/dist/{536.js.LICENSE.txt → 540.js.LICENSE.txt} +3 -2
  27. package/dist/540.js.map +1 -0
  28. package/dist/55.js +1 -0
  29. package/dist/564.js +1 -0
  30. package/dist/564.js.map +1 -0
  31. package/dist/602.js +1 -0
  32. package/dist/602.js.map +1 -0
  33. package/dist/626.js +2 -0
  34. package/dist/{294.js.LICENSE.txt → 626.js.LICENSE.txt} +3 -8
  35. package/dist/626.js.map +1 -0
  36. package/dist/652.js +1 -0
  37. package/dist/685.js +1 -0
  38. package/dist/685.js.map +1 -0
  39. package/dist/773.js +2 -0
  40. package/dist/773.js.LICENSE.txt +32 -0
  41. package/dist/773.js.map +1 -0
  42. package/dist/893.js +1 -0
  43. package/dist/893.js.map +1 -0
  44. package/dist/91.js +1 -0
  45. package/dist/91.js.map +1 -0
  46. package/dist/941.js +2 -0
  47. package/dist/941.js.LICENSE.txt +30 -0
  48. package/dist/941.js.map +1 -0
  49. package/dist/961.js +2 -0
  50. package/dist/{935.js.LICENSE.txt → 961.js.LICENSE.txt} +6 -10
  51. package/dist/961.js.map +1 -0
  52. package/dist/99.js +1 -0
  53. package/dist/99.js.map +1 -0
  54. package/dist/991.js +1 -0
  55. package/dist/991.js.map +1 -0
  56. package/dist/main.js +1 -0
  57. package/dist/main.js.map +1 -0
  58. package/dist/openmrs-esm-fast-data-entry-app.js +1 -1
  59. package/dist/openmrs-esm-fast-data-entry-app.js.buildmanifest.json +500 -122
  60. package/dist/openmrs-esm-fast-data-entry-app.js.map +1 -0
  61. package/dist/routes.json +1 -0
  62. package/jest.config.json +21 -18
  63. package/package.json +59 -62
  64. package/prettier.config.js +8 -0
  65. package/src/CancelModal.tsx +42 -0
  66. package/src/CompleteModal.tsx +35 -0
  67. package/src/FormBootstrap.tsx +45 -10
  68. package/src/Root.tsx +11 -9
  69. package/src/add-group-modal/AddGroupModal.tsx +249 -0
  70. package/src/add-group-modal/styles.scss +49 -0
  71. package/src/config-schema.ts +77 -16
  72. package/src/constant.ts +1 -1
  73. package/src/context/FormWorkflowContext.tsx +32 -33
  74. package/src/context/FormWorkflowReducer.ts +53 -67
  75. package/src/context/GroupFormWorkflowContext.tsx +155 -0
  76. package/src/context/GroupFormWorkflowReducer.ts +405 -0
  77. package/src/declarations.d.ts +4 -0
  78. package/src/empty-state/EmptyDataIllustration.tsx +4 -16
  79. package/src/empty-state/EmptyState.tsx +16 -17
  80. package/src/empty-state/styles.scss +14 -14
  81. package/src/form-entry-workflow/FormEntryWorkflow.tsx +89 -125
  82. package/src/{form-review-card → form-entry-workflow/form-review-card}/FormReviewCard.tsx +7 -7
  83. package/src/form-entry-workflow/form-review-card/index.ts +3 -0
  84. package/src/form-entry-workflow/form-review-card/styles.scss +37 -0
  85. package/src/form-entry-workflow/index.ts +1 -1
  86. package/src/form-entry-workflow/patient-banner/PatientBanner.test.tsx +9 -0
  87. package/src/{patient-banner → form-entry-workflow/patient-banner}/PatientBanner.tsx +14 -27
  88. package/src/form-entry-workflow/patient-banner/index.ts +3 -0
  89. package/src/form-entry-workflow/patient-banner/styles.scss +44 -0
  90. package/src/form-entry-workflow/patient-search-header/PatientSearchHeader.tsx +54 -0
  91. package/src/form-entry-workflow/patient-search-header/index.ts +3 -0
  92. package/src/form-entry-workflow/patient-search-header/styles.scss +25 -0
  93. package/src/form-entry-workflow/styles.scss +16 -16
  94. package/src/form-entry-workflow/workflow-review/WorkflowReview.tsx +37 -0
  95. package/src/form-entry-workflow/workflow-review/index.ts +3 -0
  96. package/src/{workflow-review → form-entry-workflow/workflow-review}/styles.scss +0 -4
  97. package/src/forms-app-menu-link.tsx +5 -7
  98. package/src/forms-page/FormsPage.tsx +48 -37
  99. package/src/forms-page/forms-table/FormsTable.tsx +117 -0
  100. package/src/forms-page/forms-table/index.ts +3 -0
  101. package/src/forms-page/forms-table/styles.scss +19 -0
  102. package/src/forms-page/index.ts +1 -1
  103. package/src/forms-page/styles.scss +3 -5
  104. package/src/group-form-entry-workflow/GroupFormEntryWorkflow.tsx +26 -0
  105. package/src/group-form-entry-workflow/GroupSessionWorkspace.tsx +207 -0
  106. package/src/group-form-entry-workflow/SessionDetailsForm.tsx +154 -0
  107. package/src/group-form-entry-workflow/SessionMetaWorkspace.tsx +99 -0
  108. package/src/group-form-entry-workflow/attendance-table/AttendanceTable.tsx +130 -0
  109. package/src/group-form-entry-workflow/attendance-table/index.ts +1 -0
  110. package/src/group-form-entry-workflow/configurable-questions/ConfigurableQuestionsSection.tsx +41 -0
  111. package/src/group-form-entry-workflow/group-display-header/GroupDisplayHeader.test.tsx +9 -0
  112. package/src/group-form-entry-workflow/group-display-header/GroupDisplayHeader.tsx +55 -0
  113. package/src/group-form-entry-workflow/group-display-header/index.ts +3 -0
  114. package/src/group-form-entry-workflow/group-display-header/styles.scss +60 -0
  115. package/src/group-form-entry-workflow/group-search/CompactGroupResults.tsx +128 -0
  116. package/src/group-form-entry-workflow/group-search/CompactGroupSearch.tsx +66 -0
  117. package/src/group-form-entry-workflow/group-search/GroupSearch.tsx +134 -0
  118. package/src/group-form-entry-workflow/group-search/compact-group-result.scss +63 -0
  119. package/src/group-form-entry-workflow/group-search/compact-group-search.scss +34 -0
  120. package/src/group-form-entry-workflow/group-search/group-search.scss +93 -0
  121. package/src/group-form-entry-workflow/group-search-header/GroupSearchHeader.tsx +72 -0
  122. package/src/group-form-entry-workflow/group-search-header/index.ts +3 -0
  123. package/src/group-form-entry-workflow/group-search-header/styles.scss +20 -0
  124. package/src/group-form-entry-workflow/index.ts +3 -0
  125. package/src/group-form-entry-workflow/styles.scss +94 -0
  126. package/src/hooks/index.ts +7 -5
  127. package/src/hooks/useForm.ts +56 -0
  128. package/src/hooks/useFormState.ts +3 -3
  129. package/src/hooks/useGetAllForms.ts +7 -15
  130. package/src/hooks/useGetEncounter.ts +3 -3
  131. package/src/hooks/useGetPatient.ts +3 -3
  132. package/src/hooks/useGetPatients.ts +32 -0
  133. package/src/hooks/useGetSystemSetting.ts +36 -0
  134. package/src/hooks/useKeyPress.ts +31 -0
  135. package/src/hooks/usePostEndpoint.ts +76 -0
  136. package/src/hooks/useSearchEndpoint.ts +103 -0
  137. package/src/hooks/useStartVisit.ts +82 -0
  138. package/src/index.ts +12 -72
  139. package/src/patient-card/PatientCard.tsx +10 -20
  140. package/src/patient-card/index.ts +1 -1
  141. package/src/patient-card/styles.scss +8 -8
  142. package/src/routes.json +24 -0
  143. package/src/setup-tests.ts +1 -1
  144. package/src/types.ts +20 -0
  145. package/tools/i18next-parser.config.js +93 -0
  146. package/translations/am.json +75 -0
  147. package/translations/ar.json +75 -0
  148. package/translations/en.json +57 -2
  149. package/translations/es.json +75 -0
  150. package/translations/fr.json +75 -0
  151. package/translations/he.json +75 -0
  152. package/translations/km.json +75 -0
  153. package/turbo.json +18 -0
  154. package/webpack.config.js +1 -1
  155. package/.editorconfig +0 -12
  156. package/.eslintignore +0 -2
  157. package/.eslintrc.js +0 -10
  158. package/.github/pull_request_template.md +0 -18
  159. package/.github/workflows/node.js.yml +0 -121
  160. package/.husky/pre-push +0 -1
  161. package/.prettierignore +0 -14
  162. package/dist/187.js +0 -1
  163. package/dist/247.js +0 -1
  164. package/dist/294.js +0 -2
  165. package/dist/312.js +0 -1
  166. package/dist/412.js +0 -1
  167. package/dist/536.js +0 -2
  168. package/dist/574.js +0 -1
  169. package/dist/592.js +0 -1
  170. package/dist/595.js +0 -2
  171. package/dist/595.js.LICENSE.txt +0 -1
  172. package/dist/776.js +0 -1
  173. package/dist/804.js +0 -1
  174. package/dist/880.js +0 -2
  175. package/dist/880.js.LICENSE.txt +0 -20
  176. package/dist/906.js +0 -1
  177. package/dist/935.js +0 -2
  178. package/dist/990.js +0 -1
  179. package/dist/openmrs-esm-fast-data-entry-app.old +0 -1
  180. package/src/declarations.d.tsx +0 -2
  181. package/src/form-review-card/index.ts +0 -3
  182. package/src/form-review-card/styles.scss +0 -38
  183. package/src/forms-table/FormsTable.tsx +0 -123
  184. package/src/forms-table/index.ts +0 -3
  185. package/src/forms-table/styles.scss +0 -20
  186. package/src/patient-banner/PatientBanner.test.tsx +0 -9
  187. package/src/patient-banner/index.ts +0 -3
  188. package/src/patient-banner/styles.scss +0 -44
  189. package/src/patient-search-header/PatientSearchHeader.tsx +0 -61
  190. package/src/patient-search-header/index.ts +0 -3
  191. package/src/patient-search-header/styles.scss +0 -21
  192. package/src/workflow-review/WorkflowReview.tsx +0 -35
  193. package/src/workflow-review/index.ts +0 -3
@@ -1,44 +0,0 @@
1
- @import '~@openmrs/esm-styleguide/src/vars';
2
- @import '~carbon-components/src/globals/scss/vars';
3
- @import '~carbon-components/src/globals/scss/mixins';
4
-
5
- .container {
6
- height: $spacing-11;
7
- display: flex;
8
- align-items: center;
9
- background-color: $ui-02;
10
- border-top: 0.0125rem solid $ui-03;
11
- border-bottom: 0.0125rem solid $ui-03;
12
- padding: 0 $spacing-05;
13
- }
14
-
15
- .photoPlaceholder {
16
- height: 48px;
17
- width: 48px;
18
- }
19
-
20
- .patientName {
21
- @include carbon--type-style('productive-heading-03');
22
- font-weight: 600;
23
- }
24
-
25
- .patientInfoContent {
26
- width: 100%;
27
- margin-left: 1rem;
28
- }
29
-
30
- .patientInfoRow {
31
- display: flex;
32
- align-items: center;
33
- & > button {
34
- min-height: 2rem;
35
- }
36
- @include carbon--type-style('body-short-02');
37
- color: $text-02;
38
- column-gap: 0.8rem;
39
- }
40
-
41
- .patientEditBtn {
42
- color: $ui-05;
43
- margin: $spacing-03;
44
- }
@@ -1,61 +0,0 @@
1
- import { Add20, Close20 } from "@carbon/icons-react";
2
- import {
3
- ExtensionSlot,
4
- interpolateUrl,
5
- navigate,
6
- } from "@openmrs/esm-framework";
7
- import { Button } from "carbon-components-react";
8
- import React, { useContext } from "react";
9
- import { Link } from "react-router-dom";
10
- import FormWorkflowContext from "../context/FormWorkflowContext";
11
- import styles from "./styles.scss";
12
-
13
- const PatientSearchHeader = () => {
14
- const { addPatient, workflowState, activeFormUuid } =
15
- useContext(FormWorkflowContext);
16
- const handleSelectPatient = (uuid) => {
17
- addPatient(uuid);
18
- };
19
-
20
- if (workflowState !== "NEW_PATIENT") return null;
21
-
22
- const afterUrl = encodeURIComponent(
23
- `\${openmrsSpaBase}/forms/${activeFormUuid}?patientUuid=\${patientUuid}`
24
- );
25
- const patientRegistrationUrl = interpolateUrl(
26
- `\${openmrsSpaBase}/patient-registration?afterUrl=${afterUrl}`
27
- );
28
-
29
- return (
30
- <div className={styles.searchHeaderContainer}>
31
- <span className={styles.padded}>Next patient:</span>
32
- <span className={styles.searchBarWrapper}>
33
- <ExtensionSlot
34
- extensionSlotName="patient-search-bar-slot"
35
- state={{
36
- selectPatientAction: handleSelectPatient,
37
- buttonProps: {
38
- kind: "primary",
39
- },
40
- }}
41
- />
42
- </span>
43
- <span className={styles.padded}>or</span>
44
- <span>
45
- <Button onClick={() => navigate({ to: patientRegistrationUrl })}>
46
- Create new patient <Add20 />
47
- </Button>
48
- </span>
49
- <span style={{ flexGrow: 1 }} />
50
- <span>
51
- <Link to="">
52
- <Button kind="ghost">
53
- Cancel <Close20 />
54
- </Button>
55
- </Link>
56
- </span>
57
- </div>
58
- );
59
- };
60
-
61
- export default PatientSearchHeader;
@@ -1,3 +0,0 @@
1
- import PatientSearchHeader from "./PatientSearchHeader";
2
-
3
- export default PatientSearchHeader;
@@ -1,21 +0,0 @@
1
- @import "~@openmrs/esm-styleguide/src/vars";
2
- @import "~carbon-components/src/globals/scss/vars";
3
- @import "~carbon-components/src/globals/scss/mixins";
4
-
5
- .searchHeaderContainer {
6
- height: $spacing-11;
7
- display: flex;
8
- align-items: center;
9
- background-color: $ui-02;
10
- border-top: 0.0125rem solid $ui-03;
11
- border-bottom: 0.0125rem solid $ui-03;
12
- padding: 0 $spacing-05;
13
- }
14
-
15
- .searchBarWrapper {
16
- min-width: 35rem;
17
- }
18
-
19
- .padded {
20
- padding: $spacing-05;
21
- }
@@ -1,35 +0,0 @@
1
- import { Button } from "carbon-components-react";
2
- import React, { useContext } from "react";
3
- import { useHistory } from "react-router-dom";
4
- import FormWorkflowContext from "../context/FormWorkflowContext";
5
- import FormReviewCard from "../form-review-card";
6
- import styles from "./styles.scss";
7
-
8
- const WorkflowReview = () => {
9
- const { patientUuids } = useContext(FormWorkflowContext);
10
- const history = useHistory();
11
- return (
12
- <div className={styles.workspaceWrapper}>
13
- <div className={styles.workspace}>
14
- <div className={styles.leftPanel}>
15
- <h4>Review</h4>
16
- <div className={styles.navButtons}>
17
- <Button kind="primary" onClick={() => history.push("/")}>
18
- Save & Close
19
- </Button>
20
- <Button kind="tertiary" onClick={() => history.push("/")}>
21
- Cancel
22
- </Button>
23
- </div>
24
- </div>
25
- <div className={styles.formContainer}>
26
- {patientUuids.map((patientUuid) => (
27
- <FormReviewCard patientUuid={patientUuid} key={patientUuid} />
28
- ))}
29
- </div>
30
- </div>
31
- </div>
32
- );
33
- };
34
-
35
- export default WorkflowReview;
@@ -1,3 +0,0 @@
1
- import WorkflowReview from "./WorkflowReview";
2
-
3
- export default WorkflowReview;