@acorex-platform/module-maintenance-management-client 2.0.0-next.54 → 2.0.0-next.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-CYL_j2e-.mjs → acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-gjOUE5Ou.mjs} +359 -158
- package/fesm2022/acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-gjOUE5Ou.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-plan.mjs +116 -7
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-plan.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template.mjs +39 -34
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-template.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-type.mjs +3 -30
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entities-maintenance-type.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-BDt6cMqM.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-DAIO9T_x.mjs} +27 -27
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-BDt6cMqM.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-acorex-platform-module-maintenance-management-client-contracts-entity-catalog-DAIO9T_x.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-BiqiUqjl.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-Cj80ZyQS.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-BiqiUqjl.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-asset-type.entity-Cj80ZyQS.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-BehHrTV6.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-BETNxnxF.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-BehHrTV6.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type-resource.entity-BETNxnxF.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-BuWyiK47.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-DhE2tBB6.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-BuWyiK47.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-activity-type.entity-DhE2tBB6.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-CQ8zPAOw.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-OSFSs_ns.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-CQ8zPAOw.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-cause.entity-OSFSs_ns.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-80AvEdF3.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-BVqwm7ej.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-80AvEdF3.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-detection.entity-BVqwm7ej.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-BbwH5XnB.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-fUq3sQ5V.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-BbwH5XnB.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-effect.entity-fUq3sQ5V.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-B1DCiXHl.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-DTgXmUUp.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-B1DCiXHl.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mechanism.entity-DTgXmUUp.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-CDowmn-i.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-CMcBAcEO.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-CDowmn-i.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-asset-type.entity-CMcBAcEO.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-C-kYvWvy.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-CSIpXG-4.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-C-kYvWvy.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-mechanism.entity-CSIpXG-4.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-DIEKv_ex.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-BR8KpOYc.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-DIEKv_ex.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode-solution.entity-BR8KpOYc.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-BddzdJFu.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-_2Rw7dRW.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-BddzdJFu.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-mode.entity-_2Rw7dRW.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-CAVBEPos.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-DZtGyLMz.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-CAVBEPos.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-cause.entity-DZtGyLMz.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-CZoRT8qh.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-BfsW8RLT.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-CZoRT8qh.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-effect.entity-BfsW8RLT.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-CwPHJjHL.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-wTNFXGYV.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-CwPHJjHL.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register-mechanism.entity-wTNFXGYV.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-BN_sibAe.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-Bn_oDcN5.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-BN_sibAe.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-register.entity-Bn_oDcN5.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-D5ot-c7d.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-DdgASFYY.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-D5ot-c7d.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-severity.entity-DdgASFYY.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-C9xwUUmV.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-FFVn2WP6.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-C9xwUUmV.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-failure-type.entity-FFVn2WP6.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-B_8EP6Ce.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-tNQB4T3E.mjs} +118 -9
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-tNQB4T3E.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-Dlf3zkXc.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-ni2-HErM.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-Dlf3zkXc.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-activity-type.entity-ni2-HErM.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-DANe3Ydz.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-BZqLuafL.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-DANe3Ydz.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-failure-mode.entity-BZqLuafL.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-DKA7o8xE.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-ngZFl1_i.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-DKA7o8xE.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template-resource.entity-ngZFl1_i.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-CgTBYIuC.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-CVfu0KMj.mjs} +41 -36
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-CVfu0KMj.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-li8bMnnc.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-B1M7vg_M.mjs} +5 -32
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-B1M7vg_M.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-qUVWc53K.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-DrC7ijw9.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-qUVWc53K.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-order.entity-DrC7ijw9.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-D9x6NNwM.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-DlU08fG2.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-D9x6NNwM.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-package.entity-DlU08fG2.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-Z8si5eF0.mjs → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-C9sqC-CQ.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-Z8si5eF0.mjs.map → acorex-platform-module-maintenance-management-client-contracts-entity-catalog-work-report.entity-C9sqC-CQ.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts.mjs +52 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-Da4IKC_I.mjs → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-BxgkvooP.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-Da4IKC_I.mjs.map → acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-BxgkvooP.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-B9iKWu8M.mjs +98 -0
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-B9iKWu8M.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-BpxhsJfI.mjs → acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-rqJ6-Akn.mjs} +6 -3
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-rqJ6-Akn.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-CisM8_Vu.mjs → acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-BnDgqwww.mjs} +17 -2
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-BnDgqwww.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-y0z6SVPA.mjs → acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-OiuiXtcL.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-y0z6SVPA.mjs.map → acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-OiuiXtcL.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-CamzeFg3.mjs → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-DsfKKMGg.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-CamzeFg3.mjs.map → acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-DsfKKMGg.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-start-work-order-flow.command-B0MvJyZl.mjs → acorex-platform-module-maintenance-management-client-start-work-order-flow.command-DkmKMqQG.mjs} +2 -6
- package/fesm2022/acorex-platform-module-maintenance-management-client-start-work-order-flow.command-DkmKMqQG.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-B2ftRL80.mjs → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CxxKTuKm.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-B2ftRL80.mjs.map → acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CxxKTuKm.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-B-3Umt3B.mjs → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-mIGUGdJu.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-B-3Umt3B.mjs.map → acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-mIGUGdJu.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client.mjs +1 -1
- package/i18n/en-AU/maintenance-management.json +10 -11
- package/i18n/en-US/maintenance-management.json +10 -11
- package/i18n/fa-IR/maintenance-management.json +9 -10
- package/package.json +3 -3
- package/types/acorex-platform-module-maintenance-management-client-contracts.d.ts +38 -7
- package/types/acorex-platform-module-maintenance-management-client.d.ts +13 -2
- package/fesm2022/acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-CYL_j2e-.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-plan.entity-B_8EP6Ce.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-template.entity-CgTBYIuC.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-contracts-entity-catalog-maintenance-type.entity-li8bMnnc.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-CKqxBPYs.mjs +0 -54
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-CKqxBPYs.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-BpxhsJfI.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-maintenance-interval-widget.kinds-CisM8_Vu.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-maintenance-management-client-start-work-order-flow.command-B0MvJyZl.mjs.map +0 -1
|
@@ -12,7 +12,7 @@ import * as i5 from '@acorex/components/selection-list';
|
|
|
12
12
|
import { AXSelectionListModule } from '@acorex/components/selection-list';
|
|
13
13
|
import * as i7 from '@acorex/core/translation';
|
|
14
14
|
import { AXTranslationModule, isValidMultiLanguageObject, resolveMultiLanguageString, AXTranslationService, createMultiLanguageString } from '@acorex/core/translation';
|
|
15
|
-
import { AXMMaintenanceIntervalUnit, readIntervalDate, emptyAXMMaintenanceIntervalConfig, AXMMaintenanceIntervalTriggerLogic, emptyAXMMaintenanceIntervalDraft, buildAXMMaintenanceIntervalConfig, draftFromAXMMaintenanceIntervalConfig, isAXMMaintenanceMeterKind, isAXMMaintenanceIntervalUnitForKind, isAXMMaintenanceIntervalKind, readMaintenancePlanCalendarSchedule, AXMWorkOrderSourceType, AXMWorkOrderStatus, RootConfig, readMaintenanceIntervalStates, resolveMaintenanceIntervalStates, AXM_MAINTENANCE_INTERVAL_STATE_ERRORS, resolveIntervalChecklistViewerMode, AXMMaintenanceManagementCommandKeys, MM_CATALOG_SCOPE_MN, AXM_MAINTENANCE_INTERVAL_WIDGET, AXPAssetsMaintenancePermissionKeys, AXMMaintenanceManagementMenuKeys } from '@acorex-platform/module-maintenance-management-client/contracts';
|
|
15
|
+
import { AXMMaintenanceIntervalUnit, readIntervalDate, emptyAXMMaintenanceIntervalConfig, AXMMaintenanceIntervalTriggerLogic, emptyAXMMaintenanceIntervalDraft, buildAXMMaintenanceIntervalConfig, draftFromAXMMaintenanceIntervalConfig, isAXMMaintenanceMeterKind, isAXMMaintenanceIntervalUnitForKind, isAXMMaintenanceIntervalKind, readMaintenancePlanCalendarSchedule, cloneMaintenanceTemplateSchedule, shouldReloadMaintenanceTemplateForPlan, hasMaintenanceTemplateSchedule, AXMWorkOrderSourceType, AXMWorkOrderStatus, readMaintenancePlanSchedule, RootConfig, readMaintenanceIntervalStates, resolveMaintenanceIntervalStates, AXM_MAINTENANCE_INTERVAL_STATE_ERRORS, syncMaintenancePlanScheduleFields, resolveIntervalChecklistViewerMode, AXMMaintenanceManagementCommandKeys, MM_CATALOG_SCOPE_MN, AXM_MAINTENANCE_INTERVAL_WIDGET, AXPAssetsMaintenancePermissionKeys, AXMMaintenanceManagementMenuKeys } from '@acorex-platform/module-maintenance-management-client/contracts';
|
|
16
16
|
import { AsyncPipe } from '@angular/common';
|
|
17
17
|
import * as i0 from '@angular/core';
|
|
18
18
|
import { input, output, signal, computed, effect, ChangeDetectionStrategy, Component, inject, Injectable, NgModule } from '@angular/core';
|
|
@@ -40,7 +40,7 @@ const AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE = 'maintenance-management';
|
|
|
40
40
|
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region ----- Constants -----
|
|
43
|
-
const I18N$
|
|
43
|
+
const I18N$3 = '@maintenance-management:maintenance-interval';
|
|
44
44
|
const KIND_ORDER = ['schedule', 'date', 'distance', 'operating-hours', 'operation-count'];
|
|
45
45
|
const SCHEDULE_MODES = [
|
|
46
46
|
'hourly',
|
|
@@ -53,31 +53,31 @@ const SCHEDULE_MODES = [
|
|
|
53
53
|
/** Shown in the Schedule section. Hourly and Yearly stay readable so existing rows still load. */
|
|
54
54
|
const VISIBLE_SCHEDULE_MODES = ['daily', 'weekly', 'monthly', 'specific-date'];
|
|
55
55
|
const LABEL_KEYS = {
|
|
56
|
-
schedule: `${I18N$
|
|
57
|
-
date: `${I18N$
|
|
58
|
-
distance: `${I18N$
|
|
59
|
-
'operating-hours': `${I18N$
|
|
60
|
-
'operation-count': `${I18N$
|
|
56
|
+
schedule: `${I18N$3}.kinds.schedule`,
|
|
57
|
+
date: `${I18N$3}.kinds.date`,
|
|
58
|
+
distance: `${I18N$3}.kinds.distance`,
|
|
59
|
+
'operating-hours': `${I18N$3}.kinds.operating-hours`,
|
|
60
|
+
'operation-count': `${I18N$3}.kinds.operation-count`,
|
|
61
61
|
};
|
|
62
62
|
const ERROR_KEYS = {
|
|
63
|
-
schedule: `${I18N$
|
|
64
|
-
date: `${I18N$
|
|
65
|
-
interval: `${I18N$
|
|
66
|
-
integer: `${I18N$
|
|
63
|
+
schedule: `${I18N$3}.validation.schedule`,
|
|
64
|
+
date: `${I18N$3}.validation.date`,
|
|
65
|
+
interval: `${I18N$3}.validation.interval`,
|
|
66
|
+
integer: `${I18N$3}.validation.integer`,
|
|
67
67
|
};
|
|
68
68
|
const UNIT_LABEL_KEYS = {
|
|
69
|
-
[AXMMaintenanceIntervalUnit.Kilometer]: `${I18N$
|
|
70
|
-
[AXMMaintenanceIntervalUnit.Mile]: `${I18N$
|
|
71
|
-
[AXMMaintenanceIntervalUnit.Hour]: `${I18N$
|
|
72
|
-
[AXMMaintenanceIntervalUnit.Operation]: `${I18N$
|
|
69
|
+
[AXMMaintenanceIntervalUnit.Kilometer]: `${I18N$3}.units.kilometer`,
|
|
70
|
+
[AXMMaintenanceIntervalUnit.Mile]: `${I18N$3}.units.mile`,
|
|
71
|
+
[AXMMaintenanceIntervalUnit.Hour]: `${I18N$3}.units.hour`,
|
|
72
|
+
[AXMMaintenanceIntervalUnit.Operation]: `${I18N$3}.units.operation`,
|
|
73
73
|
};
|
|
74
74
|
const SCHEDULE_MODE_LABEL_KEYS = {
|
|
75
|
-
hourly: `${I18N$
|
|
76
|
-
daily: `${I18N$
|
|
77
|
-
weekly: `${I18N$
|
|
78
|
-
monthly: `${I18N$
|
|
79
|
-
yearly: `${I18N$
|
|
80
|
-
'specific-date': `${I18N$
|
|
75
|
+
hourly: `${I18N$3}.recurrence-unit.hourly`,
|
|
76
|
+
daily: `${I18N$3}.recurrence-unit.daily`,
|
|
77
|
+
weekly: `${I18N$3}.recurrence-unit.weekly`,
|
|
78
|
+
monthly: `${I18N$3}.recurrence-unit.monthly`,
|
|
79
|
+
yearly: `${I18N$3}.recurrence-unit.yearly`,
|
|
80
|
+
'specific-date': `${I18N$3}.recurrence-unit.specific-date`,
|
|
81
81
|
};
|
|
82
82
|
function isScheduleMode(value) {
|
|
83
83
|
return typeof value === 'string' && SCHEDULE_MODES.includes(value);
|
|
@@ -163,6 +163,19 @@ function withSpecificDate(date) {
|
|
|
163
163
|
endCondition: { type: 'never' },
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
+
function constrainScheduleToModes(schedule, modes) {
|
|
167
|
+
if (!modes.length || modes.includes(readScheduleMode(schedule))) {
|
|
168
|
+
return schedule;
|
|
169
|
+
}
|
|
170
|
+
const mode = modes[0];
|
|
171
|
+
if (mode === 'specific-date') {
|
|
172
|
+
return { ...schedule, mode: 'specific-date' };
|
|
173
|
+
}
|
|
174
|
+
if (isPickerScheduleMode(mode)) {
|
|
175
|
+
return withScheduleMode(schedule, mode);
|
|
176
|
+
}
|
|
177
|
+
return schedule;
|
|
178
|
+
}
|
|
166
179
|
function readScheduleStartDate(schedule) {
|
|
167
180
|
if (!schedule || typeof schedule !== 'object') {
|
|
168
181
|
return null;
|
|
@@ -180,6 +193,25 @@ function configsEqual(left, right) {
|
|
|
180
193
|
function kindsKey(kinds) {
|
|
181
194
|
return [...new Set(kinds)].sort().join('|');
|
|
182
195
|
}
|
|
196
|
+
function isCalendarTrigger(value) {
|
|
197
|
+
if (!value || typeof value !== 'object') {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
const kind = value.kind;
|
|
201
|
+
return kind === 'schedule' || kind === 'date';
|
|
202
|
+
}
|
|
203
|
+
/** Meter edits keep the calendar trigger owned by the plan scheduler field. */
|
|
204
|
+
function preserveCalendarTriggers(source, built) {
|
|
205
|
+
const triggers = source && typeof source === 'object' ? source.triggers : null;
|
|
206
|
+
const calendar = Array.isArray(triggers) ? triggers.filter(isCalendarTrigger) : [];
|
|
207
|
+
if (calendar.length === 0) {
|
|
208
|
+
return built;
|
|
209
|
+
}
|
|
210
|
+
return {
|
|
211
|
+
...built,
|
|
212
|
+
triggers: [...calendar, ...built.triggers.filter((trigger) => !isCalendarTrigger(trigger))],
|
|
213
|
+
};
|
|
214
|
+
}
|
|
183
215
|
function readChoiceId(value) {
|
|
184
216
|
if (typeof value === 'string') {
|
|
185
217
|
return value;
|
|
@@ -205,28 +237,36 @@ class AXMMaintenanceIntervalComponent {
|
|
|
205
237
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
206
238
|
this.disabled = input(false, /* @ts-ignore */
|
|
207
239
|
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
240
|
+
/** When false, Specific Date is omitted. Ignored when `scheduleModes` is set. */
|
|
241
|
+
this.includeSpecificDate = input(true, /* @ts-ignore */
|
|
242
|
+
...(ngDevMode ? [{ debugName: "includeSpecificDate" }] : /* istanbul ignore next */ []));
|
|
243
|
+
/** Restricts the schedule radios. Empty keeps the default Day, Week, Month, and Specific Date list. */
|
|
244
|
+
this.scheduleModes = input(null, /* @ts-ignore */
|
|
245
|
+
...(ngDevMode ? [{ debugName: "scheduleModes" }] : /* istanbul ignore next */ []));
|
|
246
|
+
/** The plan hides the inner "Maintenance Interval" heading. */
|
|
247
|
+
this.showTitle = input(true, /* @ts-ignore */
|
|
248
|
+
...(ngDevMode ? [{ debugName: "showTitle" }] : /* istanbul ignore next */ []));
|
|
249
|
+
/** The plan edits the calendar on the scheduler picker, so this editor keeps meter intervals only. */
|
|
250
|
+
this.hideCalendar = input(false, /* @ts-ignore */
|
|
251
|
+
...(ngDevMode ? [{ debugName: "hideCalendar" }] : /* istanbul ignore next */ []));
|
|
208
252
|
//#endregion
|
|
209
253
|
//#region ----- Outputs -----
|
|
210
254
|
this.valueChange = output();
|
|
211
255
|
//#endregion
|
|
212
256
|
//#region ----- Constants -----
|
|
213
|
-
this.titleKey = `${I18N$
|
|
214
|
-
this.everyKey = `${I18N$
|
|
215
|
-
this.emptyKey = `${I18N$
|
|
216
|
-
this.triggerLogicTitleKey = `${I18N$
|
|
257
|
+
this.titleKey = `${I18N$3}.title`;
|
|
258
|
+
this.everyKey = `${I18N$3}.every`;
|
|
259
|
+
this.emptyKey = `${I18N$3}.empty`;
|
|
260
|
+
this.triggerLogicTitleKey = `${I18N$3}.trigger-logic.title`;
|
|
217
261
|
this.triggerLogic = AXMMaintenanceIntervalTriggerLogic;
|
|
218
262
|
this.distanceUnits = [
|
|
219
263
|
{ id: AXMMaintenanceIntervalUnit.Kilometer, text: UNIT_LABEL_KEYS[AXMMaintenanceIntervalUnit.Kilometer] },
|
|
220
264
|
{ id: AXMMaintenanceIntervalUnit.Mile, text: UNIT_LABEL_KEYS[AXMMaintenanceIntervalUnit.Mile] },
|
|
221
265
|
];
|
|
222
266
|
this.triggerLogicItems = [
|
|
223
|
-
{ id: AXMMaintenanceIntervalTriggerLogic.Any, text: `${I18N$
|
|
224
|
-
{ id: AXMMaintenanceIntervalTriggerLogic.All, text: `${I18N$
|
|
267
|
+
{ id: AXMMaintenanceIntervalTriggerLogic.Any, text: `${I18N$3}.trigger-logic.any` },
|
|
268
|
+
{ id: AXMMaintenanceIntervalTriggerLogic.All, text: `${I18N$3}.trigger-logic.all` },
|
|
225
269
|
];
|
|
226
|
-
this.scheduleModeItems = VISIBLE_SCHEDULE_MODES.map((mode) => ({
|
|
227
|
-
id: mode,
|
|
228
|
-
text: SCHEDULE_MODE_LABEL_KEYS[mode],
|
|
229
|
-
}));
|
|
230
270
|
//#endregion
|
|
231
271
|
//#region ----- State Signals -----
|
|
232
272
|
this.draft = signal(emptyAXMMaintenanceIntervalDraft(), /* @ts-ignore */
|
|
@@ -235,12 +275,34 @@ class AXMMaintenanceIntervalComponent {
|
|
|
235
275
|
this.lastSupportedKey = '';
|
|
236
276
|
//#endregion
|
|
237
277
|
//#region ----- Computed Properties -----
|
|
278
|
+
this.visibleScheduleModes = computed(() => {
|
|
279
|
+
const requested = this.scheduleModes();
|
|
280
|
+
if (requested?.length) {
|
|
281
|
+
return requested.filter(isScheduleMode);
|
|
282
|
+
}
|
|
283
|
+
return this.includeSpecificDate()
|
|
284
|
+
? VISIBLE_SCHEDULE_MODES
|
|
285
|
+
: VISIBLE_SCHEDULE_MODES.filter((mode) => mode !== 'specific-date');
|
|
286
|
+
}, /* @ts-ignore */
|
|
287
|
+
...(ngDevMode ? [{ debugName: "visibleScheduleModes" }] : /* istanbul ignore next */ []));
|
|
288
|
+
this.scheduleModeItems = computed(() => this.visibleScheduleModes().map((mode) => ({
|
|
289
|
+
id: mode,
|
|
290
|
+
text: SCHEDULE_MODE_LABEL_KEYS[mode],
|
|
291
|
+
})), /* @ts-ignore */
|
|
292
|
+
...(ngDevMode ? [{ debugName: "scheduleModeItems" }] : /* istanbul ignore next */ []));
|
|
238
293
|
this.scheduleValue = computed(() => {
|
|
239
294
|
const schedule = this.draft().schedule;
|
|
240
295
|
return schedule ? schedule : null;
|
|
241
296
|
}, /* @ts-ignore */
|
|
242
297
|
...(ngDevMode ? [{ debugName: "scheduleValue" }] : /* istanbul ignore next */ []));
|
|
243
|
-
this.selectedScheduleMode = computed(() =>
|
|
298
|
+
this.selectedScheduleMode = computed(() => {
|
|
299
|
+
const modes = this.visibleScheduleModes();
|
|
300
|
+
const current = readScheduleMode(this.draft().schedule);
|
|
301
|
+
if (!modes.length || modes.includes(current)) {
|
|
302
|
+
return current;
|
|
303
|
+
}
|
|
304
|
+
return modes[0];
|
|
305
|
+
}, /* @ts-ignore */
|
|
244
306
|
...(ngDevMode ? [{ debugName: "selectedScheduleMode" }] : /* istanbul ignore next */ []));
|
|
245
307
|
this.specificDate = computed(() => readScheduleStartDate(this.draft().schedule), /* @ts-ignore */
|
|
246
308
|
...(ngDevMode ? [{ debugName: "specificDate" }] : /* istanbul ignore next */ []));
|
|
@@ -260,7 +322,7 @@ class AXMMaintenanceIntervalComponent {
|
|
|
260
322
|
effect(() => {
|
|
261
323
|
const supported = this.supportedKeys();
|
|
262
324
|
const incoming = this.value();
|
|
263
|
-
const supportedKey = kindsKey(supported)
|
|
325
|
+
const supportedKey = `${kindsKey(supported)}|${this.visibleScheduleModes().join(',')}`;
|
|
264
326
|
if (this.lastEmitted &&
|
|
265
327
|
configsEqual(incoming, this.lastEmitted) &&
|
|
266
328
|
supportedKey === this.lastSupportedKey) {
|
|
@@ -268,8 +330,11 @@ class AXMMaintenanceIntervalComponent {
|
|
|
268
330
|
}
|
|
269
331
|
this.lastSupportedKey = supportedKey;
|
|
270
332
|
const next = draftFromAXMMaintenanceIntervalConfig(incoming, supported);
|
|
333
|
+
if (next.schedule) {
|
|
334
|
+
next.schedule = constrainScheduleToModes(next.schedule, this.visibleScheduleModes());
|
|
335
|
+
}
|
|
271
336
|
this.draft.set(next);
|
|
272
|
-
const built =
|
|
337
|
+
const built = this.publishedConfig(next, incoming);
|
|
273
338
|
this.lastEmitted = built;
|
|
274
339
|
if (!configsEqual(incoming, built)) {
|
|
275
340
|
this.valueChange.emit(built);
|
|
@@ -286,7 +351,7 @@ class AXMMaintenanceIntervalComponent {
|
|
|
286
351
|
const draft = this.draft();
|
|
287
352
|
if (kind === 'schedule') {
|
|
288
353
|
const schedule = enabled && !draft.schedule
|
|
289
|
-
?
|
|
354
|
+
? this.createScheduleForMode(this.selectedScheduleMode())
|
|
290
355
|
: draft.schedule;
|
|
291
356
|
this.commit({ ...draft, scheduleEnabled: enabled, schedule });
|
|
292
357
|
return;
|
|
@@ -423,15 +488,44 @@ class AXMMaintenanceIntervalComponent {
|
|
|
423
488
|
}
|
|
424
489
|
//#endregion
|
|
425
490
|
//#region ----- Draft -----
|
|
491
|
+
createScheduleForMode(mode) {
|
|
492
|
+
if (mode === 'specific-date') {
|
|
493
|
+
return withSpecificDate(null);
|
|
494
|
+
}
|
|
495
|
+
return createDefaultSchedule();
|
|
496
|
+
}
|
|
426
497
|
supportedKeys() {
|
|
427
|
-
|
|
498
|
+
let kinds = this.supportedIntervalKinds().filter(isAXMMaintenanceIntervalKind);
|
|
499
|
+
if (this.hideCalendar()) {
|
|
500
|
+
kinds = kinds.filter((kind) => kind !== 'schedule' && kind !== 'date');
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Plan Interval Config shows Specific Date under the schedule toggle.
|
|
504
|
+
* Asset types that only list Date still get that schedule section, not a second Date row.
|
|
505
|
+
*/
|
|
506
|
+
if (this.scheduleModes()?.includes('specific-date')) {
|
|
507
|
+
kinds = kinds.filter((kind) => kind !== 'date');
|
|
508
|
+
if (!kinds.includes('schedule')) {
|
|
509
|
+
kinds = ['schedule', ...kinds];
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return kinds;
|
|
513
|
+
}
|
|
514
|
+
publishedConfig(draft, incoming) {
|
|
515
|
+
const built = buildAXMMaintenanceIntervalConfig(this.supportedKeys(), draft).config;
|
|
516
|
+
if (!this.hideCalendar()) {
|
|
517
|
+
return built;
|
|
518
|
+
}
|
|
519
|
+
return preserveCalendarTriggers(incoming, built);
|
|
428
520
|
}
|
|
429
521
|
toSection(kind, draft, errors) {
|
|
430
522
|
const error = errors.get(kind);
|
|
431
523
|
if (kind === 'schedule') {
|
|
524
|
+
const modes = this.visibleScheduleModes();
|
|
525
|
+
const dateOnly = modes.length === 1 && modes[0] === 'specific-date';
|
|
432
526
|
return {
|
|
433
527
|
kind,
|
|
434
|
-
labelKey: LABEL_KEYS
|
|
528
|
+
labelKey: dateOnly ? LABEL_KEYS.date : LABEL_KEYS.schedule,
|
|
435
529
|
enabled: draft.scheduleEnabled,
|
|
436
530
|
editor: 'schedule',
|
|
437
531
|
meterKind: null,
|
|
@@ -490,13 +584,13 @@ class AXMMaintenanceIntervalComponent {
|
|
|
490
584
|
}
|
|
491
585
|
commit(draft) {
|
|
492
586
|
this.draft.set(draft);
|
|
493
|
-
const config =
|
|
587
|
+
const config = this.publishedConfig(draft, this.value());
|
|
494
588
|
this.lastEmitted = config;
|
|
495
589
|
this.lastSupportedKey = kindsKey(this.supportedKeys());
|
|
496
590
|
this.valueChange.emit(config);
|
|
497
591
|
}
|
|
498
592
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMMaintenanceIntervalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
499
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMMaintenanceIntervalComponent, isStandalone: true, selector: "axm-maintenance-interval", inputs: { supportedIntervalKinds: { classPropertyName: "supportedIntervalKinds", publicName: "supportedIntervalKinds", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "block" }, ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\n <span class=\"text-sm font-medium\">{{ titleKey | translate | async }}</span>\n\n <!-- ----- No interval sections when the asset type supports none ----- -->\n @if (sections().length === 0) {\n <p class=\"ax-text-muted\">{{ emptyKey | translate | async }}</p>\n }\n\n @for (section of sections(); track section.kind) {\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <ax-switch\n class=\"ax-sm\"\n [ngModel]=\"section.enabled\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onEnabled(section.kind, $event)\"\n ></ax-switch>\n <ax-label>{{ section.labelKey | translate | async }}</ax-label>\n </div>\n\n <!-- ----- Schedule interval reuses the scheduler picker ----- -->\n @if (section.enabled && section.editor === 'schedule') {\n <div class=\"flex flex-col gap-3 ps-7\">\n <ax-selection-list\n [items]=\"scheduleModeItems\"\n [ngModel]=\"selectedScheduleMode()\"\n [disabled]=\"disabled()\"\n direction=\"horizontal\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onScheduleMode($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n <!-- ----- Specific Date uses the date box; other modes keep the scheduler picker ----- -->\n @if (selectedScheduleMode() === 'specific-date') {\n <ax-datetime-box\n picker=\"date\"\n [ngModel]=\"specificDate()\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onSpecificDate($event)\"\n ></ax-datetime-box>\n }\n <!-- ----- Daily, weekly, and monthly recurrence stay on the scheduler picker ----- -->\n @else {\n <ax-scheduler-picker\n [config]=\"scheduleSettings()\"\n [ngModel]=\"scheduleValue()\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onSchedule($event)\"\n />\n }\n <!-- ----- Schedule is required while Schedule is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n <!-- ----- Date interval is a single date ----- -->\n @else if (section.enabled && section.editor === 'date') {\n <div class=\"ps-7\">\n <ax-datetime-box\n picker=\"date\"\n [ngModel]=\"section.date\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onDate($event)\"\n ></ax-datetime-box>\n <!-- ----- A date is required while Date is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n <!-- ----- Distance interval with a kilometer or mile choice ----- -->\n @else if (section.enabled && section.editor === 'distance') {\n <div class=\"flex flex-nowrap items-center gap-3 overflow-x-auto ps-7\">\n <span class=\"shrink-0\">{{ everyKey | translate | async }}</span>\n <ax-number-box\n class=\"w-36 shrink-0\"\n [minValue]=\"0\"\n [decimals]=\"section.decimals\"\n [ngModel]=\"section.interval\"\n [disabled]=\"disabled()\"\n [showSpinButtons]=\"false\"\n (onValueChanged)=\"onInterval('distance', $event)\"\n ></ax-number-box>\n <ax-selection-list\n class=\"!w-fit shrink-0 [&_ul]:!flex-nowrap\"\n [items]=\"distanceUnits\"\n [ngModel]=\"section.unitId\"\n [disabled]=\"disabled()\"\n direction=\"horizontal\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onDistanceUnit($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n </div>\n <!-- ----- Positive distance is required while the section is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"ps-7 text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n }\n <!-- ----- Operating hours or operation count with a fixed unit ----- -->\n @else if (section.enabled && section.editor === 'meter') {\n <div class=\"flex flex-col gap-1 ps-7\">\n <div class=\"flex flex-nowrap items-center gap-3\">\n <span class=\"shrink-0\">{{ everyKey | translate | async }}</span>\n <ax-number-box\n class=\"w-36 shrink-0\"\n [minValue]=\"0\"\n [decimals]=\"section.decimals\"\n [ngModel]=\"section.interval\"\n [disabled]=\"disabled()\"\n [showSpinButtons]=\"false\"\n (onValueChanged)=\"onInterval(section.meterKind ?? 'operating-hours', $event)\"\n >\n <ax-suffix>{{ section.unitLabelKey | translate | async }}</ax-suffix>\n </ax-number-box>\n </div>\n <!-- ----- Positive meter interval is required while the section is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n </div>\n }\n\n <!-- ----- Trigger condition when more than one interval is enabled ----- -->\n @if (showTriggerLogic()) {\n <div class=\"flex flex-col gap-2\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <ax-selection-list\n [items]=\"triggerLogicItems\"\n [ngModel]=\"selectedTriggerLogic()\"\n [disabled]=\"disabled()\"\n direction=\"vertical\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onTriggerLogic($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXSwitchModule }, { kind: "component", type: i2.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXNumberBoxModule }, { kind: "component", type: i4.AXNumberBoxComponent, selector: "ax-number-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "minValue", "maxValue", "showSpinButtons", "thousandsSeparator", "decimals", "changeOnScroll", "step"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress", "thousandsSeparatorChange"] }, { kind: "ngmodule", type: AXSelectionListModule }, { kind: "component", type: i5.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "value", "valueField", "textField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "component", type: AXSchedulerPickerComponent, selector: "ax-scheduler-picker", inputs: ["disabled", "readonly", "tabIndex", "value", "state", "name", "id", "config"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "summaryChange"] }, { kind: "ngmodule", type: AXDateTimeBoxModule }, { kind: "component", type: i6.AXDateTimeBoxComponent, selector: "ax-datetime-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "depth", "id", "type", "look", "holidayDates", "allowTyping", "picker", "calendar", "weekend", "weekdays", "calendarLook", "yearRange", "boxLook", "format"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "onOpened", "onClosed", "readonlyChange", "disabledChange", "formatChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
593
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.8", type: AXMMaintenanceIntervalComponent, isStandalone: true, selector: "axm-maintenance-interval", inputs: { supportedIntervalKinds: { classPropertyName: "supportedIntervalKinds", publicName: "supportedIntervalKinds", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, includeSpecificDate: { classPropertyName: "includeSpecificDate", publicName: "includeSpecificDate", isSignal: true, isRequired: false, transformFunction: null }, scheduleModes: { classPropertyName: "scheduleModes", publicName: "scheduleModes", isSignal: true, isRequired: false, transformFunction: null }, showTitle: { classPropertyName: "showTitle", publicName: "showTitle", isSignal: true, isRequired: false, transformFunction: null }, hideCalendar: { classPropertyName: "hideCalendar", publicName: "hideCalendar", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange" }, host: { classAttribute: "block" }, ngImport: i0, template: "<div class=\"flex flex-col gap-4\">\n <!-- ----- Inner heading stays for other interval editors ----- -->\n @if (showTitle()) {\n <span class=\"text-sm font-medium\">{{ titleKey | translate | async }}</span>\n }\n\n <!-- ----- No interval sections when the asset type supports none ----- -->\n @if (sections().length === 0 && !hideCalendar()) {\n <p class=\"ax-text-muted\">{{ emptyKey | translate | async }}</p>\n }\n\n @for (section of sections(); track section.kind) {\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <ax-switch\n class=\"ax-sm\"\n [ngModel]=\"section.enabled\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onEnabled(section.kind, $event)\"\n ></ax-switch>\n <ax-label>{{ section.labelKey | translate | async }}</ax-label>\n </div>\n\n <!-- ----- Schedule interval reuses the scheduler picker ----- -->\n @if (section.enabled && section.editor === 'schedule') {\n <div class=\"flex flex-col gap-3 ps-7\">\n <ax-selection-list\n [items]=\"scheduleModeItems()\"\n [ngModel]=\"selectedScheduleMode()\"\n [disabled]=\"disabled()\"\n direction=\"horizontal\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onScheduleMode($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n <!-- ----- Specific Date uses the date box ----- -->\n @if (selectedScheduleMode() === 'specific-date') {\n <ax-datetime-box\n picker=\"date\"\n [ngModel]=\"specificDate()\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onSpecificDate($event)\"\n ></ax-datetime-box>\n }\n <!-- ----- Daily, weekly, and monthly recurrence stay on the scheduler picker ----- -->\n @else {\n <ax-scheduler-picker\n [config]=\"scheduleSettings()\"\n [ngModel]=\"scheduleValue()\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onSchedule($event)\"\n />\n }\n <!-- ----- Schedule is required while Schedule is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n <!-- ----- Date interval is a single date ----- -->\n @else if (section.enabled && section.editor === 'date') {\n <div class=\"ps-7\">\n <ax-datetime-box\n picker=\"date\"\n [ngModel]=\"section.date\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onDate($event)\"\n ></ax-datetime-box>\n <!-- ----- A date is required while Date is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n <!-- ----- Distance interval with a kilometer or mile choice ----- -->\n @else if (section.enabled && section.editor === 'distance') {\n <div class=\"flex flex-nowrap items-center gap-3 overflow-x-auto ps-7\">\n <span class=\"shrink-0\">{{ everyKey | translate | async }}</span>\n <ax-number-box\n class=\"w-36 shrink-0\"\n [minValue]=\"0\"\n [decimals]=\"section.decimals\"\n [ngModel]=\"section.interval\"\n [disabled]=\"disabled()\"\n [showSpinButtons]=\"false\"\n (onValueChanged)=\"onInterval('distance', $event)\"\n ></ax-number-box>\n <ax-selection-list\n class=\"!w-fit shrink-0 [&_ul]:!flex-nowrap\"\n [items]=\"distanceUnits\"\n [ngModel]=\"section.unitId\"\n [disabled]=\"disabled()\"\n direction=\"horizontal\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onDistanceUnit($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n </div>\n <!-- ----- Positive distance is required while the section is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"ps-7 text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n }\n <!-- ----- Operating hours or operation count with a fixed unit ----- -->\n @else if (section.enabled && section.editor === 'meter') {\n <div class=\"flex flex-col gap-1 ps-7\">\n <div class=\"flex flex-nowrap items-center gap-3\">\n <span class=\"shrink-0\">{{ everyKey | translate | async }}</span>\n <ax-number-box\n class=\"w-36 shrink-0\"\n [minValue]=\"0\"\n [decimals]=\"section.decimals\"\n [ngModel]=\"section.interval\"\n [disabled]=\"disabled()\"\n [showSpinButtons]=\"false\"\n (onValueChanged)=\"onInterval(section.meterKind ?? 'operating-hours', $event)\"\n >\n <ax-suffix>{{ section.unitLabelKey | translate | async }}</ax-suffix>\n </ax-number-box>\n </div>\n <!-- ----- Positive meter interval is required while the section is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n </div>\n }\n\n <!-- ----- Trigger condition when more than one interval is enabled ----- -->\n @if (showTriggerLogic()) {\n <div class=\"flex flex-col gap-2\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <ax-selection-list\n [items]=\"triggerLogicItems\"\n [ngModel]=\"selectedTriggerLogic()\"\n [disabled]=\"disabled()\"\n direction=\"vertical\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onTriggerLogic($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n </div>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXSwitchModule }, { kind: "component", type: i2.AXSwitchComponent, selector: "ax-switch", inputs: ["disabled", "readonly", "color", "tabIndex", "value", "name", "isLoading"], outputs: ["onBlur", "onFocus", "valueChange", "onValueChanged", "readonlyChange", "disabledChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i2$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXNumberBoxModule }, { kind: "component", type: i4.AXNumberBoxComponent, selector: "ax-number-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "minValue", "maxValue", "showSpinButtons", "thousandsSeparator", "decimals", "changeOnScroll", "step"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress", "thousandsSeparatorChange"] }, { kind: "ngmodule", type: AXSelectionListModule }, { kind: "component", type: i5.AXSelectionListComponent, selector: "ax-selection-list", inputs: ["id", "name", "disabled", "readonly", "tabIndex", "value", "valueField", "textField", "disabledField", "readonlyField", "multiple", "direction", "customTemplate", "showControl", "items", "look"], outputs: ["onValueChanged", "onBlur", "onFocus"] }, { kind: "component", type: AXSchedulerPickerComponent, selector: "ax-scheduler-picker", inputs: ["disabled", "readonly", "tabIndex", "value", "state", "name", "id", "config"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "summaryChange"] }, { kind: "ngmodule", type: AXDateTimeBoxModule }, { kind: "component", type: i6.AXDateTimeBoxComponent, selector: "ax-datetime-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "depth", "id", "type", "look", "holidayDates", "allowTyping", "picker", "calendar", "weekend", "weekdays", "calendarLook", "yearRange", "boxLook", "format"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "onOpened", "onClosed", "readonlyChange", "disabledChange", "formatChange"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
500
594
|
}
|
|
501
595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMMaintenanceIntervalComponent, decorators: [{
|
|
502
596
|
type: Component,
|
|
@@ -511,8 +605,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
511
605
|
AXSelectionListModule,
|
|
512
606
|
AXSchedulerPickerComponent,
|
|
513
607
|
AXDateTimeBoxModule,
|
|
514
|
-
], host: { class: 'block' }, template: "<div class=\"flex flex-col gap-4\">\n <span class=\"text-sm font-medium\">{{ titleKey | translate | async }}</span>\n\n <!-- ----- No interval sections when the asset type supports none ----- -->\n @if (sections().length === 0) {\n <p class=\"ax-text-muted\">{{ emptyKey | translate | async }}</p>\n }\n\n @for (section of sections(); track section.kind) {\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <ax-switch\n class=\"ax-sm\"\n [ngModel]=\"section.enabled\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onEnabled(section.kind, $event)\"\n ></ax-switch>\n <ax-label>{{ section.labelKey | translate | async }}</ax-label>\n </div>\n\n <!-- ----- Schedule interval reuses the scheduler picker ----- -->\n @if (section.enabled && section.editor === 'schedule') {\n <div class=\"flex flex-col gap-3 ps-7\">\n <ax-selection-list\n [items]=\"scheduleModeItems\"\n [ngModel]=\"selectedScheduleMode()\"\n [disabled]=\"disabled()\"\n direction=\"horizontal\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onScheduleMode($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n <!-- ----- Specific Date uses the date box
|
|
515
|
-
}], ctorParameters: () => [], propDecorators: { supportedIntervalKinds: [{ type: i0.Input, args: [{ isSignal: true, alias: "supportedIntervalKinds", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
608
|
+
], host: { class: 'block' }, template: "<div class=\"flex flex-col gap-4\">\n <!-- ----- Inner heading stays for other interval editors ----- -->\n @if (showTitle()) {\n <span class=\"text-sm font-medium\">{{ titleKey | translate | async }}</span>\n }\n\n <!-- ----- No interval sections when the asset type supports none ----- -->\n @if (sections().length === 0 && !hideCalendar()) {\n <p class=\"ax-text-muted\">{{ emptyKey | translate | async }}</p>\n }\n\n @for (section of sections(); track section.kind) {\n <div class=\"flex flex-col gap-2\">\n <div class=\"flex items-center gap-2\">\n <ax-switch\n class=\"ax-sm\"\n [ngModel]=\"section.enabled\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onEnabled(section.kind, $event)\"\n ></ax-switch>\n <ax-label>{{ section.labelKey | translate | async }}</ax-label>\n </div>\n\n <!-- ----- Schedule interval reuses the scheduler picker ----- -->\n @if (section.enabled && section.editor === 'schedule') {\n <div class=\"flex flex-col gap-3 ps-7\">\n <ax-selection-list\n [items]=\"scheduleModeItems()\"\n [ngModel]=\"selectedScheduleMode()\"\n [disabled]=\"disabled()\"\n direction=\"horizontal\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onScheduleMode($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n <!-- ----- Specific Date uses the date box ----- -->\n @if (selectedScheduleMode() === 'specific-date') {\n <ax-datetime-box\n picker=\"date\"\n [ngModel]=\"specificDate()\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onSpecificDate($event)\"\n ></ax-datetime-box>\n }\n <!-- ----- Daily, weekly, and monthly recurrence stay on the scheduler picker ----- -->\n @else {\n <ax-scheduler-picker\n [config]=\"scheduleSettings()\"\n [ngModel]=\"scheduleValue()\"\n [disabled]=\"disabled()\"\n (ngModelChange)=\"onSchedule($event)\"\n />\n }\n <!-- ----- Schedule is required while Schedule is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n <!-- ----- Date interval is a single date ----- -->\n @else if (section.enabled && section.editor === 'date') {\n <div class=\"ps-7\">\n <ax-datetime-box\n picker=\"date\"\n [ngModel]=\"section.date\"\n [disabled]=\"disabled()\"\n (onValueChanged)=\"onDate($event)\"\n ></ax-datetime-box>\n <!-- ----- A date is required while Date is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n <!-- ----- Distance interval with a kilometer or mile choice ----- -->\n @else if (section.enabled && section.editor === 'distance') {\n <div class=\"flex flex-nowrap items-center gap-3 overflow-x-auto ps-7\">\n <span class=\"shrink-0\">{{ everyKey | translate | async }}</span>\n <ax-number-box\n class=\"w-36 shrink-0\"\n [minValue]=\"0\"\n [decimals]=\"section.decimals\"\n [ngModel]=\"section.interval\"\n [disabled]=\"disabled()\"\n [showSpinButtons]=\"false\"\n (onValueChanged)=\"onInterval('distance', $event)\"\n ></ax-number-box>\n <ax-selection-list\n class=\"!w-fit shrink-0 [&_ul]:!flex-nowrap\"\n [items]=\"distanceUnits\"\n [ngModel]=\"section.unitId\"\n [disabled]=\"disabled()\"\n direction=\"horizontal\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onDistanceUnit($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n </div>\n <!-- ----- Positive distance is required while the section is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"ps-7 text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n }\n <!-- ----- Operating hours or operation count with a fixed unit ----- -->\n @else if (section.enabled && section.editor === 'meter') {\n <div class=\"flex flex-col gap-1 ps-7\">\n <div class=\"flex flex-nowrap items-center gap-3\">\n <span class=\"shrink-0\">{{ everyKey | translate | async }}</span>\n <ax-number-box\n class=\"w-36 shrink-0\"\n [minValue]=\"0\"\n [decimals]=\"section.decimals\"\n [ngModel]=\"section.interval\"\n [disabled]=\"disabled()\"\n [showSpinButtons]=\"false\"\n (onValueChanged)=\"onInterval(section.meterKind ?? 'operating-hours', $event)\"\n >\n <ax-suffix>{{ section.unitLabelKey | translate | async }}</ax-suffix>\n </ax-number-box>\n </div>\n <!-- ----- Positive meter interval is required while the section is enabled ----- -->\n @if (section.errorKey; as errorKey) {\n <p class=\"text-sm text-danger\">{{ errorKey | translate | async }}</p>\n }\n </div>\n }\n </div>\n }\n\n <!-- ----- Trigger condition when more than one interval is enabled ----- -->\n @if (showTriggerLogic()) {\n <div class=\"flex flex-col gap-2\">\n <ax-label>{{ triggerLogicTitleKey | translate | async }}</ax-label>\n <ax-selection-list\n [items]=\"triggerLogicItems\"\n [ngModel]=\"selectedTriggerLogic()\"\n [disabled]=\"disabled()\"\n direction=\"vertical\"\n [multiple]=\"false\"\n [showControl]=\"true\"\n valueField=\"id\"\n textField=\"text\"\n (onValueChanged)=\"onTriggerLogic($event)\"\n >\n <ng-template #itemTemplate let-item>\n <span>{{ item.text | translate | async }}</span>\n </ng-template>\n </ax-selection-list>\n </div>\n }\n</div>\n" }]
|
|
609
|
+
}], ctorParameters: () => [], propDecorators: { supportedIntervalKinds: [{ type: i0.Input, args: [{ isSignal: true, alias: "supportedIntervalKinds", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], includeSpecificDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "includeSpecificDate", required: false }] }], scheduleModes: [{ type: i0.Input, args: [{ isSignal: true, alias: "scheduleModes", required: false }] }], showTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTitle", required: false }] }], hideCalendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideCalendar", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
|
|
516
610
|
|
|
517
611
|
//#region ---- Imports ----
|
|
518
612
|
//#endregion
|
|
@@ -755,6 +849,9 @@ async function allocateIdentifierCode(identifierService, sessionService, ruleId)
|
|
|
755
849
|
return result.code;
|
|
756
850
|
}
|
|
757
851
|
function buildMaintenancePlanPayload(asset, template, options) {
|
|
852
|
+
// Exact copy of the template Scheduling Widget — never invent daily/Never defaults here.
|
|
853
|
+
const schedule = cloneMaintenanceTemplateSchedule(template.schedule);
|
|
854
|
+
const assignedToId = resolveRelationId(asset.assignedToEmployeeId);
|
|
758
855
|
return {
|
|
759
856
|
...(options?.code ? { code: options.code } : {}),
|
|
760
857
|
title: combineMultiLanguageTitle(template.title, template.code ?? 'Template', asset.title, asset.code ?? 'Asset'),
|
|
@@ -762,24 +859,14 @@ function buildMaintenancePlanPayload(asset, template, options) {
|
|
|
762
859
|
assetId: asset.id,
|
|
763
860
|
maintenanceTypeId: template.maintenanceTypeId,
|
|
764
861
|
maintenanceTemplateId: template.id,
|
|
862
|
+
...(assignedToId ? { assignedToId } : {}),
|
|
863
|
+
schedule,
|
|
864
|
+
/** Meter / Specific Date intervals stay on this field. Recurrence lives on `schedule` only. */
|
|
765
865
|
intervalConfig: {
|
|
766
866
|
triggerLogic: AXMMaintenanceIntervalTriggerLogic.Any,
|
|
767
|
-
triggers: [
|
|
768
|
-
{
|
|
769
|
-
kind: 'schedule',
|
|
770
|
-
schedule: template.schedule ?? {
|
|
771
|
-
mode: 'daily',
|
|
772
|
-
interval: 1,
|
|
773
|
-
startCondition: { type: 'byDate', startDate: new Date().toISOString() },
|
|
774
|
-
endCondition: { type: 'never' },
|
|
775
|
-
},
|
|
776
|
-
},
|
|
777
|
-
],
|
|
867
|
+
triggers: [],
|
|
778
868
|
},
|
|
779
869
|
intervalStates: [],
|
|
780
|
-
estimatedHours: template.estimatedMinutes
|
|
781
|
-
? Math.max(1, Math.ceil(template.estimatedMinutes / 60))
|
|
782
|
-
: undefined,
|
|
783
870
|
needPermission: !!template.needPermission,
|
|
784
871
|
needShutdown: !!template.needShutdown,
|
|
785
872
|
...(options?.autoGeneratedPlan ? { autoGeneratedPlan: true } : {}),
|
|
@@ -788,17 +875,27 @@ function buildMaintenancePlanPayload(asset, template, options) {
|
|
|
788
875
|
: {}),
|
|
789
876
|
};
|
|
790
877
|
}
|
|
791
|
-
|
|
878
|
+
/**
|
|
879
|
+
* Loads a full template row when the list/partial result is missing fields needed for generation.
|
|
880
|
+
* Pass `requireSchedule: true` for auto plan create so a typed row without `schedule` cannot bypass reload.
|
|
881
|
+
*/
|
|
882
|
+
async function resolveMaintenanceTemplate(backend, templateEntityName, partial, options) {
|
|
792
883
|
if (!partial?.id) {
|
|
793
884
|
return null;
|
|
794
885
|
}
|
|
795
|
-
if (partial
|
|
886
|
+
if (!shouldReloadMaintenanceTemplateForPlan(partial, options)) {
|
|
796
887
|
return partial;
|
|
797
888
|
}
|
|
798
889
|
const loaded = (await backend
|
|
799
890
|
.getOne(templateEntityName, partial.id)
|
|
800
891
|
.catch(() => null));
|
|
801
|
-
|
|
892
|
+
if (!loaded?.maintenanceTypeId) {
|
|
893
|
+
return null;
|
|
894
|
+
}
|
|
895
|
+
if (options?.requireSchedule && !hasMaintenanceTemplateSchedule(loaded.schedule)) {
|
|
896
|
+
return null;
|
|
897
|
+
}
|
|
898
|
+
return loaded;
|
|
802
899
|
}
|
|
803
900
|
function resolveRelationId(value) {
|
|
804
901
|
if (isString(value)) {
|
|
@@ -947,7 +1044,7 @@ function buildWorkOrderPayloadFromFailureRegister(failureRegister, template, wor
|
|
|
947
1044
|
function buildWorkOrderPayloadFromPlan(plan, workOrderNo, options) {
|
|
948
1045
|
const title = normalizeMultiLanguageString(plan.title, plan.code ?? 'Work order');
|
|
949
1046
|
const occurrence = options?.occurrence ??
|
|
950
|
-
resolveWorkOrderOccurrences(plan
|
|
1047
|
+
resolveWorkOrderOccurrences(readMaintenancePlanSchedule(plan), {
|
|
951
1048
|
referenceDate: options?.referenceDate,
|
|
952
1049
|
estimatedHours: resolvePlanEstimatedHours(plan),
|
|
953
1050
|
})[0];
|
|
@@ -989,7 +1086,7 @@ function buildWorkOrderPayloadFromPlan(plan, workOrderNo, options) {
|
|
|
989
1086
|
function buildWorkOrderPayloadsFromPlan(plan, options) {
|
|
990
1087
|
const referenceDate = options?.referenceDate ?? new Date();
|
|
991
1088
|
const estimatedHours = resolvePlanEstimatedHours(plan);
|
|
992
|
-
const occurrences = resolveWorkOrderOccurrences(plan
|
|
1089
|
+
const occurrences = resolveWorkOrderOccurrences(readMaintenancePlanSchedule(plan), {
|
|
993
1090
|
referenceDate,
|
|
994
1091
|
estimatedHours,
|
|
995
1092
|
});
|
|
@@ -1040,11 +1137,25 @@ function isMaintenanceTemplateLike(row) {
|
|
|
1040
1137
|
const candidate = row;
|
|
1041
1138
|
return typeof candidate.id === 'string' && typeof candidate.maintenanceTypeId === 'string';
|
|
1042
1139
|
}
|
|
1140
|
+
/** Fields needed to decide auto-plan offers and to detect a missing schedule on list rows. */
|
|
1141
|
+
const AUTO_GENERATE_TEMPLATE_QUERY_FIELDS = [
|
|
1142
|
+
'id',
|
|
1143
|
+
'code',
|
|
1144
|
+
'title',
|
|
1145
|
+
'description',
|
|
1146
|
+
'maintenanceTypeId',
|
|
1147
|
+
'assetTypeId',
|
|
1148
|
+
'schedule',
|
|
1149
|
+
'needPermission',
|
|
1150
|
+
'needShutdown',
|
|
1151
|
+
'autoGeneratePlan',
|
|
1152
|
+
];
|
|
1043
1153
|
async function queryAutoGenerateTemplatesForAssetType(backend, templateEntityName, assetTypeId) {
|
|
1044
1154
|
const result = await backend
|
|
1045
1155
|
.query(templateEntityName, {
|
|
1046
1156
|
skip: 0,
|
|
1047
1157
|
take: 200,
|
|
1158
|
+
fields: [...AUTO_GENERATE_TEMPLATE_QUERY_FIELDS],
|
|
1048
1159
|
filter: {
|
|
1049
1160
|
logic: 'and',
|
|
1050
1161
|
filters: [
|
|
@@ -1057,6 +1168,27 @@ async function queryAutoGenerateTemplatesForAssetType(backend, templateEntityNam
|
|
|
1057
1168
|
const items = result.items ?? [];
|
|
1058
1169
|
return items.filter(isMaintenanceTemplateLike);
|
|
1059
1170
|
}
|
|
1171
|
+
/** Template ids that already have a maintenance plan for this asset. */
|
|
1172
|
+
async function queryMaintenanceTemplateIdsForAsset(backend, planEntityName, assetId) {
|
|
1173
|
+
const result = await backend
|
|
1174
|
+
.query(planEntityName, {
|
|
1175
|
+
skip: 0,
|
|
1176
|
+
take: 500,
|
|
1177
|
+
filter: { field: 'assetId', operator: { type: 'equal' }, value: assetId },
|
|
1178
|
+
})
|
|
1179
|
+
.catch(() => ({ total: 0, items: [] }));
|
|
1180
|
+
const templateIds = new Set();
|
|
1181
|
+
for (const item of result.items ?? []) {
|
|
1182
|
+
if (!item || typeof item !== 'object') {
|
|
1183
|
+
continue;
|
|
1184
|
+
}
|
|
1185
|
+
const templateId = resolveRelationId(item.maintenanceTemplateId);
|
|
1186
|
+
if (templateId) {
|
|
1187
|
+
templateIds.add(templateId);
|
|
1188
|
+
}
|
|
1189
|
+
}
|
|
1190
|
+
return templateIds;
|
|
1191
|
+
}
|
|
1060
1192
|
const ASSET_ENTITY$2 = 'AssetManagement.Asset';
|
|
1061
1193
|
const ASSET_TYPE_ENTITY$1 = 'AssetManagement.AssetType';
|
|
1062
1194
|
function isWorkflowEnabledOnTemplate(template) {
|
|
@@ -1150,7 +1282,7 @@ async function hasWorkOrderForPlanScheduledStart(backend, workOrderEntityName, p
|
|
|
1150
1282
|
* For `endCondition.type === 'never'`, returns the next interval from the signed-off scheduled start.
|
|
1151
1283
|
*/
|
|
1152
1284
|
function resolveNextWorkOrderOccurrenceAfterSignedOff(plan, signedOffWorkOrder, referenceDate = new Date()) {
|
|
1153
|
-
const schedule =
|
|
1285
|
+
const schedule = readMaintenancePlanSchedule(plan);
|
|
1154
1286
|
if (!schedule) {
|
|
1155
1287
|
return null;
|
|
1156
1288
|
}
|
|
@@ -1185,51 +1317,56 @@ function resolveNextWorkOrderOccurrenceAfterSignedOff(plan, signedOffWorkOrder,
|
|
|
1185
1317
|
//#endregion
|
|
1186
1318
|
//#region ---- Constants ----
|
|
1187
1319
|
const ASSET_ENTITY$1 = 'AssetManagement.Asset';
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1320
|
+
const I18N$2 = '@asset-management:assets.entities.asset.dialogs.create-maintenance-offer';
|
|
1321
|
+
//#endregion
|
|
1322
|
+
//#region ---- Dialog ----
|
|
1323
|
+
/**
|
|
1324
|
+
* Same confirm layout as the maintenance-plan work-order prompt, with Create Now and Cancel.
|
|
1325
|
+
*/
|
|
1326
|
+
async function askCreateMaintenancePlans(dialogService, translateService) {
|
|
1327
|
+
const title = await translateService.translateAsync(`${I18N$2}.title`);
|
|
1328
|
+
const content = await translateService.translateAsync(`${I18N$2}.content`);
|
|
1329
|
+
const createNowLabel = await translateService.translateAsync(`${I18N$2}.actions.create-now`);
|
|
1193
1330
|
const cancelLabel = await translateService.translateAsync('@general:actions.cancel.title');
|
|
1194
1331
|
return new Promise((resolve) => {
|
|
1195
1332
|
let settled = false;
|
|
1196
|
-
const finish = (
|
|
1333
|
+
const finish = (createPlans) => {
|
|
1197
1334
|
if (settled) {
|
|
1198
1335
|
return;
|
|
1199
1336
|
}
|
|
1200
1337
|
settled = true;
|
|
1201
|
-
resolve(
|
|
1338
|
+
resolve(createPlans);
|
|
1202
1339
|
};
|
|
1203
1340
|
const dialog = dialogService.open({
|
|
1204
1341
|
title,
|
|
1205
1342
|
content,
|
|
1206
|
-
type: '
|
|
1343
|
+
type: 'warning',
|
|
1207
1344
|
orientation: 'horizontal',
|
|
1208
|
-
|
|
1345
|
+
draggable: false,
|
|
1209
1346
|
buttons: [
|
|
1210
1347
|
{
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1348
|
+
name: 'confirm',
|
|
1349
|
+
text: createNowLabel,
|
|
1350
|
+
color: 'warning',
|
|
1214
1351
|
onClick: () => {
|
|
1215
1352
|
dialog.close();
|
|
1216
|
-
finish(
|
|
1353
|
+
finish(true);
|
|
1217
1354
|
},
|
|
1218
1355
|
},
|
|
1219
1356
|
{
|
|
1220
|
-
|
|
1357
|
+
name: 'cancel',
|
|
1358
|
+
text: cancelLabel,
|
|
1221
1359
|
color: 'default',
|
|
1360
|
+
autofocus: true,
|
|
1222
1361
|
onClick: () => {
|
|
1223
1362
|
dialog.close();
|
|
1224
|
-
finish(
|
|
1363
|
+
finish(false);
|
|
1225
1364
|
},
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
dialog.close();
|
|
1232
|
-
finish({ createPlans: true, createWorkOrders: true });
|
|
1365
|
+
hotkey: {
|
|
1366
|
+
Escape: () => {
|
|
1367
|
+
dialog.close();
|
|
1368
|
+
finish(false);
|
|
1369
|
+
},
|
|
1233
1370
|
},
|
|
1234
1371
|
},
|
|
1235
1372
|
],
|
|
@@ -1238,13 +1375,27 @@ async function askMaintenanceOfferChoice(dialogService, translateService, templa
|
|
|
1238
1375
|
}
|
|
1239
1376
|
//#endregion
|
|
1240
1377
|
//#region ---- Middleware ----
|
|
1378
|
+
function readSavedAssetId(op, id, result, data) {
|
|
1379
|
+
if (op === 'create' && typeof result === 'string' && result.trim()) {
|
|
1380
|
+
return result;
|
|
1381
|
+
}
|
|
1382
|
+
if (typeof id === 'string' && id.trim()) {
|
|
1383
|
+
return id;
|
|
1384
|
+
}
|
|
1385
|
+
if (data && typeof data === 'object' && typeof data.id === 'string') {
|
|
1386
|
+
const dataId = data.id.trim();
|
|
1387
|
+
return dataId || undefined;
|
|
1388
|
+
}
|
|
1389
|
+
return undefined;
|
|
1390
|
+
}
|
|
1241
1391
|
/**
|
|
1242
|
-
* After
|
|
1243
|
-
*
|
|
1392
|
+
* After an asset is saved, offers to create maintenance plans for auto-generate templates
|
|
1393
|
+
* on its asset type. Existing plans for the same asset and template are left as they are.
|
|
1244
1394
|
*/
|
|
1245
1395
|
const assetCreateMaintenanceOfferMiddleware = {
|
|
1246
1396
|
target: {
|
|
1247
|
-
ops: ['create'],
|
|
1397
|
+
ops: ['create', 'update'],
|
|
1398
|
+
entity: ASSET_ENTITY$1,
|
|
1248
1399
|
order: 88,
|
|
1249
1400
|
},
|
|
1250
1401
|
execute: async (ctx, next) => {
|
|
@@ -1260,8 +1411,8 @@ const assetCreateMaintenanceOfferMiddleware = {
|
|
|
1260
1411
|
return;
|
|
1261
1412
|
}
|
|
1262
1413
|
await next();
|
|
1263
|
-
const
|
|
1264
|
-
if (!
|
|
1414
|
+
const savedId = readSavedAssetId(ctx.op, ctx.id, ctx.result, ctx.data);
|
|
1415
|
+
if (!savedId ||
|
|
1265
1416
|
!dialogService ||
|
|
1266
1417
|
!toastService ||
|
|
1267
1418
|
!translateService ||
|
|
@@ -1270,35 +1421,36 @@ const assetCreateMaintenanceOfferMiddleware = {
|
|
|
1270
1421
|
!sessionService) {
|
|
1271
1422
|
return;
|
|
1272
1423
|
}
|
|
1273
|
-
const asset = (await backend.getOne(ASSET_ENTITY$1,
|
|
1424
|
+
const asset = (await backend.getOne(ASSET_ENTITY$1, savedId).catch(() => null));
|
|
1274
1425
|
if (!asset?.assetTypeId) {
|
|
1275
1426
|
return;
|
|
1276
1427
|
}
|
|
1428
|
+
asset.id = asset.id || savedId;
|
|
1277
1429
|
const templateEntity = `${RootConfig.module.name}.${RootConfig.entities.maintenanceTemplate.name}`;
|
|
1278
1430
|
const planEntity = `${RootConfig.module.name}.${RootConfig.entities.maintenancePlan.name}`;
|
|
1279
|
-
const workOrderEntity = `${RootConfig.module.name}.${RootConfig.entities.workOrder.name}`;
|
|
1280
1431
|
const templates = await queryAutoGenerateTemplatesForAssetType(backend, templateEntity, asset.assetTypeId);
|
|
1281
1432
|
if (templates.length === 0) {
|
|
1282
1433
|
return;
|
|
1283
1434
|
}
|
|
1284
|
-
const
|
|
1285
|
-
const
|
|
1286
|
-
if (
|
|
1435
|
+
const existingTemplateIds = await queryMaintenanceTemplateIdsForAsset(backend, planEntity, asset.id ?? savedId);
|
|
1436
|
+
const missingTemplates = templates.filter((template) => !existingTemplateIds.has(template.id));
|
|
1437
|
+
if (missingTemplates.length === 0) {
|
|
1287
1438
|
return;
|
|
1288
1439
|
}
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1440
|
+
const createPlans = await askCreateMaintenancePlans(dialogService, translateService);
|
|
1441
|
+
if (!createPlans) {
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
let createdCount = 0;
|
|
1445
|
+
for (const partial of missingTemplates) {
|
|
1446
|
+
// List rows can include maintenanceTypeId while omitting schedule; always require a saved schedule.
|
|
1447
|
+
const template = await resolveMaintenanceTemplate(backend, templateEntity, partial, {
|
|
1448
|
+
requireSchedule: true,
|
|
1449
|
+
});
|
|
1450
|
+
if (!template) {
|
|
1451
|
+
continue;
|
|
1299
1452
|
}
|
|
1300
1453
|
try {
|
|
1301
|
-
// Validation runs before identifier middleware; allocate (commit) a distinct code per plan.
|
|
1302
1454
|
const planCode = await allocateIdentifierCode(identifierService, sessionService, MAINTENANCE_PLAN_CODE_RULE_ID);
|
|
1303
1455
|
const planPayload = buildMaintenancePlanPayload(asset, template, {
|
|
1304
1456
|
suppressWorkOrderPrompt: true,
|
|
@@ -1306,46 +1458,23 @@ const assetCreateMaintenanceOfferMiddleware = {
|
|
|
1306
1458
|
autoGeneratedPlan: true,
|
|
1307
1459
|
});
|
|
1308
1460
|
const planId = await entityStorage.insertOne(planEntity, planPayload);
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
continue;
|
|
1312
|
-
}
|
|
1313
|
-
const storedPlan = (await backend.getOne(planEntity, resolvedPlanId).catch(() => null));
|
|
1314
|
-
const plan = mergeMaintenancePlanForWorkOrder({ ...planPayload, id: resolvedPlanId }, storedPlan, resolvedPlanId);
|
|
1315
|
-
if (plan) {
|
|
1316
|
-
createdPlans.push(plan);
|
|
1461
|
+
if (typeof planId === 'string' && planId.trim()) {
|
|
1462
|
+
createdCount += 1;
|
|
1317
1463
|
}
|
|
1318
1464
|
}
|
|
1319
1465
|
catch (error) {
|
|
1320
|
-
const errorTitle = await translateService.translateAsync(
|
|
1466
|
+
const errorTitle = await translateService.translateAsync(`${I18N$2}.errors.create-failed-title`);
|
|
1321
1467
|
const errorMessage = error instanceof Error
|
|
1322
1468
|
? error.message
|
|
1323
|
-
: await translateService.translateAsync(
|
|
1469
|
+
: await translateService.translateAsync(`${I18N$2}.errors.create-failed-content`);
|
|
1324
1470
|
toastService.show({ color: 'danger', title: errorTitle, content: errorMessage });
|
|
1325
1471
|
return;
|
|
1326
1472
|
}
|
|
1327
1473
|
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
return;
|
|
1333
|
-
}
|
|
1334
|
-
let workOrderCount = 0;
|
|
1335
|
-
const referenceDate = new Date();
|
|
1336
|
-
for (const plan of createdPlans) {
|
|
1337
|
-
if (!canCreateWorkOrderFromPlan(plan)) {
|
|
1338
|
-
continue;
|
|
1339
|
-
}
|
|
1340
|
-
workOrderCount += await insertWorkOrdersFromPlan(entityStorage, identifierService, sessionService, workOrderEntity, plan, {
|
|
1341
|
-
autoGeneratedWorkOrder: true,
|
|
1342
|
-
referenceDate,
|
|
1343
|
-
sourceType: AXMWorkOrderSourceType.CreateAsset,
|
|
1344
|
-
backend,
|
|
1345
|
-
});
|
|
1346
|
-
}
|
|
1347
|
-
const successTitle = await translateService.translateAsync('@asset-management:assets.entities.asset.dialogs.create-maintenance-offer.success.both-title');
|
|
1348
|
-
const successContent = await translateService.translateAsync('@asset-management:assets.entities.asset.dialogs.create-maintenance-offer.success.both-content', { params: { planCount: createdPlans.length, workOrderCount } });
|
|
1474
|
+
const successTitle = await translateService.translateAsync(`${I18N$2}.success.plans-title`);
|
|
1475
|
+
const successContent = await translateService.translateAsync(`${I18N$2}.success.plans-content`, {
|
|
1476
|
+
params: { count: createdCount },
|
|
1477
|
+
});
|
|
1349
1478
|
toastService.show({ color: 'success', title: successTitle, content: successContent });
|
|
1350
1479
|
},
|
|
1351
1480
|
};
|
|
@@ -1538,7 +1667,7 @@ async function runMaintenancePlanWorkOrderPrompt(deps) {
|
|
|
1538
1667
|
if (!plan) {
|
|
1539
1668
|
return;
|
|
1540
1669
|
}
|
|
1541
|
-
const plannedWorkOrderCount = countWorkOrdersToCreateFromSchedule(plan
|
|
1670
|
+
const plannedWorkOrderCount = countWorkOrdersToCreateFromSchedule(readMaintenancePlanSchedule(plan));
|
|
1542
1671
|
const confirmTitle = await translateService.translateAsync(`${I18N}.confirm-title`);
|
|
1543
1672
|
const confirmMessage = plannedWorkOrderCount === 1
|
|
1544
1673
|
? await translateService.translateAsync(`${I18N}.confirm-single`)
|
|
@@ -1587,7 +1716,7 @@ async function runMaintenancePlanWorkOrderPrompt(deps) {
|
|
|
1587
1716
|
* If confirmed, creates Work Order using the plan's already selected template.
|
|
1588
1717
|
*/
|
|
1589
1718
|
const WRITE_OPS = new Set(['create', 'update', 'upsertOne']);
|
|
1590
|
-
function readRecord(value) {
|
|
1719
|
+
function readRecord$1(value) {
|
|
1591
1720
|
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
1592
1721
|
return null;
|
|
1593
1722
|
}
|
|
@@ -1616,7 +1745,7 @@ const maintenancePlanCreateWorkOrderMiddleware = {
|
|
|
1616
1745
|
return;
|
|
1617
1746
|
}
|
|
1618
1747
|
if (WRITE_OPS.has(ctx.op)) {
|
|
1619
|
-
const data = readRecord(ctx.data);
|
|
1748
|
+
const data = readRecord$1(ctx.data);
|
|
1620
1749
|
const fieldPresent = ctx.op === 'create' || ctx.op === 'upsertOne' || (data != null && 'intervalStates' in data);
|
|
1621
1750
|
if (data && fieldPresent) {
|
|
1622
1751
|
const resolved = resolveMaintenanceIntervalStates(data['intervalStates']);
|
|
@@ -1634,7 +1763,7 @@ const maintenancePlanCreateWorkOrderMiddleware = {
|
|
|
1634
1763
|
await next();
|
|
1635
1764
|
if (ctx.op !== 'create') {
|
|
1636
1765
|
if (ctx.op === 'getOne') {
|
|
1637
|
-
const record = readRecord(ctx.result);
|
|
1766
|
+
const record = readRecord$1(ctx.result);
|
|
1638
1767
|
if (record) {
|
|
1639
1768
|
assignIntervalStates(record);
|
|
1640
1769
|
}
|
|
@@ -1647,7 +1776,7 @@ const maintenancePlanCreateWorkOrderMiddleware = {
|
|
|
1647
1776
|
: null;
|
|
1648
1777
|
if (items) {
|
|
1649
1778
|
for (const item of items) {
|
|
1650
|
-
const record = readRecord(item);
|
|
1779
|
+
const record = readRecord$1(item);
|
|
1651
1780
|
if (record) {
|
|
1652
1781
|
assignIntervalStates(record);
|
|
1653
1782
|
}
|
|
@@ -1686,6 +1815,71 @@ const maintenancePlanCreateWorkOrderMiddleware = {
|
|
|
1686
1815
|
};
|
|
1687
1816
|
//#endregion
|
|
1688
1817
|
|
|
1818
|
+
//#region ---- Imports ----
|
|
1819
|
+
//#endregion
|
|
1820
|
+
//#region ---- Constants ----
|
|
1821
|
+
const PLAN_ENTITY = `${RootConfig.module.name}.${RootConfig.entities.maintenancePlan.name}`;
|
|
1822
|
+
//#endregion
|
|
1823
|
+
//#region ---- Helpers ----
|
|
1824
|
+
function readRecord(value) {
|
|
1825
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) {
|
|
1826
|
+
return null;
|
|
1827
|
+
}
|
|
1828
|
+
return value;
|
|
1829
|
+
}
|
|
1830
|
+
//#endregion
|
|
1831
|
+
//#region ---- Middleware ----
|
|
1832
|
+
/**
|
|
1833
|
+
* Keeps the Scheduling Widget (`schedule`) and the interval-config calendar trigger aligned.
|
|
1834
|
+
* Writes push the widget value into intervalConfig. Reads hydrate `schedule` from older rows.
|
|
1835
|
+
*/
|
|
1836
|
+
const maintenancePlanScheduleMiddleware = {
|
|
1837
|
+
target: {
|
|
1838
|
+
ops: ['create', 'update', 'upsertOne', 'getOne', 'getAll', 'query', 'queryAll', 'getMany'],
|
|
1839
|
+
entity: PLAN_ENTITY,
|
|
1840
|
+
order: 90,
|
|
1841
|
+
},
|
|
1842
|
+
execute: async (ctx, next) => {
|
|
1843
|
+
if (ctx.entityName !== PLAN_ENTITY) {
|
|
1844
|
+
await next();
|
|
1845
|
+
return;
|
|
1846
|
+
}
|
|
1847
|
+
const isWrite = ctx.op === 'create' || ctx.op === 'update' || ctx.op === 'upsertOne';
|
|
1848
|
+
if (isWrite) {
|
|
1849
|
+
const data = readRecord(ctx.data);
|
|
1850
|
+
if (data) {
|
|
1851
|
+
syncMaintenancePlanScheduleFields(data);
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
await next();
|
|
1855
|
+
if (isWrite) {
|
|
1856
|
+
return;
|
|
1857
|
+
}
|
|
1858
|
+
if (ctx.op === 'getOne') {
|
|
1859
|
+
const record = readRecord(ctx.result);
|
|
1860
|
+
if (record) {
|
|
1861
|
+
syncMaintenancePlanScheduleFields(record);
|
|
1862
|
+
}
|
|
1863
|
+
return;
|
|
1864
|
+
}
|
|
1865
|
+
const items = Array.isArray(ctx.result)
|
|
1866
|
+
? ctx.result
|
|
1867
|
+
: Array.isArray(ctx.result?.items)
|
|
1868
|
+
? ctx.result.items
|
|
1869
|
+
: null;
|
|
1870
|
+
if (!items) {
|
|
1871
|
+
return;
|
|
1872
|
+
}
|
|
1873
|
+
for (const item of items) {
|
|
1874
|
+
const record = readRecord(item);
|
|
1875
|
+
if (record) {
|
|
1876
|
+
syncMaintenancePlanScheduleFields(record);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
},
|
|
1880
|
+
};
|
|
1881
|
+
//#endregion
|
|
1882
|
+
|
|
1689
1883
|
//#region ---- Constants ----
|
|
1690
1884
|
/** Answer keys pre-filled from asset.code (readonly in viewer). */
|
|
1691
1885
|
const WORK_ORDER_CHECKLIST_ASSET_CODE_KEYS = [
|
|
@@ -2213,9 +2407,6 @@ class AXMMaintenanceManagementWorkOrderExpressionEvaluatorScopeProvider {
|
|
|
2213
2407
|
},
|
|
2214
2408
|
needShutdown: template.needShutdown ?? false,
|
|
2215
2409
|
needPermission: template.needPermission ?? false,
|
|
2216
|
-
estimatedHours: typeof template.estimatedMinutes === 'number' && template.estimatedMinutes > 0
|
|
2217
|
-
? Math.round((template.estimatedMinutes / 60) * 100) / 100
|
|
2218
|
-
: undefined,
|
|
2219
2410
|
sourceType: AXMWorkOrderSourceType.Manual,
|
|
2220
2411
|
autoGeneratedWorkOrder: false,
|
|
2221
2412
|
},
|
|
@@ -2283,13 +2474,13 @@ const AXMMaintenanceIntervalWidget = {
|
|
|
2283
2474
|
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY],
|
|
2284
2475
|
components: {
|
|
2285
2476
|
view: {
|
|
2286
|
-
component: () => import('./acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-
|
|
2477
|
+
component: () => import('./acorex-platform-module-maintenance-management-client-maintenance-interval-widget-view.component-rqJ6-Akn.mjs').then((c) => c.AXMMaintenanceIntervalWidgetViewComponent),
|
|
2287
2478
|
},
|
|
2288
2479
|
edit: {
|
|
2289
|
-
component: () => import('./acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-
|
|
2480
|
+
component: () => import('./acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-B9iKWu8M.mjs').then((c) => c.AXMMaintenanceIntervalWidgetEditComponent),
|
|
2290
2481
|
},
|
|
2291
2482
|
designer: {
|
|
2292
|
-
component: () => import('./acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-
|
|
2483
|
+
component: () => import('./acorex-platform-module-maintenance-management-client-maintenance-interval-widget-edit.component-B9iKWu8M.mjs').then((c) => c.AXMMaintenanceIntervalWidgetEditComponent),
|
|
2293
2484
|
},
|
|
2294
2485
|
},
|
|
2295
2486
|
};
|
|
@@ -2322,7 +2513,7 @@ const AXMWorkOrderWorkflowColumnWidget = {
|
|
|
2322
2513
|
properties: [],
|
|
2323
2514
|
components: {
|
|
2324
2515
|
column: {
|
|
2325
|
-
component: () => import('./acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-
|
|
2516
|
+
component: () => import('./acorex-platform-module-maintenance-management-client-work-order-workflow-column.component-mIGUGdJu.mjs').then((c) => c.AXMWorkOrderWorkflowColumnComponent),
|
|
2326
2517
|
},
|
|
2327
2518
|
},
|
|
2328
2519
|
};
|
|
@@ -2457,11 +2648,11 @@ class AXMMaintenanceManagementModule {
|
|
|
2457
2648
|
},
|
|
2458
2649
|
{
|
|
2459
2650
|
key: AXMMaintenanceManagementCommandKeys.WorkOrder.StartFlow,
|
|
2460
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-start-work-order-flow.command-
|
|
2651
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-start-work-order-flow.command-DkmKMqQG.mjs').then((c) => c.StartWorkOrderFlowCommand),
|
|
2461
2652
|
},
|
|
2462
2653
|
{
|
|
2463
2654
|
key: AXMMaintenanceManagementCommandKeys.WorkOrder.OpenForm,
|
|
2464
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-
|
|
2655
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-OiuiXtcL.mjs').then((c) => c.OpenWorkOrderChecklistFormCommand),
|
|
2465
2656
|
},
|
|
2466
2657
|
{
|
|
2467
2658
|
key: AXMMaintenanceManagementCommandKeys.WorkOrder.SignOff,
|
|
@@ -2477,11 +2668,11 @@ class AXMMaintenanceManagementModule {
|
|
|
2477
2668
|
},
|
|
2478
2669
|
{
|
|
2479
2670
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.CreateOrGetWorkReportDraft,
|
|
2480
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-
|
|
2671
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-BxgkvooP.mjs').then((c) => c.CreateOrGetWorkReportDraftActivity),
|
|
2481
2672
|
},
|
|
2482
2673
|
{
|
|
2483
2674
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.UpdateWorkOrderInProgress,
|
|
2484
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-
|
|
2675
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CxxKTuKm.mjs').then((c) => c.UpdateWorkOrderInProgressActivity),
|
|
2485
2676
|
},
|
|
2486
2677
|
{
|
|
2487
2678
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.ValidateWorkOrderCompletion,
|
|
@@ -2493,7 +2684,7 @@ class AXMMaintenanceManagementModule {
|
|
|
2493
2684
|
},
|
|
2494
2685
|
{
|
|
2495
2686
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.RecordWorkReportAssessment,
|
|
2496
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-
|
|
2687
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-DsfKKMGg.mjs').then((c) => c.RecordWorkReportAssessmentActivity),
|
|
2497
2688
|
},
|
|
2498
2689
|
{
|
|
2499
2690
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.UpdateWorkOrderCompleted,
|
|
@@ -2523,6 +2714,11 @@ class AXMMaintenanceManagementModule {
|
|
|
2523
2714
|
useValue: maintenancePlanCreateWorkOrderMiddleware,
|
|
2524
2715
|
multi: true,
|
|
2525
2716
|
},
|
|
2717
|
+
{
|
|
2718
|
+
provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
|
|
2719
|
+
useValue: maintenancePlanScheduleMiddleware,
|
|
2720
|
+
multi: true,
|
|
2721
|
+
},
|
|
2526
2722
|
{
|
|
2527
2723
|
provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
|
|
2528
2724
|
useValue: workOrderSourceTypeMiddleware,
|
|
@@ -2588,11 +2784,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
2588
2784
|
},
|
|
2589
2785
|
{
|
|
2590
2786
|
key: AXMMaintenanceManagementCommandKeys.WorkOrder.StartFlow,
|
|
2591
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-start-work-order-flow.command-
|
|
2787
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-start-work-order-flow.command-DkmKMqQG.mjs').then((c) => c.StartWorkOrderFlowCommand),
|
|
2592
2788
|
},
|
|
2593
2789
|
{
|
|
2594
2790
|
key: AXMMaintenanceManagementCommandKeys.WorkOrder.OpenForm,
|
|
2595
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-
|
|
2791
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-open-work-order-checklist-form.command-OiuiXtcL.mjs').then((c) => c.OpenWorkOrderChecklistFormCommand),
|
|
2596
2792
|
},
|
|
2597
2793
|
{
|
|
2598
2794
|
key: AXMMaintenanceManagementCommandKeys.WorkOrder.SignOff,
|
|
@@ -2608,11 +2804,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
2608
2804
|
},
|
|
2609
2805
|
{
|
|
2610
2806
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.CreateOrGetWorkReportDraft,
|
|
2611
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-
|
|
2807
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-create-or-get-work-report-draft.activity-BxgkvooP.mjs').then((c) => c.CreateOrGetWorkReportDraftActivity),
|
|
2612
2808
|
},
|
|
2613
2809
|
{
|
|
2614
2810
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.UpdateWorkOrderInProgress,
|
|
2615
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-
|
|
2811
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-update-work-order-in-progress.activity-CxxKTuKm.mjs').then((c) => c.UpdateWorkOrderInProgressActivity),
|
|
2616
2812
|
},
|
|
2617
2813
|
{
|
|
2618
2814
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.ValidateWorkOrderCompletion,
|
|
@@ -2624,7 +2820,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
2624
2820
|
},
|
|
2625
2821
|
{
|
|
2626
2822
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.RecordWorkReportAssessment,
|
|
2627
|
-
command: () => import('./acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-
|
|
2823
|
+
command: () => import('./acorex-platform-module-maintenance-management-client-record-work-report-assessment.activity-DsfKKMGg.mjs').then((c) => c.RecordWorkReportAssessmentActivity),
|
|
2628
2824
|
},
|
|
2629
2825
|
{
|
|
2630
2826
|
key: AXMMaintenanceManagementCommandKeys.WorkflowActivity.UpdateWorkOrderCompleted,
|
|
@@ -2654,6 +2850,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
2654
2850
|
useValue: maintenancePlanCreateWorkOrderMiddleware,
|
|
2655
2851
|
multi: true,
|
|
2656
2852
|
},
|
|
2853
|
+
{
|
|
2854
|
+
provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
|
|
2855
|
+
useValue: maintenancePlanScheduleMiddleware,
|
|
2856
|
+
multi: true,
|
|
2857
|
+
},
|
|
2657
2858
|
{
|
|
2658
2859
|
provide: AXP_ENTITY_STORAGE_MIDDLEWARE,
|
|
2659
2860
|
useValue: workOrderSourceTypeMiddleware,
|
|
@@ -3347,4 +3548,4 @@ const workOrderExecutionWorkflowDefinition = createWorkOrderExecutionWorkflowDef
|
|
|
3347
3548
|
*/
|
|
3348
3549
|
|
|
3349
3550
|
export { AXM_WORK_ORDER_WORKFLOW_DEBUG_NAMESPACE as A, WORK_ORDER_CHECKLIST_ASSET_PREFILL_KEYS as W, AXMMaintenanceIntervalComponent as a, AXMMaintenanceManagementMenuProvider as b, AXMMaintenanceManagementModule as c, AXMMaintenanceManagementPermissionDefinitionProvider as d, AXMMaintenanceManagementSearchCommandProvider as e, createWorkOrderExecutionWorkflowDefinition as f, workOrderExecutionWorkflowName as g, queryWorkflowTemplatesForAsset as q, resolveDisplayLabel as r, workOrderExecutionWorkflowDefinition as w };
|
|
3350
|
-
//# sourceMappingURL=acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-
|
|
3551
|
+
//# sourceMappingURL=acorex-platform-module-maintenance-management-client-acorex-platform-module-maintenance-management-client-gjOUE5Ou.mjs.map
|