@acorex/modules 21.0.0-next.43 → 21.0.0-next.44
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-modules-ai-management.mjs +31 -225
- package/fesm2022/acorex-modules-ai-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-acorex-modules-human-capital-management-Bwk3-2wy.mjs → acorex-modules-human-capital-management-acorex-modules-human-capital-management-hImDhzkB.mjs} +16 -19
- package/fesm2022/acorex-modules-human-capital-management-acorex-modules-human-capital-management-hImDhzkB.mjs.map +1 -0
- package/fesm2022/{acorex-modules-human-capital-management-approve-leave-request.command-B5aSubCY.mjs → acorex-modules-human-capital-management-approve-leave-request.command-DujyJOvo.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-approve-leave-request.command-B5aSubCY.mjs.map → acorex-modules-human-capital-management-approve-leave-request.command-DujyJOvo.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-assign-position-assignment.command-l8dGe3kg.mjs → acorex-modules-human-capital-management-assign-position-assignment.command-BPB9vaCn.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-assign-position-assignment.command-l8dGe3kg.mjs.map → acorex-modules-human-capital-management-assign-position-assignment.command-BPB9vaCn.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-cancel-leave-request.command-CeV-5Y5n.mjs → acorex-modules-human-capital-management-cancel-leave-request.command-BdPUdhbU.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-cancel-leave-request.command-CeV-5Y5n.mjs.map → acorex-modules-human-capital-management-cancel-leave-request.command-BdPUdhbU.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-employee.entity-DNgt9yQm.mjs → acorex-modules-human-capital-management-employee.entity-CgmF-WPf.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-employee.entity-DNgt9yQm.mjs.map → acorex-modules-human-capital-management-employee.entity-CgmF-WPf.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-employment-type.entity-rq8-Bauc.mjs → acorex-modules-human-capital-management-employment-type.entity-Chio_E9S.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-employment-type.entity-rq8-Bauc.mjs.map → acorex-modules-human-capital-management-employment-type.entity-Chio_E9S.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-leave-request.entity-DlQJw4F6.mjs → acorex-modules-human-capital-management-leave-request.entity--9iGu0H7.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-leave-request.entity-DlQJw4F6.mjs.map → acorex-modules-human-capital-management-leave-request.entity--9iGu0H7.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-leave-type.entity-D5J2oOuY.mjs → acorex-modules-human-capital-management-leave-type.entity-O0j4P2oU.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-leave-type.entity-D5J2oOuY.mjs.map → acorex-modules-human-capital-management-leave-type.entity-O0j4P2oU.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-position-assignment.entity-D7mKhxYp.mjs → acorex-modules-human-capital-management-position-assignment.entity-Bg6omEy_.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-position-assignment.entity-D7mKhxYp.mjs.map → acorex-modules-human-capital-management-position-assignment.entity-Bg6omEy_.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-reject-leave-request.command-C4AWFOmG.mjs → acorex-modules-human-capital-management-reject-leave-request.command-ZNGufyB1.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-reject-leave-request.command-C4AWFOmG.mjs.map → acorex-modules-human-capital-management-reject-leave-request.command-ZNGufyB1.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-human-capital-management-revoke-position-assignment.command-BSJhBW3p.mjs → acorex-modules-human-capital-management-revoke-position-assignment.command-C8pwJExa.mjs} +2 -2
- package/fesm2022/{acorex-modules-human-capital-management-revoke-position-assignment.command-BSJhBW3p.mjs.map → acorex-modules-human-capital-management-revoke-position-assignment.command-C8pwJExa.mjs.map} +1 -1
- package/fesm2022/acorex-modules-human-capital-management.mjs +1 -1
- package/fesm2022/{acorex-modules-organization-management-acorex-modules-organization-management-Dqhk5reQ.mjs → acorex-modules-organization-management-acorex-modules-organization-management-CGzZcKEy.mjs} +141 -578
- package/fesm2022/acorex-modules-organization-management-acorex-modules-organization-management-CGzZcKEy.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-management-add-business-unit-to-business-unit.command-pnxqURIQ.mjs → acorex-modules-organization-management-add-business-unit-to-business-unit.command-BEJyfR3P.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-add-business-unit-to-business-unit.command-pnxqURIQ.mjs.map → acorex-modules-organization-management-add-business-unit-to-business-unit.command-BEJyfR3P.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-add-position-to-business-unit.command-DbHKd1Nd.mjs → acorex-modules-organization-management-add-position-to-business-unit.command-DKgxg9q5.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-add-position-to-business-unit.command-DbHKd1Nd.mjs.map → acorex-modules-organization-management-add-position-to-business-unit.command-DKgxg9q5.mjs.map} +1 -1
- package/fesm2022/acorex-modules-organization-management-add-team-to-business-unit.command-DJJT7BXT.mjs +130 -0
- package/fesm2022/acorex-modules-organization-management-add-team-to-business-unit.command-DJJT7BXT.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-management-business-unit.entity-FsF290Im.mjs → acorex-modules-organization-management-business-unit.entity-BAp38sib.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-business-unit.entity-FsF290Im.mjs.map → acorex-modules-organization-management-business-unit.entity-BAp38sib.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-chart.entity-_OJkO2zX.mjs → acorex-modules-organization-management-chart.entity-WfmpWj8R.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-chart.entity-_OJkO2zX.mjs.map → acorex-modules-organization-management-chart.entity-WfmpWj8R.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-company.entity-Dw7_BvxV.mjs → acorex-modules-organization-management-company.entity-BUVLrwjq.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-company.entity-Dw7_BvxV.mjs.map → acorex-modules-organization-management-company.entity-BUVLrwjq.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-entity.provider-BWw2RN_V.mjs → acorex-modules-organization-management-entity.provider-DH3eUGTu.mjs} +15 -15
- package/fesm2022/{acorex-modules-organization-management-entity.provider-BWw2RN_V.mjs.map → acorex-modules-organization-management-entity.provider-DH3eUGTu.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-feature-definition.provider-D3WYwpy0.mjs → acorex-modules-organization-management-feature-definition.provider-DuScrBze.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-feature-definition.provider-D3WYwpy0.mjs.map → acorex-modules-organization-management-feature-definition.provider-DuScrBze.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-job-definition-pages-component.provider-CnS_nu1v.mjs → acorex-modules-organization-management-job-definition-pages-component.provider-D-J9JCsU.mjs} +3 -3
- package/fesm2022/{acorex-modules-organization-management-job-definition-pages-component.provider-CnS_nu1v.mjs.map → acorex-modules-organization-management-job-definition-pages-component.provider-D-J9JCsU.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-job-definition-responsibilities-page.component-ZTopEh2M.mjs → acorex-modules-organization-management-job-definition-responsibilities-page.component-Dsy5rFGw.mjs} +3 -3
- package/fesm2022/{acorex-modules-organization-management-job-definition-responsibilities-page.component-ZTopEh2M.mjs.map → acorex-modules-organization-management-job-definition-responsibilities-page.component-Dsy5rFGw.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-job-definition-skills-page.component-Yyzwqg0v.mjs → acorex-modules-organization-management-job-definition-skills-page.component-B73wLPby.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-job-definition-skills-page.component-Yyzwqg0v.mjs.map → acorex-modules-organization-management-job-definition-skills-page.component-B73wLPby.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-job-definition.entity-DJjmv1hf.mjs → acorex-modules-organization-management-job-definition.entity-B7mWKYqb.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-job-definition.entity-DJjmv1hf.mjs.map → acorex-modules-organization-management-job-definition.entity-B7mWKYqb.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-job-level.datasource-DJH3zaNN.mjs → acorex-modules-organization-management-job-level.datasource-DibRoKXR.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-job-level.datasource-DJH3zaNN.mjs.map → acorex-modules-organization-management-job-level.datasource-DibRoKXR.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-job-level.entity-DBEFEBzu.mjs → acorex-modules-organization-management-job-level.entity-C_MzeTw5.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-job-level.entity-DBEFEBzu.mjs.map → acorex-modules-organization-management-job-level.entity-C_MzeTw5.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-menu.provider-yGn338K1.mjs → acorex-modules-organization-management-menu.provider-CQeJINzl.mjs} +3 -2
- package/fesm2022/{acorex-modules-organization-management-menu.provider-yGn338K1.mjs.map → acorex-modules-organization-management-menu.provider-CQeJINzl.mjs.map} +1 -1
- package/fesm2022/acorex-modules-organization-management-org-chart-default-node-contribution.provider-D3hCHSr_.mjs +228 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-default-node-contribution.provider-D3hCHSr_.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-employee-flyout-contribution.provider-Bv0I-45L.mjs +182 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-employee-flyout-contribution.provider-Bv0I-45L.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-position-employee-node-contribution.provider-DbfYza8q.mjs +170 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-position-employee-node-contribution.provider-DbfYza8q.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-ux-node-contribution.provider-C9APxguL.mjs +334 -0
- package/fesm2022/acorex-modules-organization-management-org-chart-ux-node-contribution.provider-C9APxguL.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-management-org-chart.page-C1J123cl.mjs → acorex-modules-organization-management-org-chart.page-BcHO5kKP.mjs} +104 -19
- package/fesm2022/acorex-modules-organization-management-org-chart.page-BcHO5kKP.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-management-permission-definition.provider-B1f668X4.mjs → acorex-modules-organization-management-permission-definition.provider-BcIRJpBt.mjs} +3 -2
- package/fesm2022/{acorex-modules-organization-management-permission-definition.provider-B1f668X4.mjs.map → acorex-modules-organization-management-permission-definition.provider-BcIRJpBt.mjs.map} +1 -1
- package/fesm2022/acorex-modules-organization-management-permission.keys-DwZNBc12.mjs +56 -0
- package/fesm2022/acorex-modules-organization-management-permission.keys-DwZNBc12.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-management-position.entity-BvSjM5Hs.mjs → acorex-modules-organization-management-position.entity-DBOpLtSI.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-position.entity-BvSjM5Hs.mjs.map → acorex-modules-organization-management-position.entity-DBOpLtSI.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-remove-position-from-business-unit.command-CPdbVSno.mjs → acorex-modules-organization-management-remove-position-from-business-unit.command-TqYgfnsy.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-remove-position-from-business-unit.command-CPdbVSno.mjs.map → acorex-modules-organization-management-remove-position-from-business-unit.command-TqYgfnsy.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-replace-position-assignee.command-CQRcVN6R.mjs → acorex-modules-organization-management-replace-position-assignee.command-BJ2gn0-A.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-replace-position-assignee.command-CQRcVN6R.mjs.map → acorex-modules-organization-management-replace-position-assignee.command-BJ2gn0-A.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-responsibilities-matrix-widget-edit.component-Ce3T04Qb.mjs → acorex-modules-organization-management-responsibilities-matrix-widget-edit.component-CZdMLIL-.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-responsibilities-matrix-widget-edit.component-Ce3T04Qb.mjs.map → acorex-modules-organization-management-responsibilities-matrix-widget-edit.component-CZdMLIL-.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-responsibilities-matrix-widget-view.component-CIr7JDX-.mjs → acorex-modules-organization-management-responsibilities-matrix-widget-view.component-BBo97rDN.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-responsibilities-matrix-widget-view.component-CIr7JDX-.mjs.map → acorex-modules-organization-management-responsibilities-matrix-widget-view.component-BBo97rDN.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-responsibilities-matrix.component-BXWso7Ga.mjs → acorex-modules-organization-management-responsibilities-matrix.component-D9oH_Fbb.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-responsibilities-matrix.component-BXWso7Ga.mjs.map → acorex-modules-organization-management-responsibilities-matrix.component-D9oH_Fbb.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-responsibility-level.entity-DB04XTJ8.mjs → acorex-modules-organization-management-responsibility-level.entity-D6IG9Zc7.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-responsibility-level.entity-DB04XTJ8.mjs.map → acorex-modules-organization-management-responsibility-level.entity-D6IG9Zc7.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-responsibility.entity-BMqhYqJS.mjs → acorex-modules-organization-management-responsibility.entity-BosNxYjW.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-responsibility.entity-BMqhYqJS.mjs.map → acorex-modules-organization-management-responsibility.entity-BosNxYjW.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-settings.provider-BhIJkbq_.mjs → acorex-modules-organization-management-settings.provider-CL9C9UXA.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-settings.provider-BhIJkbq_.mjs.map → acorex-modules-organization-management-settings.provider-CL9C9UXA.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-team-business-unit.entity-DkTtZv7y.mjs → acorex-modules-organization-management-team-business-unit.entity-CYFGTcHe.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-team-business-unit.entity-DkTtZv7y.mjs.map → acorex-modules-organization-management-team-business-unit.entity-CYFGTcHe.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-team-member-role.entity-DPqEPpkP.mjs → acorex-modules-organization-management-team-member-role.entity-B5vNDne0.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-team-member-role.entity-DPqEPpkP.mjs.map → acorex-modules-organization-management-team-member-role.entity-B5vNDne0.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-organization-management-team-member.entity-IN-CPv5W.mjs → acorex-modules-organization-management-team-member.entity-DsKuxCRB.mjs} +14 -2
- package/fesm2022/acorex-modules-organization-management-team-member.entity-DsKuxCRB.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-management-team.entity-D7B8ulFX.mjs → acorex-modules-organization-management-team.entity-Cg30cho_.mjs} +2 -2
- package/fesm2022/{acorex-modules-organization-management-team.entity-D7B8ulFX.mjs.map → acorex-modules-organization-management-team.entity-Cg30cho_.mjs.map} +1 -1
- package/fesm2022/acorex-modules-organization-management.mjs +1 -1
- package/fesm2022/{acorex-modules-task-management-acorex-modules-task-management-CWlgXg_u.mjs → acorex-modules-task-management-acorex-modules-task-management-DDUq9FpA.mjs} +178 -14
- package/fesm2022/acorex-modules-task-management-acorex-modules-task-management-DDUq9FpA.mjs.map +1 -0
- package/fesm2022/{acorex-modules-task-management-task-board.page-Bxpga0DN.mjs → acorex-modules-task-management-task-board.page-C6j-_aSD.mjs} +106 -68
- package/fesm2022/acorex-modules-task-management-task-board.page-C6j-_aSD.mjs.map +1 -0
- package/fesm2022/acorex-modules-task-management.mjs +1 -1
- package/organization-management/README.md +1 -1
- package/package.json +2 -2
- package/types/acorex-modules-ai-management.d.ts +25 -67
- package/types/acorex-modules-organization-management.d.ts +128 -69
- package/types/acorex-modules-task-management.d.ts +12 -1
- package/fesm2022/acorex-modules-human-capital-management-acorex-modules-human-capital-management-Bwk3-2wy.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-management-acorex-modules-organization-management-Dqhk5reQ.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-management-org-chart.page-C1J123cl.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-management-team-member.entity-IN-CPv5W.mjs.map +0 -1
- package/fesm2022/acorex-modules-task-management-acorex-modules-task-management-CWlgXg_u.mjs.map +0 -1
- package/fesm2022/acorex-modules-task-management-task-board.page-Bxpga0DN.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-modules-organization-management-org-chart-position-employee-node-contribution.provider-DbfYza8q.mjs","sources":["../../../../libs/modules/organization-management/src/lib/features/organization-chart/contributions/org-chart-position-employee-node-contribution.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPSessionService } from '@acorex/platform/auth';\nimport { AXPCommandService } from '@acorex/platform/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport {\n AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND,\n AXMOrganizationManagementCommandKeys,\n} from '../../../commands.keys';\nimport { RootConfig } from '../../../const';\nimport { AXPOrganizationManagementPermissionKeys } from '../../../permission.keys';\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\nconst POSITION_ENTITY_SOURCE = RootConfig.entities.position.source;\n\nconst positionAssignmentCreatePermission = 'HumanCapitalManagement:Permission:PositionAssignment.Create';\nconst positionAssignmentEditPermission = 'HumanCapitalManagement:Permission:PositionAssignment.Edit';\n\n//#endregion\n\n/**\n * Context menu actions for org chart **position** nodes (structure / location / etc.).\n */\n@Injectable()\nexport class AXMOrgChartPositionEmployeeNodeContributionProvider implements AXMOrgChartNodeContributionProvider {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n\n //#endregion\n\n //#region ---- AXMOrgChartNodeContributionProvider Implementation ----\n\n async getMenuActions(context: AXMOrgChartNodeContributionContext): Promise<AXMOrgChartNodeMenuAction[]> {\n if (context.nodeKind === 'position') {\n return this.getPositionNodeActions(context);\n }\n return [];\n }\n\n //#endregion\n\n //#region ---- Position Node Actions ----\n\n private getPositionNodeActions(context: AXMOrgChartNodeContributionContext): AXMOrgChartNodeMenuAction[] {\n const positionId = this.resolvePositionId(context);\n if (!positionId) {\n return [];\n }\n\n const businessUnitId = this.resolveBusinessUnitIdForPosition(context);\n const vacant = context.node.metadata?.['vacant'] === true;\n const occupant = context.node.metadata?.['occupant'] as Record<string, unknown> | undefined;\n const occupantEmployeeId =\n typeof occupant?.['employeeId'] === 'string' && occupant['employeeId'].trim().length > 0\n ? occupant['employeeId'].trim()\n : undefined;\n\n const canUpdateBusinessUnit = this.authorize(AXPOrganizationManagementPermissionKeys.BusinessUnit.Update);\n const canCreateAssignment = this.authorize(positionAssignmentCreatePermission);\n const canEditAssignment = this.authorize(positionAssignmentEditPermission);\n\n const actions: AXMOrgChartNodeMenuAction[] = [];\n\n if (vacant && businessUnitId) {\n actions.push({\n id: 'organization-management.assign-employee-to-position-from-chart',\n title: orgChartNodeActionKey('assign-employee-to-position'),\n icon: 'fa-light fa-user-plus',\n order: 110,\n disabled: !canCreateAssignment,\n execute: async (ctx) => {\n const pid = this.resolvePositionId(ctx);\n const buId = this.resolveBusinessUnitIdForPosition(ctx);\n if (!pid || !buId) {\n return;\n }\n const result = await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND, {\n data: {\n businessUnitId: buId,\n positionId: pid,\n isPrimary: false,\n },\n });\n if (result?.success) {\n await ctx.refreshChart();\n }\n },\n });\n }\n\n if (!vacant && occupantEmployeeId && businessUnitId) {\n actions.push({\n id: 'organization-management.replace-position-assignee-from-chart',\n title: orgChartNodeActionKey('assign-new-employee-to-position'),\n icon: 'fa-light fa-arrows-rotate',\n order: 115,\n disabled: !canCreateAssignment || !canEditAssignment,\n execute: async (ctx) => {\n const pid = this.resolvePositionId(ctx);\n const buId = this.resolveBusinessUnitIdForPosition(ctx);\n const occ = ctx.node.metadata?.['occupant'] as Record<string, unknown> | undefined;\n const eid =\n typeof occ?.['employeeId'] === 'string' && occ['employeeId'].trim().length > 0\n ? occ['employeeId'].trim()\n : '';\n if (!pid || !buId || !eid) {\n return;\n }\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.ReplacePositionAssignee,\n { businessUnitId: buId, positionId: pid, currentEmployeeId: eid },\n );\n if (result?.success) {\n await ctx.refreshChart();\n }\n },\n });\n }\n\n if (businessUnitId) {\n actions.push({\n id: 'organization-management.remove-position-from-unit-from-chart',\n title: orgChartNodeActionKey('remove-from-unit'),\n icon: 'fa-light fa-link-slash',\n color: 'danger',\n order: 120,\n disabled: !canUpdateBusinessUnit,\n execute: async (ctx) => {\n const pid = this.resolvePositionId(ctx);\n const buId = this.resolveBusinessUnitIdForPosition(ctx);\n if (!pid || !buId) {\n return;\n }\n const occ = ctx.node.metadata?.['occupant'] as Record<string, unknown> | undefined;\n const occId =\n typeof occ?.['employeeId'] === 'string' && occ['employeeId'].trim().length > 0\n ? occ['employeeId'].trim()\n : undefined;\n const result = await this.commandService.execute(\n AXMOrganizationManagementCommandKeys.OrganizationChart.RemovePositionFromBusinessUnit,\n {\n businessUnitId: buId,\n positionId: pid,\n ...(occId ? { occupantEmployeeId: occId } : {}),\n },\n );\n if (result?.success) {\n await ctx.refreshChart();\n }\n },\n });\n }\n\n return actions;\n }\n\n //#endregion\n\n //#region ---- Resolvers & Authorization ----\n\n private authorize(permission: string): boolean {\n return this.sessionService.authorize(permission);\n }\n\n private resolvePositionId(context: AXMOrgChartNodeContributionContext): string | undefined {\n const entity = context.node.entity;\n if (entity?.id != null && this.isPositionEntityType(entity.type)) {\n const id = String(entity.id).trim();\n return id.length > 0 ? id : undefined;\n }\n const metaPid = context.node.metadata?.['positionId'];\n if (typeof metaPid === 'string' && metaPid.trim().length > 0) {\n return metaPid.trim();\n }\n return undefined;\n }\n\n private isPositionEntityType(entityType: string | undefined): boolean {\n if (!entityType || typeof entityType !== 'string') {\n return false;\n }\n return entityType === POSITION_ENTITY_SOURCE || entityType.endsWith('.Position');\n }\n\n private resolveBusinessUnitIdForPosition(context: AXMOrgChartNodeContributionContext): string | undefined {\n const meta = context.node.metadata ?? {};\n const a = meta['businessUnitId'];\n const b = meta['organizationalUnitId'];\n const raw = (typeof a === 'string' && a.trim().length > 0 ? a : typeof b === 'string' ? b : '') as string;\n const id = String(raw).trim();\n return id.length > 0 ? id : undefined;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;AAAA;AAiBA;AAEA;AAEA,MAAM,qBAAqB,GAAG,CAAC,MAAc,KAC3C,CAAA,yDAAA,EAA4D,MAAM,CAAA,CAAE;AAEtE,MAAM,sBAAsB,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM;AAElE,MAAM,kCAAkC,GAAG,6DAA6D;AACxG,MAAM,gCAAgC,GAAG,2DAA2D;AAEpG;AAEA;;AAEG;MAEU,mDAAmD,CAAA;AADhE,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAwK5D,IAAA;;;IAlKC,MAAM,cA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YAAA,OAAO,OAAO,CAAC,IAAI,EAAE;QACvB;AACA,QAAA,OAAO,SAAS;IAClB;AAEQ,IAAA,oBAAoB,CAAC,UAA8B,EAAA;QACzD,IAAI,CAAC,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,EAAE;AACjD,YAAA,OAAO,KAAK;QACd;QACA,OAAO,UAAU,KAAK,sBAAsB,IAAI,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC;IAClF;AAEQ,IAAA,gCAAgC,CAAC,OAA2C,EAAA;QAClF,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE;AACxC,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC;AAChC,QAAA,MAAM,CAAC,GAAG,IAAI,CAAC,sBAAsB,CAAC;AACtC,QAAA,MAAM,GAAG,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,KAAK,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAW;QACzG,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;AAC7B,QAAA,OAAO,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,SAAS;IACvC;8GAzKW,mDAAmD,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAnD,mDAAmD,EAAA,CAAA,CAAA;;2FAAnD,mDAAmD,EAAA,UAAA,EAAA,CAAA;kBAD/D;;;;;"}
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { AXPSessionService } from '@acorex/platform/auth';
|
|
2
|
+
import { AXPCommandService } from '@acorex/platform/runtime';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, Injectable } from '@angular/core';
|
|
5
|
+
import { R as RootConfig, m as AXM_ORG_CHART_LAYOUT_SUBMENU_ICON, o as AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY, q as AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID, i as AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND, a as AXMOrgChartNodeType } from './acorex-modules-organization-management-acorex-modules-organization-management-CGzZcKEy.mjs';
|
|
6
|
+
import { A as AXPOrganizationManagementPermissionKeys } from './acorex-modules-organization-management-permission.keys-DwZNBc12.mjs';
|
|
7
|
+
|
|
8
|
+
//#region ---- Imports ----
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ---- Constants ----
|
|
11
|
+
const actionKey = (suffix) => `@organization-management:organization-chart.node-actions.${suffix}`;
|
|
12
|
+
const TENANT_VIEW_PERMISSION = 'TenantManagement:Permission:Management';
|
|
13
|
+
const POSITION_ENTITY_SOURCE = RootConfig.entities.position.source;
|
|
14
|
+
const BUSINESS_UNIT_ENTITY_SOURCE = RootConfig.entities.businessUnit.source;
|
|
15
|
+
const TENANT_ENTITY_SOURCE = 'TenantManagement.Tenant';
|
|
16
|
+
const COMPANY_ENTITY_SOURCE = RootConfig.entities.company.source;
|
|
17
|
+
//#endregion
|
|
18
|
+
/**
|
|
19
|
+
* Org chart context menus: open record details, nested expand/collapse, multi-seat assign, HR stubs.
|
|
20
|
+
*/
|
|
21
|
+
class AXMOrgChartUxNodeContributionProvider {
|
|
22
|
+
constructor() {
|
|
23
|
+
//#region ---- Services & Dependencies ----
|
|
24
|
+
this.commandService = inject(AXPCommandService);
|
|
25
|
+
this.sessionService = inject(AXPSessionService);
|
|
26
|
+
this.positionAssignmentCreatePermission = 'HumanCapitalManagement:Permission:PositionAssignment.Create';
|
|
27
|
+
this.tenantEntityInfo = {
|
|
28
|
+
module: 'TenantManagement',
|
|
29
|
+
name: 'Tenant',
|
|
30
|
+
title: '@tenant-management:tenants.entities.tenant.title',
|
|
31
|
+
};
|
|
32
|
+
this.companyEntityInfo = {
|
|
33
|
+
module: RootConfig.module.name,
|
|
34
|
+
name: RootConfig.entities.company.name,
|
|
35
|
+
title: RootConfig.entities.company.title,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region ---- AXMOrgChartNodeContributionProvider ----
|
|
40
|
+
async getMenuActions(context) {
|
|
41
|
+
const actions = [
|
|
42
|
+
...this.getCrossCuttingActions(context),
|
|
43
|
+
...this.getKindSpecificActions(context),
|
|
44
|
+
];
|
|
45
|
+
return actions;
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region ---- Cross-cutting ----
|
|
49
|
+
getCrossCuttingActions(context) {
|
|
50
|
+
const hasChildren = (context.node.children?.length ?? 0) > 0;
|
|
51
|
+
const expanded = context.node.isExpanded !== false;
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
id: 'organization-management.org-chart.toggle-detail-panel',
|
|
55
|
+
title: actionKey('toggle-detail-panel'),
|
|
56
|
+
icon: 'fa-light fa-sidebar',
|
|
57
|
+
/** After Communication and structure actions; before Remove (120). */
|
|
58
|
+
order: 117,
|
|
59
|
+
break: 'before',
|
|
60
|
+
submenuGroupId: AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID,
|
|
61
|
+
submenuGroupTitle: AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY,
|
|
62
|
+
submenuGroupIcon: AXM_ORG_CHART_LAYOUT_SUBMENU_ICON,
|
|
63
|
+
/** Separator before expand/collapse nested rows (never on the last row — that leaves a stray rule and gap). */
|
|
64
|
+
submenuSectionBreak: true,
|
|
65
|
+
execute: async (ctx) => {
|
|
66
|
+
ctx.host.toggleDetailPanel();
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'organization-management.org-chart.expand-branch',
|
|
71
|
+
title: actionKey('expand'),
|
|
72
|
+
icon: 'fa-light fa-square-plus',
|
|
73
|
+
order: 118,
|
|
74
|
+
submenuGroupId: AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID,
|
|
75
|
+
submenuGroupTitle: AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY,
|
|
76
|
+
submenuGroupIcon: AXM_ORG_CHART_LAYOUT_SUBMENU_ICON,
|
|
77
|
+
disabled: !hasChildren || expanded,
|
|
78
|
+
execute: async (ctx) => {
|
|
79
|
+
ctx.host.setNodeBranchExpanded(ctx.node, true);
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: 'organization-management.org-chart.collapse-branch',
|
|
84
|
+
title: actionKey('collapse'),
|
|
85
|
+
icon: 'fa-light fa-square-minus',
|
|
86
|
+
order: 119,
|
|
87
|
+
submenuGroupId: AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID,
|
|
88
|
+
submenuGroupTitle: AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY,
|
|
89
|
+
submenuGroupIcon: AXM_ORG_CHART_LAYOUT_SUBMENU_ICON,
|
|
90
|
+
/** Trailing group break: separator after the View & Layout row on the root menu (inner last-row break is normalized away). */
|
|
91
|
+
break: 'after',
|
|
92
|
+
disabled: !hasChildren || !expanded,
|
|
93
|
+
execute: async (ctx) => {
|
|
94
|
+
ctx.host.setNodeBranchExpanded(ctx.node, false);
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
//#endregion
|
|
100
|
+
//#region ---- Kind-specific ----
|
|
101
|
+
/**
|
|
102
|
+
* **Open** — `Entity:OpenDetails` (navigate to entity view route).
|
|
103
|
+
*/
|
|
104
|
+
buildOpenDetailsAction(args) {
|
|
105
|
+
return {
|
|
106
|
+
id: args.id,
|
|
107
|
+
title: actionKey('open'),
|
|
108
|
+
icon: 'fa-light fa-arrow-up-right-from-square',
|
|
109
|
+
order: args.order ?? 20,
|
|
110
|
+
break: args.breakAfter,
|
|
111
|
+
disabled: !args.canOpen,
|
|
112
|
+
execute: async (ctx) => {
|
|
113
|
+
const spec = args.resolve(ctx);
|
|
114
|
+
if (!spec) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
await this.commandService.execute('Entity:OpenDetails', {
|
|
118
|
+
entity: spec.entity,
|
|
119
|
+
data: { id: spec.id },
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
getKindSpecificActions(context) {
|
|
125
|
+
switch (context.nodeKind) {
|
|
126
|
+
case 'company-root':
|
|
127
|
+
return this.getCompanyRootActions(context);
|
|
128
|
+
case 'business-unit':
|
|
129
|
+
return this.getBusinessUnitActions(context);
|
|
130
|
+
case 'position':
|
|
131
|
+
return this.getPositionActions(context);
|
|
132
|
+
default:
|
|
133
|
+
return [];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
getCompanyRootActions(context) {
|
|
137
|
+
const viewTarget = this.resolveCompanyRootViewTarget(context.node);
|
|
138
|
+
if (!viewTarget) {
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
141
|
+
let canOpen = true;
|
|
142
|
+
if (viewTarget.kind === 'tenant') {
|
|
143
|
+
canOpen =
|
|
144
|
+
canOpen &&
|
|
145
|
+
(this.authorize(TENANT_VIEW_PERMISSION) ||
|
|
146
|
+
this.authorize(AXPOrganizationManagementPermissionKeys.Chart.Management));
|
|
147
|
+
}
|
|
148
|
+
else if (viewTarget.kind === 'company') {
|
|
149
|
+
canOpen =
|
|
150
|
+
canOpen && this.authorize(AXPOrganizationManagementPermissionKeys.OrganizationManagement.Management);
|
|
151
|
+
}
|
|
152
|
+
return [
|
|
153
|
+
this.buildOpenDetailsAction({
|
|
154
|
+
id: 'organization-management.org-chart.open-details',
|
|
155
|
+
canOpen,
|
|
156
|
+
breakAfter: 'after',
|
|
157
|
+
resolve: (ctx) => {
|
|
158
|
+
const target = this.resolveCompanyRootViewTarget(ctx.node);
|
|
159
|
+
return target ? { entity: target.source, id: target.id } : null;
|
|
160
|
+
},
|
|
161
|
+
}),
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
getBusinessUnitActions(context) {
|
|
165
|
+
const businessUnitId = this.resolveBusinessUnitId(context);
|
|
166
|
+
const canView = this.authorize(AXPOrganizationManagementPermissionKeys.BusinessUnit.View);
|
|
167
|
+
return [
|
|
168
|
+
...(businessUnitId
|
|
169
|
+
? [
|
|
170
|
+
this.buildOpenDetailsAction({
|
|
171
|
+
id: 'organization-management.org-chart.open-details',
|
|
172
|
+
canOpen: canView,
|
|
173
|
+
breakAfter: 'after',
|
|
174
|
+
resolve: (ctx) => {
|
|
175
|
+
const id = this.resolveBusinessUnitId(ctx);
|
|
176
|
+
return id ? { entity: BUSINESS_UNIT_ENTITY_SOURCE, id } : null;
|
|
177
|
+
},
|
|
178
|
+
}),
|
|
179
|
+
]
|
|
180
|
+
: []),
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
getPositionActions(context) {
|
|
184
|
+
const positionId = this.resolvePositionId(context);
|
|
185
|
+
const businessUnitId = this.resolveBusinessUnitIdForPosition(context);
|
|
186
|
+
const capacity = this.resolvePositionCapacity(context.node);
|
|
187
|
+
const filled = this.resolveFilledAssignmentCount(context.node);
|
|
188
|
+
const canViewPosition = this.authorize(AXPOrganizationManagementPermissionKeys.Position.View);
|
|
189
|
+
const canAssignMore = this.authorize(this.positionAssignmentCreatePermission) &&
|
|
190
|
+
capacity > 1 &&
|
|
191
|
+
filled < capacity &&
|
|
192
|
+
Boolean(positionId) &&
|
|
193
|
+
Boolean(businessUnitId);
|
|
194
|
+
return [
|
|
195
|
+
...(positionId
|
|
196
|
+
? [
|
|
197
|
+
this.buildOpenDetailsAction({
|
|
198
|
+
id: 'organization-management.org-chart.open-details',
|
|
199
|
+
canOpen: canViewPosition,
|
|
200
|
+
breakAfter: 'after',
|
|
201
|
+
resolve: (ctx) => {
|
|
202
|
+
const id = this.resolvePositionId(ctx);
|
|
203
|
+
return id ? { entity: POSITION_ENTITY_SOURCE, id } : null;
|
|
204
|
+
},
|
|
205
|
+
}),
|
|
206
|
+
]
|
|
207
|
+
: []),
|
|
208
|
+
{
|
|
209
|
+
id: 'organization-management.org-chart.add-additional-assignee',
|
|
210
|
+
title: actionKey('add-additional-assignee'),
|
|
211
|
+
icon: 'fa-light fa-user-plus',
|
|
212
|
+
order: 108,
|
|
213
|
+
disabled: !canAssignMore,
|
|
214
|
+
execute: async (ctx) => {
|
|
215
|
+
const pid = this.resolvePositionId(ctx);
|
|
216
|
+
const buId = this.resolveBusinessUnitIdForPosition(ctx);
|
|
217
|
+
if (!pid || !buId) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
const result = await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND, {
|
|
221
|
+
data: {
|
|
222
|
+
businessUnitId: buId,
|
|
223
|
+
positionId: pid,
|
|
224
|
+
isPrimary: false,
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
if (result?.success) {
|
|
228
|
+
await ctx.refreshChart();
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
];
|
|
233
|
+
}
|
|
234
|
+
//#endregion
|
|
235
|
+
//#region ---- Resolvers ----
|
|
236
|
+
authorize(permission) {
|
|
237
|
+
return this.sessionService.authorize(permission);
|
|
238
|
+
}
|
|
239
|
+
resolveCompanyRootViewTarget(node) {
|
|
240
|
+
const ent = node.entity;
|
|
241
|
+
if (!ent?.id) {
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
const id = String(ent.id).trim();
|
|
245
|
+
if (!id) {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
const rawType = String(ent.type ?? '').trim();
|
|
249
|
+
if (rawType === 'tenant' || rawType.endsWith('.Tenant')) {
|
|
250
|
+
return { kind: 'tenant', source: TENANT_ENTITY_SOURCE, entityInfo: this.tenantEntityInfo, id };
|
|
251
|
+
}
|
|
252
|
+
if (rawType === COMPANY_ENTITY_SOURCE || rawType.endsWith('.Company')) {
|
|
253
|
+
return { kind: 'company', source: COMPANY_ENTITY_SOURCE, entityInfo: this.companyEntityInfo, id };
|
|
254
|
+
}
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
resolveBusinessUnitId(context) {
|
|
258
|
+
if (context.nodeKind === 'business-unit') {
|
|
259
|
+
const fromEntity = context.node.entity?.id;
|
|
260
|
+
const entityId = fromEntity != null && String(fromEntity).trim().length > 0 ? String(fromEntity).trim() : undefined;
|
|
261
|
+
return (entityId ??
|
|
262
|
+
context.node.metadata?.['businessUnitId']?.trim() ??
|
|
263
|
+
context.node.metadata?.['unitId']?.trim());
|
|
264
|
+
}
|
|
265
|
+
return undefined;
|
|
266
|
+
}
|
|
267
|
+
resolvePositionId(context) {
|
|
268
|
+
const entity = context.node.entity;
|
|
269
|
+
if (entity?.id != null && this.isPositionEntityType(entity.type)) {
|
|
270
|
+
const id = String(entity.id).trim();
|
|
271
|
+
return id.length > 0 ? id : undefined;
|
|
272
|
+
}
|
|
273
|
+
const metaPid = context.node.metadata?.['positionId'];
|
|
274
|
+
if (typeof metaPid === 'string' && metaPid.trim().length > 0) {
|
|
275
|
+
return metaPid.trim();
|
|
276
|
+
}
|
|
277
|
+
return undefined;
|
|
278
|
+
}
|
|
279
|
+
isPositionEntityType(entityType) {
|
|
280
|
+
if (!entityType || typeof entityType !== 'string') {
|
|
281
|
+
return false;
|
|
282
|
+
}
|
|
283
|
+
return entityType === POSITION_ENTITY_SOURCE || entityType.endsWith('.Position');
|
|
284
|
+
}
|
|
285
|
+
resolveBusinessUnitIdForPosition(context) {
|
|
286
|
+
const meta = context.node.metadata ?? {};
|
|
287
|
+
const a = meta['businessUnitId'];
|
|
288
|
+
const b = meta['organizationalUnitId'];
|
|
289
|
+
const raw = (typeof a === 'string' && a.trim().length > 0 ? a : typeof b === 'string' ? b : '');
|
|
290
|
+
const id = String(raw).trim();
|
|
291
|
+
return id.length > 0 ? id : undefined;
|
|
292
|
+
}
|
|
293
|
+
resolvePositionCapacity(node) {
|
|
294
|
+
const meta = node.metadata ?? {};
|
|
295
|
+
const raw = meta['capacity'];
|
|
296
|
+
if (typeof raw === 'number' && Number.isFinite(raw) && raw >= 1) {
|
|
297
|
+
return Math.floor(raw);
|
|
298
|
+
}
|
|
299
|
+
if (typeof raw === 'string') {
|
|
300
|
+
const n = Number(raw.trim());
|
|
301
|
+
if (Number.isFinite(n) && n >= 1) {
|
|
302
|
+
return Math.floor(n);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return 1;
|
|
306
|
+
}
|
|
307
|
+
resolveFilledAssignmentCount(node) {
|
|
308
|
+
const meta = node.metadata ?? {};
|
|
309
|
+
const fromMeta = meta['activeAssignmentCount'];
|
|
310
|
+
if (typeof fromMeta === 'number' && Number.isFinite(fromMeta) && fromMeta >= 0) {
|
|
311
|
+
return Math.floor(fromMeta);
|
|
312
|
+
}
|
|
313
|
+
const employeeChildren = node.children?.filter((c) => c.type === AXMOrgChartNodeType.Employee).length ?? 0;
|
|
314
|
+
if (employeeChildren > 0) {
|
|
315
|
+
return employeeChildren;
|
|
316
|
+
}
|
|
317
|
+
if (meta['vacant'] === true) {
|
|
318
|
+
return 0;
|
|
319
|
+
}
|
|
320
|
+
const occ = meta['occupant'];
|
|
321
|
+
if (typeof occ?.['employeeId'] === 'string' && occ['employeeId'].trim().length > 0) {
|
|
322
|
+
return 1;
|
|
323
|
+
}
|
|
324
|
+
return 0;
|
|
325
|
+
}
|
|
326
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMOrgChartUxNodeContributionProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
327
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMOrgChartUxNodeContributionProvider }); }
|
|
328
|
+
}
|
|
329
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXMOrgChartUxNodeContributionProvider, decorators: [{
|
|
330
|
+
type: Injectable
|
|
331
|
+
}] });
|
|
332
|
+
|
|
333
|
+
export { AXMOrgChartUxNodeContributionProvider };
|
|
334
|
+
//# sourceMappingURL=acorex-modules-organization-management-org-chart-ux-node-contribution.provider-C9APxguL.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-modules-organization-management-org-chart-ux-node-contribution.provider-C9APxguL.mjs","sources":["../../../../libs/modules/organization-management/src/lib/features/organization-chart/contributions/org-chart-ux-node-contribution.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPSessionService } from '@acorex/platform/auth';\nimport { AXPCommandService } from '@acorex/platform/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND } from '../../../commands.keys';\nimport { RootConfig } from '../../../const';\nimport { AXPOrganizationManagementPermissionKeys } from '../../../permission.keys';\nimport {\n AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID,\n AXM_ORG_CHART_LAYOUT_SUBMENU_ICON,\n AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY,\n} from '../constants/org-chart-layout-submenu.const';\nimport {\n AXMOrgChartNodeContributionContext,\n AXMOrgChartNodeContributionProvider,\n AXMOrgChartNodeMenuAction,\n} from '../tokens/org-chart-node-contribution.token';\nimport { AXMOrgChartNodeType, AXMOrganizationNode } from '../model/org-chart.type';\n\n//#endregion\n\n//#region ---- Constants ----\n\nconst actionKey = (suffix: string): string =>\n `@organization-management:organization-chart.node-actions.${suffix}`;\n\nconst TENANT_VIEW_PERMISSION = 'TenantManagement:Permission:Management';\n\nconst POSITION_ENTITY_SOURCE = RootConfig.entities.position.source;\n\nconst BUSINESS_UNIT_ENTITY_SOURCE = RootConfig.entities.businessUnit.source;\n\nconst TENANT_ENTITY_SOURCE = 'TenantManagement.Tenant';\n\nconst COMPANY_ENTITY_SOURCE = RootConfig.entities.company.source;\n\n//#endregion\n\n/**\n * Org chart context menus: open record details, nested expand/collapse, multi-seat assign, HR stubs.\n */\n@Injectable()\nexport class AXMOrgChartUxNodeContributionProvider implements AXMOrgChartNodeContributionProvider {\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n\n private readonly positionAssignmentCreatePermission =\n 'HumanCapitalManagement:Permission:PositionAssignment.Create';\n\n private readonly tenantEntityInfo = {\n module: 'TenantManagement',\n name: 'Tenant',\n title: '@tenant-management:tenants.entities.tenant.title',\n };\n\n private readonly companyEntityInfo = {\n module: RootConfig.module.name,\n name: RootConfig.entities.company.name,\n title: RootConfig.entities.company.title,\n };\n\n //#endregion\n\n //#region ---- AXMOrgChartNodeContributionProvider ----\n\n async getMenuActions(context: AXMOrgChartNodeContributionContext): Promise<AXMOrgChartNodeMenuAction[]> {\n const actions: AXMOrgChartNodeMenuAction[] = [\n ...this.getCrossCuttingActions(context),\n ...this.getKindSpecificActions(context),\n ];\n return actions;\n }\n\n //#endregion\n\n //#region ---- Cross-cutting ----\n\n private getCrossCuttingActions(context: AXMOrgChartNodeContributionContext): AXMOrgChartNodeMenuAction[] {\n const hasChildren = (context.node.children?.length ?? 0) > 0;\n const expanded = context.node.isExpanded !== false;\n\n return [\n {\n id: 'organization-management.org-chart.toggle-detail-panel',\n title: actionKey('toggle-detail-panel'),\n icon: 'fa-light fa-sidebar',\n /** After Communication and structure actions; before Remove (120). */\n order: 117,\n break: 'before',\n submenuGroupId: AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID,\n submenuGroupTitle: AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY,\n submenuGroupIcon: AXM_ORG_CHART_LAYOUT_SUBMENU_ICON,\n /** Separator before expand/collapse nested rows (never on the last row — that leaves a stray rule and gap). */\n submenuSectionBreak: true,\n execute: async (ctx) => {\n ctx.host.toggleDetailPanel();\n },\n },\n {\n id: 'organization-management.org-chart.expand-branch',\n title: actionKey('expand'),\n icon: 'fa-light fa-square-plus',\n order: 118,\n submenuGroupId: AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID,\n submenuGroupTitle: AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY,\n submenuGroupIcon: AXM_ORG_CHART_LAYOUT_SUBMENU_ICON,\n disabled: !hasChildren || expanded,\n execute: async (ctx) => {\n ctx.host.setNodeBranchExpanded(ctx.node, true);\n },\n },\n {\n id: 'organization-management.org-chart.collapse-branch',\n title: actionKey('collapse'),\n icon: 'fa-light fa-square-minus',\n order: 119,\n submenuGroupId: AXM_ORG_CHART_LAYOUT_SUBMENU_GROUP_ID,\n submenuGroupTitle: AXM_ORG_CHART_LAYOUT_SUBMENU_TITLE_I18N_KEY,\n submenuGroupIcon: AXM_ORG_CHART_LAYOUT_SUBMENU_ICON,\n /** Trailing group break: separator after the View & Layout row on the root menu (inner last-row break is normalized away). */\n break: 'after',\n disabled: !hasChildren || !expanded,\n execute: async (ctx) => {\n ctx.host.setNodeBranchExpanded(ctx.node, false);\n },\n },\n ];\n }\n\n //#endregion\n\n //#region ---- Kind-specific ----\n\n /**\n * **Open** — `Entity:OpenDetails` (navigate to entity view route).\n */\n private buildOpenDetailsAction(args: {\n id: string;\n canOpen: boolean;\n breakAfter?: 'after';\n order?: number;\n resolve: (ctx: AXMOrgChartNodeContributionContext) => { entity: string; id: string } | null;\n }): AXMOrgChartNodeMenuAction {\n return {\n id: args.id,\n title: actionKey('open'),\n icon: 'fa-light fa-arrow-up-right-from-square',\n order: args.order ?? 20,\n break: args.breakAfter,\n disabled: !args.canOpen,\n execute: async (ctx) => {\n const spec = args.resolve(ctx);\n if (!spec) {\n return;\n }\n await this.commandService.execute('Entity:OpenDetails', {\n entity: spec.entity,\n data: { id: spec.id },\n });\n },\n };\n }\n\n private getKindSpecificActions(context: AXMOrgChartNodeContributionContext): AXMOrgChartNodeMenuAction[] {\n switch (context.nodeKind) {\n case 'company-root':\n return this.getCompanyRootActions(context);\n case 'business-unit':\n return this.getBusinessUnitActions(context);\n case 'position':\n return this.getPositionActions(context);\n default:\n return [];\n }\n }\n\n private getCompanyRootActions(context: AXMOrgChartNodeContributionContext): AXMOrgChartNodeMenuAction[] {\n const viewTarget = this.resolveCompanyRootViewTarget(context.node);\n if (!viewTarget) {\n return [];\n }\n let canOpen = true;\n if (viewTarget.kind === 'tenant') {\n canOpen =\n canOpen &&\n (this.authorize(TENANT_VIEW_PERMISSION) ||\n this.authorize(AXPOrganizationManagementPermissionKeys.Chart.Management));\n } else if (viewTarget.kind === 'company') {\n canOpen =\n canOpen && this.authorize(AXPOrganizationManagementPermissionKeys.OrganizationManagement.Management);\n }\n\n return [\n this.buildOpenDetailsAction({\n id: 'organization-management.org-chart.open-details',\n canOpen,\n breakAfter: 'after',\n resolve: (ctx) => {\n const target = this.resolveCompanyRootViewTarget(ctx.node);\n return target ? { entity: target.source, id: target.id } : null;\n },\n }),\n ];\n }\n\n private getBusinessUnitActions(context: AXMOrgChartNodeContributionContext): AXMOrgChartNodeMenuAction[] {\n const businessUnitId = this.resolveBusinessUnitId(context);\n const canView = this.authorize(AXPOrganizationManagementPermissionKeys.BusinessUnit.View);\n\n return [\n ...(businessUnitId\n ? [\n this.buildOpenDetailsAction({\n id: 'organization-management.org-chart.open-details',\n canOpen: canView,\n breakAfter: 'after',\n resolve: (ctx) => {\n const id = this.resolveBusinessUnitId(ctx);\n return id ? { entity: BUSINESS_UNIT_ENTITY_SOURCE, id } : null;\n },\n }),\n ]\n : []),\n ];\n }\n\n private getPositionActions(context: AXMOrgChartNodeContributionContext): AXMOrgChartNodeMenuAction[] {\n const positionId = this.resolvePositionId(context);\n const businessUnitId = this.resolveBusinessUnitIdForPosition(context);\n const capacity = this.resolvePositionCapacity(context.node);\n const filled = this.resolveFilledAssignmentCount(context.node);\n const canViewPosition = this.authorize(AXPOrganizationManagementPermissionKeys.Position.View);\n const canAssignMore =\n this.authorize(this.positionAssignmentCreatePermission) &&\n capacity > 1 &&\n filled < capacity &&\n Boolean(positionId) &&\n Boolean(businessUnitId);\n\n return [\n ...(positionId\n ? [\n this.buildOpenDetailsAction({\n id: 'organization-management.org-chart.open-details',\n canOpen: canViewPosition,\n breakAfter: 'after',\n resolve: (ctx) => {\n const id = this.resolvePositionId(ctx);\n return id ? { entity: POSITION_ENTITY_SOURCE, id } : null;\n },\n }),\n ]\n : []),\n {\n id: 'organization-management.org-chart.add-additional-assignee',\n title: actionKey('add-additional-assignee'),\n icon: 'fa-light fa-user-plus',\n order: 108,\n disabled: !canAssignMore,\n execute: async (ctx) => {\n const pid = this.resolvePositionId(ctx);\n const buId = this.resolveBusinessUnitIdForPosition(ctx);\n if (!pid || !buId) {\n return;\n }\n const result = await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND, {\n data: {\n businessUnitId: buId,\n positionId: pid,\n isPrimary: false,\n },\n });\n if (result?.success) {\n await ctx.refreshChart();\n }\n },\n },\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 resolveCompanyRootViewTarget(\n node: AXMOrganizationNode,\n ): { kind: 'tenant' | 'company'; source: string; entityInfo: Record<string, string>; id: string } | null {\n const ent = node.entity;\n if (!ent?.id) {\n return null;\n }\n const id = String(ent.id).trim();\n if (!id) {\n return null;\n }\n const rawType = String(ent.type ?? '').trim();\n if (rawType === 'tenant' || rawType.endsWith('.Tenant')) {\n return { kind: 'tenant', source: TENANT_ENTITY_SOURCE, entityInfo: this.tenantEntityInfo, id };\n }\n if (rawType === COMPANY_ENTITY_SOURCE || rawType.endsWith('.Company')) {\n return { kind: 'company', source: COMPANY_ENTITY_SOURCE, entityInfo: this.companyEntityInfo, id };\n }\n return null;\n }\n\n private resolveBusinessUnitId(context: AXMOrgChartNodeContributionContext): string | undefined {\n if (context.nodeKind === 'business-unit') {\n const fromEntity = context.node.entity?.id;\n const entityId =\n fromEntity != null && String(fromEntity).trim().length > 0 ? String(fromEntity).trim() : undefined;\n return (\n entityId ??\n (context.node.metadata?.['businessUnitId'] as string | undefined)?.trim() ??\n (context.node.metadata?.['unitId'] as string | undefined)?.trim()\n );\n }\n return undefined;\n }\n\n private resolvePositionId(context: AXMOrgChartNodeContributionContext): string | undefined {\n const entity = context.node.entity;\n if (entity?.id != null && this.isPositionEntityType(entity.type)) {\n const id = String(entity.id).trim();\n return id.length > 0 ? id : undefined;\n }\n const metaPid = context.node.metadata?.['positionId'];\n if (typeof metaPid === 'string' && metaPid.trim().length > 0) {\n return metaPid.trim();\n }\n return undefined;\n }\n\n private isPositionEntityType(entityType: string | undefined): boolean {\n if (!entityType || typeof entityType !== 'string') {\n return false;\n }\n return entityType === POSITION_ENTITY_SOURCE || entityType.endsWith('.Position');\n }\n\n private resolveBusinessUnitIdForPosition(context: AXMOrgChartNodeContributionContext): string | undefined {\n const meta = context.node.metadata ?? {};\n const a = meta['businessUnitId'];\n const b = meta['organizationalUnitId'];\n const raw = (typeof a === 'string' && a.trim().length > 0 ? a : typeof b === 'string' ? b : '') as string;\n const id = String(raw).trim();\n return id.length > 0 ? id : undefined;\n }\n\n private resolvePositionCapacity(node: AXMOrganizationNode): number {\n const meta = node.metadata ?? {};\n const raw = meta['capacity'];\n if (typeof raw === 'number' && Number.isFinite(raw) && raw >= 1) {\n return Math.floor(raw);\n }\n if (typeof raw === 'string') {\n const n = Number(raw.trim());\n if (Number.isFinite(n) && n >= 1) {\n return Math.floor(n);\n }\n }\n return 1;\n }\n\n private resolveFilledAssignmentCount(node: AXMOrganizationNode): number {\n const meta = node.metadata ?? {};\n const fromMeta = meta['activeAssignmentCount'];\n if (typeof fromMeta === 'number' && Number.isFinite(fromMeta) && fromMeta >= 0) {\n return Math.floor(fromMeta);\n }\n const employeeChildren =\n node.children?.filter((c) => c.type === AXMOrgChartNodeType.Employee).length ?? 0;\n if (employeeChildren > 0) {\n return employeeChildren;\n }\n if (meta['vacant'] === true) {\n return 0;\n }\n const occ = meta['occupant'] as Record<string, unknown> | undefined;\n if (typeof occ?.['employeeId'] === 'string' && occ['employeeId'].trim().length > 0) {\n return 1;\n }\n return 0;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;AAAA;AAoBA;AAEA;AAEA,MAAM,SAAS,GAAG,CAAC,MAAc,KAC/B,CAAA,yDAAA,EAA4D,MAAM,CAAA,CAAE;AAEtE,MAAM,sBAAsB,GAAG,wCAAwC;AAEvE,MAAM,sBAAsB,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM;AAElE,MAAM,2BAA2B,GAAG,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM;AAE3E,MAAM,oBAAoB,GAAG,yBAAyB;AAEtD,MAAM,qBAAqB,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM;AAEhE;AAEA;;AAEG;MAEU,qCAAqC,CAAA;AADlD,IAAA,WAAA,GAAA;;AAImB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAE1C,IAAA,CAAA,kCAAkC,GACjD,6DAA6D;AAE9C,QAAA,IAAA,CAAA,gBAAgB,GAAG;AAClC,YAAA,MAAM,EAAE,kBAAkB;AAC1B,YAAA,IAAI,EAAE,QAAQ;AACd,YAAA,KAAK,EAAE,kDAAkD;SAC1D;AAEgB,QAAA,IAAA,CAAA,iBAAiB,GAAG;AACnC,YAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,YAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI;AACtC,YAAA,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK;SACzC;AA0UF,IAAA;;;IApUC,MA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@angular/router';
|
|
28
28
|
import set from 'lodash-es/set';
|
|
29
|
-
import { A as AXM_ORG_CHART_HOST, a as AXMOrgChartNodeType, b as AXM_ORG_CHART_NODE_CONTRIBUTOR, R as RootConfig, n as normalizeVacantLeafSeatsSetting, c as AXPOrganizationManagementSettings, p as parseOrgChartMode, d as AXMOrgChartStructureRefreshHub, e as AXMOrgChartCategory, f as AXMOrgChartDetailPanelComponent } from './acorex-modules-organization-management-acorex-modules-organization-management-
|
|
29
|
+
import { A as AXM_ORG_CHART_HOST, a as AXMOrgChartNodeType, b as AXM_ORG_CHART_NODE_CONTRIBUTOR, R as RootConfig, n as normalizeVacantLeafSeatsSetting, c as AXPOrganizationManagementSettings, p as parseOrgChartMode, d as AXMOrgChartStructureRefreshHub, e as AXMOrgChartCategory, f as AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID, g as AXMOrgChartDetailPanelComponent } from './acorex-modules-organization-management-acorex-modules-organization-management-CGzZcKEy.mjs';
|
|
30
30
|
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
31
31
|
import { AXPExportService, AXPSettingsService } from '@acorex/platform/common';
|
|
32
32
|
import { AXPEntityService } from '@acorex/platform/layout/entity';
|
|
@@ -246,13 +246,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
246
246
|
//#region ---- Service ----
|
|
247
247
|
class AXMOrgChartNodeContributionService {
|
|
248
248
|
constructor() {
|
|
249
|
-
this
|
|
249
|
+
/** `inject` typings for this multi-token omit the array wrapper; runtime value is always `T[]`. */
|
|
250
|
+
this.contributorSlots = inject(AXM_ORG_CHART_NODE_CONTRIBUTOR, { optional: true }) ?? [];
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Resolves eager contributors and lazy `provideLazyProvider` slots (factory returns a Promise).
|
|
254
|
+
*/
|
|
255
|
+
async resolveContributors() {
|
|
256
|
+
return Promise.all(this.contributorSlots.map((slot) => Promise.resolve(slot)));
|
|
250
257
|
}
|
|
251
258
|
/**
|
|
252
259
|
* Collects and sorts menu actions contributed by all providers for the current node context.
|
|
253
260
|
*/
|
|
254
261
|
async getMenuActions(context) {
|
|
255
|
-
const
|
|
262
|
+
const contributors = await this.resolveContributors();
|
|
263
|
+
const buckets = await Promise.all(contributors.map((provider) => provider.getMenuActions(context)));
|
|
256
264
|
return buckets
|
|
257
265
|
.flat()
|
|
258
266
|
.sort((a, b) => (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER));
|
|
@@ -262,7 +270,8 @@ class AXMOrgChartNodeContributionService {
|
|
|
262
270
|
* This is used by the upcoming node detail drawer.
|
|
263
271
|
*/
|
|
264
272
|
async getInfoContributions(context) {
|
|
265
|
-
const
|
|
273
|
+
const contributors = await this.resolveContributors();
|
|
274
|
+
const buckets = await Promise.all(contributors.map((provider) => provider.getInfoContributions?.(context) ?? Promise.resolve([])));
|
|
266
275
|
return buckets
|
|
267
276
|
.flat()
|
|
268
277
|
.sort((a, b) => (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER));
|
|
@@ -618,6 +627,14 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
618
627
|
toggleDetailPanel() {
|
|
619
628
|
this.isDetailPanelOpen.update((open) => !open);
|
|
620
629
|
}
|
|
630
|
+
/**
|
|
631
|
+
* Expands or collapses a node's branch and redraws the chart.
|
|
632
|
+
*/
|
|
633
|
+
setNodeBranchExpanded(data, expanded) {
|
|
634
|
+
data.isExpanded = expanded;
|
|
635
|
+
this.selectNode(data);
|
|
636
|
+
this.redrawChart();
|
|
637
|
+
}
|
|
621
638
|
//#endregion
|
|
622
639
|
//#region ---- Pan & Fullscreen ----
|
|
623
640
|
/**
|
|
@@ -1082,6 +1099,62 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1082
1099
|
}
|
|
1083
1100
|
await this.openOrgChartContextMenuAt(clientX, clientY, node, targetElement);
|
|
1084
1101
|
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Turns carry {@link AXMOrgChartContextMenuItem.orgChartBreakBefore} into `AXMenuItem.break` on the **previous**
|
|
1104
|
+
* sibling at the same level. Recurses into nested flyouts, then removes `orgChartBreakBefore`.
|
|
1105
|
+
*/
|
|
1106
|
+
materializeOrgChartMenuBreaks(items) {
|
|
1107
|
+
if (items.length === 0) {
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
for (const entry of items) {
|
|
1111
|
+
if (entry.items != null && entry.items.length > 0) {
|
|
1112
|
+
this.materializeOrgChartMenuBreaks(entry.items);
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
for (let i = 0; i < items.length; i++) {
|
|
1116
|
+
if (items[i].orgChartBreakBefore === true && i > 0) {
|
|
1117
|
+
items[i - 1].break = true;
|
|
1118
|
+
}
|
|
1119
|
+
delete items[i].orgChartBreakBefore;
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
/**
|
|
1123
|
+
* Removes a trailing `break` on the last row at each nesting level so the menu does not show a divider after the final item.
|
|
1124
|
+
* Recursive for nested flyouts.
|
|
1125
|
+
*/
|
|
1126
|
+
normalizeOrgChartContextMenuBreaks(items) {
|
|
1127
|
+
if (items.length === 0) {
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1130
|
+
for (const entry of items) {
|
|
1131
|
+
if (entry.items != null && entry.items.length > 0) {
|
|
1132
|
+
this.normalizeOrgChartContextMenuBreaks(entry.items);
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
const last = items[items.length - 1];
|
|
1136
|
+
if (last.break === true) {
|
|
1137
|
+
last.break = false;
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* Whether this action renders `AXMenuItem.break` after its **row**: `break` `after` / `both`, and
|
|
1142
|
+
* {@link AXMOrgChartNodeMenuAction.submenuSectionBreak} (separator after this row at any nesting level, including
|
|
1143
|
+
* root when the Employee flyout is flattened on employee cards).
|
|
1144
|
+
*/
|
|
1145
|
+
menuActionRowBreakAfter(action) {
|
|
1146
|
+
const b = action.break;
|
|
1147
|
+
const hasAfter = b === 'after' || b === 'both';
|
|
1148
|
+
return action.submenuSectionBreak === true || hasAfter;
|
|
1149
|
+
}
|
|
1150
|
+
/** `break` `before` / `both` for carry / bucket (not for inner-only submenuSectionBreak). */
|
|
1151
|
+
menuActionHasBreakBefore(action) {
|
|
1152
|
+
return action.break === 'before' || action.break === 'both';
|
|
1153
|
+
}
|
|
1154
|
+
/** `after` / `both` for grouped parent bucket trailing separator. */
|
|
1155
|
+
menuActionContributesGroupBreakAfter(action) {
|
|
1156
|
+
return action.break === 'after' || action.break === 'both';
|
|
1157
|
+
}
|
|
1085
1158
|
/**
|
|
1086
1159
|
* Loads actions, assigns menu structures, then opens the context menu with a pre-filled opening event (`items`
|
|
1087
1160
|
* must be populated before {@link AXContextMenuComponent.showAt}: async `onOpening` alone loses the assignment).
|
|
@@ -1113,8 +1186,20 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1113
1186
|
items: addFlyoutActions.map((action) => this.buildContextMenuLeafItem(action)),
|
|
1114
1187
|
});
|
|
1115
1188
|
}
|
|
1116
|
-
|
|
1189
|
+
const nonAddMenuActions = context.nodeKind === 'employee'
|
|
1190
|
+
? otherActions.map((action) => action.submenuGroupId === AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID
|
|
1191
|
+
? {
|
|
1192
|
+
...action,
|
|
1193
|
+
submenuGroupId: undefined,
|
|
1194
|
+
submenuGroupTitle: undefined,
|
|
1195
|
+
submenuGroupIcon: undefined,
|
|
1196
|
+
}
|
|
1197
|
+
: action)
|
|
1198
|
+
: otherActions;
|
|
1199
|
+
items.push(...this.buildGroupedNonAddContextMenuItems(nonAddMenuActions));
|
|
1117
1200
|
}
|
|
1201
|
+
this.materializeOrgChartMenuBreaks(items);
|
|
1202
|
+
this.normalizeOrgChartContextMenuBreaks(items);
|
|
1118
1203
|
const menu = this.contextMenu();
|
|
1119
1204
|
if (!menu) {
|
|
1120
1205
|
return;
|
|
@@ -1124,7 +1209,7 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1124
1209
|
sender: menu,
|
|
1125
1210
|
canceled: false,
|
|
1126
1211
|
targetElement,
|
|
1127
|
-
items,
|
|
1212
|
+
items: items,
|
|
1128
1213
|
};
|
|
1129
1214
|
menu.showAt({ x: clientX, y: clientY }, targetElement, openingEvent);
|
|
1130
1215
|
});
|
|
@@ -1149,13 +1234,17 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1149
1234
|
icon: action.submenuGroupIcon,
|
|
1150
1235
|
actions: [],
|
|
1151
1236
|
breakAfter: false,
|
|
1237
|
+
breakBefore: false,
|
|
1152
1238
|
};
|
|
1153
1239
|
groups.set(gid, bucket);
|
|
1154
1240
|
}
|
|
1155
1241
|
bucket.actions.push(action);
|
|
1156
|
-
if (action
|
|
1242
|
+
if (this.menuActionContributesGroupBreakAfter(action)) {
|
|
1157
1243
|
bucket.breakAfter = true;
|
|
1158
1244
|
}
|
|
1245
|
+
if (this.menuActionHasBreakBefore(action)) {
|
|
1246
|
+
bucket.breakBefore = true;
|
|
1247
|
+
}
|
|
1159
1248
|
if (!bucket.icon && action.submenuGroupIcon) {
|
|
1160
1249
|
bucket.icon = action.submenuGroupIcon;
|
|
1161
1250
|
}
|
|
@@ -1189,12 +1278,8 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1189
1278
|
continue;
|
|
1190
1279
|
}
|
|
1191
1280
|
const sortedMembers = [...bucket.actions].sort((a, b) => (a.order ?? Number.MAX_SAFE_INTEGER) - (b.order ?? Number.MAX_SAFE_INTEGER));
|
|
1192
|
-
if (sortedMembers.length === 1) {
|
|
1193
|
-
|
|
1194
|
-
items.push(this.buildContextMenuLeafItem({
|
|
1195
|
-
...only,
|
|
1196
|
-
break: bucket.breakAfter ? true : only.break,
|
|
1197
|
-
}));
|
|
1281
|
+
if (sortedMembers.length === 1 && entry.groupId !== AXM_ORG_CHART_EMPLOYEE_SUBMENU_GROUP_ID) {
|
|
1282
|
+
items.push(this.buildContextMenuLeafItem(sortedMembers[0]));
|
|
1198
1283
|
continue;
|
|
1199
1284
|
}
|
|
1200
1285
|
items.push({
|
|
@@ -1202,10 +1287,8 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1202
1287
|
text: bucket.title,
|
|
1203
1288
|
icon: bucket.icon ?? 'fa-light fa-comments',
|
|
1204
1289
|
break: bucket.breakAfter,
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
break: action.submenuSectionBreak === true,
|
|
1208
|
-
})),
|
|
1290
|
+
orgChartBreakBefore: bucket.breakBefore === true,
|
|
1291
|
+
items: sortedMembers.map((action) => this.buildContextMenuLeafItem(action)),
|
|
1209
1292
|
});
|
|
1210
1293
|
}
|
|
1211
1294
|
return items;
|
|
@@ -1218,7 +1301,8 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1218
1301
|
icon: action.icon,
|
|
1219
1302
|
color: action.color,
|
|
1220
1303
|
disabled: action.disabled,
|
|
1221
|
-
break: action
|
|
1304
|
+
break: this.menuActionRowBreakAfter(action),
|
|
1305
|
+
orgChartBreakBefore: this.menuActionHasBreakBefore(action),
|
|
1222
1306
|
};
|
|
1223
1307
|
}
|
|
1224
1308
|
async handleContextMenuItemClick(e) {
|
|
@@ -1317,6 +1401,7 @@ class AXMOrgChartPage extends AXPPageLayoutBaseComponent {
|
|
|
1317
1401
|
await this.refresh();
|
|
1318
1402
|
this.recompute();
|
|
1319
1403
|
},
|
|
1404
|
+
host: this,
|
|
1320
1405
|
};
|
|
1321
1406
|
}
|
|
1322
1407
|
resolveNodeKind(node) {
|
|
@@ -1724,4 +1809,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
1724
1809
|
}], ctorParameters: () => [], propDecorators: { treeContainer: [{ type: i0.ViewChild, args: ['chart', { isSignal: true }] }], parent: [{ type: i0.ViewChild, args: ['parent', { isSignal: true }] }], contextMenu: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXContextMenuComponent), { isSignal: true }] }], panView: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AXPanViewDirective), { isSignal: true }] }] } });
|
|
1725
1810
|
|
|
1726
1811
|
export { AXMOrgChartPage };
|
|
1727
|
-
//# sourceMappingURL=acorex-modules-organization-management-org-chart.page-
|
|
1812
|
+
//# sourceMappingURL=acorex-modules-organization-management-org-chart.page-BcHO5kKP.mjs.map
|