@acorex-platform/module-organization-management-client 0.0.33 → 0.0.38
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-organization-management-client-acorex-platform-module-organization-management-client-UGWNdPxI.mjs → acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-ZM6X7IDO.mjs} +11 -11
- package/fesm2022/{acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-UGWNdPxI.mjs.map → acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-ZM6X7IDO.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-add-business-unit-to-business-unit.command-CA2uZQyC.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-add-position-to-business-unit.command-F7jD3jKs.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-add-team-to-business-unit.command-BLQFjhS5.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-business-unit-type.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-business-unit.mjs +3 -3
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-business-unit.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-chart.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-company.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-job-definition.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-job-level.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-position.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-responsibility-level.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-responsibility.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-team-business-unit.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-team-member-role.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-team-member.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entities-team.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-acorex-platform-module-organization-management-client-contracts-entity-catalog-xL4H41ft.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-acorex-platform-module-organization-management-client-contracts-entity-catalog-vMiwmkDK.mjs} +14 -14
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-acorex-platform-module-organization-management-client-contracts-entity-catalog-xL4H41ft.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-acorex-platform-module-organization-management-client-contracts-entity-catalog-vMiwmkDK.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit-type.entity-BE6ZOUYI.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit-type.entity-BmhCZeXd.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit-type.entity-BE6ZOUYI.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit-type.entity-BmhCZeXd.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit.entity-CzApxGMJ.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit.entity-CIPmfbsM.mjs} +5 -5
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit.entity-CIPmfbsM.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-chart.entity-BWocZ2iP.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-chart.entity-sg_rI9It.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-chart.entity-BWocZ2iP.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-chart.entity-sg_rI9It.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-company.entity-tU-53b9G.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-company.entity-BSDO_7eL.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-company.entity-tU-53b9G.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-company.entity-BSDO_7eL.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-job-definition.entity-sOUJWK_4.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-job-definition.entity-0W6OSQH-.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-job-definition.entity-sOUJWK_4.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-job-definition.entity-0W6OSQH-.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-job-level.entity-C866Av4K.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-job-level.entity-DbMjRbn9.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-job-level.entity-C866Av4K.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-job-level.entity-DbMjRbn9.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-position.entity-DI5SQJdb.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-position.entity-BkauiyPn.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-position.entity-DI5SQJdb.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-position.entity-BkauiyPn.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility-level.entity-DHyK2SPK.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility-level.entity-BagFwJmO.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility-level.entity-DHyK2SPK.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility-level.entity-BagFwJmO.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility.entity-B3UAoNc6.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility.entity-DHhT7rSq.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility.entity-B3UAoNc6.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-responsibility.entity-DHhT7rSq.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team-business-unit.entity-CCSV3xtX.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-team-business-unit.entity-hkCAl8so.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team-business-unit.entity-CCSV3xtX.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-team-business-unit.entity-hkCAl8so.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member-role.entity-vnO44D26.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member-role.entity-BeGE4JUl.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member-role.entity-vnO44D26.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member-role.entity-BeGE4JUl.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member.entity-j7Zu11Fo.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member.entity-10nYBrN4.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member.entity-j7Zu11Fo.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-team-member.entity-10nYBrN4.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team.entity-BBdUYFU0.mjs → acorex-platform-module-organization-management-client-contracts-entity-catalog-team.entity-Bygn5B_k.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-contracts-entity-catalog-team.entity-BBdUYFU0.mjs.map → acorex-platform-module-organization-management-client-contracts-entity-catalog-team.entity-Bygn5B_k.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-contracts.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-feature-definition.provider-BQKtvXOM.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-generate-org-chart.command-DJnFJKuo.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-CGRJXMOn.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-job-definition-pages-component.provider-TIHOAeAI.mjs → acorex-platform-module-organization-management-client-job-definition-pages-component.provider-XH_rXGwz.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-job-definition-pages-component.provider-TIHOAeAI.mjs.map → acorex-platform-module-organization-management-client-job-definition-pages-component.provider-XH_rXGwz.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-KwOQXdX0.mjs → acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-CpirrInU.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-KwOQXdX0.mjs.map → acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-CpirrInU.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-skills-page.component-bQOqP1Tx.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-local-entities.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-default-node-contribution.provider-BQ0ihb43.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-DZs4VB50.mjs → acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-ZnMtkQSg.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-DZs4VB50.mjs.map → acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-ZnMtkQSg.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-position-employee-node-contribution.provider-BTicXn9n.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-ISEbvMkZ.mjs → acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-uZkFZFPA.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-ISEbvMkZ.mjs.map → acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-uZkFZFPA.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-org-chart.page-CMd5nTa7.mjs → acorex-platform-module-organization-management-client-org-chart.page-BhXvP2qN.mjs} +7 -7
- package/fesm2022/{acorex-platform-module-organization-management-client-org-chart.page-CMd5nTa7.mjs.map → acorex-platform-module-organization-management-client-org-chart.page-BhXvP2qN.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-permission-definition.provider-CiCdTBGo.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-remove-position-from-business-unit.command-BFQVTpfy.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-replace-position-assignee.command-CSgERqLG.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-column.component-C5H0kcVW.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DmDQSgYC.mjs → acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-m4S5GRko.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DmDQSgYC.mjs.map → acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-m4S5GRko.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs → acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-Cbua852d.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs.map → acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-Cbua852d.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs → acorex-platform-module-organization-management-client-responsibilities-matrix.component-Cpgdxtw-.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs.map → acorex-platform-module-organization-management-client-responsibilities-matrix.component-Cpgdxtw-.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client-settings.provider-B3nDm32f.mjs.map +1 -1
- package/fesm2022/acorex-platform-module-organization-management-client.mjs +1 -1
- package/package.json +2 -2
- package/types/acorex-platform-module-organization-management-client-contracts.d.ts +2 -2
- package/fesm2022/acorex-platform-module-organization-management-client-contracts-entity-catalog-business-unit.entity-CzApxGMJ.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-generate-org-chart.command-DJnFJKuo.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/commands/generate-org-chart.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXLoadingDialogService } from '@acorex/components/loading-dialog';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult,\n runtimeCommandPayloadData} from '@acorex-platform/framework-shared/core';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXMOrganizationManagementServerCommands,\n} from '@acorex-platform/module-organization-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\nimport type { OrgChartGenerateResult } from '../generation/org-chart.types';\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Defer showing progress until work exceeds this duration (fast runs avoid flicker). */\nconst LOADING_DIALOG_SHOW_THRESHOLD_MS = 500;\n\n/** Minimum time to keep the dialog visible after work completes once shown (smoother dismiss). */\nconst LOADING_DIALOG_CLOSE_DELAY_MS = 500;\n\n//#endregion\n\n//#region ---- Types ----\n\nexport type AXMGenerateOrgChartInput = {\n mode?: 'location' | 'structure' | 'reporting' | 'positionHierarchy';\n showVacantLeafSeats?: boolean;\n};\n\n//#endregion\n\n//#region ---- Client command ----\n\n/**\n * Client orchestration for org-chart generate: loading UI, then the distinct server command.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMGenerateOrgChartCommand\n implements AXPCommand<AXMGenerateOrgChartInput, OrgChartGenerateResult>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly loadingDialog = inject(AXLoadingDialogService);\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(_input?: AXMGenerateOrgChartInput): AXPCommandExecuteResultPromise<OrgChartGenerateResult> {\n const [loadingTitle, loadingDescription] = await Promise.all([\n this.translation.translateAsync('@organization-management:organization-chart.commands.generate.loading.title'),\n this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.loading.description',\n ),\n ]);\n\n let showTimer: ReturnType<typeof setTimeout> | undefined;\n let progressDialog: { close: () => void } | undefined;\n\n showTimer = setTimeout(() => {\n showTimer = undefined;\n progressDialog = this.loadingDialog.show({\n title: loadingTitle,\n mode: 'indeterminate',\n progressColor: 'primary',\n text: loadingDescription,\n });\n }, LOADING_DIALOG_SHOW_THRESHOLD_MS);\n\n try {\n const result = await this.commandService.execute<Record<string, never>, OrgChartGenerateResult>(\n AXMOrganizationManagementServerCommands.OrganizationChart.Generate,\n {},\n );\n\n const data = runtimeCommandPayloadData(result);\n if (!data) {\n const fallbackText = await this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.messages.failed',\n );\n return {\n success: false,\n message: { text: result?.message?.text ?? fallbackText },\n };\n }\n\n return { success: true, kind: 'object',\n data: data,\n message: {\n text: await this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.messages.success',\n ),\n },\n };\n } catch (error) {\n const fallbackText = await this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.messages.failed',\n );\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : fallbackText,\n },\n };\n } finally {\n if (showTimer !== undefined) {\n clearTimeout(showTimer);\n }\n if (progressDialog !== undefined) {\n const dlg = progressDialog;\n setTimeout(() => dlg.close(), LOADING_DIALOG_CLOSE_DELAY_MS);\n }\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAAA;AAcA;AAEA;AAEA;AACA,MAAM,gCAAgC,GAAG,GAAG;AAE5C;AACA,MAAM,6BAA6B,GAAG,GAAG;AAWzC;AAEA;AAEA;;AAEG;MAEU,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAC9C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA0E5D,IAAA;;;IApEC,MAAM,OAAO,CAAC,MAAiC,EAAA;QAC7C,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,GAAG,MAAM,OAAO,CAAC,G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M,IAAI,CAAC,WAAW,CAAC,cAAc,CACxD,+EAA+E,CAChF;YACD,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;AACd,gBAAA,OAAO,EAAE;AACP,oBAAA,IAAI,EAAE,KAAK,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,YAAY;AAC5D,iBAAA;aACF;QACH;gBAAU;AACR,YAAA,IAAI,SAAS,KAAK,SAAS,EAAE;gBAC3B,YAAY,CAAC,SAAS,CAAC;YACzB;AACA,YAAA,IAAI,cAAc,KAAK,SAAS,EAAE;gBAChC,MAAM,GAAG,GAAG,cAAc;gBAC1B,UAAU,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,6BAA6B,CAAC;YAC9D;QACF;IACF;8GA9EW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-generate-org-chart.command-DJnFJKuo.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/commands/generate-org-chart.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXLoadingDialogService } from '@acorex/components/loading-dialog';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult,\n runtimeCommandPayloadData} from '@acorex-platform/framework-shared/core';\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport {\n AXMOrganizationManagementServerCommands,\n} from '@acorex-platform/module-organization-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\nimport type { OrgChartGenerateResult } from '../generation/org-chart.types';\n\n//#endregion\n\n//#region ---- Constants ----\n\n/** Defer showing progress until work exceeds this duration (fast runs avoid flicker). */\nconst LOADING_DIALOG_SHOW_THRESHOLD_MS = 500;\n\n/** Minimum time to keep the dialog visible after work completes once shown (smoother dismiss). */\nconst LOADING_DIALOG_CLOSE_DELAY_MS = 500;\n\n//#endregion\n\n//#region ---- Types ----\n\nexport type AXMGenerateOrgChartInput = {\n mode?: 'location' | 'structure' | 'reporting' | 'positionHierarchy';\n showVacantLeafSeats?: boolean;\n};\n\n//#endregion\n\n//#region ---- Client command ----\n\n/**\n * Client orchestration for org-chart generate: loading UI, then the distinct server command.\n */\n@Injectable({ providedIn: 'root' })\nexport class AXMGenerateOrgChartCommand\n implements AXPCommand<AXMGenerateOrgChartInput, OrgChartGenerateResult>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly loadingDialog = inject(AXLoadingDialogService);\n private readonly commandService = inject(AXPCommandService);\n private readonly translation = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(_input?: AXMGenerateOrgChartInput): AXPCommandExecuteResultPromise<OrgChartGenerateResult> {\n const [loadingTitle, loadingDescription] = await Promise.all([\n this.translation.translateAsync('@organization-management:organization-chart.commands.generate.loading.title'),\n this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.loading.description',\n ),\n ]);\n\n let showTimer: ReturnType<typeof setTimeout> | undefined;\n let progressDialog: { close: () => void } | undefined;\n\n showTimer = setTimeout(() => {\n showTimer = undefined;\n progressDialog = this.loadingDialog.show({\n title: loadingTitle,\n mode: 'indeterminate',\n progressColor: 'primary',\n text: loadingDescription,\n });\n }, LOADING_DIALOG_SHOW_THRESHOLD_MS);\n\n try {\n const result = await this.commandService.execute<Record<string, never>, OrgChartGenerateResult>(\n AXMOrganizationManagementServerCommands.OrganizationChart.Generate,\n {},\n );\n\n const data = runtimeCommandPayloadData(result);\n if (!data) {\n const fallbackText = await this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.messages.failed',\n );\n return {\n success: false,\n message: { text: result?.message?.text ?? fallbackText },\n };\n }\n\n return { success: true, kind: 'object',\n data: data,\n message: {\n text: await this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.messages.success',\n ),\n },\n };\n } catch (error) {\n const fallbackText = await this.translation.translateAsync(\n '@organization-management:organization-chart.commands.generate.messages.failed',\n );\n return {\n success: false,\n message: {\n text: error instanceof Error ? error.message : fallbackText,\n },\n };\n } finally {\n if (showTimer !== undefined) {\n clearTimeout(showTimer);\n }\n if (progressDialog !== undefined) {\n const dlg = progressDialog;\n setTimeout(() => dlg.close(), LOADING_DIALOG_CLOSE_DELAY_MS);\n }\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAAA;AAcA;AAEA;AAEA;AACA,MAAM,gCAAgC,GAAG,GAAG;AAE5C;AACA,MAAM,6BAA6B,GAAG,GAAG;AAWzC;AAEA;AAEA;;AAEG;MAEU,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,sBAAsB,CAAC;AAC9C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AA0E5D,IAAA;;;IApEC,MAAM,OAAO,CAAC,MAAiC,EAAA;QAC7C,MAAM,CAAC,YAAY,EAAE,kBAAkB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;AAC3D,YAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,6EAA6E,CAAC;AAC9G,YAAA,IAAI,CAAC,WAAW,CAAC,cAAc,CAC7B,mFAAmF,CACpF;AACF,SA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,YAAY,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,YAAY;AAC5D,iBAAA;aACF;QACH;gBAAU;AACR,YAAA,IAAI,SAAS,KAAK,SAAS,EAAE;gBAC3B,YAAY,CAAC,SAAS,CAAC;YACzB;AACA,YAAA,IAAI,cAAc,KAAK,SAAS,EAAE;gBAChC,MAAM,GAAG,GAAG,cAAc;gBAC1B,UAAU,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE,6BAA6B,CAAC;YAC9D;QACF;IACF;8GA9EW,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA1B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,cADb,MAAM,EAAA,CAAA,CAAA;;2FACnB,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBADtC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-CGRJXMOn.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-matrix-page.utils.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSpreadsheetData, AXPSpreadsheetItem } from '@acorex-platform/framework-client/layout/components';\n\n//#endregion\n\n//#region ---- Job definition matrix page helpers ----\n\n/**\n * Overlays overview tab fields so matrix column headers track Required Job Levels while draft patches hold matrix data only.\n */\nexport function mergeJobDefinitionMatrixPageContext(\n root: Record<string, unknown>,\n local: Record<string, unknown> | null | undefined,\n): Record<string, unknown> {\n if (local == null) {\n return root;\n }\n\n return {\n ...local,\n jobLevelsList: root['jobLevelsList'],\n jobLevelIds: root['jobLevelIds'],\n };\n}\n\n/**\n * Builds column titles for responsibility/skill matrices from the joined `jobLevelsList` snapshot.\n */\nexport function jobLevelsToSpreadsheetTitles(\n jobLevels: unknown,\n i18n: AXTranslationService,\n): AXPSpreadsheetItem[] {\n if (!Array.isArray(jobLevels) || jobLevels.length === 0) {\n return [];\n }\n\n const resolve = (v: unknown) => i18n.resolve(v as never);\n\n return jobLevels.map((item: Record<string, unknown> | string) => {\n if (typeof item === 'string') {\n return { id: item, title: item };\n }\n const id = (item['id'] ?? item['value'] ?? String(item)) as string;\n const rawTitle = (item['title'] ?? item['name'] ?? String(item)) as string | Record<string, string>;\n const desc = item['description'];\n return {\n id,\n title: resolve(rawTitle) || String(rawTitle),\n description:\n desc != null && desc !== '' ? resolve(desc as string | Record<string, string>) : undefined,\n };\n });\n}\n\n/**\n * Collects unique cell values from a spreadsheet matrix (e.g. responsibility level ids).\n */\nexport function collectIdsFromSpreadsheetMatrix(matrix: AXPSpreadsheetData | null | undefined): string[] {\n const set = new Set<string>();\n if (!matrix || typeof matrix !== 'object') {\n return [];\n }\n\n for (const row of Object.values(matrix)) {\n if (row && typeof row === 'object') {\n for (const cell of Object.values(row as Record<string, unknown>)) {\n if (cell != null && typeof cell === 'string') {\n set.add(cell);\n }\n }\n }\n }\n\n return Array.from(set);\n}\n\n//#endregion\n"],"names":[],"mappings":"AAAA;AAKA;AAEA;AAEA;;AAEG;AACG,SAAU,mCAAmC,CACjD,IAA6B,EAC7B,KAAiD,EAAA;AAEjD,IAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,IAAI;IACb;IAEA,OAAO;AACL,QAAA,GAAG,KAAK;AACR,QAAA,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;AACpC,QAAA,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;KACjC;AACH;AAEA;;AAEG;AACG,SAAU,4BAA4B,CAC1C,SAAkB,EAClB,IAA0B,EAAA;AA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OAAO,GAAG,KAAK,QAAQ,EAAE;YAClC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,MAAM,CAAC,GAA8B,CAAC,EAAE;gBAChE,IAAI,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;AAC5C,oBAAA,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC;gBACf;YACF;QACF;IACF;AAEA,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;AACxB;AAEA
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-CGRJXMOn.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-matrix-page.utils.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSpreadsheetData, AXPSpreadsheetItem } from '@acorex-platform/framework-client/layout/components';\n\n//#endregion\n\n//#region ---- Job definition matrix page helpers ----\n\n/**\n * Overlays overview tab fields so matrix column headers track Required Job Levels while draft patches hold matrix data only.\n */\nexport function mergeJobDefinitionMatrixPageContext(\n root: Record<string, unknown>,\n local: Record<string, unknown> | null | undefined,\n): Record<string, unknown> {\n if (local == null) {\n return root;\n }\n\n return {\n ...local,\n jobLevelsList: root['jobLevelsList'],\n jobLevelIds: root['jobLevelIds'],\n };\n}\n\n/**\n * Builds column titles for responsibility/skill matrices from the joined `jobLevelsList` snapshot.\n */\nexport function jobLevelsToSpreadsheetTitles(\n jobLevels: unknown,\n i18n: AXTranslationService,\n): AXPSpreadsheetItem[] {\n if (!Array.isArray(jobLevels) || jobLevels.length === 0) {\n return [];\n }\n\n const resolve = (v: unknown) => i18n.resolve(v as never);\n\n return jobLevels.map((item: Record<string, unknown> | string) => {\n if (typeof item === 'string') {\n return { id: item, title: item };\n }\n const id = (item['id'] ?? item['value'] ?? String(item)) as string;\n const rawTitle = (item['title'] ?? item['name'] ?? String(item)) as string | Record<string, string>;\n const desc = item['description'];\n return {\n id,\n title: resolve(rawTitle) || String(rawTitle),\n description:\n desc != null && desc !== '' ? resolve(desc as string | Record<string, string>) : undefined,\n };\n });\n}\n\n/**\n * Collects unique cell values from a spreadsheet matrix (e.g. responsibility level ids).\n */\nexport function collectIdsFromSpreadsheetMatrix(matrix: AXPSpreadsheetData | null | undefined): string[] {\n const set = new Set<string>();\n if (!matrix || typeof matrix !== 'object') {\n return [];\n }\n\n for (const row of Object.values(matrix)) {\n if (row && typeof row === 'object') {\n for (const cell of Object.values(row as Record<string, unknown>)) {\n if (cell != null && typeof cell === 'string') {\n set.add(cell);\n }\n }\n }\n }\n\n return Array.from(set);\n}\n\n//#endregion\n"],"names":[],"mappings":"AAAA;AAKA;AAEA;AAEA;;AAEG;AACG,SAAU,mCAAmC,CACjD,IAA6B,EAC7B,KAAiD,EAAA;AAEjD,IAAA,IAAI,KAAK,IAAI,IAAI,EAAE;AACjB,QAAA,OAAO,IAAI;IACb;IAEA,OAAO;AACL,QAAA,GAAG,KAAK;AACR,QAAA,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;AACpC,QAAA,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;KACjC;AACH;AAEA;;AAEG;AACG,SAAU,4BAA4B,CAC1C,SAAkB,EAClB,IAA0B,EAAA;AAE1B,IAAA,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;AACvD,QAAA,OAAO,EAAE;IACX;AAEA,IAAA,MAAM,OAAO,GAAG,CAAC,CAAU,KAAK,IAAI,CAAC,OAAO,CAAC,CAAU,CAAC;AAExD,IAAA,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,IAAsC,KAAI;AAC9D,QAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC5B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;QAClC;AACA,QAAA,MAAM,EAAE,IAAI,IAA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IBILITIES_PAGE_COMPONENT_KEY,
|
|
12
|
-
loader: () => import('./acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-
|
|
12
|
+
loader: () => import('./acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-CpirrInU.mjs').then((m) => m.AXMJobDefinitionResponsibilitiesPageComponent),
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
key: JOB_DEFINITION_SKILLS_PAGE_COMPONENT_KEY,
|
|
@@ -25,4 +25,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
25
25
|
}] });
|
|
26
26
|
|
|
27
27
|
export { AXMJobDefinitionPagesComponentProvider };
|
|
28
|
-
//# sourceMappingURL=acorex-platform-module-organization-management-client-job-definition-pages-component.provider-
|
|
28
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-job-definition-pages-component.provider-XH_rXGwz.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-pages-component.provider-
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-pages-component.provider-XH_rXGwz.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-pages-component.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AXPPageComponentDefinition,\n AXPPageComponentProvider,\n} from '@acorex-platform/framework-client/layout/components';\nimport { Injectable } from '@angular/core';\nimport {\n JOB_DEFINITION_RESPONSIBILITIES_PAGE_COMPONENT_KEY,\n JOB_DEFINITION_SKILLS_PAGE_COMPONENT_KEY,\n} from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\n//#region ---- Job definition entity page components provider ----\n\n@Injectable()\nexport class AXMJobDefinitionPagesComponentProvider implements AXPPageComponentProvider {\n async components(): Promise<AXPPageComponentDefinition[]> {\n return [\n {\n key: JOB_DEFINITION_RESPONSIBILITIES_PAGE_COMPONENT_KEY,\n loader: () =>\n import('./job-definition-responsibilities-page.component').then(\n (m) => m.AXMJobDefinitionResponsibilitiesPageComponent,\n ),\n },\n {\n key: JOB_DEFINITION_SKILLS_PAGE_COMPONENT_KEY,\n loader: () =>\n import('./job-definition-skills-page.component').then((m) => m.AXMJobDefinitionSkillsPageComponent),\n },\n ];\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAYA;AAEA;MAGa,sCAAsC,CAAA;AACjD,IAAA,MAAM,UAAU,GAAA;QACd,OAAO;AACL,YAAA;AACE,gBAAA,GAAG,EAAE,kDAAkD;AACvD,gBAAA,MAAM,EAAE,MACN,OAAO,qHAAkD,CAAC,CAAC,IAAI,CAC7D,CAAC,CAAC,KAAK,CAAC,CAAC,6CAA6C,CACvD;AACJ,aAAA;AACD,YAAA;AACE,gBAAA,GAAG,EAAE,wCAAwC;AAC7C,gBAAA,MAAM,EAAE,MACN,OAAO,2GAAwC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,mCAAmC,CAAC;AACtG,aAAA;SACF;IACH;8GAhBW,sCAAsC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAtC,sCAAsC,EAAA,CAAA,CAAA;;2FAAtC,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBADlD;;;"}
|
|
@@ -6,7 +6,7 @@ import * as i0 from '@angular/core';
|
|
|
6
6
|
import { input, inject, signal, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
7
7
|
import { cloneDeep, isEqual } from 'lodash';
|
|
8
8
|
import { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';
|
|
9
|
-
import { A as AXMOrganizationManagementResponsibilitiesMatrixComponent } from './acorex-platform-module-organization-management-client-responsibilities-matrix.component-
|
|
9
|
+
import { A as AXMOrganizationManagementResponsibilitiesMatrixComponent } from './acorex-platform-module-organization-management-client-responsibilities-matrix.component-Cpgdxtw-.mjs';
|
|
10
10
|
import { m as mergeJobDefinitionMatrixPageContext, j as jobLevelsToSpreadsheetTitles, c as collectIdsFromSpreadsheetMatrix } from './acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-CGRJXMOn.mjs';
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
@@ -234,4 +234,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
234
234
|
}], ctorParameters: () => [], propDecorators: { rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }] } });
|
|
235
235
|
|
|
236
236
|
export { AXMJobDefinitionResponsibilitiesPageComponent };
|
|
237
|
-
//# sourceMappingURL=acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-
|
|
237
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-CpirrInU.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-KwOQXdX0.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-responsibilities-page.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPActionMenuItem, AXPExecuteCommand, AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityEventsKeys } from '@acorex-platform/framework-shared/entity';\n\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPSpreadsheetData } from '@acorex-platform/framework-client/layout/components';\nimport {\n AXPPageLayoutBase,\n AXPPageLayoutBaseComponent,\n} from '@acorex-platform/framework-client/layout/views';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXMOrganizationManagementJobDefinitionEntityModel } from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXMOrganizationManagementResponsibilitiesMatrixComponent } from '../responsibilities-matrix/responsibilities-matrix.component';\nimport type { AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n collectIdsFromSpreadsheetMatrix,\n jobLevelsToSpreadsheetTitles,\n mergeJobDefinitionMatrixPageContext,\n} from './job-definition-matrix-page.utils';\n\n//#endregion\n\nconst JOB_DEFINITION_RESPONSIBILITIES_PAGE_DISCARD = 'JobDefinition:Responsibilities:Discard';\nconst JOB_DEFINITION_RESPONSIBILITIES_SAVE = 'JobDefinition:Responsibilities:Save';\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-job-definition-responsibilities-page',\n standalone: true,\n imports: [AXMOrganizationManagementResponsibilitiesMatrixComponent],\n template: `\n <axm-responsibilities-matrix\n [titles]=\"titles()\"\n [value]=\"matrixValue()\"\n [readonly]=\"false\"\n (valueChange)=\"onMatrixChange($event)\"\n />\n `,\n host: {\n class: 'block w-full',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMJobDefinitionResponsibilitiesPageComponent,\n },\n ],\n})\nexport class AXMJobDefinitionResponsibilitiesPageComponent extends AXPPageLayoutBaseComponent {\n //#region ---- Inputs ----\n\n rootContext = input<Record<string, unknown>>();\n pageConfig = input<Record<string, unknown>>();\n\n //#endregion\n\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly eventService = inject(AXPBroadcastEventService);\n private readonly hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n\n //#endregion\n\n //#region ---- State ----\n\n private readonly localContext = signal<Record<string, unknown> | null>(null);\n private readonly ignoreNextMatrixChange = signal(false);\n private readonly baselineMatrix = signal<AXPSpreadsheetData | null>(null);\n protected readonly isDirty = signal(false);\n\n //#endregion\n\n //#region ---- Constructor ----\n\n constructor() {\n super();\n let previousRootId: unknown = undefined;\n\n effect(() => {\n const ctx = this.rootContext();\n const currentId = ctx != null && typeof ctx === 'object' ? ctx['id'] : undefined;\n if (currentId !== previousRootId) {\n previousRootId = currentId;\n this.localContext.set(null);\n const responsibilities = ctx?.['responsibilities'];\n const base =\n responsibilities != null && typeof responsibilities === 'object'\n ? cloneDeep(responsibilities as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n }\n });\n }\n\n //#endregion\n\n //#region ---- Computed ----\n\n /** Canonical payload for matrix bindings; must be a `computed` so `titles` / `matrixValue` track inputs. */\n private readonly mergedContext = computed(() =>\n mergeJobDefinitionMatrixPageContext(this.rootContext() ?? {}, this.localContext()),\n );\n\n protected titles = computed(() =>\n jobLevelsToSpreadsheetTitles(this.mergedContext()['jobLevelsList'], this.translateService),\n );\n\n protected matrixValue = computed((): AXPSpreadsheetData => {\n const v = this.mergedContext()['responsibilities'];\n if (v != null && typeof v === 'object') {\n return v as AXPSpreadsheetData;\n }\n return {};\n });\n\n //#endregion\n\n //#region ---- UI handlers ----\n\n protected onMatrixChange(data: AXPSpreadsheetData): void {\n if (this.ignoreNextMatrixChange()) {\n this.ignoreNextMatrixChange.set(false);\n return;\n }\n\n const base = this.localContext() ?? this.rootContext() ?? {};\n const responsibilityLevelIds = collectIdsFromSpreadsheetMatrix(data);\n this.localContext.set({\n ...base,\n responsibilities: data,\n responsibilityLevelIds,\n });\n const baseline = this.baselineMatrix() ?? {};\n this.isDirty.set(!isEqual(baseline, data));\n this.recompute();\n }\n\n //#endregion\n\n //#region ---- Unsaved Changes ----\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n //#endregion\n\n //#region ---- Page actions ----\n\n override async getPrimaryMenuItems(): Promise<AXPActionMenuItem[]> {\n const discardTitle =\n (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';\n\n const discardAction: AXPLayoutDetailsViewAction = {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_RESPONSIBILITIES_PAGE_DISCARD,\n options: {},\n },\n };\n const saveAction: AXPLayoutDetailsViewAction = {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_RESPONSIBILITIES_SAVE,\n options: {},\n },\n };\n\n return [discardAction, saveAction];\n }\n\n //#endregion\n\n //#region ---- Execute ----\n\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === JOB_DEFINITION_RESPONSIBILITIES_PAGE_DISCARD) {\n this.ignoreNextMatrixChange.set(true);\n this.localContext.set(null);\n const ctx = this.rootContext() ?? {};\n const responsibilities = ctx['responsibilities'];\n const base =\n responsibilities != null && typeof responsibilities === 'object'\n ? cloneDeep(responsibilities as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n this.recompute();\n return;\n }\n\n if (command.name !== JOB_DEFINITION_RESPONSIBILITIES_SAVE) {\n return;\n }\n\n return this.persistResponsibilities() as unknown as Promise<void>;\n }\n\n private async persistResponsibilities(): AXPCommandExecuteResultPromise {\n const ctx = this.mergedContext();\n const id = ctx['id'];\n if (typeof id !== 'string' || id.length === 0) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const responsibilities = (ctx['responsibilities'] as AXPSpreadsheetData) ?? {};\n const responsibilityLevelIds = collectIdsFromSpreadsheetMatrix(responsibilities);\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.jobDefinition.name)\n .data<string, AXMOrganizationManagementJobDefinitionEntityModel>()\n .update(id, {\n responsibilities,\n responsibilityLevelIds,\n });\n\n this.baselineMatrix.set(cloneDeep(responsibilities));\n this.localContext.set(null);\n this.isDirty.set(false);\n this.recompute();\n\n this.eventService.publish(AXPEntityEventsKeys.REFRESH_LAYOUT, {\n name: `${RootConfig.module.name}.${RootConfig.entities.jobDefinition.name}`,\n });\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const text =\n error instanceof Error && error.message\n ? error.message\n : (await this.translateService.translateAsync('@general:messages.entity.invalid-data')) ?? 'Save failed';\n return {\n success: false,\n message: { text },\n };\n }\n }\n\n //#endregion\n\n //#region ---- Recompute ----\n\n protected override recompute(): void {\n super.recompute();\n const layout = this.hostPageLayout as { recompute?: () => void } | null;\n layout?.recompute?.();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAyBA;AAEA,MAAM,4CAA4C,GAAG,wCAAwC;AAC7F,MAAM,oCAAoC,GAAG,qCAAqC;AAElF;AAyBM,MAAO,6CAA8C,SAAQ,0BAA0B,CAAA;;;AA2B3F,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAzBT,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAA2B;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK;kGAA2B;;;AAM5B,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAC/C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;;QAM9E,IAAA,CAAA,YAAY,GAAG,MAAM,CAAiC,IAAI;yFAAC;QAC3D,IAAA,CAAA,sBAAsB,GAAG,MAAM,CAAC,KAAK;mGAAC;QACtC,IAAA,CAAA,cAAc,GAAG,MAAM,CAA4B,IAAI;2FAAC;QACtD,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cAAA,EAAA,cAAA,EAAA,EAAA,SAAA,EAP7C;AACT,YAAA;AACE,gBAAA,OAAO,EAAE,iBAAiB;AAC1B,gBAAA,WAAW,EAAE,6CAA6C;AAC3D,aAAA;SACF,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAjBS;;;;;;;AAOT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EARS,wDAAwD,EAAA,QAAA,EAAA,6BAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,OAAA,EAAA,UAAA,EAAA,mBAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,YAAA,EAAA,yBAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAoBvD,6CAA6C,EAAA,UAAA,EAAA,CAAA;kBAvBzD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,0CAA0C;AACpD,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,wDAAwD,CAAC;AACnE,oBAAA,QAAQ,EAAE;;;;;;;AAOT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,cAAc;AACtB,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,6CAA+C;AAC3D,yBAAA;AACF,qBAAA;AACF,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-CpirrInU.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-responsibilities-page.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPActionMenuItem, AXPExecuteCommand, AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityEventsKeys } from '@acorex-platform/framework-shared/entity';\n\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPSpreadsheetData } from '@acorex-platform/framework-client/layout/components';\nimport {\n AXPPageLayoutBase,\n AXPPageLayoutBaseComponent,\n} from '@acorex-platform/framework-client/layout/views';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXMOrganizationManagementJobDefinitionEntityModel } from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXMOrganizationManagementResponsibilitiesMatrixComponent } from '../responsibilities-matrix/responsibilities-matrix.component';\nimport type { AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n collectIdsFromSpreadsheetMatrix,\n jobLevelsToSpreadsheetTitles,\n mergeJobDefinitionMatrixPageContext,\n} from './job-definition-matrix-page.utils';\n\n//#endregion\n\nconst JOB_DEFINITION_RESPONSIBILITIES_PAGE_DISCARD = 'JobDefinition:Responsibilities:Discard';\nconst JOB_DEFINITION_RESPONSIBILITIES_SAVE = 'JobDefinition:Responsibilities:Save';\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-job-definition-responsibilities-page',\n standalone: true,\n imports: [AXMOrganizationManagementResponsibilitiesMatrixComponent],\n template: `\n <axm-responsibilities-matrix\n [titles]=\"titles()\"\n [value]=\"matrixValue()\"\n [readonly]=\"false\"\n (valueChange)=\"onMatrixChange($event)\"\n />\n `,\n host: {\n class: 'block w-full',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMJobDefinitionResponsibilitiesPageComponent,\n },\n ],\n})\nexport class AXMJobDefinitionResponsibilitiesPageComponent extends AXPPageLayoutBaseComponent {\n //#region ---- Inputs ----\n\n rootContext = input<Record<string, unknown>>();\n pageConfig = input<Record<string, unknown>>();\n\n //#endregion\n\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly eventService = inject(AXPBroadcastEventService);\n private readonly hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n\n //#endregion\n\n //#region ---- State ----\n\n private readonly localContext = signal<Record<string, unknown> | null>(null);\n private readonly ignoreNextMatrixChange = signal(false);\n private readonly baselineMatrix = signal<AXPSpreadsheetData | null>(null);\n protected readonly isDirty = signal(false);\n\n //#endregion\n\n //#region ---- Constructor ----\n\n constructor() {\n super();\n let previousRootId: unknown = undefined;\n\n effect(() => {\n const ctx = this.rootContext();\n const currentId = ctx != null && typeof ctx === 'object' ? ctx['id'] : undefined;\n if (currentId !== previousRootId) {\n previousRootId = currentId;\n this.localContext.set(null);\n const responsibilities = ctx?.['responsibilities'];\n const base =\n responsibilities != null && typeof responsibilities === 'object'\n ? cloneDeep(responsibilities as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n }\n });\n }\n\n //#endregion\n\n //#region ---- Computed ----\n\n /** Canonical payload for matrix bindings; must be a `computed` so `titles` / `matrixValue` track inputs. */\n private readonly mergedContext = computed(() =>\n mergeJobDefinitionMatrixPageContext(this.rootContext() ?? {}, this.localContext()),\n );\n\n protected titles = computed(() =>\n jobLevelsToSpreadsheetTitles(this.mergedContext()['jobLevelsList'], this.translateService),\n );\n\n protected matrixValue = computed((): AXPSpreadsheetData => {\n const v = this.mergedContext()['responsibilities'];\n if (v != null && typeof v === 'object') {\n return v as AXPSpreadsheetData;\n }\n return {};\n });\n\n //#endregion\n\n //#region ---- UI handlers ----\n\n protected onMatrixChange(data: AXPSpreadsheetData): void {\n if (this.ignoreNextMatrixChange()) {\n this.ignoreNextMatrixChange.set(false);\n return;\n }\n\n const base = this.localContext() ?? this.rootContext() ?? {};\n const responsibilityLevelIds = collectIdsFromSpreadsheetMatrix(data);\n this.localContext.set({\n ...base,\n responsibilities: data,\n responsibilityLevelIds,\n });\n const baseline = this.baselineMatrix() ?? {};\n this.isDirty.set(!isEqual(baseline, data));\n this.recompute();\n }\n\n //#endregion\n\n //#region ---- Unsaved Changes ----\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n //#endregion\n\n //#region ---- Page actions ----\n\n override async getPrimaryMenuItems(): Promise<AXPActionMenuItem[]> {\n const discardTitle =\n (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';\n\n const discardAction: AXPLayoutDetailsViewAction = {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_RESPONSIBILITIES_PAGE_DISCARD,\n options: {},\n },\n };\n const saveAction: AXPLayoutDetailsViewAction = {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_RESPONSIBILITIES_SAVE,\n options: {},\n },\n };\n\n return [discardAction, saveAction];\n }\n\n //#endregion\n\n //#region ---- Execute ----\n\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === JOB_DEFINITION_RESPONSIBILITIES_PAGE_DISCARD) {\n this.ignoreNextMatrixChange.set(true);\n this.localContext.set(null);\n const ctx = this.rootContext() ?? {};\n const responsibilities = ctx['responsibilities'];\n const base =\n responsibilities != null && typeof responsibilities === 'object'\n ? cloneDeep(responsibilities as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n this.recompute();\n return;\n }\n\n if (command.name !== JOB_DEFINITION_RESPONSIBILITIES_SAVE) {\n return;\n }\n\n return this.persistResponsibilities() as unknown as Promise<void>;\n }\n\n private async persistResponsibilities(): AXPCommandExecuteResultPromise {\n const ctx = this.mergedContext();\n const id = ctx['id'];\n if (typeof id !== 'string' || id.length === 0) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const responsibilities = (ctx['responsibilities'] as AXPSpreadsheetData) ?? {};\n const responsibilityLevelIds = collectIdsFromSpreadsheetMatrix(responsibilities);\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.jobDefinition.name)\n .data<string, AXMOrganizationManagementJobDefinitionEntityModel>()\n .update(id, {\n responsibilities,\n responsibilityLevelIds,\n });\n\n this.baselineMatrix.set(cloneDeep(responsibilities));\n this.localContext.set(null);\n this.isDirty.set(false);\n this.recompute();\n\n this.eventService.publish(AXPEntityEventsKeys.REFRESH_LAYOUT, {\n name: `${RootConfig.module.name}.${RootConfig.entities.jobDefinition.name}`,\n });\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const text =\n error instanceof Error && error.message\n ? error.message\n : (await this.translateService.translateAsync('@general:messages.entity.invalid-data')) ?? 'Save failed';\n return {\n success: false,\n message: { text },\n };\n }\n }\n\n //#endregion\n\n //#region ---- Recompute ----\n\n protected override recompute(): void {\n super.recompute();\n const layout = this.hostPageLayout as { recompute?: () => void } | null;\n layout?.recompute?.();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAyBA;AAEA,MAAM,4CAA4C,GAAG,wCAAwC;AAC7F,MAAM,oCAAoC,GAAG,qCAAqC;AAElF;AAyBM,MAAO,6CAA8C,SAAQ,0BAA0B,CAAA;;;AA2B3F,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAzBT,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAA2B;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK;kGAA2B;;;A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OT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,cAAc;AACtB,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,6CAA+C;AAC3D,yBAAA;AACF,qBAAA;AACF,iBAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-skills-page.component-bQOqP1Tx.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-skills-page.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPActionMenuItem, AXPExecuteCommand, AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityEventsKeys } from '@acorex-platform/framework-shared/entity';\n\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport { AXMLearningManagementSkillMatrixComponent } from '@acorex-platform/module-learning-management-client';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPSpreadsheetData } from '@acorex-platform/framework-client/layout/components';\nimport {\n AXPPageLayoutBase,\n AXPPageLayoutBaseComponent,\n} from '@acorex-platform/framework-client/layout/views';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXMOrganizationManagementJobDefinitionEntityModel } from '@acorex-platform/module-organization-management-client/contracts';\nimport { jobLevelsToSpreadsheetTitles, mergeJobDefinitionMatrixPageContext } from './job-definition-matrix-page.utils';\nimport type { AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\n//#endregion\n\nconst JOB_DEFINITION_SKILLS_PAGE_DISCARD = 'JobDefinition:Skills:Discard';\nconst JOB_DEFINITION_SKILLS_SAVE = 'JobDefinition:Skills:Save';\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-job-definition-skills-page',\n standalone: true,\n imports: [AXMLearningManagementSkillMatrixComponent],\n template: `\n <axm-skill-matrix\n [titles]=\"titles()\"\n [value]=\"matrixValue()\"\n [readonly]=\"false\"\n (valueChange)=\"onMatrixChange($event)\"\n />\n `,\n host: {\n class: 'block w-full',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMJobDefinitionSkillsPageComponent,\n },\n ],\n})\nexport class AXMJobDefinitionSkillsPageComponent extends AXPPageLayoutBaseComponent {\n //#region ---- Inputs ----\n\n rootContext = input<Record<string, unknown>>();\n pageConfig = input<Record<string, unknown>>();\n\n //#endregion\n\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly eventService = inject(AXPBroadcastEventService);\n private readonly hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n\n //#endregion\n\n //#region ---- State ----\n\n private readonly localContext = signal<Record<string, unknown> | null>(null);\n private readonly ignoreNextMatrixChange = signal(false);\n private readonly baselineMatrix = signal<AXPSpreadsheetData | null>(null);\n protected readonly isDirty = signal(false);\n\n //#endregion\n\n //#region ---- Constructor ----\n\n constructor() {\n super();\n let previousRootId: unknown = undefined;\n\n effect(() => {\n const ctx = this.rootContext();\n const currentId = ctx != null && typeof ctx === 'object' ? ctx['id'] : undefined;\n if (currentId !== previousRootId) {\n previousRootId = currentId;\n this.localContext.set(null);\n const skillRequirements = ctx?.['skillRequirements'];\n const base =\n skillRequirements != null && typeof skillRequirements === 'object'\n ? cloneDeep(skillRequirements as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n }\n });\n }\n\n //#endregion\n\n //#region ---- Computed ----\n\n /** Canonical payload for matrix bindings; must be a `computed` so `titles` / `matrixValue` track inputs. */\n private readonly mergedContext = computed(() =>\n mergeJobDefinitionMatrixPageContext(this.rootContext() ?? {}, this.localContext()),\n );\n\n protected titles = computed(() =>\n jobLevelsToSpreadsheetTitles(this.mergedContext()['jobLevelsList'], this.translateService),\n );\n\n protected matrixValue = computed((): AXPSpreadsheetData => {\n const v = this.mergedContext()['skillRequirements'];\n if (v != null && typeof v === 'object') {\n return v as AXPSpreadsheetData;\n }\n return {};\n });\n\n //#endregion\n\n //#region ---- UI handlers ----\n\n protected onMatrixChange(data: AXPSpreadsheetData): void {\n if (this.ignoreNextMatrixChange()) {\n this.ignoreNextMatrixChange.set(false);\n return;\n }\n\n const base = this.localContext() ?? this.rootContext() ?? {};\n this.localContext.set({\n ...base,\n skillRequirements: data,\n });\n const baseline = this.baselineMatrix() ?? {};\n this.isDirty.set(!isEqual(baseline, data));\n this.recompute();\n }\n\n //#endregion\n\n //#region ---- Unsaved Changes ----\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n //#endregion\n\n //#region ---- Page actions ----\n\n override async getPrimaryMenuItems(): Promise<AXPActionMenuItem[]> {\n const discardTitle =\n (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';\n\n const discardAction: AXPLayoutDetailsViewAction = {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_SKILLS_PAGE_DISCARD,\n options: {},\n },\n };\n const saveAction: AXPLayoutDetailsViewAction = {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_SKILLS_SAVE,\n options: {},\n },\n };\n\n return [discardAction, saveAction];\n }\n\n //#endregion\n\n //#region ---- Execute ----\n\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === JOB_DEFINITION_SKILLS_PAGE_DISCARD) {\n this.ignoreNextMatrixChange.set(true);\n this.localContext.set(null);\n const ctx = this.rootContext() ?? {};\n const skillRequirements = ctx['skillRequirements'];\n const base =\n skillRequirements != null && typeof skillRequirements === 'object'\n ? cloneDeep(skillRequirements as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n this.recompute();\n return;\n }\n\n if (command.name !== JOB_DEFINITION_SKILLS_SAVE) {\n return;\n }\n\n return this.persistSkills() as unknown as Promise<void>;\n }\n\n private async persistSkills(): AXPCommandExecuteResultPromise {\n const ctx = this.mergedContext();\n const id = ctx['id'];\n if (typeof id !== 'string' || id.length === 0) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const skillRequirements = (ctx['skillRequirements'] as AXPSpreadsheetData) ?? {};\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.jobDefinition.name)\n .data<string, AXMOrganizationManagementJobDefinitionEntityModel>()\n .update(id, {\n skillRequirements,\n });\n\n this.baselineMatrix.set(cloneDeep(skillRequirements));\n this.localContext.set(null);\n this.isDirty.set(false);\n this.recompute();\n\n this.eventService.publish(AXPEntityEventsKeys.REFRESH_LAYOUT, {\n name: `${RootConfig.module.name}.${RootConfig.entities.jobDefinition.name}`,\n });\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const text =\n error instanceof Error && error.message\n ? error.message\n : (await this.translateService.translateAsync('@general:messages.entity.invalid-data')) ?? 'Save failed';\n return {\n success: false,\n message: { text },\n };\n }\n }\n\n //#endregion\n\n //#region ---- Recompute ----\n\n protected override recompute(): void {\n super.recompute();\n const layout = this.hostPageLayout as { recompute?: () => void } | null;\n layout?.recompute?.();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;AAEA,MAAM,kCAAkC,GAAG,8BAA8B;AACzE,MAAM,0BAA0B,GAAG,2BA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CAAC,yCAAyC,CAAC;AACpD,oBAAA,QAAQ,EAAE;;;;;;;AAOT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,cAAc;AACtB,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,mCAAqC;AACjD,yBAAA;AACF,qBAAA;AACF,iBAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-skills-page.component-bQOqP1Tx.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-skills-page.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPActionMenuItem, AXPExecuteCommand, AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityEventsKeys } from '@acorex-platform/framework-shared/entity';\n\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport { AXMLearningManagementSkillMatrixComponent } from '@acorex-platform/module-learning-management-client';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPSpreadsheetData } from '@acorex-platform/framework-client/layout/components';\nimport {\n AXPPageLayoutBase,\n AXPPageLayoutBaseComponent,\n} from '@acorex-platform/framework-client/layout/views';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXMOrganizationManagementJobDefinitionEntityModel } from '@acorex-platform/module-organization-management-client/contracts';\nimport { jobLevelsToSpreadsheetTitles, mergeJobDefinitionMatrixPageContext } from './job-definition-matrix-page.utils';\nimport type { AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\n//#endregion\n\nconst JOB_DEFINITION_SKILLS_PAGE_DISCARD = 'JobDefinition:Skills:Discard';\nconst JOB_DEFINITION_SKILLS_SAVE = 'JobDefinition:Skills:Save';\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-job-definition-skills-page',\n standalone: true,\n imports: [AXMLearningManagementSkillMatrixComponent],\n template: `\n <axm-skill-matrix\n [titles]=\"titles()\"\n [value]=\"matrixValue()\"\n [readonly]=\"false\"\n (valueChange)=\"onMatrixChange($event)\"\n />\n `,\n host: {\n class: 'block w-full',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMJobDefinitionSkillsPageComponent,\n },\n ],\n})\nexport class AXMJobDefinitionSkillsPageComponent extends AXPPageLayoutBaseComponent {\n //#region ---- Inputs ----\n\n rootContext = input<Record<string, unknown>>();\n pageConfig = input<Record<string, unknown>>();\n\n //#endregion\n\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly eventService = inject(AXPBroadcastEventService);\n private readonly hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n\n //#endregion\n\n //#region ---- State ----\n\n private readonly localContext = signal<Record<string, unknown> | null>(null);\n private readonly ignoreNextMatrixChange = signal(false);\n private readonly baselineMatrix = signal<AXPSpreadsheetData | null>(null);\n protected readonly isDirty = signal(false);\n\n //#endregion\n\n //#region ---- Constructor ----\n\n constructor() {\n super();\n let previousRootId: unknown = undefined;\n\n effect(() => {\n const ctx = this.rootContext();\n const currentId = ctx != null && typeof ctx === 'object' ? ctx['id'] : undefined;\n if (currentId !== previousRootId) {\n previousRootId = currentId;\n this.localContext.set(null);\n const skillRequirements = ctx?.['skillRequirements'];\n const base =\n skillRequirements != null && typeof skillRequirements === 'object'\n ? cloneDeep(skillRequirements as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n }\n });\n }\n\n //#endregion\n\n //#region ---- Computed ----\n\n /** Canonical payload for matrix bindings; must be a `computed` so `titles` / `matrixValue` track inputs. */\n private readonly mergedContext = computed(() =>\n mergeJobDefinitionMatrixPageContext(this.rootContext() ?? {}, this.localContext()),\n );\n\n protected titles = computed(() =>\n jobLevelsToSpreadsheetTitles(this.mergedContext()['jobLevelsList'], this.translateService),\n );\n\n protected matrixValue = computed((): AXPSpreadsheetData => {\n const v = this.mergedContext()['skillRequirements'];\n if (v != null && typeof v === 'object') {\n return v as AXPSpreadsheetData;\n }\n return {};\n });\n\n //#endregion\n\n //#region ---- UI handlers ----\n\n protected onMatrixChange(data: AXPSpreadsheetData): void {\n if (this.ignoreNextMatrixChange()) {\n this.ignoreNextMatrixChange.set(false);\n return;\n }\n\n const base = this.localContext() ?? this.rootContext() ?? {};\n this.localContext.set({\n ...base,\n skillRequirements: data,\n });\n const baseline = this.baselineMatrix() ?? {};\n this.isDirty.set(!isEqual(baseline, data));\n this.recompute();\n }\n\n //#endregion\n\n //#region ---- Unsaved Changes ----\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n //#endregion\n\n //#region ---- Page actions ----\n\n override async getPrimaryMenuItems(): Promise<AXPActionMenuItem[]> {\n const discardTitle =\n (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';\n\n const discardAction: AXPLayoutDetailsViewAction = {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_SKILLS_PAGE_DISCARD,\n options: {},\n },\n };\n const saveAction: AXPLayoutDetailsViewAction = {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_SKILLS_SAVE,\n options: {},\n },\n };\n\n return [discardAction, saveAction];\n }\n\n //#endregion\n\n //#region ---- Execute ----\n\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === JOB_DEFINITION_SKILLS_PAGE_DISCARD) {\n this.ignoreNextMatrixChange.set(true);\n this.localContext.set(null);\n const ctx = this.rootContext() ?? {};\n const skillRequirements = ctx['skillRequirements'];\n const base =\n skillRequirements != null && typeof skillRequirements === 'object'\n ? cloneDeep(skillRequirements as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n this.recompute();\n return;\n }\n\n if (command.name !== JOB_DEFINITION_SKILLS_SAVE) {\n return;\n }\n\n return this.persistSkills() as unknown as Promise<void>;\n }\n\n private async persistSkills(): AXPCommandExecuteResultPromise {\n const ctx = this.mergedContext();\n const id = ctx['id'];\n if (typeof id !== 'string' || id.length === 0) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const skillRequirements = (ctx['skillRequirements'] as AXPSpreadsheetData) ?? {};\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.jobDefinition.name)\n .data<string, AXMOrganizationManagementJobDefinitionEntityModel>()\n .update(id, {\n skillRequirements,\n });\n\n this.baselineMatrix.set(cloneDeep(skillRequirements));\n this.localContext.set(null);\n this.isDirty.set(false);\n this.recompute();\n\n this.eventService.publish(AXPEntityEventsKeys.REFRESH_LAYOUT, {\n name: `${RootConfig.module.name}.${RootConfig.entities.jobDefinition.name}`,\n });\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const text =\n error instanceof Error && error.message\n ? error.message\n : (await this.translateService.translateAsync('@general:messages.entity.invalid-data')) ?? 'Save failed';\n return {\n success: false,\n message: { text },\n };\n }\n }\n\n //#endregion\n\n //#region ---- Recompute ----\n\n protected override recompute(): void {\n super.recompute();\n const layout = this.hostPageLayout as { recompute?: () => void } | null;\n layout?.recompute?.();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;AAEA,MAAM,kCAAkC,GAAG,8B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AAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,yCAAyC,CAAC;AACpD,oBAAA,QAAQ,EAAE;;;;;;;AAOT,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,cAAc;AACtB,qBAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,SAAS,EAAE;AACT,wBAAA;AACE,4BAAA,OAAO,EAAE,iBAAiB;AAC1B,4BAAA,WAAW,EAAA,mCAAqC;AACjD,yBAAA;AACF,qBAAA;AACF,iBAAA;;;"}
|
package/fesm2022/acorex-platform-module-organization-management-client-local-entities.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-local-entities.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/provide-local-entities.ts","../../../../libs/modules/organization-management/client/src/lib/acorex-platform-module-organization-management-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers organization-management layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideOrganizationManagementLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.businessUnit.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/business-unit').then((m) => m.factoryBusinessUnit()),\n [RootConfig.entities.businessUnitType.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/business-unit-type').then((m) => m.factoryBusinessUnitType()),\n [RootConfig.entities.chart.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/chart').then((m) => m.factoryChart()),\n [RootConfig.entities.company.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/company').then((m) => m.factoryCompany()),\n [RootConfig.entities.jobDefinition.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/job-definition').then((m) => m.factoryJobDefinition()),\n [RootConfig.entities.jobLevel.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/job-level').then((m) => m.factoryJobLevel()),\n [RootConfig.entities.position.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/position').then((m) => m.factoryPosition()),\n [RootConfig.entities.responsibility.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/responsibility').then((m) => m.factoryResponsibility()),\n [RootConfig.entities.responsibilityLevel.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/responsibility-level').then((m) => m.factoryResponsibilityLevel()),\n [RootConfig.entities.team.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team').then((m) => m.factoryTeam()),\n [RootConfig.entities.teamBusinessUnit.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team-business-unit').then((m) => m.factoryTeamBusinessUnit()),\n [RootConfig.entities.teamMember.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team-member').then((m) => m.factoryTeamMember()),\n [RootConfig.entities.teamMemberRole.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team-member-role').then((m) => m.factoryTeamMemberRole()),\n },\n });\n}\n\nexport { organizationManagementLocalEntityCatalog } from '@acorex-platform/module-organization-management-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,0CAA0C,GAAA;AACxD,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,YAA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,qBAAqB,EAAE,CAAC;AAC3I,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,mBAAmB,CAAC,IAAI,GAAG,MAC9C,OAAO,gGAAgG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,0BAA0B,EAAE,CAAC;AACtJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,GAAG,MAC/B,OAAO,gFAAgF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;AACvH,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAC3C,OAAO,8FAA8F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,CAAC;AACjJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,GAAG,MACrC,OAAO,uFAAuF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,iBAAiB,EAAE,CAAC;AACpI,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,GAAG,MACzC,OAAO,4FAA4F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,CAAC;AAC9I,SAAA;AACF,KAAA,CAAC;AACJ;AAIA;;ACnDA;;AAEG
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-local-entities.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/provide-local-entities.ts","../../../../libs/modules/organization-management/client/src/lib/acorex-platform-module-organization-management-client-local-entities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { provideLocalEntityCatalog } from '@acorex-platform/framework-client/layout/entity';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\n//#region ----- Provide local entities -----\n\n/**\n * Registers organization-management layouts on the client from packaged factories.\n * Each `import()` targets a secondary entry so unused entities stay out of the\n * bundle. Do not add this to the demo app; demo continues to load layouts via\n * `Domain:GetEntityLayout`.\n */\nexport function provideOrganizationManagementLocalEntities() {\n return provideLocalEntityCatalog({\n moduleName: RootConfig.module.name,\n loaders: {\n [RootConfig.entities.businessUnit.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/business-unit').then((m) => m.factoryBusinessUnit()),\n [RootConfig.entities.businessUnitType.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/business-unit-type').then((m) => m.factoryBusinessUnitType()),\n [RootConfig.entities.chart.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/chart').then((m) => m.factoryChart()),\n [RootConfig.entities.company.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/company').then((m) => m.factoryCompany()),\n [RootConfig.entities.jobDefinition.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/job-definition').then((m) => m.factoryJobDefinition()),\n [RootConfig.entities.jobLevel.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/job-level').then((m) => m.factoryJobLevel()),\n [RootConfig.entities.position.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/position').then((m) => m.factoryPosition()),\n [RootConfig.entities.responsibility.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/responsibility').then((m) => m.factoryResponsibility()),\n [RootConfig.entities.responsibilityLevel.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/responsibility-level').then((m) => m.factoryResponsibilityLevel()),\n [RootConfig.entities.team.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team').then((m) => m.factoryTeam()),\n [RootConfig.entities.teamBusinessUnit.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team-business-unit').then((m) => m.factoryTeamBusinessUnit()),\n [RootConfig.entities.teamMember.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team-member').then((m) => m.factoryTeamMember()),\n [RootConfig.entities.teamMemberRole.name]: () =>\n import('@acorex-platform/module-organization-management-client/contracts/entities/team-member-role').then((m) => m.factoryTeamMemberRole()),\n },\n });\n}\n\nexport { organizationManagementLocalEntityCatalog } from '@acorex-platform/module-organization-management-client/contracts/entity-catalog';\n\n//#endregion\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './provide-local-entities';\n"],"names":[],"mappings":";;;;AAAA;AAKA;AAEA;AAEA;;;;;AAKG;SACa,0CAA0C,GAAA;AACxD,IAAA,OAAO,yBAAyB,CAAC;AAC/B,QAAA,UAAU,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAClC,QAAA,OAAO,EAAE;AACP,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,GAAG,MACvC,OAAO,yFAAyF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,CAAC;AACxI,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,GAAG,MAC3C,OAAO,8FAA8F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,uBAAuB,EAAE,CAAC;AACjJ,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,GAAG,MAChC,OAAO,iFAAiF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,EAAE,CAAC;AACzH,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,MAClC,OAAO,mFAAmF,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,EAAE,CAAC;AAC7H,YAAA,CAAC,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,MACxC,OAAO,0FAA0F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,oBAAoB,EAAE,CAAC;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F,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,CAAC;AAC9I,SAAA;AACF,KAAA,CAAC;AACJ;AAIA;;ACnDA;;AAEG;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/menu.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { inject } from '@angular/core';\nimport {\n RootConfig,\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXPOrganizationManagementMenuKeys } from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\n//#region ---- Menu Provider ----\n\n/**\n * Organization Management Module Menu Provider.\n * Provides menu structure for the Organization Management module.\n * - Root \"Organization\": Employees, Leave Requests, Chart (operational) then Teams, Positions, Business Units (structure)\n * - Configuration/Organization: Job Definitions, Job Levels, Responsibilities, etc. (reference data)\n */\nexport class AXMMenuProvider implements AXPMenuProvider {\n //#region ---- Services & Dependencies ----\n\n private entityService = inject(AXPEntityService);\n private sessionService = inject(AXPSessionService);\n\n //#endregion\n\n //#region ---- Public Methods ----\n\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n\n const organizationMenu = context.find(AXPCommonMenuKeys.Organization);\n if (!organizationMenu.exists) {\n // Root \"Organization\" - structure items (Employees, Leave, Chart added by HCM with lower priorities)\n context.addItems([\n {\n name: AXPCommonMenuKeys.Organization,\n priority: 8000,\n text: '@organization-management:module.menus.root.title',\n icon: module.icon,\n children: [\n {\n name: AXPOrganizationManagementMenuKeys.OrganizationChart,\n text: '@organization-management:organization-chart.menus.chart.title',\n path: `${this.sessionService.application?.name}/organization/chart`,\n priority: 30,\n icon: RootConfig.entities.chart.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n { name: `${AXPOrganizationManagementMenuKeys.Root}:divider1`, text: '', type: 'break', priority: 40 },\n {\n name: AXPOrganizationManagementMenuKeys.Teams,\n text: '@organization-management:teams.menus.teams.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.team.name),\n priority: 50,\n icon: RootConfig.entities.team.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.MaintainTeams],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.Positions,\n text: '@organization-management:positions.menus.positions.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.position.name),\n priority: 55,\n icon: RootConfig.entities.position.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.BusinessUnits,\n text: '@organization-management:business-units.menus.business-units.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.businessUnit.name),\n priority: 60,\n icon: RootConfig.entities.businessUnit.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n ],\n },\n ]);\n }\n\n // Configuration/Organization - reference data (Job Definitions, Employment Types, etc.)\n const orgConfigMenu = context.find(AXPCommonMenuKeys.OrganizationConfig);\n if (!orgConfigMenu.exists) {\n context.find(AXPCommonMenuKeys.Configuration).addItems([\n {\n name: AXPCommonMenuKeys.OrganizationConfig,\n priority: 8600,\n text: '@organization-management:module.menus.configuration.title',\n icon: module.icon,\n type: 'menu',\n children: [],\n },\n ]);\n }\n\n // Add org config items\n context.find(AXPCommonMenuKeys.OrganizationConfig).addItems([\n {\n name: AXPOrganizationManagementMenuKeys.TeamMemberRoles,\n text: '@organization-management:team-member-roles.menus.team-member-roles.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.teamMemberRole.name),\n priority: 1,\n icon: RootConfig.entities.teamMemberRole.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.JobDefinitions,\n text: '@organization-management:job-definitions.menus.job-definitions.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.jobDefinition.name),\n priority: 2,\n icon: RootConfig.entities.jobDefinition.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.DesignJobs],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.JobLevels,\n text: '@organization-management:job-levels.menus.job-levels.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.jobLevel.name),\n priority: 3,\n icon: RootConfig.entities.jobLevel.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.Responsibilities,\n text: '@organization-management:responsibilities.menus.responsibilities.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.responsibility.name),\n priority: 4,\n icon: RootConfig.entities.responsibility.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.ResponsibilityLevels,\n text: '@organization-management:responsibility-levels.menus.responsibility-levels.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.responsibilityLevel.name),\n priority: 5,\n icon: RootConfig.entities.responsibilityLevel.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.BusinessUnitTypes,\n text: '@organization-management:business-unit-types.menus.business-unit-types.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.businessUnitType.name),\n priority: 6,\n icon: RootConfig.entities.businessUnitType.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n { name: `${AXPOrganizationManagementMenuKeys.Root}:staff-divider`, text: '', type: 'break', priority: 7 },\n ]);\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAAA;AAeA;AAEA;AAEA;;;;;AAKG;MACU,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;;AAGU,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;IA6JpD;;;IAvJE,MAAM,OAAO,CAAC,OAA+B,EAAA;AAC3C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM;QAEhC,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC;AACrE,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;;YAE5B,OAAO,CAAC,QAAQ,CAAC;AACjB,gBAAA;oBACE,IAAI,EAAE,iBAAiB,CAAC,YAAY;AACpC,oBAAA,QAAQ,EAAE,IAAI;AACd,oBAAA,IAAI,EAAE,kDAAkD;oBACxD,IAAI,EAAE,MAAM,CAAC,IAAI;AACjB,oBAAA,QAAQ,EAAE;AACR,wBAAA;4BACE,IAAI,EAAE,iCAAiC,CAAC,iBAAiB;AACzD,4BAAA,IAAI,EAAE,+DAA+D;4BACrE,IAAI,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAA,mBAAA,CAAqB;AACnE,4BAAA,QAAQ,EAAE,EAAE;AACZ,4BAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI;AACpC,4BAAA,MAAM,EAAE;AACN,gCAAA,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;AACvB,gCAAA,WAAW,EAAE,CAAC,mCAAmC,CAAC,gBAAgB,CAAC;AACpE,6BAAA;AACF,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AAC,gBAAgB,CAAC,IAAI;AAC/C,gBAAA,MAAM,EAAE;AACN,oBAAA,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;AACvB,oBAAA,WAAW,EAAE,CAAC,mCAAmC,CAAC,KAAK,CAAC;AACzD,iBAAA;AACF,aAAA;AACD,YAAA,EAAE,IAAI,EAAE,CAAA,EAAG,iCAAiC,CAAC,IAAI,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;AAC1G,SAAA,CAAC;IACJ;AAGD;AAED;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/menu.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { inject } from '@angular/core';\nimport {\n RootConfig,\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXPOrganizationManagementMenuKeys } from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\n//#region ---- Menu Provider ----\n\n/**\n * Organization Management Module Menu Provider.\n * Provides menu structure for the Organization Management module.\n * - Root \"Organization\": Employees, Leave Requests, Chart (operational) then Teams, Positions, Business Units (structure)\n * - Configuration/Organization: Job Definitions, Job Levels, Responsibilities, etc. (reference data)\n */\nexport class AXMMenuProvider implements AXPMenuProvider {\n //#region ---- Services & Dependencies ----\n\n private entityService = inject(AXPEntityService);\n private sessionService = inject(AXPSessionService);\n\n //#endregion\n\n //#region ---- Public Methods ----\n\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n\n const organizationMenu = context.find(AXPCommonMenuKeys.Organization);\n if (!organizationMenu.exists) {\n // Root \"Organization\" - structure items (Employees, Leave, Chart added by HCM with lower priorities)\n context.addItems([\n {\n name: AXPCommonMenuKeys.Organization,\n priority: 8000,\n text: '@organization-management:module.menus.root.title',\n icon: module.icon,\n children: [\n {\n name: AXPOrganizationManagementMenuKeys.OrganizationChart,\n text: '@organization-management:organization-chart.menus.chart.title',\n path: `${this.sessionService.application?.name}/organization/chart`,\n priority: 30,\n icon: RootConfig.entities.chart.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n { name: `${AXPOrganizationManagementMenuKeys.Root}:divider1`, text: '', type: 'break', priority: 40 },\n {\n name: AXPOrganizationManagementMenuKeys.Teams,\n text: '@organization-management:teams.menus.teams.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.team.name),\n priority: 50,\n icon: RootConfig.entities.team.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.MaintainTeams],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.Positions,\n text: '@organization-management:positions.menus.positions.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.position.name),\n priority: 55,\n icon: RootConfig.entities.position.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.BusinessUnits,\n text: '@organization-management:business-units.menus.business-units.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.businessUnit.name),\n priority: 60,\n icon: RootConfig.entities.businessUnit.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n ],\n },\n ]);\n }\n\n // Configuration/Organization - reference data (Job Definitions, Employment Types, etc.)\n const orgConfigMenu = context.find(AXPCommonMenuKeys.OrganizationConfig);\n if (!orgConfigMenu.exists) {\n context.find(AXPCommonMenuKeys.Configuration).addItems([\n {\n name: AXPCommonMenuKeys.OrganizationConfig,\n priority: 8600,\n text: '@organization-management:module.menus.configuration.title',\n icon: module.icon,\n type: 'menu',\n children: [],\n },\n ]);\n }\n\n // Add org config items\n context.find(AXPCommonMenuKeys.OrganizationConfig).addItems([\n {\n name: AXPOrganizationManagementMenuKeys.TeamMemberRoles,\n text: '@organization-management:team-member-roles.menus.team-member-roles.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.teamMemberRole.name),\n priority: 1,\n icon: RootConfig.entities.teamMemberRole.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.JobDefinitions,\n text: '@organization-management:job-definitions.menus.job-definitions.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.jobDefinition.name),\n priority: 2,\n icon: RootConfig.entities.jobDefinition.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.DesignJobs],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.JobLevels,\n text: '@organization-management:job-levels.menus.job-levels.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.jobLevel.name),\n priority: 3,\n icon: RootConfig.entities.jobLevel.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.Responsibilities,\n text: '@organization-management:responsibilities.menus.responsibilities.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.responsibility.name),\n priority: 4,\n icon: RootConfig.entities.responsibility.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.ResponsibilityLevels,\n text: '@organization-management:responsibility-levels.menus.responsibility-levels.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.responsibilityLevel.name),\n priority: 5,\n icon: RootConfig.entities.responsibilityLevel.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.BusinessUnitTypes,\n text: '@organization-management:business-unit-types.menus.business-unit-types.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.businessUnitType.name),\n priority: 6,\n icon: RootConfig.entities.businessUnitType.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n { name: `${AXPOrganizationManagementMenuKeys.Root}:staff-divider`, text: '', type: 'break', priority: 7 },\n ]);\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAAA;AAeA;AAEA;AAEA;;;;;AAKG;MACU,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;;AAGU,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;IA6JpD;;;IAvJE,MAAM,OAAO,CAAC,OAA+B,EAAA;AAC3C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM;QAEhC,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC;AACrE,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;;YAE5B,OAAO,CAAC,QAAQ,CAAC;AACjB,gBAAA;oBACE,IAAI,EAAE,iBAAiB,CAAC,YAAY;AACpC,oBAAA,QAAQ,EAAE,IAAI;AACd,oBAAA,IAAI,EAAE,kDAAkD;oBACxD,IAAI,EAAE,MAAM,CAAC,IAAI;AACjB,oBAAA,QAAQ,EAAE;AACR,wBAAA;4BACE,IAAI,EAAE,iCAAiC,CAAC,iBAAiB;AACzD,4BAAA,IAAI,EAAE,+DAA+D;4BACrE,IAAI,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,CAAA,mBAAA,CAAqB;AACnE,4BAAA,QAAQ,EAAE,EAAE;AACZ,4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A8E;AACpF,gBAAA,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC3F,gBAAA,QAAQ,EAAE,CAAC;AACX,gBAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI;AAC/C,gBAAA,MAAM,EAAE;AACN,oBAAA,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC;AACvB,oBAAA,WAAW,EAAE,CAAC,mCAAmC,CAAC,KAAK,CAAC;AACzD,iBAAA;AACF,aAAA;AACD,YAAA,EAAE,IAAI,EAAE,CAAA,EAAG,iCAAiC,CAAC,IAAI,gBAAgB,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE;AAC1G,SAAA,CAAC;IACJ;AAGD;AAED;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-org-chart-default-node-contribution.provider-BQ0ihb43.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/contributions/org-chart-default-node-contribution.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService, createMultiLanguageString, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { inject, Injectable, LOCALE_ID } from '@angular/core';\nimport {\n AXMOrganizationManagementCommandKeys,\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\n\nimport {\n AXMOrgChartNodeContributionContext,\n AXMOrgChartNodeContributionProvider,\n AXMOrgChartNodeMenuAction,\n} from '../tokens/org-chart-node-contribution.token';\n\n//#endregion\n\n//#region ---- Module Constants ----\n\nconst orgChartNodeActionKey = (suffix: string): string =>\n `@organization-management:organization-chart.node-actions.${suffix}`;\n\n//#endregion\n\n@Injectable()\nexport class AXMOrgChartDefaultNodeContributionProvider implements AXMOrgChartNodeContributionProvider {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly entityService = inject(AXPEntityService);\n private readonly localeId = inject(LOCALE_ID);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Menu Actions ----\n\n async getMenuActions(context: AXMOrgChartNodeContributionContext): Promise<AXMOrgChartNodeMenuAction[]> {\n if (context.nodeKind !== 'company-root' && context.nodeKind !== 'business-unit') {\n return [];\n }\n\n const businessUnitId = this.resolveBusinessUnitId(context);\n const parentId = context.nodeKind === 'business-unit' ? businessUnitId : undefined;\n\n const typeAllowsDirectPositions =\n context.nodeKind === 'business-unit' && businessUnitId\n ? await this.resolveTypeAllowsDirectPositions(context, businessUnitId)\n : false;\n\n /** When true, a separator goes after the last “Add BU by type” row before the Add position row. */\n const hasPositionRowAfterBuTypes =\n context.nodeKind === 'business-unit' && Boolean(businessUnitId) && typeAllowsDirectPositions;\n\n const canMaintainOrganization = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainOrganization);\n const canViewOrganization = this.authorize(AXPPeopleOrganizationPermissionKeys.ViewOrganization);\n const canCreateBusinessUnit = canMaintainOrganization;\n const canUpdateBusinessUnit = canMaintainOrganization;\n const canDeleteBusinessUnit = canMaintainOrganization;\n const canViewPosition = canViewOrganization || canMaintainOrganization;\n const canCreateTeam = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainTeams);\n\n const buTypeRows = await this.loadBusinessUnitTypes();\n const addNewBuKey = orgChartNodeActionKey('add-new-bu-with-type');\n const addBuActions: AXMOrgChartNodeMenuAction[] = await Promise.all(\n buTypeRows.map(async (row, index) => ({\n id: `organization-management.add-bu-type.${row.id}`,\n title: await this.menuTitleDualLocale(addNewBuKey, { type: row.title }),\n nestedInAddFlyout: true,\n icon: 'fa-light fa-sitemap',\n order: 10 + index,\n disabled: !canCreateBusinessUnit,\n break: hasPositionRowAfterBuTypes && index === buTypeRows.length - 1 && buTypeRows.length > 0 ? 'after' : undefined,\n execute: async () => {\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.AddBusinessUnitToBusinessUnit,\n { parentBusinessUnitId: parentId, typeId: row.id },\n );\n if (result?.success) {\n await context.refreshChart();\n }\n },\n })),\n );\n\n const addPositionToBuAction: AXMOrgChartNodeMenuAction | null =\n context.nodeKind === 'business-unit' && businessUnitId && typeAllowsDirectPositions\n ? {\n id: 'organization-management.add-position-to-business-unit',\n title: orgChartNodeActionKey('add-new-position'),\n nestedInAddFlyout: true,\n icon: 'fa-light fa-briefcase',\n order: 10 + buTypeRows.length,\n disabled: !canUpdateBusinessUnit || !canViewPosition,\n execute: async () => {\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.AddPositionToBusinessUnit,\n { businessUnitId },\n );\n if (result?.success) {\n await context.refreshChart();\n }\n },\n }\n : null;\n\n const addNewTeamToBuAction: AXMOrgChartNodeMenuAction | null =\n context.nodeKind === 'business-unit' && businessUnitId\n ? {\n id: 'organization-management.org-chart.add-new-team',\n title: orgChartNodeActionKey('add-new-team'),\n nestedInAddFlyout: true,\n icon: 'fa-light fa-people-group',\n order: 10 + buTypeRows.length + (addPositionToBuAction ? 1 : 0),\n disabled: !canCreateTeam,\n execute: async () => {\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.AddTeamToBusinessUnit,\n { businessUnitId },\n );\n if (result?.success) {\n await context.refreshChart();\n }\n },\n }\n : null;\n\n const removeBuActions: AXMOrgChartNodeMenuAction[] =\n context.nodeKind === 'business-unit'\n ? [\n {\n id: 'organization-management.remove-bu',\n title: orgChartNodeActionKey('remove'),\n icon: 'fa-light fa-trash',\n color: 'danger',\n order: 120,\n break: 'before',\n disabled: !canDeleteBusinessUnit || !businessUnitId,\n execute: async () => {\n await this.commandService.execute('Entity:Remove', {\n entity: RootConfig.entities.businessUnit.source,\n data: { id: businessUnitId },\n options: { process: { showResult: true } },\n \n });\n await context.refreshChart();\n },\n },\n ]\n : [];\n\n return [\n ...addBuActions,\n ...(addPositionToBuAction ? [addPositionToBuAction] : []),\n ...(addNewTeamToBuAction ? [addNewTeamToBuAction] : []),\n ...removeBuActions,\n ];\n }\n\n //#endregion\n\n //#region ---- Authorization ----\n\n private authorize(permission: string): boolean {\n return this.sessionService.authorize(permission);\n }\n\n //#endregion\n\n //#region ---- Menu Labels ----\n\n /**\n * Resolves copy for menu rows: nested `translate` bindings do not pass interpolation params into the pipe;\n * use per-locale strings via {@link createMultiLanguageString}.\n *\n * TODO: Remove this dual-locale pre-resolution once we can pass interpolation params through\n * {@link AXPMultiLanguageString} and/or the menu `translate` pipe (see `@acorex/components/menu` item template).\n */\n private async menuTitleDualLocale(\n key: string,\n params: Record<string, string | number>,\n ): Promise<ReturnType<typeof createMultiLanguageString>> {\n const [enUs, faIr] = await Promise.all([\n this.translationService.translateAsync(key, { lang: 'en-US', params }),\n this.translationService.translateAsync(key, { lang: 'fa-IR', params }),\n ]);\n return createMultiLanguageString(enUs, faIr);\n }\n\n //#endregion\n\n //#region ---- Business Unit Types ----\n\n /**\n * Resolves whether the BU's type allows direct positions (metadata from chart, nested type, or type lookup).\n */\n private async resolveTypeAllowsDirectPositions(\n context: AXMOrgChartNodeContributionContext,\n businessUnitId: string,\n ): Promise<boolean> {\n const fromMeta = context.node.metadata?.['typeAllowsDirectPositions'];\n if (typeof fromMeta === 'boolean') {\n return fromMeta;\n }\n try {\n const bu = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.businessUnit.name)\n .data()\n .byKey(businessUnitId);\n const row = bu as { type?: { allowsDirectPositions?: boolean }; typeId?: string } | null;\n const nested = row?.type?.allowsDirectPositions;\n if (typeof nested === 'boolean') {\n return nested;\n }\n const typeId = row?.typeId?.trim();\n if (typeId) {\n const ty = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.businessUnitType.name)\n .data()\n .byKey(typeId);\n return (ty as { allowsDirectPositions?: boolean } | null)?.allowsDirectPositions !== false;\n }\n } catch {\n // fall through\n }\n return true;\n }\n\n private async loadBusinessUnitTypes(): Promise<Array<{ id: string; title: string }>> {\n try {\n const result = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.businessUnitType.name)\n .data()\n .query({\n skip: 0,\n take: 500,\n sort: [{ field: 'title', dir: 'asc' }],\n });\n const items = (result.items ?? []) as Array<{ id: string; title?: unknown }>;\n return items\n .map((row) => {\n const id = String(row.id ?? '');\n const title = this.resolveBusinessUnitTypeLabel(row);\n return { id, title: title || id };\n })\n .filter((row) => row.id.length > 0);\n } catch {\n return [];\n }\n }\n\n /**\n * API rows use {@link AXPMultiLanguageString} for `title`; treating it as a string breaks `.trim()` and drops all types.\n */\n private resolveBusinessUnitTypeLabel(row: { title?: unknown }): string {\n const raw = row.title;\n if (raw == null) {\n return '';\n }\n if (typeof raw === 'string') {\n return raw.trim();\n }\n return resolveMultiLanguageString(raw as AXPMultiLanguageString, this.localeId).trim();\n }\n\n //#endregion\n\n //#region ---- Node Metadata ----\n\n private resolveBusinessUnitId(context: AXMOrgChartNodeContributionContext): string | undefined {\n if (context.nodeKind === 'business-unit') {\n return (\n context.node.entity?.id ??\n (context.node.metadata?.['businessUnitId'] as string | undefined) ??\n (context.node.metadata?.['unitId'] as string | undefined)\n );\n }\n return context.node.metadata?.['businessUnitId'] as string | undefined;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AAoBA;AAEA;AAEA,MAAM,qBAAqB,GAAG,CAAC,MAAc,KAC3C,CAAA,yDAAA,EAA4D,MAAM,CAAA,CAAE;AAEtE;MAGa,0CAA0C,CAAA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0BAA0B,CAAC,GAA6B,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;IACxF;;;AAMQ,IAAA,qBAAqB,CAAC,OAA2C,EAAA;AACvE,QAAA,IAAI,OAAO,CAAC,QAAQ,KAAK,eAAe,EAAE;AACxC,YAAA,QACE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE;AACtB,gBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAwB;gBAChE,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAwB;QAE7D;QACA,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAuB;IACxE;8GA9PW,0CAA0C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1C,0CAA0C,EAAA,CAAA,CAAA;;2FAA1C,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBADtD;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-org-chart-default-node-contribution.provider-BQ0ihb43.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/contributions/org-chart-default-node-contribution.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService, createMultiLanguageString, resolveMultiLanguageString } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport type { AXPMultiLanguageString } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { inject, Injectable, LOCALE_ID } from '@angular/core';\nimport {\n AXMOrganizationManagementCommandKeys,\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\n\nimport {\n AXMOrgChartNodeContributionContext,\n AXMOrgChartNodeContributionProvider,\n AXMOrgChartNodeMenuAction,\n} from '../tokens/org-chart-node-contribution.token';\n\n//#endregion\n\n//#region ---- Module Constants ----\n\nconst orgChartNodeActionKey = (suffix: string): string =>\n `@organization-management:organization-chart.node-actions.${suffix}`;\n\n//#endregion\n\n@Injectable()\nexport class AXMOrgChartDefaultNodeContributionProvider implements AXMOrgChartNodeContributionProvider {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly entityService = inject(AXPEntityService);\n private readonly localeId = inject(LOCALE_ID);\n private readonly translationService = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Menu Actions ----\n\n async getMenuActions(context: AXMOrgChartNodeContributionContext): Promise<AXMOrgChartNodeMenuAction[]> {\n if (context.nodeKind !== 'company-root' && context.nodeKind !== 'business-unit') {\n return [];\n }\n\n const businessUnitId = this.resolveBusinessUnitId(context);\n const parentId = context.nodeKind === 'business-unit' ? businessUnitId : undefined;\n\n const typeAllowsDirectPositions =\n context.nodeKind === 'business-unit' && businessUnitId\n ? await this.resolveTypeAllowsDirectPositions(context, businessUnitId)\n : false;\n\n /** When true, a separator goes after the last “Add BU by type” row before the Add position row. */\n const hasPositionRowAfterBuTypes =\n context.nodeKind === 'business-unit' && Boolean(businessUnitId) && typeAllowsDirectPositions;\n\n const canMaintainOrganization = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainOrganization);\n const canViewOrganization = this.authorize(AXPPeopleOrganizationPermissionKeys.ViewOrganization);\n const canCreateBusinessUnit = canMaintainOrganization;\n const canUpdateBusinessUnit = canMaintainOrganization;\n const canDeleteBusinessUnit = canMaintainOrganization;\n const canViewPosition = canViewOrganization || canMaintainOrganization;\n const canCreateTeam = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainTeams);\n\n const buTypeRows = await this.loadBusinessUnitTypes();\n const addNewBuKey = orgChartNodeActionKey('add-new-bu-with-type');\n const addBuActions: AXMOrgChartNodeMenuAction[] = await Promise.all(\n buTypeRows.map(async (row, index) => ({\n id: `organization-management.add-bu-type.${row.id}`,\n title: await this.menuTitleDualLocale(addNewBuKey, { type: row.title }),\n nestedInAddFlyout: true,\n icon: 'fa-light fa-sitemap',\n order: 10 + index,\n disabled: !canCreateBusinessUnit,\n break: hasPositionRowAfterBuTypes && index === buTypeRows.length - 1 && buTypeRows.length > 0 ? 'after' : undefined,\n execute: async () => {\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.AddBusinessUnitToBusinessUnit,\n { parentBusinessUnitId: parentId, typeId: row.id },\n );\n if (result?.success) {\n await context.refreshChart();\n }\n },\n })),\n );\n\n const addPositionToBuAction: AXMOrgChartNodeMenuAction | null =\n context.nodeKind === 'business-unit' && businessUnitId && typeAllowsDirectPositions\n ? {\n id: 'organization-management.add-position-to-business-unit',\n title: orgChartNodeActionKey('add-new-position'),\n nestedInAddFlyout: true,\n icon: 'fa-light fa-briefcase',\n order: 10 + buTypeRows.length,\n disabled: !canUpdateBusinessUnit || !canViewPosition,\n execute: async () => {\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.AddPositionToBusinessUnit,\n { businessUnitId },\n );\n if (result?.success) {\n await context.refreshChart();\n }\n },\n }\n : null;\n\n const addNewTeamToBuAction: AXMOrgChartNodeMenuAction | null =\n context.nodeKind === 'business-unit' && businessUnitId\n ? {\n id: 'organization-management.org-chart.add-new-team',\n title: orgChartNodeActionKey('add-new-team'),\n nestedInAddFlyout: true,\n icon: 'fa-light fa-people-group',\n order: 10 + buTypeRows.length + (addPositionToBuAction ? 1 : 0),\n disabled: !canCreateTeam,\n execute: async () => {\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.AddTeamToBusinessUnit,\n { businessUnitId },\n );\n if (result?.success) {\n await context.refreshChart();\n }\n },\n }\n : null;\n\n const removeBuActions: AXMOrgChartNodeMenuAction[] =\n context.nodeKind === 'business-unit'\n ? [\n {\n id: 'organization-management.remove-bu',\n title: orgChartNodeActionKey('remove'),\n icon: 'fa-light fa-trash',\n color: 'danger',\n order: 120,\n break: 'before',\n disabled: !canDeleteBusinessUnit || !businessUnitId,\n execute: async () => {\n await this.commandService.execute('Entity:Remove', {\n entity: RootConfig.entities.businessUnit.source,\n data: { id: businessUnitId },\n options: { process: { showResult: true } },\n \n });\n await context.refreshChart();\n },\n },\n ]\n : [];\n\n return [\n ...addBuActions,\n ...(addPositionToBuAction ? [addPositionToBuAction] : []),\n ...(addNewTeamToBuAction ? [addNewTeamToBuAction] : []),\n ...removeBuActions,\n ];\n }\n\n //#endregion\n\n //#region ---- Authorization ----\n\n private authorize(permission: string): boolean {\n return this.sessionService.authorize(permission);\n }\n\n //#endregion\n\n //#region ---- Menu Labels ----\n\n /**\n * Resolves copy for menu rows: nested `translate` bindings do not pass interpolation params into the pipe;\n * use per-locale strings via {@link createMultiLanguageString}.\n *\n * TODO: Remove this dual-locale pre-resolution once we can pass interpolation params through\n * {@link AXPMultiLanguageString} and/or the menu `translate` pipe (see `@acorex/components/menu` item template).\n */\n private async menuTitleDualLocale(\n key: string,\n params: Record<string, string | number>,\n ): Promise<ReturnType<typeof createMultiLanguageString>> {\n const [enUs, faIr] = await Promise.all([\n this.translationService.translateAsync(key, { lang: 'en-US', params }),\n this.translationService.translateAsync(key, { lang: 'fa-IR', params }),\n ]);\n return createMultiLanguageString(enUs, faIr);\n }\n\n //#endregion\n\n //#region ---- Business Unit Types ----\n\n /**\n * Resolves whether the BU's type allows direct positions (metadata from chart, nested type, or type lookup).\n */\n private async resolveTypeAllowsDirectPositions(\n context: AXMOrgChartNodeContributionContext,\n businessUnitId: string,\n ): Promise<boolean> {\n const fromMeta = context.node.metadata?.['typeAllowsDirectPositions'];\n if (typeof fromMeta === 'boolean') {\n return fromMeta;\n }\n try {\n const bu = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.businessUnit.name)\n .data()\n .byKey(businessUnitId);\n const row = bu as { type?: { allowsDirectPositions?: boolean }; typeId?: string } | null;\n const nested = row?.type?.allowsDirectPositions;\n if (typeof nested === 'boolean') {\n return nested;\n }\n const typeId = row?.typeId?.trim();\n if (typeId) {\n const ty = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.businessUnitType.name)\n .data()\n .byKey(typeId);\n return (ty as { allowsDirectPositions?: boolean } | null)?.allowsDirectPositions !== false;\n }\n } catch {\n // fall through\n }\n return true;\n }\n\n private async loadBusinessUnitTypes(): Promise<Array<{ id: string; title: string }>> {\n try {\n const result = await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.businessUnitType.name)\n .data()\n .query({\n skip: 0,\n take: 500,\n sort: [{ field: 'title', dir: 'asc' }],\n });\n const items = (result.items ?? []) as Array<{ id: string; title?: unknown }>;\n return items\n .map((row) => {\n const id = String(row.id ?? '');\n const title = this.resolveBusinessUnitTypeLabel(row);\n return { id, title: title || id };\n })\n .filter((row) => row.id.length > 0);\n } catch {\n return [];\n }\n }\n\n /**\n * API rows use {@link AXPMultiLanguageString} for `title`; treating it as a string breaks `.trim()` and drops all types.\n */\n private resolveBusinessUnitTypeLabel(row: { title?: unknown }): string {\n const raw = row.title;\n if (raw == null) {\n return '';\n }\n if (typeof raw === 'string') {\n return raw.trim();\n }\n return resolveMultiLanguageString(raw as AXPMultiLanguageString, this.localeId).trim();\n }\n\n //#endregion\n\n //#region ---- Node Metadata ----\n\n private resolveBusinessUnitId(context: AXMOrgChartNodeContributionContext): string | undefined {\n if (context.nodeKind === 'business-unit') {\n return (\n context.node.entity?.id ??\n (context.node.metadata?.['businessUnitId'] as string | undefined) ??\n (context.node.metadata?.['unitId'] as string | undefined)\n );\n }\n return context.node.metadata?.['businessUnitId'] as string | undefined;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AAoBA;AAEA;AAEA,MAAM,qBAAqB,GAAG,CAAC,MAAc,KAC3C,CAAA,yDAAA,EAA4D,MAAM,CAAA,CAAE;AAEtE;MAG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ACnB;QACA,OAAO,0BAA0B,CAAC,GAA6B,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE;IACxF;;;AAMQ,IAAA,qBAAqB,CAAC,OAA2C,EAAA;AACvE,QAAA,IAAI,OAAO,CAAC,QAAQ,KAAK,eAAe,EAAE;AACxC,YAAA,QACE,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE;AACtB,gBAAA,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAwB;gBAChE,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAwB;QAE7D;QACA,OAAO,OAAO,CAAC,IAAI,CAAC,QAAQ,GAAG,gBAAgB,CAAuB;IACxE;8GA9PW,0CAA0C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA1C,0CAA0C,EAAA,CAAA,CAAA;;2FAA1C,0CAA0C,EAAA,UAAA,EAAA,CAAA;kBADtD;;;"}
|
|
@@ -6,7 +6,7 @@ import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
|
|
|
6
6
|
import * as i0 from '@angular/core';
|
|
7
7
|
import { inject, Injectable } from '@angular/core';
|
|
8
8
|
import { RootConfig, AXPPeopleOrganizationPermissionKeys } from '@acorex-platform/module-organization-management-client/contracts';
|
|
9
|
-
import { e as axmResolveOrgChartFlyoutEmployeeId, f as AXM_ORG_CHART_EMPLOYEE_SUBMENU_ICON, g as AXM_ORG_CHART_EMPLOYEE_SUBMENU_TITLE_I18N_KEY, d as AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID } from './acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-
|
|
9
|
+
import { e as axmResolveOrgChartFlyoutEmployeeId, f as AXM_ORG_CHART_EMPLOYEE_SUBMENU_ICON, g as AXM_ORG_CHART_EMPLOYEE_SUBMENU_TITLE_I18N_KEY, d as AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID } from './acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-ZM6X7IDO.mjs';
|
|
10
10
|
|
|
11
11
|
//#region ---- Imports ----
|
|
12
12
|
//#endregion
|
|
@@ -176,4 +176,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
176
176
|
}] });
|
|
177
177
|
|
|
178
178
|
export { AXMOrgChartEmployeeFlyoutContributionProvider };
|
|
179
|
-
//# sourceMappingURL=acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-
|
|
179
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-ZnMtkQSg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-DZs4VB50.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/contributions/org-chart-employee-flyout-contribution.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport {\n RootConfig,\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\n\nimport {\n AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID,\n AXM_ORG_CHART_EMPLOYEE_SUBMENU_ICON,\n AXM_ORG_CHART_EMPLOYEE_SUBMENU_TITLE_I18N_KEY,\n} from '../constants/org-chart-employee-submenu.const';\nimport {\n AXMOrgChartNodeContributionContext,\n AXMOrgChartNodeContributionProvider,\n AXMOrgChartNodeMenuAction,\n} from '../tokens/org-chart-node-contribution.token';\nimport { axmResolveOrgChartFlyoutEmployeeId } from '../utils/org-chart-resolve-flyout-employee-id.util';\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst actionKey = (suffix: string): string =>\n `@organization-management:organization-chart.node-actions.${suffix}`;\n\nconst HCM_EMPLOYEE_MODULE = 'HumanCapitalManagement';\nconst HCM_EMPLOYEE_NAME = 'Employee';\nconst HCM_EMPLOYEE_SOURCE = `${HCM_EMPLOYEE_MODULE}.${HCM_EMPLOYEE_NAME}`;\n\n//#endregion\n\n/**\n * **Employee** context-submenu: open employee record (`Entity:OpenDetails`), HR placeholders, schedule, add-to-team — plus chat/email from extensions.\n * Shown for {@link AXMOrgChartNodeKind} `employee` and for company / business unit / filled position when an\n * assigned person id is available; hidden when head or top role is vacant.\n */\n@Injectable()\nexport class AXMOrgChartEmployeeFlyoutContributionProvider implements AXMOrgChartNodeContributionProvider {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly dialogService = inject(AXDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly entityDataSelector = inject(AXPEntityDataSelectorService);\n\n private readonly teamMemberEntityInfo = {\n module: RootConfig.module.name,\n name: RootConfig.entities.teamMember.name,\n title: RootConfig.entities.teamMember.title,\n };\n\n //#endregion\n\n //#region ---- AXMOrgChartNodeContributionProvider ----\n\n async getMenuActions(context: AXMOrgChartNodeContributionContext): Promise<AXMOrgChartNodeMenuAction[]> {\n const employeeId = axmResolveOrgChartFlyoutEmployeeId(context);\n if (!employeeId) {\n return [];\n }\n return this.buildFlyoutActions(context, employeeId);\n }\n\n //#endregion\n\n //#region ---- Flyout actions ----\n\n private buildFlyoutActions(\n context: AXMOrgChartNodeContributionContext,\n employeeId: string,\n ): AXMOrgChartNodeMenuAction[] {\n void context;\n const canViewEmployee = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainEmployees);\n const canTeam = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainTeams);\n\n return [\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.open-employee-details',\n title: actionKey('open'),\n icon: 'fa-light fa-arrow-up-right-from-square',\n order: 35,\n disabled: !canViewEmployee,\n execute: async () => {\n await this.commandService.execute('Entity:OpenDetails', {\n entity: HCM_EMPLOYEE_SOURCE,\n data: { id: employeeId },\n });\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.hr-transfer',\n title: actionKey('hr-workflow-transfer'),\n icon: 'fa-light fa-right-left',\n order: 60,\n submenuSectionBreak: true,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.hr-workflow.title'),\n actionKey('placeholders.hr-workflow.transfer'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.hr-promotion',\n title: actionKey('hr-workflow-promotion'),\n icon: 'fa-light fa-arrow-trend-up',\n order: 61,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.hr-workflow.title'),\n actionKey('placeholders.hr-workflow.promotion'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.hr-offboarding',\n title: actionKey('hr-workflow-offboarding'),\n icon: 'fa-light fa-door-open',\n order: 62,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.hr-workflow.title'),\n actionKey('placeholders.hr-workflow.offboarding'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.schedule-meeting',\n title: actionKey('schedule-meeting'),\n icon: 'fa-light fa-calendar-plus',\n order: 70,\n submenuSectionBreak: true,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.schedule-meeting.title'),\n actionKey('placeholders.schedule-meeting.message'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.add-to-team',\n title: actionKey('add-to-team'),\n icon: 'fa-light fa-user-plus',\n order: 75,\n /** Trailing group break: separator after the Employee row on the root menu (inner last-row break is normalized away). */\n break: 'after',\n disabled: !canTeam,\n execute: async (ctx) => {\n await this.openTeamSelectorThenCreateTeamMember(ctx, employeeId);\n },\n }),\n ];\n }\n\n /**\n * Picks a team via {@link AXPEntityDataSelectorService}, then opens **Create Team Member** with both `teamId` and\n * `employeeId` set.\n */\n private async openTeamSelectorThenCreateTeamMember(\n ctx: AXMOrgChartNodeContributionContext,\n employeeId: string,\n ): Promise<void> {\n const teamEntity = await this.entityRegistry.resolve(RootConfig.module.name, RootConfig.entities.team.name);\n if (!teamEntity) {\n return;\n }\n const title = await this.translationService.translateAsync(actionKey('add-to-team-select-team'));\n const pick = await this.entityDataSelector.open({\n entity: teamEntity,\n title,\n allowMultiple: false,\n });\n const teamId = pick?.items?.[0]?.id;\n if (teamId == null || String(teamId).trim().length === 0) {\n return;\n }\n\n const result = await this.commandService.execute('Entity:Create', {\n entity: RootConfig.entities.teamMember.source,\n entityInfo: this.teamMemberEntityInfo,\n data: { employeeId, teamId: String(teamId).trim() },\n options: {\n process: {\n redirect: false,\n },\n },\n \n });\n if (result?.success) {\n await ctx.refreshChart();\n }\n }\n\n private withEmployeeSubmenu(\n action: AXMOrgChartNodeMenuAction,\n ): AXMOrgChartNodeMenuAction {\n return {\n ...action,\n submenuGroupId: AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID,\n submenuGroupTitle: AXM_ORG_CHART_EMPLOYEE_SUBMENU_TITLE_I18N_KEY,\n submenuGroupIcon: AXM_ORG_CHART_EMPLOYEE_SUBMENU_ICON,\n };\n }\n\n //#endregion\n\n //#region ---- Resolvers ----\n\n private authorize(permission: string): boolean {\n return this.sessionService.authorize(permission);\n }\n\n private async showPlaceholder(titleKey: string, messageKey: string): Promise<void> {\n const title = await this.translationService.translateAsync(titleKey);\n const message = await this.translationService.translateAsync(messageKey);\n await this.dialogService.alert(title, message, 'primary');\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAyBA;AAEA;AAEA,MAAM,SAAS,GA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MAAM;AACT,YAAA,cAAc,EAAE,uCAAuC;AACvD,YAAA,iBAAiB,EAAE,6CAA6C;AAChE,YAAA,gBAAgB,EAAE,mCAAmC;SACtD;IACH;;;AAMQ,IAAA,SAAS,CAAC,UAAkB,EAAA;QAClC,OAAO,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC;IAClD;AAEQ,IAAA,MAAM,eAAe,CAAC,QAAgB,EAAE,UAAkB,EAAA;QAChE,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,QAAQ,CAAC;QACpE,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,cAAc,CAAC,UAAU,CAAC;AACxE,QAAA,MAAM,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,CAAC;IAC3D;8GArLW,6CAA6C,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA7C,6CAA6C,EAAA,CAAA,CAAA;;2FAA7C,6CAA6C,EAAA,UAAA,EAAA,CAAA;kBADzD;;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-ZnMtkQSg.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/contributions/org-chart-employee-flyout-contribution.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport {\n RootConfig,\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\n\nimport {\n AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID,\n AXM_ORG_CHART_EMPLOYEE_SUBMENU_ICON,\n AXM_ORG_CHART_EMPLOYEE_SUBMENU_TITLE_I18N_KEY,\n} from '../constants/org-chart-employee-submenu.const';\nimport {\n AXMOrgChartNodeContributionContext,\n AXMOrgChartNodeContributionProvider,\n AXMOrgChartNodeMenuAction,\n} from '../tokens/org-chart-node-contribution.token';\nimport { axmResolveOrgChartFlyoutEmployeeId } from '../utils/org-chart-resolve-flyout-employee-id.util';\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst actionKey = (suffix: string): string =>\n `@organization-management:organization-chart.node-actions.${suffix}`;\n\nconst HCM_EMPLOYEE_MODULE = 'HumanCapitalManagement';\nconst HCM_EMPLOYEE_NAME = 'Employee';\nconst HCM_EMPLOYEE_SOURCE = `${HCM_EMPLOYEE_MODULE}.${HCM_EMPLOYEE_NAME}`;\n\n//#endregion\n\n/**\n * **Employee** context-submenu: open employee record (`Entity:OpenDetails`), HR placeholders, schedule, add-to-team — plus chat/email from extensions.\n * Shown for {@link AXMOrgChartNodeKind} `employee` and for company / business unit / filled position when an\n * assigned person id is available; hidden when head or top role is vacant.\n */\n@Injectable()\nexport class AXMOrgChartEmployeeFlyoutContributionProvider implements AXMOrgChartNodeContributionProvider {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly dialogService = inject(AXDialogService);\n private readonly translationService = inject(AXTranslationService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly entityDataSelector = inject(AXPEntityDataSelectorService);\n\n private readonly teamMemberEntityInfo = {\n module: RootConfig.module.name,\n name: RootConfig.entities.teamMember.name,\n title: RootConfig.entities.teamMember.title,\n };\n\n //#endregion\n\n //#region ---- AXMOrgChartNodeContributionProvider ----\n\n async getMenuActions(context: AXMOrgChartNodeContributionContext): Promise<AXMOrgChartNodeMenuAction[]> {\n const employeeId = axmResolveOrgChartFlyoutEmployeeId(context);\n if (!employeeId) {\n return [];\n }\n return this.buildFlyoutActions(context, employeeId);\n }\n\n //#endregion\n\n //#region ---- Flyout actions ----\n\n private buildFlyoutActions(\n context: AXMOrgChartNodeContributionContext,\n employeeId: string,\n ): AXMOrgChartNodeMenuAction[] {\n void context;\n const canViewEmployee = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainEmployees);\n const canTeam = this.authorize(AXPPeopleOrganizationPermissionKeys.MaintainTeams);\n\n return [\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.open-employee-details',\n title: actionKey('open'),\n icon: 'fa-light fa-arrow-up-right-from-square',\n order: 35,\n disabled: !canViewEmployee,\n execute: async () => {\n await this.commandService.execute('Entity:OpenDetails', {\n entity: HCM_EMPLOYEE_SOURCE,\n data: { id: employeeId },\n });\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.hr-transfer',\n title: actionKey('hr-workflow-transfer'),\n icon: 'fa-light fa-right-left',\n order: 60,\n submenuSectionBreak: true,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.hr-workflow.title'),\n actionKey('placeholders.hr-workflow.transfer'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.hr-promotion',\n title: actionKey('hr-workflow-promotion'),\n icon: 'fa-light fa-arrow-trend-up',\n order: 61,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.hr-workflow.title'),\n actionKey('placeholders.hr-workflow.promotion'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.hr-offboarding',\n title: actionKey('hr-workflow-offboarding'),\n icon: 'fa-light fa-door-open',\n order: 62,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.hr-workflow.title'),\n actionKey('placeholders.hr-workflow.offboarding'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.schedule-meeting',\n title: actionKey('schedule-meeting'),\n icon: 'fa-light fa-calendar-plus',\n order: 70,\n submenuSectionBreak: true,\n execute: async () => {\n await this.showPlaceholder(\n actionKey('placeholders.schedule-meeting.title'),\n actionKey('placeholders.schedule-meeting.message'),\n );\n },\n }),\n this.withEmployeeSubmenu({\n id: 'organization-management.org-chart.add-to-team',\n title: actionKey('add-to-team'),\n icon: 'fa-light fa-user-plus',\n order: 75,\n /** Trailing group break: separator after the Employee row on the root menu (inner last-row break is normalized away). */\n break: 'after',\n disabled: !canTeam,\n execute: async (ctx) => {\n await this.openTeamSelectorThenCreateTeamMember(ctx, employeeId);\n },\n }),\n ];\n }\n\n /**\n * Picks a team via {@link AXPEntityDataSelectorService}, then opens **Create Team Member** with both `teamId` and\n * `employeeId` set.\n */\n private async openTeamSelectorThenCreateTeamMember(\n ctx: AXMOrgChartNodeContributionContext,\n employeeId: string,\n ): Promise<void> {\n const teamEntity = await this.entityRegistry.resolve(RootConfig.module.name, RootConfig.entities.team.name);\n if (!teamEntity) {\n return;\n }\n const title = await this.translationService.translateAsync(actionKey('add-to-team-select-team'));\n const pick = await this.entityDataSelector.open({\n entity: teamEntity,\n title,\n allowMultiple: false,\n });\n const teamId = pick?.items?.[0]?.id;\n if (teamId == null || String(teamId).trim().length === 0) {\n return;\n }\n\n const result = await this.commandService.execute('Entity:Create', {\n entity: RootConfig.entities.teamMember.source,\n entityInfo: this.teamMemberEntityInfo,\n data: { employeeId, teamId: String(teamId).trim() },\n options: {\n process: {\n redirect: false,\n },\n },\n \n });\n if (result?.success) {\n await ctx.refreshChart();\n }\n }\n\n private withEmployeeSubmenu(\n action: AXMOrgChartNodeMenuAction,\n ): AXMOrgChartNodeMenuAction {\n return {\n ...action,\n submenuGroupId: AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID,\n submenuGroupTitle: AXM_ORG_CHART_EMPLOYEE_SUBMENU_TITLE_I18N_KEY,\n submenuGroupIcon: AXM_ORG_CHART_EMPLOYEE_SUBMENU_ICON,\n };\n }\n\n //#endregion\n\n //#region ---- Resolvers ----\n\n private authorize(permission: string): boolean {\n return this.sessionService.authorize(permission);\n }\n\n private async showPlaceholder(titleKey: string, messageKey: string): Promise<void> {\n const title = await this.translationService.translateAsync(titleKey);\n const message = await this.translationService.translateAsync(messageKey);\n await this.dialogService.alert(title, message, 'primary');\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAyBA;AAEA;AAEA,MAAM,SAAS,GAAG,CAAC,MAAc,KAC/B,CAAA,yDAAA,EAA4D,MAAM,CAAA,CAAE;AAEtE,MAAM,mBAAmB,GAAG,wBAAwB;AACpD,MAAM,iBAAiB,GAAG,UAAU;AACpC,MAAM,mBAAmB,GAAG,CAAA,EAAG,mBAAmB,CAAA,CAAA,EAAI,iBAAiB,EAAE;AAEzE;AAEA;;;;AAIG;MAEU,6CAA6C,CAAA;AAD1D,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AACvC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,kCAAkC,CAAC;AAC3D,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,4BAA4B,CAAC;AAEzD,QAAA,IAAA,CAAA,oBAAoB,GAAG;AACtC,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,YAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI;AACzC,YAAA,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK;SAC5C;AA0KF,IAAA;;;IApKC,MAAM,cAAc,CAAC,OAA2C,EAAA;AAC9D,QAAA,MA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