@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.
Files changed (53) hide show
  1. package/fesm2022/acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-Dn8Ss1nL.mjs +433 -0
  2. package/fesm2022/acorex-platform-module-organization-management-client-acorex-platform-module-organization-management-client-Dn8Ss1nL.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-organization-management-client-add-business-unit-to-business-unit.command-CA2uZQyC.mjs +161 -0
  4. package/fesm2022/acorex-platform-module-organization-management-client-add-business-unit-to-business-unit.command-CA2uZQyC.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-organization-management-client-add-position-to-business-unit.command-F7jD3jKs.mjs +137 -0
  6. package/fesm2022/acorex-platform-module-organization-management-client-add-position-to-business-unit.command-F7jD3jKs.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-organization-management-client-add-team-to-business-unit.command-BLQFjhS5.mjs +127 -0
  8. package/fesm2022/acorex-platform-module-organization-management-client-add-team-to-business-unit.command-BLQFjhS5.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-organization-management-client-contracts.mjs +468 -0
  10. package/fesm2022/acorex-platform-module-organization-management-client-contracts.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-organization-management-client-feature-definition.provider-BQKtvXOM.mjs +19 -0
  12. package/fesm2022/acorex-platform-module-organization-management-client-feature-definition.provider-BQKtvXOM.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-organization-management-client-generate-org-chart.command-DJnFJKuo.mjs +91 -0
  14. package/fesm2022/acorex-platform-module-organization-management-client-generate-org-chart.command-DJnFJKuo.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-DD3jLujN.mjs +61 -0
  16. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-DD3jLujN.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-pages-component.provider-BNhXJfjr.mjs +28 -0
  18. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-pages-component.provider-BNhXJfjr.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-BlUzsSy3.mjs +237 -0
  20. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-responsibilities-page.component-BlUzsSy3.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-skills-page.component--pyAaXB4.mjs +233 -0
  22. package/fesm2022/acorex-platform-module-organization-management-client-job-definition-skills-page.component--pyAaXB4.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs +175 -0
  24. package/fesm2022/acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-default-node-contribution.provider-BQ0ihb43.mjs +229 -0
  26. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-default-node-contribution.provider-BQ0ihb43.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-Bz8nVm04.mjs +179 -0
  28. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-employee-flyout-contribution.provider-Bz8nVm04.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-position-employee-node-contribution.provider-BTicXn9n.mjs +168 -0
  30. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-position-employee-node-contribution.provider-BTicXn9n.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-C5TItnOp.mjs +338 -0
  32. package/fesm2022/acorex-platform-module-organization-management-client-org-chart-ux-node-contribution.provider-C5TItnOp.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-module-organization-management-client-org-chart.page-g_3oPPH0.mjs +3744 -0
  34. package/fesm2022/acorex-platform-module-organization-management-client-org-chart.page-g_3oPPH0.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-module-organization-management-client-permission-definition.provider-CiCdTBGo.mjs +43 -0
  36. package/fesm2022/acorex-platform-module-organization-management-client-permission-definition.provider-CiCdTBGo.mjs.map +1 -0
  37. package/fesm2022/acorex-platform-module-organization-management-client-remove-position-from-business-unit.command-BFQVTpfy.mjs +91 -0
  38. package/fesm2022/acorex-platform-module-organization-management-client-remove-position-from-business-unit.command-BFQVTpfy.mjs.map +1 -0
  39. package/fesm2022/acorex-platform-module-organization-management-client-replace-position-assignee.command-CSgERqLG.mjs +64 -0
  40. package/fesm2022/acorex-platform-module-organization-management-client-replace-position-assignee.command-CSgERqLG.mjs.map +1 -0
  41. package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DHmUxlnu.mjs +143 -0
  42. package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-edit.component-DHmUxlnu.mjs.map +1 -0
  43. package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs +65 -0
  44. package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix-widget-view.component-BkLZhXhM.mjs.map +1 -0
  45. package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs +400 -0
  46. package/fesm2022/acorex-platform-module-organization-management-client-responsibilities-matrix.component-DqO6xE2p.mjs.map +1 -0
  47. package/fesm2022/acorex-platform-module-organization-management-client-settings.provider-Dnrkq9Ku.mjs +432 -0
  48. package/fesm2022/acorex-platform-module-organization-management-client-settings.provider-Dnrkq9Ku.mjs.map +1 -0
  49. package/fesm2022/acorex-platform-module-organization-management-client.mjs +2 -0
  50. package/fesm2022/acorex-platform-module-organization-management-client.mjs.map +1 -0
  51. package/package.json +28 -0
  52. package/types/acorex-platform-module-organization-management-client-contracts.d.ts +501 -0
  53. package/types/acorex-platform-module-organization-management-client.d.ts +273 -0
@@ -0,0 +1,233 @@
1
+ import { AXPEntityEventsKeys } from '@acorex-platform/framework-shared/entity';
2
+ import { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';
3
+ import { AXMLearningManagementSkillMatrixComponent } from '@acorex-platform/module-learning-management-client';
4
+ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
5
+ import { AXPPageLayoutBaseComponent, AXPPageLayoutBase } from '@acorex-platform/framework-client/layout/views';
6
+ import * as i0 from '@angular/core';
7
+ import { input, inject, signal, computed, effect, ChangeDetectionStrategy, Component } from '@angular/core';
8
+ import { cloneDeep, isEqual } from 'lodash';
9
+ import { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';
10
+ import { m as mergeJobDefinitionMatrixPageContext, j as jobLevelsToSpreadsheetTitles } from './acorex-platform-module-organization-management-client-job-definition-matrix-page.utils-DD3jLujN.mjs';
11
+
12
+ //#endregion
13
+ const JOB_DEFINITION_SKILLS_PAGE_DISCARD = 'JobDefinition:Skills:Discard';
14
+ const JOB_DEFINITION_SKILLS_SAVE = 'JobDefinition:Skills:Save';
15
+ //#region ---- Component ----
16
+ class AXMJobDefinitionSkillsPageComponent extends AXPPageLayoutBaseComponent {
17
+ //#endregion
18
+ //#region ---- Constructor ----
19
+ constructor() {
20
+ super();
21
+ //#region ---- Inputs ----
22
+ this.rootContext = input(/* @ts-ignore */
23
+ ...(ngDevMode ? [undefined, { debugName: "rootContext" }] : /* istanbul ignore next */ []));
24
+ this.pageConfig = input(/* @ts-ignore */
25
+ ...(ngDevMode ? [undefined, { debugName: "pageConfig" }] : /* istanbul ignore next */ []));
26
+ //#endregion
27
+ //#region ---- Services ----
28
+ this.entityService = inject(AXPEntityService);
29
+ this.eventService = inject(AXPBroadcastEventService);
30
+ this.hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });
31
+ //#endregion
32
+ //#region ---- State ----
33
+ this.localContext = signal(null, /* @ts-ignore */
34
+ ...(ngDevMode ? [{ debugName: "localContext" }] : /* istanbul ignore next */ []));
35
+ this.ignoreNextMatrixChange = signal(false, /* @ts-ignore */
36
+ ...(ngDevMode ? [{ debugName: "ignoreNextMatrixChange" }] : /* istanbul ignore next */ []));
37
+ this.baselineMatrix = signal(null, /* @ts-ignore */
38
+ ...(ngDevMode ? [{ debugName: "baselineMatrix" }] : /* istanbul ignore next */ []));
39
+ this.isDirty = signal(false, /* @ts-ignore */
40
+ ...(ngDevMode ? [{ debugName: "isDirty" }] : /* istanbul ignore next */ []));
41
+ //#endregion
42
+ //#region ---- Computed ----
43
+ /** Canonical payload for matrix bindings; must be a `computed` so `titles` / `matrixValue` track inputs. */
44
+ this.mergedContext = computed(() => mergeJobDefinitionMatrixPageContext(this.rootContext() ?? {}, this.localContext()), /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "mergedContext" }] : /* istanbul ignore next */ []));
46
+ this.titles = computed(() => jobLevelsToSpreadsheetTitles(this.mergedContext()['jobLevels'], this.translateService), /* @ts-ignore */
47
+ ...(ngDevMode ? [{ debugName: "titles" }] : /* istanbul ignore next */ []));
48
+ this.matrixValue = computed(() => {
49
+ const v = this.mergedContext()['skillRequirements'];
50
+ if (v != null && typeof v === 'object') {
51
+ return v;
52
+ }
53
+ return {};
54
+ }, /* @ts-ignore */
55
+ ...(ngDevMode ? [{ debugName: "matrixValue" }] : /* istanbul ignore next */ []));
56
+ let previousRootId = undefined;
57
+ effect(() => {
58
+ const ctx = this.rootContext();
59
+ const currentId = ctx != null && typeof ctx === 'object' ? ctx['id'] : undefined;
60
+ if (currentId !== previousRootId) {
61
+ previousRootId = currentId;
62
+ this.localContext.set(null);
63
+ const skillRequirements = ctx?.['skillRequirements'];
64
+ const base = skillRequirements != null && typeof skillRequirements === 'object'
65
+ ? cloneDeep(skillRequirements)
66
+ : {};
67
+ this.baselineMatrix.set(base);
68
+ this.isDirty.set(false);
69
+ }
70
+ });
71
+ }
72
+ //#endregion
73
+ //#region ---- UI handlers ----
74
+ onMatrixChange(data) {
75
+ if (this.ignoreNextMatrixChange()) {
76
+ this.ignoreNextMatrixChange.set(false);
77
+ return;
78
+ }
79
+ const base = this.localContext() ?? this.rootContext() ?? {};
80
+ this.localContext.set({
81
+ ...base,
82
+ skillRequirements: data,
83
+ });
84
+ const baseline = this.baselineMatrix() ?? {};
85
+ this.isDirty.set(!isEqual(baseline, data));
86
+ this.recompute();
87
+ }
88
+ //#endregion
89
+ //#region ---- Unsaved Changes ----
90
+ hasUnsavedChanges() {
91
+ return this.isDirty();
92
+ }
93
+ //#endregion
94
+ //#region ---- Page actions ----
95
+ async getPrimaryMenuItems() {
96
+ const discardTitle = (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';
97
+ const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';
98
+ const discardAction = {
99
+ title: discardTitle,
100
+ icon: 'fa-light fa-rotate-left',
101
+ zone: 'footer',
102
+ priority: 'secondary',
103
+ color: 'default',
104
+ visible: this.isDirty(),
105
+ command: {
106
+ name: JOB_DEFINITION_SKILLS_PAGE_DISCARD,
107
+ options: {},
108
+ },
109
+ };
110
+ const saveAction = {
111
+ title: saveTitle,
112
+ icon: 'fa-light fa-floppy-disk',
113
+ zone: 'footer',
114
+ priority: 'primary',
115
+ color: 'primary',
116
+ visible: this.isDirty(),
117
+ command: {
118
+ name: JOB_DEFINITION_SKILLS_SAVE,
119
+ options: {},
120
+ },
121
+ };
122
+ return [discardAction, saveAction];
123
+ }
124
+ //#endregion
125
+ //#region ---- Execute ----
126
+ execute(command) {
127
+ if (command.name === JOB_DEFINITION_SKILLS_PAGE_DISCARD) {
128
+ this.ignoreNextMatrixChange.set(true);
129
+ this.localContext.set(null);
130
+ const ctx = this.rootContext() ?? {};
131
+ const skillRequirements = ctx['skillRequirements'];
132
+ const base = skillRequirements != null && typeof skillRequirements === 'object'
133
+ ? cloneDeep(skillRequirements)
134
+ : {};
135
+ this.baselineMatrix.set(base);
136
+ this.isDirty.set(false);
137
+ this.recompute();
138
+ return;
139
+ }
140
+ if (command.name !== JOB_DEFINITION_SKILLS_SAVE) {
141
+ return;
142
+ }
143
+ return this.persistSkills();
144
+ }
145
+ async persistSkills() {
146
+ const ctx = this.mergedContext();
147
+ const id = ctx['id'];
148
+ if (typeof id !== 'string' || id.length === 0) {
149
+ return {
150
+ success: false,
151
+ message: {
152
+ text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),
153
+ },
154
+ };
155
+ }
156
+ const skillRequirements = ctx['skillRequirements'] ?? {};
157
+ try {
158
+ await this.entityService
159
+ .withEntity(RootConfig.module.name, RootConfig.entities.jobDefinition.name)
160
+ .data()
161
+ .update(id, {
162
+ skillRequirements,
163
+ });
164
+ this.baselineMatrix.set(cloneDeep(skillRequirements));
165
+ this.localContext.set(null);
166
+ this.isDirty.set(false);
167
+ this.recompute();
168
+ this.eventService.publish(AXPEntityEventsKeys.REFRESH_LAYOUT, {
169
+ name: `${RootConfig.module.name}.${RootConfig.entities.jobDefinition.name}`,
170
+ });
171
+ return { success: true, kind: 'object', data: undefined };
172
+ }
173
+ catch (error) {
174
+ const text = error instanceof Error && error.message
175
+ ? error.message
176
+ : (await this.translateService.translateAsync('@general:messages.entity.invalid-data')) ?? 'Save failed';
177
+ return {
178
+ success: false,
179
+ message: { text },
180
+ };
181
+ }
182
+ }
183
+ //#endregion
184
+ //#region ---- Recompute ----
185
+ recompute() {
186
+ super.recompute();
187
+ const layout = this.hostPageLayout;
188
+ layout?.recompute?.();
189
+ }
190
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMJobDefinitionSkillsPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
191
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.8", type: AXMJobDefinitionSkillsPageComponent, isStandalone: true, selector: "axm-job-definition-skills-page", inputs: { rootContext: { classPropertyName: "rootContext", publicName: "rootContext", isSignal: true, isRequired: false, transformFunction: null }, pageConfig: { classPropertyName: "pageConfig", publicName: "pageConfig", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block w-full" }, providers: [
192
+ {
193
+ provide: AXPPageLayoutBase,
194
+ useExisting: AXMJobDefinitionSkillsPageComponent,
195
+ },
196
+ ], usesInheritance: true, ngImport: i0, template: `
197
+ <axm-skill-matrix
198
+ [titles]="titles()"
199
+ [value]="matrixValue()"
200
+ [readonly]="false"
201
+ (valueChange)="onMatrixChange($event)"
202
+ />
203
+ `, isInline: true, dependencies: [{ kind: "component", type: AXMLearningManagementSkillMatrixComponent, selector: "axm-skill-matrix", inputs: ["titles", "value", "readonly", "skillIds"], outputs: ["valueChange", "cellChange", "skillIdsChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
204
+ }
205
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMJobDefinitionSkillsPageComponent, decorators: [{
206
+ type: Component,
207
+ args: [{
208
+ selector: 'axm-job-definition-skills-page',
209
+ standalone: true,
210
+ imports: [AXMLearningManagementSkillMatrixComponent],
211
+ template: `
212
+ <axm-skill-matrix
213
+ [titles]="titles()"
214
+ [value]="matrixValue()"
215
+ [readonly]="false"
216
+ (valueChange)="onMatrixChange($event)"
217
+ />
218
+ `,
219
+ host: {
220
+ class: 'block w-full',
221
+ },
222
+ changeDetection: ChangeDetectionStrategy.OnPush,
223
+ providers: [
224
+ {
225
+ provide: AXPPageLayoutBase,
226
+ useExisting: AXMJobDefinitionSkillsPageComponent,
227
+ },
228
+ ],
229
+ }]
230
+ }], ctorParameters: () => [], propDecorators: { rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }] } });
231
+
232
+ export { AXMJobDefinitionSkillsPageComponent };
233
+ //# sourceMappingURL=acorex-platform-module-organization-management-client-job-definition-skills-page.component--pyAaXB4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-organization-management-client-job-definition-skills-page.component--pyAaXB4.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/features/job-definition-pages/job-definition-skills-page.component.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPActionMenuItem, AXPExecuteCommand, AXPRuntimeCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPEntityEventsKeys } from '@acorex-platform/framework-shared/entity';\n\nimport { AXPBroadcastEventService } from '@acorex-platform/framework-client/core';\nimport { AXMLearningManagementSkillMatrixComponent } from '@acorex-platform/module-learning-management-client';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPSpreadsheetData } from '@acorex-platform/framework-client/layout/components';\nimport {\n AXPPageLayoutBase,\n AXPPageLayoutBaseComponent,\n} from '@acorex-platform/framework-client/layout/views';\nimport type { AXPLayoutDetailsViewAction } from '@acorex-platform/framework-client/layout/views';\nimport { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash';\nimport { RootConfig } from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXMOrganizationManagementJobDefinitionEntityModel } from '@acorex-platform/module-organization-management-client/contracts';\nimport { jobLevelsToSpreadsheetTitles, mergeJobDefinitionMatrixPageContext } from './job-definition-matrix-page.utils';\nimport type { AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\n\n//#endregion\n\nconst JOB_DEFINITION_SKILLS_PAGE_DISCARD = 'JobDefinition:Skills:Discard';\nconst JOB_DEFINITION_SKILLS_SAVE = 'JobDefinition:Skills:Save';\n\n//#region ---- Component ----\n\n@Component({\n selector: 'axm-job-definition-skills-page',\n standalone: true,\n imports: [AXMLearningManagementSkillMatrixComponent],\n template: `\n <axm-skill-matrix\n [titles]=\"titles()\"\n [value]=\"matrixValue()\"\n [readonly]=\"false\"\n (valueChange)=\"onMatrixChange($event)\"\n />\n `,\n host: {\n class: 'block w-full',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n {\n provide: AXPPageLayoutBase,\n useExisting: AXMJobDefinitionSkillsPageComponent,\n },\n ],\n})\nexport class AXMJobDefinitionSkillsPageComponent extends AXPPageLayoutBaseComponent {\n //#region ---- Inputs ----\n\n rootContext = input<Record<string, unknown>>();\n pageConfig = input<Record<string, unknown>>();\n\n //#endregion\n\n //#region ---- Services ----\n\n private readonly entityService = inject(AXPEntityService);\n private readonly eventService = inject(AXPBroadcastEventService);\n private readonly hostPageLayout = inject(AXPPageLayoutBase, { optional: true, skipSelf: true });\n\n //#endregion\n\n //#region ---- State ----\n\n private readonly localContext = signal<Record<string, unknown> | null>(null);\n private readonly ignoreNextMatrixChange = signal(false);\n private readonly baselineMatrix = signal<AXPSpreadsheetData | null>(null);\n protected readonly isDirty = signal(false);\n\n //#endregion\n\n //#region ---- Constructor ----\n\n constructor() {\n super();\n let previousRootId: unknown = undefined;\n\n effect(() => {\n const ctx = this.rootContext();\n const currentId = ctx != null && typeof ctx === 'object' ? ctx['id'] : undefined;\n if (currentId !== previousRootId) {\n previousRootId = currentId;\n this.localContext.set(null);\n const skillRequirements = ctx?.['skillRequirements'];\n const base =\n skillRequirements != null && typeof skillRequirements === 'object'\n ? cloneDeep(skillRequirements as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n }\n });\n }\n\n //#endregion\n\n //#region ---- Computed ----\n\n /** Canonical payload for matrix bindings; must be a `computed` so `titles` / `matrixValue` track inputs. */\n private readonly mergedContext = computed(() =>\n mergeJobDefinitionMatrixPageContext(this.rootContext() ?? {}, this.localContext()),\n );\n\n protected titles = computed(() =>\n jobLevelsToSpreadsheetTitles(this.mergedContext()['jobLevels'], this.translateService),\n );\n\n protected matrixValue = computed((): AXPSpreadsheetData => {\n const v = this.mergedContext()['skillRequirements'];\n if (v != null && typeof v === 'object') {\n return v as AXPSpreadsheetData;\n }\n return {};\n });\n\n //#endregion\n\n //#region ---- UI handlers ----\n\n protected onMatrixChange(data: AXPSpreadsheetData): void {\n if (this.ignoreNextMatrixChange()) {\n this.ignoreNextMatrixChange.set(false);\n return;\n }\n\n const base = this.localContext() ?? this.rootContext() ?? {};\n this.localContext.set({\n ...base,\n skillRequirements: data,\n });\n const baseline = this.baselineMatrix() ?? {};\n this.isDirty.set(!isEqual(baseline, data));\n this.recompute();\n }\n\n //#endregion\n\n //#region ---- Unsaved Changes ----\n\n override hasUnsavedChanges(): boolean {\n return this.isDirty();\n }\n\n //#endregion\n\n //#region ---- Page actions ----\n\n override async getPrimaryMenuItems(): Promise<AXPActionMenuItem[]> {\n const discardTitle =\n (await this.translateService.translateAsync('@general:actions.discard.title')) || 'Discard';\n const saveTitle = (await this.translateService.translateAsync('@general:actions.save.title')) || 'Save';\n\n const discardAction: AXPLayoutDetailsViewAction = {\n title: discardTitle,\n icon: 'fa-light fa-rotate-left',\n zone: 'footer',\n priority: 'secondary',\n color: 'default',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_SKILLS_PAGE_DISCARD,\n options: {},\n },\n };\n const saveAction: AXPLayoutDetailsViewAction = {\n title: saveTitle,\n icon: 'fa-light fa-floppy-disk',\n zone: 'footer',\n priority: 'primary',\n color: 'primary',\n visible: this.isDirty(),\n command: {\n name: JOB_DEFINITION_SKILLS_SAVE,\n options: {},\n },\n };\n\n return [discardAction, saveAction];\n }\n\n //#endregion\n\n //#region ---- Execute ----\n\n override execute(command: AXPExecuteCommand): void | Promise<void> {\n if (command.name === JOB_DEFINITION_SKILLS_PAGE_DISCARD) {\n this.ignoreNextMatrixChange.set(true);\n this.localContext.set(null);\n const ctx = this.rootContext() ?? {};\n const skillRequirements = ctx['skillRequirements'];\n const base =\n skillRequirements != null && typeof skillRequirements === 'object'\n ? cloneDeep(skillRequirements as AXPSpreadsheetData)\n : {};\n this.baselineMatrix.set(base);\n this.isDirty.set(false);\n this.recompute();\n return;\n }\n\n if (command.name !== JOB_DEFINITION_SKILLS_SAVE) {\n return;\n }\n\n return this.persistSkills() as unknown as Promise<void>;\n }\n\n private async persistSkills(): AXPCommandExecuteResultPromise {\n const ctx = this.mergedContext();\n const id = ctx['id'];\n if (typeof id !== 'string' || id.length === 0) {\n return {\n success: false,\n message: {\n text: await this.translateService.translateAsync('@general:messages.entity.invalid-data'),\n },\n };\n }\n\n const skillRequirements = (ctx['skillRequirements'] as AXPSpreadsheetData) ?? {};\n\n try {\n await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.jobDefinition.name)\n .data<string, AXMOrganizationManagementJobDefinitionEntityModel>()\n .update(id, {\n skillRequirements,\n });\n\n this.baselineMatrix.set(cloneDeep(skillRequirements));\n this.localContext.set(null);\n this.isDirty.set(false);\n this.recompute();\n\n this.eventService.publish(AXPEntityEventsKeys.REFRESH_LAYOUT, {\n name: `${RootConfig.module.name}.${RootConfig.entities.jobDefinition.name}`,\n });\n\n return { success: true, kind: 'object', data: undefined };\n } catch (error: unknown) {\n const text =\n error instanceof Error && error.message\n ? error.message\n : (await this.translateService.translateAsync('@general:messages.entity.invalid-data')) ?? 'Save failed';\n return {\n success: false,\n message: { text },\n };\n }\n }\n\n //#endregion\n\n //#region ---- Recompute ----\n\n protected override recompute(): void {\n super.recompute();\n const layout = this.hostPageLayout as { recompute?: () => void } | null;\n layout?.recompute?.();\n }\n\n //#endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAqBA;AAEA,MAAM,kCAAkC,GAAG,8BAA8B;AACzE,MAAM,0BAA0B,GAAG,2BAA2B;AAE9D;AAyBM,MAAO,mCAAoC,SAAQ,0BAA0B,CAAA;;;AA2BjF,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;AAzBT,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAA2B;AAC9C,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK;kGAA2B;;;AAM5B,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,YAAY,GAAG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,iBAAA;;;;;"}
@@ -0,0 +1,175 @@
1
+ import { AXPSessionService } from '@acorex-platform/framework-client/auth';
2
+ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
3
+ import { AXPCommonMenuKeys } from '@acorex-platform/module-common-client/contracts';
4
+ import { inject } from '@angular/core';
5
+ import { RootConfig, AXPPeopleOrganizationPermissionKeys, AXPOrganizationManagementMenuKeys } from '@acorex-platform/module-organization-management-client/contracts';
6
+
7
+ //#region ---- Imports ----
8
+ //#endregion
9
+ //#region ---- Menu Provider ----
10
+ /**
11
+ * Organization Management Module Menu Provider.
12
+ * Provides menu structure for the Organization Management module.
13
+ * - Root "Organization": Employees, Leave Requests, Chart (operational) then Teams, Positions, Business Units (structure)
14
+ * - Configuration/Organization: Job Definitions, Job Levels, Responsibilities, etc. (reference data)
15
+ */
16
+ class AXMMenuProvider {
17
+ constructor() {
18
+ //#region ---- Services & Dependencies ----
19
+ this.entityService = inject(AXPEntityService);
20
+ this.sessionService = inject(AXPSessionService);
21
+ //#endregion
22
+ }
23
+ //#endregion
24
+ //#region ---- Public Methods ----
25
+ async provide(context) {
26
+ const module = RootConfig.module;
27
+ const organizationMenu = context.find(AXPCommonMenuKeys.Organization);
28
+ if (!organizationMenu.exists) {
29
+ // Root "Organization" - structure items (Employees, Leave, Chart added by HCM with lower priorities)
30
+ context.addItems([
31
+ {
32
+ name: AXPCommonMenuKeys.Organization,
33
+ priority: 8000,
34
+ text: '@organization-management:module.menus.root.title',
35
+ icon: module.icon,
36
+ children: [
37
+ {
38
+ name: AXPOrganizationManagementMenuKeys.OrganizationChart,
39
+ text: '@organization-management:organization-chart.menus.chart.title',
40
+ path: `${this.sessionService.application?.name}/organization/chart`,
41
+ priority: 30,
42
+ icon: RootConfig.entities.chart.icon,
43
+ policy: {
44
+ features: [module.name],
45
+ permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],
46
+ },
47
+ },
48
+ { name: `${AXPOrganizationManagementMenuKeys.Root}:divider1`, text: '', type: 'break', priority: 40 },
49
+ {
50
+ name: AXPOrganizationManagementMenuKeys.Teams,
51
+ text: '@organization-management:teams.menus.teams.title',
52
+ path: this.entityService.createPath(module.name, RootConfig.entities.team.name),
53
+ priority: 50,
54
+ icon: RootConfig.entities.team.icon,
55
+ policy: {
56
+ features: [module.name],
57
+ permissions: [AXPPeopleOrganizationPermissionKeys.MaintainTeams],
58
+ },
59
+ },
60
+ {
61
+ name: AXPOrganizationManagementMenuKeys.Positions,
62
+ text: '@organization-management:positions.menus.positions.title',
63
+ path: this.entityService.createPath(module.name, RootConfig.entities.position.name),
64
+ priority: 55,
65
+ icon: RootConfig.entities.position.icon,
66
+ policy: {
67
+ features: [module.name],
68
+ permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],
69
+ },
70
+ },
71
+ {
72
+ name: AXPOrganizationManagementMenuKeys.BusinessUnits,
73
+ text: '@organization-management:business-units.menus.business-units.title',
74
+ path: this.entityService.createPath(module.name, RootConfig.entities.businessUnit.name),
75
+ priority: 60,
76
+ icon: RootConfig.entities.businessUnit.icon,
77
+ policy: {
78
+ features: [module.name],
79
+ permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],
80
+ },
81
+ },
82
+ ],
83
+ },
84
+ ]);
85
+ }
86
+ // Configuration/Organization - reference data (Job Definitions, Employment Types, etc.)
87
+ const orgConfigMenu = context.find(AXPCommonMenuKeys.OrganizationConfig);
88
+ if (!orgConfigMenu.exists) {
89
+ context.find(AXPCommonMenuKeys.Configuration).addItems([
90
+ {
91
+ name: AXPCommonMenuKeys.OrganizationConfig,
92
+ priority: 8600,
93
+ text: '@organization-management:module.menus.configuration.title',
94
+ icon: module.icon,
95
+ type: 'menu',
96
+ children: [],
97
+ },
98
+ ]);
99
+ }
100
+ // Add org config items
101
+ context.find(AXPCommonMenuKeys.OrganizationConfig).addItems([
102
+ {
103
+ name: AXPOrganizationManagementMenuKeys.TeamMemberRoles,
104
+ text: '@organization-management:team-member-roles.menus.team-member-roles.title',
105
+ path: this.entityService.createPath(module.name, RootConfig.entities.teamMemberRole.name),
106
+ priority: 1,
107
+ icon: RootConfig.entities.teamMemberRole.icon,
108
+ policy: {
109
+ features: [module.name],
110
+ permissions: [AXPPeopleOrganizationPermissionKeys.Setup],
111
+ },
112
+ },
113
+ {
114
+ name: AXPOrganizationManagementMenuKeys.JobDefinitions,
115
+ text: '@organization-management:job-definitions.menus.job-definitions.title',
116
+ path: this.entityService.createPath(module.name, RootConfig.entities.jobDefinition.name),
117
+ priority: 2,
118
+ icon: RootConfig.entities.jobDefinition.icon,
119
+ policy: {
120
+ features: [module.name],
121
+ permissions: [AXPPeopleOrganizationPermissionKeys.DesignJobs],
122
+ },
123
+ },
124
+ {
125
+ name: AXPOrganizationManagementMenuKeys.JobLevels,
126
+ text: '@organization-management:job-levels.menus.job-levels.title',
127
+ path: this.entityService.createPath(module.name, RootConfig.entities.jobLevel.name),
128
+ priority: 3,
129
+ icon: RootConfig.entities.jobLevel.icon,
130
+ policy: {
131
+ features: [module.name],
132
+ permissions: [AXPPeopleOrganizationPermissionKeys.Setup],
133
+ },
134
+ },
135
+ {
136
+ name: AXPOrganizationManagementMenuKeys.Responsibilities,
137
+ text: '@organization-management:responsibilities.menus.responsibilities.title',
138
+ path: this.entityService.createPath(module.name, RootConfig.entities.responsibility.name),
139
+ priority: 4,
140
+ icon: RootConfig.entities.responsibility.icon,
141
+ policy: {
142
+ features: [module.name],
143
+ permissions: [AXPPeopleOrganizationPermissionKeys.Setup],
144
+ },
145
+ },
146
+ {
147
+ name: AXPOrganizationManagementMenuKeys.ResponsibilityLevels,
148
+ text: '@organization-management:responsibility-levels.menus.responsibility-levels.title',
149
+ path: this.entityService.createPath(module.name, RootConfig.entities.responsibilityLevel.name),
150
+ priority: 5,
151
+ icon: RootConfig.entities.responsibilityLevel.icon,
152
+ policy: {
153
+ features: [module.name],
154
+ permissions: [AXPPeopleOrganizationPermissionKeys.Setup],
155
+ },
156
+ },
157
+ {
158
+ name: AXPOrganizationManagementMenuKeys.BusinessUnitTypes,
159
+ text: '@organization-management:business-unit-types.menus.business-unit-types.title',
160
+ path: this.entityService.createPath(module.name, RootConfig.entities.businessUnitType.name),
161
+ priority: 6,
162
+ icon: RootConfig.entities.businessUnitType.icon,
163
+ policy: {
164
+ features: [module.name],
165
+ permissions: [AXPPeopleOrganizationPermissionKeys.Setup],
166
+ },
167
+ },
168
+ { name: `${AXPOrganizationManagementMenuKeys.Root}:staff-divider`, text: '', type: 'break', priority: 7 },
169
+ ]);
170
+ }
171
+ }
172
+ //#endregion
173
+
174
+ export { AXMMenuProvider };
175
+ //# sourceMappingURL=acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-organization-management-client-menu.provider-BgRoEC48.mjs","sources":["../../../../libs/modules/organization-management/client/src/lib/menu.provider.ts"],"sourcesContent":["//#region ---- Imports ----\n\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPMenuProvider, AXPMenuProviderContext } from '@acorex-platform/framework-client/common';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport {\n AXPCommonMenuKeys\n} from '@acorex-platform/module-common-client/contracts';\nimport { inject } from '@angular/core';\nimport {\n RootConfig,\n AXPPeopleOrganizationPermissionKeys\n} from '@acorex-platform/module-organization-management-client/contracts';\nimport { AXPOrganizationManagementMenuKeys } from '@acorex-platform/module-organization-management-client/contracts';\n\n//#endregion\n\n//#region ---- Menu Provider ----\n\n/**\n * Organization Management Module Menu Provider.\n * Provides menu structure for the Organization Management module.\n * - Root \"Organization\": Employees, Leave Requests, Chart (operational) then Teams, Positions, Business Units (structure)\n * - Configuration/Organization: Job Definitions, Job Levels, Responsibilities, etc. (reference data)\n */\nexport class AXMMenuProvider implements AXPMenuProvider {\n //#region ---- Services & Dependencies ----\n\n private entityService = inject(AXPEntityService);\n private sessionService = inject(AXPSessionService);\n\n //#endregion\n\n //#region ---- Public Methods ----\n\n async provide(context: AXPMenuProviderContext): Promise<void> {\n const module = RootConfig.module;\n\n const organizationMenu = context.find(AXPCommonMenuKeys.Organization);\n if (!organizationMenu.exists) {\n // Root \"Organization\" - structure items (Employees, Leave, Chart added by HCM with lower priorities)\n context.addItems([\n {\n name: AXPCommonMenuKeys.Organization,\n priority: 8000,\n text: '@organization-management:module.menus.root.title',\n icon: module.icon,\n children: [\n {\n name: AXPOrganizationManagementMenuKeys.OrganizationChart,\n text: '@organization-management:organization-chart.menus.chart.title',\n path: `${this.sessionService.application?.name}/organization/chart`,\n priority: 30,\n icon: RootConfig.entities.chart.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n { name: `${AXPOrganizationManagementMenuKeys.Root}:divider1`, text: '', type: 'break', priority: 40 },\n {\n name: AXPOrganizationManagementMenuKeys.Teams,\n text: '@organization-management:teams.menus.teams.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.team.name),\n priority: 50,\n icon: RootConfig.entities.team.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.MaintainTeams],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.Positions,\n text: '@organization-management:positions.menus.positions.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.position.name),\n priority: 55,\n icon: RootConfig.entities.position.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.BusinessUnits,\n text: '@organization-management:business-units.menus.business-units.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.businessUnit.name),\n priority: 60,\n icon: RootConfig.entities.businessUnit.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.ViewOrganization],\n },\n },\n ],\n },\n ]);\n }\n\n // Configuration/Organization - reference data (Job Definitions, Employment Types, etc.)\n const orgConfigMenu = context.find(AXPCommonMenuKeys.OrganizationConfig);\n if (!orgConfigMenu.exists) {\n context.find(AXPCommonMenuKeys.Configuration).addItems([\n {\n name: AXPCommonMenuKeys.OrganizationConfig,\n priority: 8600,\n text: '@organization-management:module.menus.configuration.title',\n icon: module.icon,\n type: 'menu',\n children: [],\n },\n ]);\n }\n\n // Add org config items\n context.find(AXPCommonMenuKeys.OrganizationConfig).addItems([\n {\n name: AXPOrganizationManagementMenuKeys.TeamMemberRoles,\n text: '@organization-management:team-member-roles.menus.team-member-roles.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.teamMemberRole.name),\n priority: 1,\n icon: RootConfig.entities.teamMemberRole.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.JobDefinitions,\n text: '@organization-management:job-definitions.menus.job-definitions.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.jobDefinition.name),\n priority: 2,\n icon: RootConfig.entities.jobDefinition.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.DesignJobs],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.JobLevels,\n text: '@organization-management:job-levels.menus.job-levels.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.jobLevel.name),\n priority: 3,\n icon: RootConfig.entities.jobLevel.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.Responsibilities,\n text: '@organization-management:responsibilities.menus.responsibilities.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.responsibility.name),\n priority: 4,\n icon: RootConfig.entities.responsibility.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.ResponsibilityLevels,\n text: '@organization-management:responsibility-levels.menus.responsibility-levels.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.responsibilityLevel.name),\n priority: 5,\n icon: RootConfig.entities.responsibilityLevel.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n {\n name: AXPOrganizationManagementMenuKeys.BusinessUnitTypes,\n text: '@organization-management:business-unit-types.menus.business-unit-types.title',\n path: this.entityService.createPath(module.name, RootConfig.entities.businessUnitType.name),\n priority: 6,\n icon: RootConfig.entities.businessUnitType.icon,\n policy: {\n features: [module.name],\n permissions: [AXPPeopleOrganizationPermissionKeys.Setup],\n },\n },\n { name: `${AXPOrganizationManagementMenuKeys.Root}:staff-divider`, text: '', type: 'break', priority: 7 },\n ]);\n }\n\n //#endregion\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;AAAA;AAeA;AAEA;AAEA;;;;;AAKG;MACU,eAAe,CAAA;AAA5B,IAAA,WAAA,GAAA;;AAGU,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,gBAAgB,CAAC;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;;IA6JpD;;;IAvJE,MAAM,OAAO,CAAC,OAA+B,EAAA;AAC3C,QAAA,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM;QAEhC,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC;AACrE,QAAA,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;;YAE5B,OAAO,CAAC,QAAQ,CAAC;AACjB,gBAAA;oBACE,IAAI,EAAE,iBAAiB,CAAC,YAAY;AACpC,oBAAA,QAAQ,EAAE,IAAI;AACd,oBAAA,IAAI,EAAE,kDAAkD;oBACxD,IAAI,EAAE,MAAM,CAAC,IAAI;AACjB,oBAAA,QAAQ,EAAE;AACR,wBAAA;4BACE,IAAI,EAAE,iCAAiC,CAAC,iBAAiB;AACzD,4BAAA,IAAI,EAAE,+DAA+D;4BACrE,IAAI,EAAE,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,EAAE,IAAI,C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