@kenyaemr/esm-service-queues-app 7.0.2-pre.65
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/.turbo/turbo-build.log +40 -0
- package/README.md +20 -0
- package/dist/130.js +2 -0
- package/dist/130.js.LICENSE.txt +3 -0
- package/dist/130.js.map +1 -0
- package/dist/152.js +1 -0
- package/dist/152.js.map +1 -0
- package/dist/169.js +1 -0
- package/dist/169.js.map +1 -0
- package/dist/185.js +1 -0
- package/dist/185.js.map +1 -0
- package/dist/233.js +1 -0
- package/dist/233.js.map +1 -0
- package/dist/237.js +1 -0
- package/dist/237.js.map +1 -0
- package/dist/255.js +2 -0
- package/dist/255.js.LICENSE.txt +9 -0
- package/dist/255.js.map +1 -0
- package/dist/271.js +1 -0
- package/dist/276.js +1 -0
- package/dist/276.js.map +1 -0
- package/dist/303.js +1 -0
- package/dist/303.js.map +1 -0
- package/dist/319.js +1 -0
- package/dist/401.js +1 -0
- package/dist/401.js.map +1 -0
- package/dist/430.js +2 -0
- package/dist/430.js.LICENSE.txt +50 -0
- package/dist/430.js.map +1 -0
- package/dist/460.js +1 -0
- package/dist/501.js +1 -0
- package/dist/501.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/591.js +2 -0
- package/dist/591.js.LICENSE.txt +32 -0
- package/dist/591.js.map +1 -0
- package/dist/644.js +1 -0
- package/dist/647.js +1 -0
- package/dist/647.js.map +1 -0
- package/dist/650.js +1 -0
- package/dist/650.js.map +1 -0
- package/dist/669.js +1 -0
- package/dist/669.js.map +1 -0
- package/dist/696.js +1 -0
- package/dist/696.js.map +1 -0
- package/dist/703.js +1 -0
- package/dist/703.js.map +1 -0
- package/dist/729.js +1 -0
- package/dist/729.js.map +1 -0
- package/dist/738.js +1 -0
- package/dist/738.js.map +1 -0
- package/dist/757.js +1 -0
- package/dist/764.js +1 -0
- package/dist/764.js.map +1 -0
- package/dist/784.js +2 -0
- package/dist/784.js.LICENSE.txt +9 -0
- package/dist/784.js.map +1 -0
- package/dist/788.js +1 -0
- package/dist/806.js +1 -0
- package/dist/806.js.map +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/877.js +1 -0
- package/dist/877.js.map +1 -0
- package/dist/917.js +1 -0
- package/dist/917.js.map +1 -0
- package/dist/940.js +1 -0
- package/dist/940.js.map +1 -0
- package/dist/981.js +1 -0
- package/dist/981.js.map +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js +1 -0
- package/dist/kenyaemr-esm-service-queues-app.js.buildmanifest.json +965 -0
- package/dist/kenyaemr-esm-service-queues-app.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +60 -0
- package/dist/main.js.map +1 -0
- package/dist/routes.json +1 -0
- package/jest.config.js +3 -0
- package/package.json +54 -0
- package/src/active-visits/active-visits-row-actions.component.tsx +25 -0
- package/src/active-visits/active-visits-row-actions.scss +4 -0
- package/src/active-visits/active-visits-table.resource.ts +273 -0
- package/src/active-visits/change-status-dialog.component.tsx +272 -0
- package/src/active-visits/change-status-dialog.scss +47 -0
- package/src/active-visits/change-status-dialog.test.tsx +154 -0
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.component.tsx +228 -0
- package/src/add-patient-toqueue/add-patient-toqueue-dialog.scss +32 -0
- package/src/add-provider-queue-room/add-provider-queue-room.component.tsx +238 -0
- package/src/add-provider-queue-room/add-provider-queue-room.resource.ts +76 -0
- package/src/add-provider-queue-room/add-provider-queue-room.scss +17 -0
- package/src/add-provider-queue-room/add-provider-queue-room.test.tsx +105 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.component.tsx +76 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.resource.ts +7 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.scss +8 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries-dialog.test.tsx +43 -0
- package/src/clear-queue-entries-dialog/clear-queue-entries.component.tsx +43 -0
- package/src/config-schema.ts +465 -0
- package/src/constants.ts +10 -0
- package/src/createDashboardLink.component.tsx +39 -0
- package/src/current-visit/current-visit-summary.component.tsx +38 -0
- package/src/current-visit/current-visit-summary.test.tsx +43 -0
- package/src/current-visit/current-visit.resource.ts +84 -0
- package/src/current-visit/current-visit.scss +34 -0
- package/src/current-visit/hooks/useVitalsConceptMetadata.tsx +101 -0
- package/src/current-visit/visit-details/biometrics-config-schema.ts +14 -0
- package/src/current-visit/visit-details/current-visit-details.component.tsx +96 -0
- package/src/current-visit/visit-details/triage-note.component.tsx +53 -0
- package/src/current-visit/visit-details/triage-note.scss +89 -0
- package/src/current-visit/visit-details/vitals-config-schema.ts +17 -0
- package/src/current-visit/visit-details/vitals.component.tsx +165 -0
- package/src/dashboard.meta.ts +5 -0
- package/src/declarations.d.ts +4 -0
- package/src/helpers/functions.ts +28 -0
- package/src/helpers/helpers.ts +177 -0
- package/src/helpers/time-helpers.ts +15 -0
- package/src/home.component.tsx +16 -0
- package/src/home.test.tsx +48 -0
- package/src/hooks/useConcept.ts +13 -0
- package/src/hooks/useQueue.ts +10 -0
- package/src/hooks/useQueueEntries.ts +187 -0
- package/src/hooks/useQueues.ts +22 -0
- package/src/hooks/useSystemSetting.ts +18 -0
- package/src/index.ts +172 -0
- package/src/past-visit/past-visit-details/encounter-list.component.tsx +54 -0
- package/src/past-visit/past-visit-details/medications-list.component.tsx +98 -0
- package/src/past-visit/past-visit-details/notes-list.component.tsx +41 -0
- package/src/past-visit/past-visit-details/past-visit-summary.component.tsx +181 -0
- package/src/past-visit/past-visit-details/past-visit-summary.scss +58 -0
- package/src/past-visit/past-visit.component.tsx +37 -0
- package/src/past-visit/past-visit.resource.ts +83 -0
- package/src/past-visit/past-visit.scss +126 -0
- package/src/past-visit/past-visit.test.tsx +41 -0
- package/src/patient-info/appointment-details.component.tsx +98 -0
- package/src/patient-info/appointment-details.scss +34 -0
- package/src/patient-info/appointment-details.test.tsx +36 -0
- package/src/patient-info/appointments.resource.ts +43 -0
- package/src/patient-info/hooks/usePatientAttributes.tsx +42 -0
- package/src/patient-info/patient-info.component.tsx +82 -0
- package/src/patient-info/patient-info.scss +60 -0
- package/src/patient-info/patient-info.test.tsx +43 -0
- package/src/patient-queue-header/patient-queue-header.component.tsx +99 -0
- package/src/patient-queue-header/patient-queue-header.scss +90 -0
- package/src/patient-queue-header/patient-queue-illustration.component.tsx +22 -0
- package/src/patient-queue-metrics/clinic-metrics.component.tsx +98 -0
- package/src/patient-queue-metrics/clinic-metrics.resource.ts +58 -0
- package/src/patient-queue-metrics/clinic-metrics.scss +11 -0
- package/src/patient-queue-metrics/clinic-metrics.test.tsx +76 -0
- package/src/patient-queue-metrics/metrics-card.component.tsx +68 -0
- package/src/patient-queue-metrics/metrics-card.scss +80 -0
- package/src/patient-queue-metrics/metrics-header.component.tsx +61 -0
- package/src/patient-queue-metrics/metrics-header.scss +26 -0
- package/src/patient-queue-metrics/queue-metrics.resource.ts +42 -0
- package/src/patient-search/advanced-search.component.tsx +191 -0
- package/src/patient-search/advanced-search.scss +154 -0
- package/src/patient-search/advanced-search.test.tsx +29 -0
- package/src/patient-search/basic-search.component.tsx +112 -0
- package/src/patient-search/basic-search.scss +139 -0
- package/src/patient-search/basic-search.test.tsx +23 -0
- package/src/patient-search/empty-data-illustration.component.tsx +41 -0
- package/src/patient-search/hooks/useActivePatientEnrollment.tsx +29 -0
- package/src/patient-search/hooks/useDefaultLocation.ts +14 -0
- package/src/patient-search/hooks/usePatients.tsx +25 -0
- package/src/patient-search/hooks/useQueueLocations.tsx +23 -0
- package/src/patient-search/hooks/useRecommendedVisitTypes.tsx +35 -0
- package/src/patient-search/hooks/useScheduledVisits.ts +52 -0
- package/src/patient-search/patient-scheduled-visits.component.tsx +324 -0
- package/src/patient-search/patient-scheduled-visits.scss +131 -0
- package/src/patient-search/patient-scheduled-visits.test.tsx +44 -0
- package/src/patient-search/patient-search.scss +43 -0
- package/src/patient-search/patient-search.workspace.tsx +135 -0
- package/src/patient-search/search-illustration.component.tsx +27 -0
- package/src/patient-search/search-results.component.tsx +75 -0
- package/src/patient-search/search-results.scss +80 -0
- package/src/patient-search/search-results.test.tsx +77 -0
- package/src/patient-search/search.resource.ts +10 -0
- package/src/patient-search/visit-form/existing-visit-form.component.tsx +112 -0
- package/src/patient-search/visit-form/queue.resource.ts +64 -0
- package/src/patient-search/visit-form/visit-form.component.tsx +344 -0
- package/src/patient-search/visit-form/visit-form.scss +73 -0
- package/src/patient-search/visit-form/visit-type-selector.component.tsx +155 -0
- package/src/patient-search/visit-form/visit-type-selector.scss +100 -0
- package/src/patient-search/visit-form/visit-type-selector.test.tsx +83 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.component.tsx +178 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.scss +19 -0
- package/src/patient-search/visit-form-queue-fields/visit-form-queue-fields.test.tsx +63 -0
- package/src/queue-entry-table-components/edit-entry.scss +14 -0
- package/src/queue-entry-table-components/queue-duration.component.tsx +41 -0
- package/src/queue-entry-table-components/queue-priority.component.tsx +38 -0
- package/src/queue-entry-table-components/queue-priority.scss +12 -0
- package/src/queue-entry-table-components/queue-status.component.tsx +39 -0
- package/src/queue-entry-table-components/transition-entry.component.tsx +55 -0
- package/src/queue-entry-table-components/transition-entry.scss +22 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.component.tsx +241 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.scss +110 -0
- package/src/queue-patient-linelists/queue-linelist-base-table.test.tsx +93 -0
- package/src/queue-patient-linelists/queue-linelist-filter.scss +63 -0
- package/src/queue-patient-linelists/queue-linelist-filter.test.tsx +94 -0
- package/src/queue-patient-linelists/queue-linelist-filter.workspace.tsx +185 -0
- package/src/queue-patient-linelists/queue-linelist.resource.ts +84 -0
- package/src/queue-patient-linelists/queue-services-table.component.tsx +63 -0
- package/src/queue-patient-linelists/scheduled-appointments-table.component.tsx +305 -0
- package/src/queue-patient-linelists/scheduled-appointments-table.test.tsx +41 -0
- package/src/queue-rooms/queue-room-form.scss +56 -0
- package/src/queue-rooms/queue-room-form.test.tsx +80 -0
- package/src/queue-rooms/queue-room-form.workspace.tsx +169 -0
- package/src/queue-rooms/queue-room.resource.ts +20 -0
- package/src/queue-screen/queue-screen.component.tsx +47 -0
- package/src/queue-screen/queue-screen.scss +39 -0
- package/src/queue-screen/queue-screen.test.tsx +51 -0
- package/src/queue-screen/useActiveTickets.tsx +13 -0
- package/src/queue-services/queue-service-form.scss +61 -0
- package/src/queue-services/queue-service-form.test.tsx +60 -0
- package/src/queue-services/queue-service-form.workspace.tsx +179 -0
- package/src/queue-services/queue-service.resource.ts +33 -0
- package/src/queue-table/cells/columns.resource.ts +135 -0
- package/src/queue-table/cells/queue-table-action-cell.component.tsx +88 -0
- package/src/queue-table/cells/queue-table-action-cell.scss +7 -0
- package/src/queue-table/cells/queue-table-coming-from-cell.component.tsx +13 -0
- package/src/queue-table/cells/queue-table-extension-cell.component.tsx +16 -0
- package/src/queue-table/cells/queue-table-name-cell.component.tsx +20 -0
- package/src/queue-table/cells/queue-table-patient-age-cell.component.tsx +18 -0
- package/src/queue-table/cells/queue-table-patient-identifier-cell.component.tsx +25 -0
- package/src/queue-table/cells/queue-table-priority-cell.component.tsx +23 -0
- package/src/queue-table/cells/queue-table-queue-name-cell.component.tsx +14 -0
- package/src/queue-table/cells/queue-table-status-cell.component.tsx +18 -0
- package/src/queue-table/cells/queue-table-visit-attribute-queue-number-cell.component.tsx +37 -0
- package/src/queue-table/cells/queue-table-visit-start-time-cell.component.tsx +20 -0
- package/src/queue-table/cells/queue-table-wait-time-cell.component.tsx +17 -0
- package/src/queue-table/default-queue-table.component.tsx +174 -0
- package/src/queue-table/default-queue-table.test.tsx +131 -0
- package/src/queue-table/queue-entry-actions/edit-queue-entry-modal.component.tsx +52 -0
- package/src/queue-table/queue-entry-actions/end-queue-entry-modal.component.tsx +39 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.component.tsx +362 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions-modal.test.tsx +152 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actions.resource.ts +83 -0
- package/src/queue-table/queue-entry-actions/queue-entry-actons-modal.scss +36 -0
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action-modal.component.tsx +97 -0
- package/src/queue-table/queue-entry-actions/queue-entry-confirm-action-modal.test.tsx +106 -0
- package/src/queue-table/queue-entry-actions/queue-entry-undo-actions-modal.test.tsx +76 -0
- package/src/queue-table/queue-entry-actions/transition-queue-entry-modal.component.tsx +51 -0
- package/src/queue-table/queue-entry-actions/undo-transition-queue-entry-modal.component.tsx +58 -0
- package/src/queue-table/queue-entry-actions/void-queue-entry-modal.component.tsx +34 -0
- package/src/queue-table/queue-table-by-status-menu.component.tsx +42 -0
- package/src/queue-table/queue-table-by-status-menu.scss +11 -0
- package/src/queue-table/queue-table-by-status-skeleton.component.tsx +32 -0
- package/src/queue-table/queue-table-by-status.component.tsx +96 -0
- package/src/queue-table/queue-table-expanded-row.component.tsx +29 -0
- package/src/queue-table/queue-table-metrics-card.component.tsx +50 -0
- package/src/queue-table/queue-table-metrics-card.scss +48 -0
- package/src/queue-table/queue-table-metrics.component.tsx +30 -0
- package/src/queue-table/queue-table-metrics.scss +11 -0
- package/src/queue-table/queue-table.component.tsx +179 -0
- package/src/queue-table/queue-table.scss +192 -0
- package/src/queue-table/queue-table.test.tsx +210 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.component.tsx +87 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.resource.ts +93 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.scss +7 -0
- package/src/remove-queue-entry-dialog/remove-queue-entry.test.tsx +45 -0
- package/src/root.component.tsx +28 -0
- package/src/root.scss +15 -0
- package/src/root.test.tsx +24 -0
- package/src/routes.json +133 -0
- package/src/side-menu/nav-group/createNavGroup.tsx +17 -0
- package/src/side-menu/nav-group/nav-group.component.tsx +24 -0
- package/src/side-menu/nav-group/nav-group.test.tsx +32 -0
- package/src/side-menu/nav-group/nav-group.ts +10 -0
- package/src/side-menu/side-menu.component.tsx +6 -0
- package/src/side-menu/side-menu.test.tsx +17 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.component.tsx +134 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.scss +12 -0
- package/src/transition-queue-entry/transition-queue-entry-dialog.test.tsx +102 -0
- package/src/transition-queue-entry/transition-queue-entry.resource.ts +16 -0
- package/src/types/index.ts +494 -0
- package/src/views/queue-table-by-status-view.component.tsx +25 -0
- package/src/views/queue-tables-for-all-statuses.component.tsx +150 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.component.tsx +277 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.resource.ts +93 -0
- package/src/visits-missing-inqueue/visits-missing-inqueue.scss +108 -0
- package/translations/am.json +295 -0
- package/translations/ar.json +295 -0
- package/translations/en.json +305 -0
- package/translations/es.json +295 -0
- package/translations/fr.json +295 -0
- package/translations/he.json +295 -0
- package/translations/km.json +295 -0
- package/translations/zh.json +295 -0
- package/translations/zh_CN.json +295 -0
- package/tsconfig.json +5 -0
- package/webpack.config.js +1 -0
package/dist/routes.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"webservices.rest":"^2.2.0","queue":"^2.4.0-0"},"extensions":[{"name":"outpatient-side-nav-ext","component":"outpatientSideNav","slot":"outpatient-sidebar-slot","online":true,"offline":true},{"name":"service-queues-dashboard-link","component":"serviceQueuesDashboardLink","slot":"homepage-dashboard-slot","meta":{"name":"service-queues","slot":"service-queues-dashboard-slot","title":"Service queues"},"online":true,"offline":true},{"name":"queue-table-by-status-menu-dashboard-link","component":"queueTableByStatusMenu","meta":{"name":"service-queues","slot":"service-queues-dashboard-slot","title":"Service queues"},"online":true,"offline":true},{"component":"root","name":"service-queues-dashboard","slot":"service-queues-dashboard-slot"},{"name":"edit-queue-entry-status-modal","component":"editQueueEntryStatusModal"},{"name":"patient-info-banner-slot","component":"patientInfoBannerSlot"},{"name":"remove-queue-entry","component":"removeQueueEntry"},{"name":"clear-all-queue-entries","component":"clearAllQueueEntries"},{"name":"add-visit-to-queue-modal","component":"addVisitToQueueModal"},{"name":"transition-queue-entry-status-modal","component":"transitionQueueEntryStatusModal"},{"name":"previous-visit-summary-widget","component":"pastVisitSummary","slot":"previous-visit-summary-slot"},{"name":"add-provider-to-room-modal","component":"addProviderToRoomModal"},{"name":"transition-queue-entry-modal","component":"transitionQueueEntryModal"},{"name":"edit-queue-entry-modal","component":"editQueueEntryModal"},{"name":"undo-transition-queue-entry-modal","component":"undoTransitionQueueEntryModal"},{"name":"void-queue-entry-modal","component":"voidQueueEntryModal"},{"name":"end-queue-entry-modal","component":"endQueueEntryModal"},{"name":"active-visits-row-actions","component":"activeVisitsRowActions","slot":"queue-table-serve-patient-slot"},{"name":"visit-form-queue-fields","component":"visitFormQueueFields","slot":"visit-form-queue-slot"}],"workspaces":[{"name":"service-queues-service-form","title":"addNewQueueService","component":"addNewQueueServiceWorkspace","type":"service-queues"},{"name":"service-queues-room-form","title":"addNewQueueServiceRoom","component":"addNewQueueServiceRoomWorkspace","type":"service-queues"},{"name":"service-queues-linelist-filter","title":"filter","component":"queueLinelistFilterWorkspace","type":"service-queues"},{"name":"service-queues-patient-search","title":"searchPatient","component":"patientSearchWorkspace","type":"service-queues"}],"version":"7.0.2-pre.65"}
|
package/jest.config.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kenyaemr/esm-service-queues-app",
|
|
3
|
+
"version": "7.0.2-pre.65",
|
|
4
|
+
"description": "Outpatient front-end module for the OpenMRS SPA",
|
|
5
|
+
"browser": "dist/kenyaemr-esm-service-queues-app.js",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"source": true,
|
|
8
|
+
"license": "MPL-2.0",
|
|
9
|
+
"homepage": "https://github.com/openmrs/openmrs-esm-patient-management#readme",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "openmrs develop",
|
|
12
|
+
"serve": "webpack serve --mode=development",
|
|
13
|
+
"debug": "npm run serve",
|
|
14
|
+
"build": "webpack --mode production",
|
|
15
|
+
"analyze": "webpack --mode=production --env.analyze=true",
|
|
16
|
+
"lint": "cross-env eslint src --ext ts,tsx",
|
|
17
|
+
"test": "cross-env TZ=UTC jest --config jest.config.js --verbose false --passWithNoTests --color",
|
|
18
|
+
"test:watch": "cross-env TZ=UTC jest --watch --config jest.config.js --color",
|
|
19
|
+
"coverage": "yarn test --coverage",
|
|
20
|
+
"typescript": "tsc",
|
|
21
|
+
"extract-translations": "i18next 'src/**/*.component.tsx' 'src/**/*.extension.tsx' 'src/**/*.workspace.tsx' 'src/index.ts' --config ../../tools/i18next-parser.config.js"
|
|
22
|
+
},
|
|
23
|
+
"browserslist": [
|
|
24
|
+
"extends browserslist-config-openmrs"
|
|
25
|
+
],
|
|
26
|
+
"keywords": [
|
|
27
|
+
"openmrs"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/openmrs/openmrs-esm-patient-management.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/openmrs/openmrs-esm-patient-management/issues"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@carbon/react": "~1.37.0",
|
|
41
|
+
"lodash-es": "^4.17.15"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@openmrs/esm-framework": "5.x",
|
|
45
|
+
"react": "^18.1.0",
|
|
46
|
+
"react-i18next": "11.x",
|
|
47
|
+
"react-router-dom": "6.x",
|
|
48
|
+
"swr": "2.x"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"webpack": "^5.74.0"
|
|
52
|
+
},
|
|
53
|
+
"stableVersion": "7.0.1"
|
|
54
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TransitionMenu from '../queue-entry-table-components/transition-entry.component';
|
|
3
|
+
import { type QueueTableCellComponentProps, type QueueEntry } from '../types';
|
|
4
|
+
import { useConfig } from '@openmrs/esm-framework';
|
|
5
|
+
import { type ConfigObject } from '../config-schema';
|
|
6
|
+
import { mapVisitQueueEntryProperties } from './active-visits-table.resource';
|
|
7
|
+
import styles from './active-visits-row-actions.scss';
|
|
8
|
+
|
|
9
|
+
// This component is meant to be mounted as an extension in the queue-table-extension-column-slot.
|
|
10
|
+
// Defines the following actions the user can perform on a queue entry:
|
|
11
|
+
// - queue / requeue (to the in-service status)
|
|
12
|
+
|
|
13
|
+
const ActiveVisitRowActionsCell = ({ queueEntry }: QueueTableCellComponentProps) => {
|
|
14
|
+
const { visitQueueNumberAttributeUuid } = useConfig<ConfigObject>();
|
|
15
|
+
|
|
16
|
+
const mappedQueueEntry = mapVisitQueueEntryProperties(queueEntry, visitQueueNumberAttributeUuid);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className={styles.transitionMenuContainer}>
|
|
20
|
+
<TransitionMenu queueEntry={mappedQueueEntry} />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default ActiveVisitRowActionsCell;
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { formatDate, openmrsFetch, parseDate, restBaseUrl, type Visit } from '@openmrs/esm-framework';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
|
+
import isToday from 'dayjs/plugin/isToday';
|
|
4
|
+
import isEmpty from 'lodash-es/isEmpty';
|
|
5
|
+
import useSWR from 'swr';
|
|
6
|
+
import { type Concept, type Identifer, type MappedServiceQueueEntry, type Queue, type QueueEntry } from '../types';
|
|
7
|
+
|
|
8
|
+
dayjs.extend(isToday);
|
|
9
|
+
|
|
10
|
+
export interface VisitQueueEntry {
|
|
11
|
+
queueEntry: QueueEntry;
|
|
12
|
+
uuid: string;
|
|
13
|
+
visit: Visit;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface MappedVisitQueueEntry {
|
|
17
|
+
id: string;
|
|
18
|
+
encounters: Array<MappedEncounter>;
|
|
19
|
+
name: string;
|
|
20
|
+
patientAge: string;
|
|
21
|
+
patientDob: string;
|
|
22
|
+
patientUuid: string;
|
|
23
|
+
queue: Queue;
|
|
24
|
+
priority: Concept;
|
|
25
|
+
priorityComment: string;
|
|
26
|
+
status: Concept;
|
|
27
|
+
startedAt: Date;
|
|
28
|
+
endedAt: Date;
|
|
29
|
+
visitType: string;
|
|
30
|
+
visitUuid: string;
|
|
31
|
+
visitTypeUuid: string;
|
|
32
|
+
queueUuid: string;
|
|
33
|
+
queueEntryUuid: string;
|
|
34
|
+
queueLocation: string;
|
|
35
|
+
sortWeight: number;
|
|
36
|
+
visitQueueNumber: string;
|
|
37
|
+
identifiers: Array<Identifer>;
|
|
38
|
+
queueComingFrom: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface ObsData {
|
|
42
|
+
concept: {
|
|
43
|
+
display: string;
|
|
44
|
+
uuid: string;
|
|
45
|
+
};
|
|
46
|
+
value?: string | any;
|
|
47
|
+
groupMembers?: Array<{
|
|
48
|
+
concept: { uuid: string; display: string };
|
|
49
|
+
value?: string | any;
|
|
50
|
+
}>;
|
|
51
|
+
obsDatetime: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface Encounter {
|
|
55
|
+
diagnoses: Array<any>;
|
|
56
|
+
encounterDatetime: string;
|
|
57
|
+
encounterProviders?: Array<{ provider: { person: { display: string } } }>;
|
|
58
|
+
encounterType: { display: string; uuid: string };
|
|
59
|
+
obs: Array<ObsData>;
|
|
60
|
+
uuid: string;
|
|
61
|
+
voided: boolean;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface MappedEncounter extends Omit<Encounter, 'encounterType' | 'provider'> {
|
|
65
|
+
encounterType: string;
|
|
66
|
+
provider: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const mapEncounterProperties = (encounter: Encounter): MappedEncounter => ({
|
|
70
|
+
diagnoses: encounter.diagnoses,
|
|
71
|
+
encounterDatetime: encounter.encounterDatetime,
|
|
72
|
+
encounterType: encounter.encounterType.display,
|
|
73
|
+
obs: encounter.obs,
|
|
74
|
+
provider: encounter.encounterProviders[0]?.provider?.person?.display,
|
|
75
|
+
uuid: encounter.uuid,
|
|
76
|
+
voided: encounter.voided,
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
export const mapVisitQueueEntryProperties = (
|
|
80
|
+
queueEntry: QueueEntry,
|
|
81
|
+
visitQueueNumberAttributeUuid: string,
|
|
82
|
+
): MappedVisitQueueEntry => ({
|
|
83
|
+
id: queueEntry.uuid,
|
|
84
|
+
encounters: queueEntry.visit?.encounters?.map(mapEncounterProperties),
|
|
85
|
+
name: queueEntry.display,
|
|
86
|
+
patientUuid: queueEntry.patient.uuid,
|
|
87
|
+
patientAge: queueEntry.patient.person?.age + '',
|
|
88
|
+
patientDob: queueEntry?.patient?.person?.birthdate
|
|
89
|
+
? formatDate(parseDate(queueEntry.patient.person.birthdate), { time: false })
|
|
90
|
+
: '--',
|
|
91
|
+
queue: queueEntry.queue,
|
|
92
|
+
priority: queueEntry.priority,
|
|
93
|
+
priorityComment: queueEntry.priorityComment,
|
|
94
|
+
status: queueEntry.status,
|
|
95
|
+
startedAt: dayjs(queueEntry.startedAt).toDate(),
|
|
96
|
+
endedAt: queueEntry.endedAt ? dayjs(queueEntry.endedAt).toDate() : null,
|
|
97
|
+
visitType: queueEntry.visit?.visitType?.display,
|
|
98
|
+
queueLocation: (queueEntry?.queue as any)?.location?.uuid,
|
|
99
|
+
visitTypeUuid: queueEntry.visit?.visitType?.uuid,
|
|
100
|
+
visitUuid: queueEntry.visit?.uuid,
|
|
101
|
+
queueUuid: queueEntry.queue.uuid,
|
|
102
|
+
queueEntryUuid: queueEntry.uuid,
|
|
103
|
+
sortWeight: queueEntry.sortWeight,
|
|
104
|
+
visitQueueNumber: queueEntry.visit?.attributes?.find((e) => e?.attributeType?.uuid === visitQueueNumberAttributeUuid)
|
|
105
|
+
?.value,
|
|
106
|
+
identifiers: queueEntry.patient?.identifiers as Identifer[],
|
|
107
|
+
queueComingFrom: queueEntry?.queueComingFrom?.name,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export async function updateQueueEntry(
|
|
111
|
+
visitUuid: string,
|
|
112
|
+
previousQueueUuid: string,
|
|
113
|
+
newQueueUuid: string,
|
|
114
|
+
queueEntryUuid: string,
|
|
115
|
+
patientUuid: string,
|
|
116
|
+
priority: string,
|
|
117
|
+
status: string,
|
|
118
|
+
endedAt: Date,
|
|
119
|
+
sortWeight: number,
|
|
120
|
+
) {
|
|
121
|
+
const abortController = new AbortController();
|
|
122
|
+
const queueServiceUuid = isEmpty(newQueueUuid) ? previousQueueUuid : newQueueUuid;
|
|
123
|
+
|
|
124
|
+
await Promise.all([endPatientStatus(previousQueueUuid, queueEntryUuid, endedAt)]);
|
|
125
|
+
|
|
126
|
+
return openmrsFetch(`${restBaseUrl}/visit-queue-entry`, {
|
|
127
|
+
method: 'POST',
|
|
128
|
+
headers: {
|
|
129
|
+
'Content-Type': 'application/json',
|
|
130
|
+
},
|
|
131
|
+
signal: abortController.signal,
|
|
132
|
+
body: {
|
|
133
|
+
visit: { uuid: visitUuid },
|
|
134
|
+
queueEntry: {
|
|
135
|
+
status: {
|
|
136
|
+
uuid: status,
|
|
137
|
+
},
|
|
138
|
+
priority: {
|
|
139
|
+
uuid: priority,
|
|
140
|
+
},
|
|
141
|
+
queue: {
|
|
142
|
+
uuid: queueServiceUuid,
|
|
143
|
+
},
|
|
144
|
+
patient: {
|
|
145
|
+
uuid: patientUuid,
|
|
146
|
+
},
|
|
147
|
+
startedAt: new Date(),
|
|
148
|
+
sortWeight: sortWeight,
|
|
149
|
+
queueComingFrom: previousQueueUuid,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export async function endPatientStatus(previousQueueUuid: string, queueEntryUuid: string, endedAt: Date) {
|
|
156
|
+
const abortController = new AbortController();
|
|
157
|
+
await openmrsFetch(`${restBaseUrl}/queue/${previousQueueUuid}/entry/${queueEntryUuid}`, {
|
|
158
|
+
method: 'POST',
|
|
159
|
+
headers: {
|
|
160
|
+
'Content-Type': 'application/json',
|
|
161
|
+
},
|
|
162
|
+
signal: abortController.signal,
|
|
163
|
+
body: {
|
|
164
|
+
endedAt: endedAt,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function useServiceQueueEntries(service: string, locationUuid: string) {
|
|
170
|
+
const apiUrl = `${restBaseUrl}/visit-queue-entry?status=waiting&service=${service}&location=${locationUuid}&v=full`;
|
|
171
|
+
const { data, error, isLoading, isValidating } = useSWR<{ data: { results: Array<VisitQueueEntry> } }, Error>(
|
|
172
|
+
service && locationUuid ? apiUrl : null,
|
|
173
|
+
openmrsFetch,
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
const mapServiceQueueEntryProperties = (visitQueueEntry: VisitQueueEntry): MappedServiceQueueEntry => ({
|
|
177
|
+
id: visitQueueEntry.queueEntry.uuid,
|
|
178
|
+
name: visitQueueEntry.queueEntry.display,
|
|
179
|
+
age: visitQueueEntry.queueEntry.patient ? visitQueueEntry?.queueEntry?.patient?.person?.age + '' : '--',
|
|
180
|
+
returnDate: visitQueueEntry.queueEntry.startedAt,
|
|
181
|
+
visitType: visitQueueEntry.visit?.visitType?.display,
|
|
182
|
+
gender: visitQueueEntry.queueEntry.patient ? visitQueueEntry?.queueEntry?.patient?.person?.gender : '--',
|
|
183
|
+
patientUuid: visitQueueEntry.queueEntry ? visitQueueEntry?.queueEntry.uuid : '--',
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const mappedServiceQueueEntries = data?.data?.results?.map(mapServiceQueueEntryProperties);
|
|
187
|
+
|
|
188
|
+
return {
|
|
189
|
+
serviceQueueEntries: mappedServiceQueueEntries ? mappedServiceQueueEntries : [],
|
|
190
|
+
isLoading,
|
|
191
|
+
isError: error,
|
|
192
|
+
isValidating,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export async function postQueueEntry(
|
|
197
|
+
visitUuid: string,
|
|
198
|
+
queueUuid: string,
|
|
199
|
+
patientUuid: string,
|
|
200
|
+
priority: string,
|
|
201
|
+
status: string,
|
|
202
|
+
sortWeight: number,
|
|
203
|
+
locationUuid: string,
|
|
204
|
+
visitQueueNumberAttributeUuid: string,
|
|
205
|
+
) {
|
|
206
|
+
const abortController = new AbortController();
|
|
207
|
+
|
|
208
|
+
await Promise.all([generateVisitQueueNumber(locationUuid, visitUuid, queueUuid, visitQueueNumberAttributeUuid)]);
|
|
209
|
+
|
|
210
|
+
return openmrsFetch(`${restBaseUrl}/visit-queue-entry`, {
|
|
211
|
+
method: 'POST',
|
|
212
|
+
headers: {
|
|
213
|
+
'Content-Type': 'application/json',
|
|
214
|
+
},
|
|
215
|
+
signal: abortController.signal,
|
|
216
|
+
body: {
|
|
217
|
+
visit: { uuid: visitUuid },
|
|
218
|
+
queueEntry: {
|
|
219
|
+
status: {
|
|
220
|
+
uuid: status,
|
|
221
|
+
},
|
|
222
|
+
priority: {
|
|
223
|
+
uuid: priority,
|
|
224
|
+
},
|
|
225
|
+
queue: {
|
|
226
|
+
uuid: queueUuid,
|
|
227
|
+
},
|
|
228
|
+
patient: {
|
|
229
|
+
uuid: patientUuid,
|
|
230
|
+
},
|
|
231
|
+
startedAt: new Date(),
|
|
232
|
+
sortWeight: sortWeight,
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export async function generateVisitQueueNumber(
|
|
239
|
+
location: string,
|
|
240
|
+
visitUuid: string,
|
|
241
|
+
queueUuid: string,
|
|
242
|
+
visitQueueNumberAttributeUuid: string,
|
|
243
|
+
) {
|
|
244
|
+
const abortController = new AbortController();
|
|
245
|
+
|
|
246
|
+
await openmrsFetch(
|
|
247
|
+
`${restBaseUrl}/queue-entry-number?location=${location}&queue=${queueUuid}&visit=${visitUuid}&visitAttributeType=${visitQueueNumberAttributeUuid}`,
|
|
248
|
+
{
|
|
249
|
+
method: 'GET',
|
|
250
|
+
headers: {
|
|
251
|
+
'Content-Type': 'application/json',
|
|
252
|
+
},
|
|
253
|
+
signal: abortController.signal,
|
|
254
|
+
},
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export function serveQueueEntry(servicePointName: string, ticketNumber: string, status: string) {
|
|
259
|
+
const abortController = new AbortController();
|
|
260
|
+
|
|
261
|
+
return openmrsFetch(`${restBaseUrl}/queueutil/assignticket`, {
|
|
262
|
+
method: 'POST',
|
|
263
|
+
headers: {
|
|
264
|
+
'Content-Type': 'application/json',
|
|
265
|
+
},
|
|
266
|
+
signal: abortController.signal,
|
|
267
|
+
body: {
|
|
268
|
+
servicePointName,
|
|
269
|
+
ticketNumber,
|
|
270
|
+
status,
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
ModalBody,
|
|
5
|
+
ModalFooter,
|
|
6
|
+
ModalHeader,
|
|
7
|
+
Form,
|
|
8
|
+
ContentSwitcher,
|
|
9
|
+
Switch,
|
|
10
|
+
Select,
|
|
11
|
+
SelectItem,
|
|
12
|
+
InlineNotification,
|
|
13
|
+
RadioButton,
|
|
14
|
+
RadioButtonGroup,
|
|
15
|
+
InlineLoading,
|
|
16
|
+
} from '@carbon/react';
|
|
17
|
+
import { useTranslation } from 'react-i18next';
|
|
18
|
+
import { navigate, showSnackbar, useConfig } from '@openmrs/esm-framework';
|
|
19
|
+
import { type MappedQueueEntry } from '../types';
|
|
20
|
+
import { updateQueueEntry } from './active-visits-table.resource';
|
|
21
|
+
import { useQueueLocations } from '../patient-search/hooks/useQueueLocations';
|
|
22
|
+
import styles from './change-status-dialog.scss';
|
|
23
|
+
import { useQueues } from '../hooks/useQueues';
|
|
24
|
+
import { useForm, Controller } from 'react-hook-form';
|
|
25
|
+
import { z } from 'zod';
|
|
26
|
+
import { zodResolver } from '@hookform/resolvers/zod';
|
|
27
|
+
import { type ConfigObject } from '../config-schema';
|
|
28
|
+
import { useMutateQueueEntries } from '../hooks/useQueueEntries';
|
|
29
|
+
|
|
30
|
+
interface ChangeStatusDialogProps {
|
|
31
|
+
queueEntry: MappedQueueEntry;
|
|
32
|
+
closeModal: () => void;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const ChangeStatus: React.FC<ChangeStatusDialogProps> = ({ queueEntry, closeModal }) => {
|
|
36
|
+
const { t } = useTranslation();
|
|
37
|
+
const { concepts } = useConfig<ConfigObject>();
|
|
38
|
+
const { allowedPriorities, allowedStatuses } = queueEntry.queue ?? {};
|
|
39
|
+
|
|
40
|
+
const schema = useMemo(
|
|
41
|
+
() =>
|
|
42
|
+
z.object({
|
|
43
|
+
location: z.string({ required_error: t('queueLocationRequired', 'Queue location is required') }),
|
|
44
|
+
service: z.string({ required_error: t('serviceIsRequired', 'Service is required') }),
|
|
45
|
+
status: z.string({ required_error: t('statusIsRequired', 'Status is required') }),
|
|
46
|
+
priority: z.string({ required_error: t('priorityIsRequired', 'Priority is required') }),
|
|
47
|
+
}),
|
|
48
|
+
[],
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
type ChangeStatusForm = z.infer<typeof schema>;
|
|
52
|
+
|
|
53
|
+
const {
|
|
54
|
+
control,
|
|
55
|
+
handleSubmit,
|
|
56
|
+
formState: { isSubmitting, errors },
|
|
57
|
+
getValues,
|
|
58
|
+
} = useForm<ChangeStatusForm>({
|
|
59
|
+
defaultValues: { priority: allowedPriorities[1]?.uuid },
|
|
60
|
+
resolver: zodResolver(schema),
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const { queues } = useQueues(queueEntry?.queueLocation);
|
|
64
|
+
const { queueLocations } = useQueueLocations();
|
|
65
|
+
const { mutateQueueEntries } = useMutateQueueEntries();
|
|
66
|
+
|
|
67
|
+
const onSubmit = (data: ChangeStatusForm) => {
|
|
68
|
+
const { priority, status, service } = data;
|
|
69
|
+
const defaultPriority = concepts.defaultPriorityConceptUuid;
|
|
70
|
+
const queuePriority = priority === '' ? defaultPriority : priority;
|
|
71
|
+
const emergencyPriorityConceptUuid = concepts.emergencyPriorityConceptUuid;
|
|
72
|
+
const sortWeight = priority === emergencyPriorityConceptUuid ? 1.0 : 0.0;
|
|
73
|
+
const endDate = new Date();
|
|
74
|
+
updateQueueEntry(
|
|
75
|
+
queueEntry?.visitUuid,
|
|
76
|
+
queueEntry?.queue?.uuid,
|
|
77
|
+
service,
|
|
78
|
+
queueEntry?.queueEntryUuid,
|
|
79
|
+
queueEntry?.patientUuid,
|
|
80
|
+
queuePriority,
|
|
81
|
+
status,
|
|
82
|
+
endDate,
|
|
83
|
+
sortWeight,
|
|
84
|
+
).then(
|
|
85
|
+
({ status }) => {
|
|
86
|
+
if (status === 201) {
|
|
87
|
+
showSnackbar({
|
|
88
|
+
isLowContrast: true,
|
|
89
|
+
title: t('updateEntry', 'Update entry'),
|
|
90
|
+
kind: 'success',
|
|
91
|
+
subtitle: t('queueEntryUpdateSuccessfully', 'Queue Entry Updated Successfully'),
|
|
92
|
+
});
|
|
93
|
+
closeModal();
|
|
94
|
+
mutateQueueEntries();
|
|
95
|
+
navigate({ to: `${window.spaBase}/home/service-queues` });
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
(error) => {
|
|
99
|
+
showSnackbar({
|
|
100
|
+
title: t('queueEntryStatusUpdateFailed', 'Error updating queue entry status'),
|
|
101
|
+
kind: 'error',
|
|
102
|
+
subtitle: error?.message,
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
const onError = (errors) => console.error(errors);
|
|
108
|
+
|
|
109
|
+
if (Object.keys(queueEntry)?.length === 0) {
|
|
110
|
+
return <ModalHeader closeModal={closeModal} title={t('patientNotInQueue', 'The patient is not in the queue')} />;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (Object.keys(queueEntry)?.length > 0) {
|
|
114
|
+
return (
|
|
115
|
+
<div>
|
|
116
|
+
<Form onSubmit={handleSubmit(onSubmit, onError)}>
|
|
117
|
+
<ModalHeader
|
|
118
|
+
closeModal={closeModal}
|
|
119
|
+
title={t('movePatientToNextService', 'Move patient to the next service?')}
|
|
120
|
+
/>
|
|
121
|
+
<ModalBody>
|
|
122
|
+
<div className={styles.modalBody}>
|
|
123
|
+
<h5>
|
|
124
|
+
{queueEntry.name} · {queueEntry.patientSex} · {queueEntry.patientAge}
|
|
125
|
+
{t('years', 'Years')}
|
|
126
|
+
</h5>
|
|
127
|
+
</div>
|
|
128
|
+
<section>
|
|
129
|
+
<Controller
|
|
130
|
+
name="location"
|
|
131
|
+
control={control}
|
|
132
|
+
render={({ field: { onChange, value } }) => (
|
|
133
|
+
<Select
|
|
134
|
+
labelText={t('selectQueueLocation', 'Select a queue location')}
|
|
135
|
+
id="location"
|
|
136
|
+
invalid={!!errors.location}
|
|
137
|
+
invalidText={errors.location?.message}
|
|
138
|
+
value={value}
|
|
139
|
+
onChange={(event) => {
|
|
140
|
+
onChange(event.target.value);
|
|
141
|
+
}}>
|
|
142
|
+
{!getValues()?.location && (
|
|
143
|
+
<SelectItem text={t('selectQueueLocation', 'Select a queue location')} value="" />
|
|
144
|
+
)}
|
|
145
|
+
{queueLocations?.length > 0 &&
|
|
146
|
+
queueLocations.map((location) => (
|
|
147
|
+
<SelectItem key={location.id} text={location.name} value={location.id}>
|
|
148
|
+
{location.name}
|
|
149
|
+
</SelectItem>
|
|
150
|
+
))}
|
|
151
|
+
</Select>
|
|
152
|
+
)}
|
|
153
|
+
/>
|
|
154
|
+
</section>
|
|
155
|
+
|
|
156
|
+
<section className={styles.section}>
|
|
157
|
+
<div className={styles.sectionTitle}>{t('queueService', 'Queue service')}</div>
|
|
158
|
+
<Controller
|
|
159
|
+
name="service"
|
|
160
|
+
control={control}
|
|
161
|
+
render={({ field: { onChange, value } }) => (
|
|
162
|
+
<Select
|
|
163
|
+
labelText={t('selectService', 'Select a service')}
|
|
164
|
+
id="service"
|
|
165
|
+
invalid={!!errors.service}
|
|
166
|
+
invalidText={errors.service?.message}
|
|
167
|
+
value={value}
|
|
168
|
+
onChange={(event) => onChange(event.target.value)}>
|
|
169
|
+
{!getValues()?.service && <SelectItem text={t('selectService', 'Select a service')} value="" />}
|
|
170
|
+
{queues?.length > 0 &&
|
|
171
|
+
queues.map((service) => (
|
|
172
|
+
<SelectItem key={service.uuid} text={service.display} value={service.uuid}>
|
|
173
|
+
{service.display}
|
|
174
|
+
</SelectItem>
|
|
175
|
+
))}
|
|
176
|
+
</Select>
|
|
177
|
+
)}
|
|
178
|
+
/>
|
|
179
|
+
</section>
|
|
180
|
+
|
|
181
|
+
<section className={styles.section}>
|
|
182
|
+
<div className={styles.sectionTitle}>{t('queueStatus', 'Queue status')}</div>
|
|
183
|
+
{!allowedStatuses?.length ? (
|
|
184
|
+
<InlineNotification
|
|
185
|
+
className={styles.inlineNotification}
|
|
186
|
+
kind={'error'}
|
|
187
|
+
lowContrast
|
|
188
|
+
subtitle={t('configureStatus', 'Please configure status to continue.')}
|
|
189
|
+
title={t('noStatusConfigured', 'No status configured')}
|
|
190
|
+
/>
|
|
191
|
+
) : (
|
|
192
|
+
<Controller
|
|
193
|
+
name="status"
|
|
194
|
+
control={control}
|
|
195
|
+
render={({ field: { value, onChange } }) => (
|
|
196
|
+
<RadioButtonGroup
|
|
197
|
+
className={styles.radioButtonWrapper}
|
|
198
|
+
name="status"
|
|
199
|
+
invalid={!!errors.status}
|
|
200
|
+
invalidText={errors.status?.message}
|
|
201
|
+
defaultSelected={value}
|
|
202
|
+
onChange={(uuid) => {
|
|
203
|
+
onChange(uuid);
|
|
204
|
+
}}>
|
|
205
|
+
{allowedStatuses?.length > 0 &&
|
|
206
|
+
allowedStatuses.map(({ uuid, display }) => (
|
|
207
|
+
<RadioButton key={uuid} labelText={display} value={uuid} />
|
|
208
|
+
))}
|
|
209
|
+
</RadioButtonGroup>
|
|
210
|
+
)}
|
|
211
|
+
/>
|
|
212
|
+
)}
|
|
213
|
+
</section>
|
|
214
|
+
|
|
215
|
+
<section className={styles.section}>
|
|
216
|
+
<div className={styles.sectionTitle}>{t('queuePriority', 'Queue priority')}</div>
|
|
217
|
+
<Controller
|
|
218
|
+
control={control}
|
|
219
|
+
name="priority"
|
|
220
|
+
render={({ field: { onChange } }) => (
|
|
221
|
+
<>
|
|
222
|
+
<ContentSwitcher
|
|
223
|
+
size="sm"
|
|
224
|
+
selectedIndex={1}
|
|
225
|
+
onChange={(event) => {
|
|
226
|
+
onChange(event.name as any);
|
|
227
|
+
}}>
|
|
228
|
+
{allowedPriorities?.length > 0 ? (
|
|
229
|
+
allowedPriorities.map(({ uuid, display }) => {
|
|
230
|
+
return <Switch name={uuid} text={display} key={uuid} value={uuid} />;
|
|
231
|
+
})
|
|
232
|
+
) : (
|
|
233
|
+
<Switch
|
|
234
|
+
name={t('noPriorityFound', 'No priority found')}
|
|
235
|
+
text={t('noPriorityFound', 'No priority found')}
|
|
236
|
+
value={null}
|
|
237
|
+
/>
|
|
238
|
+
)}
|
|
239
|
+
</ContentSwitcher>
|
|
240
|
+
{errors.priority && <div className={styles.error}>{errors.priority.message}</div>}
|
|
241
|
+
</>
|
|
242
|
+
)}
|
|
243
|
+
/>
|
|
244
|
+
</section>
|
|
245
|
+
</ModalBody>
|
|
246
|
+
<ModalFooter>
|
|
247
|
+
<Button kind="secondary" onClick={closeModal}>
|
|
248
|
+
{t('cancel', 'Cancel')}
|
|
249
|
+
</Button>
|
|
250
|
+
<Button disabled={isSubmitting} type="submit">
|
|
251
|
+
<>
|
|
252
|
+
{isSubmitting ? (
|
|
253
|
+
<div className={styles.inline}>
|
|
254
|
+
<InlineLoading
|
|
255
|
+
status="active"
|
|
256
|
+
iconDescription={t('submitting', 'Submitting')}
|
|
257
|
+
description={t('submitting', 'Submitting')}
|
|
258
|
+
/>
|
|
259
|
+
</div>
|
|
260
|
+
) : (
|
|
261
|
+
t('moveToNextService', 'Move to next service')
|
|
262
|
+
)}
|
|
263
|
+
</>
|
|
264
|
+
</Button>
|
|
265
|
+
</ModalFooter>
|
|
266
|
+
</Form>
|
|
267
|
+
</div>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export default ChangeStatus;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
@use '@carbon/styles/scss/spacing';
|
|
2
|
+
@use '@carbon/styles/scss/type';
|
|
3
|
+
@use '@carbon/colors';
|
|
4
|
+
|
|
5
|
+
.radioButtonGroup {
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
margin-top: spacing.$spacing-03;
|
|
10
|
+
min-height: spacing.$spacing-10;
|
|
11
|
+
width: 100%;
|
|
12
|
+
@include type.type-style('body-compact-01');
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.radioButton {
|
|
16
|
+
padding: spacing.$spacing-02 spacing.$spacing-02;
|
|
17
|
+
margin: spacing.$spacing-03 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
section {
|
|
21
|
+
margin: spacing.$spacing-03;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.sectionTitle {
|
|
25
|
+
@include type.type-style('heading-compact-02');
|
|
26
|
+
color: colors.$gray-70;
|
|
27
|
+
margin-bottom: spacing.$spacing-04;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.modalBody {
|
|
31
|
+
padding-bottom: spacing.$spacing-05;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.inline {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.loading {
|
|
40
|
+
margin-right: spacing.$spacing-02;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.error {
|
|
44
|
+
margin-top: spacing.$spacing-03;
|
|
45
|
+
color: colors.$red-60;
|
|
46
|
+
@include type.type-style('label-01');
|
|
47
|
+
}
|