@acorex/platform 21.0.0-next.41 → 21.0.0-next.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/{acorex-platform-common-common-settings.provider-G9XcXXOG.mjs → acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs} +22 -24
- package/fesm2022/acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +115 -23
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +172 -19
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +164 -24
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +235 -15
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +40 -5
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +166 -8
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widgets.mjs +161 -130
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +65 -2
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs → acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs} +23 -24
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DK6R87Lf.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +2 -2
- package/package.json +1 -1
- package/types/acorex-platform-common.d.ts +38 -4
- package/types/acorex-platform-core.d.ts +20 -2
- package/types/acorex-platform-layout-builder.d.ts +63 -21
- package/types/acorex-platform-layout-components.d.ts +54 -3
- package/types/acorex-platform-layout-entity.d.ts +19 -2
- package/types/acorex-platform-layout-widgets.d.ts +19 -5
- package/types/acorex-platform-runtime.d.ts +6 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-D13QB3Hr.mjs.map +0 -1
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
import { AXTranslationService } from '@acorex/core/translation';
|
|
2
|
-
import { AXPPlatformScope } from '@acorex/platform/core';
|
|
3
|
-
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
4
1
|
import * as i0 from '@angular/core';
|
|
5
2
|
import { Injectable } from '@angular/core';
|
|
3
|
+
import { AXPPlatformScope } from '@acorex/platform/core';
|
|
4
|
+
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
6
5
|
import { AXPCommonSettings } from './acorex-platform-common.mjs';
|
|
7
6
|
|
|
7
|
+
const I18N = '@general:settings';
|
|
8
8
|
class AXPCommonSettingProvider {
|
|
9
|
-
constructor(
|
|
10
|
-
this.
|
|
11
|
-
this.translateService = this.injector.get(AXTranslationService);
|
|
9
|
+
constructor(_injector) {
|
|
10
|
+
this._injector = _injector;
|
|
12
11
|
}
|
|
13
12
|
async provide(context) {
|
|
14
|
-
const trans = async (key) => await this.translateService.translateAsync(`@general:settings.${key}`);
|
|
15
13
|
// Define the 'General Settings' group
|
|
16
14
|
context
|
|
17
15
|
.group('general')
|
|
18
|
-
?.addSection('notifications',
|
|
16
|
+
?.addSection('notifications', `${I18N}.general.notifications.title`, `${I18N}.general.notifications.description`)
|
|
19
17
|
// Add the 'Enable Operation Toasts' setting
|
|
20
18
|
.addSetting({
|
|
21
19
|
key: AXPCommonSettings.EnableOperationToasts,
|
|
22
|
-
title:
|
|
20
|
+
title: `${I18N}.general.notifications.enable-operation-toasts.title`,
|
|
23
21
|
scope: AXPPlatformScope.User,
|
|
24
22
|
isInherited: true,
|
|
25
23
|
defaultValue: true,
|
|
@@ -29,15 +27,15 @@ class AXPCommonSettingProvider {
|
|
|
29
27
|
label: null,
|
|
30
28
|
},
|
|
31
29
|
},
|
|
32
|
-
description:
|
|
30
|
+
description: `${I18N}.general.notifications.enable-operation-toasts.description`,
|
|
33
31
|
})
|
|
34
32
|
// End the 'Notifications' section
|
|
35
33
|
.endSection()
|
|
36
|
-
.addSection('entity',
|
|
34
|
+
.addSection('entity', `${I18N}.general.entity.title`, `${I18N}.general.entity.description`)
|
|
37
35
|
// Add the 'Enable Operation Toasts' setting
|
|
38
36
|
.addSetting({
|
|
39
37
|
key: AXPCommonSettings.EntityFilterApplyMode,
|
|
40
|
-
title:
|
|
38
|
+
title: `${I18N}.general.entity.filter-apply-mode.title`,
|
|
41
39
|
scope: AXPPlatformScope.User,
|
|
42
40
|
isInherited: true,
|
|
43
41
|
defaultValue: 'auto',
|
|
@@ -48,16 +46,16 @@ class AXPCommonSettingProvider {
|
|
|
48
46
|
valueField: 'value',
|
|
49
47
|
textField: 'text',
|
|
50
48
|
dataSource: [
|
|
51
|
-
{ value: 'auto', text:
|
|
52
|
-
{ value: 'manual', text:
|
|
49
|
+
{ value: 'auto', text: `${I18N}.general.entity.filter-apply-mode.options.auto` },
|
|
50
|
+
{ value: 'manual', text: `${I18N}.general.entity.filter-apply-mode.options.manual` },
|
|
53
51
|
],
|
|
54
52
|
},
|
|
55
53
|
},
|
|
56
|
-
description:
|
|
54
|
+
description: `${I18N}.general.entity.filter-apply-mode.description`,
|
|
57
55
|
})
|
|
58
56
|
.addSetting({
|
|
59
57
|
key: AXPCommonSettings.ShowCategoryColumnsByDefault,
|
|
60
|
-
title:
|
|
58
|
+
title: `${I18N}.general.entity.show-category-columns-by-default.title`,
|
|
61
59
|
scope: AXPPlatformScope.User,
|
|
62
60
|
isInherited: true,
|
|
63
61
|
defaultValue: false,
|
|
@@ -67,11 +65,11 @@ class AXPCommonSettingProvider {
|
|
|
67
65
|
label: null,
|
|
68
66
|
},
|
|
69
67
|
},
|
|
70
|
-
description:
|
|
68
|
+
description: `${I18N}.general.entity.show-category-columns-by-default.description`,
|
|
71
69
|
})
|
|
72
70
|
.addSetting({
|
|
73
71
|
key: AXPCommonSettings.ApplyLayoutOrdering,
|
|
74
|
-
title:
|
|
72
|
+
title: `${I18N}.general.entity.apply-layout-ordering.title`,
|
|
75
73
|
scope: AXPPlatformScope.User,
|
|
76
74
|
isInherited: true,
|
|
77
75
|
defaultValue: true,
|
|
@@ -81,11 +79,11 @@ class AXPCommonSettingProvider {
|
|
|
81
79
|
label: null,
|
|
82
80
|
},
|
|
83
81
|
},
|
|
84
|
-
description:
|
|
82
|
+
description: `${I18N}.general.entity.apply-layout-ordering.description`,
|
|
85
83
|
})
|
|
86
84
|
.addSetting({
|
|
87
85
|
key: AXPCommonSettings.RedirectToDetailsAfterCreate,
|
|
88
|
-
title:
|
|
86
|
+
title: `${I18N}.general.entity.redirect-to-details-after-create.title`,
|
|
89
87
|
scope: AXPPlatformScope.User,
|
|
90
88
|
isInherited: true,
|
|
91
89
|
defaultValue: true,
|
|
@@ -95,11 +93,11 @@ class AXPCommonSettingProvider {
|
|
|
95
93
|
label: null,
|
|
96
94
|
},
|
|
97
95
|
},
|
|
98
|
-
description:
|
|
96
|
+
description: `${I18N}.general.entity.redirect-to-details-after-create.description`,
|
|
99
97
|
})
|
|
100
98
|
.addSetting({
|
|
101
99
|
key: AXPCommonSettings.ShowPageBadge,
|
|
102
|
-
title:
|
|
100
|
+
title: `${I18N}.general.entity.show-page-badge.title`,
|
|
103
101
|
scope: AXPPlatformScope.User,
|
|
104
102
|
isInherited: true,
|
|
105
103
|
defaultValue: true,
|
|
@@ -109,7 +107,7 @@ class AXPCommonSettingProvider {
|
|
|
109
107
|
label: null,
|
|
110
108
|
},
|
|
111
109
|
},
|
|
112
|
-
description:
|
|
110
|
+
description: `${I18N}.general.entity.show-page-badge.description`,
|
|
113
111
|
})
|
|
114
112
|
// End the 'Entity Settings' section
|
|
115
113
|
.endSection()
|
|
@@ -124,4 +122,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
124
122
|
}], ctorParameters: () => [{ type: i0.Injector }] });
|
|
125
123
|
|
|
126
124
|
export { AXPCommonSettingProvider };
|
|
127
|
-
//# sourceMappingURL=acorex-platform-common-common-settings.provider-
|
|
125
|
+
//# sourceMappingURL=acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs","sources":["../../../../libs/platform/common/src/lib/configs/common-settings.provider.ts"],"sourcesContent":["import { Injectable, Injector } from '@angular/core';\nimport { AXPPlatformScope } from '@acorex/platform/core';\nimport { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';\nimport { AXPSettingDefinitionProvider, AXPSettingDefinitionProviderContext } from '../settings';\nimport { AXPCommonSettings } from './common-settings.key';\n\nconst I18N = '@general:settings';\n\n@Injectable()\nexport class AXPCommonSettingProvider implements AXPSettingDefinitionProvider {\n constructor(private _injector: Injector) {}\n\n async provide(context: AXPSettingDefinitionProviderContext): Promise<void> {\n // Define the 'General Settings' group\n context\n .group('general')\n ?.addSection(\n 'notifications',\n `${I18N}.general.notifications.title`,\n `${I18N}.general.notifications.description`,\n )\n // Add the 'Enable Operation Toasts' setting\n .addSetting({\n key: AXPCommonSettings.EnableOperationToasts,\n title: `${I18N}.general.notifications.enable-operation-toasts.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n\n description: `${I18N}.general.notifications.enable-operation-toasts.description`,\n })\n\n // End the 'Notifications' section\n .endSection()\n .addSection('entity', `${I18N}.general.entity.title`, `${I18N}.general.entity.description`)\n // Add the 'Enable Operation Toasts' setting\n .addSetting({\n key: AXPCommonSettings.EntityFilterApplyMode,\n title: `${I18N}.general.entity.filter-apply-mode.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: 'auto',\n widget: {\n type: AXPWidgetsCatalog.select,\n options: {\n label: null,\n valueField: 'value',\n textField: 'text',\n dataSource: [\n { value: 'auto', text: `${I18N}.general.entity.filter-apply-mode.options.auto` },\n { value: 'manual', text: `${I18N}.general.entity.filter-apply-mode.options.manual` },\n ],\n },\n },\n\n description: `${I18N}.general.entity.filter-apply-mode.description`,\n })\n .addSetting({\n key: AXPCommonSettings.ShowCategoryColumnsByDefault,\n title: `${I18N}.general.entity.show-category-columns-by-default.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: false,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.show-category-columns-by-default.description`,\n })\n .addSetting({\n key: AXPCommonSettings.ApplyLayoutOrdering,\n title: `${I18N}.general.entity.apply-layout-ordering.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.apply-layout-ordering.description`,\n })\n .addSetting({\n key: AXPCommonSettings.RedirectToDetailsAfterCreate,\n title: `${I18N}.general.entity.redirect-to-details-after-create.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.redirect-to-details-after-create.description`,\n })\n .addSetting({\n key: AXPCommonSettings.ShowPageBadge,\n title: `${I18N}.general.entity.show-page-badge.title`,\n scope: AXPPlatformScope.User,\n isInherited: true,\n defaultValue: true,\n widget: {\n type: AXPWidgetsCatalog.toggle,\n options: {\n label: null,\n },\n },\n description: `${I18N}.general.entity.show-page-badge.description`,\n })\n\n // End the 'Entity Settings' section\n .endSection()\n // End the 'General Settings' group\n .endGroup();\n }\n}\n"],"names":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/router';
|
|
5
5
|
import { AXPSessionService, AXPSessionStatus } from '@acorex/platform/auth';
|
|
6
6
|
import { Subject, distinctUntilChanged, merge as merge$1 } from 'rxjs';
|
|
7
|
-
import { AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPHookService, AXPDataGenerator, AXPModuleManifestRegistry } from '@acorex/platform/core';
|
|
8
|
-
import { AXTranslationService } from '@acorex/core/translation';
|
|
7
|
+
import { unwrapValueProperty, coerceUnknownToDate, coerceUnknownToFiniteNumber, coerceUnknownToBoolean, coerceUnknownToTrimmedString, AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPHookService, AXPDataGenerator, AXPModuleManifestRegistry } from '@acorex/platform/core';
|
|
9
8
|
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
|
|
10
9
|
import { AXPopupModule, AXPopupService } from '@acorex/components/popup';
|
|
11
10
|
import { AXToastService, AXToastModule } from '@acorex/components/toast';
|
|
@@ -15,6 +14,7 @@ import { AXPWorkflowService, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflow
|
|
|
15
14
|
import { AXDataSource } from '@acorex/cdk/common';
|
|
16
15
|
import { AXPCommandExecutor, AXPCommandService } from '@acorex/platform/runtime';
|
|
17
16
|
import { signalStore, withState, withMethods, patchState, withHooks } from '@ngrx/signals';
|
|
17
|
+
import { AXTranslationService } from '@acorex/core/translation';
|
|
18
18
|
import { AXFormatService } from '@acorex/core/format';
|
|
19
19
|
import { AXDialogService } from '@acorex/components/dialog';
|
|
20
20
|
import { AXFileService } from '@acorex/core/file';
|
|
@@ -239,6 +239,70 @@ var AXPRegionalSetting;
|
|
|
239
239
|
AXPRegionalSetting["MultiLanguageSupport"] = "LocaleManagement:Setting:Regional.MultiLanguageSupport";
|
|
240
240
|
})(AXPRegionalSetting || (AXPRegionalSetting = {}));
|
|
241
241
|
|
|
242
|
+
//#region ---- Imports ----
|
|
243
|
+
//#endregion
|
|
244
|
+
//#region ---- Kind inference ----
|
|
245
|
+
/**
|
|
246
|
+
* If the payload uses the common `{ value: T }` shape from setting widgets, returns the inner value; otherwise returns `raw`.
|
|
247
|
+
*/
|
|
248
|
+
function peelSettingValueKey(raw) {
|
|
249
|
+
return unwrapValueProperty(raw);
|
|
250
|
+
}
|
|
251
|
+
function coercionKindFromScalarSample(v) {
|
|
252
|
+
if (v === null || v === undefined) {
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
if (typeof v === 'boolean') {
|
|
256
|
+
return 'boolean';
|
|
257
|
+
}
|
|
258
|
+
if (typeof v === 'number' && Number.isFinite(v)) {
|
|
259
|
+
return 'number';
|
|
260
|
+
}
|
|
261
|
+
if (v instanceof Date) {
|
|
262
|
+
return 'date';
|
|
263
|
+
}
|
|
264
|
+
if (typeof v === 'string') {
|
|
265
|
+
if (v === 'true' || v === 'false') {
|
|
266
|
+
return 'boolean';
|
|
267
|
+
}
|
|
268
|
+
return 'string';
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Picks a primitive coercion kind from the setting definition default and/or the effective stored value.
|
|
274
|
+
* Type argument `T` on the settings service `get` method is compile-time only; runtime behavior follows this inference.
|
|
275
|
+
*/
|
|
276
|
+
function inferSettingCoercionKind(defaultSample, effective) {
|
|
277
|
+
const fromDefault = coercionKindFromScalarSample(defaultSample);
|
|
278
|
+
if (fromDefault) {
|
|
279
|
+
return fromDefault;
|
|
280
|
+
}
|
|
281
|
+
return coercionKindFromScalarSample(unwrapValueProperty(effective));
|
|
282
|
+
}
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region ---- Value coercion ----
|
|
285
|
+
function coerceAXPSettingRawValueByKind(raw, kind) {
|
|
286
|
+
switch (kind) {
|
|
287
|
+
case 'string':
|
|
288
|
+
return coerceUnknownToTrimmedString(raw);
|
|
289
|
+
case 'boolean':
|
|
290
|
+
return coerceUnknownToBoolean(raw);
|
|
291
|
+
case 'number':
|
|
292
|
+
return coerceUnknownToFiniteNumber(raw);
|
|
293
|
+
case 'date':
|
|
294
|
+
return coerceUnknownToDate(raw);
|
|
295
|
+
default: {
|
|
296
|
+
const _exhaustive = kind;
|
|
297
|
+
return _exhaustive;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
function coerceAXPSettingRawValue(raw, kind) {
|
|
302
|
+
return coerceAXPSettingRawValueByKind(raw, kind);
|
|
303
|
+
}
|
|
304
|
+
//#endregion
|
|
305
|
+
|
|
242
306
|
const AXP_SETTING_VALUE_PROVIDER = new InjectionToken('AXP_SETTING_VALUE_PROVIDER', {
|
|
243
307
|
providedIn: 'root',
|
|
244
308
|
factory: () => {
|
|
@@ -328,10 +392,11 @@ class AXPSettingDefinitionProviderContext {
|
|
|
328
392
|
this.rootGroups = [];
|
|
329
393
|
this.groupMap = new Map();
|
|
330
394
|
}
|
|
331
|
-
addGroup(name, title, description, icon) {
|
|
395
|
+
addGroup(name, title, description, icon, pageTitle) {
|
|
332
396
|
const newGroup = {
|
|
333
397
|
name,
|
|
334
398
|
title,
|
|
399
|
+
pageTitle,
|
|
335
400
|
description,
|
|
336
401
|
icon,
|
|
337
402
|
groups: [],
|
|
@@ -382,10 +447,11 @@ class AXPSettingDefinitionGroupBuilder {
|
|
|
382
447
|
}
|
|
383
448
|
return new AXPSettingDefinitionSectionBuilder(this, foundSection);
|
|
384
449
|
}
|
|
385
|
-
addGroup(name, title, description, icon) {
|
|
450
|
+
addGroup(name, title, description, icon, pageTitle) {
|
|
386
451
|
const newGroup = {
|
|
387
452
|
name,
|
|
388
453
|
title,
|
|
454
|
+
pageTitle,
|
|
389
455
|
description: description,
|
|
390
456
|
icon,
|
|
391
457
|
groups: [],
|
|
@@ -412,6 +478,7 @@ class AXPSettingDefinitionSectionBuilder {
|
|
|
412
478
|
name: setting.key,
|
|
413
479
|
title: setting.title,
|
|
414
480
|
description: setting.description,
|
|
481
|
+
searchTagKeys: setting.searchTagKeys,
|
|
415
482
|
isRequired: setting.isRequired ?? false,
|
|
416
483
|
isInherited: setting.isInherited ?? false,
|
|
417
484
|
isEncrypted: setting.isEncrypted ?? false,
|
|
@@ -654,26 +721,42 @@ class AXPSettingsService {
|
|
|
654
721
|
throw error;
|
|
655
722
|
}
|
|
656
723
|
}
|
|
724
|
+
/**
|
|
725
|
+
* Returns the effective setting value. Primitive coercion (string, boolean, number, date) is inferred from the
|
|
726
|
+
* definition default and/or the stored shape (including `{ value: ... }`). Type argument `T` is compile-time only;
|
|
727
|
+
* it is not read at runtime—use it to document the expected result (e.g. `get<boolean>(key)`).
|
|
728
|
+
*/
|
|
657
729
|
async get(key) {
|
|
730
|
+
const { effective, defaultSample } = await this.resolveEffectiveAndDefault(key);
|
|
731
|
+
const kind = inferSettingCoercionKind(defaultSample, effective);
|
|
732
|
+
if (kind !== null) {
|
|
733
|
+
return coerceAXPSettingRawValueByKind(effective, kind);
|
|
734
|
+
}
|
|
735
|
+
if (effective === undefined) {
|
|
736
|
+
return effective;
|
|
737
|
+
}
|
|
738
|
+
return cloneDeep(effective);
|
|
739
|
+
}
|
|
740
|
+
/**
|
|
741
|
+
* Effective value (user → tenant → platform) when set; otherwise the definition default. Used for reads and coercion hints.
|
|
742
|
+
*/
|
|
743
|
+
async resolveEffectiveAndDefault(key) {
|
|
658
744
|
if (this.scopedSettingsCache.size === 0) {
|
|
659
745
|
await this.load();
|
|
660
746
|
}
|
|
661
|
-
const
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
AXPPlatformScope.Platform,
|
|
665
|
-
];
|
|
747
|
+
const defaults = await this.injector.get(AXPSettingDefaultValuesAggregatorService).getDefaults();
|
|
748
|
+
const defaultSample = get(defaults, key);
|
|
749
|
+
const scopeOrder = [AXPPlatformScope.User, AXPPlatformScope.Tenant, AXPPlatformScope.Platform];
|
|
666
750
|
for (const scope of scopeOrder) {
|
|
667
751
|
const scopeCache = this.scopedSettingsCache.get(scope);
|
|
668
752
|
if (scopeCache && scopeCache.has(key)) {
|
|
669
753
|
const value = scopeCache.get(key);
|
|
670
754
|
if (value !== undefined && value !== null) {
|
|
671
|
-
return
|
|
755
|
+
return { effective: value, defaultSample };
|
|
672
756
|
}
|
|
673
757
|
}
|
|
674
758
|
}
|
|
675
|
-
|
|
676
|
-
return get(defaults, key); // Fallback if no value is found
|
|
759
|
+
return { effective: defaultSample, defaultSample };
|
|
677
760
|
}
|
|
678
761
|
async defaultValues(scope) {
|
|
679
762
|
let scopeOrder = [
|
|
@@ -732,7 +815,17 @@ class ScopedSettingService {
|
|
|
732
815
|
async get(key) {
|
|
733
816
|
const settings = await this.provider.load();
|
|
734
817
|
const setting = settings.find((s) => s.key === key);
|
|
735
|
-
|
|
818
|
+
const effective = setting?.value;
|
|
819
|
+
const defaults = await this.parent.defaultValues(this.provider.scope);
|
|
820
|
+
const defaultSample = get(defaults, key);
|
|
821
|
+
const kind = inferSettingCoercionKind(defaultSample, effective);
|
|
822
|
+
if (kind !== null) {
|
|
823
|
+
return coerceAXPSettingRawValueByKind(effective, kind);
|
|
824
|
+
}
|
|
825
|
+
if (effective === undefined) {
|
|
826
|
+
return effective;
|
|
827
|
+
}
|
|
828
|
+
return cloneDeep(effective);
|
|
736
829
|
}
|
|
737
830
|
async all() {
|
|
738
831
|
const settings = await this.provider.load();
|
|
@@ -1129,28 +1222,27 @@ function provideDynamicHomePage() {
|
|
|
1129
1222
|
]);
|
|
1130
1223
|
}
|
|
1131
1224
|
|
|
1225
|
+
const I18N = '@general:settings';
|
|
1132
1226
|
class AXPHomePageSettingProvider {
|
|
1133
1227
|
constructor(injector) {
|
|
1134
1228
|
this.injector = injector;
|
|
1135
|
-
this.translateService = this.injector.get(AXTranslationService);
|
|
1136
1229
|
this.homePageService = this.injector.get(AXPHomePageService);
|
|
1137
1230
|
this.defaultHomePageKey = inject(AXP_HOME_PAGE_DEFAULT_KEY, { optional: true }) ?? 'home';
|
|
1138
1231
|
}
|
|
1139
1232
|
async provide(context) {
|
|
1140
|
-
const
|
|
1141
|
-
const list = await this.homePageService.getRegisteredList().map((c) => ({ id: c.key, title: c.title }));
|
|
1233
|
+
const list = this.homePageService.getRegisteredList().map((c) => ({ id: c.key, title: c.title }));
|
|
1142
1234
|
if (list.length === 0) {
|
|
1143
1235
|
return;
|
|
1144
1236
|
}
|
|
1145
1237
|
// Define the 'General Settings' group
|
|
1146
1238
|
context
|
|
1147
|
-
.addGroup('general',
|
|
1239
|
+
.addGroup('general', `${I18N}.general.nav-title`, `${I18N}.general.description`, 'fa-light fa-palette', `${I18N}.general.title`)
|
|
1148
1240
|
// Add the 'Startup' section
|
|
1149
|
-
.addSection('startup',
|
|
1241
|
+
.addSection('startup', `${I18N}.general.startup.title`, `${I18N}.general.startup.description`)
|
|
1150
1242
|
// Add the 'Home Page' setting
|
|
1151
1243
|
.addSetting({
|
|
1152
1244
|
key: AXPHomePageSettings.UserHomePath,
|
|
1153
|
-
title:
|
|
1245
|
+
title: `${I18N}.general.startup.home-page.title`,
|
|
1154
1246
|
scope: AXPPlatformScope.User,
|
|
1155
1247
|
isInherited: true,
|
|
1156
1248
|
defaultValue: this.defaultHomePageKey || list[0].id,
|
|
@@ -1163,7 +1255,7 @@ class AXPHomePageSettingProvider {
|
|
|
1163
1255
|
dataSource: list,
|
|
1164
1256
|
},
|
|
1165
1257
|
},
|
|
1166
|
-
description:
|
|
1258
|
+
description: `${I18N}.general.startup.home-page.description`,
|
|
1167
1259
|
})
|
|
1168
1260
|
// End the 'Startup' section
|
|
1169
1261
|
.endSection()
|
|
@@ -3339,7 +3431,7 @@ class AXPCommonModule {
|
|
|
3339
3431
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
|
3340
3432
|
useFactory: async () => {
|
|
3341
3433
|
const injector = inject(Injector);
|
|
3342
|
-
const provider = (await import('./acorex-platform-common-common-settings.provider-
|
|
3434
|
+
const provider = (await import('./acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs')).AXPCommonSettingProvider;
|
|
3343
3435
|
return new provider(injector);
|
|
3344
3436
|
},
|
|
3345
3437
|
multi: true,
|
|
@@ -3419,7 +3511,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
3419
3511
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
|
3420
3512
|
useFactory: async () => {
|
|
3421
3513
|
const injector = inject(Injector);
|
|
3422
|
-
const provider = (await import('./acorex-platform-common-common-settings.provider-
|
|
3514
|
+
const provider = (await import('./acorex-platform-common-common-settings.provider-lWz_f-Ia.mjs')).AXPCommonSettingProvider;
|
|
3423
3515
|
return new provider(injector);
|
|
3424
3516
|
},
|
|
3425
3517
|
multi: true,
|
|
@@ -4619,5 +4711,5 @@ class AXPVersioningService {
|
|
|
4619
4711
|
* Generated bundle index. Do not edit.
|
|
4620
4712
|
*/
|
|
4621
4713
|
|
|
4622
|
-
export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDefaultMultiLanguageConfigService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPEntityType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileActionsService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuItemsDataSourceDefinition, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPMenuVisibilityService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRegionalSetting, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingsEvaluatorScopeProvider, AXPSettingsService, AXPStatusDefinitionProviderService, AXPStatusProvider, AXPStickyDirective, AXPSystemStatusType, AXPSystemStatuses, AXPToastAction, AXPTokenDefinitionService, AXPTokenEvaluatorScopeProvider, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_ACTION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_LOCALE_MANAGEMENT_PORT, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_STATUS_PROVIDERS, AXP_TOKEN_DEFINITION_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, DEFAULT_MULTILANGUAGE_FIELD_NAMES, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, MENU_ITEMS_DATASOURCE_NAME, MULTILANGUAGE_CAPABLE_WIDGET_TYPES, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, UploadFromComputerActionProvider, configPlatform, createAllQueryView, createEntityCommandOptions, createEntitySearchCommand, createMenuContext, createMenuMiddleware, createQueryView, getEntityInfo, getStatusInfo, getSystemStatus, provideDynamicHomePage, provideMenuMiddleware, resolveStatusLook, shouldApplyDefaultMultiLanguageToEntityProperty, shouldApplyDefaultMultiLanguageToWidgetNode, shouldApplyDefaultMultiLanguageToWidgetProperty, systemStatusToDefinition, withDefaultMultiLanguageOnWidgetNodeTree, withDefaultMultiLanguageOnWidgetProperty };
|
|
4714
|
+
export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDefaultMultiLanguageConfigService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPEntityType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileActionsService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuItemsDataSourceDefinition, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPMenuVisibilityService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRegionalSetting, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingsEvaluatorScopeProvider, AXPSettingsService, AXPStatusDefinitionProviderService, AXPStatusProvider, AXPStickyDirective, AXPSystemStatusType, AXPSystemStatuses, AXPToastAction, AXPTokenDefinitionService, AXPTokenEvaluatorScopeProvider, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_ACTION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_LOCALE_MANAGEMENT_PORT, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_STATUS_PROVIDERS, AXP_TOKEN_DEFINITION_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, DEFAULT_MULTILANGUAGE_FIELD_NAMES, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, MENU_ITEMS_DATASOURCE_NAME, MULTILANGUAGE_CAPABLE_WIDGET_TYPES, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, UploadFromComputerActionProvider, coerceAXPSettingRawValue, coerceAXPSettingRawValueByKind, configPlatform, createAllQueryView, createEntityCommandOptions, createEntitySearchCommand, createMenuContext, createMenuMiddleware, createQueryView, getEntityInfo, getStatusInfo, getSystemStatus, inferSettingCoercionKind, peelSettingValueKey, provideDynamicHomePage, provideMenuMiddleware, resolveStatusLook, shouldApplyDefaultMultiLanguageToEntityProperty, shouldApplyDefaultMultiLanguageToWidgetNode, shouldApplyDefaultMultiLanguageToWidgetProperty, systemStatusToDefinition, withDefaultMultiLanguageOnWidgetNodeTree, withDefaultMultiLanguageOnWidgetProperty };
|
|
4623
4715
|
//# sourceMappingURL=acorex-platform-common.mjs.map
|