@acorex/platform 19.2.19 → 19.3.0-next.0
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 +13 -3
- package/common/lib/file-storage/file-storage.types.d.ts +20 -12
- package/common/lib/filters/filters.types.d.ts +5 -0
- package/common/lib/layout/menu/badge-helper.d.ts +7 -0
- package/common/lib/layout/menu/index.d.ts +1 -0
- package/common/lib/layout/menu/menu.types.d.ts +1 -0
- package/common/lib/layout/task-badge/index.d.ts +2 -0
- package/common/lib/layout/task-badge/task-badge.service.d.ts +11 -0
- package/common/lib/layout/task-badge/task-badge.type.d.ts +6 -0
- package/common/lib/settings/setting-definition.provider.d.ts +7 -5
- package/common/lib/settings/setting.builder.d.ts +8 -5
- package/common/lib/settings/settings.service.d.ts +6 -5
- package/common/lib/settings/settings.types.d.ts +6 -10
- package/core/lib/data/index.d.ts +1 -0
- package/core/lib/data/value-transformer.d.ts +6 -0
- package/core/lib/types/core.types.d.ts +18 -0
- package/{layout/entity/lib → core/lib/types}/data.types.d.ts +3 -1
- package/core/lib/types/element.types.d.ts +6 -0
- package/core/lib/types/index.d.ts +6 -0
- package/core/lib/types/interactive.types.d.ts +44 -0
- package/core/lib/types/scope.types.d.ts +10 -0
- package/core/lib/types/validation.types.d.ts +7 -0
- package/core/lib/utils/index.d.ts +1 -0
- package/core/lib/utils/object-util.d.ts +3 -0
- package/fesm2022/acorex-platform-common.mjs +79 -35
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +151 -6
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +44 -55
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +77 -35
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +243 -415
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-search.mjs +7 -26
- package/fesm2022/acorex-platform-layout-search.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-setting.mjs +211 -278
- package/fesm2022/acorex-platform-layout-setting.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-LKhN00ob.mjs → acorex-platform-themes-default-entity-master-create-view.component-3gmbdeJ_.mjs} +4 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-3gmbdeJ_.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DnEL7Ej-.mjs +741 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DnEL7Ej-.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-8DdICjNs.mjs +91 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-8DdICjNs.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DadBeY1I.mjs +164 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DadBeY1I.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-search-popup.component-CGARdU4C.mjs → acorex-platform-themes-default-search-popup.component-BADEuoeJ.mjs} +9 -9
- package/fesm2022/{acorex-platform-themes-default-search-popup.component-CGARdU4C.mjs.map → acorex-platform-themes-default-search-popup.component-BADEuoeJ.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default-setting-page.component-Cj73brIK.mjs +219 -0
- package/fesm2022/acorex-platform-themes-default-setting-page.component-Cj73brIK.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-rrAq6hg2.mjs +103 -0
- package/fesm2022/acorex-platform-themes-default-setting-view.component-rrAq6hg2.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +237 -73
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared-setting.provider-CXiRmniv.mjs +168 -0
- package/fesm2022/acorex-platform-themes-shared-setting.provider-CXiRmniv.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +502 -322
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-widgets.mjs +4109 -1487
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/layout/builder/lib/builder/builder.service.d.ts +1 -1
- package/layout/builder/lib/builder/index.d.ts +2 -1
- package/layout/builder/lib/builder/widget-categories.d.ts +10 -0
- package/layout/builder/lib/builder/widget-group.types.d.ts +10 -0
- package/layout/builder/lib/builder/widget-map.d.ts +8 -1
- package/layout/builder/lib/builder/widget-status.types.d.ts +2 -0
- package/layout/builder/lib/builder/widget.types.d.ts +11 -27
- package/layout/designer/lib/designer/components/widget-picker/widget-picker.component.d.ts +7 -3
- package/layout/designer/lib/designer/components/widget-picker/widget-picker.service.d.ts +12 -0
- package/layout/designer/lib/designer/index.d.ts +1 -0
- package/layout/designer/lib/designer/shared/designer.service.d.ts +1 -0
- package/layout/designer/lib/property-viewer/widget-property-viewer.component.d.ts +2 -1
- package/layout/entity/lib/entity-data-seeder.d.ts +2 -2
- package/layout/entity/lib/entity-master-list.viewmodel.d.ts +4 -7
- package/layout/entity/lib/entity-storage-service.d.ts +39 -55
- package/layout/entity/lib/entity.types.d.ts +21 -0
- package/layout/entity/lib/index.d.ts +1 -2
- package/layout/entity/lib/widgets/lookup-widget/index.d.ts +0 -2
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-column.component.d.ts +4 -0
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-edit.component.d.ts +7 -9
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.component.d.ts +5 -2
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-selector.viewmodel.d.ts +11 -3
- package/layout/search/lib/search.viewmodel.d.ts +0 -2
- package/layout/setting/lib/setting.viewmodel.d.ts +45 -111
- package/package.json +1 -1
- package/themes/default/lib/layouts/base/base-page.component.d.ts +39 -13
- package/themes/default/lib/layouts/base/base-page.types.d.ts +15 -3
- package/themes/default/lib/layouts/base/index.d.ts +1 -0
- package/themes/default/lib/layouts/base/page-layout/index.d.ts +1 -0
- package/themes/default/lib/{pages/theme-palette-preview/theme-palette-preview.page.d.ts → layouts/base/page-layout/page-layout.component.d.ts} +13 -26
- package/themes/default/lib/layouts/base/simple-page/simple-page.layout.d.ts +2 -2
- package/themes/default/lib/layouts/entity-layouts/entity-category/entity-category.component.d.ts +16 -0
- package/themes/default/lib/layouts/entity-layouts/entity-detail-list-view/entity-detail-list-view.component.d.ts +2 -2
- package/themes/default/lib/layouts/entity-layouts/entity-master-list-view/entity-master-list-view.component.d.ts +10 -8
- package/themes/default/lib/layouts/entity-layouts/entity-master-single-view/entity-master-single-view.component.d.ts +12 -4
- package/themes/default/lib/layouts/entity-layouts/entity-master-toolbar-view/entity-master-toolbar-view.component.d.ts +7 -0
- package/themes/default/lib/layouts/entity-layouts/entity-master-toolbar-view/filters/entity-filter-toolbar.component.d.ts +48 -0
- package/themes/default/lib/layouts/entity-layouts/entity-master-toolbar-view/views/entity-view-toolbar.component.d.ts +12 -0
- package/themes/default/lib/layouts/root-layout/components/header/header.component.d.ts +2 -2
- package/themes/default/lib/layouts/root-layout/components/horizontal-menu/horizontal-menu.component.d.ts +9 -3
- package/themes/default/lib/layouts/root-layout/components/side-menu/side-menu.component.d.ts +7 -1
- package/themes/default/lib/layouts/root-layout/horizontal/horizontal-layout.component.d.ts +2 -2
- package/themes/default/lib/layouts/root-layout/root-layout.component.d.ts +2 -2
- package/themes/default/lib/layouts/root-layout/vertical/vertical-layout.component.d.ts +2 -2
- package/themes/default/lib/layouts/setting-layout/setting-page/setting-page.component.d.ts +61 -5
- package/themes/default/lib/layouts/setting-layout/setting-view/setting-view.component.d.ts +68 -6
- package/themes/shared/index.d.ts +1 -1
- package/themes/shared/lib/components/badge/badge.directive.d.ts +14 -0
- package/themes/shared/lib/components/layout-elements/layout-blocks.component.d.ts +4 -1
- package/themes/shared/lib/components/layout-elements/layout-side.component.d.ts +2 -2
- package/themes/shared/lib/components/slots/theme-slot.component.d.ts +2 -2
- package/themes/shared/lib/palette.provider.d.ts +1 -1
- package/themes/shared/lib/setting.keys.d.ts +2 -1
- package/themes/shared/lib/setting.provider.d.ts +4 -1
- package/themes/shared/lib/theme.service.d.ts +2 -2
- package/themes/shared/lib/theme.types.d.ts +11 -2
- package/themes/shared/lib/widgets/font-size-chooser/font-size-chooser-widget.component.d.ts +10 -0
- package/themes/shared/lib/widgets/font-size-chooser/font-size-chooser-widget.config.d.ts +7 -0
- package/themes/shared/lib/widgets/font-size-chooser/index.d.ts +2 -0
- package/themes/shared/lib/widgets/font-style-chooser/font-style-chooser-widget.component.d.ts +15 -0
- package/themes/shared/lib/widgets/font-style-chooser/font-style-chooser-widget.config.d.ts +7 -0
- package/themes/shared/lib/widgets/font-style-chooser/index.d.ts +2 -0
- package/themes/shared/lib/widgets/menu-orientation-chooser/index.d.ts +2 -0
- package/themes/shared/lib/widgets/menu-orientation-chooser/menu-orientation-chooser-widget.component.d.ts +15 -0
- package/themes/shared/lib/widgets/menu-orientation-chooser/menu-orientation-chooser-widget.config.d.ts +7 -0
- package/themes/shared/lib/widgets/theme-mode-chooser/index.d.ts +2 -0
- package/themes/shared/lib/widgets/theme-mode-chooser/theme-mode-chooser-widget.component.d.ts +16 -0
- package/themes/shared/lib/widgets/theme-mode-chooser/theme-mode-chooser-widget.config.d.ts +7 -0
- package/themes/shared/lib/widgets/theme-palette-chooser/index.d.ts +2 -0
- package/themes/shared/lib/widgets/theme-palette-chooser/theme-palette-chooser-widget.component.d.ts +13 -0
- package/themes/shared/lib/widgets/{theme-color-selection/theme-color-selection-widget.config.d.ts → theme-palette-chooser/theme-palette-chooser-widget.config.d.ts} +2 -2
- package/widgets/lib/properties/groups.d.ts +2 -0
- package/widgets/lib/widgets/advance/file/file-box-widget-edit.component.d.ts +5 -5
- package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget.component.d.ts +52 -0
- package/widgets/lib/widgets/charts/bar-chart/bar-chart.type.d.ts +29 -11
- package/widgets/lib/widgets/charts/bar-chart/index.d.ts +1 -1
- package/widgets/lib/widgets/charts/chart.type.d.ts +3 -0
- package/widgets/lib/widgets/charts/clock-calendar/clock-calendar-widget.component.d.ts +40 -0
- package/widgets/lib/widgets/charts/clock-calendar/clock-calendar-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/charts/clock-calendar/clock-calendar.types.d.ts +50 -0
- package/widgets/lib/widgets/charts/clock-calendar/index.d.ts +3 -0
- package/widgets/lib/widgets/charts/donut-chart/donut-chart-widget.component.d.ts +54 -0
- package/widgets/lib/widgets/charts/donut-chart/donut-chart.type.d.ts +31 -21
- package/widgets/lib/widgets/charts/donut-chart/index.d.ts +1 -1
- package/widgets/lib/widgets/charts/gauge-chart/{gauge-chart-widget-edit.component.d.ts → gauge-chart-widget.component.d.ts} +3 -3
- package/widgets/lib/widgets/charts/gauge-chart/gauge-chart.type.d.ts +26 -11
- package/widgets/lib/widgets/charts/gauge-chart/index.d.ts +2 -1
- package/widgets/lib/widgets/charts/shared/chart-base.component.d.ts +44 -0
- package/widgets/lib/widgets/charts/shared/chart-base.type.d.ts +37 -0
- package/widgets/lib/widgets/charts/sticky-note/index.d.ts +1 -1
- package/widgets/lib/widgets/charts/sticky-note/{sticky-note-widget-edit.component.d.ts → sticky-note-widget.component.d.ts} +3 -3
- package/widgets/lib/widgets/charts/weather/index.d.ts +4 -0
- package/widgets/lib/widgets/charts/weather/weather-services/index.d.ts +3 -0
- package/widgets/lib/widgets/charts/weather/weather-services/weather-api.abstract.d.ts +174 -0
- package/widgets/lib/widgets/charts/weather/weather-services/weather-api.key.d.ts +2 -0
- package/widgets/lib/widgets/charts/weather/weather-services/weather-api.mock.service.d.ts +47 -0
- package/widgets/lib/widgets/charts/weather/weather-services/weather-api.service.d.ts +48 -0
- package/widgets/lib/widgets/charts/weather/weather-widget.component.d.ts +109 -0
- package/widgets/lib/widgets/charts/weather/weather-widget.config.d.ts +14 -0
- package/widgets/lib/widgets/charts/weather/weather.module.d.ts +11 -0
- package/widgets/lib/widgets/editors/select/select-box-widget-column.component.d.ts +0 -1
- package/widgets/lib/widgets/editors/select/select-box-widget-edit.component.d.ts +4 -1
- package/widgets/lib/widgets/editors/template-box/index.d.ts +6 -0
- package/widgets/lib/widgets/editors/template-box/template-box-widget-column.component.d.ts +10 -0
- package/widgets/lib/widgets/editors/template-box/template-box-widget-edit.component.d.ts +29 -0
- package/widgets/lib/widgets/editors/template-box/template-box-widget-filter.component.d.ts +6 -0
- package/widgets/lib/widgets/editors/template-box/template-box-widget-print.component.d.ts +10 -0
- package/widgets/lib/widgets/editors/template-box/template-box-widget-view.component.d.ts +11 -0
- package/widgets/lib/widgets/editors/template-box/template-box-widget.config.d.ts +7 -0
- package/widgets/lib/widgets/filters/select-filter/select-filter-widget-edit.component.d.ts +2 -5
- package/widgets/lib/widgets/index.d.ts +3 -0
- package/core/lib/types.d.ts +0 -57
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-LKhN00ob.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CdC4eF25.mjs +0 -400
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CdC4eF25.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-B9TUh-2S.mjs +0 -91
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-B9TUh-2S.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-ZfUaIxUa.mjs +0 -135
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-ZfUaIxUa.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-setting-page.component-Cd2yaPEZ.mjs +0 -74
- package/fesm2022/acorex-platform-themes-default-setting-page.component-Cd2yaPEZ.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-setting-view.component-B3Aob67f.mjs +0 -73
- package/fesm2022/acorex-platform-themes-default-setting-view.component-B3Aob67f.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-DqAngWCf.mjs +0 -146
- package/fesm2022/acorex-platform-themes-default-theme-palette-preview.page-DqAngWCf.mjs.map +0 -1
- package/layout/builder/lib/builder/widget-groups.d.ts +0 -9
- package/layout/entity/lib/dexie-storage.service.d.ts +0 -16
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-filter.component.d.ts +0 -6
- package/layout/entity/lib/widgets/lookup-widget/lookup-widget-print.component.d.ts +0 -6
- package/themes/default/lib/layouts/filters-layout/simple-filter-builder/filters-view.component.d.ts +0 -13
- package/themes/shared/lib/components/drawer/drawer.directive.d.ts +0 -22
- package/themes/shared/lib/components/drawer/index.d.ts +0 -1
- package/themes/shared/lib/widgets/theme-color-selection/index.d.ts +0 -2
- package/themes/shared/lib/widgets/theme-color-selection/theme-color-selection-widget-edit.component.d.ts +0 -6
- package/widgets/lib/widgets/charts/bar-chart/bar-chart-widget-edit.component.d.ts +0 -40
- package/widgets/lib/widgets/charts/donut-chart/donut-chart-widget-edit.component.d.ts +0 -44
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { AXDialogService } from '@acorex/components/dialog';
|
|
2
|
-
import { AXToastService } from '@acorex/components/toast';
|
|
3
1
|
import * as i1 from '@acorex/platform/common';
|
|
4
|
-
import {
|
|
5
|
-
import { AXHighlightService } from '@acorex/platform/core';
|
|
2
|
+
import { AXPSettingDefinitionProviderService, AXPSettingService, AXP_SEARCH_PROVIDER, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
|
6
3
|
import { AXPPageStatus } from '@acorex/platform/layout/builder';
|
|
7
4
|
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
|
8
5
|
import * as i0 from '@angular/core';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { filter
|
|
6
|
+
import { computed, inject, NgModule } from '@angular/core';
|
|
7
|
+
import { signalStore, withState, withComputed, withMethods, patchState, withHooks } from '@ngrx/signals';
|
|
8
|
+
import { get, isEqual, isNil, isEmpty, sortBy } from 'lodash-es';
|
|
9
|
+
import { filter } from 'rxjs';
|
|
10
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
11
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
12
|
+
import { resolvePlatformScopeName, AXPPlatformScope } from '@acorex/platform/core';
|
|
13
13
|
import { AXPSessionService } from '@acorex/platform/auth';
|
|
14
14
|
|
|
15
15
|
function searchSettings(groups, search) {
|
|
@@ -58,306 +58,239 @@ function searchSettings(groups, search) {
|
|
|
58
58
|
return [...sectionMatchResult, ...settingMatchResult];
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
this.isSaving = signal(false);
|
|
92
|
-
this.isBusy = signal(false);
|
|
93
|
-
this.activateGroup = signal(undefined);
|
|
94
|
-
this.activeScope = signal('U');
|
|
95
|
-
this.loadedItems = signal(null);
|
|
96
|
-
this.scopeName = () => {
|
|
97
|
-
return this.activatedRoute?.snapshot?.paramMap?.get('scope')?.trim().toLowerCase() ?? 'user';
|
|
98
|
-
};
|
|
99
|
-
this.title = computed(() => {
|
|
100
|
-
// fake change detect simulate
|
|
101
|
-
this.activeScope();
|
|
102
|
-
//
|
|
103
|
-
return `settings.${this.scopeName()}.title`;
|
|
61
|
+
const AXPSettingsViewModel = signalStore(withState(() => ({
|
|
62
|
+
groups: [],
|
|
63
|
+
activateGroup: undefined,
|
|
64
|
+
scope: 'U',
|
|
65
|
+
//
|
|
66
|
+
searchExpression: null,
|
|
67
|
+
//
|
|
68
|
+
previousContext: {},
|
|
69
|
+
context: {},
|
|
70
|
+
//
|
|
71
|
+
status: AXPPageStatus.Processing,
|
|
72
|
+
form: null,
|
|
73
|
+
})), withComputed((store, layout = inject(AXPLayoutThemeService)) => ({
|
|
74
|
+
searchResults: computed(() => searchSettings(store.groups(), store.searchExpression())),
|
|
75
|
+
hasActivateGroup: computed(() => store.activateGroup() != null),
|
|
76
|
+
showGroups: computed(() => store.activateGroup() != null && layout.isLarge()),
|
|
77
|
+
scopeTitle: computed(() => {
|
|
78
|
+
return `${resolvePlatformScopeName(store.scope())}.title`;
|
|
79
|
+
}),
|
|
80
|
+
scopeDescription: computed(() => {
|
|
81
|
+
return `${resolvePlatformScopeName(store.scope())}.description`;
|
|
82
|
+
}),
|
|
83
|
+
isSearching: computed(() => store.searchExpression() != null),
|
|
84
|
+
isBusy: computed(() => store.status() == AXPPageStatus.Processing),
|
|
85
|
+
isSaving: computed(() => store.status() == AXPPageStatus.Submitting),
|
|
86
|
+
isLoaded: computed(() => store.groups().length > 0),
|
|
87
|
+
})), withMethods((store, settingDefinitionService = inject(AXPSettingDefinitionProviderService), settingValueService = inject(AXPSettingService), toastService = inject(AXToastService), translateService = inject(AXTranslationService)) => ({
|
|
88
|
+
registerForm(form) {
|
|
89
|
+
patchState(store, {
|
|
90
|
+
form: form,
|
|
104
91
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return null;
|
|
111
|
-
}
|
|
92
|
+
},
|
|
93
|
+
async load(scope) {
|
|
94
|
+
patchState(store, {
|
|
95
|
+
scope: scope,
|
|
96
|
+
status: AXPPageStatus.Processing,
|
|
112
97
|
});
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this.searchResult.set(searchSettings(this.loadedItems(), this.searchExpression()));
|
|
118
|
-
}
|
|
98
|
+
//
|
|
99
|
+
const groups = await settingDefinitionService.getListAsync(scope);
|
|
100
|
+
patchState(store, {
|
|
101
|
+
groups: groups,
|
|
119
102
|
});
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const currentValue = e.values[k];
|
|
125
|
-
const contextValue = get(this.context(), k);
|
|
126
|
-
const previousValue = get(this.previousContext(), k);
|
|
127
|
-
// Update only if there are actual changes
|
|
128
|
-
if (!isEqual(previousValue, currentValue) || !isEqual(currentValue, contextValue)) {
|
|
129
|
-
this.previousContext.update((prev) => ({
|
|
130
|
-
...prev,
|
|
131
|
-
[k]: currentValue, // Use backend-provided value
|
|
132
|
-
}));
|
|
133
|
-
this.context.update((ctx) => ({
|
|
134
|
-
...ctx,
|
|
135
|
-
[k]: currentValue,
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
});
|
|
103
|
+
const currentContext = await settingValueService.scope(scope).all();
|
|
104
|
+
const defaults = await settingValueService.scope(scope).defaultValues();
|
|
105
|
+
patchState(store, {
|
|
106
|
+
context: { ...defaults, ...currentContext },
|
|
139
107
|
});
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
await this.updateGroupParam();
|
|
108
|
+
patchState(store, {
|
|
109
|
+
previousContext: store.context(),
|
|
110
|
+
status: AXPPageStatus.Rendered,
|
|
144
111
|
});
|
|
145
|
-
}
|
|
146
|
-
async
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
//
|
|
157
|
-
await this.updateGroupParam();
|
|
158
|
-
if (!this.activateGroup() && this.layout.isLarge() && !this.isSearching()) {
|
|
159
|
-
await this.redirectToFirstGroup();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
async updateGroupParam() {
|
|
163
|
-
const query = this.activatedRoute.snapshot.queryParams['q'];
|
|
164
|
-
const scope = this.resolveScope();
|
|
165
|
-
const group = this.activatedRoute.snapshot.paramMap.get('group');
|
|
166
|
-
if ((this.activeScope() && this.activeScope() != scope) || this.activateGroup() != group) {
|
|
167
|
-
this.activateGroup.set(undefined);
|
|
168
|
-
await this.load();
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
if (this.isValidQuery(query)) {
|
|
172
|
-
this.searchExpression.set(query);
|
|
173
|
-
}
|
|
174
|
-
if (this.isSearching()) {
|
|
175
|
-
setTimeout(() => {
|
|
176
|
-
this.highlightService.highlight('#ax-settings', this.searchExpression());
|
|
177
|
-
}, 100);
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
this.highlightService.clear();
|
|
181
|
-
}
|
|
182
|
-
// If no child routes exist, set activateGroup to undefined
|
|
183
|
-
if (this.activatedRoute.children.length === 0) {
|
|
184
|
-
this.activateGroup.set(undefined);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
// Traverse child routes to check for the group parameter
|
|
188
|
-
for (const childRoute of this.activatedRoute.children) {
|
|
189
|
-
const params = await childRoute.paramMap.pipe(take(1)).toPromise();
|
|
190
|
-
const group = params?.get('group');
|
|
191
|
-
if (group) {
|
|
192
|
-
this.activateGroup.set(group);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
async redirectToFirstGroup() {
|
|
197
|
-
const firstGroup = this.determineFirstGroup();
|
|
198
|
-
if (firstGroup) {
|
|
199
|
-
const app = this.activatedRoute.snapshot.params['app'];
|
|
200
|
-
const scope = this.activatedRoute.snapshot.params['scope'];
|
|
201
|
-
await this.router.navigate([app, 'settings', scope, firstGroup], { replaceUrl: true });
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
async navigateUpLevel() {
|
|
205
|
-
const func = async () => {
|
|
206
|
-
const app = this.activatedRoute.snapshot.params['app'];
|
|
207
|
-
const scope = this.activatedRoute.snapshot.params['scope'];
|
|
208
|
-
await this.router.navigate([app, 'settings', scope]);
|
|
209
|
-
};
|
|
210
|
-
if (this.isDirty()) {
|
|
211
|
-
const dialogResult = await this.dialogService.confirm('Unsaved Changes', 'You have unsaved changes. Are you sure you want to go back without saving?', 'warning');
|
|
212
|
-
if (dialogResult.result) {
|
|
213
|
-
await func();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
else {
|
|
217
|
-
await func();
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
determineFirstGroup() {
|
|
221
|
-
const groups = this.loadedItems();
|
|
222
|
-
return groups && groups.length > 0 ? groups[0].name : null;
|
|
223
|
-
}
|
|
224
|
-
handleSelectGroup(item) {
|
|
225
|
-
this.router.navigate([`${item.name}`], { relativeTo: this.activatedRoute });
|
|
226
|
-
this.searchExpression.set('');
|
|
227
|
-
}
|
|
228
|
-
async handleContextChanged(e) {
|
|
229
|
-
if (e.state == 'initiated') {
|
|
230
|
-
this.previousContext.set(e.data);
|
|
112
|
+
},
|
|
113
|
+
async reload() {
|
|
114
|
+
await settingDefinitionService.reload();
|
|
115
|
+
const groups = await settingDefinitionService.getListAsync(store.scope());
|
|
116
|
+
const oldActivateGroupName = store.activateGroup()?.name;
|
|
117
|
+
patchState(store, {
|
|
118
|
+
groups: groups,
|
|
119
|
+
activateGroup: undefined,
|
|
120
|
+
});
|
|
121
|
+
if (oldActivateGroupName) {
|
|
122
|
+
this.setActivateGroupByName(oldActivateGroupName);
|
|
231
123
|
}
|
|
232
|
-
|
|
233
|
-
|
|
124
|
+
},
|
|
125
|
+
updateContext(context) {
|
|
126
|
+
patchState(store, {
|
|
127
|
+
context: { ...store.context(), ...context },
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
updatePreviousContext(context) {
|
|
131
|
+
patchState(store, {
|
|
132
|
+
previousContext: { ...store.previousContext(), ...context },
|
|
133
|
+
});
|
|
134
|
+
},
|
|
135
|
+
setActivateGroup(group) {
|
|
136
|
+
patchState(store, {
|
|
137
|
+
activateGroup: group,
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
unloadActivateGroup() {
|
|
141
|
+
patchState(store, {
|
|
142
|
+
activateGroup: undefined,
|
|
143
|
+
});
|
|
144
|
+
},
|
|
145
|
+
setActivateGroupByName(name) {
|
|
146
|
+
const group = store.groups().find(g => g.name === name);
|
|
147
|
+
if (group) {
|
|
148
|
+
patchState(store, {
|
|
149
|
+
activateGroup: group,
|
|
150
|
+
});
|
|
234
151
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
152
|
+
},
|
|
153
|
+
//
|
|
154
|
+
async search(expression) {
|
|
155
|
+
debugger;
|
|
156
|
+
if (!isNil(expression) && !isEmpty(expression)) {
|
|
157
|
+
patchState(store, {
|
|
158
|
+
searchExpression: expression,
|
|
159
|
+
});
|
|
241
160
|
}
|
|
242
161
|
else {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
const previousValue = get(this.previousContext(), setting.name);
|
|
247
|
-
return !isEqual(currentValue, previousValue);
|
|
248
|
-
}))) || false);
|
|
162
|
+
patchState(store, {
|
|
163
|
+
searchExpression: null,
|
|
164
|
+
});
|
|
249
165
|
}
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
|
|
166
|
+
},
|
|
167
|
+
clearSearch() {
|
|
168
|
+
patchState(store, {
|
|
169
|
+
searchExpression: null,
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
isDirty() {
|
|
173
|
+
return store.groups()?.some((group) => group.sections.some((sec) => sec.settings.some((setting) => {
|
|
174
|
+
const currentValue = get(store.context(), setting.name);
|
|
175
|
+
const previousValue = get(store.previousContext(), setting.name);
|
|
176
|
+
return !isEqual(currentValue, previousValue);
|
|
177
|
+
}))) || false;
|
|
178
|
+
},
|
|
179
|
+
async apply() {
|
|
180
|
+
const i18nScope = "settings";
|
|
253
181
|
try {
|
|
254
|
-
this.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
182
|
+
if (await store.form() && this.isDirty()) {
|
|
183
|
+
const form = store.form();
|
|
184
|
+
form.resetErrors();
|
|
185
|
+
//
|
|
186
|
+
patchState(store, {
|
|
187
|
+
status: AXPPageStatus.Submitting,
|
|
188
|
+
});
|
|
189
|
+
const formResult = await form.validate();
|
|
190
|
+
if (!formResult.result) {
|
|
191
|
+
toastService.show({
|
|
192
|
+
color: 'danger',
|
|
193
|
+
title: await translateService.translateAsync('actions.apply.invalid.title', { scope: i18nScope }),
|
|
194
|
+
content: await translateService.translateAsync('actions.apply.invalid.message', { scope: i18nScope }),
|
|
195
|
+
location: 'bottom-center',
|
|
196
|
+
closeButton: true,
|
|
197
|
+
timeOut: 3000,
|
|
198
|
+
timeOutProgress: true,
|
|
199
|
+
});
|
|
200
|
+
patchState(store, {
|
|
201
|
+
status: AXPPageStatus.Error,
|
|
202
|
+
});
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
await settingValueService.scope(store.scope()).set(store.context());
|
|
206
|
+
// Show success notification
|
|
207
|
+
toastService.show({
|
|
208
|
+
color: 'success',
|
|
209
|
+
title: await translateService.translateAsync('actions.apply.success.title', { scope: i18nScope }),
|
|
210
|
+
content: await translateService.translateAsync('actions.apply.success.message', { scope: i18nScope }),
|
|
262
211
|
location: 'bottom-center',
|
|
263
212
|
closeButton: true,
|
|
264
213
|
timeOut: 3000,
|
|
265
214
|
timeOutProgress: true,
|
|
266
215
|
});
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
return;
|
|
270
|
-
}
|
|
271
|
-
if (section) {
|
|
272
|
-
// Apply changes for the specific section
|
|
273
|
-
const changes = {};
|
|
274
|
-
section.settings.forEach((c) => {
|
|
275
|
-
changes[c.name] = get(this.context(), c.name);
|
|
216
|
+
patchState(store, {
|
|
217
|
+
status: AXPPageStatus.Submitted,
|
|
276
218
|
});
|
|
277
|
-
|
|
278
|
-
await this.settingValueService.scope(this.resolveScope()).set(changes);
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
// Save the settings
|
|
283
|
-
await this.settingValueService.scope(this.resolveScope()).set(this.context());
|
|
219
|
+
return true;
|
|
284
220
|
}
|
|
285
|
-
|
|
286
|
-
// Show success notification
|
|
287
|
-
this.toastService.show({
|
|
288
|
-
color: 'success',
|
|
289
|
-
title: 'Settings Saved',
|
|
290
|
-
content: 'Your changes have been saved successfully.',
|
|
291
|
-
location: 'bottom-center',
|
|
292
|
-
closeButton: true,
|
|
293
|
-
timeOut: 3000,
|
|
294
|
-
timeOutProgress: true,
|
|
295
|
-
});
|
|
221
|
+
return false;
|
|
296
222
|
}
|
|
297
223
|
catch (error) {
|
|
298
|
-
|
|
299
|
-
this.builder.setStatus(AXPPageStatus.Error);
|
|
300
|
-
console.error('Error saving settings:', error);
|
|
301
|
-
this.toastService.show({
|
|
224
|
+
toastService.show({
|
|
302
225
|
color: 'danger',
|
|
303
|
-
title:
|
|
304
|
-
content: error
|
|
226
|
+
title: await translateService.translateAsync('actions.apply.error.title', { scope: i18nScope }),
|
|
227
|
+
content: await translateService.translateAsync('actions.apply.error.message', { scope: i18nScope }),
|
|
305
228
|
location: 'bottom-center',
|
|
306
229
|
closeButton: true,
|
|
307
|
-
timeOut:
|
|
230
|
+
timeOut: 3000,
|
|
308
231
|
timeOutProgress: true,
|
|
309
232
|
});
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
this.isSaving.set(false);
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
// discard settings logic
|
|
316
|
-
async discard(section) {
|
|
317
|
-
this.form.resetErrors();
|
|
318
|
-
if (section) {
|
|
319
|
-
// Discard changes for the specific section
|
|
320
|
-
section.settings.forEach((c) => {
|
|
321
|
-
const previousValue = get(this.previousContext(), c.name);
|
|
322
|
-
this.context.update((ctx) => ({
|
|
323
|
-
...ctx,
|
|
324
|
-
[c.name]: previousValue,
|
|
325
|
-
}));
|
|
233
|
+
patchState(store, {
|
|
234
|
+
status: AXPPageStatus.Error,
|
|
326
235
|
});
|
|
236
|
+
return false;
|
|
327
237
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
238
|
+
},
|
|
239
|
+
async discard() {
|
|
240
|
+
const form = store.form();
|
|
241
|
+
form.resetErrors();
|
|
242
|
+
//
|
|
243
|
+
patchState(store, {
|
|
244
|
+
status: AXPPageStatus.Rendered,
|
|
245
|
+
});
|
|
246
|
+
patchState(store, {
|
|
247
|
+
context: store.previousContext(),
|
|
248
|
+
});
|
|
249
|
+
},
|
|
334
250
|
async resetToDefault() {
|
|
335
|
-
const defaults = await this.settingValueService.scope(this.resolveScope()).defaultValues();
|
|
336
251
|
// Update the context with the defaults
|
|
337
|
-
|
|
252
|
+
const defaults = await settingValueService.scope(store.scope()).defaultValues();
|
|
253
|
+
patchState(store, {
|
|
254
|
+
context: defaults,
|
|
255
|
+
});
|
|
338
256
|
//
|
|
339
|
-
await this.apply();
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
257
|
+
const result = await this.apply();
|
|
258
|
+
if (!result) {
|
|
259
|
+
this.discard();
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
})), withHooks((store, settingValueService = inject(AXPSettingService), translationService = inject(AXTranslationService)) => ({
|
|
263
|
+
async onInit() {
|
|
345
264
|
//
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
265
|
+
settingValueService.onChanged.pipe(filter((c) => c.scope == store.scope())).subscribe((e) => {
|
|
266
|
+
e.keys.forEach((k) => {
|
|
267
|
+
const currentValue = e.values[k];
|
|
268
|
+
const contextValue = get(store.context(), k);
|
|
269
|
+
const previousValue = get(store.previousContext(), k);
|
|
270
|
+
// Update only if there are actual changes
|
|
271
|
+
if (!isEqual(previousValue, currentValue) || !isEqual(currentValue, contextValue)) {
|
|
272
|
+
patchState(store, {
|
|
273
|
+
previousContext: {
|
|
274
|
+
...store.previousContext(),
|
|
275
|
+
[k]: currentValue,
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
patchState(store, {
|
|
279
|
+
context: {
|
|
280
|
+
...store.context(),
|
|
281
|
+
[k]: currentValue,
|
|
282
|
+
}
|
|
283
|
+
});
|
|
284
|
+
}
|
|
349
285
|
});
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
}
|
|
358
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXPSettingsViewModel, decorators: [{
|
|
359
|
-
type: Injectable
|
|
360
|
-
}], ctorParameters: () => [] });
|
|
286
|
+
});
|
|
287
|
+
//
|
|
288
|
+
translationService.langChanges$.subscribe(async () => {
|
|
289
|
+
await store.reload();
|
|
290
|
+
});
|
|
291
|
+
},
|
|
292
|
+
onDestroy() { },
|
|
293
|
+
})));
|
|
361
294
|
|
|
362
295
|
class AXPSettingSearchProvider {
|
|
363
296
|
constructor() {
|
|
@@ -365,9 +298,9 @@ class AXPSettingSearchProvider {
|
|
|
365
298
|
this.sessionService = inject(AXPSessionService);
|
|
366
299
|
}
|
|
367
300
|
async search(text) {
|
|
368
|
-
const groupsSetting = this.settingService.getList(
|
|
301
|
+
const groupsSetting = this.settingService.getList(AXPPlatformScope.User);
|
|
369
302
|
if (groupsSetting.length == 0) {
|
|
370
|
-
groupsSetting.push(...(await this.settingService.getListAsync(
|
|
303
|
+
groupsSetting.push(...(await this.settingService.getListAsync(AXPPlatformScope.User)));
|
|
371
304
|
}
|
|
372
305
|
// Step 2: Flatten settings from groups
|
|
373
306
|
const allSettings = [];
|