@openmrs/esm-form-builder-app 2.5.1-pre.1042 → 2.5.1-pre.1049

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 (44) hide show
  1. package/dist/228.js +1 -1
  2. package/dist/228.js.map +1 -1
  3. package/dist/292.js +1 -1
  4. package/dist/292.js.map +1 -1
  5. package/dist/429.js +1 -1
  6. package/dist/429.js.map +1 -1
  7. package/dist/431.js +1 -1
  8. package/dist/431.js.map +1 -1
  9. package/dist/505.js +1 -1
  10. package/dist/505.js.map +1 -1
  11. package/dist/601.js +1 -1
  12. package/dist/601.js.map +1 -1
  13. package/dist/789.js +1 -1
  14. package/dist/789.js.map +1 -1
  15. package/dist/835.js +1 -1
  16. package/dist/835.js.map +1 -1
  17. package/dist/852.js +1 -1
  18. package/dist/852.js.map +1 -1
  19. package/dist/9.js +1 -1
  20. package/dist/9.js.map +1 -1
  21. package/dist/916.js +1 -1
  22. package/dist/916.js.map +1 -1
  23. package/dist/963.js +1 -1
  24. package/dist/963.js.map +1 -1
  25. package/dist/openmrs-esm-form-builder-app.js.buildmanifest.json +36 -36
  26. package/dist/routes.json +1 -1
  27. package/package.json +1 -1
  28. package/src/components/action-buttons/action-buttons.scss +1 -1
  29. package/src/components/action-buttons/unpublish-form.modal.tsx +2 -0
  30. package/src/components/dashboard/delete-form.scss +30 -0
  31. package/src/components/form-editor/form-editor.component.tsx +11 -8
  32. package/src/components/form-editor/restore-draft-schema.modal.tsx +6 -1
  33. package/src/components/interactive-builder/add-question.modal.tsx +10 -6
  34. package/src/components/interactive-builder/delete-page.modal.tsx +2 -0
  35. package/src/components/interactive-builder/delete-question.modal.tsx +2 -0
  36. package/src/components/interactive-builder/delete-section.modal.tsx +2 -0
  37. package/src/components/interactive-builder/edit-question.modal.tsx +4 -4
  38. package/src/components/interactive-builder/new-form.modal.tsx +6 -1
  39. package/src/components/interactive-builder/page.modal.tsx +6 -1
  40. package/src/components/interactive-builder/question-modal.scss +29 -0
  41. package/src/components/interactive-builder/section.modal.tsx +6 -1
  42. package/src/components/modals/save-form-modal.scss +30 -0
  43. package/src/components/modals/save-form.modal.tsx +2 -2
  44. package/src/components/modals.scss +29 -0
@@ -5,9 +5,9 @@
5
5
  "initial": false,
6
6
  "entry": false,
7
7
  "recorded": false,
8
- "size": 3346,
8
+ "size": 15067,
9
9
  "sizes": {
10
- "javascript": 3346
10
+ "javascript": 15067
11
11
  },
12
12
  "names": [],
13
13
  "idHints": [],
@@ -21,7 +21,7 @@
21
21
  "auxiliaryFiles": [
22
22
  "9.js.map"
23
23
  ],
24
- "hash": "de94f31efaa9d604",
24
+ "hash": "d6e677d6f78823b6",
25
25
  "childrenByOrder": {}
26
26
  },
27
27
  {
@@ -290,9 +290,9 @@
290
290
  "entry": false,
291
291
  "recorded": false,
292
292
  "reason": "reused as split chunk (cache group: default)",
293
- "size": 55614,
293
+ "size": 56551,
294
294
  "sizes": {
295
- "javascript": 55614
295
+ "javascript": 56551
296
296
  },
297
297
  "names": [],
298
298
  "idHints": [],
@@ -306,7 +306,7 @@
306
306
  "auxiliaryFiles": [
307
307
  "228.js.map"
308
308
  ],
309
- "hash": "f503f29bf8b2f1d6",
309
+ "hash": "2a315f8e00a7c014",
310
310
  "childrenByOrder": {}
311
311
  },
312
312
  {
@@ -341,9 +341,9 @@
341
341
  "initial": false,
342
342
  "entry": false,
343
343
  "recorded": false,
344
- "size": 1852,
344
+ "size": 13573,
345
345
  "sizes": {
346
- "javascript": 1852
346
+ "javascript": 13573
347
347
  },
348
348
  "names": [],
349
349
  "idHints": [],
@@ -357,7 +357,7 @@
357
357
  "auxiliaryFiles": [
358
358
  "292.js.map"
359
359
  ],
360
- "hash": "7908b68dc84142a0",
360
+ "hash": "90458660d6e443cd",
361
361
  "childrenByOrder": {}
362
362
  },
363
363
  {
@@ -485,9 +485,9 @@
485
485
  "initial": false,
486
486
  "entry": false,
487
487
  "recorded": false,
488
- "size": 1362,
488
+ "size": 13083,
489
489
  "sizes": {
490
- "javascript": 1362
490
+ "javascript": 13083
491
491
  },
492
492
  "names": [],
493
493
  "idHints": [],
@@ -501,7 +501,7 @@
501
501
  "auxiliaryFiles": [
502
502
  "429.js.map"
503
503
  ],
504
- "hash": "a5ddc22bae3f51f0",
504
+ "hash": "6ff7e4fd7740fe85",
505
505
  "childrenByOrder": {}
506
506
  },
507
507
  {
@@ -509,9 +509,9 @@
509
509
  "initial": false,
510
510
  "entry": false,
511
511
  "recorded": false,
512
- "size": 5949,
512
+ "size": 17670,
513
513
  "sizes": {
514
- "javascript": 5949
514
+ "javascript": 17670
515
515
  },
516
516
  "names": [],
517
517
  "idHints": [],
@@ -525,7 +525,7 @@
525
525
  "auxiliaryFiles": [
526
526
  "431.js.map"
527
527
  ],
528
- "hash": "a1439e7933261cba",
528
+ "hash": "6539be911ed92208",
529
529
  "childrenByOrder": {}
530
530
  },
531
531
  {
@@ -578,9 +578,9 @@
578
578
  "initial": false,
579
579
  "entry": false,
580
580
  "recorded": false,
581
- "size": 61363,
581
+ "size": 61402,
582
582
  "sizes": {
583
- "javascript": 61363
583
+ "javascript": 61402
584
584
  },
585
585
  "names": [],
586
586
  "idHints": [],
@@ -594,7 +594,7 @@
594
594
  "auxiliaryFiles": [
595
595
  "505.js.map"
596
596
  ],
597
- "hash": "f60b4bd4c41848f2",
597
+ "hash": "29ee94836b7b04ff",
598
598
  "childrenByOrder": {}
599
599
  },
600
600
  {
@@ -648,9 +648,9 @@
648
648
  "initial": false,
649
649
  "entry": false,
650
650
  "recorded": false,
651
- "size": 12704,
651
+ "size": 13584,
652
652
  "sizes": {
653
- "javascript": 12704
653
+ "javascript": 13584
654
654
  },
655
655
  "names": [],
656
656
  "idHints": [],
@@ -664,7 +664,7 @@
664
664
  "auxiliaryFiles": [
665
665
  "601.js.map"
666
666
  ],
667
- "hash": "9de6c74081cad66f",
667
+ "hash": "7b73e36749a42850",
668
668
  "childrenByOrder": {}
669
669
  },
670
670
  {
@@ -1190,9 +1190,9 @@
1190
1190
  "initial": false,
1191
1191
  "entry": false,
1192
1192
  "recorded": false,
1193
- "size": 3231,
1193
+ "size": 14952,
1194
1194
  "sizes": {
1195
- "javascript": 3231
1195
+ "javascript": 14952
1196
1196
  },
1197
1197
  "names": [],
1198
1198
  "idHints": [],
@@ -1206,7 +1206,7 @@
1206
1206
  "auxiliaryFiles": [
1207
1207
  "789.js.map"
1208
1208
  ],
1209
- "hash": "376013eac2c1e41d",
1209
+ "hash": "225af068d4947fdf",
1210
1210
  "childrenByOrder": {}
1211
1211
  },
1212
1212
  {
@@ -1242,9 +1242,9 @@
1242
1242
  "initial": false,
1243
1243
  "entry": false,
1244
1244
  "recorded": false,
1245
- "size": 5555,
1245
+ "size": 17276,
1246
1246
  "sizes": {
1247
- "javascript": 5555
1247
+ "javascript": 17276
1248
1248
  },
1249
1249
  "names": [],
1250
1250
  "idHints": [],
@@ -1258,7 +1258,7 @@
1258
1258
  "auxiliaryFiles": [
1259
1259
  "835.js.map"
1260
1260
  ],
1261
- "hash": "24beac9d083404bf",
1261
+ "hash": "9b1c6c22947bb9aa",
1262
1262
  "childrenByOrder": {}
1263
1263
  },
1264
1264
  {
@@ -1266,9 +1266,9 @@
1266
1266
  "initial": false,
1267
1267
  "entry": false,
1268
1268
  "recorded": false,
1269
- "size": 4225,
1269
+ "size": 15946,
1270
1270
  "sizes": {
1271
- "javascript": 4225
1271
+ "javascript": 15946
1272
1272
  },
1273
1273
  "names": [],
1274
1274
  "idHints": [],
@@ -1282,7 +1282,7 @@
1282
1282
  "auxiliaryFiles": [
1283
1283
  "852.js.map"
1284
1284
  ],
1285
- "hash": "05f9a0b77800d239",
1285
+ "hash": "2d0fa8e8f0912b82",
1286
1286
  "childrenByOrder": {}
1287
1287
  },
1288
1288
  {
@@ -1290,9 +1290,9 @@
1290
1290
  "initial": false,
1291
1291
  "entry": false,
1292
1292
  "recorded": false,
1293
- "size": 281419,
1293
+ "size": 282461,
1294
1294
  "sizes": {
1295
- "javascript": 281335,
1295
+ "javascript": 282377,
1296
1296
  "consume-shared": 84
1297
1297
  },
1298
1298
  "names": [],
@@ -1307,7 +1307,7 @@
1307
1307
  "auxiliaryFiles": [
1308
1308
  "916.js.map"
1309
1309
  ],
1310
- "hash": "dab308e40b62fbf4",
1310
+ "hash": "0f2c9ac8ac14e1d5",
1311
1311
  "childrenByOrder": {}
1312
1312
  },
1313
1313
  {
@@ -1342,9 +1342,9 @@
1342
1342
  "initial": false,
1343
1343
  "entry": false,
1344
1344
  "recorded": false,
1345
- "size": 6299,
1345
+ "size": 18020,
1346
1346
  "sizes": {
1347
- "javascript": 6299
1347
+ "javascript": 18020
1348
1348
  },
1349
1349
  "names": [],
1350
1350
  "idHints": [],
@@ -1358,7 +1358,7 @@
1358
1358
  "auxiliaryFiles": [
1359
1359
  "963.js.map"
1360
1360
  ],
1361
- "hash": "c7efced49d95e248",
1361
+ "hash": "30ca25e9115c160f",
1362
1362
  "childrenByOrder": {}
1363
1363
  }
1364
1364
  ]
package/dist/routes.json CHANGED
@@ -1 +1 @@
1
- {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.2.0"},"pages":[{"component":"root","route":"form-builder","online":true,"offline":true,"order":1}],"extensions":[{"name":"system-administration-form-builder-card-link","slot":"system-admin-page-card-link-slot","component":"systemAdministrationFormBuilderCardLink","online":true,"offline":true}],"modals":[{"name":"new-form-modal","component":"newFormModal"},{"name":"new-page-modal","component":"newPageModal"},{"name":"delete-page-modal","component":"deletePageModal"},{"name":"new-section-modal","component":"newSectionModal"},{"name":"delete-section-modal","component":"deleteSectionModal"},{"name":"add-question-modal","component":"addQuestionModal"},{"name":"delete-question-modal","component":"deleteQuestionModal"},{"name":"edit-question-modal","component":"editQuestionModal"},{"name":"restore-draft-schema-modal","component":"restoreDraftSchemaModal"},{"name":"unpublish-form-modal","component":"unpublishFormModal"},{"name":"delete-form-modal","component":"deleteFormModal"}],"version":"2.5.1-pre.1042"}
1
+ {"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.2.0"},"pages":[{"component":"root","route":"form-builder","online":true,"offline":true,"order":1}],"extensions":[{"name":"system-administration-form-builder-card-link","slot":"system-admin-page-card-link-slot","component":"systemAdministrationFormBuilderCardLink","online":true,"offline":true}],"modals":[{"name":"new-form-modal","component":"newFormModal"},{"name":"new-page-modal","component":"newPageModal"},{"name":"delete-page-modal","component":"deletePageModal"},{"name":"new-section-modal","component":"newSectionModal"},{"name":"delete-section-modal","component":"deleteSectionModal"},{"name":"add-question-modal","component":"addQuestionModal"},{"name":"delete-question-modal","component":"deleteQuestionModal"},{"name":"edit-question-modal","component":"editQuestionModal"},{"name":"restore-draft-schema-modal","component":"restoreDraftSchemaModal"},{"name":"unpublish-form-modal","component":"unpublishFormModal"},{"name":"delete-form-modal","component":"deleteFormModal"}],"version":"2.5.1-pre.1049"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-form-builder-app",
3
- "version": "2.5.1-pre.1042",
3
+ "version": "2.5.1-pre.1049",
4
4
  "license": "MPL-2.0",
5
5
  "description": "Form Builder for O3",
6
6
  "browser": "dist/openmrs-esm-form-builder-app.js",
@@ -4,7 +4,7 @@
4
4
  justify-content: flex-end;
5
5
  margin: 1rem 0;
6
6
 
7
- button {
7
+ > button {
8
8
  margin-left: 1rem
9
9
  }
10
10
  }
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button, ModalBody, ModalHeader, ModalFooter } from '@carbon/react';
4
+ import styles from '../modals.scss';
4
5
 
5
6
  interface UnpublishModalProps {
6
7
  closeModal: () => void;
@@ -13,6 +14,7 @@ const UnpublishFormModal: React.FC<UnpublishModalProps> = ({ closeModal, onUnpub
13
14
  return (
14
15
  <>
15
16
  <ModalHeader
17
+ className={styles.modalHeader}
16
18
  closeModal={closeModal}
17
19
  title={t('unpublishConfirmation', 'Are you sure you want to unpublish this form?')}
18
20
  />
@@ -1,3 +1,5 @@
1
+ @use '@carbon/layout';
2
+
1
3
  .spinner {
2
4
  &:global(.cds--inline-loading) {
3
5
  min-height: 1rem;
@@ -7,3 +9,31 @@
7
9
  font-size: unset;
8
10
  }
9
11
  }
12
+
13
+ .modalHeader {
14
+ :global {
15
+ .cds--modal-close-button {
16
+ position: absolute;
17
+ inset-block-start: 0;
18
+ inset-inline-end: 0;
19
+ margin: 0;
20
+ margin-top: calc(-1 * #{layout.$spacing-05});
21
+ }
22
+
23
+ .cds--modal-close {
24
+ background-color: rgba(0, 0, 0, 0);
25
+
26
+ &:hover {
27
+ background-color: var(--cds-layer-hover);
28
+ }
29
+ }
30
+
31
+ .cds--popover--left > .cds--popover > .cds--popover-content {
32
+ transform: translate(-4rem, 0.85rem);
33
+ }
34
+
35
+ .cds--popover--left > .cds--popover > .cds--popover-caret {
36
+ transform: translate(-3.75rem, 1.25rem);
37
+ }
38
+ }
39
+ }
@@ -77,13 +77,22 @@ const FormEditorContent: React.FC<TranslationFnProps> = ({ t }) => {
77
77
  const [publishedWithErrors, setPublishedWithErrors] = useState(false);
78
78
  const [errors, setErrors] = useState<Array<MarkerProps>>([]);
79
79
  const [validationOn, setValidationOn] = useState(false);
80
+ const [invalidJsonErrorMessage, setInvalidJsonErrorMessage] = useState('');
80
81
 
81
82
  const isLoadingFormOrSchema = Boolean(formUuid) && (isLoadingClobdata || isLoadingForm);
82
83
 
83
- const handleSchemaChange = useCallback((updatedSchema: string) => {
84
- setStringifiedSchema(updatedSchema);
84
+ const resetErrorMessage = useCallback(() => {
85
+ setInvalidJsonErrorMessage('');
85
86
  }, []);
86
87
 
88
+ const handleSchemaChange = useCallback(
89
+ (updatedSchema: string) => {
90
+ resetErrorMessage();
91
+ setStringifiedSchema(updatedSchema);
92
+ },
93
+ [resetErrorMessage],
94
+ );
95
+
87
96
  const launchRestoreDraftSchemaModal = useCallback(() => {
88
97
  const dispose = showModal('restore-draft-schema-modal', {
89
98
  closeModal: () => dispose(),
@@ -199,12 +208,6 @@ const FormEditorContent: React.FC<TranslationFnProps> = ({ t }) => {
199
208
  updateSchema({ ...dummySchema });
200
209
  }, [updateSchema]);
201
210
 
202
- const [invalidJsonErrorMessage, setInvalidJsonErrorMessage] = useState('');
203
-
204
- const resetErrorMessage = useCallback(() => {
205
- setInvalidJsonErrorMessage('');
206
- }, []);
207
-
208
211
  const renderSchemaChanges = useCallback(() => {
209
212
  resetErrorMessage();
210
213
  {
@@ -2,6 +2,7 @@ import React, { useCallback } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { Button, Form, ModalBody, ModalHeader, ModalFooter } from '@carbon/react';
4
4
  import { type Schema } from '../../types';
5
+ import styles from '../modals.scss';
5
6
 
6
7
  interface RestoreDraftSchemaModalProps {
7
8
  closeModal: () => void;
@@ -24,7 +25,11 @@ const RestoreDraftSchemaModal: React.FC<RestoreDraftSchemaModalProps> = ({ close
24
25
 
25
26
  return (
26
27
  <>
27
- <ModalHeader closeModal={closeModal} title={t('schemaNotFound', 'Schema not found')} />
28
+ <ModalHeader
29
+ className={styles.modalHeader}
30
+ closeModal={closeModal}
31
+ title={t('schemaNotFound', 'Schema not found')}
32
+ />
28
33
  <Form onSubmit={(event: React.SyntheticEvent) => event.preventDefault()}>
29
34
  <ModalBody>
30
35
  <p>
@@ -7,9 +7,9 @@ import {
7
7
  Form,
8
8
  FormGroup,
9
9
  FormLabel,
10
- Layer,
11
10
  InlineLoading,
12
11
  InlineNotification,
12
+ Layer,
13
13
  ModalBody,
14
14
  ModalFooter,
15
15
  ModalHeader,
@@ -19,11 +19,11 @@ import {
19
19
  Search,
20
20
  Select,
21
21
  SelectItem,
22
+ SelectSkeleton,
22
23
  Stack,
23
24
  Tag,
24
25
  TextInput,
25
26
  Tile,
26
- SelectSkeleton,
27
27
  } from '@carbon/react';
28
28
  import { ArrowUpRight } from '@carbon/react/icons';
29
29
  import { showSnackbar, useConfig, useDebounce } from '@openmrs/esm-framework';
@@ -46,8 +46,8 @@ import type {
46
46
  import { useConceptLookup } from '../../hooks/useConceptLookup';
47
47
  import { usePatientIdentifierTypes } from '../../hooks/usePatientIdentifierTypes';
48
48
  import { usePersonAttributeTypes } from '../../hooks/usePersonAttributeTypes';
49
- import styles from './question-modal.scss';
50
49
  import { useProgramWorkStates, usePrograms } from '../../hooks/useProgramStates';
50
+ import styles from './question-modal.scss';
51
51
 
52
52
  interface AddQuestionModalProps {
53
53
  closeModal: () => void;
@@ -303,7 +303,11 @@ const AddQuestionModal: React.FC<AddQuestionModalProps> = ({
303
303
 
304
304
  return (
305
305
  <>
306
- <ModalHeader title={t('createNewQuestion', 'Create a new question')} closeModal={closeModal} />
306
+ <ModalHeader
307
+ className={styles.modalHeader}
308
+ title={t('createNewQuestion', 'Create a new question')}
309
+ closeModal={closeModal}
310
+ />
307
311
  <Form className={styles.form} onSubmit={(event: React.SyntheticEvent) => event.preventDefault()}>
308
312
  <ModalBody hasScrollingContent>
309
313
  <FormGroup legendText={''}>
@@ -701,8 +705,8 @@ const AddQuestionModal: React.FC<AddQuestionModalProps> = ({
701
705
  name="datePickerType"
702
706
  legendText={t('datePickerType', 'The type of date picker to show ')}
703
707
  >
704
- {/** Filters out the date picker types based on the selected concept's data type.
705
- If no concept is selected, all date picker types are shown.
708
+ {/** Filters out the date picker types based on the selected concept's data type.
709
+ If no concept is selected, all date picker types are shown.
706
710
  */}
707
711
  {selectedConcept && selectedConcept.datatype
708
712
  ? datePickerTypeOptions[selectedConcept.datatype.name.toLowerCase()].map((type) => (
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
3
3
  import { Button, ModalBody, ModalFooter, ModalHeader } from '@carbon/react';
4
4
  import { showSnackbar } from '@openmrs/esm-framework';
5
5
  import type { Schema } from '../../types';
6
+ import styles from '../modals.scss';
6
7
 
7
8
  interface DeletePageModalProps {
8
9
  closeModal: () => void;
@@ -40,6 +41,7 @@ const DeletePageModal: React.FC<DeletePageModalProps> = ({ onSchemaChange, pageI
40
41
  return (
41
42
  <>
42
43
  <ModalHeader
44
+ className={styles.modalHeader}
43
45
  title={t('deletePageConfirmation', 'Are you sure you want to delete this page?')}
44
46
  closeModal={closeModal}
45
47
  />
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
3
3
  import { Button, ModalBody, ModalFooter, ModalHeader } from '@carbon/react';
4
4
  import { showSnackbar } from '@openmrs/esm-framework';
5
5
  import type { Question, Schema } from '../../types';
6
+ import styles from '../modals.scss';
6
7
 
7
8
  interface DeleteQuestionModal {
8
9
  closeModal: () => void;
@@ -68,6 +69,7 @@ const DeleteQuestionModal: React.FC<DeleteQuestionModal> = ({
68
69
  return (
69
70
  <div>
70
71
  <ModalHeader
72
+ className={styles.modalHeader}
71
73
  closeModal={closeModal}
72
74
  title={t('deleteQuestionConfirmation', 'Are you sure you want to delete this question? ')}
73
75
  />
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
3
3
  import { Button, ModalBody, ModalFooter, ModalHeader } from '@carbon/react';
4
4
  import { showSnackbar } from '@openmrs/esm-framework';
5
5
  import type { Schema } from '../../types';
6
+ import styles from '../modals.scss';
6
7
 
7
8
  interface DeleteSectionModal {
8
9
  closeModal: () => void;
@@ -47,6 +48,7 @@ const DeleteSectionModal: React.FC<DeleteSectionModal> = ({
47
48
  return (
48
49
  <>
49
50
  <ModalHeader
51
+ className={styles.modalHeader}
50
52
  title={t('deleteSectionConfirmation', 'Are you sure you want to delete this section?')}
51
53
  closeModal={closeModal}
52
54
  />
@@ -52,8 +52,8 @@ import { usePersonAttributeLookup } from '../../hooks/usePersonAttributeLookup';
52
52
  import { usePersonAttributeName } from '../../hooks/usePersonAttributeName';
53
53
  import { usePersonAttributeTypes } from '../../hooks/usePersonAttributeTypes';
54
54
  import { usePrograms, useProgramWorkStates } from '../../hooks/useProgramStates';
55
- import styles from './question-modal.scss';
56
55
  import { getDatePickerType } from './add-question.modal';
56
+ import styles from './question-modal.scss';
57
57
 
58
58
  interface EditQuestionModalProps {
59
59
  closeModal: () => void;
@@ -357,7 +357,7 @@ const EditQuestionModal: React.FC<EditQuestionModalProps> = ({
357
357
 
358
358
  return (
359
359
  <>
360
- <ModalHeader closeModal={closeModal} title={t('editQuestion', 'Edit question')} />
360
+ <ModalHeader className={styles.modalHeader} closeModal={closeModal} title={t('editQuestion', 'Edit question')} />
361
361
  <Form className={styles.form} onSubmit={(event: React.SyntheticEvent) => event.preventDefault()}>
362
362
  <ModalBody hasScrollingContent>
363
363
  <Stack gap={5}>
@@ -832,8 +832,8 @@ const EditQuestionModal: React.FC<EditQuestionModalProps> = ({
832
832
  name="datePickerType"
833
833
  legendText={t('datePickerType', 'The type of date picker to show')}
834
834
  >
835
- {/** Filters out the date picker types based on the selected concept's data type.
836
- If no concept is selected, all date picker types are shown.
835
+ {/** Filters out the date picker types based on the selected concept's data type.
836
+ If no concept is selected, all date picker types are shown.
837
837
  */}
838
838
  {selectedConcept && selectedConcept.datatype
839
839
  ? datePickerTypeOptions[selectedConcept.datatype.name.toLowerCase()].map((type) => (
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
3
3
  import { Button, Form, FormGroup, ModalBody, ModalFooter, ModalHeader, Stack, TextInput } from '@carbon/react';
4
4
  import { showSnackbar } from '@openmrs/esm-framework';
5
5
  import type { Schema } from '../../types';
6
+ import styles from '../modals.scss';
6
7
 
7
8
  interface NewFormModalProps {
8
9
  schema: Schema;
@@ -50,7 +51,11 @@ const NewFormModal: React.FC<NewFormModalProps> = ({ schema, onSchemaChange, clo
50
51
 
51
52
  return (
52
53
  <>
53
- <ModalHeader closeModal={closeModal} title={t('createNewForm', 'Create a new form')} />
54
+ <ModalHeader
55
+ className={styles.modalHeader}
56
+ closeModal={closeModal}
57
+ title={t('createNewForm', 'Create a new form')}
58
+ />
54
59
  <Form onSubmit={(event: React.SyntheticEvent) => event.preventDefault()}>
55
60
  <ModalBody>
56
61
  <Stack gap={5}>
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
3
3
  import { Button, Form, FormGroup, ModalBody, ModalFooter, ModalHeader, TextInput } from '@carbon/react';
4
4
  import { showSnackbar } from '@openmrs/esm-framework';
5
5
  import type { Schema } from '../../types';
6
+ import styles from '../modals.scss';
6
7
 
7
8
  interface PageModalProps {
8
9
  closeModal: () => void;
@@ -49,7 +50,11 @@ const PageModal: React.FC<PageModalProps> = ({ closeModal, schema, onSchemaChang
49
50
 
50
51
  return (
51
52
  <>
52
- <ModalHeader title={t('createNewPage', 'Create a new page')} closeModal={closeModal} />
53
+ <ModalHeader
54
+ className={styles.modalHeader}
55
+ title={t('createNewPage', 'Create a new page')}
56
+ closeModal={closeModal}
57
+ />
53
58
  <Form onSubmit={(event: React.SyntheticEvent) => event.preventDefault()}>
54
59
  <ModalBody>
55
60
  <FormGroup legendText={''}>
@@ -1,4 +1,5 @@
1
1
  @use '@carbon/colors';
2
+ @use '@carbon/layout';
2
3
  @use "@carbon/type";
3
4
 
4
5
  .label {
@@ -126,3 +127,31 @@
126
127
  color: colors.$red-60;
127
128
  margin-left: 0.125rem;
128
129
  }
130
+
131
+ .modalHeader {
132
+ :global {
133
+ .cds--modal-close-button {
134
+ position: absolute;
135
+ inset-block-start: 0;
136
+ inset-inline-end: 0;
137
+ margin: 0;
138
+ margin-top: calc(-1 * #{layout.$spacing-05});
139
+ }
140
+
141
+ .cds--modal-close {
142
+ background-color: rgba(0, 0, 0, 0);
143
+
144
+ &:hover {
145
+ background-color: var(--cds-layer-hover);
146
+ }
147
+ }
148
+
149
+ .cds--popover--left > .cds--popover > .cds--popover-content {
150
+ transform: translate(-4rem, 0.85rem);
151
+ }
152
+
153
+ .cds--popover--left > .cds--popover > .cds--popover-caret {
154
+ transform: translate(-3.75rem, 1.25rem);
155
+ }
156
+ }
157
+ }
@@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next';
3
3
  import { Button, Form, FormGroup, ModalBody, ModalFooter, ModalHeader, TextInput } from '@carbon/react';
4
4
  import { showSnackbar } from '@openmrs/esm-framework';
5
5
  import type { Schema } from '../../types';
6
+ import styles from '../modals.scss';
6
7
 
7
8
  interface SectionModalProps {
8
9
  closeModal: () => void;
@@ -49,7 +50,11 @@ const SectionModal: React.FC<SectionModalProps> = ({ closeModal, schema, onSchem
49
50
 
50
51
  return (
51
52
  <>
52
- <ModalHeader title={t('createNewSection', 'Create a new section')} closeModal={closeModal} />
53
+ <ModalHeader
54
+ className={styles.modalHeader}
55
+ title={t('createNewSection', 'Create a new section')}
56
+ closeModal={closeModal}
57
+ />
53
58
  <Form onSubmit={(event: React.SyntheticEvent) => event.preventDefault()}>
54
59
  <ModalBody>
55
60
  <FormGroup legendText={''}>
@@ -1,3 +1,5 @@
1
+ @use '@carbon/layout';
2
+
1
3
  .spinner {
2
4
  &:global(.cds--inline-loading) {
3
5
  min-height: 1rem;
@@ -12,3 +14,31 @@
12
14
  max-height: 75vh;
13
15
  overflow-y: auto;
14
16
  }
17
+
18
+ .modalHeader {
19
+ :global {
20
+ .cds--modal-close-button {
21
+ position: absolute;
22
+ inset-block-start: 0;
23
+ inset-inline-end: 0;
24
+ margin: 0;
25
+ margin-top: calc(-1 * #{layout.$spacing-05});
26
+ }
27
+
28
+ .cds--modal-close {
29
+ background-color: rgba(0, 0, 0, 0);
30
+
31
+ &:hover {
32
+ background-color: var(--cds-layer-hover);
33
+ }
34
+ }
35
+
36
+ .cds--popover--left > .cds--popover > .cds--popover-content {
37
+ transform: translate(-4rem, 0.85rem);
38
+ }
39
+
40
+ .cds--popover--left > .cds--popover > .cds--popover-caret {
41
+ transform: translate(-3.75rem, 1.25rem);
42
+ }
43
+ }
44
+ }