@acorex/modules 19.2.5 → 19.2.6
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/auth/lib/store/auth.effects.d.ts +2 -2
- package/fesm2022/{acorex-modules-application-management-module-designer.component-kMtkkid-.mjs → acorex-modules-application-management-module-designer.component-DPJ4qpK3.mjs} +4 -4
- package/fesm2022/acorex-modules-application-management-module-designer.component-DPJ4qpK3.mjs.map +1 -0
- package/fesm2022/acorex-modules-application-management.mjs +3 -3
- package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-auth-acorex-modules-auth-CcRRSTGN.mjs → acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs} +22 -22
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-D75igkfc.mjs.map +1 -0
- package/fesm2022/acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs +64 -0
- package/fesm2022/acorex-modules-auth-app-chooser.component-BZb8n5Ag.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-login.module-ua9uEgUG.mjs → acorex-modules-auth-login.module-DAtJYcHZ.mjs} +4 -4
- package/fesm2022/{acorex-modules-auth-login.module-ua9uEgUG.mjs.map → acorex-modules-auth-login.module-DAtJYcHZ.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs +23 -0
- package/fesm2022/acorex-modules-auth-master.layout-qeAQTygT.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-password.component-BVoPZUG9.mjs → acorex-modules-auth-password.component-20Ofs9FL.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-password.component-BVoPZUG9.mjs.map → acorex-modules-auth-password.component-20Ofs9FL.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-auth-password.component-CIwOjQRh.mjs → acorex-modules-auth-password.component-CRvI9sIa.mjs} +4 -4
- package/fesm2022/acorex-modules-auth-password.component-CRvI9sIa.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-routes-hR3jePok.mjs → acorex-modules-auth-routes-BDED-qaZ.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-routes-hR3jePok.mjs.map → acorex-modules-auth-routes-BDED-qaZ.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-CKsbiOUX.mjs +83 -0
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-CKsbiOUX.mjs.map +1 -0
- package/fesm2022/{acorex-modules-auth-two-factor.module-CKe_H_-u.mjs → acorex-modules-auth-two-factor.module-B0C2aBWh.mjs} +2 -2
- package/fesm2022/{acorex-modules-auth-two-factor.module-CKe_H_-u.mjs.map → acorex-modules-auth-two-factor.module-B0C2aBWh.mjs.map} +1 -1
- package/fesm2022/acorex-modules-auth.mjs +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +4 -4
- package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-xiRKc4FF.mjs +126 -0
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-xiRKc4FF.mjs.map +1 -0
- package/fesm2022/acorex-modules-form-template-management.mjs +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +279 -8
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs +92 -0
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-DEFgztyn.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs +145 -0
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.service-D-LkPUIw.mjs.map +1 -0
- package/fesm2022/{acorex-modules-organization-managment-org-chart.page-CTHNSn2n.mjs → acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs} +111 -19
- package/fesm2022/acorex-modules-organization-managment-org-chart.page-B3aaLlm2.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-managment.mjs +2 -2
- package/fesm2022/acorex-modules-platform-management.mjs +12 -0
- package/fesm2022/acorex-modules-platform-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-security-management.mjs +12 -1
- package/fesm2022/acorex-modules-security-management.mjs.map +1 -1
- package/notification-management/lib/components/promotion-slot/promotion-slot.component.d.ts +11 -0
- package/notification-management/lib/entities/channel/channel.types.d.ts +11 -1
- package/organization-managment/lib/features/organization-chart/org-chart-configuration.page.d.ts +2 -2
- package/organization-managment/lib/features/organization-chart/org-chart-configuration.service.d.ts +24 -0
- package/organization-managment/lib/features/organization-chart/org-chart.page.d.ts +1 -1
- package/organization-managment/lib/features/organization-chart/org-chart.service.d.ts +3 -19
- package/package.json +1 -1
- package/security-management/index.d.ts +1 -0
- package/security-management/lib/menu.keys.d.ts +5 -0
- package/fesm2022/acorex-modules-application-management-module-designer.component-kMtkkid-.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-acorex-modules-auth-CcRRSTGN.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-app-chooser.component-DuRnQda8.mjs +0 -64
- package/fesm2022/acorex-modules-auth-app-chooser.component-DuRnQda8.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-master.layout-KNzdjwP6.mjs +0 -23
- package/fesm2022/acorex-modules-auth-master.layout-KNzdjwP6.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-password.component-CIwOjQRh.mjs.map +0 -1
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-Cx3fK__H.mjs +0 -83
- package/fesm2022/acorex-modules-auth-tenant-chooser.component-Cx3fK__H.mjs.map +0 -1
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs +0 -126
- package/fesm2022/acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs +0 -310
- package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-managment-org-chart.page-CTHNSn2n.mjs.map +0 -1
package/fesm2022/acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs
DELETED
@@ -1,126 +0,0 @@
|
|
1
|
-
import * as i4 from '@acorex/components/button';
|
2
|
-
import { AXButtonModule } from '@acorex/components/button';
|
3
|
-
import * as i2 from '@acorex/components/common';
|
4
|
-
import { AXCommonModule } from '@acorex/components/common';
|
5
|
-
import * as i5 from '@acorex/components/decorators';
|
6
|
-
import { AXDecoratorModule } from '@acorex/components/decorators';
|
7
|
-
import { AXBasePageComponent } from '@acorex/components/page';
|
8
|
-
import * as i7 from '@acorex/components/search-box';
|
9
|
-
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
10
|
-
import * as i6 from '@acorex/components/tabs';
|
11
|
-
import { AXTabsModule } from '@acorex/components/tabs';
|
12
|
-
import { AXPSettingService, AXPSettingScope, AXPStickyDirective } from '@acorex/platform/common';
|
13
|
-
import * as i1 from '@angular/common';
|
14
|
-
import { CommonModule } from '@angular/common';
|
15
|
-
import * as i0 from '@angular/core';
|
16
|
-
import { inject, model, signal, computed, Component, ViewEncapsulation } from '@angular/core';
|
17
|
-
import * as i3 from '@angular/forms';
|
18
|
-
import { FormsModule } from '@angular/forms';
|
19
|
-
import { orderBy, uniqBy } from 'lodash-es';
|
20
|
-
|
21
|
-
class AXPTemplateWidgetPickerComponent extends AXBasePageComponent {
|
22
|
-
constructor() {
|
23
|
-
super(...arguments);
|
24
|
-
this.settingService = inject(AXPSettingService);
|
25
|
-
this.pinnedSettingKey = 'forms:templates:picker:pinned';
|
26
|
-
this.searchTerm = model('');
|
27
|
-
// Signals
|
28
|
-
this.widgets = [];
|
29
|
-
this.displayWidgets = signal([]);
|
30
|
-
// Signal to track selected widgets
|
31
|
-
this.selectedWidgets = signal([]);
|
32
|
-
// Computed for filtered and ordered widget list
|
33
|
-
this.orderedList = computed(() => {
|
34
|
-
const search = this.searchTerm().toLowerCase();
|
35
|
-
const selectedTabName = this.selectedTab().name;
|
36
|
-
return orderBy(this.displayWidgets().filter((w) => {
|
37
|
-
const matchesTab = selectedTabName === 'all' || w.group.name === selectedTabName;
|
38
|
-
const matchesSearch = !search || w.title.toLowerCase().includes(search) || w.description?.toLowerCase().includes(search);
|
39
|
-
return matchesTab && matchesSearch;
|
40
|
-
}), ['pinned', 'title'], ['desc', 'asc']);
|
41
|
-
});
|
42
|
-
// Pinned and regular lists
|
43
|
-
this.pinnedList = computed(() => this.orderedList().filter((c) => c.pinned));
|
44
|
-
this.regularList = computed(() => this.orderedList().filter((c) => !c.pinned));
|
45
|
-
this.tabs = computed(() => {
|
46
|
-
const uniqueOrderedWidgets = orderBy(uniqBy([{ name: 'all', title: 'All', order: 0 }, ...this.widgets.map(c => c.group)], (c) => c.name // or another property to ensure uniqueness
|
47
|
-
), (c) => c.order);
|
48
|
-
return uniqueOrderedWidgets;
|
49
|
-
});
|
50
|
-
this.currentTabIndex = signal(0);
|
51
|
-
this.selectedTab = computed(() => this.tabs()[this.currentTabIndex()]);
|
52
|
-
}
|
53
|
-
async ngOnInit() {
|
54
|
-
super.ngOnInit();
|
55
|
-
const pinnedWidgets = (await this.settingService.get(this.pinnedSettingKey)) || [];
|
56
|
-
this.displayWidgets.set(this.widgets.map((c) => ({ ...c, pinned: pinnedWidgets.includes(c.id), icon: c.icon ?? 'fa-solid fa-file-invoice' })));
|
57
|
-
}
|
58
|
-
handleTabChange(event) {
|
59
|
-
const indx = event.index;
|
60
|
-
if (this.currentTabIndex() != indx) {
|
61
|
-
this.currentTabIndex.set(indx);
|
62
|
-
}
|
63
|
-
}
|
64
|
-
handleClick(event, widget) {
|
65
|
-
if (event.ctrlKey) {
|
66
|
-
const currentSelection = this.selectedWidgets();
|
67
|
-
const isAlreadySelected = currentSelection.some((w) => w === widget);
|
68
|
-
if (isAlreadySelected) {
|
69
|
-
// Deselect widget if already selected
|
70
|
-
this.selectedWidgets.set(currentSelection.filter((w) => w !== widget));
|
71
|
-
}
|
72
|
-
else {
|
73
|
-
// Add widget to selection
|
74
|
-
this.selectedWidgets.set([...currentSelection, widget]);
|
75
|
-
}
|
76
|
-
}
|
77
|
-
else {
|
78
|
-
// If CTRL is not pressed, select only the clicked widget
|
79
|
-
this.close({ widgets: [widget] });
|
80
|
-
}
|
81
|
-
}
|
82
|
-
async handlePinClick(e, widget) {
|
83
|
-
e.stopPropagation();
|
84
|
-
widget.pinned = !widget.pinned;
|
85
|
-
// Get the current list of pinned widgets from settings
|
86
|
-
let pinnedWidgets = (await this.settingService.get(this.pinnedSettingKey)) || [];
|
87
|
-
// Update the list of pinned widgets based on the pinned status
|
88
|
-
if (widget.pinned) {
|
89
|
-
if (!pinnedWidgets.includes(widget.id)) {
|
90
|
-
pinnedWidgets.push(widget.id);
|
91
|
-
}
|
92
|
-
}
|
93
|
-
else {
|
94
|
-
pinnedWidgets = pinnedWidgets.filter((name) => name !== widget.id);
|
95
|
-
}
|
96
|
-
// Save the updated list of pinned widgets
|
97
|
-
await this.settingService.scope(AXPSettingScope.User).set(this.pinnedSettingKey, pinnedWidgets);
|
98
|
-
// Trigger a re-render of the widgets
|
99
|
-
this.displayWidgets.set([...this.displayWidgets()]);
|
100
|
-
}
|
101
|
-
// Check if a widget is selected
|
102
|
-
isWidgetSelected(widget) {
|
103
|
-
return this.selectedWidgets().includes(widget);
|
104
|
-
}
|
105
|
-
handleConfirmSelection() {
|
106
|
-
this.close({ widgets: this.selectedWidgets() });
|
107
|
-
}
|
108
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetPickerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
109
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXPTemplateWidgetPickerComponent, isStandalone: true, selector: "ng-component", inputs: { searchTerm: { classPropertyName: "searchTerm", publicName: "searchTerm", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { searchTerm: "searchTermChange" }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-flex ax-flex-col lg:ax-h-[75vh]\">\n <div>\n <ax-tabs [look]=\"'with-line'\" (onActiveTabChanged)=\"handleTabChange($event)\">\n @for(w of tabs();track $index)\n {\n <ax-tab-item [text]=\"w.title\" [key]=\"$index.toString()\"\n [active]=\"currentTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n </div>\n <div class=\"ax-overflow-auto\" #content>\n <div class=\"ax-p-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all \" #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface-lowest ax-shadow-xl'\" [stickyParent]=\"content\" [stickyOffset]=\"10\">\n <ax-search-box look=\"fill\" placeholder=\"e.g. Button, Text, ...\" [(ngModel)]=\"searchTerm\" [delayTime]=\"300\"\n [axAutoFocus]=\"true\">\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-pt-0\">\n <ng-template #itemTpl let-w>\n <div (click)=\"handleClick($event,w)\"\n class=\"ax-py-2 ax-px-3 ax-rounded-md ax-flex ax-gap-3 ax-items-center ax-group hover:ax-bg-primary-100 dark:hover:ax-bg-primary-800 ax-cursor-pointer\"\n [class.ax-bg-primary-100]=\"isWidgetSelected(w)\">\n <div class=\"ax-w-10 ax-h-10 ax-flex ax-items-center ax-justify-center ax-rounded-md ax-border ax-border-neutral-200 ax-text-neutral-500 ax-bg-on-surface group-hover:ax-bg-primary-200\"\n [class.ax-bg-primary-200]=\"isWidgetSelected(w)\">\n <i [ngClass]=\"w.icon\" class=\"ax-text-lg group-hover:ax-text-primary-700 ax-text-on-surface-fore\"\n [class.ax-text-primary-700]=\"isWidgetSelected(w)\"></i>\n </div>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-flex-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n <div class=\"ax-font-semibold ax-text-sm\">{{w.title}}</div>\n <div (click)=\"handlePinClick($event,w)\">\n @if (w.pinned) {\n <i class=\"fa-solid fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45\"></i>\n }\n @else {\n <i\n class=\"fa-light fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45 ax-invisible group-hover:ax-visible\"></i>\n }\n </div>\n </div>\n <span class=\"ax-text-xs ax-text-neutral-400 ax-truncate\">\n {{w.description}}\n </span>\n </div>\n </div>\n </ng-template>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of pinnedList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n @if(pinnedList().length)\n {\n <hr class=\"ax-my-4 ax-border-dashed\">\n }\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of regularList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n </div>\n </div>\n</div>\n@if(selectedWidgets().length)\n{\n<ax-footer>\n <ax-suffix>\n <ax-button look=\"solid\" color=\"primary\" text=\"{{ selectedWidgets().length }} Selected\"\n (onClick)=\"handleConfirmSelection()\"></ax-button>\n </ax-suffix>\n</ax-footer>\n}", styles: [".selected-widget{border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-100),var(--tw-bg-opacity, 1))}.selected-widget i{--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-primary-500),var(--tw-text-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i2.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i4.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i5.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i5.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXTabsModule }, { kind: "component", type: i6.AXTabsComponent, selector: "ax-tabs", inputs: ["look", "location", "fitParent", "minWidth", "content"], outputs: ["onActiveTabChanged"] }, { kind: "component", type: i6.AXTabItemComponent, selector: "ax-tab-item", inputs: ["disabled", "text", "key", "headerTemplate", "active"], outputs: ["disabledChange", "onClick", "onBlur", "onFocus", "activeChange"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i7.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "directive", type: AXPStickyDirective, selector: "[axpSticky]", inputs: ["axpSticky", "stickyOffset", "stickyParent", "stickyTarget"], outputs: ["isStickyChange"], exportAs: ["axpSticky"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
110
|
-
}
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPTemplateWidgetPickerComponent, decorators: [{
|
112
|
-
type: Component,
|
113
|
-
args: [{ imports: [
|
114
|
-
CommonModule,
|
115
|
-
AXCommonModule,
|
116
|
-
FormsModule,
|
117
|
-
AXButtonModule,
|
118
|
-
AXDecoratorModule,
|
119
|
-
AXTabsModule,
|
120
|
-
AXSearchBoxModule,
|
121
|
-
AXPStickyDirective,
|
122
|
-
], encapsulation: ViewEncapsulation.None, template: "<div class=\"ax-flex ax-flex-col lg:ax-h-[75vh]\">\n <div>\n <ax-tabs [look]=\"'with-line'\" (onActiveTabChanged)=\"handleTabChange($event)\">\n @for(w of tabs();track $index)\n {\n <ax-tab-item [text]=\"w.title\" [key]=\"$index.toString()\"\n [active]=\"currentTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n </div>\n <div class=\"ax-overflow-auto\" #content>\n <div class=\"ax-p-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all \" #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface-lowest ax-shadow-xl'\" [stickyParent]=\"content\" [stickyOffset]=\"10\">\n <ax-search-box look=\"fill\" placeholder=\"e.g. Button, Text, ...\" [(ngModel)]=\"searchTerm\" [delayTime]=\"300\"\n [axAutoFocus]=\"true\">\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-pt-0\">\n <ng-template #itemTpl let-w>\n <div (click)=\"handleClick($event,w)\"\n class=\"ax-py-2 ax-px-3 ax-rounded-md ax-flex ax-gap-3 ax-items-center ax-group hover:ax-bg-primary-100 dark:hover:ax-bg-primary-800 ax-cursor-pointer\"\n [class.ax-bg-primary-100]=\"isWidgetSelected(w)\">\n <div class=\"ax-w-10 ax-h-10 ax-flex ax-items-center ax-justify-center ax-rounded-md ax-border ax-border-neutral-200 ax-text-neutral-500 ax-bg-on-surface group-hover:ax-bg-primary-200\"\n [class.ax-bg-primary-200]=\"isWidgetSelected(w)\">\n <i [ngClass]=\"w.icon\" class=\"ax-text-lg group-hover:ax-text-primary-700 ax-text-on-surface-fore\"\n [class.ax-text-primary-700]=\"isWidgetSelected(w)\"></i>\n </div>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-flex-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n <div class=\"ax-font-semibold ax-text-sm\">{{w.title}}</div>\n <div (click)=\"handlePinClick($event,w)\">\n @if (w.pinned) {\n <i class=\"fa-solid fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45\"></i>\n }\n @else {\n <i\n class=\"fa-light fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45 ax-invisible group-hover:ax-visible\"></i>\n }\n </div>\n </div>\n <span class=\"ax-text-xs ax-text-neutral-400 ax-truncate\">\n {{w.description}}\n </span>\n </div>\n </div>\n </ng-template>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of pinnedList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n @if(pinnedList().length)\n {\n <hr class=\"ax-my-4 ax-border-dashed\">\n }\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of regularList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n </div>\n </div>\n</div>\n@if(selectedWidgets().length)\n{\n<ax-footer>\n <ax-suffix>\n <ax-button look=\"solid\" color=\"primary\" text=\"{{ selectedWidgets().length }} Selected\"\n (onClick)=\"handleConfirmSelection()\"></ax-button>\n </ax-suffix>\n</ax-footer>\n}", styles: [".selected-widget{border-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-primary-500),var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-primary-100),var(--tw-bg-opacity, 1))}.selected-widget i{--tw-text-opacity: 1;color:rgba(var(--ax-sys-color-primary-500),var(--tw-text-opacity, 1))}\n"] }]
|
123
|
-
}] });
|
124
|
-
|
125
|
-
export { AXPTemplateWidgetPickerComponent };
|
126
|
-
//# sourceMappingURL=acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs.map
|
package/fesm2022/acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"acorex-modules-form-template-management-template-picker.component-CG-_1tWi.mjs","sources":["../../../../libs/modules/form-template-management/src/lib/components/widgets/template-picker/template-picker.component.ts","../../../../libs/modules/form-template-management/src/lib/components/widgets/template-picker/template-picker.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXCommonModule } from '@acorex/components/common';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { AXSearchBoxModule } from '@acorex/components/search-box';\nimport { AXTabsModule, AXTabStripChangedEvent } from '@acorex/components/tabs';\nimport { AXPSettingScope, AXPSettingService, AXPStickyDirective } from '@acorex/platform/common';\nimport { AXPWidgetGroup } from '@acorex/platform/layout/builder';\nimport { CommonModule } from '@angular/common';\nimport { Component, computed, inject, model, signal, ViewEncapsulation } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { orderBy, uniqBy } from 'lodash-es';\nimport { AXPTemplateWidgetListItem } from './template.provider';\n\nexport interface AXPDisplayWidgetProvided extends AXPTemplateWidgetListItem {\n pinned: boolean;\n}\n\n@Component({\n imports: [\n CommonModule,\n AXCommonModule,\n FormsModule,\n AXButtonModule,\n AXDecoratorModule,\n AXTabsModule,\n AXSearchBoxModule,\n AXPStickyDirective,\n ],\n templateUrl: './template-picker.component.html',\n encapsulation: ViewEncapsulation.None,\n styleUrls: ['./template-picker.component.scss']\n})\nexport class AXPTemplateWidgetPickerComponent extends AXBasePageComponent {\n private settingService = inject(AXPSettingService);\n\n private readonly pinnedSettingKey = 'forms:templates:picker:pinned';\n\n protected searchTerm = model('');\n\n // Signals\n private widgets: AXPDisplayWidgetProvided[] = [];\n private displayWidgets = signal<AXPDisplayWidgetProvided[]>([]);\n\n // Signal to track selected widgets\n protected selectedWidgets = signal<AXPDisplayWidgetProvided[]>([]);\n\n // Computed for filtered and ordered widget list\n private orderedList = computed(() => {\n const search = this.searchTerm().toLowerCase();\n const selectedTabName = this.selectedTab().name;\n\n return orderBy(\n this.displayWidgets().filter((w) => {\n const matchesTab = selectedTabName === 'all' || w.group.name === selectedTabName;\n const matchesSearch =\n !search || w.title.toLowerCase().includes(search) || w.description?.toLowerCase().includes(search);\n return matchesTab && matchesSearch;\n }),\n ['pinned', 'title'],\n ['desc', 'asc']\n );\n });\n\n // Pinned and regular lists\n protected pinnedList = computed(() => this.orderedList().filter((c) => c.pinned));\n protected regularList = computed(() => this.orderedList().filter((c) => !c.pinned));\n\n protected tabs = computed<AXPWidgetGroup[]>(() => {\n const uniqueOrderedWidgets = orderBy(\n uniqBy(\n [{ name: 'all', title: 'All', order: 0 }, ...this.widgets.map(c => c.group)],\n (c) => c.name // or another property to ensure uniqueness\n ),\n (c) => c.order\n );\n return uniqueOrderedWidgets;\n })\n protected currentTabIndex = signal(0);\n protected selectedTab = computed(() => this.tabs()[this.currentTabIndex()]);\n\n protected override async ngOnInit() {\n super.ngOnInit();\n const pinnedWidgets = (await this.settingService.get<string[]>(this.pinnedSettingKey)) || [];\n this.displayWidgets.set(this.widgets.map((c) => ({ ...c, pinned: pinnedWidgets.includes(c.id), icon: c.icon ?? 'fa-solid fa-file-invoice' })));\n }\n\n protected handleTabChange(event: AXTabStripChangedEvent): void {\n const indx = event.index;\n if (this.currentTabIndex() != indx) {\n this.currentTabIndex.set(indx);\n }\n }\n\n protected handleClick(event: MouseEvent, widget: AXPDisplayWidgetProvided) {\n if (event.ctrlKey) {\n const currentSelection = this.selectedWidgets();\n const isAlreadySelected = currentSelection.some((w) => w === widget);\n\n if (isAlreadySelected) {\n // Deselect widget if already selected\n this.selectedWidgets.set(currentSelection.filter((w) => w !== widget));\n } else {\n // Add widget to selection\n this.selectedWidgets.set([...currentSelection, widget]);\n }\n } else {\n // If CTRL is not pressed, select only the clicked widget\n this.close({ widgets: [widget] });\n }\n }\n\n protected async handlePinClick(e: MouseEvent, widget: AXPDisplayWidgetProvided) {\n e.stopPropagation();\n widget.pinned = !widget.pinned;\n // Get the current list of pinned widgets from settings\n let pinnedWidgets = (await this.settingService.get<string[]>(this.pinnedSettingKey)) || [];\n\n // Update the list of pinned widgets based on the pinned status\n if (widget.pinned) {\n if (!pinnedWidgets.includes(widget.id)) {\n pinnedWidgets.push(widget.id);\n }\n } else {\n pinnedWidgets = pinnedWidgets.filter((name) => name !== widget.id);\n }\n\n // Save the updated list of pinned widgets\n await this.settingService.scope(AXPSettingScope.User).set(this.pinnedSettingKey, pinnedWidgets);\n\n // Trigger a re-render of the widgets\n this.displayWidgets.set([...this.displayWidgets()]);\n }\n\n // Check if a widget is selected\n protected isWidgetSelected(widget: AXPDisplayWidgetProvided): boolean {\n return this.selectedWidgets().includes(widget);\n }\n\n protected handleConfirmSelection(): void {\n this.close({ widgets: this.selectedWidgets() });\n }\n}\n","<div class=\"ax-flex ax-flex-col lg:ax-h-[75vh]\">\n <div>\n <ax-tabs [look]=\"'with-line'\" (onActiveTabChanged)=\"handleTabChange($event)\">\n @for(w of tabs();track $index)\n {\n <ax-tab-item [text]=\"w.title\" [key]=\"$index.toString()\"\n [active]=\"currentTabIndex() === $index\"></ax-tab-item>\n }\n </ax-tabs>\n </div>\n <div class=\"ax-overflow-auto\" #content>\n <div class=\"ax-p-4 ax-sticky ax-top-0 ax-z-10 ax-transition-all \" #sticky=\"axpSticky\"\n [axpSticky]=\"'ax-bg-surface-lowest ax-shadow-xl'\" [stickyParent]=\"content\" [stickyOffset]=\"10\">\n <ax-search-box look=\"fill\" placeholder=\"e.g. Button, Text, ...\" [(ngModel)]=\"searchTerm\" [delayTime]=\"300\"\n [axAutoFocus]=\"true\">\n <ax-clear-button></ax-clear-button>\n </ax-search-box>\n </div>\n <div class=\"ax-flex ax-flex-col ax-p-4 ax-pt-0\">\n <ng-template #itemTpl let-w>\n <div (click)=\"handleClick($event,w)\"\n class=\"ax-py-2 ax-px-3 ax-rounded-md ax-flex ax-gap-3 ax-items-center ax-group hover:ax-bg-primary-100 dark:hover:ax-bg-primary-800 ax-cursor-pointer\"\n [class.ax-bg-primary-100]=\"isWidgetSelected(w)\">\n <div class=\"ax-w-10 ax-h-10 ax-flex ax-items-center ax-justify-center ax-rounded-md ax-border ax-border-neutral-200 ax-text-neutral-500 ax-bg-on-surface group-hover:ax-bg-primary-200\"\n [class.ax-bg-primary-200]=\"isWidgetSelected(w)\">\n <i [ngClass]=\"w.icon\" class=\"ax-text-lg group-hover:ax-text-primary-700 ax-text-on-surface-fore\"\n [class.ax-text-primary-700]=\"isWidgetSelected(w)\"></i>\n </div>\n <div class=\"ax-flex ax-flex-col ax-gap-1 ax-flex-1\">\n <div class=\"ax-flex ax-items-center ax-gap-2\">\n <div class=\"ax-font-semibold ax-text-sm\">{{w.title}}</div>\n <div (click)=\"handlePinClick($event,w)\">\n @if (w.pinned) {\n <i class=\"fa-solid fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45\"></i>\n }\n @else {\n <i\n class=\"fa-light fa-thumbtack ax-text-sm ax-text-neutral-500 ax-rotate-45 ax-invisible group-hover:ax-visible\"></i>\n }\n </div>\n </div>\n <span class=\"ax-text-xs ax-text-neutral-400 ax-truncate\">\n {{w.description}}\n </span>\n </div>\n </div>\n </ng-template>\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of pinnedList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n @if(pinnedList().length)\n {\n <hr class=\"ax-my-4 ax-border-dashed\">\n }\n <div class=\"ax-grid ax-grid-cols-2 ax-gap-2 \">\n @for(w of regularList();track $index)\n {\n <ng-container *ngTemplateOutlet=\"itemTpl;context:{ $implicit: w}\"></ng-container>\n }\n </div>\n </div>\n </div>\n</div>\n@if(selectedWidgets().length)\n{\n<ax-footer>\n <ax-suffix>\n <ax-button look=\"solid\" color=\"primary\" text=\"{{ selectedWidgets().length }} Selected\"\n (onClick)=\"handleConfirmSelection()\"></ax-button>\n </ax-suffix>\n</ax-footer>\n}"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCM,MAAO,gCAAiC,SAAQ,mBAAmB,CAAA;AAfzE,IAAA,WAAA,GAAA;;AAgBU,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;QAEjC,IAAgB,CAAA,gBAAA,GAAG,+BAA+B;AAEzD,QAAA,IAAA,CAAA,UAAU,GAAG,KAAK,CAAC,EAAE,CAAC;;QAGxB,IAAO,CAAA,OAAA,GAA+B,EAAE;AACxC,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAA6B,EAAE,CAAC;;AAGrD,QAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAA6B,EAAE,CAAC;;AAG1D,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;YAClC,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,WAAW,EAAE;YAC9C,MAAM,eAAe,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,IAAI;AAE/C,YAAA,OAAO,OAAO,CACZ,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,KAAI;AACjC,gBAAA,MAAM,UAAU,GAAG,eAAe,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe;AAChF,gBAAA,MAAM,aAAa,GACjB,CAAC,MAAM,IAAI,CAAC,CAAC,KAA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CAAC,IAAI,EAAA,QAAA,EAAA,21HAAA,EAAA,MAAA,EAAA,CAAA,4VAAA,CAAA,EAAA;;;;;"}
|
package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs
DELETED
@@ -1,310 +0,0 @@
|
|
1
|
-
import * as i3 from '@acorex/components/button';
|
2
|
-
import { AXButtonModule } from '@acorex/components/button';
|
3
|
-
import * as i5 from '@acorex/components/decorators';
|
4
|
-
import { AXDecoratorModule } from '@acorex/components/decorators';
|
5
|
-
import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
|
6
|
-
import * as i5$1 from '@acorex/components/loading';
|
7
|
-
import { AXLoadingModule } from '@acorex/components/loading';
|
8
|
-
import { AXMenuModule } from '@acorex/components/menu';
|
9
|
-
import * as i4 from '@acorex/core/translation';
|
10
|
-
import { AXTranslationModule } from '@acorex/core/translation';
|
11
|
-
import { AXPSimplePageLayout } from '@acorex/platform/themes/default';
|
12
|
-
import { AXPLayoutThemeService, AXPThemeLayoutBlockComponent, AXPThemeLayoutHeaderTemplateComponent, AXPThemeLayoutActionsComponent, AXPThemeLayoutPageSecondaryActionsComponent, AXPThemeLayoutPagePrimaryActionsComponent } from '@acorex/platform/themes/shared';
|
13
|
-
import * as i1 from '@angular/common';
|
14
|
-
import { CommonModule } from '@angular/common';
|
15
|
-
import * as i0 from '@angular/core';
|
16
|
-
import { inject, signal, Injectable, Component, ChangeDetectionStrategy } from '@angular/core';
|
17
|
-
import { RouterModule } from '@angular/router';
|
18
|
-
import { AXMOrganizationManagementCompanyEntityService, AXMOrganizationManagementDepartmentEntityService, AXMOrganizationManagementEmployeeEntityService, AXMOrganizationManagementPositionEntityService, AXMOrganizationManagementChartEntityService, RootConfig } from './acorex-modules-organization-managment.mjs';
|
19
|
-
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
20
|
-
import { FormsModule } from '@angular/forms';
|
21
|
-
import * as i6 from '@acorex/components/breadcrumbs';
|
22
|
-
import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
|
23
|
-
import * as i7 from '@acorex/components/alert';
|
24
|
-
import { AXAlertModule } from '@acorex/components/alert';
|
25
|
-
import { AXPSettingService, AXPDataGenerator, AXPSettingScope } from '@acorex/platform/common';
|
26
|
-
import { AXPSessionService } from '@acorex/platform/auth';
|
27
|
-
import { A as AXPOrganizationSetting } from './acorex-modules-organization-managment-setting.keys-CF6Giykz.mjs';
|
28
|
-
|
29
|
-
class AXMOrgChartService {
|
30
|
-
constructor() {
|
31
|
-
this.companyService = inject(AXMOrganizationManagementCompanyEntityService);
|
32
|
-
this.departmentService = inject(AXMOrganizationManagementDepartmentEntityService);
|
33
|
-
this.employmentService = inject(AXMOrganizationManagementEmployeeEntityService);
|
34
|
-
this.positionService = inject(AXMOrganizationManagementPositionEntityService);
|
35
|
-
this.chartService = inject(AXMOrganizationManagementChartEntityService);
|
36
|
-
this.settingService = inject(AXPSettingService);
|
37
|
-
//
|
38
|
-
this.sessionService = inject(AXPSessionService);
|
39
|
-
this._types = ['Company', 'Location', 'BusinessUnit', 'Role', 'Employee'];
|
40
|
-
this._defaultPermissioEncoded = '0111001110001100001100001';
|
41
|
-
this.permissions = signal(this.defaultPermissions());
|
42
|
-
}
|
43
|
-
get types() {
|
44
|
-
return this._types;
|
45
|
-
}
|
46
|
-
//#region Load And Save
|
47
|
-
async load(id) {
|
48
|
-
if (id) {
|
49
|
-
const item = await this.chartService.getOne(id);
|
50
|
-
return item;
|
51
|
-
}
|
52
|
-
else {
|
53
|
-
return await this.createNew();
|
54
|
-
}
|
55
|
-
}
|
56
|
-
async createNew() {
|
57
|
-
const tenant = this.sessionService.tenant;
|
58
|
-
return {
|
59
|
-
//createAt: new Date(),
|
60
|
-
//updateAt: new Date(),
|
61
|
-
version: '0.0.0',
|
62
|
-
nodes: [{
|
63
|
-
id: AXPDataGenerator.uuid(),
|
64
|
-
title: tenant.name,
|
65
|
-
entity: {
|
66
|
-
id: tenant.id,
|
67
|
-
source: 'tenant',
|
68
|
-
},
|
69
|
-
}],
|
70
|
-
};
|
71
|
-
}
|
72
|
-
async save(chart) {
|
73
|
-
if (chart.id) {
|
74
|
-
await this.chartService.updateOne(chart.id, { version: chart.version, nodes: chart.nodes, updateAt: new Date() });
|
75
|
-
}
|
76
|
-
else {
|
77
|
-
await this.chartService.insertOne(chart);
|
78
|
-
}
|
79
|
-
} //save Chart Data
|
80
|
-
async listItemType(type, event) {
|
81
|
-
switch (type.text.toLowerCase()) {
|
82
|
-
case 'company':
|
83
|
-
return await this.companyService.query({
|
84
|
-
skip: event.skip,
|
85
|
-
take: event.take,
|
86
|
-
filter: event.filter,
|
87
|
-
sort: event.sort,
|
88
|
-
});
|
89
|
-
case 'country':
|
90
|
-
break;
|
91
|
-
case 'city':
|
92
|
-
break;
|
93
|
-
case 'department':
|
94
|
-
return (await this.departmentService.query({
|
95
|
-
skip: event.skip,
|
96
|
-
take: event.take,
|
97
|
-
filter: event.filter,
|
98
|
-
sort: event.sort,
|
99
|
-
}));
|
100
|
-
case 'position':
|
101
|
-
return (await this.positionService.query({
|
102
|
-
skip: event.skip,
|
103
|
-
take: event.take,
|
104
|
-
filter: event.filter,
|
105
|
-
sort: event.sort,
|
106
|
-
}));
|
107
|
-
case 'employment':
|
108
|
-
return (await this.employmentService.query({
|
109
|
-
skip: event.skip,
|
110
|
-
take: event.take,
|
111
|
-
filter: event.filter,
|
112
|
-
sort: event.sort,
|
113
|
-
}));
|
114
|
-
}
|
115
|
-
}
|
116
|
-
//#endregion
|
117
|
-
//#region Configuration Methods
|
118
|
-
defaultPermissions() {
|
119
|
-
return this.decodePermissionsString(this._defaultPermissioEncoded);
|
120
|
-
}
|
121
|
-
encodePermissionsString(permissions) {
|
122
|
-
let str = '';
|
123
|
-
for (const parent of this.types) {
|
124
|
-
for (const child of this.types) {
|
125
|
-
str += (permissions[parent]?.[child] ?? 0).toString();
|
126
|
-
}
|
127
|
-
}
|
128
|
-
return str;
|
129
|
-
}
|
130
|
-
decodePermissionsString(encoded) {
|
131
|
-
const result = {};
|
132
|
-
const expectedLength = this.types.length * this.types.length;
|
133
|
-
if (encoded.length !== expectedLength) {
|
134
|
-
throw new Error(`Invalid permissions string length. Expected ${expectedLength} but got ${encoded.length}`);
|
135
|
-
}
|
136
|
-
let index = 0;
|
137
|
-
for (const parent of this.types) {
|
138
|
-
result[parent] = {};
|
139
|
-
for (const child of this.types) {
|
140
|
-
const char = encoded.charAt(index);
|
141
|
-
result[parent][child] = parseInt(char, 10);
|
142
|
-
index++;
|
143
|
-
}
|
144
|
-
}
|
145
|
-
return result;
|
146
|
-
}
|
147
|
-
decodePermissionsMatrix(matrix) {
|
148
|
-
const newPermissions = {};
|
149
|
-
this.types.forEach((parent, rowIndex) => {
|
150
|
-
newPermissions[parent] = {};
|
151
|
-
this.types.forEach((child, colIndex) => {
|
152
|
-
newPermissions[parent][child] = matrix[rowIndex][colIndex];
|
153
|
-
});
|
154
|
-
});
|
155
|
-
return newPermissions;
|
156
|
-
}
|
157
|
-
validateStoredPermissions(storedValue) {
|
158
|
-
try {
|
159
|
-
if (typeof storedValue === 'string') {
|
160
|
-
const expectedLength = this.types.length * this.types.length;
|
161
|
-
// Check that the string is the correct length and only contains 0s and 1s.
|
162
|
-
if (storedValue.length === expectedLength && /^[01]+$/.test(storedValue)) {
|
163
|
-
return this.decodePermissionsString(storedValue);
|
164
|
-
}
|
165
|
-
}
|
166
|
-
else if (Array.isArray(storedValue)) {
|
167
|
-
// Validate the 2D array dimensions and values.
|
168
|
-
if (storedValue.length === this.types.length &&
|
169
|
-
storedValue.every(row => Array.isArray(row) &&
|
170
|
-
row.length === this.types.length &&
|
171
|
-
row.every(val => val === 0 || val === 1))) {
|
172
|
-
return this.decodePermissionsMatrix(storedValue);
|
173
|
-
}
|
174
|
-
}
|
175
|
-
else if (typeof storedValue === 'object' && storedValue !== null) {
|
176
|
-
// Validate that the object has all the required keys and that their values are 0 or 1.
|
177
|
-
let valid = true;
|
178
|
-
for (const parent of this.types) {
|
179
|
-
if (!(parent in storedValue)) {
|
180
|
-
valid = false;
|
181
|
-
break;
|
182
|
-
}
|
183
|
-
const childPermissions = storedValue[parent];
|
184
|
-
for (const child of this.types) {
|
185
|
-
if (!(child in childPermissions) || (childPermissions[child] !== 0 && childPermissions[child] !== 1)) {
|
186
|
-
valid = false;
|
187
|
-
break;
|
188
|
-
}
|
189
|
-
}
|
190
|
-
if (!valid)
|
191
|
-
break;
|
192
|
-
}
|
193
|
-
if (valid) {
|
194
|
-
return storedValue;
|
195
|
-
}
|
196
|
-
}
|
197
|
-
}
|
198
|
-
catch (error) {
|
199
|
-
// In case of any errors during validation, fall back to default permissions.
|
200
|
-
}
|
201
|
-
// Return the default permissions if validation fails.
|
202
|
-
return this.defaultPermissions();
|
203
|
-
}
|
204
|
-
isAllowed(parent, child) {
|
205
|
-
return (this.permissions()[parent]?.[child] ?? 0) === 1;
|
206
|
-
}
|
207
|
-
setPermission(parent, child, value) {
|
208
|
-
this.permissions.update((p) => {
|
209
|
-
if (!p[parent]) {
|
210
|
-
p[parent] = {};
|
211
|
-
}
|
212
|
-
p[parent][child] = value ? 1 : 0;
|
213
|
-
return p;
|
214
|
-
});
|
215
|
-
}
|
216
|
-
getPermission(parent, child) {
|
217
|
-
return this.permissions()[parent]?.[child] === 1;
|
218
|
-
}
|
219
|
-
async loadSettings() {
|
220
|
-
const storedValue = await this.settingService
|
221
|
-
.scope(AXPSettingScope.Tenant)
|
222
|
-
.get(AXPOrganizationSetting.Relations);
|
223
|
-
// Use the validation method to ensure the stored value is correct.
|
224
|
-
if (storedValue) {
|
225
|
-
const validatedPermissions = this.validateStoredPermissions(storedValue);
|
226
|
-
this.permissions.set(validatedPermissions);
|
227
|
-
}
|
228
|
-
else {
|
229
|
-
this.permissions.set(this.defaultPermissions());
|
230
|
-
}
|
231
|
-
}
|
232
|
-
async updateSettings() {
|
233
|
-
const matrix = this.encodePermissionsString(this.permissions());
|
234
|
-
await this.settingService
|
235
|
-
.scope(AXPSettingScope.Tenant)
|
236
|
-
.set(AXPOrganizationSetting.Relations, matrix);
|
237
|
-
}
|
238
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
239
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService }); }
|
240
|
-
}
|
241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartService, decorators: [{
|
242
|
-
type: Injectable
|
243
|
-
}] });
|
244
|
-
|
245
|
-
class AXMOrgChartConfigurationPage {
|
246
|
-
constructor() {
|
247
|
-
this.layout = inject(AXPLayoutThemeService);
|
248
|
-
this.chartService = inject(AXMOrgChartService);
|
249
|
-
this.loadingStates = signal({});
|
250
|
-
this.rootConfig = RootConfig;
|
251
|
-
}
|
252
|
-
async ngOnInit() {
|
253
|
-
await this.chartService.loadSettings();
|
254
|
-
}
|
255
|
-
async togglePermission(parent, child) {
|
256
|
-
//TODO: Check the async and loading
|
257
|
-
// Set the loading state for this cell to true.
|
258
|
-
this.loadingStates.update((states) => {
|
259
|
-
if (!states[parent]) {
|
260
|
-
states[parent] = {};
|
261
|
-
}
|
262
|
-
states[parent][child] = true;
|
263
|
-
return states;
|
264
|
-
});
|
265
|
-
this.chartService.setPermission(parent, child, !this.chartService.getPermission(parent, child));
|
266
|
-
await this.chartService.updateSettings();
|
267
|
-
// Turn off the loading state.
|
268
|
-
this.loadingStates.update((states) => {
|
269
|
-
if (!states[parent]) {
|
270
|
-
states[parent] = {};
|
271
|
-
}
|
272
|
-
states[parent][child] = false;
|
273
|
-
return states;
|
274
|
-
});
|
275
|
-
}
|
276
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartConfigurationPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
277
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMOrgChartConfigurationPage, isStandalone: true, selector: "ng-component", providers: [AXMOrgChartService], ngImport: i0, template: "<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.structure.title) | async}} </axp-layout-title>\n\n <axp-layout-description>Customize your organization's hierarchical relationships</axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('reset') | async)!\">\n <ax-prefix>\n <ax-icon [icon]=\"'fa-solid fa-print'\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </axp-layout-actions-secondary>\n </axp-layout-actions>\n\n\n <axp-layout-breadcrumbs>\n <ax-breadcrumbs [class.ax-hidden]=\"layout.isSmall()\">\n <ng-template #divider>\n <i class=\"fa-regular fa-slash-forward\"></i>\n </ng-template>\n <ax-breadcrumbs-item>\n Home\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n Organization\n </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content>\n <div class=\"ax-flex ax-flex-col ax-gap-6 ax-w-full 2xl:ax-w-3/4 3xl:ax-w-1/2\">\n <div>\n <h3 class=\"ax-font-semibold ax-text-xl\">Relations Permissions</h3>\n <p class=\"ax-text-sm ax-opacity-85\">\n This matrix sets the relationships between nodes in your organization chart. Click a cell to toggle the\n relation between <span class=\"ax-text-danger-500\">Allowed</span> and <span\n class=\"ax-text-success-500\">Denied</span>.\n </p>\n </div>\n <div class=\"ax-rounded-md ax-overflow-hidden ax-w-full\">\n <table class=\" ax-table-auto ax-border-collapse ax-w-full ax-border-primary-900 ax-rounded-md\">\n <thead>\n <tr class=\"ax-bg-primary-400 ax-text-on-primary\">\n <!-- Top-left empty cell -->\n <th class=\"ax-border ax-border-primary-900 ax-p-4 ax-min-w-44 ax-font-semibold ax-text-start\">Parent\n \\\n Child</th>\n <!-- Horizontal headers -->\n @for ( type of chartService.types; track $index) {\n <th class=\"ax-border ax-border-primary-900 ax-p-4 ax-min-w-44 ax-text-center ax-font-semibold\">\n {{ type }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <!-- For each parent type, render a row with alternating backgrounds -->\n @for ( parent of chartService.types; track $index) {\n <tr>\n <!-- Vertical header cell with custom header colors -->\n <td\n class=\"ax-border ax-border-primary-900 ax-p-4 ax-font-semibold ax-bg-primary-400 ax-text-on-primary ax-text-start\">\n {{ parent }}\n </td>\n <!-- Render a cell for each potential child type -->\n @for ( child of chartService.types; track $index) {\n <td class=\"ax-border ax-border-primary-900 ax-p-2 \">\n <div class=\"ax-flex ax-justify-center ax-cursor-pointer ax-sm\">\n @let isLoading = loadingStates()[parent]?.[child];\n <ax-button look=\"twotone\" [color]=\"chartService.isAllowed(parent, child) ? 'success' : 'danger'\"\n [text]=\"chartService.isAllowed(parent, child) ? 'Allowed' : 'Denied'\" [disabled]=\"isLoading\"\n (onClick)=\"togglePermission(parent, child)\">\n @if(isLoading)\n {\n <ax-loading></ax-loading>\n }\n </ax-button>\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div>\n <ax-alert [color]=\"'warning'\">\n <ax-icon></ax-icon>\n <ax-title>Attention</ax-title>\n <ax-content>\n Changes made here will not update your current organization chart. They will only affect future charts or\n updates.\n </ax-content>\n </ax-alert>\n </div>\n </div>\n\n </axp-layout-content>\n</axp-layout-simple-page>", styles: [""], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type:
|
278
|
-
//
|
279
|
-
AXPSimplePageLayout, selector: "axp-layout-simple-page" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-layout-content, axp-layout-header-container, axp-layout-footer-container, axp-layout-side-container, axp-layout-sections, axp-layout-section-container, axp-layout-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title, axp-layout-nav-button, axp-layout-description, axp-layout-toolbar, axp-layout-title-bar, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "component", type: AXPThemeLayoutHeaderTemplateComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutActionsComponent, selector: "axp-layout-actions" }, { kind: "component", type: AXPThemeLayoutPageSecondaryActionsComponent, selector: "axp-layout-actions-secondary" }, { kind: "component", type: AXPThemeLayoutPagePrimaryActionsComponent, selector: "axp-layout-actions-primary" }, { kind: "ngmodule", type:
|
280
|
-
//
|
281
|
-
AXMenuModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i4.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i5.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i5.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i5$1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "component", type: i6.AXBreadCrumbsComponent, selector: "ax-breadcrumbs" }, { kind: "component", type: i6.AXBreadCrumbsItemComponent, selector: "ax-breadcrumbs-item", inputs: ["disabled", "active"] }, { kind: "ngmodule", type: AXAlertModule }, { kind: "component", type: i7.AXAlertComponent, selector: "ax-alert", inputs: ["color", "timeOut"], outputs: ["colorChange", "onClosed", "timeOutChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
282
|
-
}
|
283
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMOrgChartConfigurationPage, decorators: [{
|
284
|
-
type: Component,
|
285
|
-
args: [{ imports: [
|
286
|
-
CommonModule,
|
287
|
-
RouterModule,
|
288
|
-
FormsModule,
|
289
|
-
//
|
290
|
-
AXPSimplePageLayout,
|
291
|
-
AXPThemeLayoutBlockComponent,
|
292
|
-
AXPThemeLayoutHeaderTemplateComponent,
|
293
|
-
AXPThemeLayoutActionsComponent,
|
294
|
-
AXPThemeLayoutPageSecondaryActionsComponent,
|
295
|
-
AXPThemeLayoutPagePrimaryActionsComponent,
|
296
|
-
//
|
297
|
-
AXMenuModule,
|
298
|
-
AXButtonModule,
|
299
|
-
AXDropdownButtonModule,
|
300
|
-
AXTranslationModule,
|
301
|
-
AXDecoratorModule,
|
302
|
-
AXLoadingModule,
|
303
|
-
AXCheckBoxModule,
|
304
|
-
AXBreadcrumbsModule,
|
305
|
-
AXAlertModule
|
306
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [AXMOrgChartService], template: "<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.structure.title) | async}} </axp-layout-title>\n\n <axp-layout-description>Customize your organization's hierarchical relationships</axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('reset') | async)!\">\n <ax-prefix>\n <ax-icon [icon]=\"'fa-solid fa-print'\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </axp-layout-actions-secondary>\n </axp-layout-actions>\n\n\n <axp-layout-breadcrumbs>\n <ax-breadcrumbs [class.ax-hidden]=\"layout.isSmall()\">\n <ng-template #divider>\n <i class=\"fa-regular fa-slash-forward\"></i>\n </ng-template>\n <ax-breadcrumbs-item>\n Home\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n Organization\n </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content>\n <div class=\"ax-flex ax-flex-col ax-gap-6 ax-w-full 2xl:ax-w-3/4 3xl:ax-w-1/2\">\n <div>\n <h3 class=\"ax-font-semibold ax-text-xl\">Relations Permissions</h3>\n <p class=\"ax-text-sm ax-opacity-85\">\n This matrix sets the relationships between nodes in your organization chart. Click a cell to toggle the\n relation between <span class=\"ax-text-danger-500\">Allowed</span> and <span\n class=\"ax-text-success-500\">Denied</span>.\n </p>\n </div>\n <div class=\"ax-rounded-md ax-overflow-hidden ax-w-full\">\n <table class=\" ax-table-auto ax-border-collapse ax-w-full ax-border-primary-900 ax-rounded-md\">\n <thead>\n <tr class=\"ax-bg-primary-400 ax-text-on-primary\">\n <!-- Top-left empty cell -->\n <th class=\"ax-border ax-border-primary-900 ax-p-4 ax-min-w-44 ax-font-semibold ax-text-start\">Parent\n \\\n Child</th>\n <!-- Horizontal headers -->\n @for ( type of chartService.types; track $index) {\n <th class=\"ax-border ax-border-primary-900 ax-p-4 ax-min-w-44 ax-text-center ax-font-semibold\">\n {{ type }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <!-- For each parent type, render a row with alternating backgrounds -->\n @for ( parent of chartService.types; track $index) {\n <tr>\n <!-- Vertical header cell with custom header colors -->\n <td\n class=\"ax-border ax-border-primary-900 ax-p-4 ax-font-semibold ax-bg-primary-400 ax-text-on-primary ax-text-start\">\n {{ parent }}\n </td>\n <!-- Render a cell for each potential child type -->\n @for ( child of chartService.types; track $index) {\n <td class=\"ax-border ax-border-primary-900 ax-p-2 \">\n <div class=\"ax-flex ax-justify-center ax-cursor-pointer ax-sm\">\n @let isLoading = loadingStates()[parent]?.[child];\n <ax-button look=\"twotone\" [color]=\"chartService.isAllowed(parent, child) ? 'success' : 'danger'\"\n [text]=\"chartService.isAllowed(parent, child) ? 'Allowed' : 'Denied'\" [disabled]=\"isLoading\"\n (onClick)=\"togglePermission(parent, child)\">\n @if(isLoading)\n {\n <ax-loading></ax-loading>\n }\n </ax-button>\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div>\n <ax-alert [color]=\"'warning'\">\n <ax-icon></ax-icon>\n <ax-title>Attention</ax-title>\n <ax-content>\n Changes made here will not update your current organization chart. They will only affect future charts or\n updates.\n </ax-content>\n </ax-alert>\n </div>\n </div>\n\n </axp-layout-content>\n</axp-layout-simple-page>" }]
|
307
|
-
}] });
|
308
|
-
|
309
|
-
export { AXMOrgChartConfigurationPage };
|
310
|
-
//# sourceMappingURL=acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs.map
|
package/fesm2022/acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"acorex-modules-organization-managment-org-chart-configuration.page-Dc6c7GmB.mjs","sources":["../../../../libs/modules/organization-managment/src/lib/features/organization-chart/org-chart.service.ts","../../../../libs/modules/organization-managment/src/lib/features/organization-chart/org-chart-configuration.page.ts","../../../../libs/modules/organization-managment/src/lib/features/organization-chart/org-chart-configuration.page.html"],"sourcesContent":["import { inject, Injectable, signal } from '@angular/core';\nimport { AXMOrganizationManagementChartEntityService } from '../../entities/chart/chart.service';\nimport { AXMOrganizationManagementChartEntityModel } from '../../entities/chart/chart.types';\nimport { AXMOrganizationManagementCompanyEntityService } from '../../entities/company/company.service';\nimport { AXMOrganizationManagementDepartmentEntityService } from '../../entities/department/department.service';\nimport { AXMOrganizationManagementEmployeeEntityService } from '../../entities/employee/employee.service';\nimport { AXMOrganizationManagementPositionEntityService } from '../../entities/position/position.service';\nimport { AXPDataGenerator, AXPSettingScope, AXPSettingService } from '@acorex/platform/common';\nimport { AXPSessionService } from '@acorex/platform/auth';\nimport { AXPOrganizationSetting } from '../../setting.keys';\n\n\n@Injectable()\nexport class AXMOrgChartService {\n\n private companyService = inject(AXMOrganizationManagementCompanyEntityService);\n private departmentService = inject(AXMOrganizationManagementDepartmentEntityService);\n private employmentService = inject(AXMOrganizationManagementEmployeeEntityService);\n private positionService = inject(AXMOrganizationManagementPositionEntityService);\n private chartService = inject(AXMOrganizationManagementChartEntityService);\n\n private readonly settingService = inject(AXPSettingService);\n //\n private sessionService = inject(AXPSessionService);\n\n\n protected _types = ['Company', 'Location', 'BusinessUnit', 'Role', 'Employee'];\n\n public get types(): string[] {\n return this._types;\n }\n\n private _defaultPermissioEncoded = '0111001110001100001100001';\n\n protected permissions = signal<{ [parent: string]: { [child: string]: number } }>(this.defaultPermissions());\n\n\n\n\n\n //#region Load And Save\n\n public async load(id?: string): Promise<AXMOrganizationManagementChartEntityModel> {\n if (id) {\n const item = await this.chartService.getOne(id);\n return item;\n } else {\n return await this.createNew();\n }\n }\n\n private async createNew(): Promise<AXMOrganizationManagementChartEntityModel> {\n const tenant = this.sessionService.tenant!;\n return {\n //createAt: new Date(),\n //updateAt: new Date(),\n version: '0.0.0',\n nodes: [{\n id: AXPDataGenerator.uuid(),\n title: tenant.name,\n entity: {\n id: tenant.id,\n source: 'tenant',\n },\n }],\n };\n }\n\n public async save(chart: AXMOrganizationManagementChartEntityModel): Promise<void> {\n if (chart.id) {\n await this.chartService.updateOne(chart.id, { version: chart.version, nodes: chart.nodes, updateAt: new Date() });\n } else {\n await this.chartService.insertOne(chart);\n }\n } //save Chart Data\n\n public async listItemType(type: any, event: any): Promise<any> {\n switch (type.text.toLowerCase()) {\n case 'company':\n return await this.companyService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n });\n case 'country':\n break;\n case 'city':\n break;\n case 'department':\n return (await this.departmentService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n })) as any;\n case 'position':\n return (await this.positionService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n })) as any;\n case 'employment':\n return (await this.employmentService.query({\n skip: event.skip,\n take: event.take,\n filter: event.filter,\n sort: event.sort,\n })) as any;\n }\n }\n\n //#endregion\n\n\n\n //#region Configuration Methods\n\n\n private defaultPermissions() {\n return this.decodePermissionsString(this._defaultPermissioEncoded);\n }\n\n\n private encodePermissionsString(\n permissions: { [parent: string]: { [child: string]: number } }\n ): string {\n let str = '';\n for (const parent of this.types) {\n for (const child of this.types) {\n str += (permissions[parent]?.[child] ?? 0).toString();\n }\n }\n return str;\n }\n\n\n private decodePermissionsString(encoded: string): { [parent: string]: { [child: string]: number } } {\n const result: { [parent: string]: { [child: string]: number } } = {};\n const expectedLength = this.types.length * this.types.length;\n if (encoded.length !== expectedLength) {\n throw new Error(`Invalid permissions string length. Expected ${expectedLength} but got ${encoded.length}`);\n }\n let index = 0;\n for (const parent of this.types) {\n result[parent] = {};\n for (const child of this.types) {\n const char = encoded.charAt(index);\n result[parent][child] = parseInt(char, 10);\n index++;\n }\n }\n return result;\n }\n\n\n private decodePermissionsMatrix(matrix: number[][]): { [parent: string]: { [child: string]: number } } {\n const newPermissions: { [parent: string]: { [child: string]: number } } = {};\n this.types.forEach((parent, rowIndex) => {\n newPermissions[parent] = {};\n this.types.forEach((child, colIndex) => {\n newPermissions[parent][child] = matrix[rowIndex][colIndex];\n });\n });\n return newPermissions;\n }\n\n private validateStoredPermissions(storedValue: unknown): { [parent: string]: { [child: string]: number } } {\n try {\n if (typeof storedValue === 'string') {\n const expectedLength = this.types.length * this.types.length;\n // Check that the string is the correct length and only contains 0s and 1s.\n if (storedValue.length === expectedLength && /^[01]+$/.test(storedValue)) {\n return this.decodePermissionsString(storedValue);\n }\n } else if (Array.isArray(storedValue)) {\n // Validate the 2D array dimensions and values.\n if (\n storedValue.length === this.types.length &&\n storedValue.every(\n row =>\n Array.isArray(row) &&\n row.length === this.types.length &&\n row.every(val => val === 0 || val === 1)\n )\n ) {\n return this.decodePermissionsMatrix(storedValue);\n }\n } else if (typeof storedValue === 'object' && storedValue !== null) {\n // Validate that the object has all the required keys and that their values are 0 or 1.\n let valid = true;\n for (const parent of this.types) {\n if (!(parent in storedValue)) {\n valid = false;\n break;\n }\n const childPermissions = (storedValue as any)[parent];\n for (const child of this.types) {\n if (!(child in childPermissions) || (childPermissions[child] !== 0 && childPermissions[child] !== 1)) {\n valid = false;\n break;\n }\n }\n if (!valid) break;\n }\n if (valid) {\n return storedValue as { [parent: string]: { [child: string]: number } };\n }\n }\n } catch (error) {\n // In case of any errors during validation, fall back to default permissions.\n }\n // Return the default permissions if validation fails.\n return this.defaultPermissions();\n }\n\n\n public isAllowed(parent: string, child: string): boolean {\n return (this.permissions()[parent]?.[child] ?? 0) === 1;\n }\n\n\n public setPermission(parent: string, child: string, value: boolean) {\n this.permissions.update((p) => {\n if (!p[parent]) {\n p[parent] = {};\n }\n p[parent][child] = value ? 1 : 0;\n return p;\n });\n }\n\n public getPermission(parent: string, child: string): boolean {\n return this.permissions()[parent]?.[child] === 1;\n }\n\n\n public async loadSettings() {\n const storedValue = await this.settingService\n .scope(AXPSettingScope.Tenant)\n .get(AXPOrganizationSetting.Relations);\n\n // Use the validation method to ensure the stored value is correct.\n if (storedValue) {\n const validatedPermissions = this.validateStoredPermissions(storedValue);\n this.permissions.set(validatedPermissions);\n } else {\n this.permissions.set(this.defaultPermissions());\n }\n }\n\n public async updateSettings() {\n const matrix = this.encodePermissionsString(this.permissions());\n await this.settingService\n .scope(AXPSettingScope.Tenant)\n .set(AXPOrganizationSetting.Relations, matrix);\n }\n\n //#endregion\n}\n","import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXDropdownButtonModule } from '@acorex/components/dropdown-button';\nimport { AXLoadingModule } from '@acorex/components/loading';\nimport { AXMenuModule } from '@acorex/components/menu';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPSimplePageLayout } from '@acorex/platform/themes/default';\nimport {\n AXPLayoutThemeService,\n AXPThemeLayoutActionsComponent,\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutHeaderTemplateComponent,\n AXPThemeLayoutPagePrimaryActionsComponent,\n AXPThemeLayoutPageSecondaryActionsComponent,\n} from '@acorex/platform/themes/shared';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n signal,\n} from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { RootConfig } from '../../const';\nimport { AXCheckBoxModule } from '@acorex/components/check-box';\nimport { FormsModule } from '@angular/forms';\nimport { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';\nimport { AXAlertModule } from '@acorex/components/alert';\nimport { AXMOrgChartService } from './org-chart.service';\n\n@Component({\n templateUrl: './org-chart-configuration.page.html',\n styleUrls: ['./org-chart-configuration.page.scss'],\n imports: [\n CommonModule,\n RouterModule,\n FormsModule,\n //\n AXPSimplePageLayout,\n AXPThemeLayoutBlockComponent,\n AXPThemeLayoutHeaderTemplateComponent,\n AXPThemeLayoutActionsComponent,\n AXPThemeLayoutPageSecondaryActionsComponent,\n AXPThemeLayoutPagePrimaryActionsComponent,\n //\n AXMenuModule,\n AXButtonModule,\n AXDropdownButtonModule,\n AXTranslationModule,\n AXDecoratorModule,\n AXLoadingModule,\n AXCheckBoxModule,\n AXBreadcrumbsModule,\n AXAlertModule\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [AXMOrgChartService],\n})\nexport class AXMOrgChartConfigurationPage {\n\n protected readonly layout = inject(AXPLayoutThemeService);\n protected readonly chartService = inject(AXMOrgChartService);\n\n protected loadingStates = signal<{ [parent: string]: { [child: string]: boolean } | undefined }>({});\n\n protected readonly rootConfig = RootConfig;\n\n\n async ngOnInit() {\n await this.chartService.loadSettings();\n }\n\n\n protected async togglePermission(parent: string, child: string) {\n //TODO: Check the async and loading\n\n // Set the loading state for this cell to true.\n this.loadingStates.update((states) => {\n if (!states[parent]) {\n states[parent] = {};\n }\n states[parent][child] = true;\n return states;\n });\n\n\n\n this.chartService.setPermission(parent, child, !this.chartService.getPermission(parent, child));\n\n await this.chartService.updateSettings();\n\n // Turn off the loading state.\n this.loadingStates.update((states) => {\n if (!states[parent]) {\n states[parent] = {};\n }\n states[parent][child] = false;\n return states;\n });\n }\n\n\n}\n","<axp-layout-simple-page *translate=\"let t\">\n <axp-layout-header>\n <axp-layout-title> {{t(rootConfig.entities.structure.title) | async}} </axp-layout-title>\n\n <axp-layout-description>Customize your organization's hierarchical relationships</axp-layout-description>\n\n <axp-layout-actions>\n <axp-layout-actions-primary> </axp-layout-actions-primary>\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('reset') | async)!\">\n <ax-prefix>\n <ax-icon [icon]=\"'fa-solid fa-print'\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n </axp-layout-actions-secondary>\n </axp-layout-actions>\n\n\n <axp-layout-breadcrumbs>\n <ax-breadcrumbs [class.ax-hidden]=\"layout.isSmall()\">\n <ng-template #divider>\n <i class=\"fa-regular fa-slash-forward\"></i>\n </ng-template>\n <ax-breadcrumbs-item>\n Home\n </ax-breadcrumbs-item>\n <ax-breadcrumbs-item>\n Organization\n </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n </axp-layout-header>\n\n <axp-layout-content>\n <div class=\"ax-flex ax-flex-col ax-gap-6 ax-w-full 2xl:ax-w-3/4 3xl:ax-w-1/2\">\n <div>\n <h3 class=\"ax-font-semibold ax-text-xl\">Relations Permissions</h3>\n <p class=\"ax-text-sm ax-opacity-85\">\n This matrix sets the relationships between nodes in your organization chart. Click a cell to toggle the\n relation between <span class=\"ax-text-danger-500\">Allowed</span> and <span\n class=\"ax-text-success-500\">Denied</span>.\n </p>\n </div>\n <div class=\"ax-rounded-md ax-overflow-hidden ax-w-full\">\n <table class=\" ax-table-auto ax-border-collapse ax-w-full ax-border-primary-900 ax-rounded-md\">\n <thead>\n <tr class=\"ax-bg-primary-400 ax-text-on-primary\">\n <!-- Top-left empty cell -->\n <th class=\"ax-border ax-border-primary-900 ax-p-4 ax-min-w-44 ax-font-semibold ax-text-start\">Parent\n \\\n Child</th>\n <!-- Horizontal headers -->\n @for ( type of chartService.types; track $index) {\n <th class=\"ax-border ax-border-primary-900 ax-p-4 ax-min-w-44 ax-text-center ax-font-semibold\">\n {{ type }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n <!-- For each parent type, render a row with alternating backgrounds -->\n @for ( parent of chartService.types; track $index) {\n <tr>\n <!-- Vertical header cell with custom header colors -->\n <td\n class=\"ax-border ax-border-primary-900 ax-p-4 ax-font-semibold ax-bg-primary-400 ax-text-on-primary ax-text-start\">\n {{ parent }}\n </td>\n <!-- Render a cell for each potential child type -->\n @for ( child of chartService.types; track $index) {\n <td class=\"ax-border ax-border-primary-900 ax-p-2 \">\n <div class=\"ax-flex ax-justify-center ax-cursor-pointer ax-sm\">\n @let isLoading = loadingStates()[parent]?.[child];\n <ax-button look=\"twotone\" [color]=\"chartService.isAllowed(parent, child) ? 'success' : 'danger'\"\n [text]=\"chartService.isAllowed(parent, child) ? 'Allowed' : 'Denied'\" [disabled]=\"isLoading\"\n (onClick)=\"togglePermission(parent, child)\">\n @if(isLoading)\n {\n <ax-loading></ax-loading>\n }\n </ax-button>\n </div>\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n <div>\n <ax-alert [color]=\"'warning'\">\n <ax-icon></ax-icon>\n <ax-title>Attention</ax-title>\n <ax-content>\n Changes made here will not update your current organization chart. They will only affect future charts or\n updates.\n </ax-content>\n </ax-alert>\n </div>\n </div>\n\n </axp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