@kenyaemr/esm-admin-app 5.4.4-pre.50 → 5.4.4-pre.502

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 (539) hide show
  1. package/.turbo/turbo-build.log +5 -5
  2. package/dist/1102.js +1 -0
  3. package/dist/{7988.js.map → 1102.js.map} +1 -1
  4. package/dist/1278.js +1 -0
  5. package/dist/1278.js.map +1 -0
  6. package/dist/1442.js +1 -0
  7. package/dist/1442.js.map +1 -0
  8. package/dist/15.js +1 -0
  9. package/dist/15.js.map +1 -0
  10. package/dist/162.js +1 -0
  11. package/dist/162.js.map +1 -0
  12. package/dist/1620.js +1 -0
  13. package/dist/1620.js.map +1 -0
  14. package/dist/1789.js +1 -0
  15. package/dist/1789.js.map +1 -0
  16. package/dist/1831.js +1 -0
  17. package/dist/1831.js.map +1 -0
  18. package/dist/1844.js +1 -0
  19. package/dist/1844.js.map +1 -0
  20. package/dist/1854.js +1 -0
  21. package/dist/1854.js.map +1 -0
  22. package/dist/1919.js +1 -0
  23. package/dist/1919.js.map +1 -0
  24. package/dist/193.js +1 -0
  25. package/dist/193.js.map +1 -0
  26. package/dist/1946.js +1 -0
  27. package/dist/1946.js.map +1 -0
  28. package/dist/2007.js +1 -1
  29. package/dist/2007.js.map +1 -1
  30. package/dist/2043.js +1 -0
  31. package/dist/2043.js.map +1 -0
  32. package/dist/2127.js +1 -0
  33. package/dist/2127.js.map +1 -0
  34. package/dist/2146.js +1 -0
  35. package/dist/2146.js.map +1 -0
  36. package/dist/2152.js +1 -0
  37. package/dist/2152.js.map +1 -0
  38. package/dist/2202.js +1 -0
  39. package/dist/2202.js.map +1 -0
  40. package/dist/2258.js +1 -0
  41. package/dist/2258.js.map +1 -0
  42. package/dist/2394.js +1 -0
  43. package/dist/2394.js.map +1 -0
  44. package/dist/2468.js +1 -0
  45. package/dist/2468.js.map +1 -0
  46. package/dist/2534.js +1 -1
  47. package/dist/2534.js.map +1 -1
  48. package/dist/2556.js +1 -0
  49. package/dist/2556.js.map +1 -0
  50. package/dist/26.js +1 -0
  51. package/dist/26.js.map +1 -0
  52. package/dist/2638.js +1 -0
  53. package/dist/2638.js.map +1 -0
  54. package/dist/2648.js +1 -0
  55. package/dist/2648.js.map +1 -0
  56. package/dist/2709.js +1 -0
  57. package/dist/2709.js.map +1 -0
  58. package/dist/2823.js +1 -0
  59. package/dist/2823.js.map +1 -0
  60. package/dist/2840.js +1 -0
  61. package/dist/2840.js.map +1 -0
  62. package/dist/2842.js +1 -0
  63. package/dist/2842.js.map +1 -0
  64. package/dist/2916.js +1 -0
  65. package/dist/2916.js.map +1 -0
  66. package/dist/2924.js +1 -0
  67. package/dist/2924.js.map +1 -0
  68. package/dist/3137.js +1 -0
  69. package/dist/3137.js.map +1 -0
  70. package/dist/3248.js +1 -1
  71. package/dist/3248.js.map +1 -1
  72. package/dist/3282.js +1 -0
  73. package/dist/3282.js.map +1 -0
  74. package/dist/3285.js +1 -0
  75. package/dist/3285.js.map +1 -0
  76. package/dist/3302.js +1 -0
  77. package/dist/3302.js.map +1 -0
  78. package/dist/3335.js +1 -0
  79. package/dist/3335.js.map +1 -0
  80. package/dist/3378.js +1 -0
  81. package/dist/3378.js.map +1 -0
  82. package/dist/3504.js +1 -0
  83. package/dist/3504.js.map +1 -0
  84. package/dist/356.js +1 -0
  85. package/dist/356.js.map +1 -0
  86. package/dist/3569.js +1 -0
  87. package/dist/3569.js.map +1 -0
  88. package/dist/3580.js +1 -0
  89. package/dist/3580.js.map +1 -0
  90. package/dist/3690.js +1 -0
  91. package/dist/3690.js.map +1 -0
  92. package/dist/3723.js +1 -0
  93. package/dist/3723.js.map +1 -0
  94. package/dist/3745.js +1 -0
  95. package/dist/3745.js.map +1 -0
  96. package/dist/3796.js +1 -0
  97. package/dist/3796.js.map +1 -0
  98. package/dist/3813.js +1 -0
  99. package/dist/3813.js.map +1 -0
  100. package/dist/393.js +6 -0
  101. package/dist/393.js.map +1 -0
  102. package/dist/3953.js +1 -0
  103. package/dist/3953.js.map +1 -0
  104. package/dist/3989.js +1 -0
  105. package/dist/3989.js.map +1 -0
  106. package/dist/4124.js +1 -0
  107. package/dist/4124.js.map +1 -0
  108. package/dist/4163.js +1 -0
  109. package/dist/4163.js.map +1 -0
  110. package/dist/4178.js +1 -1
  111. package/dist/4178.js.map +1 -1
  112. package/dist/4308.js +1 -1
  113. package/dist/4308.js.map +1 -1
  114. package/dist/4487.js +11 -0
  115. package/dist/4487.js.map +1 -0
  116. package/dist/4588.js +1 -0
  117. package/dist/4588.js.map +1 -0
  118. package/dist/4637.js +1 -1
  119. package/dist/4637.js.map +1 -1
  120. package/dist/466.js +1 -1
  121. package/dist/466.js.map +1 -1
  122. package/dist/4711.js +1 -0
  123. package/dist/4711.js.map +1 -0
  124. package/dist/4759.js +1 -0
  125. package/dist/4759.js.map +1 -0
  126. package/dist/4817.js +1 -0
  127. package/dist/4817.js.map +1 -0
  128. package/dist/4818.js +1 -0
  129. package/dist/4818.js.map +1 -0
  130. package/dist/4902.js +1 -0
  131. package/dist/4902.js.map +1 -0
  132. package/dist/4973.js +1 -0
  133. package/dist/4973.js.map +1 -0
  134. package/dist/500.js +1 -0
  135. package/dist/500.js.map +1 -0
  136. package/dist/5086.js +1 -1
  137. package/dist/5086.js.map +1 -1
  138. package/dist/5117.js +1 -0
  139. package/dist/5117.js.map +1 -0
  140. package/dist/5203.js +1 -0
  141. package/dist/5203.js.map +1 -0
  142. package/dist/5361.js +1 -1
  143. package/dist/5361.js.map +1 -1
  144. package/dist/5362.js +1 -0
  145. package/dist/5362.js.map +1 -0
  146. package/dist/5366.js +1 -0
  147. package/dist/5366.js.map +1 -0
  148. package/dist/5536.js +1 -0
  149. package/dist/5536.js.map +1 -0
  150. package/dist/5567.js +1 -0
  151. package/dist/5567.js.map +1 -0
  152. package/dist/5598.js +1 -0
  153. package/dist/5598.js.map +1 -0
  154. package/dist/5676.js +1 -1
  155. package/dist/5676.js.map +1 -1
  156. package/dist/5693.js +1 -0
  157. package/dist/5693.js.map +1 -0
  158. package/dist/5731.js +5 -0
  159. package/dist/5731.js.map +1 -0
  160. package/dist/5767.js +1 -0
  161. package/dist/5767.js.map +1 -0
  162. package/dist/5809.js +1 -1
  163. package/dist/5809.js.map +1 -1
  164. package/dist/5825.js +1 -0
  165. package/dist/5825.js.map +1 -0
  166. package/dist/5932.js +1 -0
  167. package/dist/5932.js.map +1 -0
  168. package/dist/5941.js +1 -0
  169. package/dist/5941.js.map +1 -0
  170. package/dist/6104.js +1 -1
  171. package/dist/6104.js.map +1 -1
  172. package/dist/6273.js +1 -0
  173. package/dist/6273.js.map +1 -0
  174. package/dist/6337.js +1 -0
  175. package/dist/6337.js.map +1 -0
  176. package/dist/6355.js +1 -0
  177. package/dist/{2797.js.map → 6355.js.map} +1 -1
  178. package/dist/6357.js +1 -0
  179. package/dist/6357.js.map +1 -0
  180. package/dist/6427.js +1 -1
  181. package/dist/6427.js.map +1 -1
  182. package/dist/6478.js +7 -0
  183. package/dist/6478.js.map +1 -0
  184. package/dist/6508.js +1 -0
  185. package/dist/6508.js.map +1 -0
  186. package/dist/6567.js +1 -0
  187. package/dist/6567.js.map +1 -0
  188. package/dist/6634.js +1 -0
  189. package/dist/6634.js.map +1 -0
  190. package/dist/6698.js +1 -0
  191. package/dist/6698.js.map +1 -0
  192. package/dist/682.js +1 -1
  193. package/dist/682.js.map +1 -1
  194. package/dist/6848.js +1 -0
  195. package/dist/6848.js.map +1 -0
  196. package/dist/689.js +1 -1
  197. package/dist/689.js.map +1 -1
  198. package/dist/6978.js +1 -0
  199. package/dist/6978.js.map +1 -0
  200. package/dist/7085.js +1 -1
  201. package/dist/7085.js.map +1 -1
  202. package/dist/7187.js +1 -0
  203. package/dist/7187.js.map +1 -0
  204. package/dist/7209.js +1 -0
  205. package/dist/7209.js.map +1 -0
  206. package/dist/740.js +1 -0
  207. package/dist/740.js.map +1 -0
  208. package/dist/7419.js +1 -1
  209. package/dist/7419.js.map +1 -1
  210. package/dist/7478.js +1 -1
  211. package/dist/7478.js.map +1 -1
  212. package/dist/7686.js +1 -0
  213. package/dist/7686.js.map +1 -0
  214. package/dist/770.js +1 -0
  215. package/dist/770.js.map +1 -0
  216. package/dist/7782.js +1 -0
  217. package/dist/7782.js.map +1 -0
  218. package/dist/7783.js +1 -0
  219. package/dist/7783.js.map +1 -0
  220. package/dist/7808.js +1 -0
  221. package/dist/7808.js.map +1 -0
  222. package/dist/781.js +1 -1
  223. package/dist/781.js.map +1 -1
  224. package/dist/8183.js +1 -0
  225. package/dist/8183.js.map +1 -0
  226. package/dist/8196.js +1 -1
  227. package/dist/8196.js.map +1 -1
  228. package/dist/820.js +1 -0
  229. package/dist/820.js.map +1 -0
  230. package/dist/8240.js +1 -1
  231. package/dist/8240.js.map +1 -1
  232. package/dist/8267.js +1 -0
  233. package/dist/8267.js.map +1 -0
  234. package/dist/8472.js +1 -0
  235. package/dist/8472.js.map +1 -0
  236. package/dist/8521.js +1 -0
  237. package/dist/8521.js.map +1 -0
  238. package/dist/8602.js +1 -0
  239. package/dist/8602.js.map +1 -0
  240. package/dist/8607.js +1 -0
  241. package/dist/8607.js.map +1 -0
  242. package/dist/8743.js +1 -0
  243. package/dist/8743.js.map +1 -0
  244. package/dist/8762.js +1 -0
  245. package/dist/8762.js.map +1 -0
  246. package/dist/8781.js +1 -0
  247. package/dist/8781.js.map +1 -0
  248. package/dist/8812.js +1 -0
  249. package/dist/8812.js.map +1 -0
  250. package/dist/8952.js +1 -0
  251. package/dist/8952.js.map +1 -0
  252. package/dist/8985.js +1 -0
  253. package/dist/8985.js.map +1 -0
  254. package/dist/8996.js +1 -0
  255. package/dist/8996.js.map +1 -0
  256. package/dist/9011.js +1 -1
  257. package/dist/9011.js.map +1 -1
  258. package/dist/9049.js +1 -0
  259. package/dist/9049.js.map +1 -0
  260. package/dist/9050.js +1 -0
  261. package/dist/9050.js.map +1 -0
  262. package/dist/9061.js +1 -1
  263. package/dist/9061.js.map +1 -1
  264. package/dist/9087.js +1 -0
  265. package/dist/9087.js.map +1 -0
  266. package/dist/9148.js +1 -0
  267. package/dist/9148.js.map +1 -0
  268. package/dist/9168.js +1 -0
  269. package/dist/9168.js.map +1 -0
  270. package/dist/935.js +1 -0
  271. package/dist/935.js.map +1 -0
  272. package/dist/9425.js +1 -1
  273. package/dist/944.js +1 -0
  274. package/dist/944.js.map +1 -0
  275. package/dist/9443.js +1 -0
  276. package/dist/9443.js.map +1 -0
  277. package/dist/9520.js +1 -1
  278. package/dist/9520.js.map +1 -1
  279. package/dist/9547.js +1 -0
  280. package/dist/9547.js.map +1 -0
  281. package/dist/9549.js +1 -0
  282. package/dist/9549.js.map +1 -0
  283. package/dist/9603.js +1 -0
  284. package/dist/9603.js.map +1 -0
  285. package/dist/9612.js +1 -0
  286. package/dist/9612.js.map +1 -0
  287. package/dist/9621.js +1 -0
  288. package/dist/9621.js.map +1 -0
  289. package/dist/9662.js +1 -0
  290. package/dist/9662.js.map +1 -0
  291. package/dist/9771.js +1 -0
  292. package/dist/9771.js.map +1 -0
  293. package/dist/9774.js +1 -0
  294. package/dist/9774.js.map +1 -0
  295. package/dist/9800.js +1 -0
  296. package/dist/9800.js.map +1 -0
  297. package/dist/9806.js +1 -0
  298. package/dist/9806.js.map +1 -0
  299. package/dist/992.js +1 -0
  300. package/dist/992.js.map +1 -0
  301. package/dist/kenyaemr-esm-admin-app.js +6 -5
  302. package/dist/kenyaemr-esm-admin-app.js.buildmanifest.json +1694 -719
  303. package/dist/kenyaemr-esm-admin-app.js.map +1 -1
  304. package/dist/main.js +6 -5
  305. package/dist/main.js.map +1 -1
  306. package/dist/routes.json +1 -1
  307. package/package.json +4 -6
  308. package/src/components/confirm-modal/confirmation-operation.test.tsx +8 -19
  309. package/src/components/dashboard/dashboard.component.tsx +4 -1
  310. package/src/components/empty-state/empty-state-log.test.tsx +3 -4
  311. package/src/components/facility-setup/constant/index.ts +3 -0
  312. package/src/components/facility-setup/facility-info.component.tsx +247 -108
  313. package/src/components/facility-setup/facility-info.scss +136 -55
  314. package/src/components/facility-setup/facility-setup.component.tsx +2 -2
  315. package/src/components/facility-setup/header/header.component.tsx +4 -10
  316. package/src/components/facility-setup/header/header.scss +3 -9
  317. package/src/components/facility-setup/shared/custom-info.component.tsx +9 -0
  318. package/src/components/facility-setup/shared/custom-section-card.component.tsx +10 -0
  319. package/src/components/facility-setup/shared/custom-status-tag.component.tsx +22 -0
  320. package/src/components/facility-setup/type/index.ts +61 -0
  321. package/src/components/facility-setup/useFacilityRegistry.ts +29 -0
  322. package/src/components/global-property/dashboard/global-property-dashboard.component.tsx +23 -0
  323. package/src/components/global-property/dashboard/global-property-dashboard.scss +6 -0
  324. package/src/components/global-property/hooks/useGlobalProperty.ts +64 -0
  325. package/src/components/global-property/hooks/useLogoUpload.ts +28 -0
  326. package/src/components/global-property/index.ts +14 -0
  327. package/src/components/global-property/modal/delete-global-property-modal.component.tsx +71 -0
  328. package/src/components/global-property/modal/delete-global-property-modal.test.tsx +131 -0
  329. package/src/components/global-property/table/global-property-table.component.tsx +241 -0
  330. package/src/components/global-property/table/global-property-table.scss +44 -0
  331. package/src/components/global-property/table/global-property-table.test.tsx +202 -0
  332. package/src/components/global-property/workspace/global-property-form-schema.ts +32 -0
  333. package/src/components/global-property/workspace/global-property.workspace.scss +40 -0
  334. package/src/components/global-property/workspace/global-property.workspace.test.tsx +172 -0
  335. package/src/components/global-property/workspace/global-property.workspace.tsx +260 -0
  336. package/src/components/global-property/workspace/upload-logo.workspace.scss +61 -0
  337. package/src/components/global-property/workspace/upload-logo.workspace.test.tsx +180 -0
  338. package/src/components/global-property/workspace/upload-logo.workspace.tsx +191 -0
  339. package/src/components/hook/healthWorkerRegistry.ts +78 -0
  340. package/src/components/hook/useProfessionalRegistryEnums.ts +59 -0
  341. package/src/components/locations/forms/add-location/add-location.workspace.tsx +96 -95
  342. package/src/components/locations/forms/search-location/search-location.workspace.tsx +90 -85
  343. package/src/components/locations/tables/locations-table.component.tsx +117 -121
  344. package/src/components/logs-table/operation-log-table.component.tsx +87 -75
  345. package/src/components/logs-table/operation-log.test.tsx +134 -28
  346. package/src/components/modal/hwr-confirmation.modal.scss +80 -4
  347. package/src/components/modal/hwr-confirmation.modal.tsx +118 -128
  348. package/src/components/modal/hwr-sync.modal.tsx +194 -106
  349. package/src/components/users/manage-users/manage-user-role-scope/user-role-scope-workspace/user-role-scope.workspace.tsx +14 -14
  350. package/src/components/users/manage-users/user-details/user-detail.scss +167 -39
  351. package/src/components/users/manage-users/user-details/user-details.component.tsx +130 -122
  352. package/src/components/users/manage-users/user-list/user-list.component.tsx +22 -9
  353. package/src/components/users/manage-users/user-management.workspace.scss +233 -95
  354. package/src/components/users/manage-users/user-management.workspace.tsx +800 -687
  355. package/src/components/users/userManagementFormSchema.tsx +17 -8
  356. package/src/config-schema.ts +48 -68
  357. package/src/index.ts +21 -7
  358. package/src/left-pannel-link.component.tsx +5 -3
  359. package/src/root.component.tsx +13 -13
  360. package/src/routes.json +60 -36
  361. package/src/types/index.ts +40 -3
  362. package/translations/am.json +213 -13
  363. package/translations/en.json +225 -25
  364. package/translations/fr.json +260 -58
  365. package/translations/sw.json +329 -129
  366. package/tsconfig.json +1 -1
  367. package/dist/1072.js +0 -1
  368. package/dist/1072.js.map +0 -1
  369. package/dist/1091.js +0 -1
  370. package/dist/1091.js.map +0 -1
  371. package/dist/1172.js +0 -1
  372. package/dist/1172.js.map +0 -1
  373. package/dist/132.js +0 -1
  374. package/dist/132.js.map +0 -1
  375. package/dist/1332.js +0 -1
  376. package/dist/1332.js.map +0 -1
  377. package/dist/1577.js +0 -1
  378. package/dist/1577.js.map +0 -1
  379. package/dist/1660.js +0 -1
  380. package/dist/1660.js.map +0 -1
  381. package/dist/1729.js +0 -17
  382. package/dist/1729.js.map +0 -1
  383. package/dist/1761.js +0 -1
  384. package/dist/1761.js.map +0 -1
  385. package/dist/1809.js +0 -7
  386. package/dist/1809.js.map +0 -1
  387. package/dist/1866.js +0 -1
  388. package/dist/1866.js.map +0 -1
  389. package/dist/1962.js +0 -1
  390. package/dist/1962.js.map +0 -1
  391. package/dist/2045.js +0 -1
  392. package/dist/2045.js.map +0 -1
  393. package/dist/2163.js +0 -1
  394. package/dist/2163.js.map +0 -1
  395. package/dist/2267.js +0 -1
  396. package/dist/2267.js.map +0 -1
  397. package/dist/2357.js +0 -1
  398. package/dist/2357.js.map +0 -1
  399. package/dist/2419.js +0 -1
  400. package/dist/2419.js.map +0 -1
  401. package/dist/2561.js +0 -1
  402. package/dist/2561.js.map +0 -1
  403. package/dist/2564.js +0 -1
  404. package/dist/2564.js.map +0 -1
  405. package/dist/2738.js +0 -1
  406. package/dist/2738.js.map +0 -1
  407. package/dist/2797.js +0 -1
  408. package/dist/2810.js +0 -2
  409. package/dist/2810.js.map +0 -1
  410. package/dist/2867.js +0 -1
  411. package/dist/2867.js.map +0 -1
  412. package/dist/3040.js +0 -1
  413. package/dist/3134.js +0 -1
  414. package/dist/3134.js.map +0 -1
  415. package/dist/3189.js +0 -1
  416. package/dist/3189.js.map +0 -1
  417. package/dist/3228.js +0 -1
  418. package/dist/3228.js.map +0 -1
  419. package/dist/3381.js +0 -1
  420. package/dist/3381.js.map +0 -1
  421. package/dist/3472.js +0 -1
  422. package/dist/3472.js.map +0 -1
  423. package/dist/3491.js +0 -1
  424. package/dist/3491.js.map +0 -1
  425. package/dist/3509.js +0 -1
  426. package/dist/3509.js.map +0 -1
  427. package/dist/3576.js +0 -1
  428. package/dist/3576.js.map +0 -1
  429. package/dist/3968.js +0 -1
  430. package/dist/3968.js.map +0 -1
  431. package/dist/4146.js +0 -1
  432. package/dist/4146.js.map +0 -1
  433. package/dist/4220.js +0 -1
  434. package/dist/4220.js.map +0 -1
  435. package/dist/4224.js +0 -1
  436. package/dist/4224.js.map +0 -1
  437. package/dist/4402.js +0 -1
  438. package/dist/4402.js.map +0 -1
  439. package/dist/4724.js +0 -1
  440. package/dist/4724.js.map +0 -1
  441. package/dist/4972.js +0 -1
  442. package/dist/4972.js.map +0 -1
  443. package/dist/509.js +0 -1
  444. package/dist/509.js.map +0 -1
  445. package/dist/5096.js +0 -1
  446. package/dist/5096.js.map +0 -1
  447. package/dist/5119.js +0 -1
  448. package/dist/5119.js.map +0 -1
  449. package/dist/5136.js +0 -1
  450. package/dist/5136.js.map +0 -1
  451. package/dist/5159.js +0 -13
  452. package/dist/5159.js.map +0 -1
  453. package/dist/5533.js +0 -1
  454. package/dist/5533.js.map +0 -1
  455. package/dist/5870.js +0 -1
  456. package/dist/5870.js.map +0 -1
  457. package/dist/5882.js +0 -1
  458. package/dist/5939.js +0 -5
  459. package/dist/5939.js.map +0 -1
  460. package/dist/6004.js +0 -1
  461. package/dist/6004.js.map +0 -1
  462. package/dist/6121.js +0 -3
  463. package/dist/6121.js.map +0 -1
  464. package/dist/6137.js +0 -1
  465. package/dist/6137.js.map +0 -1
  466. package/dist/6192.js +0 -1
  467. package/dist/6192.js.map +0 -1
  468. package/dist/6232.js +0 -1
  469. package/dist/6232.js.map +0 -1
  470. package/dist/6356.js +0 -1
  471. package/dist/6356.js.map +0 -1
  472. package/dist/6363.js +0 -1
  473. package/dist/6363.js.map +0 -1
  474. package/dist/6548.js +0 -1
  475. package/dist/6548.js.map +0 -1
  476. package/dist/6571.js +0 -1
  477. package/dist/6571.js.map +0 -1
  478. package/dist/6615.js +0 -1
  479. package/dist/6615.js.map +0 -1
  480. package/dist/6721.js +0 -1
  481. package/dist/6721.js.map +0 -1
  482. package/dist/6868.js +0 -1
  483. package/dist/6868.js.map +0 -1
  484. package/dist/6892.js +0 -1
  485. package/dist/6892.js.map +0 -1
  486. package/dist/7127.js +0 -1
  487. package/dist/7329.js +0 -1
  488. package/dist/7329.js.map +0 -1
  489. package/dist/754.js +0 -1
  490. package/dist/754.js.map +0 -1
  491. package/dist/7544.js +0 -1
  492. package/dist/7544.js.map +0 -1
  493. package/dist/7560.js +0 -1
  494. package/dist/7560.js.map +0 -1
  495. package/dist/7988.js +0 -1
  496. package/dist/8179.js +0 -6
  497. package/dist/8179.js.map +0 -1
  498. package/dist/8189.js +0 -1
  499. package/dist/8189.js.map +0 -1
  500. package/dist/8249.js +0 -1
  501. package/dist/8249.js.map +0 -1
  502. package/dist/8502.js +0 -1
  503. package/dist/8502.js.map +0 -1
  504. package/dist/8522.js +0 -1
  505. package/dist/8522.js.map +0 -1
  506. package/dist/8622.js +0 -1
  507. package/dist/8622.js.map +0 -1
  508. package/dist/8775.js +0 -11
  509. package/dist/8775.js.map +0 -1
  510. package/dist/8820.js +0 -1
  511. package/dist/8820.js.map +0 -1
  512. package/dist/887.js +0 -1
  513. package/dist/887.js.map +0 -1
  514. package/dist/8927.js +0 -1
  515. package/dist/8927.js.map +0 -1
  516. package/dist/8977.js +0 -1
  517. package/dist/8977.js.map +0 -1
  518. package/dist/916.js +0 -1
  519. package/dist/9303.js +0 -1
  520. package/dist/9303.js.map +0 -1
  521. package/dist/9466.js +0 -1
  522. package/dist/9466.js.map +0 -1
  523. package/dist/9675.js +0 -1
  524. package/dist/9675.js.map +0 -1
  525. package/dist/9787.js +0 -1
  526. package/dist/9787.js.map +0 -1
  527. package/dist/981.js +0 -1
  528. package/dist/981.js.map +0 -1
  529. package/dist/984.js +0 -1
  530. package/dist/984.js.map +0 -1
  531. package/dist/9931.js +0 -1
  532. package/dist/9931.js.map +0 -1
  533. package/dist/9947.js +0 -1
  534. package/dist/9947.js.map +0 -1
  535. package/jest.config.js +0 -8
  536. package/src/components/facility-setup/card.component.tsx +0 -16
  537. package/src/components/facility-setup/facility-setup.resource.tsx +0 -7
  538. package/src/components/hook/healthWorkerAdapter.ts +0 -213
  539. package/src/components/hook/useFacilityInfo.tsx +0 -37
@@ -1,27 +1,29 @@
1
- import { Button, ButtonSet, FilterableMultiSelect, Form, FormGroup, InlineLoading, Stack } from '@carbon/react';
1
+ import React, { useEffect, useState } from 'react';
2
+ import { useTranslation } from 'react-i18next';
3
+ import { mutate } from 'swr';
4
+ import classNames from 'classnames';
5
+ import { z } from 'zod';
6
+ import { Controller, useForm } from 'react-hook-form';
2
7
  import { zodResolver } from '@hookform/resolvers/zod';
3
8
  import {
4
- type DefaultWorkspaceProps,
9
+ Workspace2,
10
+ Workspace2DefinitionProps,
11
+ useLayoutType,
5
12
  ResponsiveWrapper,
6
13
  restBaseUrl,
7
14
  showSnackbar,
8
- useLayoutType,
9
15
  } from '@openmrs/esm-framework';
10
- import classNames from 'classnames';
11
- import React, { useEffect, useState } from 'react';
12
- import { Controller, useForm } from 'react-hook-form';
13
- import { useTranslation } from 'react-i18next';
14
- import { mutate } from 'swr';
15
- import { z } from 'zod';
16
+ import { Button, ButtonSet, FilterableMultiSelect, Form, FormGroup, InlineLoading, Stack } from '@carbon/react';
17
+
16
18
  import { LocationAutosuggest } from '../../auto-suggest/location-autosuggest.component';
17
19
  import ResultsTile from '../../common/results-tile.component';
18
- import { extractErrorMessagesFromResponse } from '../../helpers';
19
- import { saveOrUpdateLocation } from '../../hooks/useLocation';
20
20
  import { useLocationTags } from '../../hooks/useLocationTags';
21
+ import { saveOrUpdateLocation } from '../../hooks/useLocation';
22
+ import { extractErrorMessagesFromResponse } from '../../helpers';
21
23
  import { LocationResponse } from '../../types';
22
24
  import styles from './search-location.workspace.scss';
23
25
 
24
- type AddLocationWorkspaceProps = DefaultWorkspaceProps & {
26
+ type AddLocationWorkspaceProps = {
25
27
  location?: LocationResponse;
26
28
  };
27
29
 
@@ -37,17 +39,15 @@ const locationFormSchema = z.object({
37
39
 
38
40
  type LocationFormType = z.infer<typeof locationFormSchema>;
39
41
 
40
- const SearchLocationWorkspace: React.FC<AddLocationWorkspaceProps> = ({
42
+ const SearchLocationWorkspace: React.FC<Workspace2DefinitionProps<AddLocationWorkspaceProps, {}, {}>> = ({
41
43
  closeWorkspace,
42
- closeWorkspaceWithSavedChanges,
43
- promptBeforeClosing,
44
- location,
44
+ workspaceProps: { location = {} as LocationResponse },
45
45
  }) => {
46
46
  const { t } = useTranslation();
47
47
  const isTablet = useLayoutType() === 'tablet';
48
48
  const { locationTagList: Tags } = useLocationTags();
49
49
  const [selectedLocation, setSelectedLocation] = useState<LocationResponse | null>(null);
50
-
50
+ const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
51
51
  const handleMutation = () => {
52
52
  const url = `${restBaseUrl}/location`;
53
53
  mutate((key) => typeof key === 'string' && key.startsWith(url), undefined, { revalidate: true });
@@ -56,7 +56,6 @@ const SearchLocationWorkspace: React.FC<AddLocationWorkspaceProps> = ({
56
56
  const {
57
57
  handleSubmit,
58
58
  control,
59
- getValues,
60
59
  setValue,
61
60
  reset,
62
61
  formState: { isSubmitting, isDirty, errors },
@@ -89,7 +88,7 @@ const SearchLocationWorkspace: React.FC<AddLocationWorkspaceProps> = ({
89
88
  });
90
89
 
91
90
  handleMutation();
92
- closeWorkspaceWithSavedChanges();
91
+ closeWorkspace({ discardUnsavedChanges: true });
93
92
  } catch (error: any) {
94
93
  console.error('Error saving location:', error);
95
94
  const errorMessages = extractErrorMessagesFromResponse(error);
@@ -137,78 +136,84 @@ const SearchLocationWorkspace: React.FC<AddLocationWorkspaceProps> = ({
137
136
  };
138
137
 
139
138
  useEffect(() => {
140
- promptBeforeClosing(() => isDirty);
141
- }, [isDirty, promptBeforeClosing]);
139
+ setHasUnsavedChanges(true);
140
+ }, [isDirty, setHasUnsavedChanges]);
142
141
 
143
142
  const isFormReady = (selectedLocation || location) && isDirty;
144
143
 
145
144
  return (
146
- <Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
147
- <div className={styles.formContainer}>
148
- <Stack gap={3}>
149
- <ResponsiveWrapper>
150
- <FormGroup legendText="">
151
- {!selectedLocation ? (
152
- <LocationAutosuggest
153
- onLocationSelected={handleLocationSelected}
154
- labelText={t('searchForLocation', 'Search for location')}
155
- placeholder={t('searchParentLocation', 'Search for location...')}
156
- />
157
- ) : (
158
- renderSelectedLocationTile()
159
- )}
160
- </FormGroup>
161
- </ResponsiveWrapper>
162
-
163
- <ResponsiveWrapper>
164
- <FormGroup legendText="">
165
- <Controller
166
- control={control}
167
- name="tags"
168
- render={({ field: { onChange, value, ref } }) => (
169
- <FilterableMultiSelect
170
- id="locationTags"
171
- titleText={t('selectTags', 'Select tag(s)')}
172
- placeholder={t('selectTagPlaceholder', 'Select a tag')}
173
- items={Tags || []}
174
- selectedItems={(value || []).map(
175
- (selected) => Tags?.find((tag) => tag.uuid === selected.uuid) || selected,
176
- )}
177
- onChange={({ selectedItems }) => onChange(selectedItems || [])}
178
- itemToString={(item) => (item && typeof item === 'object' ? item.display : '')}
179
- selectionFeedback="top-after-reopen"
180
- invalid={!!errors.tags?.message}
181
- invalidText={errors.tags?.message}
182
- disabled={!Tags?.length}
183
- ref={ref}
145
+ <Workspace2 title={t('searchLocation', 'Search Location')} hasUnsavedChanges={hasUnsavedChanges}>
146
+ <Form onSubmit={handleSubmit(onSubmit)} className={styles.form}>
147
+ <div className={styles.formContainer}>
148
+ <Stack gap={3}>
149
+ <ResponsiveWrapper>
150
+ <FormGroup legendText="">
151
+ {!selectedLocation ? (
152
+ <LocationAutosuggest
153
+ onLocationSelected={handleLocationSelected}
154
+ labelText={t('searchForLocation', 'Search for location')}
155
+ placeholder={t('searchParentLocation', 'Search for location...')}
184
156
  />
157
+ ) : (
158
+ renderSelectedLocationTile()
185
159
  )}
186
- />
187
- </FormGroup>
188
- </ResponsiveWrapper>
189
- </Stack>
190
- </div>
191
-
192
- <ButtonSet
193
- className={classNames({
194
- [styles.tablet]: isTablet,
195
- [styles.desktop]: !isTablet,
196
- })}>
197
- <Button className={styles.buttonContainer} kind="secondary" onClick={() => closeWorkspace()}>
198
- {t('cancel', 'Cancel')}
199
- </Button>
200
- <Button className={styles.buttonContainer} disabled={isSubmitting || !isFormReady} kind="primary" type="submit">
201
- {isSubmitting ? (
202
- <span className={styles.inlineLoading}>
203
- {t('submitting', 'Submitting' + '...')}
204
- <InlineLoading status="active" iconDescription="Loading" />
205
- </span>
206
- ) : (
207
- t('saveAndClose', 'Save & close')
208
- )}
209
- </Button>
210
- </ButtonSet>
211
- </Form>
160
+ </FormGroup>
161
+ </ResponsiveWrapper>
162
+
163
+ <ResponsiveWrapper>
164
+ <FormGroup legendText="">
165
+ <Controller
166
+ control={control}
167
+ name="tags"
168
+ render={({ field: { onChange, value, ref } }) => (
169
+ <FilterableMultiSelect
170
+ id="locationTags"
171
+ titleText={t('selectTags', 'Select tag(s)')}
172
+ placeholder={t('selectTagPlaceholder', 'Select a tag')}
173
+ items={Tags || []}
174
+ selectedItems={(value || []).map(
175
+ (selected) => Tags?.find((tag) => tag.uuid === selected.uuid) || selected,
176
+ )}
177
+ onChange={({ selectedItems }) => onChange(selectedItems || [])}
178
+ itemToString={(item) => (item && typeof item === 'object' ? item.display : '')}
179
+ selectionFeedback="top-after-reopen"
180
+ invalid={!!errors.tags?.message}
181
+ invalidText={errors.tags?.message}
182
+ disabled={!Tags?.length}
183
+ ref={ref}
184
+ />
185
+ )}
186
+ />
187
+ </FormGroup>
188
+ </ResponsiveWrapper>
189
+ </Stack>
190
+ </div>
191
+
192
+ <ButtonSet
193
+ className={classNames({
194
+ [styles.tablet]: isTablet,
195
+ [styles.desktop]: !isTablet,
196
+ })}>
197
+ <Button className={styles.buttonContainer} kind="secondary" onClick={() => closeWorkspace()}>
198
+ {t('cancel', 'Cancel')}
199
+ </Button>
200
+ <Button
201
+ className={styles.buttonContainer}
202
+ disabled={isSubmitting || !isFormReady}
203
+ kind="primary"
204
+ type="submit">
205
+ {isSubmitting ? (
206
+ <span className={styles.inlineLoading}>
207
+ {t('submitting', 'Submitting' + '...')}
208
+ <InlineLoading status="active" iconDescription="Loading" />
209
+ </span>
210
+ ) : (
211
+ t('saveAndClose', 'Save & close')
212
+ )}
213
+ </Button>
214
+ </ButtonSet>
215
+ </Form>
216
+ </Workspace2>
212
217
  );
213
218
  };
214
219
 
@@ -1,4 +1,4 @@
1
- import React, { useMemo, useState, useEffect } from 'react';
1
+ import React, { useMemo, useState } from 'react';
2
2
  import { useTranslation } from 'react-i18next';
3
3
  import {
4
4
  Button,
@@ -18,7 +18,7 @@ import {
18
18
  Tag,
19
19
  } from '@carbon/react';
20
20
  import { Add } from '@carbon/react/icons';
21
- import { WorkspaceContainer, isDesktop as desktopLayout, launchWorkspace, useLayoutType } from '@openmrs/esm-framework';
21
+ import { launchWorkspace2, useLayoutType } from '@openmrs/esm-framework';
22
22
  import styles from './locations-table.scss';
23
23
  import { CardHeader } from '@openmrs/esm-patient-common-lib';
24
24
  import { useFacilitiesTagged } from './locations-table.resource';
@@ -28,23 +28,26 @@ const LocationsTable: React.FC = () => {
28
28
  const { t } = useTranslation();
29
29
  const layout = useLayoutType();
30
30
  const isTablet = layout === 'tablet';
31
- const isDesktop = desktopLayout(layout);
32
31
  const [pageSize, setPageSize] = useState(10);
33
32
  const [searchTerm, setSearchTerm] = useState('');
34
33
  const [currentPage, setCurrentPage] = useState(1);
35
34
 
36
- const { locationTagList, isLoading: tagsLoading, error: tagsError } = useLocationTags();
35
+ const { locationTagList, isLoading: tagsLoading } = useLocationTags();
37
36
  const { facilityList, isLoading: taggedLoading } = useFacilitiesTagged({ results: locationTagList });
38
37
 
39
38
  const handleAddLocationWorkspace = () => {
40
- launchWorkspace('add-location-workspace', {
41
- workspaceTitle: t('addLocation', 'Add Location'),
39
+ launchWorkspace2('add-location-workspace', {
40
+ workspaceProps: {
41
+ workspaceTitle: t('addLocation', 'Add Location'),
42
+ },
42
43
  });
43
44
  };
44
45
 
45
46
  const handleSearchLocationWorkspace = () => {
46
- launchWorkspace('search-location-workspace', {
47
- workspaceTitle: t('tagLocation', 'Tag Location'),
47
+ launchWorkspace2('search-location-workspace', {
48
+ workspaceProps: {
49
+ workspaceTitle: t('tagLocation', 'Tag Location'),
50
+ },
48
51
  });
49
52
  };
50
53
 
@@ -117,126 +120,119 @@ const LocationsTable: React.FC = () => {
117
120
 
118
121
  if (tagsLoading || (taggedLoading && !facilityList.length)) {
119
122
  return (
120
- <>
121
- <div className={styles.widgetCard}>
122
- <DataTableSkeleton role="progressbar" compact={isDesktop} zebra />
123
- </div>
124
- </>
123
+ <div className={styles.widgetCard}>
124
+ <DataTableSkeleton role="progressbar" zebra />
125
+ </div>
125
126
  );
126
127
  }
127
128
 
128
129
  return (
129
- <>
130
- <div className={styles.widgetCard}>
131
- <CardHeader title={t('locations', 'Locations')}>
132
- <span className={styles.backgroundDataFetchingIndicator}>
133
- <span>{tagsLoading ? <InlineLoading /> : null}</span>
134
- </span>
135
- <div className={styles.headerActions}>
136
- <>
137
- <div className={styles.filterContainer}>
138
- <Search
139
- onChange={(e) => {
140
- setSearchTerm(e.target.value);
141
- setCurrentPage(1);
142
- }}
143
- placeholder={t('search', 'Search location')}
144
- value={searchTerm}
145
- labelText={t('search', 'Search location')}
146
- />
147
- </div>
148
- <Button
149
- kind="ghost"
150
- renderIcon={(props) => <Add size={16} {...props} />}
151
- onClick={handleAddLocationWorkspace}>
152
- {t('addLocation', 'Add Location')}
153
- </Button>
154
- <Button
155
- kind="ghost"
156
- renderIcon={(props) => <Add size={16} {...props} />}
157
- onClick={handleSearchLocationWorkspace}>
158
- {t('tagLocation', 'Tag Location')}
159
- </Button>
160
- </>
130
+ <div className={styles.widgetCard}>
131
+ <CardHeader title={t('locations', 'Locations')}>
132
+ <span className={styles.backgroundDataFetchingIndicator}>
133
+ <span>{tagsLoading ? <InlineLoading /> : null}</span>
134
+ </span>
135
+ <div className={styles.headerActions}>
136
+ <div className={styles.filterContainer}>
137
+ <Search
138
+ onChange={(e) => {
139
+ setSearchTerm(e.target.value);
140
+ setCurrentPage(1);
141
+ }}
142
+ placeholder={t('search', 'Search location')}
143
+ value={searchTerm}
144
+ labelText={t('search', 'Search location')}
145
+ />
161
146
  </div>
162
- </CardHeader>
163
-
164
- <DataTable rows={paginatedRows} headers={tableHeaders} isSortable size={isTablet ? 'lg' : 'sm'} useZebraStyles>
165
- {({ rows, headers, getTableProps }) => {
166
- return (
167
- <TableContainer>
168
- <Table {...getTableProps()}>
169
- <TableHead>
170
- <TableRow>
171
- {headers.map((header) => (
172
- <TableHeader key={header.key}>{header.header}</TableHeader>
147
+ <Button
148
+ kind="ghost"
149
+ renderIcon={(props) => <Add size={16} {...props} />}
150
+ onClick={handleAddLocationWorkspace}>
151
+ {t('addLocation', 'Add Location')}
152
+ </Button>
153
+ <Button
154
+ kind="ghost"
155
+ renderIcon={(props) => <Add size={16} {...props} />}
156
+ onClick={handleSearchLocationWorkspace}>
157
+ {t('tagLocation', 'Tag Location')}
158
+ </Button>
159
+ </div>
160
+ </CardHeader>
161
+
162
+ <DataTable rows={paginatedRows} headers={tableHeaders} isSortable size={isTablet ? 'lg' : 'sm'} useZebraStyles>
163
+ {({ rows, headers, getTableProps }) => {
164
+ return (
165
+ <TableContainer>
166
+ <Table {...getTableProps()}>
167
+ <TableHead>
168
+ <TableRow>
169
+ {headers.map((header) => (
170
+ <TableHeader key={header.key}>{header.header}</TableHeader>
171
+ ))}
172
+ </TableRow>
173
+ </TableHead>
174
+ <TableBody>
175
+ {rows.map((row) => (
176
+ <TableRow key={row.id}>
177
+ {row.cells.map((cell) => (
178
+ <TableCell key={cell.id}>
179
+ {cell.id.includes('tags') && cell.value !== 'No tags' ? (
180
+ <div style={{ display: 'flex', flexWrap: 'wrap', gap: '4px' }}>
181
+ {cell.value.split(', ').map((tag, index) => (
182
+ <Tag key={index} type="blue" size="sm">
183
+ {tag}
184
+ </Tag>
185
+ ))}
186
+ </div>
187
+ ) : (
188
+ cell.value
189
+ )}
190
+ </TableCell>
173
191
  ))}
174
192
  </TableRow>
175
- </TableHead>
176
- <TableBody>
177
- {rows.map((row) => (
178
- <TableRow key={row.id}>
179
- {row.cells.map((cell) => (
180
- <TableCell key={cell.id}>
181
- {cell.id.includes('tags') && cell.value !== 'No tags' ? (
182
- <div style={{ display: 'flex', flexWrap: 'wrap', gap: '4px' }}>
183
- {cell.value.split(', ').map((tag, index) => (
184
- <Tag key={index} type="blue" size="sm">
185
- {tag}
186
- </Tag>
187
- ))}
188
- </div>
189
- ) : (
190
- cell.value
191
- )}
192
- </TableCell>
193
- ))}
194
- </TableRow>
195
- ))}
196
- </TableBody>
197
- </Table>
198
- {rows.length === 0 ? (
199
- <div className={styles.tileContainer}>
200
- <Tile className={styles.tile}>
201
- <div className={styles.tileContent}>
202
- <p className={styles.content}>
203
- {searchTerm
204
- ? t('noSearchResults', `No results found for "${searchTerm}"`)
205
- : t('noData', 'No data to display')}
206
- </p>
207
- <p className={styles.helper}>
208
- {searchTerm
209
- ? t('tryDifferentSearch', 'Try a different search term')
210
- : t('checkFilters', 'Check the filters above')}
211
- </p>
212
- </div>
213
- </Tile>
214
- </div>
215
- ) : null}
216
- <Pagination
217
- backwardText="Previous page"
218
- forwardText="Next page"
219
- page={currentPage}
220
- pageSize={pageSize}
221
- pageSizes={[10, 20, 30, 40, 50]}
222
- totalItems={filteredRows.length}
223
- onChange={({ pageSize: newPageSize, page }) => {
224
- if (newPageSize !== pageSize) {
225
- setPageSize(newPageSize);
226
- setCurrentPage(1);
227
- }
228
- if (page !== currentPage) {
229
- setCurrentPage(page);
230
- }
231
- }}
232
- />
233
- </TableContainer>
234
- );
235
- }}
236
- </DataTable>
237
- </div>
238
- <WorkspaceContainer contextKey="locations" />
239
- </>
193
+ ))}
194
+ </TableBody>
195
+ </Table>
196
+ {rows.length === 0 ? (
197
+ <div className={styles.tileContainer}>
198
+ <Tile className={styles.tile}>
199
+ <div className={styles.tileContent}>
200
+ <p className={styles.content}>
201
+ {searchTerm
202
+ ? t('noSearchResults', `No results found for "${searchTerm}"`)
203
+ : t('noData', 'No data to display')}
204
+ </p>
205
+ <p className={styles.helper}>
206
+ {searchTerm
207
+ ? t('tryDifferentSearch', 'Try a different search term')
208
+ : t('checkFilters', 'Check the filters above')}
209
+ </p>
210
+ </div>
211
+ </Tile>
212
+ </div>
213
+ ) : null}
214
+ <Pagination
215
+ backwardText="Previous page"
216
+ forwardText="Next page"
217
+ page={currentPage}
218
+ pageSize={pageSize}
219
+ pageSizes={[10, 20, 30, 40, 50]}
220
+ totalItems={filteredRows.length}
221
+ onChange={({ pageSize: newPageSize, page }) => {
222
+ if (newPageSize !== pageSize) {
223
+ setPageSize(newPageSize);
224
+ setCurrentPage(1);
225
+ }
226
+ if (page !== currentPage) {
227
+ setCurrentPage(page);
228
+ }
229
+ }}
230
+ />
231
+ </TableContainer>
232
+ );
233
+ }}
234
+ </DataTable>
235
+ </div>
240
236
  );
241
237
  };
242
238