@acorex/modules 19.4.10 → 19.4.12
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/content-management/README.md +3 -0
- package/content-management/index.d.ts +6 -0
- package/content-management/lib/const.d.ts +19 -0
- package/content-management/lib/content-management.module.d.ts +7 -0
- package/content-management/lib/entity.provider.d.ts +10 -0
- package/content-management/lib/menu.provider.d.ts +5 -0
- package/content-management/lib/permission-definition.provider.d.ts +4 -0
- package/content-management/lib/search-command.provider.d.ts +4 -0
- package/content-management/lib/setting.provider.d.ts +4 -0
- package/document-management/lib/features/shared/document-manager.service.d.ts +3 -0
- package/fesm2022/acorex-modules-content-management-acorex-modules-content-management-C23PlUCn.mjs +392 -0
- package/fesm2022/acorex-modules-content-management-acorex-modules-content-management-C23PlUCn.mjs.map +1 -0
- package/fesm2022/acorex-modules-content-management-promotion.entity-D3qRwZhQ.mjs +892 -0
- package/fesm2022/acorex-modules-content-management-promotion.entity-D3qRwZhQ.mjs.map +1 -0
- package/fesm2022/acorex-modules-content-management.mjs +2 -0
- package/fesm2022/acorex-modules-content-management.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-lAGMGi3Y.mjs → acorex-modules-document-management-acorex-modules-document-management-_tXLNsja.mjs} +20 -20
- package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-_tXLNsja.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-attachment-widget.component-DieghltT.mjs → acorex-modules-document-management-attachment-widget.component-BVOXu-Jt.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-attachment-widget.component-DieghltT.mjs.map → acorex-modules-document-management-attachment-widget.component-BVOXu-Jt.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-create-folder-dialog.component-Ddzknhp0.mjs → acorex-modules-document-management-create-folder-dialog.component-DRj1LyK3.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-create-folder-dialog.component-Ddzknhp0.mjs.map → acorex-modules-document-management-create-folder-dialog.component-DRj1LyK3.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-details-view.component-irEPa71J.mjs → acorex-modules-document-management-details-view.component-llMxeeFn.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-details-view.component-irEPa71J.mjs.map → acorex-modules-document-management-details-view.component-llMxeeFn.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-drive-choose.component-eAqk3eca.mjs → acorex-modules-document-management-drive-choose.component-DDepk8Hb.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-drive-choose.component-eAqk3eca.mjs.map → acorex-modules-document-management-drive-choose.component-DDepk8Hb.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-drive.component-TNwvgpB_.mjs → acorex-modules-document-management-drive.component-BQ2w-PZw.mjs} +3 -2
- package/fesm2022/acorex-modules-document-management-drive.component-BQ2w-PZw.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-large-icons-view.component-iBkydbXJ.mjs → acorex-modules-document-management-large-icons-view.component-9Q0LX8M-.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-large-icons-view.component-iBkydbXJ.mjs.map → acorex-modules-document-management-large-icons-view.component-9Q0LX8M-.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-BUnwhB1D.mjs → acorex-modules-document-management-large-tiles-view.component-CyqKSkZY.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-BUnwhB1D.mjs.map → acorex-modules-document-management-large-tiles-view.component-CyqKSkZY.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-list-view.component-Bu6EA_LC.mjs → acorex-modules-document-management-list-view.component-CpXtdrMZ.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-list-view.component-Bu6EA_LC.mjs.map → acorex-modules-document-management-list-view.component-CpXtdrMZ.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-permission-definition.provider-D0O5DPux.mjs → acorex-modules-document-management-permission-definition.provider-DZni4b4s.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-permission-definition.provider-D0O5DPux.mjs.map → acorex-modules-document-management-permission-definition.provider-DZni4b4s.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-CSnz9s0C.mjs → acorex-modules-document-management-rename-node-dialog.component-hcrBZ7h2.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-CSnz9s0C.mjs.map → acorex-modules-document-management-rename-node-dialog.component-hcrBZ7h2.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-small-icons-view.component-BvgWgPdU.mjs → acorex-modules-document-management-small-icons-view.component-y9M40s9q.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-small-icons-view.component-BvgWgPdU.mjs.map → acorex-modules-document-management-small-icons-view.component-y9M40s9q.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-CGAmXmDZ.mjs → acorex-modules-document-management-small-tiles-view.component-Ck8m3hZE.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-CGAmXmDZ.mjs.map → acorex-modules-document-management-small-tiles-view.component-Ck8m3hZE.mjs.map} +1 -1
- package/fesm2022/acorex-modules-document-management.mjs +1 -1
- package/fesm2022/{acorex-modules-platform-management-acorex-modules-platform-management-l00277iI.mjs → acorex-modules-platform-management-acorex-modules-platform-management-B8aACrqL.mjs} +229 -1225
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-B8aACrqL.mjs.map +1 -0
- package/fesm2022/{acorex-modules-platform-management-list-version.component-CbjbxadS.mjs → acorex-modules-platform-management-list-version.component-DhSicYd3.mjs} +2 -2
- package/fesm2022/{acorex-modules-platform-management-list-version.component-CbjbxadS.mjs.map → acorex-modules-platform-management-list-version.component-DhSicYd3.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-platform-management-settings.provider-DKwQuq9_.mjs → acorex-modules-platform-management-settings.provider-CnGAUpof.mjs} +2 -2
- package/fesm2022/{acorex-modules-platform-management-settings.provider-DKwQuq9_.mjs.map → acorex-modules-platform-management-settings.provider-CnGAUpof.mjs.map} +1 -1
- package/fesm2022/acorex-modules-platform-management.mjs +1 -1
- package/package.json +5 -1
- package/platform-management/lib/const.d.ts +0 -6
- package/platform-management/lib/entities/data-source/data-source.types.d.ts +1 -2
- package/platform-management/lib/entities/index.d.ts +0 -1
- package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-lAGMGi3Y.mjs.map +0 -1
- package/fesm2022/acorex-modules-document-management-drive.component-TNwvgpB_.mjs.map +0 -1
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-l00277iI.mjs.map +0 -1
- package/platform-management/lib/entities/promotion/index.d.ts +0 -4
- package/platform-management/lib/features/promotion/components/index.d.ts +0 -1
- /package/{platform-management → content-management}/lib/entities/promotion/promotion.datasource.d.ts +0 -0
- /package/{platform-management → content-management}/lib/entities/promotion/promotion.entity.d.ts +0 -0
- /package/{platform-management → content-management}/lib/entities/promotion/promotion.service.d.ts +0 -0
- /package/{platform-management → content-management}/lib/entities/promotion/promotion.types.d.ts +0 -0
- /package/{platform-management → content-management}/lib/features/promotion/components/promotion-slot/promotion-slot.component.d.ts +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
import { createAllQueryView, AXPEntityCommandScope, AXPEntityQueryType, AXPSettingService, AXP_APP_VERSION_PROVIDER, createQueryView,
|
1
|
+
import { createAllQueryView, AXPEntityCommandScope, AXPEntityQueryType, AXPSettingService, AXP_APP_VERSION_PROVIDER, createQueryView, AXPRegionalService, AXP_SETTING_DEFINITION_PROVIDER, AXP_MENU_PROVIDER } from '@acorex/platform/common';
|
2
2
|
import * as i2$2 from '@acorex/platform/layout/components';
|
3
3
|
import { AXPThemeLayoutBlockComponent, AXPComponentSlotModule } from '@acorex/platform/layout/components';
|
4
4
|
import { AXMEntityCrudServiceImpl, AXPEntityDefinitionRegistryService, AXPEntityResolver, AXPEntityService, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
|
@@ -24,7 +24,7 @@ import { CommonModule } from '@angular/common';
|
|
24
24
|
import { AXSafePipe } from '@acorex/core/pipes';
|
25
25
|
import { AXPopupService } from '@acorex/components/popup';
|
26
26
|
import * as i1$2 from '@acorex/platform/core';
|
27
|
-
import { AXPPlatformScope, AXPDataSourceDefinitionProviderService, applyQueryArray, AXPAppStartUpService, objectKeyValueTransforms
|
27
|
+
import { AXPPlatformScope, AXPDataSourceDefinitionProviderService, applyQueryArray, AXPAppStartUpService, objectKeyValueTransforms } from '@acorex/platform/core';
|
28
28
|
import * as i3$1 from '@acorex/components/button';
|
29
29
|
import { AXButtonModule } from '@acorex/components/button';
|
30
30
|
import * as i3 from '@acorex/components/check-box';
|
@@ -89,12 +89,6 @@ const RootConfig = {
|
|
89
89
|
pageDescription: `t("app-term.page-description", {scope:"${config.i18n}"})`,
|
90
90
|
icon: 'fa-light fa-scale-balanced',
|
91
91
|
},
|
92
|
-
promotion: {
|
93
|
-
name: 'promotion',
|
94
|
-
title: `t("promotion", {scope:"${config.i18n}"})`,
|
95
|
-
titlePlural: `t("promotionPlural", {scope:"${config.i18n}"})`,
|
96
|
-
icon: 'fa-light fa-billboard',
|
97
|
-
},
|
98
92
|
dataSource: {
|
99
93
|
name: 'DataSource',
|
100
94
|
title: `t("dataSource", {scope:"${config.i18n}"})`,
|
@@ -1680,10 +1674,10 @@ async function dataSourceEntityFactory(injector) {
|
|
1680
1674
|
},
|
1681
1675
|
},
|
1682
1676
|
validations: [
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1677
|
+
// {
|
1678
|
+
// rule: 'required',
|
1679
|
+
// disabled: "{{ context.eval('sourceType')?.name != 'entity' }}",
|
1680
|
+
// },
|
1687
1681
|
],
|
1688
1682
|
},
|
1689
1683
|
{
|
@@ -3064,6 +3058,16 @@ async function metaDataDefinitionFactory(injector) {
|
|
3064
3058
|
},
|
3065
3059
|
},
|
3066
3060
|
},
|
3061
|
+
{
|
3062
|
+
name: 'description',
|
3063
|
+
layout: {
|
3064
|
+
positions: {
|
3065
|
+
lg: {
|
3066
|
+
colSpan: 12,
|
3067
|
+
},
|
3068
|
+
},
|
3069
|
+
},
|
3070
|
+
},
|
3067
3071
|
{
|
3068
3072
|
name: 'categoryIds',
|
3069
3073
|
layout: {
|
@@ -3113,6 +3117,16 @@ async function metaDataDefinitionFactory(injector) {
|
|
3113
3117
|
},
|
3114
3118
|
},
|
3115
3119
|
},
|
3120
|
+
{
|
3121
|
+
name: 'description',
|
3122
|
+
layout: {
|
3123
|
+
positions: {
|
3124
|
+
lg: {
|
3125
|
+
colSpan: 12,
|
3126
|
+
},
|
3127
|
+
},
|
3128
|
+
},
|
3129
|
+
},
|
3116
3130
|
{
|
3117
3131
|
name: 'categoryIds',
|
3118
3132
|
layout: {
|
@@ -3170,6 +3184,16 @@ async function metaDataDefinitionFactory(injector) {
|
|
3170
3184
|
},
|
3171
3185
|
},
|
3172
3186
|
},
|
3187
|
+
{
|
3188
|
+
name: 'description',
|
3189
|
+
layout: {
|
3190
|
+
positions: {
|
3191
|
+
lg: {
|
3192
|
+
colSpan: 12,
|
3193
|
+
},
|
3194
|
+
},
|
3195
|
+
},
|
3196
|
+
},
|
3173
3197
|
{
|
3174
3198
|
name: 'categoryIds',
|
3175
3199
|
dataPath: 'categories',
|
@@ -3500,1107 +3524,175 @@ async function metaDataDefinitionCategoryEntityFactory(injector) {
|
|
3500
3524
|
// };
|
3501
3525
|
// }
|
3502
3526
|
|
3503
|
-
|
3504
|
-
|
3505
|
-
|
3506
|
-
|
3507
|
-
|
3508
|
-
|
3509
|
-
|
3510
|
-
|
3511
|
-
|
3512
|
-
|
3513
|
-
|
3514
|
-
|
3527
|
+
var index = /*#__PURE__*/Object.freeze({
|
3528
|
+
__proto__: null,
|
3529
|
+
AXMAppTermService: AXMAppTermService,
|
3530
|
+
AXMAppTermServiceImpl: AXMAppTermServiceImpl,
|
3531
|
+
AXMAppVersionService: AXMAppVersionService,
|
3532
|
+
AXMAppVersionServiceImpl: AXMAppVersionServiceImpl,
|
3533
|
+
AXMAppVersionSlotComponent: AXMAppVersionSlotComponent,
|
3534
|
+
AXMChangeLogPopupAction: AXMChangeLogPopupAction,
|
3535
|
+
AXMChangeLogUpdateSettingAction: AXMChangeLogUpdateSettingAction,
|
3536
|
+
AXMCheckNewVersionAction: AXMCheckNewVersionAction,
|
3537
|
+
AXMCheckNewVersionWorkflow: AXMCheckNewVersionWorkflow,
|
3538
|
+
AXMDataSourceService: AXMDataSourceService,
|
3539
|
+
AXMDataSourceServiceImpl: AXMDataSourceServiceImpl,
|
3540
|
+
AXMGlobalVariablesService: AXMGlobalVariablesService,
|
3541
|
+
AXMGlobalVariablesServiceImpl: AXMGlobalVariablesServiceImpl,
|
3542
|
+
AXMGlossaryService: AXMGlossaryService,
|
3543
|
+
AXMGlossaryServiceImpl: AXMGlossaryServiceImpl,
|
3544
|
+
AXMListTermsComponent: AXMListTermsComponent,
|
3545
|
+
AXMMetaDataDefinitionCategoryService: AXMMetaDataDefinitionCategoryService,
|
3546
|
+
AXMMetaDataDefinitionCategoryServiceImpl: AXMMetaDataDefinitionCategoryServiceImpl,
|
3547
|
+
AXMMetaDataDefinitionService: AXMMetaDataDefinitionService,
|
3548
|
+
AXMNewTermWorkflow: AXMNewTermWorkflow,
|
3549
|
+
AXMNotifyAppComponent: AXMNotifyAppComponent,
|
3550
|
+
AXMNotifyNewTermPopupAction: AXMNotifyNewTermPopupAction,
|
3551
|
+
AXMPMetaDataDefinitionServiceImpl: AXMPMetaDataDefinitionServiceImpl,
|
3552
|
+
AXMTermUpdateSettingAction: AXMTermUpdateSettingAction,
|
3553
|
+
AXMWhatsNewWorkflow: AXMWhatsNewWorkflow,
|
3554
|
+
appTermEntityEntityFactory: appTermEntityEntityFactory,
|
3555
|
+
appVersionEntityEntityFactory: appVersionEntityEntityFactory,
|
3556
|
+
dataSourceEntityFactory: dataSourceEntityFactory,
|
3557
|
+
globalVariableEntityFactory: globalVariableEntityFactory,
|
3558
|
+
glossaryEntityFactory: glossaryEntityFactory,
|
3559
|
+
metaDataDefinitionCategoryEntityFactory: metaDataDefinitionCategoryEntityFactory,
|
3560
|
+
metaDataDefinitionFactory: metaDataDefinitionFactory
|
3561
|
+
});
|
3562
|
+
|
3563
|
+
const path = 'regional:';
|
3564
|
+
var AXPRegionalSetting;
|
3565
|
+
(function (AXPRegionalSetting) {
|
3566
|
+
AXPRegionalSetting["LocaleProfile"] = "regional:locale-profile";
|
3567
|
+
AXPRegionalSetting["TimeZone"] = "regional:timezone";
|
3568
|
+
AXPRegionalSetting["Language"] = "regional:language";
|
3569
|
+
AXPRegionalSetting["Country"] = "regional:country";
|
3570
|
+
AXPRegionalSetting["Calendar"] = "regional:calendar";
|
3571
|
+
AXPRegionalSetting["FirstDayOfWeek"] = "regional:first-day-of-week";
|
3572
|
+
AXPRegionalSetting["WeekendDays"] = "regional:weekend-days";
|
3573
|
+
AXPRegionalSetting["ShortDate"] = "regional:short-date";
|
3574
|
+
AXPRegionalSetting["LongDate"] = "regional:long-date";
|
3575
|
+
AXPRegionalSetting["ShortTime"] = "regional:short-time";
|
3576
|
+
AXPRegionalSetting["LongTime"] = "regional:long-time";
|
3577
|
+
AXPRegionalSetting["MeasurementUnits"] = "regional:measurement-units";
|
3578
|
+
AXPRegionalSetting["TemperatureUnits"] = "regional:temperature-units";
|
3579
|
+
AXPRegionalSetting["DistanceUnits"] = "regional:distance-units";
|
3580
|
+
AXPRegionalSetting["WeightUnits"] = "regional:weight-units";
|
3581
|
+
AXPRegionalSetting["VolumeUnits"] = "regional:volume-units";
|
3582
|
+
AXPRegionalSetting["SpeedUnits"] = "regional:speed-units";
|
3583
|
+
AXPRegionalSetting["AreaUnits"] = "regional:area-units";
|
3584
|
+
})(AXPRegionalSetting || (AXPRegionalSetting = {}));
|
3585
|
+
|
3586
|
+
// Regional Store - Manages regional settings and system changes
|
3587
|
+
const AXPRegionalStoreService = signalStore({ providedIn: 'root' },
|
3588
|
+
// Initial State
|
3589
|
+
withState((localeService = inject(AXLocaleService)) => {
|
3590
|
+
const state = {
|
3591
|
+
profile: localeService.activeProfile().localeInfo.code,
|
3592
|
+
language: localeService.activeProfile().localeInfo.language,
|
3593
|
+
calendar: localeService.activeProfile().calendar.system,
|
3594
|
+
};
|
3595
|
+
return state;
|
3596
|
+
}),
|
3597
|
+
// Computed Signals
|
3598
|
+
// withComputed(({ }) => ({
|
3599
|
+
// })),
|
3600
|
+
// Methods for State Management
|
3601
|
+
withMethods((store, settingService = inject(AXPSettingService), localeService = inject(AXLocaleService), calendarService = inject(AXCalendarService), translateService = inject(AXTranslationService)) => {
|
3602
|
+
const applyChanges = async () => {
|
3603
|
+
const profile = localeService.activeProfile();
|
3604
|
+
const html = document.getElementsByTagName('html')[0];
|
3605
|
+
profile.i18nMeta?.rtl ? html.setAttribute('dir', 'rtl') : html.removeAttribute('dir');
|
3606
|
+
};
|
3607
|
+
return {
|
3608
|
+
async changeProfile(profileCode) {
|
3609
|
+
await localeService.setProfile(profileCode);
|
3610
|
+
const profile = localeService.activeProfile();
|
3611
|
+
//
|
3612
|
+
if (store.profile() != profile.localeInfo.code) {
|
3613
|
+
settingService.scope(AXPPlatformScope.User).set(AXPRegionalSetting.LocaleProfile, profile.localeInfo.code);
|
3614
|
+
settingService.scope(AXPPlatformScope.User).set(AXPRegionalSetting.Language, profile.localeInfo.code);
|
3615
|
+
patchState(store, { profile: profile.localeInfo.code });
|
3616
|
+
}
|
3617
|
+
//
|
3618
|
+
await applyChanges();
|
3619
|
+
},
|
3620
|
+
async loadSetting() {
|
3621
|
+
const profileCode = (await settingService.scope(AXPPlatformScope.User).get(AXPRegionalSetting.LocaleProfile));
|
3622
|
+
patchState(store, { profile: profileCode });
|
3623
|
+
await localeService.setProfile(profileCode);
|
3624
|
+
//
|
3625
|
+
// delay to ensure the profile is set and override the default
|
3626
|
+
setTimeout(async () => {
|
3627
|
+
const calendar = (await settingService.scope(AXPPlatformScope.User).get(AXPRegionalSetting.Calendar));
|
3628
|
+
patchState(store, { calendar: calendar });
|
3629
|
+
calendarService.setActiveCalendar(calendar);
|
3630
|
+
//
|
3631
|
+
const language = (await settingService.scope(AXPPlatformScope.User).get(AXPRegionalSetting.Language));
|
3632
|
+
patchState(store, { language: language });
|
3633
|
+
translateService.setActiveLang(language);
|
3634
|
+
//
|
3635
|
+
await applyChanges();
|
3636
|
+
});
|
3637
|
+
//
|
3638
|
+
},
|
3639
|
+
};
|
3640
|
+
}), withHooks((store, settingService = inject(AXPSettingService), translateService = inject(AXTranslationService)) => ({
|
3641
|
+
onInit() {
|
3642
|
+
settingService.onChanged.subscribe(async (setting) => {
|
3643
|
+
const keys = [
|
3644
|
+
AXPRegionalSetting.LocaleProfile,
|
3645
|
+
AXPRegionalSetting.Language,
|
3646
|
+
AXPRegionalSetting.Calendar
|
3647
|
+
];
|
3648
|
+
//
|
3649
|
+
if (keys.some(k => setting.keys.includes(k))) {
|
3650
|
+
await store.loadSetting();
|
3651
|
+
}
|
3652
|
+
});
|
3653
|
+
},
|
3654
|
+
onDestroy() { },
|
3655
|
+
})));
|
3515
3656
|
|
3516
|
-
class
|
3657
|
+
class AXMLanguageSlotComponent {
|
3517
3658
|
constructor() {
|
3518
|
-
this.
|
3519
|
-
this.
|
3520
|
-
this.
|
3659
|
+
this.regionalService = inject(AXPRegionalService);
|
3660
|
+
this.store = inject(AXPRegionalStoreService);
|
3661
|
+
this.items = signal([]);
|
3521
3662
|
}
|
3522
3663
|
async ngOnInit() {
|
3523
|
-
const
|
3524
|
-
|
3525
|
-
take: 10000,
|
3526
|
-
// filter: {
|
3527
|
-
// field: 'type',
|
3528
|
-
// operator: { type: 'equal' },
|
3529
|
-
// value: 'promotion',
|
3530
|
-
// },
|
3531
|
-
});
|
3532
|
-
const filteredItems = channels.items.filter((x) => x.placement?.name == this.location);
|
3533
|
-
const mappedItems = await Promise.all(filteredItems.map(async (item) => {
|
3534
|
-
if (item.imageId != null) {
|
3535
|
-
const image = await this.fileStorage.getInfo(item.imageId);
|
3536
|
-
return {
|
3537
|
-
...item,
|
3538
|
-
image: image,
|
3539
|
-
};
|
3540
|
-
}
|
3541
|
-
else {
|
3542
|
-
return item;
|
3543
|
-
}
|
3544
|
-
}));
|
3545
|
-
this.listData.set(mappedItems);
|
3664
|
+
const items = await this.regionalService.getLocaleProfiles();
|
3665
|
+
this.items.set(items);
|
3546
3666
|
}
|
3547
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
3548
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type:
|
3667
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMLanguageSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
3668
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMLanguageSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button color=\"primary\">\n <ax-icon class=\"fa-regular fa-globe\"> </ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n @for(lang of items(); track lang){\n <ax-button-item\n [text]=\"lang.title\"\n [selected]=\"store.profile() === lang.code\"\n (onClick)=\"store.changeProfile(lang.code)\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-flag\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n</ax-button>\n", dependencies: [{ kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i1$1.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3$1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: CommonModule }] }); }
|
3549
3669
|
}
|
3550
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
3670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMLanguageSlotComponent, decorators: [{
|
3551
3671
|
type: Component,
|
3552
|
-
args: [{
|
3672
|
+
args: [{ imports: [AXDropdownModule, AXDecoratorModule, AXPopoverModule, AXButtonModule, CommonModule], template: "<ax-button color=\"primary\">\n <ax-icon class=\"fa-regular fa-globe\"> </ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n @for(lang of items(); track lang){\n <ax-button-item\n [text]=\"lang.title\"\n [selected]=\"store.profile() === lang.code\"\n (onClick)=\"store.changeProfile(lang.code)\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-flag\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n</ax-button>\n" }]
|
3553
3673
|
}] });
|
3554
3674
|
|
3555
|
-
|
3556
|
-
|
3557
|
-
|
3558
|
-
|
3559
|
-
|
3560
|
-
|
3561
|
-
|
3562
|
-
|
3563
|
-
|
3564
|
-
|
3565
|
-
|
3566
|
-
|
3567
|
-
|
3568
|
-
return obj.map(item => sanitizeForStorage(item));
|
3569
|
-
}
|
3570
|
-
// Handle Date objects
|
3571
|
-
if (obj instanceof Date) {
|
3572
|
-
return obj;
|
3573
|
-
}
|
3574
|
-
// Handle File objects specially
|
3575
|
-
if (obj instanceof File) {
|
3576
|
-
// File objects are handled separately, return as is
|
3577
|
-
return obj;
|
3578
|
-
}
|
3579
|
-
// Handle Blob objects
|
3580
|
-
if (obj instanceof Blob) {
|
3581
|
-
// Blob objects are handled separately
|
3582
|
-
return obj;
|
3583
|
-
}
|
3584
|
-
// Handle regular objects
|
3585
|
-
const cleanedObj = {};
|
3586
|
-
for (const [key, value] of Object.entries(obj)) {
|
3587
|
-
// Skip functions, symbols and other non-serializable types
|
3588
|
-
if (typeof value === 'function' || typeof value === 'symbol') {
|
3589
|
-
continue;
|
3590
|
-
}
|
3591
|
-
// Handle null values
|
3592
|
-
if (value === null) {
|
3593
|
-
cleanedObj[key] = null;
|
3594
|
-
continue;
|
3595
|
-
}
|
3596
|
-
// Recursively sanitize objects
|
3597
|
-
if (typeof value === 'object') {
|
3598
|
-
cleanedObj[key] = sanitizeForStorage(value);
|
3599
|
-
}
|
3600
|
-
else {
|
3601
|
-
cleanedObj[key] = value;
|
3602
|
-
}
|
3603
|
-
}
|
3604
|
-
return cleanedObj;
|
3605
|
-
}
|
3606
|
-
async function promotionEntityFactory(injector) {
|
3607
|
-
const dataService = injector.get(AXMAppPromotionService);
|
3608
|
-
const fileStorageService = injector.get(AXPFileStorageService);
|
3609
|
-
const i18n = RootConfig.config.i18n;
|
3610
|
-
const entityDef = {
|
3611
|
-
module: RootConfig.module.name,
|
3612
|
-
name: RootConfig.entities.promotion.name,
|
3613
|
-
source: '',
|
3614
|
-
title: RootConfig.entities.promotion.title,
|
3615
|
-
formats: {
|
3616
|
-
individual: RootConfig.entities.promotion.title,
|
3617
|
-
plural: RootConfig.entities.promotion.titlePlural,
|
3618
|
-
searchResult: {
|
3619
|
-
title: '{{ title }}',
|
3620
|
-
description: RootConfig.module.title,
|
3621
|
-
},
|
3622
|
-
},
|
3623
|
-
relatedEntities: [],
|
3624
|
-
groups: [
|
3625
|
-
{
|
3626
|
-
id: 'promotion',
|
3627
|
-
title: 'Promotion',
|
3628
|
-
},
|
3629
|
-
],
|
3630
|
-
properties: [
|
3631
|
-
{
|
3632
|
-
name: 'id',
|
3633
|
-
title: 'ID',
|
3634
|
-
schema: {
|
3635
|
-
dataType: 'uuid',
|
3636
|
-
hidden: true,
|
3637
|
-
nullable: false,
|
3638
|
-
readonly: true,
|
3639
|
-
unique: {
|
3640
|
-
enabled: true,
|
3641
|
-
},
|
3675
|
+
class AXPRegionalWidgetDataSourceProvider {
|
3676
|
+
constructor() {
|
3677
|
+
this.regionalService = inject(AXPRegionalService);
|
3678
|
+
//#region Country
|
3679
|
+
this.country = {
|
3680
|
+
name: 'countries',
|
3681
|
+
title: 'Countries',
|
3682
|
+
textField: 'title',
|
3683
|
+
valueField: 'code',
|
3684
|
+
columns: [
|
3685
|
+
{
|
3686
|
+
name: 'code',
|
3687
|
+
title: 'Code',
|
3642
3688
|
},
|
3643
|
-
|
3644
|
-
|
3645
|
-
|
3646
|
-
},
|
3689
|
+
{
|
3690
|
+
name: 'title',
|
3691
|
+
title: 'Title',
|
3647
3692
|
},
|
3648
|
-
|
3649
|
-
|
3650
|
-
|
3651
|
-
title: `t("title", { scope: "common" })`,
|
3652
|
-
groupId: 'promotion',
|
3653
|
-
schema: {
|
3654
|
-
dataType: 'string',
|
3655
|
-
interface: {
|
3656
|
-
type: AXPWidgetsCatalog.text,
|
3657
|
-
},
|
3658
|
-
},
|
3659
|
-
options: {
|
3660
|
-
sort: {
|
3661
|
-
enabled: true,
|
3662
|
-
},
|
3663
|
-
filter: {
|
3664
|
-
advance: {
|
3665
|
-
enabled: true,
|
3666
|
-
},
|
3667
|
-
inline: {
|
3668
|
-
enabled: true,
|
3669
|
-
},
|
3670
|
-
},
|
3671
|
-
},
|
3672
|
-
validations: [
|
3673
|
-
{
|
3674
|
-
rule: 'required',
|
3675
|
-
},
|
3676
|
-
],
|
3677
|
-
},
|
3678
|
-
{
|
3679
|
-
name: 'body',
|
3680
|
-
title: `t("body", { scope: "${i18n}" })`,
|
3681
|
-
groupId: 'promotion',
|
3682
|
-
schema: {
|
3683
|
-
dataType: 'string',
|
3684
|
-
interface: {
|
3685
|
-
type: AXPWidgetsCatalog.richText,
|
3686
|
-
},
|
3687
|
-
},
|
3688
|
-
validations: [
|
3689
|
-
{
|
3690
|
-
rule: 'required',
|
3691
|
-
},
|
3692
|
-
],
|
3693
|
-
},
|
3694
|
-
{
|
3695
|
-
name: 'imageId',
|
3696
|
-
title: `t("Gallery", { scope: "${i18n}" })`,
|
3697
|
-
groupId: 'promotion',
|
3698
|
-
schema: {
|
3699
|
-
dataType: 'string',
|
3700
|
-
interface: {
|
3701
|
-
type: AXPWidgetsCatalog.fileUploader,
|
3702
|
-
options: {
|
3703
|
-
multiple: true,
|
3704
|
-
},
|
3705
|
-
},
|
3706
|
-
},
|
3707
|
-
},
|
3708
|
-
{
|
3709
|
-
name: 'contentType',
|
3710
|
-
title: `t("contentType", { scope: "${i18n}" })`,
|
3711
|
-
groupId: 'promotion',
|
3712
|
-
schema: {
|
3713
|
-
dataType: 'string',
|
3714
|
-
interface: {
|
3715
|
-
type: AXPWidgetsCatalog.select,
|
3716
|
-
options: {
|
3717
|
-
valueField: 'name',
|
3718
|
-
textField: 'title',
|
3719
|
-
dataSource: [
|
3720
|
-
{ title: 'Media', name: 'media' },
|
3721
|
-
{ title: 'Text', name: 'text' },
|
3722
|
-
],
|
3723
|
-
direction: 'horizontal',
|
3724
|
-
multiple: false,
|
3725
|
-
},
|
3726
|
-
},
|
3727
|
-
},
|
3728
|
-
options: {
|
3729
|
-
sort: {
|
3730
|
-
enabled: true,
|
3731
|
-
},
|
3732
|
-
filter: {
|
3733
|
-
advance: {
|
3734
|
-
enabled: true,
|
3735
|
-
},
|
3736
|
-
},
|
3737
|
-
},
|
3738
|
-
validations: [
|
3739
|
-
{
|
3740
|
-
rule: 'required',
|
3741
|
-
},
|
3742
|
-
],
|
3743
|
-
},
|
3744
|
-
// {
|
3745
|
-
// name: 'shape',
|
3746
|
-
// title: `t("shape", { scope: "${i18n}" })`,
|
3747
|
-
// groupId: 'promotion',
|
3748
|
-
// schema: {
|
3749
|
-
// dataType: 'string',
|
3750
|
-
// interface: {
|
3751
|
-
// type: AXPWidgetsCatalog.select,
|
3752
|
-
// options: {
|
3753
|
-
// valueField: 'name',
|
3754
|
-
// textField: 'title',
|
3755
|
-
// dataSource: [
|
3756
|
-
// { title: 'Circle', name: 'circle' },
|
3757
|
-
// { title: 'Square', name: 'square' },
|
3758
|
-
// ],
|
3759
|
-
// direction: 'horizontal',
|
3760
|
-
// multiple: false,
|
3761
|
-
// accept: '',
|
3762
|
-
// },
|
3763
|
-
// },
|
3764
|
-
// },
|
3765
|
-
// validations: [
|
3766
|
-
// {
|
3767
|
-
// rule: 'required',
|
3768
|
-
// },
|
3769
|
-
// ],
|
3770
|
-
// },
|
3771
|
-
{
|
3772
|
-
name: 'placement',
|
3773
|
-
title: `t("placement", { scope: "${i18n}" })`,
|
3774
|
-
groupId: 'promotion',
|
3775
|
-
schema: {
|
3776
|
-
dataType: 'string',
|
3777
|
-
interface: {
|
3778
|
-
type: AXPWidgetsCatalog.select,
|
3779
|
-
options: {
|
3780
|
-
valueField: 'name',
|
3781
|
-
textField: 'title',
|
3782
|
-
dataSource: [
|
3783
|
-
{
|
3784
|
-
title: 'Side Menu Footer',
|
3785
|
-
name: 'side-menu-footer',
|
3786
|
-
options: AXM_COLUMN_DEF_WIDGET,
|
3787
|
-
},
|
3788
|
-
{
|
3789
|
-
title: 'Side Menu Header',
|
3790
|
-
name: 'side-menu-header',
|
3791
|
-
options: [
|
3792
|
-
{
|
3793
|
-
type: 'text-editor',
|
3794
|
-
mode: 'edit',
|
3795
|
-
path: 'name',
|
3796
|
-
options: {
|
3797
|
-
placeholder: 'Name',
|
3798
|
-
defaultValue: 'test',
|
3799
|
-
},
|
3800
|
-
},
|
3801
|
-
],
|
3802
|
-
},
|
3803
|
-
],
|
3804
|
-
direction: 'horizontal',
|
3805
|
-
multiple: false,
|
3806
|
-
},
|
3807
|
-
},
|
3808
|
-
},
|
3809
|
-
validations: [
|
3810
|
-
{
|
3811
|
-
rule: 'required',
|
3812
|
-
},
|
3813
|
-
],
|
3814
|
-
},
|
3815
|
-
// {
|
3816
|
-
// name: "metadaata",
|
3817
|
-
// title: "Meta Data",
|
3818
|
-
// groupId: 'promotion',
|
3819
|
-
// schema: {
|
3820
|
-
// dataType: 'object',
|
3821
|
-
// interface: {
|
3822
|
-
// type: AXPWidgetsCatalog.text,
|
3823
|
-
// // children: "{{ context.eval('placement').options }}" as any,
|
3824
|
-
// },
|
3825
|
-
// }
|
3826
|
-
//},
|
3827
|
-
// {
|
3828
|
-
// name: 'metadata',
|
3829
|
-
// title: `Meta Data`,
|
3830
|
-
// groupId: 'promotion',
|
3831
|
-
// schema: {
|
3832
|
-
// dataType: 'object',
|
3833
|
-
// interface: {
|
3834
|
-
// type: AXPWidgetsCatalog.blockLayout,
|
3835
|
-
// children: "{{ context.eval('placement')?.options ?? [] }}" as any,
|
3836
|
-
// },
|
3837
|
-
// },
|
3838
|
-
// },
|
3839
|
-
],
|
3840
|
-
columns: [{ name: 'title' }, { name: 'placement' }, { name: 'imageId' }],
|
3841
|
-
commands: {
|
3842
|
-
create: {
|
3843
|
-
execute: async (data) => {
|
3844
|
-
data = sanitizeForStorage(data);
|
3845
|
-
const entityPayload = { ...data };
|
3846
|
-
const filesToUploadAfterSave = [];
|
3847
|
-
// const originalImageIdArray = Array.isArray(entityPayload.imageId) ? [...entityPayload.imageId] : [];
|
3848
|
-
if (entityPayload.imageId && Array.isArray(entityPayload.imageId)) {
|
3849
|
-
const processedImageIdForEntitySave = [];
|
3850
|
-
for (const fileItem of entityPayload.imageId) {
|
3851
|
-
if (fileItem.source?.kind === 'blob' && fileItem.source.value instanceof Blob) {
|
3852
|
-
filesToUploadAfterSave.push({ fileItem, blob: fileItem.source.value });
|
3853
|
-
processedImageIdForEntitySave.push({
|
3854
|
-
tempId: fileItem.id,
|
3855
|
-
name: fileItem.name,
|
3856
|
-
size: fileItem.size,
|
3857
|
-
type: fileItem.source.value.type, // Type from blob is reliable
|
3858
|
-
status: 'pending_upload'
|
3859
|
-
});
|
3860
|
-
}
|
3861
|
-
else if (fileItem.source?.kind === 'fileId' && fileItem.id && typeof fileItem.source.value === 'string') {
|
3862
|
-
// If it's a fileId, we assume it's already processed. We don't have type directly on AXPFileListItem.
|
3863
|
-
// We'll reconstruct it from fileStorageService or it should be part of what's saved if needed.
|
3864
|
-
processedImageIdForEntitySave.push({
|
3865
|
-
id: fileItem.id,
|
3866
|
-
name: fileItem.name,
|
3867
|
-
size: fileItem.size,
|
3868
|
-
// type: fileItem.type, // Removed: AXPFileListItem does not have .type
|
3869
|
-
status: 'uploaded',
|
3870
|
-
source: { kind: 'fileId', value: fileItem.source.value }
|
3871
|
-
});
|
3872
|
-
}
|
3873
|
-
else if (fileItem.id && fileItem.name) { // Fallback for items that might be from a previous save
|
3874
|
-
processedImageIdForEntitySave.push({
|
3875
|
-
id: fileItem.id,
|
3876
|
-
name: fileItem.name,
|
3877
|
-
size: fileItem.size,
|
3878
|
-
// type: fileItem.type, // Removed: AXPFileListItem does not have .type
|
3879
|
-
status: fileItem.status, // Preserve existing status
|
3880
|
-
source: fileItem.source ? { kind: fileItem.source.kind, value: fileItem.source.value } : undefined
|
3881
|
-
});
|
3882
|
-
}
|
3883
|
-
}
|
3884
|
-
entityPayload.imageId = processedImageIdForEntitySave;
|
3885
|
-
}
|
3886
|
-
const savedEntityId = await dataService.insertOne(entityPayload);
|
3887
|
-
// const entityId = savedEntity.id; // Corrected based on typical service return
|
3888
|
-
const finalImageIdReferences = (entityPayload.imageId || [])
|
3889
|
-
.filter((f) => f.status !== 'pending_upload');
|
3890
|
-
for (const { fileItem, blob } of filesToUploadAfterSave) {
|
3891
|
-
try {
|
3892
|
-
if (!fileStorageService) {
|
3893
|
-
throw new Error('fileStorageService is not available.');
|
3894
|
-
}
|
3895
|
-
const fileStorageInfo = await fileStorageService.save({
|
3896
|
-
file: blob,
|
3897
|
-
refId: savedEntityId,
|
3898
|
-
refType: `${RootConfig.module.name}.${RootConfig.entities.promotion.name}`,
|
3899
|
-
category: '',
|
3900
|
-
name: blob.name,
|
3901
|
-
});
|
3902
|
-
finalImageIdReferences.push({
|
3903
|
-
id: fileStorageInfo.fileId,
|
3904
|
-
name: fileStorageInfo.name || blob.name,
|
3905
|
-
size: fileStorageInfo.size || blob.size,
|
3906
|
-
type: fileStorageInfo.mimeType || blob.type,
|
3907
|
-
status: 'uploaded',
|
3908
|
-
source: { kind: 'fileId', value: fileStorageInfo.fileId }
|
3909
|
-
});
|
3910
|
-
}
|
3911
|
-
catch (err) { // Typed error
|
3912
|
-
console.error('Error uploading file to FileStorage for entityId:', savedEntityId, 'file:', fileItem.name, err);
|
3913
|
-
finalImageIdReferences.push({
|
3914
|
-
tempId: fileItem.id,
|
3915
|
-
name: fileItem.name,
|
3916
|
-
size: fileItem.size,
|
3917
|
-
type: blob.type, // Correctly access type from Blob/File
|
3918
|
-
status: 'upload_failed',
|
3919
|
-
error: err.message
|
3920
|
-
});
|
3921
|
-
}
|
3922
|
-
}
|
3923
|
-
if (filesToUploadAfterSave.length > 0) {
|
3924
|
-
let needsUpdate = true;
|
3925
|
-
if (entityPayload.imageId && entityPayload.imageId.length === finalImageIdReferences.length) {
|
3926
|
-
const oldIds = entityPayload.imageId.map((f) => f.id || f.tempId).sort().join(',');
|
3927
|
-
const newIds = finalImageIdReferences.map((f) => f.id || f.tempId).sort().join(',');
|
3928
|
-
if (oldIds === newIds && !finalImageIdReferences.some((f) => f.status === 'upload_failed')) {
|
3929
|
-
needsUpdate = false;
|
3930
|
-
}
|
3931
|
-
}
|
3932
|
-
if (needsUpdate) {
|
3933
|
-
// Assuming updateOne takes the ID and an object of fields to update
|
3934
|
-
await dataService.updateOne(savedEntityId, { imageId: finalImageIdReferences });
|
3935
|
-
}
|
3936
|
-
}
|
3937
|
-
return { id: savedEntityId };
|
3938
|
-
},
|
3939
|
-
},
|
3940
|
-
delete: {
|
3941
|
-
execute: async (id) => {
|
3942
|
-
return await dataService.deleteOne(id);
|
3943
|
-
},
|
3944
|
-
},
|
3945
|
-
update: {
|
3946
|
-
execute: async (data) => {
|
3947
|
-
const entityId = data.id;
|
3948
|
-
const filesToUpload = [];
|
3949
|
-
const processedImageReferences = []; // Will hold final file objects for DB
|
3950
|
-
// Ensure fileStorageService is available (it's injected at the factory level)
|
3951
|
-
// const fileStorageService = injector.get(AXPFileStorageService); // Already available in this scope from factory
|
3952
|
-
if (data.imageId && Array.isArray(data.imageId)) {
|
3953
|
-
for (const fileItem of data.imageId) {
|
3954
|
-
if (fileItem.status === 'deleted') {
|
3955
|
-
// File marked for deletion. Skip.
|
3956
|
-
// Optionally, you might want to call fileStorageService.delete(fileId) here
|
3957
|
-
// if fileItem.id points to an existing stored file and actual deletion is needed.
|
3958
|
-
// For now, we just disassociate it from the entity.
|
3959
|
-
continue;
|
3960
|
-
}
|
3961
|
-
if (fileItem.source?.kind === 'blob' && fileItem.source.value instanceof Blob) {
|
3962
|
-
filesToUpload.push({ fileItem, blob: fileItem.source.value });
|
3963
|
-
// Actual reference will be added to processedImageReferences after successful upload.
|
3964
|
-
}
|
3965
|
-
else if (fileItem.source?.kind === 'fileId' && fileItem.id && typeof fileItem.source.value === 'string') {
|
3966
|
-
// This is an existing file, keep its reference.
|
3967
|
-
processedImageReferences.push({
|
3968
|
-
id: fileItem.id,
|
3969
|
-
name: fileItem.name,
|
3970
|
-
size: fileItem.size,
|
3971
|
-
status: fileItem.status || 'uploaded', // Default to 'uploaded' if status is missing
|
3972
|
-
source: { kind: 'fileId', value: fileItem.source.value }
|
3973
|
-
// 'type' is not typically part of AXPFileListItem for existing fileIds in 'create'
|
3974
|
-
});
|
3975
|
-
}
|
3976
|
-
else if (fileItem.id && fileItem.name) {
|
3977
|
-
// Fallback for items that might be from a previous save state (already processed)
|
3978
|
-
// These are likely already processed files that are being kept.
|
3979
|
-
processedImageReferences.push({
|
3980
|
-
id: fileItem.id,
|
3981
|
-
name: fileItem.name,
|
3982
|
-
size: fileItem.size,
|
3983
|
-
status: fileItem.status || 'uploaded',
|
3984
|
-
source: fileItem.source ? { kind: fileItem.source.kind, value: fileItem.source.value } : undefined
|
3985
|
-
});
|
3986
|
-
}
|
3987
|
-
// Else: unknown fileItem structure, it will be ignored or you can log an error.
|
3988
|
-
}
|
3989
|
-
}
|
3990
|
-
// Upload new files and add their successful/failed info to processedImageReferences
|
3991
|
-
for (const { fileItem, blob } of filesToUpload) {
|
3992
|
-
try {
|
3993
|
-
if (!fileStorageService) {
|
3994
|
-
throw new Error('fileStorageService is not available.');
|
3995
|
-
}
|
3996
|
-
const fileStorageInfo = await fileStorageService.save({
|
3997
|
-
file: blob,
|
3998
|
-
refId: entityId, // ID of the entity being updated
|
3999
|
-
refType: `${RootConfig.module.name}.${RootConfig.entities.promotion.name}`,
|
4000
|
-
category: '', // Add category if applicable
|
4001
|
-
name: blob.name,
|
4002
|
-
});
|
4003
|
-
processedImageReferences.push({
|
4004
|
-
id: fileStorageInfo.fileId,
|
4005
|
-
name: fileStorageInfo.name || blob.name,
|
4006
|
-
size: fileStorageInfo.size || blob.size,
|
4007
|
-
type: fileStorageInfo.mimeType || blob.type, // Store MIME type
|
4008
|
-
status: 'uploaded',
|
4009
|
-
source: { kind: 'fileId', value: fileStorageInfo.fileId }
|
4010
|
-
});
|
4011
|
-
}
|
4012
|
-
catch (err) {
|
4013
|
-
console.error('Error uploading file to FileStorage during update for entityId:', entityId, 'file:', fileItem.name, err);
|
4014
|
-
processedImageReferences.push({
|
4015
|
-
tempId: fileItem.id, // Use fileItem.id if it's a unique temp client-side ID, or generate one
|
4016
|
-
name: fileItem.name,
|
4017
|
-
size: fileItem.size,
|
4018
|
-
type: blob.type,
|
4019
|
-
status: 'upload_failed',
|
4020
|
-
error: err.message
|
4021
|
-
});
|
4022
|
-
}
|
4023
|
-
}
|
4024
|
-
// Construct the final data payload for the update.
|
4025
|
-
// Create a mutable copy of the input data.
|
4026
|
-
const finalUpdatePayload = { ...data };
|
4027
|
-
// Replace the original imageId array with the newly processed one.
|
4028
|
-
finalUpdatePayload.imageId = processedImageReferences;
|
4029
|
-
// Sanitize the entire payload before sending it to dataService.updateOne.
|
4030
|
-
// This ensures that the processedImageReferences (which are plain objects)
|
4031
|
-
// and all other fields in the payload are clean and serializable.
|
4032
|
-
const fullySanitizedPayload = sanitizeForStorage(finalUpdatePayload);
|
4033
|
-
return await dataService.updateOne(entityId, fullySanitizedPayload);
|
4034
|
-
},
|
4035
|
-
},
|
4036
|
-
},
|
4037
|
-
queries: {
|
4038
|
-
byKey: {
|
4039
|
-
execute: async (id) => {
|
4040
|
-
try {
|
4041
|
-
// Debug the incoming ID parameter
|
4042
|
-
console.log('byKey original id parameter:', id, typeof id);
|
4043
|
-
// Ensure id is a valid key for IndexedDB - needs to be string or number
|
4044
|
-
let validId;
|
4045
|
-
// If id is an object (e.g., from router params or complex structure)
|
4046
|
-
if (typeof id === 'object' && id !== null) {
|
4047
|
-
if ('id' in id) {
|
4048
|
-
validId = String(id.id);
|
4049
|
-
}
|
4050
|
-
else {
|
4051
|
-
validId = String(id);
|
4052
|
-
}
|
4053
|
-
console.warn('Converted object id to string:', validId);
|
4054
|
-
}
|
4055
|
-
else if (id === undefined || id === null) {
|
4056
|
-
console.error('Invalid id parameter: null or undefined');
|
4057
|
-
return null;
|
4058
|
-
}
|
4059
|
-
else {
|
4060
|
-
// Convert to string to ensure consistency
|
4061
|
-
validId = String(id);
|
4062
|
-
}
|
4063
|
-
// Log the ID being used for the query
|
4064
|
-
console.log('Fetching record with id:', validId, typeof validId);
|
4065
|
-
try {
|
4066
|
-
const data = await dataService.getOne(validId);
|
4067
|
-
console.log('getOne result:', data ? 'Data found' : 'No data found');
|
4068
|
-
// If no data was found
|
4069
|
-
if (!data) {
|
4070
|
-
console.warn(`No record found with id: ${validId}`);
|
4071
|
-
return null;
|
4072
|
-
}
|
4073
|
-
return data;
|
4074
|
-
}
|
4075
|
-
catch (error) {
|
4076
|
-
console.error(`Error fetching data with ID ${validId}:`, error);
|
4077
|
-
// Return null instead of throwing to avoid cascading errors
|
4078
|
-
return null;
|
4079
|
-
}
|
4080
|
-
}
|
4081
|
-
catch (error) {
|
4082
|
-
console.error('Critical error in byKey query:', error);
|
4083
|
-
return null; // Return null instead of throwing to avoid UI errors
|
4084
|
-
}
|
4085
|
-
},
|
4086
|
-
type: AXPEntityQueryType.Single,
|
4087
|
-
},
|
4088
|
-
list: {
|
4089
|
-
execute: async (e) => {
|
4090
|
-
return await dataService.query({ skip: e.skip, take: e.take, filter: e.filter });
|
4091
|
-
},
|
4092
|
-
type: AXPEntityQueryType.List,
|
4093
|
-
},
|
4094
|
-
},
|
4095
|
-
interfaces: {
|
4096
|
-
master: {
|
4097
|
-
create: {
|
4098
|
-
sections: [
|
4099
|
-
{
|
4100
|
-
id: 'promotion',
|
4101
|
-
},
|
4102
|
-
],
|
4103
|
-
properties: [
|
4104
|
-
{
|
4105
|
-
name: 'title',
|
4106
|
-
layout: {
|
4107
|
-
positions: {
|
4108
|
-
lg: {
|
4109
|
-
colSpan: 6,
|
4110
|
-
order: 1,
|
4111
|
-
},
|
4112
|
-
},
|
4113
|
-
},
|
4114
|
-
},
|
4115
|
-
{
|
4116
|
-
name: 'body',
|
4117
|
-
layout: {
|
4118
|
-
positions: {
|
4119
|
-
lg: {
|
4120
|
-
colSpan: 12,
|
4121
|
-
order: 5,
|
4122
|
-
},
|
4123
|
-
},
|
4124
|
-
},
|
4125
|
-
},
|
4126
|
-
{
|
4127
|
-
name: 'imageId',
|
4128
|
-
layout: {
|
4129
|
-
positions: {
|
4130
|
-
lg: {
|
4131
|
-
colSpan: 12,
|
4132
|
-
order: 6,
|
4133
|
-
},
|
4134
|
-
},
|
4135
|
-
},
|
4136
|
-
},
|
4137
|
-
{
|
4138
|
-
name: 'contentType',
|
4139
|
-
layout: {
|
4140
|
-
positions: {
|
4141
|
-
lg: {
|
4142
|
-
colSpan: 6,
|
4143
|
-
order: 2,
|
4144
|
-
},
|
4145
|
-
},
|
4146
|
-
},
|
4147
|
-
},
|
4148
|
-
{
|
4149
|
-
name: 'shape',
|
4150
|
-
layout: {
|
4151
|
-
positions: {
|
4152
|
-
lg: {
|
4153
|
-
colSpan: 6,
|
4154
|
-
order: 3,
|
4155
|
-
},
|
4156
|
-
},
|
4157
|
-
},
|
4158
|
-
},
|
4159
|
-
{
|
4160
|
-
name: 'placement',
|
4161
|
-
layout: {
|
4162
|
-
positions: {
|
4163
|
-
lg: {
|
4164
|
-
colSpan: 6,
|
4165
|
-
order: 4,
|
4166
|
-
},
|
4167
|
-
},
|
4168
|
-
},
|
4169
|
-
},
|
4170
|
-
{
|
4171
|
-
name: 'metadata',
|
4172
|
-
layout: {
|
4173
|
-
positions: {
|
4174
|
-
lg: {
|
4175
|
-
colSpan: 12,
|
4176
|
-
order: 10,
|
4177
|
-
},
|
4178
|
-
},
|
4179
|
-
},
|
4180
|
-
},
|
4181
|
-
],
|
4182
|
-
},
|
4183
|
-
update: {
|
4184
|
-
sections: [
|
4185
|
-
{
|
4186
|
-
id: 'promotion',
|
4187
|
-
},
|
4188
|
-
],
|
4189
|
-
properties: [
|
4190
|
-
{
|
4191
|
-
name: 'title',
|
4192
|
-
layout: {
|
4193
|
-
positions: {
|
4194
|
-
lg: {
|
4195
|
-
colSpan: 6,
|
4196
|
-
order: 1,
|
4197
|
-
},
|
4198
|
-
},
|
4199
|
-
},
|
4200
|
-
},
|
4201
|
-
{
|
4202
|
-
name: 'body',
|
4203
|
-
layout: {
|
4204
|
-
positions: {
|
4205
|
-
lg: {
|
4206
|
-
colSpan: 12,
|
4207
|
-
order: 5,
|
4208
|
-
},
|
4209
|
-
},
|
4210
|
-
},
|
4211
|
-
},
|
4212
|
-
{
|
4213
|
-
name: 'imageId',
|
4214
|
-
layout: {
|
4215
|
-
positions: {
|
4216
|
-
lg: {
|
4217
|
-
colSpan: 12,
|
4218
|
-
order: 6,
|
4219
|
-
},
|
4220
|
-
},
|
4221
|
-
},
|
4222
|
-
},
|
4223
|
-
{
|
4224
|
-
name: 'contentType',
|
4225
|
-
layout: {
|
4226
|
-
positions: {
|
4227
|
-
lg: {
|
4228
|
-
colSpan: 6,
|
4229
|
-
order: 2,
|
4230
|
-
},
|
4231
|
-
},
|
4232
|
-
},
|
4233
|
-
},
|
4234
|
-
{
|
4235
|
-
name: 'shape',
|
4236
|
-
layout: {
|
4237
|
-
positions: {
|
4238
|
-
lg: {
|
4239
|
-
colSpan: 6,
|
4240
|
-
order: 3,
|
4241
|
-
},
|
4242
|
-
},
|
4243
|
-
},
|
4244
|
-
},
|
4245
|
-
{
|
4246
|
-
name: 'placement',
|
4247
|
-
layout: {
|
4248
|
-
positions: {
|
4249
|
-
lg: {
|
4250
|
-
colSpan: 6,
|
4251
|
-
order: 4,
|
4252
|
-
},
|
4253
|
-
},
|
4254
|
-
},
|
4255
|
-
},
|
4256
|
-
// {
|
4257
|
-
// name: 'metadata',
|
4258
|
-
// layout: {
|
4259
|
-
// positions: {
|
4260
|
-
// lg: {
|
4261
|
-
// colSpan: 12,
|
4262
|
-
// order: 10,
|
4263
|
-
// },
|
4264
|
-
// },
|
4265
|
-
// },
|
4266
|
-
// },
|
4267
|
-
],
|
4268
|
-
},
|
4269
|
-
single: {
|
4270
|
-
title: '{{title}}',
|
4271
|
-
sections: [
|
4272
|
-
{
|
4273
|
-
id: 'promotion',
|
4274
|
-
},
|
4275
|
-
],
|
4276
|
-
properties: [
|
4277
|
-
{
|
4278
|
-
name: 'title',
|
4279
|
-
layout: {
|
4280
|
-
positions: {
|
4281
|
-
lg: {
|
4282
|
-
colSpan: 6,
|
4283
|
-
},
|
4284
|
-
},
|
4285
|
-
},
|
4286
|
-
},
|
4287
|
-
{
|
4288
|
-
name: 'body',
|
4289
|
-
layout: {
|
4290
|
-
positions: {
|
4291
|
-
lg: {
|
4292
|
-
colSpan: 6,
|
4293
|
-
},
|
4294
|
-
},
|
4295
|
-
},
|
4296
|
-
},
|
4297
|
-
{
|
4298
|
-
name: 'imageId',
|
4299
|
-
layout: {
|
4300
|
-
positions: {
|
4301
|
-
lg: {
|
4302
|
-
colSpan: 12,
|
4303
|
-
order: 2,
|
4304
|
-
},
|
4305
|
-
},
|
4306
|
-
},
|
4307
|
-
},
|
4308
|
-
{
|
4309
|
-
name: 'contentType',
|
4310
|
-
layout: {
|
4311
|
-
positions: {
|
4312
|
-
lg: {
|
4313
|
-
colSpan: 4,
|
4314
|
-
order: 4,
|
4315
|
-
},
|
4316
|
-
},
|
4317
|
-
},
|
4318
|
-
},
|
4319
|
-
{
|
4320
|
-
name: 'shape',
|
4321
|
-
layout: {
|
4322
|
-
positions: {
|
4323
|
-
lg: {
|
4324
|
-
colSpan: 4,
|
4325
|
-
order: 5,
|
4326
|
-
},
|
4327
|
-
},
|
4328
|
-
},
|
4329
|
-
},
|
4330
|
-
{
|
4331
|
-
name: 'placement',
|
4332
|
-
layout: {
|
4333
|
-
positions: {
|
4334
|
-
lg: {
|
4335
|
-
colSpan: 4,
|
4336
|
-
order: 6,
|
4337
|
-
},
|
4338
|
-
},
|
4339
|
-
},
|
4340
|
-
},
|
4341
|
-
],
|
4342
|
-
actions: [],
|
4343
|
-
},
|
4344
|
-
list: {
|
4345
|
-
actions: [
|
4346
|
-
{
|
4347
|
-
title: `t("create", { scope: "common" })`,
|
4348
|
-
command: 'create-entity',
|
4349
|
-
priority: 'primary',
|
4350
|
-
type: 'create',
|
4351
|
-
scope: AXPEntityCommandScope.TypeLevel,
|
4352
|
-
},
|
4353
|
-
{
|
4354
|
-
title: 't("deleteItems", { scope: "common" })',
|
4355
|
-
command: 'delete-entity',
|
4356
|
-
priority: 'primary',
|
4357
|
-
type: 'delete',
|
4358
|
-
scope: AXPEntityCommandScope.Selected,
|
4359
|
-
},
|
4360
|
-
{
|
4361
|
-
title: 't("detail", { scope: "common" })',
|
4362
|
-
command: 'open-entity',
|
4363
|
-
priority: 'primary',
|
4364
|
-
type: 'view',
|
4365
|
-
scope: AXPEntityCommandScope.Individual,
|
4366
|
-
},
|
4367
|
-
{
|
4368
|
-
title: 't("delete", { scope: "common" })',
|
4369
|
-
command: 'delete-entity',
|
4370
|
-
priority: 'primary',
|
4371
|
-
type: 'delete',
|
4372
|
-
scope: AXPEntityCommandScope.Individual,
|
4373
|
-
},
|
4374
|
-
{
|
4375
|
-
title: 't("entity.modify", { scope: "common" })',
|
4376
|
-
command: 'quick-modify-entity',
|
4377
|
-
priority: 'secondary',
|
4378
|
-
type: 'update',
|
4379
|
-
scope: AXPEntityCommandScope.Individual,
|
4380
|
-
},
|
4381
|
-
//TODO: add this to the entity
|
4382
|
-
{
|
4383
|
-
title: 't("upload.title", { scope: "common" })',
|
4384
|
-
command: {
|
4385
|
-
name: 'show-file-uploader-popup',
|
4386
|
-
options: {
|
4387
|
-
id: '{{ context.eval("id") }}',
|
4388
|
-
files: '{{ context.eval("imageId") }}',
|
4389
|
-
multiple: true,
|
4390
|
-
accept: '.jpg,.jpeg,.png,.gif,.webp',
|
4391
|
-
key: 'imageId',
|
4392
|
-
}
|
4393
|
-
},
|
4394
|
-
priority: 'secondary',
|
4395
|
-
type: 'update',
|
4396
|
-
scope: AXPEntityCommandScope.Individual,
|
4397
|
-
},
|
4398
|
-
],
|
4399
|
-
views: [
|
4400
|
-
createAllQueryView({ sorts: [{ name: 'title', dir: 'asc' }] }),
|
4401
|
-
createQueryView('media', `t("media", { scope: "${i18n}" })`, true, {
|
4402
|
-
conditions: [
|
4403
|
-
{
|
4404
|
-
name: 'contentType.name',
|
4405
|
-
operator: {
|
4406
|
-
type: 'equal',
|
4407
|
-
},
|
4408
|
-
value: 'media',
|
4409
|
-
},
|
4410
|
-
],
|
4411
|
-
}),
|
4412
|
-
createQueryView('text', `t("text", { scope: "${i18n}" })`, true, {
|
4413
|
-
conditions: [
|
4414
|
-
{
|
4415
|
-
name: 'contentType.name',
|
4416
|
-
operator: {
|
4417
|
-
type: 'equal',
|
4418
|
-
},
|
4419
|
-
value: 'text',
|
4420
|
-
},
|
4421
|
-
],
|
4422
|
-
}),
|
4423
|
-
],
|
4424
|
-
},
|
4425
|
-
},
|
4426
|
-
},
|
4427
|
-
};
|
4428
|
-
return entityDef;
|
4429
|
-
}
|
4430
|
-
|
4431
|
-
var index = /*#__PURE__*/Object.freeze({
|
4432
|
-
__proto__: null,
|
4433
|
-
AXMAppPromotionService: AXMAppPromotionService,
|
4434
|
-
AXMAppTermService: AXMAppTermService,
|
4435
|
-
AXMAppTermServiceImpl: AXMAppTermServiceImpl,
|
4436
|
-
AXMAppVersionService: AXMAppVersionService,
|
4437
|
-
AXMAppVersionServiceImpl: AXMAppVersionServiceImpl,
|
4438
|
-
AXMAppVersionSlotComponent: AXMAppVersionSlotComponent,
|
4439
|
-
AXMChangeLogPopupAction: AXMChangeLogPopupAction,
|
4440
|
-
AXMChangeLogUpdateSettingAction: AXMChangeLogUpdateSettingAction,
|
4441
|
-
AXMCheckNewVersionAction: AXMCheckNewVersionAction,
|
4442
|
-
AXMCheckNewVersionWorkflow: AXMCheckNewVersionWorkflow,
|
4443
|
-
AXMDataSourceService: AXMDataSourceService,
|
4444
|
-
AXMDataSourceServiceImpl: AXMDataSourceServiceImpl,
|
4445
|
-
AXMGlobalVariablesService: AXMGlobalVariablesService,
|
4446
|
-
AXMGlobalVariablesServiceImpl: AXMGlobalVariablesServiceImpl,
|
4447
|
-
AXMGlossaryService: AXMGlossaryService,
|
4448
|
-
AXMGlossaryServiceImpl: AXMGlossaryServiceImpl,
|
4449
|
-
AXMListTermsComponent: AXMListTermsComponent,
|
4450
|
-
AXMMetaDataDefinitionCategoryService: AXMMetaDataDefinitionCategoryService,
|
4451
|
-
AXMMetaDataDefinitionCategoryServiceImpl: AXMMetaDataDefinitionCategoryServiceImpl,
|
4452
|
-
AXMMetaDataDefinitionService: AXMMetaDataDefinitionService,
|
4453
|
-
AXMNewTermWorkflow: AXMNewTermWorkflow,
|
4454
|
-
AXMNotifyAppComponent: AXMNotifyAppComponent,
|
4455
|
-
AXMNotifyNewTermPopupAction: AXMNotifyNewTermPopupAction,
|
4456
|
-
AXMPMetaDataDefinitionServiceImpl: AXMPMetaDataDefinitionServiceImpl,
|
4457
|
-
AXMPromotionServiceImpl: AXMPromotionServiceImpl,
|
4458
|
-
AXMPromotionSlotComponent: AXMPromotionSlotComponent,
|
4459
|
-
AXMTermUpdateSettingAction: AXMTermUpdateSettingAction,
|
4460
|
-
AXMWhatsNewWorkflow: AXMWhatsNewWorkflow,
|
4461
|
-
appTermEntityEntityFactory: appTermEntityEntityFactory,
|
4462
|
-
appVersionEntityEntityFactory: appVersionEntityEntityFactory,
|
4463
|
-
dataSourceEntityFactory: dataSourceEntityFactory,
|
4464
|
-
globalVariableEntityFactory: globalVariableEntityFactory,
|
4465
|
-
glossaryEntityFactory: glossaryEntityFactory,
|
4466
|
-
metaDataDefinitionCategoryEntityFactory: metaDataDefinitionCategoryEntityFactory,
|
4467
|
-
metaDataDefinitionFactory: metaDataDefinitionFactory,
|
4468
|
-
promotionEntityFactory: promotionEntityFactory
|
4469
|
-
});
|
4470
|
-
|
4471
|
-
const path = 'regional:';
|
4472
|
-
var AXPRegionalSetting;
|
4473
|
-
(function (AXPRegionalSetting) {
|
4474
|
-
AXPRegionalSetting["LocaleProfile"] = "regional:locale-profile";
|
4475
|
-
AXPRegionalSetting["TimeZone"] = "regional:timezone";
|
4476
|
-
AXPRegionalSetting["Language"] = "regional:language";
|
4477
|
-
AXPRegionalSetting["Country"] = "regional:country";
|
4478
|
-
AXPRegionalSetting["Calendar"] = "regional:calendar";
|
4479
|
-
AXPRegionalSetting["FirstDayOfWeek"] = "regional:first-day-of-week";
|
4480
|
-
AXPRegionalSetting["WeekendDays"] = "regional:weekend-days";
|
4481
|
-
AXPRegionalSetting["ShortDate"] = "regional:short-date";
|
4482
|
-
AXPRegionalSetting["LongDate"] = "regional:long-date";
|
4483
|
-
AXPRegionalSetting["ShortTime"] = "regional:short-time";
|
4484
|
-
AXPRegionalSetting["LongTime"] = "regional:long-time";
|
4485
|
-
AXPRegionalSetting["MeasurementUnits"] = "regional:measurement-units";
|
4486
|
-
AXPRegionalSetting["TemperatureUnits"] = "regional:temperature-units";
|
4487
|
-
AXPRegionalSetting["DistanceUnits"] = "regional:distance-units";
|
4488
|
-
AXPRegionalSetting["WeightUnits"] = "regional:weight-units";
|
4489
|
-
AXPRegionalSetting["VolumeUnits"] = "regional:volume-units";
|
4490
|
-
AXPRegionalSetting["SpeedUnits"] = "regional:speed-units";
|
4491
|
-
AXPRegionalSetting["AreaUnits"] = "regional:area-units";
|
4492
|
-
})(AXPRegionalSetting || (AXPRegionalSetting = {}));
|
4493
|
-
|
4494
|
-
// Regional Store - Manages regional settings and system changes
|
4495
|
-
const AXPRegionalStoreService = signalStore({ providedIn: 'root' },
|
4496
|
-
// Initial State
|
4497
|
-
withState((localeService = inject(AXLocaleService)) => {
|
4498
|
-
const state = {
|
4499
|
-
profile: localeService.activeProfile().localeInfo.code,
|
4500
|
-
language: localeService.activeProfile().localeInfo.language,
|
4501
|
-
calendar: localeService.activeProfile().calendar.system,
|
4502
|
-
};
|
4503
|
-
return state;
|
4504
|
-
}),
|
4505
|
-
// Computed Signals
|
4506
|
-
// withComputed(({ }) => ({
|
4507
|
-
// })),
|
4508
|
-
// Methods for State Management
|
4509
|
-
withMethods((store, settingService = inject(AXPSettingService), localeService = inject(AXLocaleService), calendarService = inject(AXCalendarService), translateService = inject(AXTranslationService)) => {
|
4510
|
-
const applyChanges = async () => {
|
4511
|
-
const profile = localeService.activeProfile();
|
4512
|
-
const html = document.getElementsByTagName('html')[0];
|
4513
|
-
profile.i18nMeta?.rtl ? html.setAttribute('dir', 'rtl') : html.removeAttribute('dir');
|
4514
|
-
};
|
4515
|
-
return {
|
4516
|
-
async changeProfile(profileCode) {
|
4517
|
-
await localeService.setProfile(profileCode);
|
4518
|
-
const profile = localeService.activeProfile();
|
4519
|
-
//
|
4520
|
-
if (store.profile() != profile.localeInfo.code) {
|
4521
|
-
settingService.scope(AXPPlatformScope.User).set(AXPRegionalSetting.LocaleProfile, profile.localeInfo.code);
|
4522
|
-
settingService.scope(AXPPlatformScope.User).set(AXPRegionalSetting.Language, profile.localeInfo.code);
|
4523
|
-
patchState(store, { profile: profile.localeInfo.code });
|
4524
|
-
}
|
4525
|
-
//
|
4526
|
-
await applyChanges();
|
4527
|
-
},
|
4528
|
-
async loadSetting() {
|
4529
|
-
const profileCode = (await settingService.scope(AXPPlatformScope.User).get(AXPRegionalSetting.LocaleProfile));
|
4530
|
-
patchState(store, { profile: profileCode });
|
4531
|
-
await localeService.setProfile(profileCode);
|
4532
|
-
//
|
4533
|
-
// delay to ensure the profile is set and override the default
|
4534
|
-
setTimeout(async () => {
|
4535
|
-
const calendar = (await settingService.scope(AXPPlatformScope.User).get(AXPRegionalSetting.Calendar));
|
4536
|
-
patchState(store, { calendar: calendar });
|
4537
|
-
calendarService.setActiveCalendar(calendar);
|
4538
|
-
//
|
4539
|
-
const language = (await settingService.scope(AXPPlatformScope.User).get(AXPRegionalSetting.Language));
|
4540
|
-
patchState(store, { language: language });
|
4541
|
-
translateService.setActiveLang(language);
|
4542
|
-
//
|
4543
|
-
await applyChanges();
|
4544
|
-
});
|
4545
|
-
//
|
4546
|
-
},
|
4547
|
-
};
|
4548
|
-
}), withHooks((store, settingService = inject(AXPSettingService), translateService = inject(AXTranslationService)) => ({
|
4549
|
-
onInit() {
|
4550
|
-
settingService.onChanged.subscribe(async (setting) => {
|
4551
|
-
const keys = [
|
4552
|
-
AXPRegionalSetting.LocaleProfile,
|
4553
|
-
AXPRegionalSetting.Language,
|
4554
|
-
AXPRegionalSetting.Calendar
|
4555
|
-
];
|
4556
|
-
//
|
4557
|
-
if (keys.some(k => setting.keys.includes(k))) {
|
4558
|
-
await store.loadSetting();
|
4559
|
-
}
|
4560
|
-
});
|
4561
|
-
},
|
4562
|
-
onDestroy() { },
|
4563
|
-
})));
|
4564
|
-
|
4565
|
-
class AXMLanguageSlotComponent {
|
4566
|
-
constructor() {
|
4567
|
-
this.regionalService = inject(AXPRegionalService);
|
4568
|
-
this.store = inject(AXPRegionalStoreService);
|
4569
|
-
this.items = signal([]);
|
4570
|
-
}
|
4571
|
-
async ngOnInit() {
|
4572
|
-
const items = await this.regionalService.getLocaleProfiles();
|
4573
|
-
this.items.set(items);
|
4574
|
-
}
|
4575
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMLanguageSlotComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4576
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMLanguageSlotComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<ax-button color=\"primary\">\n <ax-icon class=\"fa-regular fa-globe\"> </ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n @for(lang of items(); track lang){\n <ax-button-item\n [text]=\"lang.title\"\n [selected]=\"store.profile() === lang.code\"\n (onClick)=\"store.changeProfile(lang.code)\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-flag\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n</ax-button>\n", dependencies: [{ kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i1$1.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i4$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3$1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: CommonModule }] }); }
|
4577
|
-
}
|
4578
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMLanguageSlotComponent, decorators: [{
|
4579
|
-
type: Component,
|
4580
|
-
args: [{ imports: [AXDropdownModule, AXDecoratorModule, AXPopoverModule, AXButtonModule, CommonModule], template: "<ax-button color=\"primary\">\n <ax-icon class=\"fa-regular fa-globe\"> </ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n @for(lang of items(); track lang){\n <ax-button-item\n [text]=\"lang.title\"\n [selected]=\"store.profile() === lang.code\"\n (onClick)=\"store.changeProfile(lang.code)\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-solid fa-flag\"> </ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n</ax-button>\n" }]
|
4581
|
-
}] });
|
4582
|
-
|
4583
|
-
class AXPRegionalWidgetDataSourceProvider {
|
4584
|
-
constructor() {
|
4585
|
-
this.regionalService = inject(AXPRegionalService);
|
4586
|
-
//#region Country
|
4587
|
-
this.country = {
|
4588
|
-
name: 'countries',
|
4589
|
-
title: 'Countries',
|
4590
|
-
textField: 'title',
|
4591
|
-
valueField: 'code',
|
4592
|
-
columns: [
|
4593
|
-
{
|
4594
|
-
name: 'code',
|
4595
|
-
title: 'Code',
|
4596
|
-
},
|
4597
|
-
{
|
4598
|
-
name: 'title',
|
4599
|
-
title: 'Title',
|
4600
|
-
},
|
4601
|
-
{
|
4602
|
-
name: 'timezone',
|
4603
|
-
title: 'Timezone',
|
3693
|
+
{
|
3694
|
+
name: 'timezone',
|
3695
|
+
title: 'Timezone',
|
4604
3696
|
},
|
4605
3697
|
],
|
4606
3698
|
source: async () => {
|
@@ -4804,7 +3896,7 @@ class AXMPlatformManagementCommonModule {
|
|
4804
3896
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
4805
3897
|
useFactory: async () => {
|
4806
3898
|
const injector = inject(Injector);
|
4807
|
-
const provider = (await import('./acorex-modules-platform-management-settings.provider-
|
3899
|
+
const provider = (await import('./acorex-modules-platform-management-settings.provider-CnGAUpof.mjs')).AXMRegionalSettingProvider;
|
4808
3900
|
return new provider(injector);
|
4809
3901
|
},
|
4810
3902
|
multi: true
|
@@ -4843,7 +3935,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
4843
3935
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
4844
3936
|
useFactory: async () => {
|
4845
3937
|
const injector = inject(Injector);
|
4846
|
-
const provider = (await import('./acorex-modules-platform-management-settings.provider-
|
3938
|
+
const provider = (await import('./acorex-modules-platform-management-settings.provider-CnGAUpof.mjs')).AXMRegionalSettingProvider;
|
4847
3939
|
return new provider(injector);
|
4848
3940
|
},
|
4849
3941
|
multi: true
|
@@ -4907,62 +3999,6 @@ class AXMDynamicDataSourceProvider {
|
|
4907
3999
|
}
|
4908
4000
|
}
|
4909
4001
|
|
4910
|
-
class AXMPromotionDataSourceDefinition {
|
4911
|
-
constructor() {
|
4912
|
-
this.promotionService = inject(AXMAppPromotionService);
|
4913
|
-
this.i18n = RootConfig.config.i18n;
|
4914
|
-
}
|
4915
|
-
items() {
|
4916
|
-
return Promise.resolve([
|
4917
|
-
{
|
4918
|
-
name: 'promotion',
|
4919
|
-
title: 'Promotion',
|
4920
|
-
source: () => {
|
4921
|
-
return new AXDataSource({
|
4922
|
-
load: async (_) => {
|
4923
|
-
try {
|
4924
|
-
const res = await this.promotionService.query();
|
4925
|
-
return {
|
4926
|
-
items: res.items,
|
4927
|
-
total: res.total,
|
4928
|
-
};
|
4929
|
-
}
|
4930
|
-
catch (e) {
|
4931
|
-
console.log(e);
|
4932
|
-
throw e;
|
4933
|
-
}
|
4934
|
-
},
|
4935
|
-
pageSize: 100,
|
4936
|
-
});
|
4937
|
-
},
|
4938
|
-
columns: [
|
4939
|
-
{
|
4940
|
-
name: 'id',
|
4941
|
-
title: 'ID',
|
4942
|
-
datatype: 'uuid',
|
4943
|
-
type: AXPWidgetsCatalog.text,
|
4944
|
-
},
|
4945
|
-
{
|
4946
|
-
name: 'title',
|
4947
|
-
//TODO translate
|
4948
|
-
title: `Title`,
|
4949
|
-
datatype: 'string',
|
4950
|
-
type: AXPWidgetsCatalog.text,
|
4951
|
-
},
|
4952
|
-
{
|
4953
|
-
name: 'body',
|
4954
|
-
title: `Body`,
|
4955
|
-
datatype: 'string',
|
4956
|
-
type: AXPWidgetsCatalog.richText,
|
4957
|
-
},
|
4958
|
-
],
|
4959
|
-
textField: 'title',
|
4960
|
-
valueField: 'id',
|
4961
|
-
},
|
4962
|
-
]);
|
4963
|
-
}
|
4964
|
-
}
|
4965
|
-
|
4966
4002
|
class AXMEntityLoader {
|
4967
4003
|
constructor() {
|
4968
4004
|
this.injector = inject(Injector);
|
@@ -4998,11 +4034,6 @@ class AXMEntityLoader {
|
|
4998
4034
|
resolve(entity(this.injector));
|
4999
4035
|
break;
|
5000
4036
|
}
|
5001
|
-
case RootConfig.entities.promotion.name: {
|
5002
|
-
const entity = (await Promise.resolve().then(function () { return index; })).promotionEntityFactory;
|
5003
|
-
resolve(entity(this.injector));
|
5004
|
-
break;
|
5005
|
-
}
|
5006
4037
|
case RootConfig.entities.dataSource.name: {
|
5007
4038
|
const entity = (await Promise.resolve().then(function () { return index; })).dataSourceEntityFactory;
|
5008
4039
|
resolve(entity(this.injector));
|
@@ -5088,7 +4119,7 @@ class AXMShowReleaseNotesPopupAction extends AXPWorkflowAction {
|
|
5088
4119
|
}
|
5089
4120
|
async execute(context) {
|
5090
4121
|
const scope = RootConfig.config.i18n;
|
5091
|
-
const comp = await (await import('./acorex-modules-platform-management-list-version.component-
|
4122
|
+
const comp = await (await import('./acorex-modules-platform-management-list-version.component-DhSicYd3.mjs')).AXMListVersionComponent;
|
5092
4123
|
this.popupService.open(comp, {
|
5093
4124
|
title: `t('release-notes',{scope: "${scope}"})`,
|
5094
4125
|
});
|
@@ -5348,15 +4379,6 @@ class AXMMenuProvider {
|
|
5348
4379
|
// requiredPermission: '',
|
5349
4380
|
},
|
5350
4381
|
},
|
5351
|
-
{
|
5352
|
-
priority: 9006,
|
5353
|
-
text: RootConfig.entities.promotion.title,
|
5354
|
-
path: this.entityService.createPath(RootConfig.module.name, RootConfig.entities.promotion.name),
|
5355
|
-
icon: RootConfig.entities.promotion.icon,
|
5356
|
-
data: {
|
5357
|
-
// requiredPermission: '',
|
5358
|
-
},
|
5359
|
-
},
|
5360
4382
|
{
|
5361
4383
|
priority: 9005,
|
5362
4384
|
text: RootConfig.entities.dataSource.title,
|
@@ -5528,10 +4550,6 @@ class AXMPlatformManagementModule {
|
|
5528
4550
|
provide: AXMAppTermService,
|
5529
4551
|
useClass: AXMAppTermServiceImpl,
|
5530
4552
|
},
|
5531
|
-
{
|
5532
|
-
provide: AXMAppPromotionService,
|
5533
|
-
useClass: AXMPromotionServiceImpl,
|
5534
|
-
},
|
5535
4553
|
{
|
5536
4554
|
provide: AXMDataSourceService,
|
5537
4555
|
useClass: AXMDataSourceServiceImpl,
|
@@ -5559,11 +4577,6 @@ class AXMPlatformManagementModule {
|
|
5559
4577
|
useClass: AXMDynamicDataSourceProvider,
|
5560
4578
|
multi: true,
|
5561
4579
|
},
|
5562
|
-
{
|
5563
|
-
provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
|
5564
|
-
useClass: AXMPromotionDataSourceDefinition,
|
5565
|
-
multi: true,
|
5566
|
-
},
|
5567
4580
|
{
|
5568
4581
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
5569
4582
|
useClass: AXPReleaseNotesSettingProvider,
|
@@ -5598,23 +4611,23 @@ class AXMPlatformManagementModule {
|
|
5598
4611
|
}),
|
5599
4612
|
AXPComponentSlotModule.forChild({
|
5600
4613
|
'side-menu-footer': [
|
5601
|
-
|
5602
|
-
|
5603
|
-
|
5604
|
-
|
5605
|
-
|
5606
|
-
|
5607
|
-
|
4614
|
+
// {
|
4615
|
+
// name: 'side-menu-footer',
|
4616
|
+
// component: AXMPromotionSlotComponent,
|
4617
|
+
// options: {
|
4618
|
+
// location: 'side-menu-footer',
|
4619
|
+
// },
|
4620
|
+
// },
|
5608
4621
|
],
|
5609
4622
|
'side-menu-header': [
|
5610
|
-
|
5611
|
-
|
5612
|
-
|
5613
|
-
|
5614
|
-
|
5615
|
-
|
5616
|
-
|
5617
|
-
|
4623
|
+
// {
|
4624
|
+
// name: 'side-menu-header',
|
4625
|
+
// component: AXMPromotionSlotComponent,
|
4626
|
+
// priority: 2,
|
4627
|
+
// options: {
|
4628
|
+
// location: 'side-menu-header',
|
4629
|
+
// },
|
4630
|
+
// },
|
5618
4631
|
],
|
5619
4632
|
})] }); }
|
5620
4633
|
}
|
@@ -5644,23 +4657,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5644
4657
|
}),
|
5645
4658
|
AXPComponentSlotModule.forChild({
|
5646
4659
|
'side-menu-footer': [
|
5647
|
-
|
5648
|
-
|
5649
|
-
|
5650
|
-
|
5651
|
-
|
5652
|
-
|
5653
|
-
|
4660
|
+
// {
|
4661
|
+
// name: 'side-menu-footer',
|
4662
|
+
// component: AXMPromotionSlotComponent,
|
4663
|
+
// options: {
|
4664
|
+
// location: 'side-menu-footer',
|
4665
|
+
// },
|
4666
|
+
// },
|
5654
4667
|
],
|
5655
4668
|
'side-menu-header': [
|
5656
|
-
|
5657
|
-
|
5658
|
-
|
5659
|
-
|
5660
|
-
|
5661
|
-
|
5662
|
-
|
5663
|
-
|
4669
|
+
// {
|
4670
|
+
// name: 'side-menu-header',
|
4671
|
+
// component: AXMPromotionSlotComponent,
|
4672
|
+
// priority: 2,
|
4673
|
+
// options: {
|
4674
|
+
// location: 'side-menu-header',
|
4675
|
+
// },
|
4676
|
+
// },
|
5664
4677
|
],
|
5665
4678
|
}),
|
5666
4679
|
],
|
@@ -5688,10 +4701,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5688
4701
|
provide: AXMAppTermService,
|
5689
4702
|
useClass: AXMAppTermServiceImpl,
|
5690
4703
|
},
|
5691
|
-
{
|
5692
|
-
provide: AXMAppPromotionService,
|
5693
|
-
useClass: AXMPromotionServiceImpl,
|
5694
|
-
},
|
5695
4704
|
{
|
5696
4705
|
provide: AXMDataSourceService,
|
5697
4706
|
useClass: AXMDataSourceServiceImpl,
|
@@ -5719,11 +4728,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5719
4728
|
useClass: AXMDynamicDataSourceProvider,
|
5720
4729
|
multi: true,
|
5721
4730
|
},
|
5722
|
-
{
|
5723
|
-
provide: AXP_DATASOURCE_DEFINITION_PROVIDER,
|
5724
|
-
useClass: AXMPromotionDataSourceDefinition,
|
5725
|
-
multi: true,
|
5726
|
-
},
|
5727
4731
|
{
|
5728
4732
|
provide: AXP_SETTING_DEFINITION_PROVIDER,
|
5729
4733
|
useClass: AXPReleaseNotesSettingProvider,
|
@@ -5746,5 +4750,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5746
4750
|
* Generated bundle index. Do not edit.
|
5747
4751
|
*/
|
5748
4752
|
|
5749
|
-
export { AXPRegionalSetting as A, AXMGlossaryServiceImpl as B, metaDataDefinitionFactory as C, AXMMetaDataDefinitionService as D, AXMPMetaDataDefinitionServiceImpl as E, metaDataDefinitionCategoryEntityFactory as F, AXMMetaDataDefinitionCategoryService as G, AXMMetaDataDefinitionCategoryServiceImpl as H,
|
5750
|
-
//# sourceMappingURL=acorex-modules-platform-management-acorex-modules-platform-management-
|
4753
|
+
export { AXPRegionalSetting as A, AXMGlossaryServiceImpl as B, metaDataDefinitionFactory as C, AXMMetaDataDefinitionService as D, AXMPMetaDataDefinitionServiceImpl as E, metaDataDefinitionCategoryEntityFactory as F, AXMMetaDataDefinitionCategoryService as G, AXMMetaDataDefinitionCategoryServiceImpl as H, AXPRegionalStoreService as I, AXMUpdaterModule as J, AXPUpdaterService as K, RootConfig as R, AXMAppVersionService as a, AXMPlatformManagementModule as b, appTermEntityEntityFactory as c, AXMAppTermService as d, AXMAppTermServiceImpl as e, AXMListTermsComponent as f, AXMNotifyNewTermPopupAction as g, AXMTermUpdateSettingAction as h, AXMNewTermWorkflow as i, appVersionEntityEntityFactory as j, AXMAppVersionServiceImpl as k, AXMNotifyAppComponent as l, AXMAppVersionSlotComponent as m, AXMChangeLogPopupAction as n, AXMChangeLogUpdateSettingAction as o, AXMWhatsNewWorkflow as p, AXMCheckNewVersionAction as q, AXMCheckNewVersionWorkflow as r, dataSourceEntityFactory as s, AXMDataSourceService as t, AXMDataSourceServiceImpl as u, globalVariableEntityFactory as v, AXMGlobalVariablesService as w, AXMGlobalVariablesServiceImpl as x, glossaryEntityFactory as y, AXMGlossaryService as z };
|
4754
|
+
//# sourceMappingURL=acorex-modules-platform-management-acorex-modules-platform-management-B8aACrqL.mjs.map
|