@acorex/platform 19.1.3 → 19.1.4
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/common/index.d.ts +1 -0
- package/common/lib/app/application.types.d.ts +2 -2
- package/common/lib/file-storage/file-storage.service.d.ts +13 -0
- package/common/lib/file-storage/file-storage.types.d.ts +143 -0
- package/common/lib/file-storage/index.d.ts +2 -0
- package/common/lib/filters/filters.types.d.ts +2 -1
- package/common/lib/settings/setting-definition.provider.d.ts +12 -5
- package/common/lib/settings/setting.builder.d.ts +4 -3
- package/common/lib/settings/settings.provider.d.ts +2 -7
- package/common/lib/settings/settings.service.d.ts +19 -7
- package/common/lib/settings/settings.types.d.ts +15 -2
- package/core/utils/highlighter.d.ts +1 -1
- package/fesm2022/acorex-platform-common.mjs +194 -74
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +2 -2
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +245 -444
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +13 -13
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +59 -54
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-filters.mjs +82 -5
- package/fesm2022/acorex-platform-layout-filters.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-setting.mjs +73 -91
- package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
- package/fesm2022/acorex-platform-layouts.mjs +3 -4
- package/fesm2022/acorex-platform-layouts.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-K9B_-q_K.mjs +108 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-K9B_-q_K.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DAmHq1bt.mjs +369 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DAmHq1bt.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Cd2gxLZt.mjs +87 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Cd2gxLZt.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-6sZdw013.mjs +130 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-6sZdw013.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-setting-page.component-BYpCgHZb.mjs +74 -0
- package/fesm2022/acorex-platform-themes-default-setting-page.component-BYpCgHZb.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-CdmIphX1.mjs +73 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-CdmIphX1.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +20 -20
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +288 -81
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-05nKV-UV.mjs → acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs} +18 -14
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-jeZBOEhl.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs → acorex-platform-widgets-checkbox-widget-designer.component-RCi5IJOR.mjs} +4 -4
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-B_Gec5Qf.mjs.map → acorex-platform-widgets-checkbox-widget-designer.component-RCi5IJOR.mjs.map} +1 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs +64 -0
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-DU1niJES.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-B2g0ct24.mjs → acorex-platform-widgets-color-box-widget-designer.component-CWhbgmDV.mjs} +4 -4
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CWhbgmDV.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +1309 -334
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +9 -3
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/lib/builder/builder.module.d.ts +6 -7
- package/layout/builder/lib/builder/builder.service.d.ts +9 -10
- package/layout/builder/lib/builder/context-store.service.d.ts +33 -0
- package/layout/builder/lib/builder/index.d.ts +4 -2
- package/layout/builder/lib/builder/widget-catalog.d.ts +1 -1
- package/layout/builder/lib/builder/widget-container.component.d.ts +34 -9
- package/layout/builder/lib/builder/widget-groups.d.ts +1 -0
- package/layout/builder/lib/builder/widget-map.d.ts +43 -0
- package/layout/builder/lib/builder/{widget-renderer.component.directive.d.ts → widget-renderer.directive.d.ts} +26 -0
- package/layout/builder/lib/builder/widget-status.types.d.ts +14 -0
- package/layout/builder/lib/builder/widget.types.d.ts +41 -55
- package/layout/designer/lib/preview/preview-viewer.component.d.ts +2 -2
- package/layout/designer/lib/property-viewer/widget-property-viewer.component.d.ts +2 -2
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +7 -2
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +0 -1
- package/layout/filters/lib/filters.viewmodel.d.ts +13 -3
- package/layout/setting/lib/convert-setting-data.d.ts +0 -20
- package/layout/setting/lib/setting.viewmodel.d.ts +65 -4
- package/layouts/lib/admin/entity-layout/entity-details-view/entity-details-view.component.d.ts +15 -5
- package/package.json +15 -15
- package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +15 -5
- package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +15 -5
- package/themes/default/lib/layouts/entity-layouts/entity-master-create-view/entity-master-create-view.component.d.ts +2 -1
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +17 -6
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/list-view-option-filters/list-view-option-filters.component.d.ts +6 -3
- package/themes/default/lib/layouts/entity-layouts/entity-master-modify-view/entity-master-modify-view.component.d.ts +2 -1
- package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +15 -5
- package/themes/default/lib/layouts/filters-layout/simple-filter-builder/filters-view.component.d.ts +6 -5
- package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +15 -5
- package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +15 -5
- package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +0 -47
- package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +19 -5
- package/themes/shared/index.d.ts +3 -1
- package/themes/shared/lib/components/theme-slot.component.d.ts +23 -13
- package/themes/shared/lib/palette.provider.d.ts +9 -0
- package/themes/shared/lib/setting.keys.d.ts +7 -2
- package/themes/shared/lib/setting.provider.d.ts +1 -0
- package/themes/shared/lib/shared.module.d.ts +2 -1
- package/themes/shared/lib/{services/theme.service.d.ts → theme.service.d.ts} +16 -24
- package/themes/shared/lib/theme.types.d.ts +25 -0
- package/themes/shared/lib/widgets/theme-color-selection/index.d.ts +2 -0
- package/themes/shared/lib/widgets/theme-color-selection/theme-color-selection-widget-edit.component.d.ts +6 -0
- package/themes/shared/lib/widgets/theme-color-selection/theme-color-selection-widget.config.d.ts +7 -0
- package/widgets/lib/properties/layout.props.d.ts +1 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-column.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-designer.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-edit.component.d.ts +18 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-print.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget-view.component.d.ts +6 -0
- package/widgets/lib/widgets/advance/avatar/avatar-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/advance/avatar/index.d.ts +6 -0
- package/widgets/lib/widgets/advance/map/map-box-widget-edit.component.d.ts +9 -5
- package/widgets/lib/widgets/advance/map/map-box-widget-view.component.d.ts +6 -4
- package/widgets/lib/widgets/editors/number/number-box-widget-edit.component.d.ts +1 -7
- package/widgets/lib/widgets/editors/toggle/toggle-widget-edit.component.d.ts +0 -2
- package/widgets/lib/widgets/filters/operations/operations.component.d.ts +9 -0
- package/widgets/lib/widgets/filters/string-filter/index.d.ts +2 -0
- package/widgets/lib/widgets/filters/string-filter/string-filter-widget-edit.component.d.ts +11 -0
- package/widgets/lib/widgets/filters/string-filter/string-filter-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/index.d.ts +5 -1
- package/widgets/lib/widgets/property-editors/border/border-widget-editor.component.d.ts +29 -7
- package/widgets/lib/widgets/property-editors/border/index.d.ts +0 -1
- package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget-editor.component.d.ts +31 -0
- package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/property-editors/flex-options/flex-options-widget.type.d.ts +15 -0
- package/widgets/lib/widgets/property-editors/flex-options/index.d.ts +3 -0
- package/widgets/lib/widgets/property-editors/property-editor-helper.d.ts +72 -0
- package/widgets/lib/widgets/property-editors/property-editor.type.d.ts +35 -0
- package/widgets/lib/widgets/property-editors/spacing/index.d.ts +0 -1
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-editor.component.d.ts +11 -9
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs +0 -108
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CSyR4pYp.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs +0 -368
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-xHWp2Lk-.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs +0 -87
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-n7mYNduJ.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs +0 -130
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DjyYU0Gy.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs +0 -78
- package/fesm2022/acorex-platform-themes-default-setting-page.component-6Dd8MGqr.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs +0 -58
- package/fesm2022/acorex-platform-themes-default-setting-view.component-BgiMClew.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-05nKV-UV.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-BkWcZ4K9.mjs +0 -72
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-BkWcZ4K9.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-B2g0ct24.mjs.map +0 -1
- package/layout/builder/lib/builder/widget-renderer.component.d.ts +0 -48
- package/widgets/lib/widgets/property-editors/border/border-widget-type.d.ts +0 -18
- package/widgets/lib/widgets/property-editors/spacing/spacing-widget-type.d.ts +0 -16
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { AXPFiltersProviderService } from '@acorex/platform/common';
|
|
2
2
|
import { moveItemInArray } from '@angular/cdk/drag-drop';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { inject, signal, computed, Injectable } from '@angular/core';
|
|
4
|
+
import { inject, signal, computed, effect, Injectable } from '@angular/core';
|
|
5
|
+
import { isEqual, cloneDeep } from 'lodash-es';
|
|
5
6
|
|
|
6
7
|
class AXPFiltersViewModel {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.filterProviderService = inject(AXPFiltersProviderService);
|
|
10
|
+
this.context = signal({}, { equal: isEqual });
|
|
9
11
|
this.availableFilters = signal([]);
|
|
10
12
|
this.activeFilters = signal([]);
|
|
11
13
|
this.newFilters = signal([]);
|
|
12
14
|
this.activeFiltersCount = computed(() => this.activeFilters().length);
|
|
15
|
+
this.#effect = effect(() => {
|
|
16
|
+
console.log(this.context());
|
|
17
|
+
this.filters.update((prev) => ({ ...prev, filters: this.convertContextToQueries(this.context()) }));
|
|
18
|
+
});
|
|
19
|
+
this.#effect1 = effect(() => {
|
|
20
|
+
this.initializeContext();
|
|
21
|
+
console.log(this.filters().filters);
|
|
22
|
+
this.activeFilters.update((prev) => {
|
|
23
|
+
return this.convertFiltersToDefinition(this.filters().filters || []);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
13
26
|
}
|
|
14
27
|
onChoosingFiltersChange(e) {
|
|
15
28
|
if (e.isUserInteraction) {
|
|
@@ -17,19 +30,83 @@ class AXPFiltersViewModel {
|
|
|
17
30
|
}
|
|
18
31
|
}
|
|
19
32
|
onChoosingFiltersConfirm() {
|
|
20
|
-
this.
|
|
33
|
+
this.filters.update((prev) => ({
|
|
34
|
+
...prev,
|
|
35
|
+
filters: [
|
|
36
|
+
...(prev.filters || []),
|
|
37
|
+
...this.newFilters().filter((newFilter) => !prev.filters?.some((existing) => existing.field === newFilter.field)),
|
|
38
|
+
],
|
|
39
|
+
}));
|
|
21
40
|
}
|
|
22
|
-
|
|
23
|
-
this.availableFilters.
|
|
41
|
+
convertFiltersToDefinition(filters) {
|
|
42
|
+
const availableFiltersMap = new Map(this.availableFilters().map((af) => [af.field, af]));
|
|
43
|
+
return filters
|
|
44
|
+
.map((df) => {
|
|
45
|
+
const af = availableFiltersMap.get(df.field);
|
|
46
|
+
if (!af)
|
|
47
|
+
return null;
|
|
48
|
+
return {
|
|
49
|
+
field: df.field,
|
|
50
|
+
operator: df.operator,
|
|
51
|
+
filters: df.filters,
|
|
52
|
+
logic: df.logic,
|
|
53
|
+
value: df.value,
|
|
54
|
+
title: af.title,
|
|
55
|
+
widget: af.widget,
|
|
56
|
+
isParametric: af.isParametric,
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
.filter((filter) => filter !== null);
|
|
60
|
+
}
|
|
61
|
+
setAvailableFilters(availableFilters) {
|
|
62
|
+
this.availableFilters.set(availableFilters);
|
|
63
|
+
}
|
|
64
|
+
setFiltersModel(filters) {
|
|
65
|
+
this.filters = filters;
|
|
24
66
|
}
|
|
25
67
|
drop(event) {
|
|
26
|
-
|
|
68
|
+
const cloned = cloneDeep(this.activeFilters());
|
|
69
|
+
moveItemInArray(cloned, event.previousIndex, event.currentIndex);
|
|
70
|
+
this.activeFilters.set(cloned);
|
|
71
|
+
}
|
|
72
|
+
convertContextToQueries(context) {
|
|
73
|
+
const contextKeys = Object.keys(context);
|
|
74
|
+
return contextKeys.map((c) => ({
|
|
75
|
+
field: c,
|
|
76
|
+
value: context[c].value,
|
|
77
|
+
operator: {
|
|
78
|
+
type: context[c].operation,
|
|
79
|
+
},
|
|
80
|
+
}));
|
|
27
81
|
}
|
|
28
82
|
resetFilterFields() {
|
|
29
83
|
this.newFilters.set(this.activeFilters());
|
|
30
84
|
}
|
|
31
85
|
removeCondition(selectedFilter) {
|
|
32
86
|
this.activeFilters.update((prev) => prev.filter((filter) => filter.field !== selectedFilter.field));
|
|
87
|
+
this.context.update((prev) => {
|
|
88
|
+
const newContext = { ...prev };
|
|
89
|
+
delete newContext[selectedFilter.field];
|
|
90
|
+
return newContext;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
#effect;
|
|
94
|
+
#effect1;
|
|
95
|
+
initializeContext() {
|
|
96
|
+
const context = {};
|
|
97
|
+
if (this.filters()?.filters?.length) {
|
|
98
|
+
this.filters().filters?.forEach((f) => {
|
|
99
|
+
context[f.field] = {
|
|
100
|
+
value: f.value,
|
|
101
|
+
operation: f.operator.type,
|
|
102
|
+
};
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
this.context.set(context);
|
|
106
|
+
}
|
|
107
|
+
initializeFilters() {
|
|
108
|
+
this.initializeContext();
|
|
109
|
+
this.activeFilters.update((prev) => this.convertFiltersToDefinition(this.filters().filters || []));
|
|
33
110
|
}
|
|
34
111
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFiltersViewModel, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
35
112
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPFiltersViewModel, providedIn: 'root' }); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-layout-filters.mjs","sources":["../../../../libs/platform/layout/filters/src/lib/filters.viewmodel.ts","../../../../libs/platform/layout/filters/src/acorex-platform-layout-filters.ts"],"sourcesContent":["import { AXValueChangedEvent } from '@acorex/components/common';\nimport { AXPFilterDefinition, AXPFiltersProviderService } from '@acorex/platform/common';\nimport { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { computed, inject, Injectable, signal, WritableSignal } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPFiltersViewModel {\n private readonly filterProviderService = inject(AXPFiltersProviderService);\n\n readonly availableFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n readonly activeFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n readonly newFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n\n readonly activeFiltersCount = computed(() => this.activeFilters().length);\n\n onChoosingFiltersChange(e: AXValueChangedEvent<any>) {\n if (e.isUserInteraction) {\n this.newFilters.set(e.component.selectedItems);\n }\n }\n\n onChoosingFiltersConfirm() {\n this.
|
|
1
|
+
{"version":3,"file":"acorex-platform-layout-filters.mjs","sources":["../../../../libs/platform/layout/filters/src/lib/filters.viewmodel.ts","../../../../libs/platform/layout/filters/src/acorex-platform-layout-filters.ts"],"sourcesContent":["import { AXValueChangedEvent } from '@acorex/components/common';\nimport { AXPFilterDefinition, AXPFilterQuery, AXPFiltersProviderService } from '@acorex/platform/common';\nimport { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { computed, effect, inject, Injectable, ModelSignal, signal, WritableSignal } from '@angular/core';\nimport { cloneDeep, isEqual } from 'lodash-es';\n\n@Injectable({ providedIn: 'root' })\nexport class AXPFiltersViewModel {\n private readonly filterProviderService = inject(AXPFiltersProviderService);\n\n context: WritableSignal<{ [key: string]: any }> = signal({}, { equal: isEqual });\n\n readonly availableFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n readonly activeFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n readonly newFilters: WritableSignal<AXPFilterDefinition[]> = signal([]);\n\n protected filters!: ModelSignal<AXPFilterQuery>;\n\n readonly activeFiltersCount = computed(() => this.activeFilters().length);\n\n onChoosingFiltersChange(e: AXValueChangedEvent<any>) {\n if (e.isUserInteraction) {\n this.newFilters.set(e.component.selectedItems);\n }\n }\n\n onChoosingFiltersConfirm() {\n this.filters.update((prev) => ({\n ...prev,\n filters: [\n ...(prev.filters || []),\n ...this.newFilters().filter(\n (newFilter) => !prev.filters?.some((existing) => existing.field === newFilter.field)\n ),\n ],\n }));\n }\n\n convertFiltersToDefinition(filters: AXPFilterQuery[]): AXPFilterDefinition[] {\n const availableFiltersMap = new Map(this.availableFilters().map((af) => [af.field, af]));\n return filters\n .map((df) => {\n const af = availableFiltersMap.get(df.field);\n if (!af) return null;\n return {\n field: df.field,\n operator: df.operator,\n filters: df.filters,\n logic: df.logic,\n value: df.value,\n title: af.title,\n widget: af.widget,\n isParametric: af.isParametric,\n };\n })\n .filter((filter) => filter !== null) as AXPFilterDefinition[];\n }\n\n setAvailableFilters(availableFilters: AXPFilterDefinition[]) {\n this.availableFilters.set(availableFilters);\n }\n\n setFiltersModel(filters: ModelSignal<AXPFilterQuery>) {\n this.filters = filters;\n }\n\n drop(event: CdkDragDrop<unknown[]>) {\n const cloned = cloneDeep(this.activeFilters());\n moveItemInArray(cloned, event.previousIndex, event.currentIndex);\n this.activeFilters.set(cloned);\n }\n\n convertContextToQueries(context: any): AXPFilterQuery[] {\n const contextKeys = Object.keys(context);\n return contextKeys.map((c) => ({\n field: c,\n value: context[c].value,\n operator: {\n type: context[c].operation,\n },\n }));\n }\n\n resetFilterFields() {\n this.newFilters.set(this.activeFilters());\n }\n\n removeCondition(selectedFilter: AXPFilterDefinition) {\n this.activeFilters.update((prev) => prev.filter((filter) => filter.field !== selectedFilter.field));\n this.context.update((prev) => {\n const newContext = { ...prev };\n delete newContext[selectedFilter.field];\n return newContext;\n });\n }\n\n #effect = effect(() => {\n console.log(this.context());\n this.filters.update((prev) => ({ ...prev, filters: this.convertContextToQueries(this.context()) }));\n });\n\n #effect1 = effect(() => {\n this.initializeContext();\n console.log(this.filters().filters);\n this.activeFilters.update((prev) => {\n return this.convertFiltersToDefinition(this.filters().filters || []);\n });\n });\n\n private initializeContext() {\n const context: any = {};\n\n if (this.filters()?.filters?.length) {\n this.filters().filters?.forEach((f) => {\n context[f.field] = {\n value: f.value,\n operation: f.operator.type,\n };\n });\n }\n this.context.set(context);\n }\n\n initializeFilters(): void {\n this.initializeContext();\n this.activeFilters.update((prev) => this.convertFiltersToDefinition(this.filters().filters || []));\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAOa,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,qBAAqB,GAAG,MAAM,CAAC,yBAAyB,CAAC;QAE1E,IAAO,CAAA,OAAA,GAA2C,MAAM,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAEvE,QAAA,IAAA,CAAA,gBAAgB,GAA0C,MAAM,CAAC,EAAE,CAAC;AACpE,QAAA,IAAA,CAAA,aAAa,G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ACnC,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAI;AACpC,gBAAA,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG;oBACjB,KAAK,EAAE,CAAC,CAAC,KAAK;AACd,oBAAA,SAAS,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI;iBAC3B;AACH,aAAC,CAAC;;AAEJ,QAAA,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;;IAG3B,iBAAiB,GAAA;QACf,IAAI,CAAC,iBAAiB,EAAE;QACxB,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;;8GAtHzF,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAnB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,cADN,MAAM,EAAA,CAAA,CAAA;;2FACnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAD/B,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;ACNlC;;AAEG;;;;"}
|
|
@@ -1,72 +1,15 @@
|
|
|
1
1
|
import { AXToastService } from '@acorex/components/toast';
|
|
2
|
-
import { AXPSettingDefinitionProviderService, AXPSettingValueProviderService } from '@acorex/platform/common';
|
|
2
|
+
import { AXPSettingScope, AXPSettingDefinitionProviderService, AXPSettingValueProviderService } from '@acorex/platform/common';
|
|
3
3
|
import { AXHighlightService } from '@acorex/platform/core';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, signal, computed, effect, Injectable } from '@angular/core';
|
|
6
6
|
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
|
|
7
7
|
import { filter, take } from 'rxjs';
|
|
8
8
|
import { isNil, isEmpty, get, isEqual } from 'lodash-es';
|
|
9
|
+
import { AXPPageStatus } from '@acorex/platform/layout/builder';
|
|
9
10
|
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
|
11
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
|
10
12
|
|
|
11
|
-
/**
|
|
12
|
-
* Converts a list of AXPSettingDefinitionGroup into a tree structure of AXTreeViewSchema.
|
|
13
|
-
* This function processes groups and their nested sub-groups, recursively creating a tree.
|
|
14
|
-
*
|
|
15
|
-
* @param groups - Array of top-level setting groups to be converted into tree view schema.
|
|
16
|
-
* @param parentId - The parent ID for nested groups, passed down recursively. (Optional, default is undefined)
|
|
17
|
-
*
|
|
18
|
-
* @returns An array of AXTreeViewSchema representing the hierarchical structure of groups.
|
|
19
|
-
*/
|
|
20
|
-
function convertToTreeViewSchema(groups, parentId) {
|
|
21
|
-
// Helper function to traverse and convert a single group (and its sub-groups)
|
|
22
|
-
const traverseGroups = (group, parent) => {
|
|
23
|
-
const currentId = group.name;
|
|
24
|
-
// Schema for the current group
|
|
25
|
-
const schema = {
|
|
26
|
-
id: currentId, // Unique identifier for the group (using group name)
|
|
27
|
-
parentId: parent, // Parent group ID, passed down recursively
|
|
28
|
-
text: group.title, // Display title of the group
|
|
29
|
-
//tooltip: group.description, // Optional description as tooltip
|
|
30
|
-
hasChild: group.groups.length > 0, // Whether the group has child groups
|
|
31
|
-
isExpanded: false, // Default state for expansion (optional)
|
|
32
|
-
icon: group.icon,
|
|
33
|
-
childrens: group.groups.length > 0 ? [] : undefined, // Child groups array (undefined if no children)
|
|
34
|
-
};
|
|
35
|
-
// Recursively process nested groups (sub-groups inside the current group)
|
|
36
|
-
group.groups.forEach((subGroup) => {
|
|
37
|
-
const childSchema = traverseGroups(subGroup, currentId); // Create schema for sub-group
|
|
38
|
-
schema.childrens?.push(childSchema); // Add the child schema to the parent group's children
|
|
39
|
-
});
|
|
40
|
-
return schema; // Return the group schema with its children (if any)
|
|
41
|
-
};
|
|
42
|
-
// Initialize an array to hold the top-level groups' schemas
|
|
43
|
-
const treeViewSchemas = [];
|
|
44
|
-
// Process each top-level group and convert it into tree view schema
|
|
45
|
-
groups.forEach((group) => {
|
|
46
|
-
treeViewSchemas.push(traverseGroups(group, parentId)); // Add the schema for each group
|
|
47
|
-
});
|
|
48
|
-
// Return the resulting hierarchical structure
|
|
49
|
-
return treeViewSchemas;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Recursively searches for a specific `id` in a tree structure and updates its `active` property to `true`.
|
|
53
|
-
* Additionally, ensures all other nodes have their `active` property set to `false`.
|
|
54
|
-
*
|
|
55
|
-
* @param tree - The tree structure to search, represented as an array of AXTreeViewSchema nodes.
|
|
56
|
-
* @param targetId - The `id` of the node to activate.
|
|
57
|
-
* @returns The updated tree structure with the target node activated and others deactivated.
|
|
58
|
-
*/
|
|
59
|
-
function setActiveByValueField(tree, targetId) {
|
|
60
|
-
return tree.map((node) => {
|
|
61
|
-
// Set active property for the target node
|
|
62
|
-
node.active = node.id === targetId;
|
|
63
|
-
// Recursively process children if they exist
|
|
64
|
-
if (node.childrens && node.childrens.length > 0) {
|
|
65
|
-
node.childrens = setActiveByValueField(node.childrens, targetId);
|
|
66
|
-
}
|
|
67
|
-
return node;
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
13
|
function searchSettings(groups, search) {
|
|
71
14
|
const sectionMatchResult = [];
|
|
72
15
|
const settingMatchResult = [];
|
|
@@ -114,15 +57,17 @@ function searchSettings(groups, search) {
|
|
|
114
57
|
}
|
|
115
58
|
|
|
116
59
|
class AXPSettingsViewModel {
|
|
117
|
-
|
|
60
|
+
resolveScopeKey(name) {
|
|
118
61
|
const scopeMap = {
|
|
119
|
-
environment:
|
|
120
|
-
global:
|
|
121
|
-
tenant:
|
|
122
|
-
user:
|
|
62
|
+
environment: AXPSettingScope.Environment,
|
|
63
|
+
global: AXPSettingScope.Global,
|
|
64
|
+
tenant: AXPSettingScope.Tenant,
|
|
65
|
+
user: AXPSettingScope.User,
|
|
123
66
|
};
|
|
124
|
-
|
|
125
|
-
|
|
67
|
+
return scopeMap[name.toLowerCase()] ?? AXPSettingScope.User;
|
|
68
|
+
}
|
|
69
|
+
resolveScope() {
|
|
70
|
+
return this.resolveScopeKey(this.scopeName());
|
|
126
71
|
}
|
|
127
72
|
#effect2;
|
|
128
73
|
/**
|
|
@@ -133,20 +78,28 @@ class AXPSettingsViewModel {
|
|
|
133
78
|
this.settingDefinitionService = inject(AXPSettingDefinitionProviderService);
|
|
134
79
|
this.settingValueService = inject(AXPSettingValueProviderService);
|
|
135
80
|
this.toastService = inject(AXToastService);
|
|
81
|
+
this.dialogService = inject(AXDialogService);
|
|
136
82
|
this.highlightService = inject(AXHighlightService);
|
|
137
|
-
this.
|
|
83
|
+
this.layout = inject(AXPLayoutThemeService);
|
|
138
84
|
this.activatedRoute = inject(ActivatedRoute);
|
|
139
85
|
this.searchExpression = signal('');
|
|
140
86
|
this.isValidQuery = (expression) => !isNil(expression) && !isEmpty(expression);
|
|
141
87
|
this.isSearching = computed(() => this.isValidQuery(this.searchExpression()));
|
|
142
88
|
this.searchResult = signal([]);
|
|
143
89
|
this.isSaving = signal(false);
|
|
144
|
-
this.
|
|
145
|
-
return this.layoutService.isSmall();
|
|
146
|
-
});
|
|
90
|
+
this.isBusy = signal(false);
|
|
147
91
|
this.activateGroup = signal(undefined);
|
|
148
92
|
this.activeScope = signal('U');
|
|
149
93
|
this.loadedItems = signal(null);
|
|
94
|
+
this.scopeName = () => {
|
|
95
|
+
return this.activatedRoute?.snapshot?.paramMap?.get('scope')?.trim().toLowerCase() ?? 'user';
|
|
96
|
+
};
|
|
97
|
+
this.title = computed(() => {
|
|
98
|
+
// fake change detect simulate
|
|
99
|
+
this.activeScope();
|
|
100
|
+
//
|
|
101
|
+
return `settings.${this.scopeName()}.title`;
|
|
102
|
+
});
|
|
150
103
|
this.groups = computed(() => {
|
|
151
104
|
if (this.activateGroup()) {
|
|
152
105
|
return this.settingDefinitionService.findGroup(this.activeScope(), this.activateGroup());
|
|
@@ -156,6 +109,8 @@ class AXPSettingsViewModel {
|
|
|
156
109
|
}
|
|
157
110
|
;
|
|
158
111
|
});
|
|
112
|
+
this.hasGroup = computed(() => this.activateGroup() != null);
|
|
113
|
+
this.showSide = computed(() => this.layout.isLarge() && this.hasGroup());
|
|
159
114
|
this.#effect2 = effect(() => {
|
|
160
115
|
if (this.searchExpression()) {
|
|
161
116
|
this.searchResult.set(searchSettings(this.loadedItems(), this.searchExpression()));
|
|
@@ -163,7 +118,7 @@ class AXPSettingsViewModel {
|
|
|
163
118
|
});
|
|
164
119
|
this.context = signal({});
|
|
165
120
|
this.previousContext = signal({});
|
|
166
|
-
this.settingValueService.onChanged.subscribe((e) => {
|
|
121
|
+
this.settingValueService.onChanged.pipe(filter(c => c.scope == this.resolveScope())).subscribe((e) => {
|
|
167
122
|
e.keys.forEach(k => {
|
|
168
123
|
const currentValue = e.values[k];
|
|
169
124
|
const contextValue = get(this.context(), k);
|
|
@@ -189,23 +144,23 @@ class AXPSettingsViewModel {
|
|
|
189
144
|
}
|
|
190
145
|
async load() {
|
|
191
146
|
//
|
|
192
|
-
this.activeScope.set(this.resolveScope(
|
|
147
|
+
this.activeScope.set(this.resolveScope());
|
|
193
148
|
//
|
|
194
149
|
const items = await this.settingDefinitionService.getListAsync(this.activeScope());
|
|
195
150
|
this.loadedItems.set(items);
|
|
196
|
-
const currentContext = await this.settingValueService.all();
|
|
197
|
-
const defaults = this.
|
|
151
|
+
const currentContext = await this.settingValueService.scope(this.resolveScope()).all();
|
|
152
|
+
const defaults = await this.settingValueService.scope(this.resolveScope()).defaultValues();
|
|
198
153
|
this.context.set({ ...defaults, ...currentContext });
|
|
199
154
|
this.previousContext.set(this.context());
|
|
200
155
|
//
|
|
201
156
|
await this.updateGroupParam();
|
|
202
|
-
if (!this.activateGroup() && this.
|
|
157
|
+
if (!this.activateGroup() && this.layout.isLarge() && !this.isSearching()) {
|
|
203
158
|
await this.redirectToFirstGroup();
|
|
204
159
|
}
|
|
205
160
|
}
|
|
206
161
|
async updateGroupParam() {
|
|
207
162
|
const query = this.activatedRoute.snapshot.queryParams["q"];
|
|
208
|
-
const scope = this.resolveScope(
|
|
163
|
+
const scope = this.resolveScope();
|
|
209
164
|
const group = this.activatedRoute.snapshot.paramMap.get("group");
|
|
210
165
|
if ((this.activeScope() && this.activeScope() != scope) || (this.activateGroup() != group)) {
|
|
211
166
|
this.activateGroup.set(undefined);
|
|
@@ -220,6 +175,9 @@ class AXPSettingsViewModel {
|
|
|
220
175
|
this.highlightService.highlight('#ax-settings', this.searchExpression());
|
|
221
176
|
}, 100);
|
|
222
177
|
}
|
|
178
|
+
else {
|
|
179
|
+
this.highlightService.clear();
|
|
180
|
+
}
|
|
223
181
|
// If no child routes exist, set activateGroup to undefined
|
|
224
182
|
if (this.activatedRoute.children.length === 0) {
|
|
225
183
|
this.activateGroup.set(undefined);
|
|
@@ -240,13 +198,23 @@ class AXPSettingsViewModel {
|
|
|
240
198
|
const app = this.activatedRoute.snapshot.params['app'];
|
|
241
199
|
const scope = this.activatedRoute.snapshot.params['scope'];
|
|
242
200
|
await this.router.navigate([app, 'settings', scope, firstGroup], { replaceUrl: true });
|
|
243
|
-
//this.activateGroup.set(firstGroup);
|
|
244
201
|
}
|
|
245
202
|
}
|
|
246
203
|
async navigateUpLevel() {
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
|
|
204
|
+
const func = async () => {
|
|
205
|
+
const app = this.activatedRoute.snapshot.params['app'];
|
|
206
|
+
const scope = this.activatedRoute.snapshot.params['scope'];
|
|
207
|
+
await this.router.navigate([app, 'settings', scope]);
|
|
208
|
+
};
|
|
209
|
+
if (this.isDirty()) {
|
|
210
|
+
const dialogResult = await this.dialogService.confirm('Unsaved Changes', 'You have unsaved changes. Are you sure you want to go back without saving?', 'warning');
|
|
211
|
+
if (dialogResult.result) {
|
|
212
|
+
await func();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
await func();
|
|
217
|
+
}
|
|
250
218
|
}
|
|
251
219
|
determineFirstGroup() {
|
|
252
220
|
const groups = this.loadedItems();
|
|
@@ -257,16 +225,11 @@ class AXPSettingsViewModel {
|
|
|
257
225
|
this.searchExpression.set('');
|
|
258
226
|
}
|
|
259
227
|
async handleContextChanged(e) {
|
|
260
|
-
if (e.
|
|
228
|
+
if (e.state == 'initiated') {
|
|
261
229
|
this.previousContext.set(e.data);
|
|
262
230
|
}
|
|
263
231
|
else {
|
|
264
|
-
|
|
265
|
-
await this.settingValueService.set(e.path, e.newValue);
|
|
266
|
-
}
|
|
267
|
-
else {
|
|
268
|
-
this.context.set(e.data);
|
|
269
|
-
}
|
|
232
|
+
this.context.set(e.data);
|
|
270
233
|
}
|
|
271
234
|
}
|
|
272
235
|
isDirty(section) {
|
|
@@ -287,6 +250,22 @@ class AXPSettingsViewModel {
|
|
|
287
250
|
async apply(section) {
|
|
288
251
|
try {
|
|
289
252
|
this.isSaving.set(true);
|
|
253
|
+
this.builder.setStatus(AXPPageStatus.Submitting);
|
|
254
|
+
const formResult = await this.form.validate();
|
|
255
|
+
if (!formResult.result) {
|
|
256
|
+
this.toastService.show({
|
|
257
|
+
color: 'danger',
|
|
258
|
+
title: 'Review Needed',
|
|
259
|
+
content: 'Invalid configuration detected. Please review your inputs.',
|
|
260
|
+
location: 'bottom-center',
|
|
261
|
+
closeButton: true,
|
|
262
|
+
timeOut: 3000,
|
|
263
|
+
timeOutProgress: true,
|
|
264
|
+
});
|
|
265
|
+
this.isSaving.set(false);
|
|
266
|
+
this.builder.setStatus(AXPPageStatus.Error);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
290
269
|
if (section) {
|
|
291
270
|
// Apply changes for the specific section
|
|
292
271
|
const changes = {};
|
|
@@ -294,13 +273,14 @@ class AXPSettingsViewModel {
|
|
|
294
273
|
changes[c.name] = get(this.context(), c.name);
|
|
295
274
|
});
|
|
296
275
|
if (!isEmpty(changes)) {
|
|
297
|
-
await this.settingValueService.set(changes);
|
|
276
|
+
await this.settingValueService.scope(this.resolveScope()).set(changes);
|
|
298
277
|
}
|
|
299
278
|
}
|
|
300
279
|
else {
|
|
301
280
|
// Save the settings
|
|
302
|
-
await this.settingValueService.set(this.context());
|
|
281
|
+
await this.settingValueService.scope(this.resolveScope()).set(this.context());
|
|
303
282
|
}
|
|
283
|
+
this.builder.setStatus(AXPPageStatus.Submitted);
|
|
304
284
|
// Show success notification
|
|
305
285
|
this.toastService.show({
|
|
306
286
|
color: 'success',
|
|
@@ -314,6 +294,7 @@ class AXPSettingsViewModel {
|
|
|
314
294
|
}
|
|
315
295
|
catch (error) {
|
|
316
296
|
// Handle and show errors
|
|
297
|
+
this.builder.setStatus(AXPPageStatus.Error);
|
|
317
298
|
console.error('Error saving settings:', error);
|
|
318
299
|
this.toastService.show({
|
|
319
300
|
color: 'danger',
|
|
@@ -331,6 +312,7 @@ class AXPSettingsViewModel {
|
|
|
331
312
|
}
|
|
332
313
|
// discard settings logic
|
|
333
314
|
async discard(section) {
|
|
315
|
+
this.form.resetErrors();
|
|
334
316
|
if (section) {
|
|
335
317
|
// Discard changes for the specific section
|
|
336
318
|
section.settings.forEach(c => {
|
|
@@ -348,7 +330,7 @@ class AXPSettingsViewModel {
|
|
|
348
330
|
}
|
|
349
331
|
// Cancel settings logic
|
|
350
332
|
async resetToDefault() {
|
|
351
|
-
const defaults = this.
|
|
333
|
+
const defaults = await this.settingValueService.scope(this.resolveScope()).defaultValues();
|
|
352
334
|
// Update the context with the defaults
|
|
353
335
|
this.context.set(defaults);
|
|
354
336
|
//
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-layout-setting.mjs","sources":["../../../../libs/platform/layout/setting/src/lib/convert-setting-data.ts","../../../../libs/platform/layout/setting/src/lib/setting.viewmodel.ts","../../../../libs/platform/layout/setting/src/acorex-platform-layout-setting.ts"],"sourcesContent":["import { AXTreeViewSchema } from '@acorex/components/tree-view/lib/tree-view.class';\nimport { AXPSettingDefinitionGroup, AXPSettingDefinitionSection } from '@acorex/platform/common';\n\n/**\n * Converts a list of AXPSettingDefinitionGroup into a tree structure of AXTreeViewSchema.\n * This function processes groups and their nested sub-groups, recursively creating a tree.\n *\n * @param groups - Array of top-level setting groups to be converted into tree view schema.\n * @param parentId - The parent ID for nested groups, passed down recursively. (Optional, default is undefined)\n *\n * @returns An array of AXTreeViewSchema representing the hierarchical structure of groups.\n */\nexport function convertToTreeViewSchema(\n groups: AXPSettingDefinitionGroup[],\n parentId?: string | number\n): AXTreeViewSchema[] {\n // Helper function to traverse and convert a single group (and its sub-groups)\n const traverseGroups = (group: AXPSettingDefinitionGroup, parent?: string | number): AXTreeViewSchema => {\n const currentId = group.name;\n\n // Schema for the current group\n const schema: AXTreeViewSchema = {\n id: currentId, // Unique identifier for the group (using group name)\n parentId: parent, // Parent group ID, passed down recursively\n text: group.title, // Display title of the group\n //tooltip: group.description, // Optional description as tooltip\n hasChild: group.groups.length > 0, // Whether the group has child groups\n isExpanded: false, // Default state for expansion (optional)\n icon: group.icon,\n childrens: group.groups.length > 0 ? [] : undefined, // Child groups array (undefined if no children)\n };\n\n // Recursively process nested groups (sub-groups inside the current group)\n group.groups.forEach((subGroup) => {\n const childSchema = traverseGroups(subGroup, currentId); // Create schema for sub-group\n schema.childrens?.push(childSchema); // Add the child schema to the parent group's children\n });\n\n return schema; // Return the group schema with its children (if any)\n };\n\n // Initialize an array to hold the top-level groups' schemas\n const treeViewSchemas: AXTreeViewSchema[] = [];\n\n // Process each top-level group and convert it into tree view schema\n groups.forEach((group) => {\n treeViewSchemas.push(traverseGroups(group, parentId)); // Add the schema for each group\n });\n\n // Return the resulting hierarchical structure\n return treeViewSchemas;\n}\n\n/**\n * Recursively searches for a specific `id` in a tree structure and updates its `active` property to `true`.\n * Additionally, ensures all other nodes have their `active` property set to `false`.\n *\n * @param tree - The tree structure to search, represented as an array of AXTreeViewSchema nodes.\n * @param targetId - The `id` of the node to activate.\n * @returns The updated tree structure with the target node activated and others deactivated.\n */\nexport function setActiveByValueField(tree: AXTreeViewSchema[], targetId: string | number): AXTreeViewSchema[] {\n return tree.map((node) => {\n // Set active property for the target node\n node.active = node.id === targetId;\n\n // Recursively process children if they exist\n if (node.childrens && node.childrens.length > 0) {\n node.childrens = setActiveByValueField(node.childrens, targetId);\n }\n\n return node;\n });\n}\nexport function searchSettings(groups: AXPSettingDefinitionGroup[], search: string): AXPSettingDefinitionGroup[] {\n const sectionMatchResult: AXPSettingDefinitionGroup[] = [];\n const settingMatchResult: AXPSettingDefinitionGroup[] = [];\n const processedGroups = new Set<string>();\n\n const createGroupIdentifier = (group: AXPSettingDefinitionGroup): string => `${group.name}-${group.title}`;\n\n const addGroupToResult = (\n group: AXPSettingDefinitionGroup,\n sections: AXPSettingDefinitionSection[],\n resultArray: AXPSettingDefinitionGroup[]\n ) => {\n const groupId = createGroupIdentifier(group);\n if (!processedGroups.has(groupId)) {\n resultArray.push({\n ...group,\n sections,\n groups: [], // Exclude nested groups\n });\n processedGroups.add(groupId);\n }\n };\n\n const processSections = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => boolean\n ) => {\n const matchedSections = group.sections.filter(filterFn);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, sectionMatchResult);\n }\n };\n\n const processSettings = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => AXPSettingDefinitionSection | null\n ) => {\n const matchedSections = group.sections\n .map(filterFn)\n .filter((section): section is AXPSettingDefinitionSection => section !== null);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, settingMatchResult);\n }\n };\n\n const sectionMatches = (section: AXPSettingDefinitionSection): boolean =>\n section.name.toLowerCase().includes(search.toLowerCase()) ||\n section.title.toLowerCase().includes(search.toLowerCase());\n\n const filterSettings = (section: AXPSettingDefinitionSection): AXPSettingDefinitionSection | null => {\n const matchedSettings = section.settings.filter(\n (setting) =>\n setting.name.toLowerCase().includes(search.toLowerCase()) ||\n setting.title.toLowerCase().includes(search.toLowerCase())\n );\n return matchedSettings.length > 0 ? { ...section, settings: matchedSettings } : null;\n };\n\n const processGroupRecursively = (group: AXPSettingDefinitionGroup) => {\n processSections(group, sectionMatches); // Match sections with all settings\n processSettings(group, filterSettings); // Match settings within sections\n group.groups.forEach(processGroupRecursively); // Recurse into nested groups\n };\n\n groups.forEach(processGroupRecursively);\n\n return [...sectionMatchResult, ...settingMatchResult];\n}\n","import { AXToastService } from '@acorex/components/toast';\nimport {\n AXPGroupSearchResult,\n AXPSettingDefinitionGroup,\n AXPSettingDefinitionProviderService,\n AXPSettingDefinitionSection,\n AXPSettingScope,\n AXPSettingValueProviderService,\n} from '@acorex/platform/common';\nimport { AXHighlightService } from '@acorex/platform/core';\nimport { computed, effect, inject, Injectable, signal } from '@angular/core';\nimport { ActivatedRoute, NavigationEnd, Router } from '@angular/router';\nimport { filter, take } from 'rxjs';\nimport { searchSettings } from './convert-setting-data';\nimport { cloneDeep, get, isEmpty, isEqual, isNil, values } from 'lodash-es';\nimport { AXPLayoutContextEvent } from '@acorex/platform/layout/builder';\nimport { AXPLayoutThemeService } from '@acorex/platform/themes/shared';\n\n\n@Injectable()\nexport class AXPSettingsViewModel {\n\n private readonly router = inject(Router);\n private readonly settingDefinitionService = inject(AXPSettingDefinitionProviderService);\n private readonly settingValueService = inject(AXPSettingValueProviderService);\n private readonly toastService = inject(AXToastService);\n private readonly highlightService = inject(AXHighlightService);\n private readonly layoutService = inject(AXPLayoutThemeService);\n private activatedRoute = inject(ActivatedRoute);\n\n\n public searchExpression = signal('');\n private isValidQuery = (expression: string) => !isNil(expression) && !isEmpty(expression);\n public isSearching = computed(() => this.isValidQuery(this.searchExpression()));\n\n public searchResult = signal<AXPSettingDefinitionGroup[]>([]);\n public isSaving = signal(false);\n public inlineSave = computed(() => {\n return this.layoutService.isSmall();\n });\n\n\n public activateGroup = signal<string | undefined>(undefined);\n private activeScope = signal<AXPSettingScope>('U');\n\n public loadedItems = signal<AXPSettingDefinitionGroup[] | null>(null);\n\n\n\n private resolveScope(scopeName: string): AXPSettingScope {\n const scopeMap: Record<string, AXPSettingScope> = {\n environment: 'C',\n global: 'G',\n tenant: 'T',\n user: 'U',\n };\n\n const normalizedScopeName = scopeName.trim().toLowerCase();\n\n return scopeMap[normalizedScopeName] ?? 'U'\n }\n\n groups = computed<AXPGroupSearchResult | null>(() => {\n if (this.activateGroup()) {\n return this.settingDefinitionService.findGroup(this.activeScope(), this.activateGroup()!);\n } else {\n return null\n };\n });\n\n #effect2 = effect(\n () => {\n if (this.searchExpression()) {\n this.searchResult.set(searchSettings(this.loadedItems()!, this.searchExpression()));\n }\n }\n );\n\n\n /**\n * @ignore\n */\n constructor() {\n this.settingValueService.onChanged.subscribe((e) => {\n e.keys.forEach(k => {\n const currentValue = e.values[k];\n const contextValue = get(this.context(), k);\n const previousValue = get(this.previousContext(), k);\n // Update only if there are actual changes\n if (!isEqual(previousValue, currentValue) || !isEqual(currentValue, contextValue)) {\n this.previousContext.update(prev => ({\n ...prev,\n [k]: currentValue, // Use backend-provided value\n }));\n this.context.update(ctx => ({\n ...ctx,\n [k]: currentValue,\n }));\n }\n });\n });\n this.load();\n //\n this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd)\n ).subscribe(async () => {\n await this.updateGroupParam();\n });\n }\n\n async load() {\n //\n this.activeScope.set(this.resolveScope(this.activatedRoute.snapshot.paramMap?.get('scope')!));\n //\n const items = await this.settingDefinitionService.getListAsync(this.activeScope());\n this.loadedItems.set(items);\n const currentContext = await this.settingValueService.all();\n const defaults = this.settingDefinitionService.defaultValues();\n this.context.set({ ...defaults, ...currentContext });\n this.previousContext.set(this.context());\n //\n await this.updateGroupParam();\n if (!this.activateGroup() && this.layoutService.isLarge() && !this.isSearching()) {\n await this.redirectToFirstGroup();\n }\n }\n\n\n\n\n private async updateGroupParam(): Promise<void> {\n const query = this.activatedRoute.snapshot.queryParams[\"q\"];\n const scope = this.resolveScope(this.activatedRoute.snapshot.paramMap.get(\"scope\")!);\n const group = this.activatedRoute.snapshot.paramMap.get(\"group\");\n\n\n if ((this.activeScope() && this.activeScope() != scope) || (this.activateGroup() != group)) {\n this.activateGroup.set(undefined);\n await this.load();\n return;\n }\n\n if (this.isValidQuery(query)) {\n this.searchExpression.set(query);\n }\n if (this.isSearching()) {\n setTimeout(() => {\n this.highlightService.highlight('#ax-settings', this.searchExpression());\n }, 100);\n }\n\n // If no child routes exist, set activateGroup to undefined\n if (this.activatedRoute.children.length === 0) {\n this.activateGroup.set(undefined);\n return;\n }\n // Traverse child routes to check for the group parameter\n for (const childRoute of this.activatedRoute.children) {\n const params = await childRoute.paramMap.pipe(take(1)).toPromise();\n const group = params?.get('group');\n if (group) {\n this.activateGroup.set(group);\n }\n }\n\n\n }\n\n public async redirectToFirstGroup(): Promise<void> {\n const firstGroup = this.determineFirstGroup();\n if (firstGroup) {\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n await this.router.navigate([app, 'settings', scope, firstGroup], { replaceUrl: true });\n //this.activateGroup.set(firstGroup);\n }\n }\n\n public async navigateUpLevel(): Promise<void> {\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n await this.router.navigate([app, 'settings', scope]);\n }\n\n private determineFirstGroup(): string | null {\n const groups = this.loadedItems();\n return groups && groups.length > 0 ? groups[0].name : null;\n }\n\n public handleSelectGroup(item: AXPSettingDefinitionGroup) {\n this.router.navigate([`${item.name}`], { relativeTo: this.activatedRoute });\n this.searchExpression.set('');\n }\n\n context = signal<Record<any, any>>({});\n private previousContext = signal<Record<any, any>>({});\n\n async handleContextChanged(e: AXPLayoutContextEvent) {\n if (e.init) {\n this.previousContext.set(e.data);\n }\n else {\n if (this.inlineSave()) {\n await this.settingValueService.set(e.path!, e.newValue);\n }\n else {\n this.context.set(e.data);\n }\n\n }\n }\n\n\n isDirty(section?: AXPSettingDefinitionSection): boolean {\n if (section) {\n // Check for changes in the specific section\n return section.settings.some(c =>\n !isEqual(get(this.context(), c.name), get(this.previousContext(), c.name))\n );\n } else {\n // Check for changes globally based on loadedItems keys\n return this.loadedItems()?.some(group =>\n group.sections.some(sec =>\n sec.settings.some(setting => {\n const currentValue = get(this.context(), setting.name);\n const previousValue = get(this.previousContext(), setting.name);\n return !isEqual(currentValue, previousValue);\n })\n )\n ) || false;\n }\n }\n\n // Save settings logic\n public async apply(section?: AXPSettingDefinitionSection): Promise<void> {\n try {\n this.isSaving.set(true);\n\n if (section) {\n // Apply changes for the specific section\n const changes: Record<string, any> = {}\n section.settings.forEach(c => {\n changes[c.name] = get(this.context(), c.name);\n });\n if (!isEmpty(changes)) {\n await this.settingValueService.set(changes);\n }\n } else {\n // Save the settings\n await this.settingValueService.set(this.context());\n }\n\n // Show success notification\n this.toastService.show({\n color: 'success',\n title: 'Settings Saved',\n content: 'Your changes have been saved successfully.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n } catch (error: any) {\n // Handle and show errors\n console.error('Error saving settings:', error);\n this.toastService.show({\n color: 'danger',\n title: 'Save Failed',\n content: error?.['message'] || 'An error occurred while saving your settings. Please try again.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 5000,\n timeOutProgress: true,\n });\n } finally {\n this.isSaving.set(false);\n }\n }\n\n // discard settings logic\n public async discard(section?: AXPSettingDefinitionSection): Promise<void> {\n if (section) {\n // Discard changes for the specific section\n section.settings.forEach(c => {\n const previousValue = get(this.previousContext(), c.name);\n this.context.update(ctx => ({\n ...ctx,\n [c.name]: previousValue\n }));\n });\n } else {\n // Discard changes for all sections\n this.context.set(this.previousContext());\n }\n }\n\n // Cancel settings logic\n public async resetToDefault(): Promise<void> {\n const defaults = this.settingDefinitionService.defaultValues();\n // Update the context with the defaults\n this.context.set(defaults);\n //\n await this.apply();\n }\n\n\n public async search(expression: string) {\n this.searchExpression.set(expression);\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n //\n if (this.isValidQuery(expression)) {\n await this.router.navigate([app, 'settings', scope, this.activateGroup() ?? ''], { queryParams: { q: expression } });\n }\n else {\n await this.router.navigate([app, 'settings', scope, this.activateGroup() ?? '']);\n }\n }\n\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAGA;;;;;;;;AAQG;AACa,SAAA,uBAAuB,CACrC,MAAmC,EACnC,QAA0B,EAAA;;AAG1B,IAAA,MAAM,cAAc,GAAG,CAAC,KAAgC,EAAE,MAAwB,KAAsB;AACtG,QAAA,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI;;AAG5B,QAAA,MAAM,MAAM,GAAqB;YAC/B,EAAE,EAAE,SAAS;YACb,QAAQ,EAAE,MAAM;AAChB,YAAA,IAAI,EAAE,KAAK,CAAC,KAAK;;YAEjB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;YACjC,UAAU,EAAE,KAAK;YACjB,IAAI,EAAE,KAAK,CAAC,IAAI;AAChB,YAAA,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,GAAG,SAAS;SACpD;;QAGD,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,QAAQ,KAAI;YAChC,MAAM,WAAW,GAAG,cAAc,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YACxD,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;AACtC,SAAC,CAAC;QAEF,OAAO,MAAM,CAAC;AAChB,KAAC;;IAGD,MAAM,eAAe,GAAuB,EAAE;;AAG9C,IAAA,MAAM,CAAC,OAAO,CAAC,C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,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAApB,oBAAoB,EAAA,CAAA,CAAA;;2FAApB,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBADhC;;;ACnBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-layout-setting.mjs","sources":["../../../../libs/platform/layout/setting/src/lib/convert-setting-data.ts","../../../../libs/platform/layout/setting/src/lib/setting.viewmodel.ts","../../../../libs/platform/layout/setting/src/acorex-platform-layout-setting.ts"],"sourcesContent":["import { AXPSettingDefinitionGroup, AXPSettingDefinitionSection } from '@acorex/platform/common';\n\n\nexport function searchSettings(groups: AXPSettingDefinitionGroup[], search: string): AXPSettingDefinitionGroup[] {\n const sectionMatchResult: AXPSettingDefinitionGroup[] = [];\n const settingMatchResult: AXPSettingDefinitionGroup[] = [];\n const processedGroups = new Set<string>();\n\n const createGroupIdentifier = (group: AXPSettingDefinitionGroup): string => `${group.name}-${group.title}`;\n\n const addGroupToResult = (\n group: AXPSettingDefinitionGroup,\n sections: AXPSettingDefinitionSection[],\n resultArray: AXPSettingDefinitionGroup[]\n ) => {\n const groupId = createGroupIdentifier(group);\n if (!processedGroups.has(groupId)) {\n resultArray.push({\n ...group,\n sections,\n groups: [], // Exclude nested groups\n });\n processedGroups.add(groupId);\n }\n };\n\n const processSections = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => boolean\n ) => {\n const matchedSections = group.sections.filter(filterFn);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, sectionMatchResult);\n }\n };\n\n const processSettings = (\n group: AXPSettingDefinitionGroup,\n filterFn: (section: AXPSettingDefinitionSection) => AXPSettingDefinitionSection | null\n ) => {\n const matchedSections = group.sections\n .map(filterFn)\n .filter((section): section is AXPSettingDefinitionSection => section !== null);\n if (matchedSections.length > 0) {\n addGroupToResult(group, matchedSections, settingMatchResult);\n }\n };\n\n const sectionMatches = (section: AXPSettingDefinitionSection): boolean =>\n section.name.toLowerCase().includes(search.toLowerCase()) ||\n section.title.toLowerCase().includes(search.toLowerCase());\n\n const filterSettings = (section: AXPSettingDefinitionSection): AXPSettingDefinitionSection | null => {\n const matchedSettings = section.settings.filter(\n (setting) =>\n setting.name.toLowerCase().includes(search.toLowerCase()) ||\n setting.title.toLowerCase().includes(search.toLowerCase())\n );\n return matchedSettings.length > 0 ? { ...section, settings: matchedSettings } : null;\n };\n\n const processGroupRecursively = (group: AXPSettingDefinitionGroup) => {\n processSections(group, sectionMatches); // Match sections with all settings\n processSettings(group, filterSettings); // Match settings within sections\n group.groups.forEach(processGroupRecursively); // Recurse into nested groups\n };\n\n groups.forEach(processGroupRecursively);\n\n return [...sectionMatchResult, ...settingMatchResult];\n}\n","import { AXToastService } from '@acorex/components/toast';\nimport {\n AXPGroupSearchResult,\n AXPSettingDefinitionGroup,\n AXPSettingDefinitionProviderService,\n AXPSettingDefinitionSection,\n AXPSettingScope,\n AXPSettingScopeKey,\n AXPSettingValueProviderService,\n} from '@acorex/platform/common';\nimport { AXHighlightService } from '@acorex/platform/core';\nimport { computed, effect, inject, Injectable, input, signal } from '@angular/core';\nimport { ActivatedRoute, NavigationEnd, Router } from '@angular/router';\nimport { filter, take } from 'rxjs';\nimport { searchSettings } from './convert-setting-data';\nimport { get, isEmpty, isEqual, isNil, } from 'lodash-es';\nimport { AXPLayoutBuilderService, AXPLayoutContextChangeEvent, AXPPageStatus } from '@acorex/platform/layout/builder';\nimport { AXPLayoutThemeService } from '@acorex/platform/themes/shared';\nimport { AXFormComponent } from '@acorex/components/form';\nimport { AXDialogService } from '@acorex/components/dialog';\n\n\n@Injectable()\nexport class AXPSettingsViewModel {\n\n private readonly router = inject(Router);\n private readonly settingDefinitionService = inject(AXPSettingDefinitionProviderService);\n private readonly settingValueService = inject(AXPSettingValueProviderService);\n private readonly toastService = inject(AXToastService);\n private readonly dialogService = inject(AXDialogService);\n private readonly highlightService = inject(AXHighlightService);\n public readonly layout = inject(AXPLayoutThemeService);\n private activatedRoute = inject(ActivatedRoute);\n\n public form: AXFormComponent;\n public builder: AXPLayoutBuilderService;\n\n\n public searchExpression = signal('');\n private isValidQuery = (expression: string) => !isNil(expression) && !isEmpty(expression);\n public isSearching = computed(() => this.isValidQuery(this.searchExpression()));\n\n public searchResult = signal<AXPSettingDefinitionGroup[]>([]);\n public isSaving = signal(false);\n\n public isBusy = signal(false);\n\n public activateGroup = signal<string | undefined>(undefined);\n private activeScope = signal<AXPSettingScopeKey>('U');\n\n public loadedItems = signal<AXPSettingDefinitionGroup[] | null>(null);\n\n private scopeName = () => {\n return this.activatedRoute?.snapshot?.paramMap?.get('scope')?.trim().toLowerCase() ?? 'user';\n };\n\n private resolveScopeKey(name: string): AXPSettingScopeKey {\n const scopeMap: Record<string, AXPSettingScopeKey> = {\n environment: AXPSettingScope.Environment,\n global: AXPSettingScope.Global,\n tenant: AXPSettingScope.Tenant,\n user: AXPSettingScope.User,\n };\n return scopeMap[name.toLowerCase()] ?? AXPSettingScope.User;\n }\n\n private resolveScope(): AXPSettingScope {\n return this.resolveScopeKey(this.scopeName()) as AXPSettingScope;\n }\n\n public title = computed(() => {\n // fake change detect simulate\n this.activeScope();\n //\n return `settings.${this.scopeName()}.title`;\n });\n\n\n groups = computed<AXPGroupSearchResult | null>(() => {\n if (this.activateGroup()) {\n return this.settingDefinitionService.findGroup(this.activeScope(), this.activateGroup()!);\n } else {\n return null\n };\n });\n\n public hasGroup = computed(() => this.activateGroup() != null);\n public showSide = computed(() => this.layout.isLarge() && this.hasGroup());\n\n #effect2 = effect(\n () => {\n if (this.searchExpression()) {\n this.searchResult.set(searchSettings(this.loadedItems()!, this.searchExpression()));\n }\n }\n );\n\n\n /**\n * @ignore\n */\n constructor() {\n this.settingValueService.onChanged.pipe(filter(c => c.scope == this.resolveScope())).subscribe((e) => {\n e.keys.forEach(k => {\n const currentValue = e.values[k];\n const contextValue = get(this.context(), k);\n const previousValue = get(this.previousContext(), k);\n // Update only if there are actual changes\n if (!isEqual(previousValue, currentValue) || !isEqual(currentValue, contextValue)) {\n this.previousContext.update(prev => ({\n ...prev,\n [k]: currentValue, // Use backend-provided value\n }));\n this.context.update(ctx => ({\n ...ctx,\n [k]: currentValue,\n }));\n }\n });\n });\n this.load();\n //\n this.router.events.pipe(\n filter((event) => event instanceof NavigationEnd)\n ).subscribe(async () => {\n await this.updateGroupParam();\n });\n }\n\n async load() {\n //\n this.activeScope.set(this.resolveScope());\n //\n const items = await this.settingDefinitionService.getListAsync(this.activeScope());\n this.loadedItems.set(items);\n const currentContext = await this.settingValueService.scope(this.resolveScope()).all();\n const defaults = await this.settingValueService.scope(this.resolveScope()).defaultValues();\n this.context.set({ ...defaults, ...currentContext });\n this.previousContext.set(this.context());\n //\n await this.updateGroupParam();\n if (!this.activateGroup() && this.layout.isLarge() && !this.isSearching()) {\n await this.redirectToFirstGroup();\n }\n }\n\n\n\n\n private async updateGroupParam(): Promise<void> {\n const query = this.activatedRoute.snapshot.queryParams[\"q\"];\n const scope = this.resolveScope();\n const group = this.activatedRoute.snapshot.paramMap.get(\"group\");\n\n if ((this.activeScope() && this.activeScope() != scope) || (this.activateGroup() != group)) {\n this.activateGroup.set(undefined);\n await this.load();\n return;\n }\n\n if (this.isValidQuery(query)) {\n this.searchExpression.set(query);\n }\n if (this.isSearching()) {\n setTimeout(() => {\n this.highlightService.highlight('#ax-settings', this.searchExpression());\n }, 100);\n }\n else {\n this.highlightService.clear();\n }\n\n // If no child routes exist, set activateGroup to undefined\n if (this.activatedRoute.children.length === 0) {\n this.activateGroup.set(undefined);\n return;\n }\n // Traverse child routes to check for the group parameter\n for (const childRoute of this.activatedRoute.children) {\n const params = await childRoute.paramMap.pipe(take(1)).toPromise();\n const group = params?.get('group');\n if (group) {\n this.activateGroup.set(group);\n }\n }\n }\n\n public async redirectToFirstGroup(): Promise<void> {\n const firstGroup = this.determineFirstGroup();\n if (firstGroup) {\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n await this.router.navigate([app, 'settings', scope, firstGroup], { replaceUrl: true });\n }\n }\n\n public async navigateUpLevel(): Promise<void> {\n const func = async () => {\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n await this.router.navigate([app, 'settings', scope]);\n }\n\n if (this.isDirty()) {\n const dialogResult = await this.dialogService.confirm('Unsaved Changes', 'You have unsaved changes. Are you sure you want to go back without saving?', 'warning');\n if (dialogResult.result) {\n await func();\n }\n }\n else {\n await func();\n }\n }\n\n private determineFirstGroup(): string | null {\n const groups = this.loadedItems();\n return groups && groups.length > 0 ? groups[0].name : null;\n }\n\n public handleSelectGroup(item: AXPSettingDefinitionGroup) {\n this.router.navigate([`${item.name}`], { relativeTo: this.activatedRoute });\n this.searchExpression.set('');\n }\n\n context = signal<Record<any, any>>({});\n private previousContext = signal<Record<any, any>>({});\n\n async handleContextChanged(e: AXPLayoutContextChangeEvent) {\n if (e.state == 'initiated') {\n this.previousContext.set(e.data);\n }\n else {\n this.context.set(e.data);\n }\n }\n\n\n isDirty(section?: AXPSettingDefinitionSection): boolean {\n if (section) {\n // Check for changes in the specific section\n return section.settings.some(c =>\n !isEqual(get(this.context(), c.name), get(this.previousContext(), c.name))\n );\n } else {\n // Check for changes globally based on loadedItems keys\n return this.loadedItems()?.some(group =>\n group.sections.some(sec =>\n sec.settings.some(setting => {\n const currentValue = get(this.context(), setting.name);\n const previousValue = get(this.previousContext(), setting.name);\n return !isEqual(currentValue, previousValue);\n })\n )\n ) || false;\n }\n }\n\n // Save settings logic\n public async apply(section?: AXPSettingDefinitionSection): Promise<void> {\n try {\n this.isSaving.set(true);\n this.builder.setStatus(AXPPageStatus.Submitting);\n\n const formResult = await this.form.validate();\n if (!formResult.result) {\n this.toastService.show({\n color: 'danger',\n title: 'Review Needed',\n content: 'Invalid configuration detected. Please review your inputs.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n this.isSaving.set(false);\n this.builder.setStatus(AXPPageStatus.Error);\n return;\n }\n\n if (section) {\n // Apply changes for the specific section\n const changes: Record<string, any> = {}\n section.settings.forEach(c => {\n changes[c.name] = get(this.context(), c.name);\n });\n if (!isEmpty(changes)) {\n await this.settingValueService.scope(this.resolveScope()).set(changes);\n }\n } else {\n // Save the settings\n await this.settingValueService.scope(this.resolveScope()).set(this.context());\n }\n this.builder.setStatus(AXPPageStatus.Submitted);\n // Show success notification\n this.toastService.show({\n color: 'success',\n title: 'Settings Saved',\n content: 'Your changes have been saved successfully.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n } catch (error: any) {\n // Handle and show errors\n this.builder.setStatus(AXPPageStatus.Error);\n console.error('Error saving settings:', error);\n this.toastService.show({\n color: 'danger',\n title: 'Save Failed',\n content: error?.['message'] || 'An error occurred while saving your settings. Please try again.',\n location: 'bottom-center',\n closeButton: true,\n timeOut: 5000,\n timeOutProgress: true,\n });\n } finally {\n this.isSaving.set(false);\n }\n }\n\n // discard settings logic\n public async discard(section?: AXPSettingDefinitionSection): Promise<void> {\n this.form.resetErrors();\n if (section) {\n // Discard changes for the specific section\n section.settings.forEach(c => {\n const previousValue = get(this.previousContext(), c.name);\n this.context.update(ctx => ({\n ...ctx,\n [c.name]: previousValue\n }));\n });\n } else {\n // Discard changes for all sections\n this.context.set(this.previousContext());\n }\n }\n\n // Cancel settings logic\n public async resetToDefault(): Promise<void> {\n const defaults = await this.settingValueService.scope(this.resolveScope()).defaultValues();\n // Update the context with the defaults\n this.context.set(defaults);\n //\n await this.apply();\n }\n\n\n public async search(expression: string) {\n this.searchExpression.set(expression);\n const app = this.activatedRoute.snapshot.params['app'];\n const scope = this.activatedRoute.snapshot.params['scope'];\n //\n if (this.isValidQuery(expression)) {\n await this.router.navigate([app, 'settings', scope, this.activateGroup() ?? ''], { queryParams: { q: expression } });\n }\n else {\n await this.router.navigate([app, 'settings', scope,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