@acorex-platform/module-application-management-client 0.0.18 → 0.0.21

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.
Files changed (33) hide show
  1. package/fesm2022/{acorex-platform-module-application-management-client-application-status.provider-DqPlbWuW.mjs → acorex-platform-module-application-management-client-application-status.provider-Bz6cknzi.mjs} +4 -4
  2. package/fesm2022/{acorex-platform-module-application-management-client-application-status.provider-DqPlbWuW.mjs.map → acorex-platform-module-application-management-client-application-status.provider-Bz6cknzi.mjs.map} +1 -1
  3. package/fesm2022/{acorex-platform-module-application-management-client-assign-features.command-R7y4QKhC.mjs → acorex-platform-module-application-management-client-assign-features.command-BG986HtP.mjs} +23 -21
  4. package/fesm2022/acorex-platform-module-application-management-client-assign-features.command-BG986HtP.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-application-management-client-contracts.mjs +79 -1930
  6. package/fesm2022/acorex-platform-module-application-management-client-contracts.mjs.map +1 -1
  7. package/fesm2022/{acorex-platform-module-application-management-client-feature-definition.provider-Depetn50.mjs → acorex-platform-module-application-management-client-feature-definition.provider-V-wfUEZf.mjs} +4 -4
  8. package/fesm2022/{acorex-platform-module-application-management-client-feature-definition.provider-Depetn50.mjs.map → acorex-platform-module-application-management-client-feature-definition.provider-V-wfUEZf.mjs.map} +1 -1
  9. package/fesm2022/acorex-platform-module-application-management-client-features-editor.component-B5yrn7eX.mjs +584 -0
  10. package/fesm2022/acorex-platform-module-application-management-client-features-editor.component-B5yrn7eX.mjs.map +1 -0
  11. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-column.component-CiBGmw6I.mjs → acorex-platform-module-application-management-client-features-widget-column.component-C2OEG0LL.mjs} +7 -8
  12. package/fesm2022/acorex-platform-module-application-management-client-features-widget-column.component-C2OEG0LL.mjs.map +1 -0
  13. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-designer.component-nStj9BAw.mjs → acorex-platform-module-application-management-client-features-widget-designer.component-CMJwcY5f.mjs} +4 -4
  14. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-designer.component-nStj9BAw.mjs.map → acorex-platform-module-application-management-client-features-widget-designer.component-CMJwcY5f.mjs.map} +1 -1
  15. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-edit.component-BdHYm0Yr.mjs → acorex-platform-module-application-management-client-features-widget-edit.component-D_IBCjfM.mjs} +5 -5
  16. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-edit.component-BdHYm0Yr.mjs.map → acorex-platform-module-application-management-client-features-widget-edit.component-D_IBCjfM.mjs.map} +1 -1
  17. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-print.component-C6Z9uzRr.mjs → acorex-platform-module-application-management-client-features-widget-print.component-CkTEfzcY.mjs} +4 -4
  18. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-print.component-C6Z9uzRr.mjs.map → acorex-platform-module-application-management-client-features-widget-print.component-CkTEfzcY.mjs.map} +1 -1
  19. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-view.component-ysM1jD08.mjs → acorex-platform-module-application-management-client-features-widget-view.component-yKbBTqym.mjs} +12 -8
  20. package/fesm2022/{acorex-platform-module-application-management-client-features-widget-view.component-ysM1jD08.mjs.map → acorex-platform-module-application-management-client-features-widget-view.component-yKbBTqym.mjs.map} +1 -1
  21. package/fesm2022/acorex-platform-module-application-management-client-permission-definition.provider-MTs9VAE_.mjs +44 -0
  22. package/fesm2022/acorex-platform-module-application-management-client-permission-definition.provider-MTs9VAE_.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-application-management-client.mjs +256 -217
  24. package/fesm2022/acorex-platform-module-application-management-client.mjs.map +1 -1
  25. package/package.json +1 -1
  26. package/types/acorex-platform-module-application-management-client-contracts.d.ts +166 -51
  27. package/types/acorex-platform-module-application-management-client.d.ts +9 -17
  28. package/fesm2022/acorex-platform-module-application-management-client-assign-features.command-R7y4QKhC.mjs.map +0 -1
  29. package/fesm2022/acorex-platform-module-application-management-client-features-editor.component-BiYXAqYJ.mjs +0 -548
  30. package/fesm2022/acorex-platform-module-application-management-client-features-editor.component-BiYXAqYJ.mjs.map +0 -1
  31. package/fesm2022/acorex-platform-module-application-management-client-features-widget-column.component-CiBGmw6I.mjs.map +0 -1
  32. package/fesm2022/acorex-platform-module-application-management-client-permission-definition.provider-Dn5WiubC.mjs +0 -32
  33. package/fesm2022/acorex-platform-module-application-management-client-permission-definition.provider-Dn5WiubC.mjs.map +0 -1
@@ -1,5 +1,7 @@
1
- import { AXPEntity, AXPEntityModel } from '@acorex-platform/framework-shared/entity';
2
- import { AXPCategoryListItem, AXPSystemStatusType } from '@acorex-platform/framework-shared/core';
1
+ import { AXPContextDefinition, AXPMultiLanguageString, AXPCategoryListItem, AXPSystemStatusType } from '@acorex-platform/framework-shared/core';
2
+ import { AXPEntityModel } from '@acorex-platform/framework-shared/entity';
3
+
4
+ declare const AXM_APPLICATION_CONTEXT_DEFINITIONS: AXPContextDefinition[];
3
5
 
4
6
  declare const AXMApplicationManagementFeatureKeys: {};
5
7
 
@@ -13,12 +15,32 @@ declare const AXPApplicationManagementMenuKeys: {
13
15
  readonly HelpTerms: "ApplicationManagement:Menu:Help.Terms";
14
16
  };
15
17
 
18
+ /**
19
+ * Applications & Platform capabilities used by this module.
20
+ * Domain capability keys for this module. Root groups live in `AXPCommonPermissionGroupKeys` (common contracts).
21
+ */
22
+ declare const AXPApplicationsPlatformPermissionKeys: {
23
+ readonly Access: "ApplicationsPlatform:Permission:Access";
24
+ readonly MaintainApplications: "ApplicationsPlatform:Permission:MaintainApplications";
25
+ readonly MaintainTenants: "ApplicationsPlatform:Permission:MaintainTenants";
26
+ readonly MaintainPlatformShell: "ApplicationsPlatform:Permission:MaintainPlatformShell";
27
+ readonly MaintainLandingPages: "ApplicationsPlatform:Permission:MaintainLandingPages";
28
+ readonly MaintainIdentifiers: "ApplicationsPlatform:Permission:MaintainIdentifiers";
29
+ readonly MaintainTenantSettings: "ApplicationsPlatform:Permission:MaintainTenantSettings";
30
+ readonly MaintainPlatformSettings: "ApplicationsPlatform:Permission:MaintainPlatformSettings";
31
+ readonly MaintainLocales: "ApplicationsPlatform:Permission:MaintainLocales";
32
+ readonly UseDevTools: "ApplicationsPlatform:Permission:UseDevTools";
33
+ };
34
+ /**
35
+ * @deprecated Prefer {@link AXPApplicationsPlatformPermissionKeys}.
36
+ * Legacy nested shape kept so existing imports compile during migration.
37
+ */
16
38
  declare const AXMPermissionsKeys: {
17
- ApplicationManagement: {
18
- Root: string;
19
- Applications: string;
20
- ReleaseNotes: string;
21
- AppTerms: string;
39
+ readonly ApplicationManagement: {
40
+ readonly Root: "ApplicationsPlatform:Permission:MaintainApplications";
41
+ readonly Applications: "ApplicationsPlatform:Permission:MaintainApplications";
42
+ readonly ReleaseNotes: "ApplicationsPlatform:Permission:MaintainApplications";
43
+ readonly AppTerms: "ApplicationsPlatform:Permission:MaintainApplications";
22
44
  };
23
45
  };
24
46
 
@@ -26,7 +48,9 @@ declare enum AXPApplicationInfoSettings {
26
48
  DisplayPattern = "ApplicationManagement:Setting:ApplicationInfo.DisplayPattern",
27
49
  ApplicationTerms = "ApplicationManagement:Setting:Startup.ApplicationTerms",
28
50
  InitVersion = "ApplicationManagement:Setting:AppVersion.InitVersion",
29
- ReleaseNotes = "ApplicationManagement:Setting:Startup.ReleaseNotes"
51
+ ReleaseNotes = "ApplicationManagement:Setting:Startup.ReleaseNotes",
52
+ /** Last selected edition modules checklist view mode (`type` | `domain`). */
53
+ EditionModulesViewMode = "ApplicationManagement:Setting:EditionModules.ViewMode"
30
54
  }
31
55
  /**
32
56
  * Get the setting key for tracking if a specific version has been seen
@@ -35,43 +59,142 @@ declare enum AXPApplicationInfoSettings {
35
59
  */
36
60
  declare function getAppVersionSeenKey(versionNumber: string): string;
37
61
 
62
+ declare const AXMApplicationManagementServerCommands: {
63
+ readonly SetupTenant: "ApplicationManagement:Server:SetupTenant";
64
+ };
65
+ interface AXMSetupTenantInput {
66
+ /** Target tenant id. Required unless `allTenants` is true. */
67
+ tenantId?: string;
68
+ /**
69
+ * When true, run setup for every tenant row (demo seed / ops).
70
+ * Ignores `tenantId`.
71
+ */
72
+ allTenants?: boolean;
73
+ /**
74
+ * When set, only these modules run (must still be subscribed).
75
+ * When omitted, all subscribed modules with registered setup handlers run.
76
+ */
77
+ moduleNames?: string[];
78
+ /**
79
+ * Apply industry starter-pack contributions after module setup.
80
+ * Default true when tenant has `industryId` and matching contributions exist.
81
+ */
82
+ applyStarterPack?: boolean;
83
+ /** Force re-run even when ledger version matches (future use). */
84
+ force?: boolean;
85
+ }
86
+ interface AXMSetupTenantResult {
87
+ tenantIds: string[];
88
+ modulesRun: string[];
89
+ industryPacksRun: string[];
90
+ }
91
+
92
+ /**
93
+ * Context passed to every module setup / industry pack contribution.
94
+ * Handlers must be idempotent (create-if-missing / upsert by stable keys).
95
+ */
96
+ interface TenantModuleSetupContext {
97
+ tenantId: string;
98
+ /** Tenant `industryId` when set. */
99
+ industryId?: string;
100
+ /** Resolved `BusinessCore.Industry.code` when available (e.g. `CONSTR`). */
101
+ industryCode?: string;
102
+ /** Modules enabled for this tenant via active subscription → edition. */
103
+ enabledModules: readonly string[];
104
+ /** When true, industry pack contributions may run after module setup. */
105
+ applyStarterPack: boolean;
106
+ }
107
+ interface ModuleSetupProvider {
108
+ /** Module name matching edition `modulesAndFeatures.modules` (e.g. `ProjectManagement`). */
109
+ moduleName: string;
110
+ /** Other module names that must complete setup first. */
111
+ dependsOn?: readonly string[];
112
+ /**
113
+ * When true, run even if the module is not listed on the tenant's edition
114
+ * (platform core: settings, tenant org defaults, etc.).
115
+ */
116
+ always?: boolean;
117
+ /** Bump when master data shape changes so callers can force re-apply. */
118
+ version?: string;
119
+ /** Source label for diagnostics. */
120
+ layer?: string;
121
+ run(context: TenantModuleSetupContext): Promise<void>;
122
+ }
123
+ interface IndustryPackContributionProvider {
124
+ /** Industry code from `BusinessCore.Industry.code` (e.g. `CONSTR`). */
125
+ industryCode: string;
126
+ /** Module that owns this contribution; skipped if module is not enabled. */
127
+ moduleName: string;
128
+ dependsOn?: readonly string[];
129
+ version?: string;
130
+ layer?: string;
131
+ run(context: TenantModuleSetupContext): Promise<void>;
132
+ }
133
+ declare const MODULE_SETUP_PROVIDER: unique symbol;
134
+ declare const INDUSTRY_PACK_PROVIDER: unique symbol;
135
+ /** Nest `multi: true` registration for a module's tenant setup handler. */
136
+ declare function provideModuleSetup(provider: ModuleSetupProvider): {
137
+ readonly provide: typeof MODULE_SETUP_PROVIDER;
138
+ readonly useValue: ModuleSetupProvider;
139
+ readonly multi: true;
140
+ };
141
+ /** Nest `multi: true` registration for an industry starter-pack contribution. */
142
+ declare function provideIndustryPackContribution(provider: IndustryPackContributionProvider): {
143
+ readonly provide: typeof INDUSTRY_PACK_PROVIDER;
144
+ readonly useValue: IndustryPackContributionProvider;
145
+ readonly multi: true;
146
+ };
147
+
148
+ /** Coarse industry codes used by starter packs (`BusinessCore.Industry.code`). */
149
+ declare const AXM_INDUSTRY_PACK_CODES: {
150
+ readonly Construction: "CONSTR";
151
+ readonly Software: "SOFTWARE";
152
+ };
153
+ type AXMIndustryPackCode = (typeof AXM_INDUSTRY_PACK_CODES)[keyof typeof AXM_INDUSTRY_PACK_CODES];
154
+
38
155
  declare const RootConfig: {
39
- config: {
156
+ readonly config: {
40
157
  i18n: string;
41
158
  module: string;
42
159
  };
43
- module: {
44
- route: string;
45
- name: string;
46
- title: string;
47
- icon: string;
160
+ readonly module: {
161
+ readonly route: "application-management";
162
+ readonly name: string;
163
+ readonly title: `@${string}:module.title`;
164
+ readonly icon: "fa-light fa-cogs";
48
165
  };
49
- entities: {
50
- application: {
51
- name: string;
52
- title: string;
53
- titlePlural: string;
54
- icon: string;
166
+ readonly entities: {
167
+ readonly application: {
168
+ readonly name: "Application";
169
+ readonly title: `@${string}:applications.entities.application.title`;
170
+ readonly titlePlural: `@${string}:applications.entities.application.plural`;
171
+ readonly icon: "fa-light fa-cube";
172
+ };
173
+ readonly edition: {
174
+ readonly name: "Edition";
175
+ readonly title: `@${string}:editions.entities.edition.title`;
176
+ readonly titlePlural: `@${string}:editions.entities.edition.plural`;
177
+ readonly icon: "fa-light fa-layer-group";
55
178
  };
56
- edition: {
57
- name: string;
58
- title: string;
59
- titlePlural: string;
60
- icon: string;
179
+ readonly appVersion: {
180
+ readonly name: "AppVersion";
181
+ readonly title: `@${string}:app-versions.entities.app-version.title`;
182
+ readonly titlePlural: `@${string}:app-versions.entities.app-version.plural`;
183
+ readonly icon: "fa-light fa-code-branch";
61
184
  };
62
- appVersion: {
63
- name: string;
64
- title: string;
65
- titlePlural: string;
66
- icon: string;
185
+ readonly appTerm: {
186
+ readonly name: "AppTerm";
187
+ readonly title: `@${string}:app-terms.entities.app-term.title`;
188
+ readonly titlePlural: `@${string}:app-terms.entities.app-term.plural`;
189
+ readonly pageTitle: `@${string}:app-terms.pages.terms-page.title`;
190
+ readonly pageDescription: `@${string}:app-terms.pages.terms-page.description`;
191
+ readonly icon: "fa-light fa-scale-balanced";
67
192
  };
68
- appTerm: {
69
- name: string;
70
- title: string;
71
- titlePlural: string;
72
- pageTitle: string;
73
- pageDescription: string;
74
- icon: string;
193
+ };
194
+ readonly queries: {
195
+ readonly reports: {
196
+ readonly getApplicationVersionsTimeline: `${string}:Reports:GetApplicationVersionsTimeline`;
197
+ readonly getApplicationVersionsChartData: `${string}:Reports:GetApplicationVersionsChartData`;
75
198
  };
76
199
  };
77
200
  };
@@ -81,15 +204,9 @@ declare const AXMApplicationManagementModuleConst: {
81
204
  readonly i18n: "platform-management";
82
205
  };
83
206
 
84
- declare function appTermEntityEntityFactory(): Promise<AXPEntity | null>;
85
-
86
- declare function applicationEntityFactory(): Promise<AXPEntity | null>;
87
-
88
- declare function editionEntityFactory(): Promise<AXPEntity | null>;
89
-
90
207
  interface AXMApplicationManagementEditionEntityModel extends AXPEntityModel<string> {
91
- title: string;
92
- description?: string;
208
+ title: AXPMultiLanguageString;
209
+ description?: AXPMultiLanguageString;
93
210
  /**
94
211
  * Modules and features configuration for this edition.
95
212
  * Format: { modules: string[], features: Record<string, any> }
@@ -102,8 +219,8 @@ interface AXMApplicationManagementEditionEntityModel extends AXPEntityModel<stri
102
219
 
103
220
  interface AXMApplicationManagementApplicationEntityModel extends AXPEntityModel<string> {
104
221
  code?: string;
105
- title: string;
106
- description?: string;
222
+ title: AXPMultiLanguageString;
223
+ description?: AXPMultiLanguageString;
107
224
  version?: string;
108
225
  /** Assigned by the category plugin (`categoryIds`). */
109
226
  categoryIds?: string[];
@@ -143,8 +260,6 @@ interface AXMAppTermViewModel {
143
260
  applicationId?: string;
144
261
  }
145
262
 
146
- declare function appVersionEntityEntityFactory(): Promise<AXPEntity | null>;
147
-
148
263
  interface AXMAppVersionEntityModel extends AXPEntityModel<string> {
149
264
  versionNumber: string;
150
265
  publishDate: string;
@@ -157,5 +272,5 @@ interface AXMAppVersionListComponentModel {
157
272
  content: any;
158
273
  }
159
274
 
160
- export { AXMApplicationManagementFeatureKeys, AXMApplicationManagementModuleConst, AXMPermissionsKeys, AXPApplicationInfoSettings, AXPApplicationManagementMenuKeys, RootConfig, appTermEntityEntityFactory, appVersionEntityEntityFactory, applicationEntityFactory, editionEntityFactory, getAppVersionSeenKey };
161
- export type { AXMAppTermEntityModel, AXMAppTermViewModel, AXMAppVersionEntityModel, AXMAppVersionListComponentModel, AXMApplicationManagementApplicationEntityModel, AXMApplicationManagementEditionEntityModel };
275
+ export { AXMApplicationManagementFeatureKeys, AXMApplicationManagementModuleConst, AXMApplicationManagementServerCommands, AXMPermissionsKeys, AXM_APPLICATION_CONTEXT_DEFINITIONS, AXM_INDUSTRY_PACK_CODES, AXPApplicationInfoSettings, AXPApplicationManagementMenuKeys, AXPApplicationsPlatformPermissionKeys, INDUSTRY_PACK_PROVIDER, MODULE_SETUP_PROVIDER, RootConfig, getAppVersionSeenKey, provideIndustryPackContribution, provideModuleSetup };
276
+ export type { AXMAppTermEntityModel, AXMAppTermViewModel, AXMAppVersionEntityModel, AXMAppVersionListComponentModel, AXMApplicationManagementApplicationEntityModel, AXMApplicationManagementEditionEntityModel, AXMIndustryPackCode, AXMSetupTenantInput, AXMSetupTenantResult, IndustryPackContributionProvider, ModuleSetupProvider, TenantModuleSetupContext };
@@ -1,18 +1,20 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import * as i1 from '@acorex-platform/framework-client/layout/widget-core';
3
3
  import * as i2 from '@acorex-platform/framework-client/core';
4
- import { AXPEntity } from '@acorex-platform/framework-shared/entity';
5
- import { AXPEntityDefinitionLoader } from '@acorex-platform/framework-client/layout/entity';
6
4
  import { AXPMenuProvider, AXPMenuProviderContext, AXPSearchCommandProvider, AXPSearchResult } from '@acorex-platform/framework-client/common';
7
5
 
8
6
  declare class AXMAppTermsCheckService {
9
7
  private readonly entityService;
10
- private settingsService;
8
+ private readonly settingsService;
11
9
  private readonly commandService;
12
- private appTermService;
13
- private appInitService;
14
- private sessionService;
10
+ private readonly appInitService;
11
+ private readonly sessionService;
12
+ private readonly destroyRef;
13
+ private readonly appTermService;
14
+ private termsCheckGeneration;
15
15
  constructor();
16
+ private evaluateUnconfirmedTerms;
17
+ private canCheckTerms;
16
18
  static ɵfac: i0.ɵɵFactoryDeclaration<AXMAppTermsCheckService, never>;
17
19
  static ɵprov: i0.ɵɵInjectableDeclaration<AXMAppTermsCheckService>;
18
20
  }
@@ -30,16 +32,6 @@ declare class AXMApplicationManagementModule {
30
32
  static ɵinj: i0.ɵɵInjectorDeclaration<AXMApplicationManagementModule>;
31
33
  }
32
34
 
33
- declare class AXMEntityProvider implements AXPEntityDefinitionLoader {
34
- get(moduleName: string, entityName: string): Promise<AXPEntity | null>;
35
- list(): Promise<{
36
- name: string;
37
- module: string;
38
- }[]>;
39
- static ɵfac: i0.ɵɵFactoryDeclaration<AXMEntityProvider, never>;
40
- static ɵprov: i0.ɵɵInjectableDeclaration<AXMEntityProvider>;
41
- }
42
-
43
35
  declare class AXMApplicationManagmentModuleMenuProvider implements AXPMenuProvider {
44
36
  private entityService;
45
37
  private sessionService;
@@ -54,4 +46,4 @@ declare class AXMSearchCommandProvider extends AXPSearchCommandProvider {
54
46
  static ɵprov: i0.ɵɵInjectableDeclaration<AXMSearchCommandProvider>;
55
47
  }
56
48
 
57
- export { AXMApplicationManagementModule, AXMApplicationManagmentModuleMenuProvider, AXMEntityProvider, AXMSearchCommandProvider };
49
+ export { AXMApplicationManagementModule, AXMApplicationManagmentModuleMenuProvider, AXMSearchCommandProvider };
@@ -1 +0,0 @@
1
- {"version":3,"file":"acorex-platform-module-application-management-client-assign-features.command-R7y4QKhC.mjs","sources":["../../../../libs/modules/application-management/client/src/lib/features/features-widget/features-editor-popup.component.ts","../../../../libs/modules/application-management/client/src/lib/features/features-widget/commands/assign-features.command.ts"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXDecoratorModule } from '@acorex/components/decorators';\nimport { AXBasePageComponent } from '@acorex/components/page';\nimport { Component, input, signal } from '@angular/core';\n\nimport { AXPFeaturesEditorComponent } from './features-editor.component';\n\n@Component({\n template: `\n <div class=\"flex flex-col h-full\">\n <ax-content class=\"flex-1 overflow-auto p-4\">\n <axm-features-editor\n [initialValue]=\"initialValue()\"\n [readOnly]=\"false\"\n (valueChanged)=\"onValueChanged($event)\"\n />\n </ax-content>\n <ax-footer>\n <ax-suffix>\n <ax-button text=\"Cancel\" (onClick)=\"close()\"></ax-button>\n <ax-button color=\"primary\" text=\"Save\" (onClick)=\"save()\"></ax-button>\n </ax-suffix>\n </ax-footer>\n </div>\n `,\n imports: [AXDecoratorModule, AXButtonModule, AXPFeaturesEditorComponent],\n})\nexport class AXPFeaturesEditorPopupComponent extends AXBasePageComponent {\n initialValue = input<{ modules?: string[]; features?: Record<string, unknown> }>({});\n\n private latestValue = signal<{ modules: string[]; features: Record<string, unknown> }>({\n modules: [],\n features: {},\n });\n\n override ngOnInit(): void {\n super.ngOnInit();\n const initial = this.initialValue();\n this.latestValue.set({\n modules: initial.modules ?? [],\n features: initial.features ?? {},\n });\n }\n\n protected onValueChanged(value: { modules: string[]; features: Record<string, unknown> }): void {\n this.latestValue.set(value);\n }\n\n protected save(): void {\n this.close(this.latestValue());\n }\n}\n","//#region ---- Imports ----\n\nimport { AXPopupService } from '@acorex/components/popup';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport {\n AXPCommonSettings,\n AXPRefreshEvent,\n AXPSettingsService,\n} from '@acorex-platform/framework-client/common';\nimport { AXPEntityDefinitionRegistryService, AXPEntityModifyEvent } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPWorkflowEventService } from '@acorex-platform/framework-client/workflow';\nimport { AXPExecuteCommandResult } from '@acorex-platform/framework-shared/core';\nimport { AXPCommand } from '@acorex-platform/framework-shared/runtime';\nimport { RootConfig } from '@acorex-platform/module-application-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { AXPFeaturesEditorPopupComponent } from '../features-editor-popup.component';\n\n//#endregion\n\n//#region ---- Types ----\n\nexport interface AXMAssignFeaturesCommandInput {\n __context__?: {\n data?: Record<string, unknown>;\n entity?: string;\n options?: unknown;\n };\n}\n\n//#endregion\n\n//#region ---- Assign features command ----\n\n@Injectable({ providedIn: 'root' })\nexport class AXMAssignFeaturesCommand implements AXPCommand<AXMAssignFeaturesCommandInput, AXPExecuteCommandResult> {\n private readonly popupService = inject(AXPopupService);\n private readonly translationService = inject(AXTranslationService);\n private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);\n private readonly toastService = inject(AXToastService);\n private readonly settingsService = inject(AXPSettingsService);\n private readonly workflowEventService = inject(AXPWorkflowEventService);\n\n async execute(input: AXMAssignFeaturesCommandInput = {}): Promise<AXPExecuteCommandResult> {\n const row = input.__context__?.data;\n const id = row?.['id'];\n if (!id) {\n return { success: false, message: { text: 'Edition data with id is required.' } };\n }\n\n const title = await this.translationService.translateAsync(\n '@application-management:features-widget.terms.features',\n );\n const entityTitle = row['title'] ?? row['name'] ?? id;\n\n const modulesAndFeatures = (row['modulesAndFeatures'] as {\n modules?: string[];\n features?: Record<string, unknown>;\n }) ?? { modules: [], features: {} };\n\n const popupResult = await this.popupService.open(AXPFeaturesEditorPopupComponent, {\n title: `${title} - ${entityTitle}`,\n size: 'lg',\n data: {\n initialValue: modulesAndFeatures,\n },\n });\n\n const nextValue = popupResult?.data as { modules?: string[]; features?: Record<string, unknown> } | undefined;\n if (!nextValue) {\n return { success: true, data: null };\n }\n\n const entityKey = `${RootConfig.module.name}.${RootConfig.entities.edition.name}`;\n const [moduleName, entityName] = entityKey.split('.');\n const entityRef = await this.entityRegistry.resolve(moduleName, entityName);\n const updatePayload = {\n ...row,\n modulesAndFeatures: nextValue,\n };\n\n const updated = await (entityRef.commands?.update?.execute as (\n data: Record<string, unknown>,\n ) => Promise<Record<string, unknown>>)(updatePayload);\n\n await this.showSuccessToast();\n this.workflowEventService.dispatch(AXPEntityModifyEvent({ entity: entityKey, values: updated }));\n this.workflowEventService.dispatch(AXPRefreshEvent({ entity: entityKey }));\n\n return { success: true, data: nextValue };\n }\n\n private async showSuccessToast(): Promise<void> {\n const enableOperationToasts = await this.settingsService.get<boolean>(AXPCommonSettings.EnableOperationToasts);\n if (!enableOperationToasts) {\n return;\n }\n\n this.toastService.show({\n color: 'success',\n title: await this.translationService.translateAsync('@general:workflow.entity-modified-title'),\n content: await this.translationService.translateAsync('@general:workflow.entity-modified-body'),\n closeButton: true,\n timeOut: 3000,\n timeOutProgress: true,\n });\n }\n}\n\n//#endregion\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;AA2BM,MAAO,+BAAgC,SAAQ,mBAAmB,CAAA;AApBxE,IAAA,WAAA,GAAA;;AAqBE,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK,CAA6D,EAAE,mFAAC;QAE5E,IAAA,CAAA,WAAW,GAAG,MAAM,CAA2D;AACrF,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,QAAQ,EAAE,EAAE;AACb,SAAA,EAAA,IAAA,SAAA,GAAA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