@acorex-platform/module-workplacesafety-management-client 0.0.37 → 0.0.46

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 (125) hide show
  1. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Ds0Fkspp.mjs → acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-C3a08xjg.mjs} +79 -32
  2. package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-C3a08xjg.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-hierarchy-levels.mjs +19 -5
  4. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-hierarchy-levels.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-measure.mjs +19 -5
  6. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-control-measure.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs +19 -5
  8. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-ppe-rule.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-register.mjs +19 -5
  10. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-register.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-risk.mjs +22 -72
  12. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard-risk.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs +20 -6
  14. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-hazard.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-ppe-item.mjs +19 -5
  16. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-ppe-item.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.mjs +1516 -0
  18. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs +82 -12
  20. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-section.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs +82 -12
  22. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type-section.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type.mjs +19 -5
  24. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-type.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs +39 -6
  26. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan.mjs.map +1 -1
  27. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs +20 -5
  28. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-template.mjs.map +1 -1
  29. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-section-type.mjs +19 -5
  30. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-section-type.mjs.map +1 -1
  31. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs +82 -12
  32. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-work-step-type.mjs.map +1 -1
  33. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-BI4TLvSE.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs} +21 -21
  34. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-C46YEBVd.mjs.map +1 -0
  35. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-COlCNnyK.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-oylKTsgJ.mjs} +16 -2
  36. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-oylKTsgJ.mjs.map +1 -0
  37. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BrXGzqZU.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-DHm1nRwW.mjs} +16 -2
  38. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-DHm1nRwW.mjs.map +1 -0
  39. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DHJus7OP.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DH-hPuAD.mjs} +16 -2
  40. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DH-hPuAD.mjs.map +1 -0
  41. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-CogjoDox.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-g4AT_IiT.mjs} +16 -2
  42. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-g4AT_IiT.mjs.map +1 -0
  43. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-9UWHmIXV.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-BwNlWbnC.mjs} +18 -72
  44. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-BwNlWbnC.mjs.map +1 -0
  45. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-CNPbxULL.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-Cogwbd1P.mjs} +17 -3
  46. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-Cogwbd1P.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-D5iOBl3P.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-0xqGaPnk.mjs} +16 -2
  48. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-0xqGaPnk.mjs.map +1 -0
  49. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs +7 -0
  50. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-risk-management.integration-CUZIl8zt.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs +324 -0
  52. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-activity.entity-CZCYupQT.mjs.map +1 -0
  53. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-TdIMIkM7.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs} +62 -10
  54. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-D0fzHV_L.mjs.map +1 -0
  55. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-DJAI-7lB.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BpziBgGf.mjs} +17 -3
  56. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-DJAI-7lB.mjs.map → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section.entity-BpziBgGf.mjs.map} +1 -1
  57. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BGZ1VAW3.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-D8wL0ned.mjs} +17 -3
  58. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-D8wL0ned.mjs.map +1 -0
  59. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-B6NYL4xi.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-DrqQDYn9.mjs} +16 -2
  60. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-DrqQDYn9.mjs.map +1 -0
  61. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-BSUR9jqs.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-DaRnWCin.mjs} +36 -3
  62. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-DaRnWCin.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-CIHy_hLh.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-Coj5Rzry.mjs} +17 -2
  64. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-Coj5Rzry.mjs.map +1 -0
  65. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-Cs4nIHou.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-BU5roQ5-.mjs} +16 -2
  66. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-BU5roQ5-.mjs.map +1 -0
  67. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-CJFWDOoh.mjs → acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-DijGV30H.mjs} +17 -3
  68. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-DijGV30H.mjs.map +1 -0
  69. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog.mjs +1 -1
  70. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs +144 -168
  71. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts.mjs.map +1 -1
  72. package/fesm2022/acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs +165 -0
  73. package/fesm2022/acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs.map +1 -0
  74. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs +240 -0
  75. package/fesm2022/acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs.map +1 -0
  76. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs → acorex-platform-module-workplacesafety-management-client-index-CInaiEjw.mjs} +130 -398
  77. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-CInaiEjw.mjs.map +1 -0
  78. package/fesm2022/acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-Ce67NSIZ.mjs +136 -0
  79. package/fesm2022/acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-Ce67NSIZ.mjs.map +1 -0
  80. package/fesm2022/acorex-platform-module-workplacesafety-management-client-local-entities.mjs +1 -1
  81. package/fesm2022/acorex-platform-module-workplacesafety-management-client-local-entities.mjs.map +1 -1
  82. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-DJqqiYlD.mjs +102 -0
  83. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-DJqqiYlD.mjs.map +1 -0
  84. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs +33 -0
  85. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs.map +1 -0
  86. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs → acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs} +252 -72
  87. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs.map +1 -0
  88. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs +185 -0
  89. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-C0SEJsVM.mjs.map +1 -0
  90. package/fesm2022/{acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CLj3y_JD.mjs → acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-D0aRQHWk.mjs} +30 -94
  91. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-D0aRQHWk.mjs.map +1 -0
  92. package/fesm2022/acorex-platform-module-workplacesafety-management-client.mjs +1 -1
  93. package/package.json +6 -6
  94. package/types/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-activity.d.ts +5 -0
  95. package/types/acorex-platform-module-workplacesafety-management-client-contracts.d.ts +133 -157
  96. package/fesm2022/acorex-platform-module-workplacesafety-management-client-acorex-platform-module-workplacesafety-management-client-Ds0Fkspp.mjs.map +0 -1
  97. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.mjs +0 -542
  98. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.mjs.map +0 -1
  99. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-BI4TLvSE.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-hierarchy-levels.entity-COlCNnyK.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-control-measure.entity-BrXGzqZU.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-ppe-rule.entity-DHJus7OP.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-register.entity-CogjoDox.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard-risk.entity-9UWHmIXV.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-hazard.entity-CNPbxULL.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-ppe-item.entity-D5iOBl3P.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-section-dependency-TdIMIkM7.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type-section.entity-BGZ1VAW3.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-type.entity-B6NYL4xi.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs +0 -405
  111. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan-work-step.entity-BlCbf5qP.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-plan.entity-BSUR9jqs.mjs.map +0 -1
  113. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-safety-template.entity-CIHy_hLh.mjs.map +0 -1
  114. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-section-type.entity-Cs4nIHou.mjs.map +0 -1
  115. package/fesm2022/acorex-platform-module-workplacesafety-management-client-contracts-entity-catalog-work-step-type.entity-CJFWDOoh.mjs.map +0 -1
  116. package/fesm2022/acorex-platform-module-workplacesafety-management-client-index-gbDgxqrV.mjs.map +0 -1
  117. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs +0 -254
  118. package/fesm2022/acorex-platform-module-workplacesafety-management-client-preview-safety-plan.command-BU95c4xb.mjs.map +0 -1
  119. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-CQ2xB7Va.mjs.map +0 -1
  120. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs +0 -36
  121. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-preview.service-DJP41MuL.mjs.map +0 -1
  122. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs +0 -204
  123. package/fesm2022/acorex-platform-module-workplacesafety-management-client-safety-plan-section-builder.types-LaN1NIgc.mjs.map +0 -1
  124. package/fesm2022/acorex-platform-module-workplacesafety-management-client-save-safety-plan-sections.command-CLj3y_JD.mjs.map +0 -1
  125. package/types/acorex-platform-module-workplacesafety-management-client-contracts-entities-safety-plan-work-step.d.ts +0 -5
@@ -0,0 +1,165 @@
1
+ import { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';
2
+ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
3
+ import { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Injectable } from '@angular/core';
6
+ import { get, isString, isEmpty, defaultTo } from 'lodash';
7
+ import { A as AXMSafetyPlanPreviewService } from './acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs';
8
+ import { l as loadSafetyPlanFillValues } from './acorex-platform-module-workplacesafety-management-client-safety-plan-fill-values.util-RLOdySf7.mjs';
9
+ import { l as loadSafetyPlanPreviewStructure } from './acorex-platform-module-workplacesafety-management-client-load-safety-plan-preview-structure-Ce67NSIZ.mjs';
10
+
11
+ //#region ----- Imports -----
12
+ //#endregion
13
+ //#region ----- Command -----
14
+ /**
15
+
16
+ * Opens the Safety Plan preview. Save as Draft, Submit, Lock, and Sign Off persist fill values first.
17
+
18
+ * Outcomes depend on workflowActionSet:
19
+
20
+ * - draft: Saved | Submitted | Cancelled
21
+
22
+ * - assigned: Saved | Locked | Cancelled
23
+
24
+ * - locked: SignOff | Cancelled
25
+
26
+ */
27
+ class AXMFillSafetyPlanCommand {
28
+ constructor() {
29
+ //#region ----- Services & Dependencies -----
30
+ this.entityService = inject(AXPEntityService);
31
+ this.translationService = inject(AXTranslationService);
32
+ this.previewService = inject(AXMSafetyPlanPreviewService);
33
+ }
34
+ //#endregion
35
+ //#region ----- Command Implementation -----
36
+ async execute(input = {}) {
37
+ try {
38
+ const planId = this.resolvePlanId(input);
39
+ if (!planId) {
40
+ return {
41
+ success: false,
42
+ message: {
43
+ text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),
44
+ },
45
+ metadata: { outcome: 'Cancelled' },
46
+ };
47
+ }
48
+ const structure = await loadSafetyPlanPreviewStructure(this.entityService, this.translationService, planId);
49
+ const fillValues = await loadSafetyPlanFillValues(this.entityService, planId);
50
+ const dialogTitle = await this.resolveDialogTitle(input);
51
+ const workflowActionSet = this.resolveWorkflowActionSet(input);
52
+ const editable = this.resolveEditable(input);
53
+ const result = await this.previewService.open({
54
+ title: dialogTitle,
55
+ structure,
56
+ planId,
57
+ fillValues,
58
+ workflowActionSet,
59
+ editable,
60
+ });
61
+ const outcome = this.resolveOutcome(result);
62
+ return {
63
+ success: true,
64
+ kind: 'object',
65
+ data: undefined,
66
+ metadata: { outcome, refresh: false },
67
+ };
68
+ }
69
+ catch {
70
+ return {
71
+ success: false,
72
+ message: {
73
+ text: await this.translationService.translateAsync('@general:messages.generic.error.description'),
74
+ },
75
+ metadata: { outcome: 'Cancelled' },
76
+ };
77
+ }
78
+ }
79
+ //#endregion
80
+ //#region ----- Utility Methods -----
81
+ resolveWorkflowActionSet(input) {
82
+ const candidates = [
83
+ input.workflowActionSet,
84
+ input.options?.workflowActionSet,
85
+ get(input, 'options.workflowActionSet'),
86
+ input.__context__?.options?.workflowActionSet,
87
+ ];
88
+ for (const candidate of candidates) {
89
+ if (candidate === 'draft' || candidate === 'assigned' || candidate === 'locked') {
90
+ return candidate;
91
+ }
92
+ }
93
+ return undefined;
94
+ }
95
+ resolveEditable(input) {
96
+ const candidates = [
97
+ input.editable,
98
+ input.options?.editable,
99
+ get(input, 'options.editable'),
100
+ input.__context__?.options?.editable,
101
+ ];
102
+ return candidates.some((candidate) => candidate === true || candidate === 'true');
103
+ }
104
+ resolveOutcome(result) {
105
+ if (result?.signOff === true) {
106
+ return 'SignOff';
107
+ }
108
+ if (result?.locked === true) {
109
+ return 'Locked';
110
+ }
111
+ if (result?.submitted === true) {
112
+ return 'Submitted';
113
+ }
114
+ if (result?.saved === true) {
115
+ return 'Saved';
116
+ }
117
+ return 'Cancelled';
118
+ }
119
+ resolvePlanId(input) {
120
+ const context = input.__context__;
121
+ const candidates = [
122
+ input.id,
123
+ input.options?.id,
124
+ get(input, 'options.id'),
125
+ context?.options?.id,
126
+ context?.data?.id,
127
+ input.data?.['id'],
128
+ ];
129
+ for (const candidate of candidates) {
130
+ if (isString(candidate) && !isEmpty(candidate.trim())) {
131
+ return candidate.trim();
132
+ }
133
+ }
134
+ return undefined;
135
+ }
136
+ async resolveDialogTitle(input) {
137
+ const locale = this.translationService.getActiveLang?.() ?? 'en-US';
138
+ const explicitTitle = defaultTo(input.title, defaultTo(input.options?.title, defaultTo(get(input, 'options.title'), input.__context__?.options?.title)));
139
+ if (isString(explicitTitle) && explicitTitle.trim().length > 0) {
140
+ return resolveMultiLanguageString(explicitTitle, locale).trim();
141
+ }
142
+ if (explicitTitle != null && typeof explicitTitle === 'object') {
143
+ const resolved = resolveMultiLanguageString(explicitTitle, locale).trim();
144
+ if (resolved.length > 0) {
145
+ return resolved;
146
+ }
147
+ }
148
+ const contextTitle = defaultTo(input.data?.['title'], input.__context__?.data?.title);
149
+ if (contextTitle != null) {
150
+ const recordTitle = resolveEntityRowDisplayText(contextTitle, locale).trim();
151
+ if (recordTitle.length > 0) {
152
+ return recordTitle;
153
+ }
154
+ }
155
+ return ((await this.translationService.translateAsync('@workplacesafety-management:safety-plan-sections.preview.fill-title')) || 'Safety Plan');
156
+ }
157
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFillSafetyPlanCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
158
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFillSafetyPlanCommand }); }
159
+ }
160
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMFillSafetyPlanCommand, decorators: [{
161
+ type: Injectable
162
+ }] });
163
+
164
+ export { AXMFillSafetyPlanCommand };
165
+ //# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-workplacesafety-management-client-fill-safety-plan.command-lJl0qpvT.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan/commands/fill-safety-plan.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\n\n\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\n\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\n\nimport type { AXPCommand, AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\nimport type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\n\nimport { AXTranslationService, resolveMultiLanguageString } from '@acorex/core/translation';\n\nimport { Injectable, inject } from '@angular/core';\n\nimport { defaultTo, get, isEmpty, isString } from 'lodash';\n\n\n\nimport { AXMSafetyPlanPreviewService } from '../../safety-plan-preview/safety-plan-preview.service';\n\nimport type { AXMSafetyPlanPreviewWorkflowActionSet } from '../../safety-plan-preview/safety-plan-preview.types';\n\nimport { loadSafetyPlanFillValues } from '../../safety-plan-preview/safety-plan-fill-values.util';\n\nimport { loadSafetyPlanPreviewStructure } from './load-safety-plan-preview-structure';\n\n\n\n//#endregion\n\n\n\n//#region ----- Types -----\n\n\n\nexport type FillSafetyPlanOutcome = 'Submitted' | 'Saved' | 'Cancelled' | 'Locked' | 'SignOff';\n\n\n\nexport interface AXMFillSafetyPlanCommandInput {\n\n id?: string;\n\n title?: AXPMultiLanguageString | string;\n\n showAs?: 'popup';\n\n /** draft = Save as Draft/Submit. assigned = Save/Lock. locked = Sign Off. */\n\n workflowActionSet?: AXMSafetyPlanPreviewWorkflowActionSet;\n\n /** Edit section values and persist them when the dialog closes. */\n\n editable?: boolean | string;\n\n data?: Record<string, unknown>;\n\n options?: Partial<AXMFillSafetyPlanCommandInput>;\n\n __context__?: {\n\n entity?: string;\n\n data?: { id?: string; title?: unknown };\n\n options?: { id?: string; title?: unknown; workflowActionSet?: unknown; editable?: unknown };\n\n };\n\n}\n\n\n\n//#endregion\n\n\n\n//#region ----- Command -----\n\n\n\n/**\n\n * Opens the Safety Plan preview. Save as Draft, Submit, Lock, and Sign Off persist fill values first.\n\n * Outcomes depend on workflowActionSet:\n\n * - draft: Saved | Submitted | Cancelled\n\n * - assigned: Saved | Locked | Cancelled\n\n * - locked: SignOff | Cancelled\n\n */\n\n@Injectable()\n\nexport class AXMFillSafetyPlanCommand implements AXPCommand<AXMFillSafetyPlanCommandInput, void> {\n\n //#region ----- Services & Dependencies -----\n\n\n\n private readonly entityService = inject(AXPEntityService);\n\n private readonly translationService = inject(AXTranslationService);\n\n private readonly previewService = inject(AXMSafetyPlanPreviewService);\n\n\n\n //#endregion\n\n\n\n //#region ----- Command Implementation -----\n\n\n\n async execute(input: AXMFillSafetyPlanCommandInput = {}): AXPCommandExecuteResultPromise<void> {\n\n try {\n\n const planId = this.resolvePlanId(input);\n\n if (!planId) {\n\n return {\n\n success: false,\n\n message: {\n\n text: await this.translationService.translateAsync('@general:messages.entity.invalid-data'),\n\n },\n\n metadata: { outcome: 'Cancelled' satisfies FillSafetyPlanOutcome },\n\n };\n\n }\n\n\n\n const structure = await loadSafetyPlanPreviewStructure(\n\n this.entityService,\n\n this.translationService,\n\n planId,\n\n );\n\n const fillValues = await loadSafetyPlanFillValues(this.entityService, planId);\n\n const dialogTitle = await this.resolveDialogTitle(input);\n\n const workflowActionSet = this.resolveWorkflowActionSet(input);\n\n const editable = this.resolveEditable(input);\n\n\n\n const result = await this.previewService.open({\n\n title: dialogTitle,\n\n structure,\n\n planId,\n\n fillValues,\n\n workflowActionSet,\n\n editable,\n\n });\n\n\n\n const outcome = this.resolveOutcome(result);\n\n return {\n\n success: true,\n\n kind: 'object',\n\n data: undefined,\n\n metadata: { outcome, refresh: false },\n\n };\n\n } catch {\n\n return {\n\n success: false,\n\n message: {\n\n text: await this.translationService.translateAsync('@general:messages.generic.error.description'),\n\n },\n\n metadata: { outcome: 'Cancelled' satisfies FillSafetyPlanOutcome },\n\n };\n\n }\n\n }\n\n\n\n //#endregion\n\n\n\n //#region ----- Utility Methods -----\n\n\n\n private resolveWorkflowActionSet(\n\n input: AXMFillSafetyPlanCommandInput,\n\n ): AXMSafetyPlanPreviewWorkflowActionSet | undefined {\n\n const candidates = [\n\n input.workflowActionSet,\n\n input.options?.workflowActionSet,\n\n get(input, 'options.workflowActionSet'),\n\n input.__context__?.options?.workflowActionSet,\n\n ];\n\n\n\n for (const candidate of candidates) {\n\n if (candidate === 'draft' || candidate === 'assigned' || candidate === 'locked') {\n\n return candidate;\n\n }\n\n }\n\n\n\n return undefined;\n\n }\n\n\n\n private resolveEditable(input: AXMFillSafetyPlanCommandInput): boolean {\n\n const candidates = [\n\n input.editable,\n\n input.options?.editable,\n\n get(input, 'options.editable'),\n\n input.__context__?.options?.editable,\n\n ];\n\n\n\n return candidates.some((candidate) => candidate === true || candidate === 'true');\n\n }\n\n\n\n private resolveOutcome(\n\n result: { saved?: boolean; submitted?: boolean; locked?: boolean; signOff?: boolean } | null,\n\n ): FillSafetyPlanOutcome {\n\n if (result?.signOff === true) {\n\n return 'SignOff';\n\n }\n\n if (result?.locked === true) {\n\n return 'Locked';\n\n }\n\n if (result?.submitted === true) {\n\n return 'Submitted';\n\n }\n\n if (result?.saved === true) {\n\n return 'Saved';\n\n }\n\n return 'Cancelled';\n\n }\n\n\n\n private resolvePlanId(input: AXMFillSafetyPlanCommandInput): string | undefined {\n\n const context = input.__context__;\n\n const candidates = [\n\n input.id,\n\n input.options?.id,\n\n get(input, 'options.id'),\n\n context?.options?.id,\n\n context?.data?.id,\n\n input.data?.['id'],\n\n ];\n\n\n\n for (const candidate of candidates) {\n\n if (isString(candidate) && !isEmpty(candidate.trim())) {\n\n return candidate.trim();\n\n }\n\n }\n\n\n\n return undefined;\n\n }\n\n\n\n private async resolveDialogTitle(input: AXMFillSafetyPlanCommandInput): Promise<string> {\n\n const locale = this.translationService.getActiveLang?.() ?? 'en-US';\n\n\n\n const explicitTitle = defaultTo(\n\n input.title,\n\n defaultTo(input.options?.title, defaultTo(get(input, 'options.title'), input.__context__?.options?.title)),\n\n );\n\n if (isString(explicitTitle) && explicitTitle.trim().length > 0) {\n\n return resolveMultiLanguageString(explicitTitle, locale).trim();\n\n }\n\n if (explicitTitle != null && typeof explicitTitle === 'object') {\n\n const resolved = resolveMultiLanguageString(explicitTitle as AXPMultiLanguageString, locale).trim();\n\n if (resolved.length > 0) {\n\n return resolved;\n\n }\n\n }\n\n\n\n const contextTitle = defaultTo(input.data?.['title'], input.__context__?.data?.title);\n\n if (contextTitle != null) {\n\n const recordTitle = resolveEntityRowDisplayText(contextTitle, locale).trim();\n\n if (recordTitle.length > 0) {\n\n return recordTitle;\n\n }\n\n }\n\n\n\n return (\n\n (await this.translationService.translateAsync(\n\n '@workplacesafety-management:safety-plan-sections.preview.fill-title',\n\n )) || 'Safety Plan'\n\n );\n\n }\n\n\n\n //#endregion\n\n}\n\n\n\n//#endregion\n\n\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AA4EA;AAIA;AAIA;;;;;;;;;;;;AAYG;MAIU,wBAAwB,CAAA;AAFrC,IAAA,WAAA,GAAA;;AAQmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AAExC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAEjD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAkUtE,IAAA;;;AAtTC,IAAA,MAAM,OAAO,CAAC,KAAA,GAAuC,EAAE,EAAA;AAErD,QAAA,IAAI;YAEF,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;YAExC,IAAI,CAAC,MAAM,EAAE;gBAEX,OAAO;AAEL,oBAAA,OAAO,EAAE,KAAK;AAEd,oBAAA,OAAO,EAAE;wBAEP,IAAI,EAAE,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,uCAAuC,CAAC;AAE5F,qBAAA;AAED,oBAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,WAA2C,EAAE;i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B,gBAAA,OAAO,QAAQ;YAEjB;QAEF;QAIA,MAAM,YAAY,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,EAAE,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC;AAErF,QAAA,IAAI,YAAY,IAAI,IAAI,EAAE;YAExB,MAAM,WAAW,GAAG,2BAA2B,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE;AAE5E,YAAA,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;AAE1B,gBAAA,OAAO,WAAW;YAEpB;QAEF;AAIA,QAAA,QAEE,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAE3C,qEAAqE,CAEtE,KAAK,aAAa;IAIvB;8GAtUW,wBAAwB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAxB,wBAAwB,EAAA,CAAA,CAAA;;2FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBAFpC;;;"}
@@ -0,0 +1,240 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, Injectable } from '@angular/core';
3
+ import { AXPopupService } from '@acorex/components/popup';
4
+ import { AXPDeviceService } from '@acorex-platform/framework-client/core';
5
+ import { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';
6
+ import { isActivitySectionType, resolveEntityRefId, RootConfig, mapSafetyPlanActivityItemsToSectionSnapshots, resolveSectionItemEntityName, asSafetyPlanDisplayText } from '@acorex-platform/module-workplacesafety-management-client/contracts';
7
+
8
+ //#region ----- Imports -----
9
+ //#endregion
10
+ //#region ----- Service -----
11
+ class AXMSafetyPlanPreviewService {
12
+ constructor() {
13
+ //#region ----- Services & Dependencies -----
14
+ this.popupService = inject(AXPopupService);
15
+ this.deviceService = inject(AXPDeviceService);
16
+ }
17
+ //#endregion
18
+ //#region ----- Public API -----
19
+ async open(options) {
20
+ const { AXMSafetyPlanPreviewModalComponent } = await import('./acorex-platform-module-workplacesafety-management-client-safety-plan-preview-modal.component-B9lElhxc.mjs');
21
+ const workflowActionSet = this.resolveWorkflowActionSet(options);
22
+ const result = await this.popupService.open(AXMSafetyPlanPreviewModalComponent, {
23
+ title: options.title,
24
+ size: this.deviceService.isSmall() ? 'full' : 'lg',
25
+ data: {
26
+ structure: options.structure,
27
+ workflowActionSet,
28
+ editable: options.editable === true,
29
+ planId: options.planId,
30
+ fillValues: options.fillValues ?? {},
31
+ },
32
+ });
33
+ return result?.data ?? null;
34
+ }
35
+ //#endregion
36
+ //#region ----- Helpers -----
37
+ resolveWorkflowActionSet(options) {
38
+ if (options.workflowActionSet === 'draft' ||
39
+ options.workflowActionSet === 'assigned' ||
40
+ options.workflowActionSet === 'locked') {
41
+ return options.workflowActionSet;
42
+ }
43
+ if (options.showWorkflowActions === true) {
44
+ return 'draft';
45
+ }
46
+ return undefined;
47
+ }
48
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSafetyPlanPreviewService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
49
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSafetyPlanPreviewService, providedIn: 'root' }); }
50
+ }
51
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMSafetyPlanPreviewService, decorators: [{
52
+ type: Injectable,
53
+ args: [{ providedIn: 'root' }]
54
+ }] });
55
+
56
+ //#region ----- Imports -----
57
+ //#endregion
58
+ //#region ----- Public API -----
59
+ /**
60
+ * Loads each Activity catalog row's predefined `items` onto `activityRow.sections`
61
+ * and fills missing catalog item titles for preview rendering.
62
+ */
63
+ async function hydrateSafetyPlanActivitySectionsForPreview(entityService, translationService, value) {
64
+ const activityIds = collectActivityIdsNeedingSections(value);
65
+ if (activityIds.length === 0) {
66
+ return value;
67
+ }
68
+ const loadedById = await loadSafetyPlanActivitiesById(entityService, activityIds);
69
+ if (loadedById.size === 0) {
70
+ return value;
71
+ }
72
+ const withSections = {
73
+ sections: value.sections.map((section) => {
74
+ if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {
75
+ return section;
76
+ }
77
+ return {
78
+ ...section,
79
+ items: section.items.map((item) => {
80
+ const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);
81
+ if (!activityId) {
82
+ return item;
83
+ }
84
+ const loaded = loadedById.get(activityId);
85
+ if (!loaded) {
86
+ return item;
87
+ }
88
+ const existingRow = item.activityRow;
89
+ return {
90
+ ...item,
91
+ activityRow: {
92
+ ...existingRow,
93
+ title: existingRow?.title || loaded.title,
94
+ code: existingRow?.code || loaded.code,
95
+ description: existingRow?.description || loaded.description,
96
+ sections: loaded.sections,
97
+ },
98
+ };
99
+ }),
100
+ };
101
+ }),
102
+ };
103
+ return hydrateNestedActivityCatalogSnapshots(entityService, translationService, withSections);
104
+ }
105
+ //#endregion
106
+ //#region ----- Helpers -----
107
+ function collectActivityIdsNeedingSections(value) {
108
+ const ids = new Set();
109
+ for (const section of value.sections) {
110
+ if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {
111
+ continue;
112
+ }
113
+ for (const item of section.items ?? []) {
114
+ const hasSections = (item.activityRow?.sections?.length ?? 0) > 0;
115
+ if (hasSections) {
116
+ continue;
117
+ }
118
+ const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);
119
+ if (activityId) {
120
+ ids.add(activityId);
121
+ }
122
+ }
123
+ }
124
+ return [...ids];
125
+ }
126
+ async function loadSafetyPlanActivitiesById(entityService, activityIds) {
127
+ const entityKey = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanActivity.name}`;
128
+ const loaded = new Map();
129
+ await Promise.all(activityIds.map(async (id) => {
130
+ try {
131
+ const row = await entityService.withEntity(entityKey).data().byKey(id);
132
+ if (!row) {
133
+ return;
134
+ }
135
+ const record = row;
136
+ loaded.set(id, {
137
+ title: typeof record.title === 'string' ? record.title : undefined,
138
+ code: typeof record.code === 'string' ? record.code : undefined,
139
+ description: typeof record.description === 'string' ? record.description : undefined,
140
+ sections: mapSafetyPlanActivityItemsToSectionSnapshots(record.items),
141
+ });
142
+ }
143
+ catch {
144
+ /* skip activities the session cannot read */
145
+ }
146
+ }));
147
+ return loaded;
148
+ }
149
+ async function hydrateNestedActivityCatalogSnapshots(entityService, translationService, value) {
150
+ const locale = translationService.getActiveLang?.() ?? 'en-US';
151
+ const missingByEntity = new Map();
152
+ for (const section of value.sections) {
153
+ if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {
154
+ continue;
155
+ }
156
+ for (const item of section.items ?? []) {
157
+ for (const activitySection of item.activityRow?.sections ?? []) {
158
+ const entityName = resolveSectionItemEntityName(activitySection.sectionTypeId, activitySection.sectionType);
159
+ if (!entityName) {
160
+ continue;
161
+ }
162
+ for (const id of activitySection.itemIds ?? []) {
163
+ const snapshot = activitySection.items?.find((entry) => entry.id === id);
164
+ if (asSafetyPlanDisplayText(snapshot?.title) || asSafetyPlanDisplayText(snapshot?.code)) {
165
+ continue;
166
+ }
167
+ const ids = missingByEntity.get(entityName) ?? new Set();
168
+ ids.add(id);
169
+ missingByEntity.set(entityName, ids);
170
+ }
171
+ }
172
+ }
173
+ }
174
+ if (missingByEntity.size === 0) {
175
+ return value;
176
+ }
177
+ const loadedById = new Map();
178
+ await Promise.all([...missingByEntity.entries()].map(async ([entityName, ids]) => {
179
+ const idList = [...ids];
180
+ try {
181
+ const result = await entityService.withEntity(entityName).data().query({
182
+ skip: 0,
183
+ take: Math.max(idList.length, 1),
184
+ filter: idList.length === 1
185
+ ? { field: 'id', operator: { type: 'equal' }, value: idList[0] }
186
+ : { field: 'id', operator: { type: 'in' }, value: idList },
187
+ });
188
+ for (const row of result.items ?? []) {
189
+ const record = row;
190
+ const id = resolveEntityRefId(record['id']);
191
+ if (!id) {
192
+ continue;
193
+ }
194
+ loadedById.set(id, {
195
+ title: resolveEntityRowDisplayText(record['title'], locale) || undefined,
196
+ code: asSafetyPlanDisplayText(record['code']) || undefined,
197
+ });
198
+ }
199
+ }
200
+ catch {
201
+ /* skip entities the session cannot read */
202
+ }
203
+ }));
204
+ if (loadedById.size === 0) {
205
+ return value;
206
+ }
207
+ return {
208
+ sections: value.sections.map((section) => ({
209
+ ...section,
210
+ items: section.items.map((item) => {
211
+ if (!item.activityRow?.sections?.length) {
212
+ return item;
213
+ }
214
+ return {
215
+ ...item,
216
+ activityRow: {
217
+ ...item.activityRow,
218
+ sections: item.activityRow.sections.map((activitySection) => ({
219
+ ...activitySection,
220
+ items: (activitySection.itemIds ?? []).map((id, index) => {
221
+ const existing = activitySection.items?.find((entry) => entry.id === id) ??
222
+ activitySection.items?.[index];
223
+ const loaded = loadedById.get(id);
224
+ return {
225
+ id,
226
+ title: asSafetyPlanDisplayText(existing?.title) || loaded?.title,
227
+ code: asSafetyPlanDisplayText(existing?.code) || loaded?.code,
228
+ };
229
+ }),
230
+ })),
231
+ },
232
+ };
233
+ }),
234
+ })),
235
+ };
236
+ }
237
+ //#endregion
238
+
239
+ export { AXMSafetyPlanPreviewService as A, hydrateSafetyPlanActivitySectionsForPreview as h };
240
+ //# sourceMappingURL=acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-workplacesafety-management-client-hydrate-safety-plan-activity-sections-TrVl3-T6.mjs","sources":["../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-preview/safety-plan-preview.service.ts","../../../../libs/modules/workplacesafety-management/client/src/lib/features/safety-plan-preview/hydrate-safety-plan-activity-sections.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { Injectable, inject } from '@angular/core';\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXPDeviceService } from '@acorex-platform/framework-client/core';\n\nimport type {\n AXMSafetyPlanPreviewOpenOptions,\n AXMSafetyPlanPreviewResult,\n AXMSafetyPlanPreviewWorkflowActionSet,\n} from './safety-plan-preview.types';\n\n//#endregion\n\n//#region ----- Service -----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMSafetyPlanPreviewService {\n //#region ----- Services & Dependencies -----\n\n private readonly popupService = inject(AXPopupService);\n private readonly deviceService = inject(AXPDeviceService);\n\n //#endregion\n\n //#region ----- Public API -----\n\n async open(options: AXMSafetyPlanPreviewOpenOptions): Promise<AXMSafetyPlanPreviewResult | null> {\n const { AXMSafetyPlanPreviewModalComponent } = await import('./safety-plan-preview-modal.component');\n const workflowActionSet = this.resolveWorkflowActionSet(options);\n const result = await this.popupService.open(AXMSafetyPlanPreviewModalComponent, {\n title: options.title,\n size: this.deviceService.isSmall() ? 'full' : 'lg',\n data: {\n structure: options.structure,\n workflowActionSet,\n editable: options.editable === true,\n planId: options.planId,\n fillValues: options.fillValues ?? {},\n },\n });\n\n return (result?.data as AXMSafetyPlanPreviewResult | undefined) ?? null;\n }\n\n //#endregion\n\n //#region ----- Helpers -----\n\n private resolveWorkflowActionSet(\n options: AXMSafetyPlanPreviewOpenOptions,\n ): AXMSafetyPlanPreviewWorkflowActionSet | undefined {\n if (\n options.workflowActionSet === 'draft' ||\n options.workflowActionSet === 'assigned' ||\n options.workflowActionSet === 'locked'\n ) {\n return options.workflowActionSet;\n }\n if (options.showWorkflowActions === true) {\n return 'draft';\n }\n return undefined;\n }\n\n //#endregion\n}\n\n//#endregion\n\n","//#region ----- Imports -----\n\nimport { resolveEntityRowDisplayText } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n asSafetyPlanDisplayText,\n isActivitySectionType,\n mapSafetyPlanActivityItemsToSectionSnapshots,\n resolveEntityRefId,\n resolveSectionItemEntityName,\n RootConfig,\n type AXMSafetyPlanActivitySectionSnapshot,\n type AXMSafetyPlanSectionBuilderValue,\n type AXMWorkplaceSafetyManagementSafetyPlanSectionItemModel,\n} from '@acorex-platform/module-workplacesafety-management-client/contracts';\nimport { AXTranslationService } from '@acorex/core/translation';\n\n//#endregion\n\n//#region ----- Public API -----\n\n/**\n * Loads each Activity catalog row's predefined `items` onto `activityRow.sections`\n * and fills missing catalog item titles for preview rendering.\n */\nexport async function hydrateSafetyPlanActivitySectionsForPreview(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const activityIds = collectActivityIdsNeedingSections(value);\n if (activityIds.length === 0) {\n return value;\n }\n\n const loadedById = await loadSafetyPlanActivitiesById(entityService, activityIds);\n if (loadedById.size === 0) {\n return value;\n }\n\n const withSections: AXMSafetyPlanSectionBuilderValue = {\n sections: value.sections.map((section) => {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n return section;\n }\n return {\n ...section,\n items: section.items.map((item) => {\n const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);\n if (!activityId) {\n return item;\n }\n const loaded = loadedById.get(activityId);\n if (!loaded) {\n return item;\n }\n const existingRow = item.activityRow;\n return {\n ...item,\n activityRow: {\n ...existingRow,\n title: existingRow?.title || loaded.title,\n code: existingRow?.code || loaded.code,\n description: existingRow?.description || loaded.description,\n sections: loaded.sections,\n },\n };\n }),\n };\n }),\n };\n\n return hydrateNestedActivityCatalogSnapshots(entityService, translationService, withSections);\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction collectActivityIdsNeedingSections(value: AXMSafetyPlanSectionBuilderValue): string[] {\n const ids = new Set<string>();\n for (const section of value.sections) {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n for (const item of section.items ?? []) {\n const hasSections = (item.activityRow?.sections?.length ?? 0) > 0;\n if (hasSections) {\n continue;\n }\n const activityId = resolveEntityRefId(item.id) ?? resolveEntityRefId(item.itemIds?.[0]);\n if (activityId) {\n ids.add(activityId);\n }\n }\n }\n return [...ids];\n}\n\nasync function loadSafetyPlanActivitiesById(\n entityService: AXPEntityService,\n activityIds: string[],\n): Promise<\n Map<\n string,\n {\n title?: string;\n code?: string;\n description?: string;\n sections: AXMSafetyPlanActivitySectionSnapshot[];\n }\n >\n> {\n const entityKey = `${RootConfig.module.name}.${RootConfig.entities.safetyPlanActivity.name}`;\n const loaded = new Map<\n string,\n {\n title?: string;\n code?: string;\n description?: string;\n sections: AXMSafetyPlanActivitySectionSnapshot[];\n }\n >();\n\n await Promise.all(\n activityIds.map(async (id) => {\n try {\n const row = await entityService.withEntity(entityKey).data().byKey(id);\n if (!row) {\n return;\n }\n const record = row as {\n title?: string;\n code?: string;\n description?: string;\n items?: AXMWorkplaceSafetyManagementSafetyPlanSectionItemModel[];\n };\n loaded.set(id, {\n title: typeof record.title === 'string' ? record.title : undefined,\n code: typeof record.code === 'string' ? record.code : undefined,\n description: typeof record.description === 'string' ? record.description : undefined,\n sections: mapSafetyPlanActivityItemsToSectionSnapshots(record.items),\n });\n } catch {\n /* skip activities the session cannot read */\n }\n }),\n );\n\n return loaded;\n}\n\nasync function hydrateNestedActivityCatalogSnapshots(\n entityService: AXPEntityService,\n translationService: AXTranslationService,\n value: AXMSafetyPlanSectionBuilderValue,\n): Promise<AXMSafetyPlanSectionBuilderValue> {\n const locale = translationService.getActiveLang?.() ?? 'en-US';\n const missingByEntity = new Map<string, Set<string>>();\n\n for (const section of value.sections) {\n if (!isActivitySectionType(section.sectionTypeId, section.sectionType)) {\n continue;\n }\n for (const item of section.items ?? []) {\n for (const activitySection of item.activityRow?.sections ?? []) {\n const entityName = resolveSectionItemEntityName(\n activitySection.sectionTypeId,\n activitySection.sectionType,\n );\n if (!entityName) {\n continue;\n }\n for (const id of activitySection.itemIds ?? []) {\n const snapshot = activitySection.items?.find((entry) => entry.id === id);\n if (asSafetyPlanDisplayText(snapshot?.title) || asSafetyPlanDisplayText(snapshot?.code)) {\n continue;\n }\n const ids = missingByEntity.get(entityName) ?? new Set<string>();\n ids.add(id);\n missingByEntity.set(entityName, ids);\n }\n }\n }\n }\n\n if (missingByEntity.size === 0) {\n return value;\n }\n\n const loadedById = new Map<string, { title?: string; code?: string }>();\n await Promise.all(\n [...missingByEntity.entries()].map(async ([entityName, ids]) => {\n const idList = [...ids];\n try {\n const result = await entityService.withEntity(entityName).data().query({\n skip: 0,\n take: Math.max(idList.length, 1),\n filter:\n idList.length === 1\n ? { field: 'id', operator: { type: 'equal' }, value: idList[0] }\n : { field: 'id', operator: { type: 'in' }, value: idList },\n } as never);\n for (const row of result.items ?? []) {\n const record = row as unknown as Record<string, unknown>;\n const id = resolveEntityRefId(record['id']);\n if (!id) {\n continue;\n }\n loadedById.set(id, {\n title: resolveEntityRowDisplayText(record['title'], locale) || undefined,\n code: asSafetyPlanDisplayText(record['code']) || undefined,\n });\n }\n } catch {\n /* skip entities the session cannot read */\n }\n }),\n );\n\n if (loadedById.size === 0) {\n return value;\n }\n\n return {\n sections: value.sections.map((section) => ({\n ...section,\n items: section.items.map((item) => {\n if (!item.activityRow?.sections?.length) {\n return item;\n }\n return {\n ...item,\n activityRow: {\n ...item.activityRow,\n sections: item.activityRow.sections.map((activitySection) => ({\n ...activitySection,\n items: (activitySection.itemIds ?? []).map((id, index) => {\n const existing =\n activitySection.items?.find((entry) => entry.id === id) ??\n activitySection.items?.[index];\n const loaded = loadedById.get(id);\n return {\n id,\n title: asSafetyPlanDisplayText(existing?.title) || loaded?.title,\n code: asSafetyPlanDisplayText(existing?.code) || loaded?.code,\n };\n }),\n })),\n },\n };\n }),\n })),\n };\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AAYA;AAEA;MAGa,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC;AACrC,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AA6C1D,IAAA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