@kenyaemr/esm-admin-app 5.4.4-pre.43 → 5.4.4-pre.432
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 +5 -5
- package/dist/1102.js +1 -0
- package/dist/{7988.js.map → 1102.js.map} +1 -1
- package/dist/1278.js +1 -0
- package/dist/1278.js.map +1 -0
- package/dist/1442.js +1 -0
- package/dist/1442.js.map +1 -0
- package/dist/15.js +1 -0
- package/dist/15.js.map +1 -0
- package/dist/162.js +1 -0
- package/dist/162.js.map +1 -0
- package/dist/1620.js +1 -0
- package/dist/1620.js.map +1 -0
- package/dist/1789.js +1 -0
- package/dist/1789.js.map +1 -0
- package/dist/1831.js +1 -0
- package/dist/1831.js.map +1 -0
- package/dist/1844.js +1 -0
- package/dist/1844.js.map +1 -0
- package/dist/1854.js +1 -0
- package/dist/1854.js.map +1 -0
- package/dist/1919.js +1 -0
- package/dist/1919.js.map +1 -0
- package/dist/193.js +1 -0
- package/dist/193.js.map +1 -0
- package/dist/1946.js +1 -0
- package/dist/1946.js.map +1 -0
- package/dist/2007.js +1 -1
- package/dist/2007.js.map +1 -1
- package/dist/2043.js +1 -0
- package/dist/2043.js.map +1 -0
- package/dist/2127.js +1 -0
- package/dist/2127.js.map +1 -0
- package/dist/2146.js +1 -0
- package/dist/2146.js.map +1 -0
- package/dist/2152.js +1 -0
- package/dist/2152.js.map +1 -0
- package/dist/2202.js +1 -0
- package/dist/2202.js.map +1 -0
- package/dist/2258.js +1 -0
- package/dist/2258.js.map +1 -0
- package/dist/2394.js +1 -0
- package/dist/2394.js.map +1 -0
- package/dist/2468.js +1 -0
- package/dist/2468.js.map +1 -0
- package/dist/2534.js +1 -1
- package/dist/2534.js.map +1 -1
- package/dist/2556.js +1 -0
- package/dist/2556.js.map +1 -0
- package/dist/26.js +1 -0
- package/dist/26.js.map +1 -0
- package/dist/2638.js +1 -0
- package/dist/2638.js.map +1 -0
- package/dist/2648.js +1 -0
- package/dist/2648.js.map +1 -0
- package/dist/2709.js +1 -0
- package/dist/2709.js.map +1 -0
- package/dist/2823.js +1 -0
- package/dist/2823.js.map +1 -0
- package/dist/2840.js +1 -0
- package/dist/2840.js.map +1 -0
- package/dist/2842.js +1 -0
- package/dist/2842.js.map +1 -0
- package/dist/2916.js +1 -0
- package/dist/2916.js.map +1 -0
- package/dist/2924.js +1 -0
- package/dist/2924.js.map +1 -0
- package/dist/3137.js +1 -0
- package/dist/3137.js.map +1 -0
- package/dist/3248.js +1 -1
- package/dist/3248.js.map +1 -1
- package/dist/3282.js +1 -0
- package/dist/3282.js.map +1 -0
- package/dist/3285.js +1 -0
- package/dist/3285.js.map +1 -0
- package/dist/3302.js +1 -0
- package/dist/3302.js.map +1 -0
- package/dist/3335.js +1 -0
- package/dist/3335.js.map +1 -0
- package/dist/3378.js +1 -0
- package/dist/3378.js.map +1 -0
- package/dist/3504.js +1 -0
- package/dist/3504.js.map +1 -0
- package/dist/356.js +1 -0
- package/dist/356.js.map +1 -0
- package/dist/3569.js +1 -0
- package/dist/3569.js.map +1 -0
- package/dist/3580.js +1 -0
- package/dist/3580.js.map +1 -0
- package/dist/3690.js +1 -0
- package/dist/3690.js.map +1 -0
- package/dist/3723.js +1 -0
- package/dist/3723.js.map +1 -0
- package/dist/3745.js +1 -0
- package/dist/3745.js.map +1 -0
- package/dist/3796.js +1 -0
- package/dist/3796.js.map +1 -0
- package/dist/3813.js +1 -0
- package/dist/3813.js.map +1 -0
- package/dist/393.js +6 -0
- package/dist/393.js.map +1 -0
- package/dist/3953.js +1 -0
- package/dist/3953.js.map +1 -0
- package/dist/3989.js +1 -0
- package/dist/3989.js.map +1 -0
- package/dist/4124.js +1 -0
- package/dist/4124.js.map +1 -0
- package/dist/4163.js +1 -0
- package/dist/4163.js.map +1 -0
- package/dist/4178.js +1 -1
- package/dist/4178.js.map +1 -1
- package/dist/4308.js +1 -1
- package/dist/4308.js.map +1 -1
- package/dist/4487.js +11 -0
- package/dist/4487.js.map +1 -0
- package/dist/4588.js +1 -0
- package/dist/4588.js.map +1 -0
- package/dist/4637.js +1 -1
- package/dist/4637.js.map +1 -1
- package/dist/466.js +1 -1
- package/dist/466.js.map +1 -1
- package/dist/4711.js +1 -0
- package/dist/4711.js.map +1 -0
- package/dist/4759.js +1 -0
- package/dist/4759.js.map +1 -0
- package/dist/4817.js +1 -0
- package/dist/4817.js.map +1 -0
- package/dist/4818.js +1 -0
- package/dist/4818.js.map +1 -0
- package/dist/4902.js +1 -0
- package/dist/4902.js.map +1 -0
- package/dist/4973.js +1 -0
- package/dist/4973.js.map +1 -0
- package/dist/500.js +1 -0
- package/dist/500.js.map +1 -0
- package/dist/5086.js +1 -1
- package/dist/5086.js.map +1 -1
- package/dist/5117.js +1 -0
- package/dist/5117.js.map +1 -0
- package/dist/5203.js +1 -0
- package/dist/5203.js.map +1 -0
- package/dist/5361.js +1 -1
- package/dist/5361.js.map +1 -1
- package/dist/5362.js +1 -0
- package/dist/5362.js.map +1 -0
- package/dist/5366.js +1 -0
- package/dist/5366.js.map +1 -0
- package/dist/5536.js +1 -0
- package/dist/5536.js.map +1 -0
- package/dist/5567.js +1 -0
- package/dist/5567.js.map +1 -0
- package/dist/5598.js +1 -0
- package/dist/5598.js.map +1 -0
- package/dist/5676.js +1 -1
- package/dist/5676.js.map +1 -1
- package/dist/5693.js +1 -0
- package/dist/5693.js.map +1 -0
- package/dist/5731.js +5 -0
- package/dist/5731.js.map +1 -0
- package/dist/5767.js +1 -0
- package/dist/5767.js.map +1 -0
- package/dist/5809.js +1 -1
- package/dist/5809.js.map +1 -1
- package/dist/5825.js +1 -0
- package/dist/5825.js.map +1 -0
- package/dist/5932.js +1 -0
- package/dist/5932.js.map +1 -0
- package/dist/5941.js +1 -0
- package/dist/5941.js.map +1 -0
- package/dist/6104.js +1 -1
- package/dist/6104.js.map +1 -1
- package/dist/6273.js +1 -0
- package/dist/6273.js.map +1 -0
- package/dist/6337.js +1 -0
- package/dist/6337.js.map +1 -0
- package/dist/6355.js +1 -0
- package/dist/{2797.js.map → 6355.js.map} +1 -1
- package/dist/6357.js +1 -0
- package/dist/6357.js.map +1 -0
- package/dist/6427.js +1 -1
- package/dist/6427.js.map +1 -1
- package/dist/6478.js +7 -0
- package/dist/6478.js.map +1 -0
- package/dist/6508.js +1 -0
- package/dist/6508.js.map +1 -0
- package/dist/6567.js +1 -0
- package/dist/6567.js.map +1 -0
- package/dist/6634.js +1 -0
- package/dist/6634.js.map +1 -0
- package/dist/6698.js +1 -0
- package/dist/6698.js.map +1 -0
- package/dist/682.js +1 -1
- package/dist/682.js.map +1 -1
- package/dist/6848.js +1 -0
- package/dist/6848.js.map +1 -0
- package/dist/689.js +1 -1
- package/dist/689.js.map +1 -1
- package/dist/6978.js +1 -0
- package/dist/6978.js.map +1 -0
- package/dist/7085.js +1 -1
- package/dist/7085.js.map +1 -1
- package/dist/7187.js +1 -0
- package/dist/7187.js.map +1 -0
- package/dist/7209.js +1 -0
- package/dist/7209.js.map +1 -0
- package/dist/740.js +1 -0
- package/dist/740.js.map +1 -0
- package/dist/7419.js +1 -1
- package/dist/7419.js.map +1 -1
- package/dist/7478.js +1 -1
- package/dist/7478.js.map +1 -1
- package/dist/7686.js +1 -0
- package/dist/7686.js.map +1 -0
- package/dist/770.js +1 -0
- package/dist/770.js.map +1 -0
- package/dist/7782.js +1 -0
- package/dist/7782.js.map +1 -0
- package/dist/7783.js +1 -0
- package/dist/7783.js.map +1 -0
- package/dist/7808.js +1 -0
- package/dist/7808.js.map +1 -0
- package/dist/781.js +1 -1
- package/dist/781.js.map +1 -1
- package/dist/8183.js +1 -0
- package/dist/8183.js.map +1 -0
- package/dist/8196.js +1 -1
- package/dist/8196.js.map +1 -1
- package/dist/820.js +1 -0
- package/dist/820.js.map +1 -0
- package/dist/8240.js +1 -1
- package/dist/8240.js.map +1 -1
- package/dist/8267.js +1 -0
- package/dist/8267.js.map +1 -0
- package/dist/8472.js +1 -0
- package/dist/8472.js.map +1 -0
- package/dist/8521.js +1 -0
- package/dist/8521.js.map +1 -0
- package/dist/8602.js +1 -0
- package/dist/8602.js.map +1 -0
- package/dist/8607.js +1 -0
- package/dist/8607.js.map +1 -0
- package/dist/8743.js +1 -0
- package/dist/8743.js.map +1 -0
- package/dist/8762.js +1 -0
- package/dist/8762.js.map +1 -0
- package/dist/8781.js +1 -0
- package/dist/8781.js.map +1 -0
- package/dist/8812.js +1 -0
- package/dist/8812.js.map +1 -0
- package/dist/8952.js +1 -0
- package/dist/8952.js.map +1 -0
- package/dist/8985.js +1 -0
- package/dist/8985.js.map +1 -0
- package/dist/8996.js +1 -0
- package/dist/8996.js.map +1 -0
- package/dist/9011.js +1 -1
- package/dist/9011.js.map +1 -1
- package/dist/9049.js +1 -0
- package/dist/9049.js.map +1 -0
- package/dist/9050.js +1 -0
- package/dist/9050.js.map +1 -0
- package/dist/9061.js +1 -1
- package/dist/9061.js.map +1 -1
- package/dist/9087.js +1 -0
- package/dist/9087.js.map +1 -0
- package/dist/9148.js +1 -0
- package/dist/9148.js.map +1 -0
- package/dist/9168.js +1 -0
- package/dist/9168.js.map +1 -0
- package/dist/935.js +1 -0
- package/dist/935.js.map +1 -0
- package/dist/9425.js +1 -1
- package/dist/944.js +1 -0
- package/dist/944.js.map +1 -0
- package/dist/9443.js +1 -0
- package/dist/9443.js.map +1 -0
- package/dist/9520.js +1 -1
- package/dist/9520.js.map +1 -1
- package/dist/9547.js +1 -0
- package/dist/9547.js.map +1 -0
- package/dist/9549.js +1 -0
- package/dist/9549.js.map +1 -0
- package/dist/9603.js +1 -0
- package/dist/9603.js.map +1 -0
- package/dist/9612.js +1 -0
- package/dist/9612.js.map +1 -0
- package/dist/9621.js +1 -0
- package/dist/9621.js.map +1 -0
- package/dist/9662.js +1 -0
- package/dist/9662.js.map +1 -0
- package/dist/9771.js +1 -0
- package/dist/9771.js.map +1 -0
- package/dist/9774.js +1 -0
- package/dist/9774.js.map +1 -0
- package/dist/9800.js +1 -0
- package/dist/9800.js.map +1 -0
- package/dist/9806.js +1 -0
- package/dist/9806.js.map +1 -0
- package/dist/992.js +1 -0
- package/dist/992.js.map +1 -0
- package/dist/kenyaemr-esm-admin-app.js +6 -5
- package/dist/kenyaemr-esm-admin-app.js.buildmanifest.json +1694 -719
- package/dist/kenyaemr-esm-admin-app.js.map +1 -1
- package/dist/main.js +6 -5
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +4 -6
- package/src/components/confirm-modal/confirmation-operation.test.tsx +8 -19
- package/src/components/dashboard/dashboard.component.tsx +4 -1
- package/src/components/empty-state/empty-state-log.test.tsx +3 -4
- package/src/components/facility-setup/constant/index.ts +3 -0
- package/src/components/facility-setup/facility-info.component.tsx +247 -108
- package/src/components/facility-setup/facility-info.scss +136 -55
- package/src/components/facility-setup/facility-setup.component.tsx +2 -2
- package/src/components/facility-setup/header/header.component.tsx +4 -10
- package/src/components/facility-setup/header/header.scss +3 -9
- package/src/components/facility-setup/shared/custom-info.component.tsx +9 -0
- package/src/components/facility-setup/shared/custom-section-card.component.tsx +10 -0
- package/src/components/facility-setup/shared/custom-status-tag.component.tsx +22 -0
- package/src/components/facility-setup/type/index.ts +61 -0
- package/src/components/facility-setup/useFacilityRegistry.ts +29 -0
- package/src/components/global-property/dashboard/global-property-dashboard.component.tsx +23 -0
- package/src/components/global-property/dashboard/global-property-dashboard.scss +6 -0
- package/src/components/global-property/hooks/useGlobalProperty.ts +64 -0
- package/src/components/global-property/hooks/useLogoUpload.ts +28 -0
- package/src/components/global-property/index.ts +14 -0
- package/src/components/global-property/modal/delete-global-property-modal.component.tsx +71 -0
- package/src/components/global-property/modal/delete-global-property-modal.test.tsx +131 -0
- package/src/components/global-property/table/global-property-table.component.tsx +241 -0
- package/src/components/global-property/table/global-property-table.scss +44 -0
- package/src/components/global-property/table/global-property-table.test.tsx +202 -0
- package/src/components/global-property/workspace/global-property-form-schema.ts +32 -0
- package/src/components/global-property/workspace/global-property.workspace.scss +40 -0
- package/src/components/global-property/workspace/global-property.workspace.test.tsx +172 -0
- package/src/components/global-property/workspace/global-property.workspace.tsx +260 -0
- package/src/components/global-property/workspace/upload-logo.workspace.scss +61 -0
- package/src/components/global-property/workspace/upload-logo.workspace.test.tsx +180 -0
- package/src/components/global-property/workspace/upload-logo.workspace.tsx +191 -0
- package/src/components/hook/healthWorkerRegistry.ts +78 -0
- package/src/components/hook/useProfessionalRegistryEnums.ts +59 -0
- package/src/components/locations/forms/add-location/add-location.workspace.tsx +96 -95
- package/src/components/locations/forms/search-location/search-location.workspace.tsx +90 -85
- package/src/components/locations/tables/locations-table.component.tsx +117 -121
- package/src/components/logs-table/operation-log-table.component.tsx +87 -75
- package/src/components/logs-table/operation-log.test.tsx +134 -28
- package/src/components/modal/hwr-confirmation.modal.scss +80 -4
- package/src/components/modal/hwr-confirmation.modal.tsx +118 -128
- package/src/components/modal/hwr-sync.modal.tsx +194 -106
- package/src/components/users/manage-users/manage-user-role-scope/user-role-scope-workspace/user-role-scope.workspace.tsx +14 -14
- package/src/components/users/manage-users/user-details/user-detail.scss +167 -39
- package/src/components/users/manage-users/user-details/user-details.component.tsx +130 -122
- package/src/components/users/manage-users/user-list/user-list.component.tsx +22 -9
- package/src/components/users/manage-users/user-management.workspace.scss +233 -95
- package/src/components/users/manage-users/user-management.workspace.tsx +800 -687
- package/src/components/users/userManagementFormSchema.tsx +17 -8
- package/src/config-schema.ts +48 -68
- package/src/index.ts +21 -7
- package/src/left-pannel-link.component.tsx +5 -3
- package/src/root.component.tsx +13 -13
- package/src/routes.json +60 -36
- package/src/types/index.ts +40 -3
- package/translations/am.json +213 -13
- package/translations/en.json +225 -25
- package/translations/fr.json +260 -58
- package/translations/sw.json +329 -129
- package/tsconfig.json +1 -1
- package/dist/1072.js +0 -1
- package/dist/1072.js.map +0 -1
- package/dist/1091.js +0 -1
- package/dist/1091.js.map +0 -1
- package/dist/1172.js +0 -1
- package/dist/1172.js.map +0 -1
- package/dist/132.js +0 -1
- package/dist/132.js.map +0 -1
- package/dist/1332.js +0 -1
- package/dist/1332.js.map +0 -1
- package/dist/1577.js +0 -1
- package/dist/1577.js.map +0 -1
- package/dist/1660.js +0 -1
- package/dist/1660.js.map +0 -1
- package/dist/1729.js +0 -17
- package/dist/1729.js.map +0 -1
- package/dist/1761.js +0 -1
- package/dist/1761.js.map +0 -1
- package/dist/1809.js +0 -7
- package/dist/1809.js.map +0 -1
- package/dist/1866.js +0 -1
- package/dist/1866.js.map +0 -1
- package/dist/1962.js +0 -1
- package/dist/1962.js.map +0 -1
- package/dist/2045.js +0 -1
- package/dist/2045.js.map +0 -1
- package/dist/2163.js +0 -1
- package/dist/2163.js.map +0 -1
- package/dist/2267.js +0 -1
- package/dist/2267.js.map +0 -1
- package/dist/2357.js +0 -1
- package/dist/2357.js.map +0 -1
- package/dist/2419.js +0 -1
- package/dist/2419.js.map +0 -1
- package/dist/2561.js +0 -1
- package/dist/2561.js.map +0 -1
- package/dist/2564.js +0 -1
- package/dist/2564.js.map +0 -1
- package/dist/2738.js +0 -1
- package/dist/2738.js.map +0 -1
- package/dist/2797.js +0 -1
- package/dist/2810.js +0 -2
- package/dist/2810.js.map +0 -1
- package/dist/2867.js +0 -1
- package/dist/2867.js.map +0 -1
- package/dist/3040.js +0 -1
- package/dist/3134.js +0 -1
- package/dist/3134.js.map +0 -1
- package/dist/3189.js +0 -1
- package/dist/3189.js.map +0 -1
- package/dist/3228.js +0 -1
- package/dist/3228.js.map +0 -1
- package/dist/3381.js +0 -1
- package/dist/3381.js.map +0 -1
- package/dist/3472.js +0 -1
- package/dist/3472.js.map +0 -1
- package/dist/3491.js +0 -1
- package/dist/3491.js.map +0 -1
- package/dist/3509.js +0 -1
- package/dist/3509.js.map +0 -1
- package/dist/3576.js +0 -1
- package/dist/3576.js.map +0 -1
- package/dist/3968.js +0 -1
- package/dist/3968.js.map +0 -1
- package/dist/4146.js +0 -1
- package/dist/4146.js.map +0 -1
- package/dist/4220.js +0 -1
- package/dist/4220.js.map +0 -1
- package/dist/4224.js +0 -1
- package/dist/4224.js.map +0 -1
- package/dist/4402.js +0 -1
- package/dist/4402.js.map +0 -1
- package/dist/4724.js +0 -1
- package/dist/4724.js.map +0 -1
- package/dist/4972.js +0 -1
- package/dist/4972.js.map +0 -1
- package/dist/509.js +0 -1
- package/dist/509.js.map +0 -1
- package/dist/5096.js +0 -1
- package/dist/5096.js.map +0 -1
- package/dist/5119.js +0 -1
- package/dist/5119.js.map +0 -1
- package/dist/5136.js +0 -1
- package/dist/5136.js.map +0 -1
- package/dist/5159.js +0 -13
- package/dist/5159.js.map +0 -1
- package/dist/5533.js +0 -1
- package/dist/5533.js.map +0 -1
- package/dist/5870.js +0 -1
- package/dist/5870.js.map +0 -1
- package/dist/5882.js +0 -1
- package/dist/5939.js +0 -5
- package/dist/5939.js.map +0 -1
- package/dist/6004.js +0 -1
- package/dist/6004.js.map +0 -1
- package/dist/6121.js +0 -3
- package/dist/6121.js.map +0 -1
- package/dist/6137.js +0 -1
- package/dist/6137.js.map +0 -1
- package/dist/6192.js +0 -1
- package/dist/6192.js.map +0 -1
- package/dist/6232.js +0 -1
- package/dist/6232.js.map +0 -1
- package/dist/6356.js +0 -1
- package/dist/6356.js.map +0 -1
- package/dist/6363.js +0 -1
- package/dist/6363.js.map +0 -1
- package/dist/6548.js +0 -1
- package/dist/6548.js.map +0 -1
- package/dist/6571.js +0 -1
- package/dist/6571.js.map +0 -1
- package/dist/6615.js +0 -1
- package/dist/6615.js.map +0 -1
- package/dist/6721.js +0 -1
- package/dist/6721.js.map +0 -1
- package/dist/6868.js +0 -1
- package/dist/6868.js.map +0 -1
- package/dist/6892.js +0 -1
- package/dist/6892.js.map +0 -1
- package/dist/7127.js +0 -1
- package/dist/7329.js +0 -1
- package/dist/7329.js.map +0 -1
- package/dist/754.js +0 -1
- package/dist/754.js.map +0 -1
- package/dist/7544.js +0 -1
- package/dist/7544.js.map +0 -1
- package/dist/7560.js +0 -1
- package/dist/7560.js.map +0 -1
- package/dist/7988.js +0 -1
- package/dist/8179.js +0 -6
- package/dist/8179.js.map +0 -1
- package/dist/8189.js +0 -1
- package/dist/8189.js.map +0 -1
- package/dist/8249.js +0 -1
- package/dist/8249.js.map +0 -1
- package/dist/8502.js +0 -1
- package/dist/8502.js.map +0 -1
- package/dist/8522.js +0 -1
- package/dist/8522.js.map +0 -1
- package/dist/8622.js +0 -1
- package/dist/8622.js.map +0 -1
- package/dist/8775.js +0 -11
- package/dist/8775.js.map +0 -1
- package/dist/8820.js +0 -1
- package/dist/8820.js.map +0 -1
- package/dist/887.js +0 -1
- package/dist/887.js.map +0 -1
- package/dist/8927.js +0 -1
- package/dist/8927.js.map +0 -1
- package/dist/8977.js +0 -1
- package/dist/8977.js.map +0 -1
- package/dist/916.js +0 -1
- package/dist/9303.js +0 -1
- package/dist/9303.js.map +0 -1
- package/dist/9466.js +0 -1
- package/dist/9466.js.map +0 -1
- package/dist/9675.js +0 -1
- package/dist/9675.js.map +0 -1
- package/dist/9787.js +0 -1
- package/dist/9787.js.map +0 -1
- package/dist/981.js +0 -1
- package/dist/981.js.map +0 -1
- package/dist/984.js +0 -1
- package/dist/984.js.map +0 -1
- package/dist/9931.js +0 -1
- package/dist/9931.js.map +0 -1
- package/dist/9947.js +0 -1
- package/dist/9947.js.map +0 -1
- package/jest.config.js +0 -8
- package/src/components/facility-setup/card.component.tsx +0 -16
- package/src/components/facility-setup/facility-setup.resource.tsx +0 -7
- package/src/components/hook/healthWorkerAdapter.ts +0 -213
- package/src/components/hook/useFacilityInfo.tsx +0 -37
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { showSnackbar, useLayoutType, Workspace2, type Workspace2DefinitionProps } from '@openmrs/esm-framework';
|
|
3
|
+
import {
|
|
4
|
+
Button,
|
|
5
|
+
ButtonSet,
|
|
6
|
+
FileUploader,
|
|
7
|
+
Form,
|
|
8
|
+
FormGroup,
|
|
9
|
+
InlineLoading,
|
|
10
|
+
InlineNotification,
|
|
11
|
+
RadioButton,
|
|
12
|
+
RadioButtonGroup,
|
|
13
|
+
Stack,
|
|
14
|
+
} from '@carbon/react';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import classNames from 'classnames';
|
|
17
|
+
|
|
18
|
+
import styles from './upload-logo.workspace.scss';
|
|
19
|
+
import { ALLOWED_LOGO_TYPES, MAX_LOGO_SIZE_BYTES, type LogoTarget, uploadLogo } from '../hooks/useLogoUpload';
|
|
20
|
+
|
|
21
|
+
type UploadLogoWorkspaceProps = {
|
|
22
|
+
mutateGlobalProperty?: () => void;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const UploadLogoWorkspace: React.FC<Workspace2DefinitionProps<UploadLogoWorkspaceProps, {}, {}>> = ({
|
|
26
|
+
closeWorkspace,
|
|
27
|
+
workspaceProps,
|
|
28
|
+
}) => {
|
|
29
|
+
const { t } = useTranslation();
|
|
30
|
+
const isTablet = useLayoutType() === 'tablet';
|
|
31
|
+
const mutateGlobalProperty = workspaceProps?.mutateGlobalProperty;
|
|
32
|
+
|
|
33
|
+
const [target, setTarget] = useState<LogoTarget>('prescription');
|
|
34
|
+
const [file, setFile] = useState<File | null>(null);
|
|
35
|
+
const [previewUrl, setPreviewUrl] = useState<string | null>(null);
|
|
36
|
+
const [validationError, setValidationError] = useState<string | null>(null);
|
|
37
|
+
const [isSubmitting, setIsSubmitting] = useState(false);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (!file) {
|
|
41
|
+
setPreviewUrl(null);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const url = URL.createObjectURL(file);
|
|
45
|
+
setPreviewUrl(url);
|
|
46
|
+
return () => URL.revokeObjectURL(url);
|
|
47
|
+
}, [file]);
|
|
48
|
+
|
|
49
|
+
const handleFileChange = (selected: File | null) => {
|
|
50
|
+
setValidationError(null);
|
|
51
|
+
if (!selected) {
|
|
52
|
+
setFile(null);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (!ALLOWED_LOGO_TYPES.includes(selected.type)) {
|
|
56
|
+
setValidationError(t('unsupportedImageType', 'Unsupported file type. Accepted: JPEG, PNG, GIF, BMP or WebP.'));
|
|
57
|
+
setFile(null);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
if (selected.size > MAX_LOGO_SIZE_BYTES) {
|
|
61
|
+
setValidationError(t('imageTooLarge', 'File exceeds the 2 MB maximum size.'));
|
|
62
|
+
setFile(null);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
setFile(selected);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
const onSubmit = async (event: React.FormEvent) => {
|
|
69
|
+
event.preventDefault();
|
|
70
|
+
if (!file) {
|
|
71
|
+
setValidationError(t('selectImageFirst', 'Please select an image to upload.'));
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
setIsSubmitting(true);
|
|
75
|
+
try {
|
|
76
|
+
const { savedPath } = await uploadLogo(file, target);
|
|
77
|
+
const fileName = savedPath?.split(/[\\/]/).pop() ?? file.name;
|
|
78
|
+
showSnackbar({
|
|
79
|
+
title: t('success', 'Success'),
|
|
80
|
+
kind: 'success',
|
|
81
|
+
subtitle: t('logoUploaded', 'Image "{{fileName}}" uploaded successfully', { fileName }),
|
|
82
|
+
timeoutInMs: 5000,
|
|
83
|
+
});
|
|
84
|
+
mutateGlobalProperty?.();
|
|
85
|
+
closeWorkspace({ discardUnsavedChanges: true });
|
|
86
|
+
} catch (error: any) {
|
|
87
|
+
showSnackbar({
|
|
88
|
+
title: t('error', 'Error'),
|
|
89
|
+
kind: 'error',
|
|
90
|
+
subtitle: error?.message ?? t('logoUploadError', 'Error uploading image'),
|
|
91
|
+
});
|
|
92
|
+
} finally {
|
|
93
|
+
setIsSubmitting(false);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
return (
|
|
98
|
+
<Workspace2 title={t('uploadImage', 'Upload image')} hasUnsavedChanges={Boolean(file)}>
|
|
99
|
+
<Form onSubmit={onSubmit} className={styles.form}>
|
|
100
|
+
<div className={styles.formContainer}>
|
|
101
|
+
<Stack gap={5}>
|
|
102
|
+
<InlineNotification
|
|
103
|
+
kind="info"
|
|
104
|
+
lowContrast
|
|
105
|
+
hideCloseButton
|
|
106
|
+
title={t('logoUploadTitle', 'Printed documents logo')}
|
|
107
|
+
subtitle={t(
|
|
108
|
+
'logoUploadDesc',
|
|
109
|
+
'Upload a logo used in printed documents. JPEG, PNG, GIF, BMP or WebP, up to 2 MB.',
|
|
110
|
+
)}
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
<FormGroup legendText={t('logoTarget', 'Logo destination')}>
|
|
114
|
+
<RadioButtonGroup
|
|
115
|
+
name="logo-target"
|
|
116
|
+
legendText=""
|
|
117
|
+
valueSelected={target}
|
|
118
|
+
onChange={(value: string) => setTarget(value as LogoTarget)}
|
|
119
|
+
disabled={isSubmitting}>
|
|
120
|
+
<RadioButton
|
|
121
|
+
labelText={t('prescriptionLogo', 'Prescription logo')}
|
|
122
|
+
value="prescription"
|
|
123
|
+
id="logo-target-prescription"
|
|
124
|
+
/>
|
|
125
|
+
<RadioButton labelText={t('receiptLogo', 'Receipt logo')} value="receipt" id="logo-target-receipt" />
|
|
126
|
+
</RadioButtonGroup>
|
|
127
|
+
</FormGroup>
|
|
128
|
+
|
|
129
|
+
<FormGroup legendText={t('image', 'Image')}>
|
|
130
|
+
<FileUploader
|
|
131
|
+
labelTitle=""
|
|
132
|
+
labelDescription={t('logoUploaderHint', 'Max file size is 2 MB. Supported: JPEG, PNG, GIF, BMP, WebP.')}
|
|
133
|
+
buttonLabel={t('addFile', 'Add file')}
|
|
134
|
+
buttonKind="tertiary"
|
|
135
|
+
size="md"
|
|
136
|
+
filenameStatus="edit"
|
|
137
|
+
accept={ALLOWED_LOGO_TYPES}
|
|
138
|
+
multiple={false}
|
|
139
|
+
disabled={isSubmitting}
|
|
140
|
+
onChange={(e: { target: HTMLInputElement; addedFiles?: File[] }) => {
|
|
141
|
+
const selected = e.addedFiles?.[0] ?? e.target?.files?.[0] ?? null;
|
|
142
|
+
handleFileChange(selected);
|
|
143
|
+
}}
|
|
144
|
+
onDelete={() => handleFileChange(null)}
|
|
145
|
+
/>
|
|
146
|
+
</FormGroup>
|
|
147
|
+
|
|
148
|
+
{validationError && (
|
|
149
|
+
<InlineNotification
|
|
150
|
+
kind="error"
|
|
151
|
+
lowContrast
|
|
152
|
+
hideCloseButton
|
|
153
|
+
title={t('invalidImage', 'Invalid image')}
|
|
154
|
+
subtitle={validationError}
|
|
155
|
+
/>
|
|
156
|
+
)}
|
|
157
|
+
|
|
158
|
+
{previewUrl && (
|
|
159
|
+
<div className={styles.previewContainer}>
|
|
160
|
+
<span className={styles.previewLabel}>{t('preview', 'Preview')}</span>
|
|
161
|
+
<img src={previewUrl} alt={t('imagePreview', 'Image preview')} className={styles.preview} />
|
|
162
|
+
</div>
|
|
163
|
+
)}
|
|
164
|
+
</Stack>
|
|
165
|
+
</div>
|
|
166
|
+
|
|
167
|
+
<ButtonSet
|
|
168
|
+
className={classNames({
|
|
169
|
+
[styles.tablet]: isTablet,
|
|
170
|
+
[styles.desktop]: !isTablet,
|
|
171
|
+
})}>
|
|
172
|
+
<Button className={styles.buttonContainer} kind="secondary" onClick={() => closeWorkspace()}>
|
|
173
|
+
{t('cancel', 'Cancel')}
|
|
174
|
+
</Button>
|
|
175
|
+
<Button className={styles.buttonContainer} disabled={!file || isSubmitting} kind="primary" type="submit">
|
|
176
|
+
{isSubmitting ? (
|
|
177
|
+
<span className={styles.inlineLoading}>
|
|
178
|
+
{t('uploading', 'Uploading...')}
|
|
179
|
+
<InlineLoading status="active" iconDescription="Loading" />
|
|
180
|
+
</span>
|
|
181
|
+
) : (
|
|
182
|
+
t('upload', 'Upload')
|
|
183
|
+
)}
|
|
184
|
+
</Button>
|
|
185
|
+
</ButtonSet>
|
|
186
|
+
</Form>
|
|
187
|
+
</Workspace2>
|
|
188
|
+
);
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
export default UploadLogoWorkspace;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { FetchResponse, openmrsFetch, restBaseUrl } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
import { HWR_API_NO_CREDENTIALS, PROVIDER_NOT_FOUND, RESOURCE_NOT_FOUND, UNKNOWN } from '../../constants';
|
|
4
|
+
|
|
5
|
+
export interface ProfessionalRegistryResponse {
|
|
6
|
+
success: boolean;
|
|
7
|
+
regulator: string;
|
|
8
|
+
identification_type: string;
|
|
9
|
+
identification_number: string;
|
|
10
|
+
professional: {
|
|
11
|
+
membership: {
|
|
12
|
+
id: string;
|
|
13
|
+
full_name: string;
|
|
14
|
+
gender: string;
|
|
15
|
+
first_name: string;
|
|
16
|
+
middle_name: string;
|
|
17
|
+
last_name: string;
|
|
18
|
+
registration_id: string;
|
|
19
|
+
external_reference_id: string;
|
|
20
|
+
licensing_body: string;
|
|
21
|
+
specialty: string;
|
|
22
|
+
is_active: number;
|
|
23
|
+
};
|
|
24
|
+
licenses?: Array<{
|
|
25
|
+
id: string;
|
|
26
|
+
external_reference_id: string;
|
|
27
|
+
license_type: string;
|
|
28
|
+
license_start: string;
|
|
29
|
+
license_end: string;
|
|
30
|
+
}>;
|
|
31
|
+
professional_details?: {
|
|
32
|
+
professional_cadre?: string;
|
|
33
|
+
practice_type?: string;
|
|
34
|
+
educational_qualifications?: string;
|
|
35
|
+
};
|
|
36
|
+
contacts?: {
|
|
37
|
+
phone?: string;
|
|
38
|
+
email?: string;
|
|
39
|
+
postal_address?: string;
|
|
40
|
+
};
|
|
41
|
+
identifiers?: {
|
|
42
|
+
identification_type?: string;
|
|
43
|
+
identification_number?: string;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const searchHealthCareWork = async (
|
|
49
|
+
identifierType: string,
|
|
50
|
+
identifierNumber: string,
|
|
51
|
+
regulator: string,
|
|
52
|
+
): Promise<ProfessionalRegistryResponse> => {
|
|
53
|
+
const url = `${restBaseUrl}/virtualclaims/professional-registry?${new URLSearchParams({
|
|
54
|
+
identification_number: identifierNumber,
|
|
55
|
+
identification_type: identifierType,
|
|
56
|
+
regulator,
|
|
57
|
+
}).toString()}`;
|
|
58
|
+
|
|
59
|
+
try {
|
|
60
|
+
const response = await openmrsFetch<ProfessionalRegistryResponse>(url);
|
|
61
|
+
if (!response.data?.success || !response.data?.professional) {
|
|
62
|
+
throw new Error(PROVIDER_NOT_FOUND);
|
|
63
|
+
}
|
|
64
|
+
return response.data;
|
|
65
|
+
} catch (err: any) {
|
|
66
|
+
if (err?.message === PROVIDER_NOT_FOUND) {
|
|
67
|
+
throw err;
|
|
68
|
+
}
|
|
69
|
+
const status = err?.response?.status;
|
|
70
|
+
if (status === 401) {
|
|
71
|
+
throw new Error(HWR_API_NO_CREDENTIALS);
|
|
72
|
+
}
|
|
73
|
+
if (status === 404) {
|
|
74
|
+
throw new Error(RESOURCE_NOT_FOUND);
|
|
75
|
+
}
|
|
76
|
+
throw new Error(UNKNOWN);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { FetchResponse, openmrsFetch, restBaseUrl, useSession } from '@openmrs/esm-framework';
|
|
2
|
+
import useSWR from 'swr';
|
|
3
|
+
|
|
4
|
+
export type EnumEntry = {
|
|
5
|
+
code: string;
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type RegulatorsResponse = {
|
|
10
|
+
count: number;
|
|
11
|
+
regulators: Array<EnumEntry>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type IdentificationTypesResponse = {
|
|
15
|
+
count: number;
|
|
16
|
+
identification_types: Array<EnumEntry>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const ONE_DAY_MS = 24 * 60 * 60 * 1000;
|
|
20
|
+
|
|
21
|
+
export const useProfessionalRegistryRegulators = () => {
|
|
22
|
+
const { authenticated } = useSession();
|
|
23
|
+
const url = `${restBaseUrl}/virtualclaims/professional-registry/regulators`;
|
|
24
|
+
|
|
25
|
+
const { data, error, isLoading } = useSWR<FetchResponse<RegulatorsResponse>>(
|
|
26
|
+
authenticated ? url : null,
|
|
27
|
+
openmrsFetch,
|
|
28
|
+
{
|
|
29
|
+
revalidateOnFocus: false,
|
|
30
|
+
dedupingInterval: ONE_DAY_MS,
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
regulators: data?.data?.regulators ?? [],
|
|
36
|
+
isLoading,
|
|
37
|
+
error,
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const useProfessionalRegistryIdentificationTypes = () => {
|
|
42
|
+
const { authenticated } = useSession();
|
|
43
|
+
const url = `${restBaseUrl}/virtualclaims/professional-registry/identification-types`;
|
|
44
|
+
|
|
45
|
+
const { data, error, isLoading } = useSWR<FetchResponse<IdentificationTypesResponse>>(
|
|
46
|
+
authenticated ? url : null,
|
|
47
|
+
openmrsFetch,
|
|
48
|
+
{
|
|
49
|
+
revalidateOnFocus: false,
|
|
50
|
+
dedupingInterval: ONE_DAY_MS,
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
identificationTypes: data?.data?.identification_types ?? [],
|
|
56
|
+
isLoading,
|
|
57
|
+
error,
|
|
58
|
+
};
|
|
59
|
+
};
|
|
@@ -1,35 +1,36 @@
|
|
|
1
|
-
import React, { useEffect, useMemo } from 'react';
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
2
|
import {
|
|
3
|
-
type DefaultWorkspaceProps,
|
|
4
3
|
ResponsiveWrapper,
|
|
5
|
-
|
|
6
|
-
showSnackbar,
|
|
7
|
-
useConfig,
|
|
4
|
+
Workspace2,
|
|
8
5
|
restBaseUrl,
|
|
6
|
+
showSnackbar,
|
|
7
|
+
useLayoutType,
|
|
8
|
+
type Workspace2DefinitionProps,
|
|
9
9
|
} from '@openmrs/esm-framework';
|
|
10
10
|
import { useTranslation } from 'react-i18next';
|
|
11
11
|
import { Controller, useForm } from 'react-hook-form';
|
|
12
12
|
import {
|
|
13
|
-
ButtonSet,
|
|
14
13
|
Button,
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
ButtonSet,
|
|
15
|
+
FilterableMultiSelect,
|
|
16
|
+
Form,
|
|
17
17
|
FormGroup,
|
|
18
|
+
InlineLoading,
|
|
18
19
|
Stack,
|
|
19
|
-
|
|
20
|
-
FilterableMultiSelect,
|
|
20
|
+
TextInput,
|
|
21
21
|
} from '@carbon/react';
|
|
22
|
-
import classNames from 'classnames';
|
|
23
|
-
import { z } from 'zod';
|
|
24
22
|
import { zodResolver } from '@hookform/resolvers/zod';
|
|
23
|
+
import { z } from 'zod';
|
|
24
|
+
import classNames from 'classnames';
|
|
25
|
+
import { mutate } from 'swr';
|
|
26
|
+
|
|
25
27
|
import styles from './add-location.workspace.scss';
|
|
26
28
|
import { type LocationResponse } from '../../types';
|
|
27
29
|
import { extractErrorMessagesFromResponse } from '../../helpers';
|
|
28
30
|
import { useLocationTags } from '../../hooks/useLocationTags';
|
|
29
|
-
import { mutate } from 'swr';
|
|
30
31
|
import { saveOrUpdateLocation } from '../../hooks/useLocation';
|
|
31
32
|
|
|
32
|
-
type AddLocationWorkspaceProps =
|
|
33
|
+
type AddLocationWorkspaceProps = {
|
|
33
34
|
location?: LocationResponse;
|
|
34
35
|
};
|
|
35
36
|
|
|
@@ -46,16 +47,14 @@ const locationFormSchema = z.object({
|
|
|
46
47
|
|
|
47
48
|
type LocationFormType = z.infer<typeof locationFormSchema>;
|
|
48
49
|
|
|
49
|
-
const AddLocationWorkspace: React.FC<AddLocationWorkspaceProps
|
|
50
|
+
const AddLocationWorkspace: React.FC<Workspace2DefinitionProps<AddLocationWorkspaceProps, {}, {}>> = ({
|
|
50
51
|
closeWorkspace,
|
|
51
|
-
|
|
52
|
-
promptBeforeClosing,
|
|
53
|
-
location,
|
|
52
|
+
workspaceProps: { location = {} as LocationResponse },
|
|
54
53
|
}) => {
|
|
55
54
|
const { t } = useTranslation();
|
|
56
55
|
const isTablet = useLayoutType() === 'tablet';
|
|
57
56
|
const { locationTagList: Tags } = useLocationTags();
|
|
58
|
-
|
|
57
|
+
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
|
|
59
58
|
const hasLocationAttributes = useMemo(() => {
|
|
60
59
|
return location?.attributes && location.attributes.length > 0;
|
|
61
60
|
}, [location?.attributes]);
|
|
@@ -105,7 +104,7 @@ const AddLocationWorkspace: React.FC<AddLocationWorkspaceProps> = ({
|
|
|
105
104
|
}),
|
|
106
105
|
});
|
|
107
106
|
handleMutation();
|
|
108
|
-
|
|
107
|
+
closeWorkspace({ discardUnsavedChanges: true });
|
|
109
108
|
} catch (error: any) {
|
|
110
109
|
const errorMessages = extractErrorMessagesFromResponse(error);
|
|
111
110
|
showSnackbar({
|
|
@@ -117,83 +116,85 @@ const AddLocationWorkspace: React.FC<AddLocationWorkspaceProps> = ({
|
|
|
117
116
|
};
|
|
118
117
|
|
|
119
118
|
useEffect(() => {
|
|
120
|
-
|
|
121
|
-
}, [isDirty,
|
|
119
|
+
setHasUnsavedChanges(true);
|
|
120
|
+
}, [isDirty, setHasUnsavedChanges]);
|
|
122
121
|
|
|
123
122
|
return (
|
|
124
|
-
<
|
|
125
|
-
<
|
|
126
|
-
<
|
|
127
|
-
<
|
|
128
|
-
<
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
<
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
{isSubmitting
|
|
187
|
-
|
|
188
|
-
{
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
123
|
+
<Workspace2 title={t('addLocation', 'Add Location')} hasUnsavedChanges={hasUnsavedChanges}>
|
|
124
|
+
<Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
|
|
125
|
+
<div className={styles.formContainer}>
|
|
126
|
+
<Stack gap={3}>
|
|
127
|
+
<ResponsiveWrapper>
|
|
128
|
+
<FormGroup legendText="">
|
|
129
|
+
<Controller
|
|
130
|
+
control={control}
|
|
131
|
+
name="name"
|
|
132
|
+
render={({ field }) => (
|
|
133
|
+
<TextInput
|
|
134
|
+
id="locationName"
|
|
135
|
+
placeholder={t('locationPlaceholder', 'Add a location')}
|
|
136
|
+
labelText={t('locationName', 'Location Name')}
|
|
137
|
+
value={field.value}
|
|
138
|
+
onChange={field.onChange}
|
|
139
|
+
invalid={!!errors.name?.message}
|
|
140
|
+
invalidText={errors.name?.message}
|
|
141
|
+
disabled={hasLocationAttributes}
|
|
142
|
+
/>
|
|
143
|
+
)}
|
|
144
|
+
/>
|
|
145
|
+
</FormGroup>
|
|
146
|
+
</ResponsiveWrapper>
|
|
147
|
+
|
|
148
|
+
<ResponsiveWrapper>
|
|
149
|
+
<FormGroup legendText="">
|
|
150
|
+
<Controller
|
|
151
|
+
control={control}
|
|
152
|
+
name="tags"
|
|
153
|
+
render={({ field: { onChange, value, ref } }) => (
|
|
154
|
+
<FilterableMultiSelect
|
|
155
|
+
id="locationTags"
|
|
156
|
+
titleText={t('selectTags', 'Select tag(s)')}
|
|
157
|
+
placeholder={t('selectTagPlaceholder', 'Select a tag')}
|
|
158
|
+
items={Tags || []}
|
|
159
|
+
selectedItems={(value || []).map(
|
|
160
|
+
(selected) => Tags?.find((tag) => tag.uuid === selected.uuid) || selected,
|
|
161
|
+
)}
|
|
162
|
+
onChange={({ selectedItems }) => onChange(selectedItems || [])}
|
|
163
|
+
itemToString={(item) => (item && typeof item === 'object' ? item.display : '')}
|
|
164
|
+
selectionFeedback="top-after-reopen"
|
|
165
|
+
invalid={!!errors.tags?.message}
|
|
166
|
+
invalidText={errors.tags?.message}
|
|
167
|
+
disabled={!Tags?.length}
|
|
168
|
+
ref={ref}
|
|
169
|
+
/>
|
|
170
|
+
)}
|
|
171
|
+
/>
|
|
172
|
+
</FormGroup>
|
|
173
|
+
</ResponsiveWrapper>
|
|
174
|
+
</Stack>
|
|
175
|
+
</div>
|
|
176
|
+
|
|
177
|
+
<ButtonSet
|
|
178
|
+
className={classNames({
|
|
179
|
+
[styles.tablet]: isTablet,
|
|
180
|
+
[styles.desktop]: !isTablet,
|
|
181
|
+
})}>
|
|
182
|
+
<Button className={styles.buttonContainer} kind="secondary" onClick={() => closeWorkspace()}>
|
|
183
|
+
{t('cancel', 'Cancel')}
|
|
184
|
+
</Button>
|
|
185
|
+
<Button className={styles.buttonContainer} disabled={isSubmitting || !isDirty} kind="primary" type="submit">
|
|
186
|
+
{isSubmitting ? (
|
|
187
|
+
<span className={styles.inlineLoading}>
|
|
188
|
+
{t('submitting', 'Submitting' + '...')}
|
|
189
|
+
<InlineLoading status="active" iconDescription="Loading" />
|
|
190
|
+
</span>
|
|
191
|
+
) : (
|
|
192
|
+
t('saveAndClose', 'Save & close')
|
|
193
|
+
)}
|
|
194
|
+
</Button>
|
|
195
|
+
</ButtonSet>
|
|
196
|
+
</Form>
|
|
197
|
+
</Workspace2>
|
|
197
198
|
);
|
|
198
199
|
};
|
|
199
200
|
|