@acorex-platform/module-organization-management-client 0.0.21
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-Dn8Ss1nL.mjs +433 -0
- package/fesm2022/acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-Dn8Ss1nL.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-add-business-unit-to-business-unit.command-CA2uZQyC.mjs +161 -0
- package/fesm2022/acorex-platform-module-organization-management-client-add-business-unit-to-business-unit.command-CA2uZQyC.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-add-position-to-business-unit.command-F7jD3jKs.mjs +137 -0
- package/fesm2022/acorex-platform-module-organization-management-client-add-position-to-business-unit.command-F7jD3jKs.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-add-team-to-business-unit.command-BLQFjhS5.mjs +127 -0
- package/fesm2022/acorex-platform-module-organization-management-client-add-team-to-business-unit.command-BLQFjhS5.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-contracts.mjs +468 -0
- package/fesm2022/acorex-platform-module-organization-management-client-contracts.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-feature-definition.provider-BQKtvXOM.mjs +19 -0
- package/fesm2022/acorex-platform-module-organization-management-client-feature-definition.provider-BQKtvXOM.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-generate-org-chart.command-DJnFJKuo.mjs +91 -0
- package/fesm2022/acorex-platform-module-organization-management-client-generate-org-chart.command-DJnFJKuo.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-DD3jLujN.mjs +61 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-DD3jLujN.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-pages-component.provider-BNhXJfjr.mjs +28 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-pages-component.provider-BNhXJfjr.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-BlUzsSy3.mjs +237 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-BlUzsSy3.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-skills-page.component--pyAaXB4.mjs +233 -0
- package/fesm2022/acorex-platform-module-organization-management-client-job-definition-skills-page.component--pyAaXB4.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs +175 -0
- package/fesm2022/acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-default-node-contribution.provider-BQ0ihb43.mjs +229 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-default-node-contribution.provider-BQ0ihb43.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-Bz8nVm04.mjs +179 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-Bz8nVm04.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-position-employee-node-contribution.provider-BTicXn9n.mjs +168 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-position-employee-node-contribution.provider-BTicXn9n.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-C5TItnOp.mjs +338 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-C5TItnOp.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart.page-g_3oPPH0.mjs +3744 -0
- package/fesm2022/acorex-platform-module-organization-management-client-org-chart.page-g_3oPPH0.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-permission-definition.provider-CiCdTBGo.mjs +43 -0
- package/fesm2022/acorex-platform-module-organization-management-client-permission-definition.provider-CiCdTBGo.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-remove-position-from-business-unit.command-BFQVTpfy.mjs +91 -0
- package/fesm2022/acorex-platform-module-organization-management-client-remove-position-from-business-unit.command-BFQVTpfy.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-replace-position-assignee.command-CSgERqLG.mjs +64 -0
- package/fesm2022/acorex-platform-module-organization-management-client-replace-position-assignee.command-CSgERqLG.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DHmUxlnu.mjs +143 -0
- package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DHmUxlnu.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs +65 -0
- package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs +400 -0
- package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client-settings.provider-Dnrkq9Ku.mjs +432 -0
- package/fesm2022/acorex-platform-module-organization-management-client-settings.provider-Dnrkq9Ku.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-organization-management-client.mjs +2 -0
- package/fesm2022/acorex-platform-module-organization-management-client.mjs.map +1 -0
- package/package.json +28 -0
- package/types/acorex-platform-module-organization-management-client-contracts.d.ts +501 -0
- package/types/acorex-platform-module-organization-management-client.d.ts +273 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { AXPCommonPermissionGroupKeys } from '@acorex-platform/module-common-client/contracts';
|
|
2
|
+
import { AXPPeopleOrganizationPermissionKeys } from '@acorex-platform/module-organization-management-client/contracts';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Injectable } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ---- Permission Definition Provider ----
|
|
8
|
+
/**
|
|
9
|
+
* Registers People & Organization capabilities owned or shared by org-management.
|
|
10
|
+
* MaintainEmployees / ManageEmployeeActions are registered by HCM.
|
|
11
|
+
*/
|
|
12
|
+
class AXMPermissionDefinitionProvider {
|
|
13
|
+
async define(context) {
|
|
14
|
+
const keys = AXPPeopleOrganizationPermissionKeys;
|
|
15
|
+
const groups = AXPCommonPermissionGroupKeys;
|
|
16
|
+
const P = '@common:people-organization.permissions';
|
|
17
|
+
const G = '@common:permission-groups';
|
|
18
|
+
context.addGroup(groups.PeopleOrganization.Root, `${G}.people-organization.title`, `${G}.people-organization.description`, { order: 10 });
|
|
19
|
+
context
|
|
20
|
+
.addGroup(groups.PeopleOrganization.Structure, `${G}.people-organization-structure.title`, `${G}.people-organization-structure.description`, { parent: groups.PeopleOrganization.Root, order: 10 })
|
|
21
|
+
.addPermission(keys.Access, `${P}.access.title`, `${P}.access.description`)
|
|
22
|
+
.endPermission()
|
|
23
|
+
.addPermission(keys.ViewOrganization, `${P}.view-organization.title`, `${P}.view-organization.description`)
|
|
24
|
+
.endPermission()
|
|
25
|
+
.addPermission(keys.MaintainOrganization, `${P}.maintain-organization.title`, `${P}.maintain-organization.description`)
|
|
26
|
+
.endPermission()
|
|
27
|
+
.addPermission(keys.MaintainTeams, `${P}.maintain-teams.title`, `${P}.maintain-teams.description`)
|
|
28
|
+
.endPermission()
|
|
29
|
+
.addPermission(keys.DesignJobs, `${P}.design-jobs.title`, `${P}.design-jobs.description`)
|
|
30
|
+
.endPermission()
|
|
31
|
+
.addPermission(keys.Setup, `${P}.setup.title`, `${P}.setup.description`)
|
|
32
|
+
.endPermission()
|
|
33
|
+
.endGroup();
|
|
34
|
+
}
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPermissionDefinitionProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
36
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPermissionDefinitionProvider }); }
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMPermissionDefinitionProvider, decorators: [{
|
|
39
|
+
type: Injectable
|
|
40
|
+
}] });
|
|
41
|
+
|
|
42
|
+
export { AXMPermissionDefinitionProvider };
|
|
43
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-permission-definition.provider-CiCdTBGo.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-permission-definition.provider-CiCdTBGo.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/permission-definition.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n AXPPermissionDefinitionProvider,\n AXPPermissionDefinitionProviderContext,\n} from '@acorex-platform/framework-client/auth';\nimport {\n AXPCommonPermissionGroupKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport {\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\n\nimport { Injectable } from '@angular/core';\n\n//#endregion\n\n//#region ---- Permission Definition Provider ----\n\n/**\n * Registers People & Organization capabilities owned or shared by org-management.\n * MaintainEmployees / ManageEmployeeActions are registered by HCM.\n */\n@Injectable()\nexport class AXMPermissionDefinitionProvider implements AXPPermissionDefinitionProvider {\n async define(context: AXPPermissionDefinitionProviderContext): Promise<void> {\n const keys = AXPPeopleOrganizationPermissionKeys;\n const groups = AXPCommonPermissionGroupKeys;\n const P = '@common:people-organization.permissions';\n const G = '@common:permission-groups';\n\n context.addGroup(groups.PeopleOrganization.Root, `${G}.people-organization.title`, `${G}.people-organization.description`, { order: 10 });\n\n context\n .addGroup(\n groups.PeopleOrganization.Structure,\n `${G}.people-organization-structure.title`,\n `${G}.people-organization-structure.description`,\n { parent: groups.PeopleOrganization.Root, order: 10 },\n )\n .addPermission(keys.Access, `${P}.access.title`, `${P}.access.description`)\n .endPermission()\n .addPermission(keys.ViewOrganization, `${P}.view-organization.title`, `${P}.view-organization.description`)\n .endPermission()\n .addPermission(\n keys.MaintainOrganization,\n `${P}.maintain-organization.title`,\n `${P}.maintain-organization.description`,\n )\n .endPermission()\n .addPermission(keys.MaintainTeams, `${P}.maintain-teams.title`, `${P}.maintain-teams.description`)\n .endPermission()\n .addPermission(keys.DesignJobs, `${P}.design-jobs.title`, `${P}.design-jobs.description`)\n .endPermission()\n .addPermission(keys.Setup, `${P}.setup.title`, `${P}.setup.description`)\n .endPermission()\n .endGroup();\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAeA;AAEA;AAEA;;;AAGG;MAEU,+BAA+B,CAAA;IAC1C,MAAM,MAAM,CAAC,OAA+C,EAAA;QAC1D,MAAM,IAAI,GAAG,mCAAmC;QAChD,MAAM,MAAM,GAAG,4BAA4B;QAC3C,MAAM,CAAC,GAAG,yCAAyC;QACnD,MAAM,CAAC,GAAG,2BAA2B;QAErC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAA,EAAG,CAAC,4BAA4B,EAAE,CAAA,EAAG,CAAC,CAAA,gCAAA,CAAkC,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QAEzI;AACG,aAAA,QAAQ,CACP,MAAM,CAAC,kBAAkB,CAAC,SAAS,EACnC,CAAA,EAAG,CAAC,CAAA,oCAAA,CAAsC,EAC1C,CAAA,EAAG,CAAC,CAAA,0CAAA,CAA4C,EAChD,EAAE,MAAM,EAAE,MAAM,CAAC,kBAAkB,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE;AAEtD,aAAA,aAAa,CAAC,IAAI,CAAC,MAAM,EAAE,CAAA,EAAG,CAAC,CAAA,aAAA,CAAe,EAAE,CAAA,EAAG,CAAC,CAAA,mBAAA,CAAqB;AACzE,aAAA,aAAa;AACb,aAAA,aAAa,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAA,EAAG,CAAC,CAAA,wBAAA,CAA0B,EAAE,CAAA,EAAG,CAAC,CAAA,8BAAA,CAAgC;AACzG,aAAA,aAAa;AACb,aAAA,aAAa,CACZ,IAAI,CAAC,oBAAoB,EACzB,CAAA,EAAG,CAAC,CAAA,4BAAA,CAA8B,EAClC,CAAA,EAAG,CAAC,CAAA,kCAAA,CAAoC;AAEzC,aAAA,aAAa;AACb,aAAA,aAAa,CAAC,IAAI,CAAC,aAAa,EAAE,CAAA,EAAG,CAAC,CAAA,qBAAA,CAAuB,EAAE,CAAA,EAAG,CAAC,CAAA,2BAAA,CAA6B;AAChG,aAAA,aAAa;AACb,aAAA,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,CAAA,EAAG,CAAC,CAAA,kBAAA,CAAoB,EAAE,CAAA,EAAG,CAAC,CAAA,wBAAA,CAA0B;AACvF,aAAA,aAAa;AACb,aAAA,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA,EAAG,CAAC,CAAA,YAAA,CAAc,EAAE,CAAA,EAAG,CAAC,CAAA,kBAAA,CAAoB;AACtE,aAAA,aAAa;AACb,aAAA,QAAQ,EAAE;IACf;8GAjCW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAA/B,+BAA+B,EAAA,CAAA,CAAA;;2FAA/B,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAD3C;;;;;"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
|
2
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
3
|
+
import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
|
|
4
|
+
import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
|
|
5
|
+
import * as i0 from '@angular/core';
|
|
6
|
+
import { inject, Injectable } from '@angular/core';
|
|
7
|
+
import { AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND, RootConfig } from '@acorex-platform/module-organization-management-client/contracts';
|
|
8
|
+
|
|
9
|
+
class AXMRemovePositionFromBusinessUnitCommand {
|
|
10
|
+
constructor() {
|
|
11
|
+
//#region ---- Services & Dependencies ----
|
|
12
|
+
this.commandService = inject(AXPCommandService);
|
|
13
|
+
this.entityService = inject(AXPEntityService);
|
|
14
|
+
this.translationService = inject(AXTranslationService);
|
|
15
|
+
this.dialogService = inject(AXDialogService);
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
//#region ---- Command ----
|
|
19
|
+
async execute(input) {
|
|
20
|
+
const businessUnitId = input?.businessUnitId?.trim() ?? '';
|
|
21
|
+
const positionId = input?.positionId?.trim() ?? '';
|
|
22
|
+
if (!businessUnitId || !positionId) {
|
|
23
|
+
return { success: false };
|
|
24
|
+
}
|
|
25
|
+
if (!(await this.confirmRemoveFromUnit())) {
|
|
26
|
+
return { success: false };
|
|
27
|
+
}
|
|
28
|
+
const occupantId = input?.occupantEmployeeId?.trim() ?? '';
|
|
29
|
+
if (occupantId.length > 0) {
|
|
30
|
+
await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND, {
|
|
31
|
+
positionId,
|
|
32
|
+
employeeId: occupantId,
|
|
33
|
+
businessUnitId,
|
|
34
|
+
skipConfirmation: true,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
const buData = this.entityService
|
|
38
|
+
.withEntity(RootConfig.module.name, RootConfig.entities.businessUnit.name)
|
|
39
|
+
.data();
|
|
40
|
+
const businessUnit = await buData.byKey(businessUnitId);
|
|
41
|
+
if (!businessUnit?.id) {
|
|
42
|
+
return { success: false };
|
|
43
|
+
}
|
|
44
|
+
const existingIds = this.normalizePositionIds(businessUnit.positionIds);
|
|
45
|
+
const nextPositionIds = existingIds.filter((id) => id !== positionId);
|
|
46
|
+
const headRaw = businessUnit.headPositionId != null ? String(businessUnit.headPositionId).trim() : '';
|
|
47
|
+
const patch = { positionIds: nextPositionIds };
|
|
48
|
+
if (headRaw === positionId) {
|
|
49
|
+
patch.headPositionId = null;
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
await buData.update(businessUnitId, patch);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return { success: false };
|
|
56
|
+
}
|
|
57
|
+
return { success: true, kind: 'object', data: { businessUnitId, positionId } };
|
|
58
|
+
}
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region ---- Helpers ----
|
|
61
|
+
normalizePositionIds(value) {
|
|
62
|
+
if (value == null) {
|
|
63
|
+
return [];
|
|
64
|
+
}
|
|
65
|
+
if (Array.isArray(value)) {
|
|
66
|
+
return value.map((v) => String(v ?? '').trim()).filter((id) => id.length > 0);
|
|
67
|
+
}
|
|
68
|
+
if (typeof value === 'string') {
|
|
69
|
+
return value
|
|
70
|
+
.split(',')
|
|
71
|
+
.map((id) => id.trim())
|
|
72
|
+
.filter((id) => id.length > 0);
|
|
73
|
+
}
|
|
74
|
+
return [];
|
|
75
|
+
}
|
|
76
|
+
async confirmRemoveFromUnit() {
|
|
77
|
+
const title = await this.translationService.translateAsync('@organization-management:organization-chart.node-actions.remove-from-unit-confirm.title');
|
|
78
|
+
const message = await this.translationService.translateAsync('@organization-management:organization-chart.node-actions.remove-from-unit-confirm.message');
|
|
79
|
+
const result = await this.dialogService.confirm(title, message, 'danger', 'horizontal', false, 'cancel');
|
|
80
|
+
return result.result === true;
|
|
81
|
+
}
|
|
82
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMRemovePositionFromBusinessUnitCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
83
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMRemovePositionFromBusinessUnitCommand, providedIn: 'root' }); }
|
|
84
|
+
}
|
|
85
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMRemovePositionFromBusinessUnitCommand, decorators: [{
|
|
86
|
+
type: Injectable,
|
|
87
|
+
args: [{ providedIn: 'root' }]
|
|
88
|
+
}] });
|
|
89
|
+
|
|
90
|
+
export { AXMRemovePositionFromBusinessUnitCommand };
|
|
91
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-remove-position-from-business-unit.command-BFQVTpfy.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-remove-position-from-business-unit.command-BFQVTpfy.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/commands/remove-position-from-business-unit.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult } 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 } from '@angular/core';\nimport { AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND } from '@acorex-platform/module-organization-management-client/contracts';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\nimport type { AXMOrganizationManagementBusinessUnitEntityModel } from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\nexport interface AXMRemovePositionFromBusinessUnitInput {\n businessUnitId: string;\n positionId: string;\n /** Primary assignee on the chart card; when set, active assignment is revoked before the seat is unlinked. */\n occupantEmployeeId?: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXMRemovePositionFromBusinessUnitCommand\n implements AXPCommand<AXMRemovePositionFromBusinessUnitInput, { businessUnitId: string; positionId: string }>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly entityService = inject(AXPEntityService);\n private readonly translationService = inject(AXTranslationService);\n private readonly dialogService = inject(AXDialogService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(\n input: AXMRemovePositionFromBusinessUnitInput,\n ): AXPCommandExecuteResultPromise<{ businessUnitId: string; positionId: string }> {\n const businessUnitId = input?.businessUnitId?.trim() ?? '';\n const positionId = input?.positionId?.trim() ?? '';\n if (!businessUnitId || !positionId) {\n return { success: false };\n }\n\n if (!(await this.confirmRemoveFromUnit())) {\n return { success: false };\n }\n\n const occupantId = input?.occupantEmployeeId?.trim() ?? '';\n if (occupantId.length > 0) {\n await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND, {\n positionId,\n employeeId: occupantId,\n businessUnitId,\n skipConfirmation: true,\n });\n }\n\n const buData = this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.businessUnit.name)\n .data<string, AXMOrganizationManagementBusinessUnitEntityModel>();\n\n const businessUnit = await buData.byKey(businessUnitId);\n if (!businessUnit?.id) {\n return { success: false };\n }\n\n const existingIds = this.normalizePositionIds(businessUnit.positionIds);\n const nextPositionIds = existingIds.filter((id) => id !== positionId);\n\n const headRaw = businessUnit.headPositionId != null ? String(businessUnit.headPositionId).trim() : '';\n\n const patch: Partial<AXMOrganizationManagementBusinessUnitEntityModel> = { positionIds: nextPositionIds };\n if (headRaw === positionId) {\n patch.headPositionId = null;\n }\n\n try {\n await buData.update(businessUnitId, patch);\n } catch {\n return { success: false };\n }\n\n return { success: true, kind: 'object', data: { businessUnitId, positionId } };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private normalizePositionIds(value: unknown): string[] {\n if (value == null) {\n return [];\n }\n if (Array.isArray(value)) {\n return value.map((v) => String(v ?? '').trim()).filter((id) => id.length > 0);\n }\n if (typeof value === 'string') {\n return value\n .split(',')\n .map((id) => id.trim())\n .filter((id) => id.length > 0);\n }\n return [];\n }\n\n private async confirmRemoveFromUnit(): Promise<boolean> {\n const title = await this.translationService.translateAsync(\n '@organization-management:organization-chart.node-actions.remove-from-unit-confirm.title',\n );\n const message = await this.translationService.translateAsync(\n '@organization-management:organization-chart.node-actions.remove-from-unit-confirm.message',\n );\n const result = await this.dialogService.confirm(title, message, 'danger', 'horizontal', false, 'cancel');\n return result.result === true;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;MAuBa,wCAAwC,CAAA;AADrD,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AAyFzD,IAAA;;;IAnFC,MAAM,OAAO,CACX,KAA6C,EAAA;QAE7C,MAAM,cAAc,GAAG,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE;QAC1D,MAAM,UAAU,GAAG,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE;AAClD,QAAA,IAAI,CAAC,cAAc,IAAI,CAAC,UAAU,EAAE;AAClC,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;QAEA,IAAI,EAAE,MAAM,IAAI,CAAC,qBAAqB,EAAE,CAAC,EAAE;AACzC,YAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3B;QAEA,MAAM,UAAU,GAAG,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,IAAI,EAAE;AAC1D,QAAA,IAAI,UAAU,CAAC,MAAM,G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AA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,wCAAwC,cAD3B,MAAM,EAAA,CAAA,CAAA;;2FACnB,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBADpD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
|
2
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
3
|
+
import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { inject, Injectable } from '@angular/core';
|
|
6
|
+
import { AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND, AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND } from '@acorex-platform/module-organization-management-client/contracts';
|
|
7
|
+
|
|
8
|
+
class AXMReplacePositionAssigneeCommand {
|
|
9
|
+
constructor() {
|
|
10
|
+
//#region ---- Services & Dependencies ----
|
|
11
|
+
this.commandService = inject(AXPCommandService);
|
|
12
|
+
this.translationService = inject(AXTranslationService);
|
|
13
|
+
this.dialogService = inject(AXDialogService);
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
//#region ---- Command ----
|
|
17
|
+
async execute(input) {
|
|
18
|
+
const businessUnitId = input?.businessUnitId?.trim() ?? '';
|
|
19
|
+
const positionId = input?.positionId?.trim() ?? '';
|
|
20
|
+
const currentEmployeeId = input?.currentEmployeeId?.trim() ?? '';
|
|
21
|
+
if (!businessUnitId || !positionId || !currentEmployeeId) {
|
|
22
|
+
return { success: false };
|
|
23
|
+
}
|
|
24
|
+
if (!(await this.confirmReplaceAssignee())) {
|
|
25
|
+
return { success: false };
|
|
26
|
+
}
|
|
27
|
+
const revokeResult = await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND, {
|
|
28
|
+
positionId,
|
|
29
|
+
employeeId: currentEmployeeId,
|
|
30
|
+
businessUnitId,
|
|
31
|
+
skipConfirmation: true,
|
|
32
|
+
});
|
|
33
|
+
if (!revokeResult?.success) {
|
|
34
|
+
return { success: false };
|
|
35
|
+
}
|
|
36
|
+
const assignResult = await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND, {
|
|
37
|
+
data: {
|
|
38
|
+
businessUnitId,
|
|
39
|
+
positionId,
|
|
40
|
+
isPrimary: false,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return assignResult?.success === true
|
|
44
|
+
? { success: true, kind: 'object', data: { businessUnitId, positionId } }
|
|
45
|
+
: { success: false, message: assignResult?.message };
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region ---- Helpers ----
|
|
49
|
+
async confirmReplaceAssignee() {
|
|
50
|
+
const title = await this.translationService.translateAsync('@organization-management:organization-chart.node-actions.replace-assignee-confirm.title');
|
|
51
|
+
const message = await this.translationService.translateAsync('@organization-management:organization-chart.node-actions.replace-assignee-confirm.message');
|
|
52
|
+
const result = await this.dialogService.confirm(title, message, 'primary', 'horizontal', false, 'cancel');
|
|
53
|
+
return result.result === true;
|
|
54
|
+
}
|
|
55
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMReplacePositionAssigneeCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
56
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMReplacePositionAssigneeCommand, providedIn: 'root' }); }
|
|
57
|
+
}
|
|
58
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMReplacePositionAssigneeCommand, decorators: [{
|
|
59
|
+
type: Injectable,
|
|
60
|
+
args: [{ providedIn: 'root' }]
|
|
61
|
+
}] });
|
|
62
|
+
|
|
63
|
+
export { AXMReplacePositionAssigneeCommand };
|
|
64
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-replace-position-assignee.command-CSgERqLG.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-replace-position-assignee.command-CSgERqLG.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/organization-chart/commands/replace-position-assignee.command.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { AXDialogService } from '@acorex/components/dialog';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport { inject, Injectable } from '@angular/core';\nimport { AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND, AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND } from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\nexport interface AXMReplacePositionAssigneeInput {\n businessUnitId: string;\n positionId: string;\n currentEmployeeId: string;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class AXMReplacePositionAssigneeCommand\n implements AXPCommand<AXMReplacePositionAssigneeInput, { businessUnitId: string; positionId: string }>\n{\n //#region ---- Services & Dependencies ----\n\n private readonly commandService = inject(AXPCommandService);\n private readonly translationService = inject(AXTranslationService);\n private readonly dialogService = inject(AXDialogService);\n\n //#endregion\n\n //#region ---- Command ----\n\n async execute(\n input: AXMReplacePositionAssigneeInput,\n ): AXPCommandExecuteResultPromise<{ businessUnitId: string; positionId: string }> {\n const businessUnitId = input?.businessUnitId?.trim() ?? '';\n const positionId = input?.positionId?.trim() ?? '';\n const currentEmployeeId = input?.currentEmployeeId?.trim() ?? '';\n if (!businessUnitId || !positionId || !currentEmployeeId) {\n return { success: false };\n }\n\n if (!(await this.confirmReplaceAssignee())) {\n return { success: false };\n }\n\n const revokeResult = await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_REVOKE_COMMAND, {\n positionId,\n employeeId: currentEmployeeId,\n businessUnitId,\n skipConfirmation: true,\n });\n if (!revokeResult?.success) {\n return { success: false };\n }\n\n const assignResult = await this.commandService.execute(AXM_HCM_POSITION_ASSIGNMENT_ASSIGN_COMMAND, {\n data: {\n businessUnitId,\n positionId,\n isPrimary: false,\n },\n });\n\n return assignResult?.success === true\n ? { success: true, kind: 'object', data: { businessUnitId, positionId } }\n : { success: false, message: assignResult?.message };\n }\n\n //#endregion\n\n //#region ---- Helpers ----\n\n private async confirmReplaceAssignee(): Promise<boolean> {\n const title = await this.translationService.translateAsync(\n '@organization-management:organization-chart.node-actions.replace-assignee-confirm.title',\n );\n const message = await this.translationService.translateAsync(\n '@organization-management:organization-chart.node-actions.replace-assignee-confirm.message',\n );\n const result = await this.dialogService.confirm(title, message, 'primary', 'horizontal', false, 'cancel');\n return result.result === true;\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;MAmBa,iCAAiC,CAAA;AAD9C,IAAA,WAAA,GAAA;;AAMmB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,eAAe,CAAC;AA2DzD,IAAA;;;IArDC,MAAM,OAAO,CACX,KAAsC,EAAA;QAEtC,MAAM,cAAc,GAAG,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE;QAC1D,MAAM,UAAU,GAAG,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE;QAClD,MAAM,iBAAiB,GAAG,KAAK,EAAE,iBAAiB,EAAE,IAAI,EAAE,IAAI,EAAE;QAChE,IAAI,CAAC,cAAc,IAAI,CA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YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC;AACzG,QAAA,OAAO,MAAM,CAAC,MAAM,KAAK,IAAI;IAC/B;8GA/DW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,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,iCAAiC,cADpB,MAAM,EAAA,CAAA,CAAA;;2FACnB,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;;;"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
2
|
+
import { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { inject, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
5
|
+
import { get } from 'lodash';
|
|
6
|
+
import { A as AXMOrganizationManagementResponsibilitiesMatrixComponent } from './acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs';
|
|
7
|
+
|
|
8
|
+
//#region ---- Imports ----
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ---- Component Definition ----
|
|
11
|
+
class AXMResponsibilitiesMatrixWidgetEditComponent extends AXPValueWidgetComponent {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
//#region ---- Services & Dependencies ----
|
|
15
|
+
this.multiLanguageResolver = inject(AXTranslationService);
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region ---- Computed Properties ----
|
|
18
|
+
/**
|
|
19
|
+
* Readonly mode from options
|
|
20
|
+
*/
|
|
21
|
+
this.readonly = computed(() => {
|
|
22
|
+
const options = this.options();
|
|
23
|
+
return options?.['readonly'] ?? false;
|
|
24
|
+
}, /* @ts-ignore */
|
|
25
|
+
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
26
|
+
/**
|
|
27
|
+
* Titles from context - reactively reads from context data signal
|
|
28
|
+
* This ensures the titles update immediately when jobLevels changes in context
|
|
29
|
+
*/
|
|
30
|
+
this.titles = computed(() => {
|
|
31
|
+
const resolve = (v) => this.multiLanguageResolver.resolve(v);
|
|
32
|
+
const toItem = (item) => {
|
|
33
|
+
if (typeof item === 'string') {
|
|
34
|
+
return { id: item, title: item };
|
|
35
|
+
}
|
|
36
|
+
const id = item.id || item.value || String(item);
|
|
37
|
+
const rawTitle = item.title ?? item.name ?? String(item);
|
|
38
|
+
return {
|
|
39
|
+
id,
|
|
40
|
+
title: resolve(rawTitle) || String(rawTitle),
|
|
41
|
+
description: item.description != null && item.description !== '' ? resolve(item.description) : undefined,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
// Read directly from context data signal for reactive updates
|
|
45
|
+
const contextData = this.contextService.data();
|
|
46
|
+
const jobLevelsFromContext = get(contextData, 'jobLevels');
|
|
47
|
+
if (Array.isArray(jobLevelsFromContext) && jobLevelsFromContext.length > 0) {
|
|
48
|
+
return jobLevelsFromContext.map(toItem);
|
|
49
|
+
}
|
|
50
|
+
// Fallback to options (for initial load or when context is not yet available)
|
|
51
|
+
const options = this.options();
|
|
52
|
+
const rawTitles = options?.['titles'];
|
|
53
|
+
if (!rawTitles) {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
if (Array.isArray(rawTitles)) {
|
|
57
|
+
return rawTitles.map(toItem);
|
|
58
|
+
}
|
|
59
|
+
return [];
|
|
60
|
+
}, /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "titles" }] : /* istanbul ignore next */ []));
|
|
62
|
+
/**
|
|
63
|
+
* Current matrix value
|
|
64
|
+
*/
|
|
65
|
+
this.matrixValue = computed(() => {
|
|
66
|
+
return this.getValue() || {};
|
|
67
|
+
}, /* @ts-ignore */
|
|
68
|
+
...(ngDevMode ? [{ debugName: "matrixValue" }] : /* istanbul ignore next */ []));
|
|
69
|
+
/**
|
|
70
|
+
* Responsibility IDs extracted from value or from options
|
|
71
|
+
*/
|
|
72
|
+
this.responsibilityIds = computed(() => {
|
|
73
|
+
const options = this.options();
|
|
74
|
+
const responsibilityIdsFromOptions = options?.['responsibilityIds'] ?? [];
|
|
75
|
+
// If responsibilityIds from options is an array, use it
|
|
76
|
+
if (Array.isArray(responsibilityIdsFromOptions) && responsibilityIdsFromOptions.length > 0) {
|
|
77
|
+
return responsibilityIdsFromOptions;
|
|
78
|
+
}
|
|
79
|
+
// Otherwise, extract from value (only if value exists and has items)
|
|
80
|
+
const value = this.matrixValue();
|
|
81
|
+
if (value && typeof value === 'object' && Object.keys(value).length > 0) {
|
|
82
|
+
return Object.keys(value).filter((id) => id != null);
|
|
83
|
+
}
|
|
84
|
+
// Return empty array to prevent undefined issues
|
|
85
|
+
return [];
|
|
86
|
+
}, /* @ts-ignore */
|
|
87
|
+
...(ngDevMode ? [{ debugName: "responsibilityIds" }] : /* istanbul ignore next */ []));
|
|
88
|
+
}
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region ---- Event Handlers ----
|
|
91
|
+
/**
|
|
92
|
+
* Handle value change from responsibilities-matrix component
|
|
93
|
+
*/
|
|
94
|
+
handleValueChange(data) {
|
|
95
|
+
if (data) {
|
|
96
|
+
this.setValue(data);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Handle responsibility IDs change from responsibilities-matrix component
|
|
101
|
+
*/
|
|
102
|
+
handleResponsibilityIdsChange(responsibilityIds) {
|
|
103
|
+
// Responsibility IDs are already reflected in the value
|
|
104
|
+
// This handler is here for potential future use or side effects
|
|
105
|
+
}
|
|
106
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMResponsibilitiesMatrixWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
107
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: AXMResponsibilitiesMatrixWidgetEditComponent, isStandalone: true, selector: "axm-responsibilities-matrix-widget-edit", host: { classAttribute: "block w-full" }, usesInheritance: true, ngImport: i0, template: `
|
|
108
|
+
<axm-responsibilities-matrix
|
|
109
|
+
[titles]="titles()"
|
|
110
|
+
[value]="matrixValue()"
|
|
111
|
+
[responsibilityIds]="responsibilityIds()"
|
|
112
|
+
[readonly]="readonly()"
|
|
113
|
+
(valueChange)="handleValueChange($any($event))"
|
|
114
|
+
(responsibilityIdsChange)="handleResponsibilityIdsChange($any($event))"
|
|
115
|
+
></axm-responsibilities-matrix>
|
|
116
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AXMOrganizationManagementResponsibilitiesMatrixComponent, selector: "axm-responsibilities-matrix", inputs: ["titles", "value", "readonly", "responsibilityIds"], outputs: ["valueChange", "cellChange", "responsibilityIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
117
|
+
}
|
|
118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMResponsibilitiesMatrixWidgetEditComponent, decorators: [{
|
|
119
|
+
type: Component,
|
|
120
|
+
args: [{
|
|
121
|
+
selector: 'axm-responsibilities-matrix-widget-edit',
|
|
122
|
+
standalone: true,
|
|
123
|
+
imports: [AXMOrganizationManagementResponsibilitiesMatrixComponent],
|
|
124
|
+
template: `
|
|
125
|
+
<axm-responsibilities-matrix
|
|
126
|
+
[titles]="titles()"
|
|
127
|
+
[value]="matrixValue()"
|
|
128
|
+
[responsibilityIds]="responsibilityIds()"
|
|
129
|
+
[readonly]="readonly()"
|
|
130
|
+
(valueChange)="handleValueChange($any($event))"
|
|
131
|
+
(responsibilityIdsChange)="handleResponsibilityIdsChange($any($event))"
|
|
132
|
+
></axm-responsibilities-matrix>
|
|
133
|
+
`,
|
|
134
|
+
host: {
|
|
135
|
+
class: 'block w-full',
|
|
136
|
+
},
|
|
137
|
+
encapsulation: ViewEncapsulation.None,
|
|
138
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
139
|
+
}]
|
|
140
|
+
}] });
|
|
141
|
+
|
|
142
|
+
export { AXMResponsibilitiesMatrixWidgetEditComponent };
|
|
143
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DHmUxlnu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DHmUxlnu.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/responsibilities-matrix/responsibilities-matrix-widget-edit.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPSpreadsheetData, AXPSpreadsheetItem } from '@acorex-platform/framework-client/layout/components';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { ChangeDetectionStrategy, Component, computed, inject, ViewEncapsulation } from '@angular/core';\nimport { get } from 'lodash';\nimport { AXMOrganizationManagementResponsibilitiesMatrixComponent } from './responsibilities-matrix.component';\n\n//#endregion\n\n//#region ---- Component Definition ----\n\n@Component({\n selector: 'axm-responsibilities-matrix-widget-edit',\n standalone: true,\n imports: [AXMOrganizationManagementResponsibilitiesMatrixComponent],\n template: `\n <axm-responsibilities-matrix\n [titles]=\"titles()\"\n [value]=\"matrixValue()\"\n [responsibilityIds]=\"responsibilityIds()\"\n [readonly]=\"readonly()\"\n (valueChange)=\"handleValueChange($any($event))\"\n (responsibilityIdsChange)=\"handleResponsibilityIdsChange($any($event))\"\n ></axm-responsibilities-matrix>\n `,\n host: {\n class: 'block w-full',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXMResponsibilitiesMatrixWidgetEditComponent extends AXPValueWidgetComponent<AXPSpreadsheetData> {\n //#region ---- Services & Dependencies ----\n\n private readonly multiLanguageResolver = inject(AXTranslationService);\n\n //#endregion\n\n //#region ---- Computed Properties ----\n\n /**\n * Readonly mode from options\n */\n protected readonly = computed<boolean>(() => {\n const options = this.options();\n return options?.['readonly'] ?? false;\n });\n\n /**\n * Titles from context - reactively reads from context data signal\n * This ensures the titles update immediately when jobLevels changes in context\n */\n protected titles = computed<AXPSpreadsheetItem[]>(() => {\n const resolve = (v: unknown) => this.multiLanguageResolver.resolve(v as any);\n const toItem = (item: any): AXPSpreadsheetItem => {\n if (typeof item === 'string') {\n return { id: item, title: item };\n }\n const id = item.id || item.value || String(item);\n const rawTitle = item.title ?? item.name ?? String(item);\n return {\n id,\n title: resolve(rawTitle) || String(rawTitle),\n description: item.description != null && item.description !== '' ? resolve(item.description) : undefined,\n };\n };\n\n // Read directly from context data signal for reactive updates\n const contextData = this.contextService.data();\n const jobLevelsFromContext = get(contextData, 'jobLevels') as any[] | undefined;\n\n if (Array.isArray(jobLevelsFromContext) && jobLevelsFromContext.length > 0) {\n return jobLevelsFromContext.map(toItem);\n }\n\n // Fallback to options (for initial load or when context is not yet available)\n const options = this.options();\n const rawTitles = options?.['titles'];\n\n if (!rawTitles) {\n return [];\n }\n\n if (Array.isArray(rawTitles)) {\n return rawTitles.map(toItem);\n }\n\n return [];\n });\n\n /**\n * Current matrix value\n */\n protected matrixValue = computed<AXPSpreadsheetData>(() => {\n return (this.getValue() as AXPSpreadsheetData) || {};\n });\n\n /**\n * Responsibility IDs extracted from value or from options\n */\n protected responsibilityIds = computed<string[]>(() => {\n const options = this.options();\n const responsibilityIdsFromOptions = options?.['responsibilityIds'] ?? [];\n\n // If responsibilityIds from options is an array, use it\n if (Array.isArray(responsibilityIdsFromOptions) && responsibilityIdsFromOptions.length > 0) {\n return responsibilityIdsFromOptions;\n }\n\n // Otherwise, extract from value (only if value exists and has items)\n const value = this.matrixValue();\n if (value && typeof value === 'object' && Object.keys(value).length > 0) {\n return Object.keys(value).filter((id) => id != null);\n }\n\n // Return empty array to prevent undefined issues\n return [];\n });\n\n //#endregion\n\n //#region ---- Event Handlers ----\n\n /**\n * Handle value change from responsibilities-matrix component\n */\n protected handleValueChange(data: AXPSpreadsheetData): void {\n if (data) {\n this.setValue(data);\n }\n }\n\n /**\n * Handle responsibility IDs change from responsibilities-matrix component\n */\n protected handleResponsibilityIdsChange(responsibilityIds: string[]): void {\n // Responsibility IDs are already reflected in the value\n // This handler is here for potential future use or side effects\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;AAAA;AASA;AAEA;AAsBM,MAAO,4CAA6C,SAAQ,uBAA2C,CAAA;AApB7G,IAAA,WAAA,GAAA;;;AAuBmB,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,oBAAoB,CAAC;;;AAMrE;;AAEG;AACO,QAAA,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAU,MAAK;AAC1C,YAAA,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,EAAE;AAC9B,YAAA,OAAO,OAAO,GAAG,UAAU,CAAC,IAAI,KAAK;QACvC,CAAC;qFAAC;AAEF;;;AAGG;AACO,QAAA,IAAA,CAAA,MAAM,GAAG,QAAQ,CAAuB,MAAK;AACrD,YAAA,MAAM,OAAO,GAAG,CAAC,CAAU,KAAK,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAQ,CAAC;AAC5E,YAAA,MAAM,MAAM,GAAG,CAAC,IAAS,KAAwB;AAC/C,gBAAA,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;oBAC5B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;gBAClC;AACA,gBAAA,MAAM,EAAE,GAAG,IAAI,CAAC,E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A,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAhB7C;;;;;;;;;AAST,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAVS,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,aAAA,EAAA,EAAA,CAAA,iBAAA,CAAA,IAAA,EAAA,CAAA,CAAA;;2FAiBvD,4CAA4C,EAAA,UAAA,EAAA,CAAA;kBApBxD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,yCAAyC;AACnD,oBAAA,UAAU,EAAE,IAAI;oBAChB,OAAO,EAAE,CAAC,wDAAwD,CAAC;AACnE,oBAAA,QAAQ,EAAE;;;;;;;;;AAST,EAAA,CAAA;AACD,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE,cAAc;AACtB,qBAAA;oBACD,aAAa,EAAE,iBAAiB,CAAC,IAAI;oBACrC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;;;;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
|
|
3
|
+
import { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';
|
|
4
|
+
import { A as AXMOrganizationManagementResponsibilitiesMatrixComponent } from './acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs';
|
|
5
|
+
|
|
6
|
+
//#region ---- Imports ----
|
|
7
|
+
//#endregion
|
|
8
|
+
//#region ---- Component Definition ----
|
|
9
|
+
class AXMResponsibilitiesMatrixWidgetViewComponent extends AXPValueWidgetComponent {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region ---- Computed Properties ----
|
|
14
|
+
/**
|
|
15
|
+
* Current matrix value
|
|
16
|
+
*/
|
|
17
|
+
this.matrixValue = computed(() => {
|
|
18
|
+
return this.getValue() || {};
|
|
19
|
+
}, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "matrixValue" }] : /* istanbul ignore next */ []));
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region ---- Event Handlers ----
|
|
24
|
+
/**
|
|
25
|
+
* Handle value change from responsibilities-matrix component
|
|
26
|
+
*/
|
|
27
|
+
handleValueChange(data) {
|
|
28
|
+
if (data) {
|
|
29
|
+
this.setValue(data);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMResponsibilitiesMatrixWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.8", type: AXMResponsibilitiesMatrixWidgetViewComponent, isStandalone: true, selector: "axm-responsibilities-matrix-widget-view", host: { classAttribute: "block w-full" }, usesInheritance: true, ngImport: i0, template: `
|
|
34
|
+
<axm-responsibilities-matrix
|
|
35
|
+
[value]="matrixValue()"
|
|
36
|
+
[readonly]="true"
|
|
37
|
+
(valueChange)="handleValueChange($any($event))"
|
|
38
|
+
></axm-responsibilities-matrix>
|
|
39
|
+
`, isInline: true, dependencies: [{ kind: "component", type: AXMOrganizationManagementResponsibilitiesMatrixComponent, selector: "axm-responsibilities-matrix", inputs: ["titles", "value", "readonly", "responsibilityIds"], outputs: ["valueChange", "cellChange", "responsibilityIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
40
|
+
}
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMResponsibilitiesMatrixWidgetViewComponent, decorators: [{
|
|
42
|
+
type: Component,
|
|
43
|
+
args: [{
|
|
44
|
+
selector: 'axm-responsibilities-matrix-widget-view',
|
|
45
|
+
standalone: true,
|
|
46
|
+
imports: [
|
|
47
|
+
AXMOrganizationManagementResponsibilitiesMatrixComponent
|
|
48
|
+
],
|
|
49
|
+
template: `
|
|
50
|
+
<axm-responsibilities-matrix
|
|
51
|
+
[value]="matrixValue()"
|
|
52
|
+
[readonly]="true"
|
|
53
|
+
(valueChange)="handleValueChange($any($event))"
|
|
54
|
+
></axm-responsibilities-matrix>
|
|
55
|
+
`,
|
|
56
|
+
host: {
|
|
57
|
+
class: 'block w-full',
|
|
58
|
+
},
|
|
59
|
+
encapsulation: ViewEncapsulation.None,
|
|
60
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
61
|
+
}]
|
|
62
|
+
}] });
|
|
63
|
+
|
|
64
|
+
export { AXMResponsibilitiesMatrixWidgetViewComponent };
|
|
65
|
+
//# sourceMappingURL=acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/responsibilities-matrix/responsibilities-matrix-widget-view.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ViewEncapsulation,\n} from '@angular/core';\nimport { AXPValueWidgetComponent } from '@acorex-platform/framework-client/layout/widget-core';\nimport { AXPSpreadsheetData } from '@acorex-platform/framework-client/layout/components';\nimport { AXMOrganizationManagementResponsibilitiesMatrixComponent } from './responsibilities-matrix.component';\n\n//#endregion\n\n//#region ---- Component Definition ----\n\n@Component({\n selector: 'axm-responsibilities-matrix-widget-view',\n standalone: true,\n imports: [\n AXMOrganizationManagementResponsibilitiesMatrixComponent\n],\n template: `\n <axm-responsibilities-matrix\n [value]=\"matrixValue()\"\n [readonly]=\"true\"\n (valueChange)=\"handleValueChange($any($event))\"\n ></axm-responsibilities-matrix>\n `,\n host: {\n class: 'block w-full',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXMResponsibilitiesMatrixWidgetViewComponent extends AXPValueWidgetComponent<AXPSpreadsheetData> {\n //#endregion\n\n //#region ---- Computed Properties ----\n\n /**\n * Current matrix value\n */\n protected matrixValue = computed<AXPSpreadsheetData>(() => {\n return (this.getValue() as AXPSpreadsheetData) || {};\n });\n\n //#endregion\n\n //#region ---- Event Handlers ----\n\n /**\n * Handle value change from responsibilities-matrix component\n */\n protected handleValueChange(data: AXPSpreadsheetData): void {\n if (data) {\n this.setValue(data);\n }\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAAA;AAYA;AAEA;AAqBM,MAAO,4CAA6C,SAAQ,uBAA2C,CAAA;AAnB7G,IAAA,WAAA,GAAA;;;;AAwBI;;AAEG;AACO,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAqB,MAAK;AACtD,YAAA,OAAQ,IAAI,CAAC,QAAQ,EAAyB,IAAI,EAAE;QACxD,CAAC;wFAAC;AAgBL,IAAA;;;AAVG;;AAEG;AACO,IAAA,iBAAiB,CAAC,IAAwB,EAAA;QAChD,IAAI,IAAI,EAAE;AACN,YAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;QACvB;IACJ;8GAvBS,4CAA4C,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAA5C,IAAA,SAAA,IAAA,CA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