@kenyaemr/esm-service-queues-app 7.0.2-pre.67 → 7.0.2-pre.68

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 (115) hide show
  1. package/.turbo/turbo-build.log +14 -13
  2. package/dist/130.js +1 -1
  3. package/dist/130.js.map +1 -1
  4. package/dist/199.js +1 -0
  5. package/dist/{738.js.map → 199.js.map} +1 -1
  6. package/dist/271.js +1 -1
  7. package/dist/276.js +1 -1
  8. package/dist/319.js +1 -1
  9. package/dist/401.js +1 -1
  10. package/dist/430.js +1 -2
  11. package/dist/430.js.map +1 -1
  12. package/dist/460.js +1 -1
  13. package/dist/490.js +2 -0
  14. package/dist/490.js.map +1 -0
  15. package/dist/574.js +1 -1
  16. package/dist/6.js +1 -0
  17. package/dist/6.js.map +1 -0
  18. package/dist/60.js +1 -0
  19. package/dist/60.js.map +1 -0
  20. package/dist/600.js +1 -0
  21. package/dist/600.js.map +1 -0
  22. package/dist/644.js +1 -1
  23. package/dist/647.js +1 -1
  24. package/dist/647.js.map +1 -1
  25. package/dist/650.js +1 -1
  26. package/dist/650.js.map +1 -1
  27. package/dist/669.js +1 -1
  28. package/dist/669.js.map +1 -1
  29. package/dist/{806.js → 752.js} +1 -1
  30. package/dist/{806.js.map → 752.js.map} +1 -1
  31. package/dist/757.js +1 -1
  32. package/dist/764.js +1 -1
  33. package/dist/764.js.map +1 -1
  34. package/dist/788.js +1 -1
  35. package/dist/{981.js → 800.js} +1 -1
  36. package/dist/{981.js.map → 800.js.map} +1 -1
  37. package/dist/807.js +1 -1
  38. package/dist/{696.js → 828.js} +1 -1
  39. package/dist/{696.js.map → 828.js.map} +1 -1
  40. package/dist/833.js +1 -1
  41. package/dist/877.js +1 -1
  42. package/dist/877.js.map +1 -1
  43. package/dist/917.js +1 -1
  44. package/dist/917.js.map +1 -1
  45. package/dist/kenyaemr-esm-service-queues-app.js +1 -1
  46. package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +193 -193
  47. package/dist/kenyaemr-esm-service-queues-app.js.map +1 -1
  48. package/dist/main.js +1 -1
  49. package/dist/main.js.map +1 -1
  50. package/dist/routes.json +1 -1
  51. package/package.json +2 -2
  52. package/src/add-patient-toqueue/add-patient-toqueue-dialog.component.tsx +4 -4
  53. package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +12 -15
  54. package/src/config-schema.ts +20 -0
  55. package/src/helpers/helpers.ts +42 -32
  56. package/src/home.component.tsx +1 -1
  57. package/src/hooks/useQueueEntries.ts +1 -1
  58. package/src/hooks/useQueueService.ts +21 -0
  59. package/src/hooks/useQueueStatuses.ts +40 -0
  60. package/src/index.ts +5 -5
  61. package/src/patient-info/patient-info.component.tsx +9 -9
  62. package/src/patient-queue-header/patient-queue-header.component.tsx +30 -24
  63. package/src/patient-queue-header/patient-queue-header.scss +1 -2
  64. package/src/patient-queue-metrics/clinic-metrics.component.tsx +16 -27
  65. package/src/patient-queue-metrics/queue-metrics.resource.ts +1 -2
  66. package/src/patient-search/patient-scheduled-visits.scss +1 -1
  67. package/src/patient-search/patient-search.scss +6 -0
  68. package/src/patient-search/patient-search.workspace.tsx +30 -30
  69. package/src/patient-search/visit-form/visit-form.component.tsx +8 -8
  70. package/src/patient-search/visit-form/visit-form.scss +5 -3
  71. package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.component.tsx +14 -7
  72. package/src/queue-patient-linelists/queue-linelist-filter.scss +2 -12
  73. package/src/queue-rooms/queue-room-form.scss +1 -1
  74. package/src/queue-screen/queue-screen.component.tsx +1 -1
  75. package/src/queue-services/queue-service-form.scss +2 -2
  76. package/src/queue-table/cells/queue-table-action-cell.component.tsx +6 -4
  77. package/src/queue-table/cells/queue-table-action-cell.scss +7 -0
  78. package/src/queue-table/default-queue-table.component.tsx +69 -38
  79. package/src/queue-table/queue-entry-actions/{edit-queue-entry-modal.component.tsx → edit-queue-entry.modal.tsx} +1 -1
  80. package/src/queue-table/queue-entry-actions/{end-queue-entry-modal.component.tsx → end-queue-entry.modal.tsx} +1 -1
  81. package/src/queue-table/queue-entry-actions/{queue-entry-actions-modal.test.tsx → queue-entry-actions.test.tsx} +2 -2
  82. package/src/queue-table/queue-entry-actions/{queue-entry-confirm-action-modal.test.tsx → queue-entry-confirm-action.test.tsx} +3 -3
  83. package/src/queue-table/queue-entry-actions/{queue-entry-undo-actions-modal.test.tsx → queue-entry-undo-actions.test.tsx} +2 -2
  84. package/src/queue-table/queue-entry-actions/{transition-queue-entry-modal.component.tsx → transition-queue-entry.modal.tsx} +1 -1
  85. package/src/queue-table/queue-entry-actions/{undo-transition-queue-entry-modal.component.tsx → undo-transition-queue-entry.modal.tsx} +1 -1
  86. package/src/queue-table/queue-entry-actions/{void-queue-entry-modal.component.tsx → void-queue-entry.modal.tsx} +1 -1
  87. package/src/queue-table/queue-table-by-status-skeleton.component.tsx +18 -18
  88. package/src/queue-table/queue-table-metrics-card.scss +1 -1
  89. package/src/queue-table/queue-table-metrics.scss +1 -1
  90. package/src/queue-table/queue-table.component.tsx +35 -18
  91. package/src/queue-table/queue-table.scss +12 -4
  92. package/src/types/index.ts +3 -1
  93. package/src/views/queue-table-by-status-view.component.tsx +2 -14
  94. package/src/views/queue-tables-for-all-statuses.component.tsx +81 -43
  95. package/translations/am.json +29 -19
  96. package/translations/ar.json +33 -23
  97. package/translations/en.json +3 -2
  98. package/translations/es.json +29 -19
  99. package/translations/fr.json +29 -19
  100. package/translations/he.json +33 -23
  101. package/translations/km.json +31 -21
  102. package/translations/zh.json +39 -29
  103. package/translations/zh_CN.json +38 -28
  104. package/dist/185.js +0 -1
  105. package/dist/185.js.map +0 -1
  106. package/dist/233.js +0 -1
  107. package/dist/233.js.map +0 -1
  108. package/dist/237.js +0 -1
  109. package/dist/237.js.map +0 -1
  110. package/dist/703.js +0 -1
  111. package/dist/703.js.map +0 -1
  112. package/dist/738.js +0 -1
  113. /package/dist/{430.js.LICENSE.txt → 490.js.LICENSE.txt} +0 -0
  114. /package/src/queue-table/queue-entry-actions/{queue-entry-actions-modal.component.tsx → queue-entry-actions.modal.tsx} +0 -0
  115. /package/src/queue-table/queue-entry-actions/{queue-entry-confirm-action-modal.component.tsx → queue-entry-confirm-action.modal.tsx} +0 -0
@@ -1,5 +1,4 @@
1
1
  import useSWR from 'swr';
2
- import useSWRImmutable from 'swr/immutable';
3
2
  import { openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
4
3
  import { type Appointment, type QueueServiceInfo } from '../types';
5
4
  import { startOfDay } from '../constants';
@@ -11,7 +10,7 @@ export function useServiceMetricsCount(service: string, location: string) {
11
10
  (service ? `&service=${service}` : '') +
12
11
  (location ? `&location=${location}` : '');
13
12
 
14
- const { data } = useSWRImmutable<
13
+ const { data } = useSWR<
15
14
  {
16
15
  data: {
17
16
  count: number;
@@ -7,7 +7,7 @@
7
7
  display: flex;
8
8
  flex-direction: column;
9
9
  justify-content: space-between;
10
- height: calc(var(--desktop-workspace-window-height) - 7rem - 2px); // 7rem patient banner, plus border
10
+ height: 100%;
11
11
  }
12
12
 
13
13
  .grid {
@@ -2,6 +2,12 @@
2
2
  @use '@carbon/styles/scss/type';
3
3
  @import '~@openmrs/esm-styleguide/src/vars';
4
4
 
5
+ .patientSearchContainer {
6
+ height: 100%;
7
+ display: flex;
8
+ flex-direction: column;
9
+ }
10
+
5
11
  .patientBannerContainer {
6
12
  display: flex;
7
13
  flex-direction: column;
@@ -4,10 +4,10 @@ import { SearchTypes } from '../types';
4
4
  import PatientScheduledVisits from './patient-scheduled-visits.component';
5
5
  import VisitForm from './visit-form/visit-form.component';
6
6
  import {
7
- ArrowLeftIcon,
8
7
  type DefaultWorkspaceProps,
9
- displayName,
8
+ ArrowLeftIcon,
10
9
  ErrorState,
10
+ getPatientName,
11
11
  PatientBannerContactDetails,
12
12
  PatientBannerPatientInfo,
13
13
  PatientBannerToggleContactDetailsButton,
@@ -76,35 +76,35 @@ const PatientSearch: React.FC<PatientSearchProps> = ({
76
76
  }
77
77
  }, [searchType, handleBackToSearchList]);
78
78
 
79
- const patientName = patient && displayName(patient);
79
+ const patientName = patient && getPatientName(patient);
80
80
  return patient ? (
81
- <AddPatientToQueueContext.Provider value={{ currentServiceQueueUuid }}>
82
- <div className={styles.patientBannerContainer}>
83
- <div className={styles.patientBanner}>
84
- <div className={styles.patientPhoto}>
85
- <PatientPhoto patientUuid={patient.id} patientName={patientName} />
81
+ <div className={styles.patientSearchContainer}>
82
+ <AddPatientToQueueContext.Provider value={{ currentServiceQueueUuid }}>
83
+ <div className={styles.patientBannerContainer}>
84
+ <div className={styles.patientBanner}>
85
+ <div className={styles.patientPhoto}>
86
+ <PatientPhoto patientUuid={patient.id} patientName={patientName} />
87
+ </div>
88
+ <PatientBannerPatientInfo patient={patient} />
89
+ <PatientBannerToggleContactDetailsButton
90
+ showContactDetails={showContactDetails}
91
+ toggleContactDetails={() => setContactDetails(!showContactDetails)}
92
+ />
86
93
  </div>
87
- <PatientBannerPatientInfo patient={patient} />
88
- <PatientBannerToggleContactDetailsButton
89
- showContactDetails={showContactDetails}
90
- toggleContactDetails={() => setContactDetails(!showContactDetails)}
91
- />
94
+ {showContactDetails ? (
95
+ <PatientBannerContactDetails patientId={patient.id} deceased={patient.deceasedBoolean} />
96
+ ) : null}
97
+ </div>
98
+ <div className={styles.backButton}>
99
+ <Button
100
+ kind="ghost"
101
+ renderIcon={(props) => <ArrowLeftIcon size={24} {...props} />}
102
+ iconDescription={backButtonDescription}
103
+ size="sm"
104
+ onClick={handleBackToAction}>
105
+ <span>{backButtonDescription}</span>
106
+ </Button>
92
107
  </div>
93
- {showContactDetails ? (
94
- <PatientBannerContactDetails patientId={patient.id} deceased={patient.deceasedBoolean} />
95
- ) : null}
96
- </div>
97
- <div className={styles.backButton}>
98
- <Button
99
- kind="ghost"
100
- renderIcon={(props) => <ArrowLeftIcon size={24} {...props} />}
101
- iconDescription={backButtonDescription}
102
- size="sm"
103
- onClick={() => handleBackToAction()}>
104
- <span>{backButtonDescription}</span>
105
- </Button>
106
- </div>
107
- <div>
108
108
  {activeVisit ? (
109
109
  <ExistingVisitFormComponent visit={activeVisit} closeWorkspace={closeWorkspace} />
110
110
  ) : (
@@ -127,8 +127,8 @@ const PatientSearch: React.FC<PatientSearchProps> = ({
127
127
  ) : null}
128
128
  </>
129
129
  )}
130
- </div>
131
- </AddPatientToQueueContext.Provider>
130
+ </AddPatientToQueueContext.Provider>
131
+ </div>
132
132
  ) : null;
133
133
  };
134
134
 
@@ -327,16 +327,16 @@ const VisitForm: React.FC<VisitFormProps> = ({ patientUuid, closeWorkspace }) =>
327
327
  )}
328
328
 
329
329
  <VisitFormQueueFields setFormFields={setVisitFormFields} />
330
- <ButtonSet className={isTablet ? styles.tablet : styles.desktop}>
331
- <Button className={styles.button} kind="secondary" onClick={closeWorkspace}>
332
- {t('discard', 'Discard')}
333
- </Button>
334
- <Button className={styles.button} disabled={isSubmitting} kind="primary" type="submit">
335
- {t('startVisit', 'Start visit')}
336
- </Button>
337
- </ButtonSet>
338
330
  </Stack>
339
331
  </div>
332
+ <ButtonSet className={isTablet ? styles.tabletButtons : styles.desktopButtons}>
333
+ <Button className={styles.button} kind="secondary" onClick={closeWorkspace}>
334
+ {t('discard', 'Discard')}
335
+ </Button>
336
+ <Button className={styles.button} disabled={isSubmitting} kind="primary" type="submit">
337
+ {t('startVisit', 'Start visit')}
338
+ </Button>
339
+ </ButtonSet>
340
340
  </Form>
341
341
  );
342
342
  };
@@ -46,7 +46,7 @@
46
46
  display: flex;
47
47
  flex-direction: column;
48
48
  justify-content: space-between;
49
- height: calc(var(--desktop-workspace-window-height) - 7rem - 2px); // 7rem patient banner, plus border
49
+ height: 100%;
50
50
  }
51
51
 
52
52
  .button {
@@ -57,13 +57,15 @@
57
57
  min-width: 50%;
58
58
  }
59
59
 
60
- .tablet {
60
+ .tabletButtons {
61
61
  padding: spacing.$spacing-06 spacing.$spacing-05;
62
+ margin-top: spacing.$spacing-10;
62
63
  background-color: $ui-02;
63
64
  }
64
65
 
65
- .desktop {
66
+ .desktopButtons {
66
67
  padding: 0rem;
68
+ margin-top: spacing.$spacing-10;
67
69
  }
68
70
 
69
71
  @media screen and (max-width: 600px) {
@@ -1,15 +1,22 @@
1
- import React, { useContext, useEffect, useRef, useState } from 'react';
1
+ import React, { useContext, useEffect, useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
2
3
  import classNames from 'classnames';
3
- import { InlineNotification, Select, SelectItem, RadioButtonGroup, RadioButton, TextInput } from '@carbon/react';
4
- import { useQueueLocations } from '../hooks/useQueueLocations';
5
- import styles from './visit-form-queue-fields.scss';
4
+ import {
5
+ InlineNotification,
6
+ RadioButton,
7
+ RadioButtonGroup,
8
+ RadioButtonSkeleton,
9
+ Select,
10
+ SelectItem,
11
+ SelectSkeleton,
12
+ TextInput,
13
+ } from '@carbon/react';
6
14
  import { useConfig, ResponsiveWrapper, useSession } from '@openmrs/esm-framework';
7
- import { useTranslation } from 'react-i18next';
8
15
  import { useQueues } from '../../hooks/useQueues';
16
+ import { useQueueLocations } from '../hooks/useQueueLocations';
9
17
  import { type ConfigObject } from '../../config-schema';
10
- import { SelectSkeleton } from '@carbon/react';
11
- import { RadioButtonSkeleton } from '@carbon/react';
12
18
  import { AddPatientToQueueContext } from '../patient-search.workspace';
19
+ import styles from './visit-form-queue-fields.scss';
13
20
 
14
21
  export interface VisitFormQueueFieldsProps {
15
22
  setFormFields: (fields: {
@@ -48,16 +48,6 @@
48
48
  margin-top: spacing.$spacing-05;
49
49
  }
50
50
 
51
- /* Desktop */
52
- :global(.omrs-breakpoint-gt-tablet) {
53
- .form {
54
- height: calc(100vh - 6rem);
55
- }
56
- }
57
-
58
- /* Tablet */
59
- :global(.omrs-breakpoint-lt-desktop) {
60
- .form {
61
- height: calc(100vh - 3rem);
62
- }
51
+ .form {
52
+ height: 100%;
63
53
  }
@@ -25,7 +25,7 @@ $overlay-header-height: 5.5rem;
25
25
  display: flex;
26
26
  flex-direction: column;
27
27
  justify-content: space-between;
28
- height: var(--desktop-workspace-window-height);
28
+ height: 100%;
29
29
  }
30
30
 
31
31
  .grid {
@@ -28,7 +28,7 @@ const QueueScreen: React.FC<QueueScreenProps> = () => {
28
28
 
29
29
  return (
30
30
  <div>
31
- <PatientQueueHeader title={t('queueScreen', 'Queue screen')} />
31
+ <PatientQueueHeader title={t('queueScreen', 'Queue screen')} showLocationDropdown />
32
32
  <div className={styles.gridFlow}>
33
33
  {rowData.map((row) => (
34
34
  <div className={styles.card} key={row.id}>
@@ -23,7 +23,7 @@
23
23
  display: flex;
24
24
  flex-direction: column;
25
25
  justify-content: space-between;
26
- height: var(--desktop-workspace-window-height);
26
+ height: 100%;
27
27
  }
28
28
 
29
29
  .grid {
@@ -51,7 +51,7 @@
51
51
  /* Tablet */
52
52
  :global(.omrs-breakpoint-lt-desktop) {
53
53
  .form {
54
- height: var(--tablet-workspace-window-height);
54
+ height: 100%;
55
55
  }
56
56
 
57
57
  .buttonSet {
@@ -1,15 +1,16 @@
1
1
  import React from 'react';
2
2
  import { Button, OverflowMenu, OverflowMenuItem } from '@carbon/react';
3
- import { showModal } from '@openmrs/esm-framework';
3
+ import { isDesktop, showModal, useLayoutType } from '@openmrs/esm-framework';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { type QueueTableColumnFunction, type QueueTableCellComponentProps } from '../../types';
6
6
  import styles from './queue-table-action-cell.scss';
7
7
 
8
8
  export function QueueTableActionCell({ queueEntry }: QueueTableCellComponentProps) {
9
9
  const { t } = useTranslation();
10
+ const layout = useLayoutType();
10
11
 
11
12
  return (
12
- <div className={styles.actionCellContainer}>
13
+ <div className={styles.actionsCell}>
13
14
  <Button
14
15
  kind="ghost"
15
16
  aria-label={t('actions', 'Actions')}
@@ -18,10 +19,11 @@ export function QueueTableActionCell({ queueEntry }: QueueTableCellComponentProp
18
19
  closeModal: () => dispose(),
19
20
  queueEntry,
20
21
  });
21
- }}>
22
+ }}
23
+ size={isDesktop(layout) ? 'sm' : 'lg'}>
22
24
  {t('transition', 'Transition')}
23
25
  </Button>
24
- <OverflowMenu aria-label="Actions menu" size="sm" flipped>
26
+ <OverflowMenu aria-label="Actions menu" size={isDesktop(layout) ? 'sm' : 'lg'} flipped>
25
27
  <OverflowMenuItem
26
28
  className={styles.menuItem}
27
29
  aria-label={t('edit', 'Edit')}
@@ -5,3 +5,10 @@
5
5
  .menuItem {
6
6
  max-width: none;
7
7
  }
8
+
9
+ .actionsCell {
10
+ display: flex;
11
+ justify-content: flex-end;
12
+ height: 100%;
13
+ align-items: center;
14
+ }
@@ -13,18 +13,19 @@ import {
13
13
  import { useTranslation } from 'react-i18next';
14
14
  import ClearQueueEntries from '../clear-queue-entries-dialog/clear-queue-entries.component';
15
15
  import {
16
- updateSelectedServiceName,
17
- updateSelectedServiceUuid,
16
+ updateSelectedQueueStatus,
17
+ updateSelectedService,
18
18
  useSelectedQueueLocationUuid,
19
- useSelectedServiceName,
20
- useSelectedServiceUuid,
19
+ useSelectedQueueStatus,
20
+ useSelectedService,
21
21
  } from '../helpers/helpers';
22
- import { useQueues } from '../hooks/useQueues';
23
22
  import { useQueueEntries } from '../hooks/useQueueEntries';
24
23
  import QueueTableExpandedRow from './queue-table-expanded-row.component';
25
24
  import QueueTable from './queue-table.component';
26
25
  import styles from './queue-table.scss';
27
26
  import { useColumns } from './cells/columns.resource';
27
+ import useQueueStatuses from '../hooks/useQueueStatuses';
28
+ import useQueueServices from '../hooks/useQueueService';
28
29
 
29
30
  const serviceQueuesPatientSearchWorkspace = 'service-queues-patient-search';
30
31
 
@@ -33,12 +34,14 @@ Component with default values / sub-components passed into the more generic Queu
33
34
  This is used in the main dashboard of the queues app. (Currently behind a feature flag)
34
35
  */
35
36
  function DefaultQueueTable() {
36
- const selectedQueueUuid = useSelectedServiceUuid();
37
+ const selectedService = useSelectedService();
37
38
  const currentLocationUuid = useSelectedQueueLocationUuid();
38
- const { queueEntries, isLoading, isValidating, error } = useQueueEntries({
39
- queue: selectedQueueUuid,
39
+ const selectedQueueStatus = useSelectedQueueStatus();
40
+ const { queueEntries, isLoading, error, isValidating } = useQueueEntries({
41
+ service: selectedService?.serviceUuid,
40
42
  location: currentLocationUuid,
41
43
  isEnded: false,
44
+ status: selectedQueueStatus?.statusUuid,
42
45
  });
43
46
 
44
47
  const { t } = useTranslation();
@@ -83,10 +86,6 @@ function DefaultQueueTable() {
83
86
  });
84
87
  }, [queueEntries, searchTerm]);
85
88
 
86
- if (isLoading && !queueEntries.length) {
87
- return <DataTableSkeleton role="progressbar" />;
88
- }
89
-
90
89
  return (
91
90
  <div className={styles.container}>
92
91
  <div className={styles.headerContainer}>
@@ -113,7 +112,7 @@ function DefaultQueueTable() {
113
112
  setIsPatientSearchOpen(false);
114
113
  launchWorkspace(serviceQueuesPatientSearchWorkspace, {
115
114
  selectedPatientUuid,
116
- currentServiceQueueUuid: selectedQueueUuid,
115
+ currentServiceQueueUuid: selectedService?.serviceUuid,
117
116
  handleBackToSearchList,
118
117
  });
119
118
  },
@@ -121,23 +120,30 @@ function DefaultQueueTable() {
121
120
  />
122
121
  </div>
123
122
  </div>
124
- <QueueTable
125
- queueEntries={filteredQueueEntries ?? []}
126
- isValidating={isValidating}
127
- queueUuid={null}
128
- statusUuid={null}
129
- ExpandedRow={QueueTableExpandedRow}
130
- tableFilter={[
131
- <QueueDropdownFilter />,
132
- <TableToolbarSearch
133
- className={styles.search}
134
- onChange={(e) => setSearchTerm(e.target.value)}
135
- placeholder={t('searchThisList', 'Search this list')}
136
- size={isDesktop(layout) ? 'sm' : 'lg'}
137
- />,
138
- <ClearQueueEntries queueEntries={filteredQueueEntries} />,
139
- ]}
140
- />
123
+ {!isLoading ? (
124
+ <div className={styles.paddedQueueTable}>
125
+ <QueueTable
126
+ queueEntries={filteredQueueEntries ?? []}
127
+ isValidating={isValidating}
128
+ queueUuid={null}
129
+ statusUuid={null}
130
+ ExpandedRow={QueueTableExpandedRow}
131
+ tableFilter={[
132
+ <QueueDropdownFilter />,
133
+ <StatusDropdownFilter />,
134
+ <TableToolbarSearch
135
+ className={styles.search}
136
+ onChange={(e) => setSearchTerm(e.target.value)}
137
+ placeholder={t('searchThisList', 'Search this list')}
138
+ size={isDesktop(layout) ? 'sm' : 'lg'}
139
+ />,
140
+ <ClearQueueEntries queueEntries={filteredQueueEntries} />,
141
+ ]}
142
+ />
143
+ </div>
144
+ ) : (
145
+ <DataTableSkeleton role="progressbar" />
146
+ )}
141
147
  </div>
142
148
  );
143
149
  }
@@ -145,12 +151,10 @@ function DefaultQueueTable() {
145
151
  function QueueDropdownFilter() {
146
152
  const { t } = useTranslation();
147
153
  const layout = useLayoutType();
148
- const currentQueueLocation = useSelectedQueueLocationUuid();
149
- const { queues } = useQueues(currentQueueLocation);
150
- const currentServiceName = useSelectedServiceName();
154
+ const { services } = useQueueServices();
155
+ const selectedService = useSelectedService();
151
156
  const handleServiceChange = ({ selectedItem }) => {
152
- updateSelectedServiceUuid(selectedItem.uuid);
153
- updateSelectedServiceName(selectedItem.display);
157
+ updateSelectedService(selectedItem.uuid, selectedItem?.display);
154
158
  };
155
159
 
156
160
  return (
@@ -158,10 +162,37 @@ function QueueDropdownFilter() {
158
162
  <div className={styles.filterContainer}>
159
163
  <Dropdown
160
164
  id="serviceFilter"
161
- titleText={t('showPatientsWaitingFor', 'Show patients waiting for') + ':'}
162
- label={currentServiceName}
165
+ titleText={t('filterByService', 'Filter by service :')}
166
+ label={selectedService?.serviceDisplay ?? t('all', 'All')}
167
+ type="inline"
168
+ items={[{ display: `${t('all', 'All')}` }, ...(services ?? [])]}
169
+ itemToString={(item) => (item ? item.display : '')}
170
+ onChange={handleServiceChange}
171
+ size={isDesktop(layout) ? 'sm' : 'lg'}
172
+ />
173
+ </div>
174
+ </>
175
+ );
176
+ }
177
+
178
+ function StatusDropdownFilter() {
179
+ const { t } = useTranslation();
180
+ const layout = useLayoutType();
181
+ const { statuses } = useQueueStatuses();
182
+ const queueStatus = useSelectedQueueStatus();
183
+ const handleServiceChange = ({ selectedItem }) => {
184
+ updateSelectedQueueStatus(selectedItem.uuid, selectedItem?.display);
185
+ };
186
+
187
+ return (
188
+ <>
189
+ <div className={styles.filterContainer}>
190
+ <Dropdown
191
+ id="statusFilter"
192
+ titleText={t('filterByStatus', 'Filter by status :')}
193
+ label={queueStatus?.statusDisplay ?? t('all', 'All')}
163
194
  type="inline"
164
- items={[{ display: `${t('all', 'All')}` }, ...queues]}
195
+ items={[{ display: `${t('all', 'All')}` }, ...(statuses ?? [])]}
165
196
  itemToString={(item) => (item ? item.display : '')}
166
197
  onChange={handleServiceChange}
167
198
  size={isDesktop(layout) ? 'sm' : 'lg'}
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { type QueueEntry } from '../../types';
4
- import QueueEntryActionModal from './queue-entry-actions-modal.component';
4
+ import QueueEntryActionModal from './queue-entry-actions.modal';
5
5
  import { updateQueueEntry } from './queue-entry-actions.resource';
6
6
  import { useQueues } from '../../hooks/useQueues';
7
7
  import { convertTime12to24 } from '../../helpers/time-helpers';
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { type QueueEntry } from '../../types';
4
4
  import { updateQueueEntry } from './queue-entry-actions.resource';
5
- import QueueEntryConfirmActionModal from './queue-entry-confirm-action-modal.component';
5
+ import QueueEntryConfirmActionModal from './queue-entry-confirm-action.modal';
6
6
 
7
7
  interface EndQueueEntryModalProps {
8
8
  queueEntry: QueueEntry;
@@ -3,9 +3,9 @@ import { screen } from '@testing-library/react';
3
3
  import { mockQueueEntryBrian, mockQueueSurgery, mockStatusInService, mockQueues } from '__mocks__';
4
4
  import React from 'react';
5
5
  import { renderWithSwr } from 'tools';
6
- import TransitionQueueEntryModal from './transition-queue-entry-modal.component';
6
+ import TransitionQueueEntryModal from './transition-queue-entry.modal';
7
7
  import userEvent from '@testing-library/user-event';
8
- import EditQueueEntryModal from './edit-queue-entry-modal.component';
8
+ import EditQueueEntryModal from './edit-queue-entry.modal';
9
9
 
10
10
  const mockedOpenmrsFetch = openmrsFetch as jest.Mock;
11
11
 
@@ -4,9 +4,9 @@ import { mockQueues, mockQueueEntryAlice } from '__mocks__';
4
4
  import React from 'react';
5
5
  import { renderWithSwr } from 'tools';
6
6
  import userEvent from '@testing-library/user-event';
7
- import UndoTransitionQueueEntryModal from './undo-transition-queue-entry-modal.component';
8
- import VoidQueueEntryModal from './void-queue-entry-modal.component';
9
- import EndQueueEntryModal from './end-queue-entry-modal.component';
7
+ import UndoTransitionQueueEntryModal from './undo-transition-queue-entry.modal';
8
+ import VoidQueueEntryModal from './void-queue-entry.modal';
9
+ import EndQueueEntryModal from './end-queue-entry.modal';
10
10
 
11
11
  const mockedOpenmrsFetch = openmrsFetch as jest.Mock;
12
12
 
@@ -4,8 +4,8 @@ import { mockQueues, mockQueueEntryAlice } from '__mocks__';
4
4
  import React from 'react';
5
5
  import { renderWithSwr } from 'tools';
6
6
  import userEvent from '@testing-library/user-event';
7
- import UndoTransitionQueueEntryModal from './undo-transition-queue-entry-modal.component';
8
- import VoidQueueEntryModal from './void-queue-entry-modal.component';
7
+ import UndoTransitionQueueEntryModal from './undo-transition-queue-entry.modal';
8
+ import VoidQueueEntryModal from './void-queue-entry.modal';
9
9
 
10
10
  const mockedOpenmrsFetch = openmrsFetch as jest.Mock;
11
11
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { type QueueEntry } from '../../types';
4
- import QueueEntryActionModal from './queue-entry-actions-modal.component';
4
+ import QueueEntryActionModal from './queue-entry-actions.modal';
5
5
  import { transitionQueueEntry } from './queue-entry-actions.resource';
6
6
  import { convertTime12to24 } from '../../helpers/time-helpers';
7
7
 
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { type QueueEntry } from '../../types';
4
4
  import { undoTransition } from './queue-entry-actions.resource';
5
- import QueueEntryConfirmActionModal from './queue-entry-confirm-action-modal.component';
5
+ import QueueEntryConfirmActionModal from './queue-entry-confirm-action.modal';
6
6
 
7
7
  interface UndoTransitionQueueEntryModalProps {
8
8
  queueEntry: QueueEntry;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import { type QueueEntry } from '../../types';
4
4
  import { voidQueueEntry } from './queue-entry-actions.resource';
5
- import QueueEntryConfirmActionModal from './queue-entry-confirm-action-modal.component';
5
+ import QueueEntryConfirmActionModal from './queue-entry-confirm-action.modal';
6
6
 
7
7
  interface VoidQueueEntryModalProps {
8
8
  queueEntry: QueueEntry;
@@ -2,31 +2,31 @@ import { DataTableSkeleton, SkeletonText, Tab, TabList, TabPanel, TabPanels, Tab
2
2
  import { isDesktop, useLayoutType } from '@openmrs/esm-framework';
3
3
  import React from 'react';
4
4
  import styles from './queue-table.scss';
5
+ import classNames from 'classnames';
5
6
 
6
7
  export const QueueTableByStatusSkeleton = () => {
7
8
  const layout = useLayoutType();
8
9
 
9
10
  return (
10
11
  <div className={styles.container}>
11
- <div className={styles.headerContainer}>
12
- <div className={!isDesktop(layout) ? styles.tabletHeading : styles.desktopHeading}>
13
- <h3>
14
- <SkeletonText />
15
- </h3>
16
- </div>
12
+ <div className={styles.statusTableContainer}>
13
+ <h5 className={styles.statusTableHeader}>
14
+ <SkeletonText width={'40%'} />
15
+ </h5>
16
+ <DataTableSkeleton showHeader={false} />
17
+ </div>
18
+ <div className={styles.statusTableContainer}>
19
+ <h5 className={styles.statusTableHeader}>
20
+ <SkeletonText width={'40%'} />
21
+ </h5>
22
+ <DataTableSkeleton showHeader={false} />
23
+ </div>
24
+ <div className={styles.statusTableContainer}>
25
+ <h5 className={styles.statusTableHeader}>
26
+ <SkeletonText width={'40%'} />
27
+ </h5>
28
+ <DataTableSkeleton showHeader={false} />
17
29
  </div>
18
- <Tabs selectedIndex={0}>
19
- <TabList>
20
- <Tab>
21
- <SkeletonText />
22
- </Tab>
23
- </TabList>
24
- </Tabs>
25
- <TabPanels>
26
- <TabPanel>
27
- <DataTableSkeleton />
28
- </TabPanel>
29
- </TabPanels>
30
30
  </div>
31
31
  );
32
32
  };
@@ -15,7 +15,7 @@
15
15
  }
16
16
 
17
17
  .tileContainerWithoutBorder {
18
- height: 4.875rem;
18
+ padding: spacing.$spacing-04;
19
19
  }
20
20
 
21
21
  .tileHeader {
@@ -7,5 +7,5 @@
7
7
  display: flex;
8
8
  justify-content: space-between;
9
9
  flex-flow: row wrap;
10
- margin-top: -(spacing.$spacing-03);
10
+ margin: spacing.$spacing-05;
11
11
  }