@acorex-platform/module-software-management-client 1.0.1 → 2.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/fesm2022/{acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs → acorex-platform-module-software-management-client-accept-software-suggestion.command-BzPDjIw0.mjs} +7 -6
  2. package/fesm2022/acorex-platform-module-software-management-client-accept-software-suggestion.command-BzPDjIw0.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-software-management-client-behavior-specification.commands-4rkD2uP9.mjs +212 -0
  4. package/fesm2022/acorex-platform-module-software-management-client-behavior-specification.commands-4rkD2uP9.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-software-management-client-behavior-task.activities-WmCC3-3L.mjs +79 -0
  6. package/fesm2022/acorex-platform-module-software-management-client-behavior-task.activities-WmCC3-3L.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-software-management-client-complete-software-phase.activity-C61GUc78.mjs +512 -0
  8. package/fesm2022/acorex-platform-module-software-management-client-complete-software-phase.activity-C61GUc78.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-software-management-client-contracts-acceptance-criterion.entity-CHEusZ4z.mjs +62 -0
  10. package/fesm2022/acorex-platform-module-software-management-client-contracts-acceptance-criterion.entity-CHEusZ4z.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-software-management-client-contracts-business-rule.entity-Cew1yY4A.mjs +76 -0
  12. package/fesm2022/acorex-platform-module-software-management-client-contracts-business-rule.entity-Cew1yY4A.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-software-management-client-contracts-design-decision.entity-BDRnAUj9.mjs +94 -0
  14. package/fesm2022/acorex-platform-module-software-management-client-contracts-design-decision.entity-BDRnAUj9.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-software-management-client-contracts-discovery-item.entity-Ah5hlc5n.mjs +71 -0
  16. package/fesm2022/acorex-platform-module-software-management-client-contracts-discovery-item.entity-Ah5hlc5n.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-module-software-management-client-contracts-feature.entity-D9es0yAv.mjs +49 -0
  18. package/fesm2022/acorex-platform-module-software-management-client-contracts-feature.entity-D9es0yAv.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-module-software-management-client-contracts-module.entity-E9XKlo1v.mjs +26 -0
  20. package/fesm2022/acorex-platform-module-software-management-client-contracts-module.entity-E9XKlo1v.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-software-management-client-contracts-requirement.entity-DKr-En_J.mjs +86 -0
  22. package/fesm2022/acorex-platform-module-software-management-client-contracts-requirement.entity-DKr-En_J.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-software-management-client-contracts-scope-item.entity-D25tkUvi.mjs +73 -0
  24. package/fesm2022/acorex-platform-module-software-management-client-contracts-scope-item.entity-D25tkUvi.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-module-software-management-client-contracts-software-entity.util-sRHl21Jh.mjs +281 -0
  26. package/fesm2022/acorex-platform-module-software-management-client-contracts-software-entity.util-sRHl21Jh.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-software-management-client-contracts-software.entity-DfeM7KfF.mjs +751 -0
  28. package/fesm2022/acorex-platform-module-software-management-client-contracts-software.entity-DfeM7KfF.mjs.map +1 -0
  29. package/fesm2022/acorex-platform-module-software-management-client-contracts-use-case.entity-dPBFz-xN.mjs +92 -0
  30. package/fesm2022/acorex-platform-module-software-management-client-contracts-use-case.entity-dPBFz-xN.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-module-software-management-client-contracts.mjs +2709 -156
  32. package/fesm2022/acorex-platform-module-software-management-client-contracts.mjs.map +1 -1
  33. package/fesm2022/acorex-platform-module-software-management-client-delivery-plan.commands-ccrjppbE.mjs +212 -0
  34. package/fesm2022/acorex-platform-module-software-management-client-delivery-plan.commands-ccrjppbE.mjs.map +1 -0
  35. package/fesm2022/acorex-platform-module-software-management-client-delivery-task.activities-L955X3RX.mjs +216 -0
  36. package/fesm2022/acorex-platform-module-software-management-client-delivery-task.activities-L955X3RX.mjs.map +1 -0
  37. package/fesm2022/acorex-platform-module-software-management-client-design-document.commands-BDE3x0KG.mjs +212 -0
  38. package/fesm2022/acorex-platform-module-software-management-client-design-document.commands-BDE3x0KG.mjs.map +1 -0
  39. package/fesm2022/acorex-platform-module-software-management-client-design-task.activities-Cra2LNal.mjs +79 -0
  40. package/fesm2022/acorex-platform-module-software-management-client-design-task.activities-Cra2LNal.mjs.map +1 -0
  41. package/fesm2022/{acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs → acorex-platform-module-software-management-client-discovery-kickoff.commands-BZxzDJs9.mjs} +4 -2
  42. package/fesm2022/{acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs.map → acorex-platform-module-software-management-client-discovery-kickoff.commands-BZxzDJs9.mjs.map} +1 -1
  43. package/fesm2022/{acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs → acorex-platform-module-software-management-client-discovery-report.commands-C9GKrnHs.mjs} +3 -2
  44. package/fesm2022/acorex-platform-module-software-management-client-discovery-report.commands-C9GKrnHs.mjs.map +1 -0
  45. package/fesm2022/acorex-platform-module-software-management-client-discovery-task.activities-PIJEUza7.mjs +228 -0
  46. package/fesm2022/acorex-platform-module-software-management-client-discovery-task.activities-PIJEUza7.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs → acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs} +1 -1
  48. package/fesm2022/{acorex-platform-module-software-management-client-introduction-exit-message.util-DShFM8MY.mjs.map → acorex-platform-module-software-management-client-introduction-exit-message.util-cYtN92HY.mjs.map} +1 -1
  49. package/fesm2022/{acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs → acorex-platform-module-software-management-client-introduction-task.activities-DQPpsJaH.mjs} +78 -3
  50. package/fesm2022/acorex-platform-module-software-management-client-introduction-task.activities-DQPpsJaH.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-module-software-management-client-scope-document.commands-oLGsbLoA.mjs +212 -0
  52. package/fesm2022/acorex-platform-module-software-management-client-scope-document.commands-oLGsbLoA.mjs.map +1 -0
  53. package/fesm2022/acorex-platform-module-software-management-client-scope-task.activities-BCSPq0eO.mjs +79 -0
  54. package/fesm2022/acorex-platform-module-software-management-client-scope-task.activities-BCSPq0eO.mjs.map +1 -0
  55. package/fesm2022/{acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs → acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs} +1 -1
  56. package/fesm2022/{acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs.map → acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs.map} +1 -1
  57. package/fesm2022/{acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs → acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs} +2 -2
  58. package/fesm2022/{acorex-platform-module-software-management-client-start-software-definition-flow.command-B0YCgv2V.mjs.map → acorex-platform-module-software-management-client-start-software-definition-flow.command-BfxtMIGb.mjs.map} +1 -1
  59. package/fesm2022/acorex-platform-module-software-management-client.mjs +400 -32
  60. package/fesm2022/acorex-platform-module-software-management-client.mjs.map +1 -1
  61. package/i18n/en-AU/software-management.json +473 -24
  62. package/i18n/en-US/software-management.json +473 -24
  63. package/i18n/fa-IR/software-management.json +474 -25
  64. package/package.json +1 -1
  65. package/types/acorex-platform-module-software-management-client-contracts.d.ts +640 -11
  66. package/fesm2022/acorex-platform-module-software-management-client-accept-software-suggestion.command-DVcM5TTv.mjs.map +0 -1
  67. package/fesm2022/acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs +0 -182
  68. package/fesm2022/acorex-platform-module-software-management-client-complete-software-phase.activity-C56HhK20.mjs.map +0 -1
  69. package/fesm2022/acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs.map +0 -1
  70. package/fesm2022/acorex-platform-module-software-management-client-introduction-task.activities-BOsJbeJe.mjs.map +0 -1
@@ -0,0 +1,212 @@
1
+ import { AXToastService } from '@acorex/components/toast';
2
+ import { AXTranslationService } from '@acorex/core/translation';
3
+ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
4
+ import { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';
5
+ import { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';
6
+ import { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';
7
+ import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtime';
8
+ import { AXPSoftwareManagementCommandKeys, kickoffText, RootConfig, kickoffPlainTextFromVersion } from '@acorex-platform/module-software-management-client/contracts';
9
+ import * as i0 from '@angular/core';
10
+ import { inject, Injectable } from '@angular/core';
11
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
12
+
13
+ //#region ----- Imports -----
14
+ //#endregion
15
+ //#region ----- Helpers -----
16
+ function resolveSoftwareId(input) {
17
+ const resolved = resolveEntityActionRef(input);
18
+ const fromRef = resolveSoftwareText(resolved?.refId);
19
+ if (fromRef) {
20
+ return fromRef;
21
+ }
22
+ if (!input || typeof input !== 'object') {
23
+ return '';
24
+ }
25
+ const row = input;
26
+ return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);
27
+ }
28
+ function messageText(result) {
29
+ return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();
30
+ }
31
+ //#endregion
32
+ //#region ----- Remote design commands -----
33
+ class DesignDocumentRemoteCommand {
34
+ constructor() {
35
+ this.executor = inject(AXPCommandExecutor);
36
+ this.toast = inject(AXToastService);
37
+ this.i18n = inject(AXTranslationService);
38
+ }
39
+ async execute(input) {
40
+ const softwareId = resolveSoftwareId(input);
41
+ if (!softwareId) {
42
+ const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');
43
+ this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });
44
+ return { success: false, message: { text } };
45
+ }
46
+ const result = await this.executor.executeRemote(this.commandKey, {
47
+ softwareId,
48
+ locale: this.i18n.getActiveLang?.() ?? 'en-US',
49
+ });
50
+ const text = await this.translateMessage(messageText(result));
51
+ if (!result?.success) {
52
+ this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 6000 });
53
+ return { success: false, message: { text } };
54
+ }
55
+ await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);
56
+ this.toast.show({ color: 'success', title: text, content: text, closeButton: true, timeOut: 6000 });
57
+ return result;
58
+ }
59
+ async afterSuccess(data) {
60
+ void data;
61
+ }
62
+ async translateMessage(text) {
63
+ if (!text) {
64
+ return this.i18n.translateAsync('@software-management:messages.design.failed');
65
+ }
66
+ if (text.startsWith('@')) {
67
+ return this.i18n.translateAsync(text);
68
+ }
69
+ return text;
70
+ }
71
+ }
72
+ class GenerateDesignDocumentCommand extends DesignDocumentRemoteCommand {
73
+ constructor() {
74
+ super(...arguments);
75
+ this.commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateDesignDocument;
76
+ }
77
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GenerateDesignDocumentCommand, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
78
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GenerateDesignDocumentCommand, providedIn: 'root' }); }
79
+ }
80
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GenerateDesignDocumentCommand, decorators: [{
81
+ type: Injectable,
82
+ args: [{ providedIn: 'root' }]
83
+ }] });
84
+ class SubmitDesignDocumentCommand extends DesignDocumentRemoteCommand {
85
+ constructor() {
86
+ super(...arguments);
87
+ this.commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitDesignDocument;
88
+ }
89
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SubmitDesignDocumentCommand, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
90
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SubmitDesignDocumentCommand, providedIn: 'root' }); }
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SubmitDesignDocumentCommand, decorators: [{
93
+ type: Injectable,
94
+ args: [{ providedIn: 'root' }]
95
+ }] });
96
+ class ExportDesignPdfCommand extends DesignDocumentRemoteCommand {
97
+ constructor() {
98
+ super(...arguments);
99
+ this.commandKey = AXPSoftwareManagementCommandKeys.Software.ExportDesignPdf;
100
+ }
101
+ async afterSuccess(data) {
102
+ const base64 = kickoffText(data?.['base64']);
103
+ if (!base64 || typeof document === 'undefined') {
104
+ return;
105
+ }
106
+ const binary = atob(base64);
107
+ const bytes = new Uint8Array(binary.length);
108
+ for (let index = 0; index < binary.length; index += 1) {
109
+ bytes[index] = binary.charCodeAt(index);
110
+ }
111
+ const blob = new Blob([bytes], { type: 'application/pdf' });
112
+ const url = URL.createObjectURL(blob);
113
+ const anchor = document.createElement('a');
114
+ anchor.href = url;
115
+ anchor.download = kickoffText(data?.['filename']) || 'design.pdf';
116
+ anchor.click();
117
+ URL.revokeObjectURL(url);
118
+ }
119
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ExportDesignPdfCommand, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
120
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ExportDesignPdfCommand, providedIn: 'root' }); }
121
+ }
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ExportDesignPdfCommand, decorators: [{
123
+ type: Injectable,
124
+ args: [{ providedIn: 'root' }]
125
+ }] });
126
+ //#endregion
127
+ //#region ----- Read the pinned behavior and open the design document -----
128
+ class ViewPinnedBehaviorCommand {
129
+ constructor() {
130
+ this.entityService = inject(AXPEntityService);
131
+ this.layoutBuilder = inject(AXPLayoutBuilderService);
132
+ this.toast = inject(AXToastService);
133
+ this.i18n = inject(AXTranslationService);
134
+ }
135
+ async execute(input) {
136
+ const softwareId = resolveSoftwareId(input);
137
+ const software = softwareId
138
+ ? (await this.entityService
139
+ .withEntity(RootConfig.module.name, RootConfig.entities.software.name)
140
+ .data()
141
+ .byKey(softwareId))
142
+ : null;
143
+ const versionId = kickoffText(software?.behaviorApprovedVersionId);
144
+ if (!versionId) {
145
+ const text = await this.i18n.translateAsync('@software-management:messages.design.pinned-behavior-missing');
146
+ this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });
147
+ return { success: false, message: { text } };
148
+ }
149
+ const version = (await this.entityService
150
+ .withEntity('DocumentManagement', 'DocumentVersion')
151
+ .data()
152
+ .byKey(versionId));
153
+ const text = kickoffPlainTextFromVersion(version);
154
+ await this.layoutBuilder
155
+ .create()
156
+ .dialog((dialog) => {
157
+ dialog
158
+ .setTitle('@software-management:actions.view-pinned-behavior.title')
159
+ .setSize('lg')
160
+ .setCloseButton(true)
161
+ .setContext({ text })
162
+ .content((flex) => {
163
+ flex.customWidget('text-block-layout', { content: text || versionId });
164
+ })
165
+ .setActions((actions) => {
166
+ actions.cancel('@general:actions.cancel.title');
167
+ });
168
+ })
169
+ .show();
170
+ return { success: true, kind: 'object', data: { versionId } };
171
+ }
172
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewPinnedBehaviorCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
173
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewPinnedBehaviorCommand, providedIn: 'root' }); }
174
+ }
175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewPinnedBehaviorCommand, decorators: [{
176
+ type: Injectable,
177
+ args: [{ providedIn: 'root' }]
178
+ }] });
179
+ class OpenDesignDocumentCommand {
180
+ constructor() {
181
+ this.entityService = inject(AXPEntityService);
182
+ this.executor = inject(AXPCommandExecutor);
183
+ this.toast = inject(AXToastService);
184
+ this.i18n = inject(AXTranslationService);
185
+ }
186
+ async execute(input) {
187
+ const softwareId = resolveSoftwareId(input);
188
+ const software = softwareId
189
+ ? (await this.entityService
190
+ .withEntity(RootConfig.module.name, RootConfig.entities.software.name)
191
+ .data()
192
+ .byKey(softwareId))
193
+ : null;
194
+ const documentId = kickoffText(software?.designDocumentId);
195
+ if (!documentId) {
196
+ const text = await this.i18n.translateAsync('@software-management:messages.design.missing-document');
197
+ this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });
198
+ return { success: false, message: { text } };
199
+ }
200
+ await this.executor.execute('DocumentManagement.Document:Open', { documentId });
201
+ return { success: true, kind: 'object', data: { documentId } };
202
+ }
203
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenDesignDocumentCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
204
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenDesignDocumentCommand, providedIn: 'root' }); }
205
+ }
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenDesignDocumentCommand, decorators: [{
207
+ type: Injectable,
208
+ args: [{ providedIn: 'root' }]
209
+ }] });
210
+
211
+ export { ExportDesignPdfCommand, GenerateDesignDocumentCommand, OpenDesignDocumentCommand, SubmitDesignDocumentCommand, ViewPinnedBehaviorCommand };
212
+ //# sourceMappingURL=acorex-platform-module-software-management-client-design-document.commands-BDE3x0KG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-design-document.commands-BDE3x0KG.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/design-document.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffPlainTextFromVersion,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote design commands -----\n\nabstract class DesignDocumentRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n protected readonly toast = inject(AXToastService);\n protected readonly i18n = inject(AXTranslationService);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n locale: this.i18n.getActiveLang?.() ?? 'en-US',\n });\n const text = await this.translateMessage(messageText(result));\n if (!result?.success) {\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 6000 });\n return { success: false, message: { text } };\n }\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n this.toast.show({ color: 'success', title: text, content: text, closeButton: true, timeOut: 6000 });\n return result;\n }\n\n protected async afterSuccess(data?: Record<string, unknown>): Promise<void> {\n void data;\n }\n\n private async translateMessage(text: string): Promise<string> {\n if (!text) {\n return this.i18n.translateAsync('@software-management:messages.design.failed');\n }\n if (text.startsWith('@')) {\n return this.i18n.translateAsync(text);\n }\n return text;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDesignDocumentCommand extends DesignDocumentRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateDesignDocument;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDesignDocumentCommand extends DesignDocumentRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitDesignDocument;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDesignPdfCommand extends DesignDocumentRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportDesignPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'design.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n//#endregion\n\n//#region ----- Read the pinned behavior and open the design document -----\n\n@Injectable({ providedIn: 'root' })\nexport class ViewPinnedBehaviorCommand implements AXPCommand<unknown, { versionId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ versionId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const versionId = kickoffText(software?.behaviorApprovedVersionId);\n if (!versionId) {\n const text = await this.i18n.translateAsync('@software-management:messages.design.pinned-behavior-missing');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n const version = (await this.entityService\n .withEntity('DocumentManagement', 'DocumentVersion')\n .data()\n .byKey(versionId)) as { metaDataForm?: unknown } | null;\n const text = kickoffPlainTextFromVersion(version);\n await this.layoutBuilder\n .create()\n .dialog((dialog) => {\n dialog\n .setTitle('@software-management:actions.view-pinned-behavior.title')\n .setSize('lg')\n .setCloseButton(true)\n .setContext({ text })\n .content((flex) => {\n flex.customWidget('text-block-layout', { content: text || versionId });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n });\n })\n .show();\n return { success: true, kind: 'object', data: { versionId } };\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDesignDocumentCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const documentId = kickoffText(software?.designDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.design.missing-document');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAwBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpD,IAAI,OAAO,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,EAAE;IACX;IACA,MAAM,GAAG,GAAG,KAAgC;AAC5C,IAAA,OAAO,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACjF;AAEA,SAAS,WAAW,CAAC,MAA2D,EAAA;AAC9E,IAAA,OAAO,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;AAC1E;AAEA;AAEA;AAEA,MAAe,2BAA2B,CAAA;AAA1C,IAAA,WAAA,GAAA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E,iBAAA,IAAI;iBACJ,KAAK,CAAC,UAAU,CAAC;cACpB,IAAI;QACR,MAAM,UAAU,GAAG,WAAW,CAAC,QAAQ,EAAE,gBAAgB,CAAC;QAC1D,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,uDAAuD,CAAC;YACpG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACnG,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE;QAC9C;AACA,QAAA,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,kCAAkC,EAAE,EAAE,UAAU,EAAE,CAAC;AAC/E,QAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE;IAChE;8GAtBW,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,yBAAyB,cADZ,MAAM,EAAA,CAAA,CAAA;;2FACnB,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBADrC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -0,0 +1,79 @@
1
+ import { runtimeCommandSuccessObject } from '@acorex-platform/framework-shared/core';
2
+ import * as i0 from '@angular/core';
3
+ import { inject, Injectable } from '@angular/core';
4
+ import { GenerateDesignDocumentCommand, SubmitDesignDocumentCommand, ViewPinnedBehaviorCommand, OpenDesignDocumentCommand } from './acorex-platform-module-software-management-client-design-document.commands-BDE3x0KG.mjs';
5
+
6
+ //#endregion
7
+ //#region ----- Report from Design task -----
8
+ class GenerateSoftwareDesignDocumentActivity {
9
+ constructor() {
10
+ this.generate = inject(GenerateDesignDocumentCommand);
11
+ }
12
+ async execute(input) {
13
+ return workflowOutcome(await this.generate.execute(input));
14
+ }
15
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GenerateSoftwareDesignDocumentActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
16
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GenerateSoftwareDesignDocumentActivity, providedIn: 'root' }); }
17
+ }
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: GenerateSoftwareDesignDocumentActivity, decorators: [{
19
+ type: Injectable,
20
+ args: [{ providedIn: 'root' }]
21
+ }] });
22
+ class SubmitSoftwareDesignDocumentActivity {
23
+ constructor() {
24
+ this.submit = inject(SubmitDesignDocumentCommand);
25
+ }
26
+ async execute(input) {
27
+ return workflowOutcome(await this.submit.execute(input));
28
+ }
29
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SubmitSoftwareDesignDocumentActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
30
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SubmitSoftwareDesignDocumentActivity, providedIn: 'root' }); }
31
+ }
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: SubmitSoftwareDesignDocumentActivity, decorators: [{
33
+ type: Injectable,
34
+ args: [{ providedIn: 'root' }]
35
+ }] });
36
+ class ViewSoftwarePinnedBehaviorActivity {
37
+ constructor() {
38
+ this.view = inject(ViewPinnedBehaviorCommand);
39
+ }
40
+ async execute(input) {
41
+ return workflowOutcome(await this.view.execute(input));
42
+ }
43
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewSoftwarePinnedBehaviorActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
44
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewSoftwarePinnedBehaviorActivity, providedIn: 'root' }); }
45
+ }
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: ViewSoftwarePinnedBehaviorActivity, decorators: [{
47
+ type: Injectable,
48
+ args: [{ providedIn: 'root' }]
49
+ }] });
50
+ class OpenSoftwareDesignDocumentActivity {
51
+ constructor() {
52
+ this.open = inject(OpenDesignDocumentCommand);
53
+ }
54
+ async execute(input) {
55
+ return workflowOutcome(await this.open.execute(input));
56
+ }
57
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenSoftwareDesignDocumentActivity, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
58
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenSoftwareDesignDocumentActivity, providedIn: 'root' }); }
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: OpenSoftwareDesignDocumentActivity, decorators: [{
61
+ type: Injectable,
62
+ args: [{ providedIn: 'root' }]
63
+ }] });
64
+ //#endregion
65
+ //#region ----- Helpers -----
66
+ function workflowOutcome(result) {
67
+ if (!result.success) {
68
+ return Promise.resolve({
69
+ success: false,
70
+ metadata: { outcome: 'Failed' },
71
+ });
72
+ }
73
+ return Promise.resolve(runtimeCommandSuccessObject(result.data, {
74
+ metadata: { outcome: 'Done' },
75
+ }));
76
+ }
77
+
78
+ export { GenerateSoftwareDesignDocumentActivity, OpenSoftwareDesignDocumentActivity, SubmitSoftwareDesignDocumentActivity, ViewSoftwarePinnedBehaviorActivity };
79
+ //# sourceMappingURL=acorex-platform-module-software-management-client-design-task.activities-Cra2LNal.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-design-task.activities-Cra2LNal.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/workflows/activities/design-task.activities.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport { runtimeCommandSuccessObject } from '@acorex-platform/framework-shared/core';\nimport { inject, Injectable } from '@angular/core';\n\nimport {\n GenerateDesignDocumentCommand,\n OpenDesignDocumentCommand,\n SubmitDesignDocumentCommand,\n ViewPinnedBehaviorCommand,\n} from '../../commands/design-document.commands';\n\n//#endregion\n\n//#region ----- Report from Design task -----\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateSoftwareDesignDocumentActivity implements AXPCommand<unknown, unknown> {\n private readonly generate = inject(GenerateDesignDocumentCommand);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n return workflowOutcome(await this.generate.execute(input));\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitSoftwareDesignDocumentActivity implements AXPCommand<unknown, unknown> {\n private readonly submit = inject(SubmitDesignDocumentCommand);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n return workflowOutcome(await this.submit.execute(input));\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ViewSoftwarePinnedBehaviorActivity implements AXPCommand<unknown, unknown> {\n private readonly view = inject(ViewPinnedBehaviorCommand);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n return workflowOutcome(await this.view.execute(input));\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OpenSoftwareDesignDocumentActivity implements AXPCommand<unknown, unknown> {\n private readonly open = inject(OpenDesignDocumentCommand);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n return workflowOutcome(await this.open.execute(input));\n }\n}\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction workflowOutcome(result: { success?: boolean; data?: unknown }): AXPCommandExecuteResultPromise<unknown> {\n if (!result.success) {\n return Promise.resolve({\n success: false,\n metadata: { outcome: 'Failed' },\n });\n }\n return Promise.resolve(\n runtimeCommandSuccessObject(result.data, {\n metadata: { outcome: 'Done' },\n }),\n );\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;AAaA;AAEA;MAGa,sCAAsC,CAAA;AADnD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,6BAA6B,CAAC;AAKlE,IAAA;IAHC,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,OAAO,eAAe,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5D;8GALW,sCAAsC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAtC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,sCAAsC,cADzB,MAAM,EAAA,CAAA,CAAA;;2FACnB,sCAAsC,EAAA,UAAA,EAAA,CAAA;kBADlD,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;MAUrB,oCAAoC,CAAA;AADjD,IAAA,WAAA,GAAA;AAEmB,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,2BAA2B,CAAC;AAK9D,IAAA;IAH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QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,yBAAyB,CAAC;AAK1D,IAAA;IAHC,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,OAAO,eAAe,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxD;8GALW,kCAAkC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAlC,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kCAAkC,cADrB,MAAM,EAAA,CAAA,CAAA;;2FACnB,kCAAkC,EAAA,UAAA,EAAA,CAAA;kBAD9C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AASlC;AAEA;AAEA,SAAS,eAAe,CAAC,MAA6C,EAAA;AACpE,IAAA,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;QACnB,OAAO,OAAO,CAAC,OAAO,CAAC;AACrB,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE;AAChC,SAAA,CAAC;IACJ;IACA,OAAO,OAAO,CAAC,OAAO,CACpB,2BAA2B,CAAC,MAAM,CAAC,IAAI,EAAE;AACvC,QAAA,QAAQ,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;AAC9B,KAAA,CAAC,CACH;AACH;;"}
@@ -7,7 +7,7 @@ import { resolveEntityActionRef } from '@acorex-platform/framework-shared/runtim
7
7
  import { AXPSoftwareManagementCommandKeys, kickoffText, RootConfig } from '@acorex-platform/module-software-management-client/contracts';
8
8
  import * as i0 from '@angular/core';
9
9
  import { inject, Injectable } from '@angular/core';
10
- import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs';
10
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
11
11
 
12
12
  //#region ----- Imports -----
13
13
  //#endregion
@@ -32,6 +32,7 @@ function messageText(result) {
32
32
  class DiscoveryKickoffRemoteCommand {
33
33
  constructor() {
34
34
  this.executor = inject(AXPCommandExecutor);
35
+ this.translation = inject(AXTranslationService);
35
36
  }
36
37
  async execute(input) {
37
38
  const softwareId = resolveSoftwareId(input);
@@ -43,6 +44,7 @@ class DiscoveryKickoffRemoteCommand {
43
44
  }
44
45
  const result = await this.executor.executeRemote(this.commandKey, {
45
46
  softwareId,
47
+ locale: this.translation.getActiveLang?.() ?? 'en-US',
46
48
  });
47
49
  if (!result?.success) {
48
50
  const text = messageText(result) || '@software-management:messages.kickoff.failed';
@@ -159,4 +161,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
159
161
  }] });
160
162
 
161
163
  export { ExportDiscoveryKickoffPdfCommand, GenerateDiscoveryKickoffCommand, OpenDiscoveryKickoffCommand, SubmitDiscoveryKickoffCommand };
162
- //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs.map
164
+ //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-kickoff.commands-BZxzDJs9.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-software-management-client-discovery-kickoff.commands-gB0_htfF.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/discovery-kickoff.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote kickoff commands -----\n\nabstract class DiscoveryKickoffRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n return {\n success: false,\n message: { text: '@software-management:messages.kickoff.id-required', type: 'warning' },\n };\n }\n\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n });\n if (!result?.success) {\n const text = messageText(result) || '@software-management:messages.kickoff.failed';\n return { success: false, message: { text, type: 'warning' } };\n }\n\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n return result;\n }\n\n protected async afterSuccess(_data: Record<string, unknown> | undefined): Promise<void> {\n return undefined;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDiscoveryKickoffPdfCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportKickoffPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'discovery-kickoff.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n//#endregion\n\n//#region ----- Open the stored sheet -----\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDiscoveryKickoffCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n const documentId = kickoffText(software?.kickoffDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.missing-sheet');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAsBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpD,IAAI,OAAO,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAAA,OAAO,EAAE;IACX;IACA,MAAM,GAAG,GAAG,KAAgC;AAC5C,IAAA,OAAO,mBAAmB,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,IAAI,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AACjF;AAEA,SAAS,WAAW,CAAC,MAA2D,EAAA;AAC9E,IAAA,OAAO,0BAA0B,CAAC,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE;AAC1E;AAEA;AAEA;AAEA,MAAe,6BAA6B,CAAA;AAA5C,IAAA,WAAA,GAAA;AACqB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,kBAAkB,CAAC;IA4B1D;IAxBE,MAAM,OAAO,CAAC,KAAc,EAAA;AAC1B,QAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,KAAK,CAAC;QAC3C,IAAI,CAAC,UAAU,EAAE;YACf,OAAO;AACL,gBAAA,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,EAAE,IAAI,EAAE,mDAAmD,EAAE,IAAI,EAAE,SAAS,EAAE;aACxF;QACH;AAEA,QAAA,MAAM,MAAM,GAAG,MAAM,IAA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AAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-discovery-kickoff.commands-BZxzDJs9.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/discovery-kickoff.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote kickoff commands -----\n\nabstract class DiscoveryKickoffRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n protected readonly translation = inject(AXTranslationService);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n return {\n success: false,\n message: { text: '@software-management:messages.kickoff.id-required', type: 'warning' },\n };\n }\n\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n locale: this.translation.getActiveLang?.() ?? 'en-US',\n });\n if (!result?.success) {\n const text = messageText(result) || '@software-management:messages.kickoff.failed';\n return { success: false, message: { text, type: 'warning' } };\n }\n\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n return result;\n }\n\n protected async afterSuccess(_data: Record<string, unknown> | undefined): Promise<void> {\n return undefined;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDiscoveryKickoffCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitKickoffSheet;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDiscoveryKickoffPdfCommand extends DiscoveryKickoffRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportKickoffPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'discovery-kickoff.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n//#endregion\n\n//#region ----- Open the stored sheet -----\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDiscoveryKickoffCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n const software = (await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null;\n const documentId = kickoffText(software?.kickoffDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.missing-sheet');\n this.toast.show({\n color: 'warning',\n title: text,\n content: text,\n closeButton: true,\n timeOut: 5000,\n });\n return { success: false, message: { text } };\n }\n\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;AAsBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,GAAG,sBAAsB,CAAC,KAAK,CAAC;IAC9C,MAAM,OAAO,GAAG,mBAAmB,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpD,IAAI,OAAO,EAAE;AACX,QAAA,OAAO,OAAO;IAChB;IACA,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AACvC,QAA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im
8
8
  import { AXPSoftwareManagementCommandKeys, kickoffText, RootConfig, kickoffPlainTextFromVersion } from '@acorex-platform/module-software-management-client/contracts';
9
9
  import * as i0 from '@angular/core';
10
10
  import { inject, Injectable } from '@angular/core';
11
- import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-BsoKQCX5.mjs';
11
+ import { r as resolveSoftwareText } from './acorex-platform-module-software-management-client-software-command.util-CvlYk7tC.mjs';
12
12
 
13
13
  //#region ----- Imports -----
14
14
  //#endregion
@@ -50,6 +50,7 @@ class DiscoveryReportRemoteCommand {
50
50
  const result = await this.executor.executeRemote(this.commandKey, {
51
51
  softwareId,
52
52
  ...extra,
53
+ locale: this.i18n.getActiveLang?.() ?? 'en-US',
53
54
  });
54
55
  const text = await this.translateMessage(messageText(result));
55
56
  if (!result?.success) {
@@ -275,4 +276,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
275
276
  }] });
276
277
 
277
278
  export { ExportDiscoveryReportPdfCommand, GenerateDiscoveryReportCommand, LinkDiscoveryQuestionnaireCommand, OpenDiscoveryReportCommand, SubmitDiscoveryReportCommand, ViewPinnedKickoffCommand };
278
- //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-report.commands-D2ricLpq.mjs.map
279
+ //# sourceMappingURL=acorex-platform-module-software-management-client-discovery-report.commands-C9GKrnHs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-software-management-client-discovery-report.commands-C9GKrnHs.mjs","sources":["../../../../libs/modules/software-management/client/src/lib/commands/discovery-report.commands.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationService } from '@acorex/core/translation';\nimport { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPLayoutBuilderService } from '@acorex-platform/framework-client/layout/builder';\nimport { AXPCommandExecutor } from '@acorex-platform/framework-client/runtime';\nimport { resolveMultiLanguageString, runtimeCommandPayloadData } from '@acorex-platform/framework-shared/core';\nimport {\n AXPCommand,\n resolveEntityActionRef,\n type AXPCommandExecuteResultPromise,\n} from '@acorex-platform/framework-shared/runtime';\nimport {\n AXPSoftwareManagementCommandKeys,\n kickoffPlainTextFromVersion,\n kickoffText,\n RootConfig,\n type AXMSoftwareManagementSoftwareEntityModel,\n} from '@acorex-platform/module-software-management-client/contracts';\nimport { inject, Injectable } from '@angular/core';\n\nimport { resolveSoftwareText } from './software-command.util';\n\n//#endregion\n\n//#region ----- Helpers -----\n\nfunction resolveSoftwareId(input: unknown): string {\n const resolved = resolveEntityActionRef(input);\n const fromRef = resolveSoftwareText(resolved?.refId);\n if (fromRef) {\n return fromRef;\n }\n if (!input || typeof input !== 'object') {\n return '';\n }\n const row = input as Record<string, unknown>;\n return resolveSoftwareText(row['softwareId']) || resolveSoftwareText(row['id']);\n}\n\nfunction messageText(result: { message?: { text?: unknown } } | null | undefined): string {\n return resolveMultiLanguageString(result?.message?.text, 'en-US').trim();\n}\n\n//#endregion\n\n//#region ----- Remote report commands -----\n\nabstract class DiscoveryReportRemoteCommand implements AXPCommand<unknown, unknown> {\n protected readonly executor = inject(AXPCommandExecutor);\n protected readonly toast = inject(AXToastService);\n protected readonly i18n = inject(AXTranslationService);\n\n protected abstract readonly commandKey: string;\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<unknown> {\n const softwareId = resolveSoftwareId(input);\n if (!softwareId) {\n const text = await this.i18n.translateAsync('@software-management:messages.kickoff.id-required');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n\n const extra = await this.extraInput();\n if (!extra) {\n return { success: false };\n }\n const result = await this.executor.executeRemote<unknown, Record<string, unknown>>(this.commandKey, {\n softwareId,\n ...extra,\n locale: this.i18n.getActiveLang?.() ?? 'en-US',\n });\n const text = await this.translateMessage(messageText(result));\n if (!result?.success) {\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 6000 });\n return { success: false, message: { text } };\n }\n await this.afterSuccess(runtimeCommandPayloadData(result) ?? undefined);\n this.toast.show({ color: 'success', title: text, content: text, closeButton: true, timeOut: 6000 });\n return result;\n }\n\n protected async extraInput(): Promise<Record<string, unknown> | null> {\n return {};\n }\n\n protected async afterSuccess(data?: Record<string, unknown>): Promise<void> {\n void data;\n }\n\n private async translateMessage(text: string): Promise<string> {\n if (!text) {\n return this.i18n.translateAsync('@software-management:messages.discovery.failed');\n }\n if (text.startsWith('@')) {\n return this.i18n.translateAsync(text);\n }\n return text;\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class GenerateDiscoveryReportCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.GenerateDiscoveryReport;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class SubmitDiscoveryReportCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.SubmitDiscoveryReport;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class ExportDiscoveryReportPdfCommand extends DiscoveryReportRemoteCommand {\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.ExportDiscoveryReportPdf;\n\n protected override async afterSuccess(data: Record<string, unknown> | undefined): Promise<void> {\n const base64 = kickoffText(data?.['base64']);\n if (!base64 || typeof document === 'undefined') {\n return;\n }\n const binary = atob(base64);\n const bytes = new Uint8Array(binary.length);\n for (let index = 0; index < binary.length; index += 1) {\n bytes[index] = binary.charCodeAt(index);\n }\n const blob = new Blob([bytes], { type: 'application/pdf' });\n const url = URL.createObjectURL(blob);\n const anchor = document.createElement('a');\n anchor.href = url;\n anchor.download = kickoffText(data?.['filename']) || 'discovery-report.pdf';\n anchor.click();\n URL.revokeObjectURL(url);\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class LinkDiscoveryQuestionnaireCommand extends DiscoveryReportRemoteCommand {\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n protected readonly commandKey = AXPSoftwareManagementCommandKeys.Software.LinkDiscoveryQuestionnaire;\n\n protected override async extraInput(): Promise<Record<string, unknown> | null> {\n const picked = await this.layoutBuilder\n .create()\n .dialog<{ questionnaireId?: unknown } | null>((dialog) => {\n dialog\n .setTitle('@software-management:actions.link-discovery-questionnaire.title')\n .setSize('md')\n .setCloseButton(true)\n .setContext({ questionnaireId: null })\n .content((flex) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .formField('@software-management:actions.link-discovery-questionnaire.title', (field) => {\n field.path('questionnaireId');\n field.lookupBox({\n entity: 'AssessmentManagement.Questionnaire',\n multiple: false,\n look: 'select',\n });\n });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n actions.submit('@general:actions.save.title');\n })\n .onAction(async (dialogRef) => {\n if (dialogRef.action() === 'cancel') {\n return null;\n }\n const context = dialogRef.context() as { questionnaireId?: unknown };\n const questionnaireId = kickoffText(\n context.questionnaireId && typeof context.questionnaireId === 'object'\n ? (context.questionnaireId as { id?: unknown }).id\n : context.questionnaireId,\n );\n if (!questionnaireId) {\n throw new Error('@software-management:messages.discovery.questionnaire-required');\n }\n return { questionnaireId };\n });\n })\n .show();\n if (!picked?.questionnaireId) {\n return null;\n }\n return { questionnaireId: picked.questionnaireId };\n }\n}\n\n//#endregion\n\n//#region ----- Read the pinned kickoff and open the report -----\n\n@Injectable({ providedIn: 'root' })\nexport class ViewPinnedKickoffCommand implements AXPCommand<unknown, { versionId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ versionId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const versionId = kickoffText(software?.kickoffApprovedVersionId);\n if (!versionId) {\n const text = await this.i18n.translateAsync('@software-management:messages.discovery.pinned-kickoff-missing');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n const version = (await this.entityService\n .withEntity('DocumentManagement', 'DocumentVersion')\n .data()\n .byKey(versionId)) as { metaDataForm?: unknown } | null;\n const text = kickoffPlainTextFromVersion(version);\n await this.layoutBuilder\n .create()\n .dialog((dialog) => {\n dialog\n .setTitle('@software-management:actions.view-pinned-kickoff.title')\n .setSize('lg')\n .setCloseButton(true)\n .setContext({ text })\n .content((flex) => {\n flex.customWidget('text-block-layout', { content: text || versionId });\n })\n .setActions((actions) => {\n actions.cancel('@general:actions.cancel.title');\n });\n })\n .show();\n return { success: true, kind: 'object', data: { versionId } };\n }\n}\n\n@Injectable({ providedIn: 'root' })\nexport class OpenDiscoveryReportCommand implements AXPCommand<unknown, { documentId: string }> {\n private readonly entityService = inject(AXPEntityService);\n private readonly executor = inject(AXPCommandExecutor);\n private readonly toast = inject(AXToastService);\n private readonly i18n = inject(AXTranslationService);\n\n async execute(input: unknown): AXPCommandExecuteResultPromise<{ documentId: string }> {\n const softwareId = resolveSoftwareId(input);\n const software = softwareId\n ? ((await this.entityService\n .withEntity(RootConfig.module.name, RootConfig.entities.software.name)\n .data()\n .byKey(softwareId)) as AXMSoftwareManagementSoftwareEntityModel | null)\n : null;\n const documentId = kickoffText(software?.discoveryReportDocumentId);\n if (!documentId) {\n const text = await this.i18n.translateAsync('@software-management:messages.discovery.missing-report');\n this.toast.show({ color: 'warning', title: text, content: text, closeButton: true, timeOut: 5000 });\n return { success: false, message: { text } };\n }\n await this.executor.execute('DocumentManagement.Document:Open', { documentId });\n return { success: true, kind: 'object', data: { documentId } };\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;;;;AAAA;AAwBA;AAEA;AAEA,SAAS,iBAAiB,CAAC,KAAc,EAAA;AACvC,IAAA,MAAM,QAAQ,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