@sap-ux/generator-adp 0.7.44 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators/app/index.d.ts +4 -0
- package/generators/app/index.js +19 -3
- package/generators/app/questions/attributes.js +24 -1
- package/generators/app/questions/helper/choices.d.ts +23 -1
- package/generators/app/questions/helper/choices.js +31 -1
- package/generators/app/questions/key-user.d.ts +135 -0
- package/generators/app/questions/key-user.js +332 -0
- package/generators/app/types.d.ts +49 -1
- package/generators/app/types.js +12 -1
- package/generators/translations/generator-adp.i18n.json +10 -1
- package/generators/utils/steps.d.ts +6 -0
- package/generators/utils/steps.js +9 -0
- package/package.json +5 -5
|
@@ -112,6 +112,10 @@ export default class extends Generator {
|
|
|
112
112
|
* Telemetry collector instance.
|
|
113
113
|
*/
|
|
114
114
|
private telemetryCollector;
|
|
115
|
+
/**
|
|
116
|
+
* Key-user import prompter instance.
|
|
117
|
+
*/
|
|
118
|
+
private keyUserPrompter?;
|
|
115
119
|
/**
|
|
116
120
|
* Creates an instance of the generator.
|
|
117
121
|
*
|
package/generators/app/index.js
CHANGED
|
@@ -32,6 +32,7 @@ const default_values_1 = require("./questions/helper/default-values");
|
|
|
32
32
|
const validators_1 = require("./questions/helper/validators");
|
|
33
33
|
const types_1 = require("./types");
|
|
34
34
|
const target_env_1 = require("./questions/target-env");
|
|
35
|
+
const key_user_1 = require("./questions/key-user");
|
|
35
36
|
const generatorTitle = 'Adaptation Project';
|
|
36
37
|
/**
|
|
37
38
|
* Generator for creating an Adaptation Project.
|
|
@@ -145,6 +146,10 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
145
146
|
* Telemetry collector instance.
|
|
146
147
|
*/
|
|
147
148
|
telemetryCollector;
|
|
149
|
+
/**
|
|
150
|
+
* Key-user import prompter instance.
|
|
151
|
+
*/
|
|
152
|
+
keyUserPrompter;
|
|
148
153
|
/**
|
|
149
154
|
* Creates an instance of the generator.
|
|
150
155
|
*
|
|
@@ -243,12 +248,20 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
243
248
|
hasBaseAppInbounds: !!this.prompter.baseAppInbounds,
|
|
244
249
|
hide: this.shouldCreateExtProject
|
|
245
250
|
},
|
|
246
|
-
addDeployConfig: { hide: this.shouldCreateExtProject || !this.isCustomerBase }
|
|
251
|
+
addDeployConfig: { hide: this.shouldCreateExtProject || !this.isCustomerBase },
|
|
252
|
+
importKeyUserChanges: { hide: this.shouldCreateExtProject }
|
|
247
253
|
};
|
|
248
254
|
const attributesQuestions = (0, attributes_1.getPrompts)(this.destinationPath(), promptConfig, options);
|
|
249
255
|
this.attributeAnswers = await this.prompt(attributesQuestions);
|
|
250
256
|
// Steps need to be updated here to be available after back navigation in Yeoman UI.
|
|
251
257
|
this._updateWizardStepsAfterNavigation();
|
|
258
|
+
if (this.attributeAnswers.importKeyUserChanges) {
|
|
259
|
+
this.keyUserPrompter = new key_user_1.KeyUserImportPrompter(this.systemLookup, this.configAnswers.application.id, this.prompter.provider, this.configAnswers.system, this.logger);
|
|
260
|
+
const keyUserQuestions = this.keyUserPrompter.getPrompts({
|
|
261
|
+
keyUserSystem: { default: this.configAnswers.system }
|
|
262
|
+
});
|
|
263
|
+
await this.prompt(keyUserQuestions);
|
|
264
|
+
}
|
|
252
265
|
this.logger.info(`Project Attributes: ${JSON.stringify(this.attributeAnswers, null, 2)}`);
|
|
253
266
|
if (this.attributeAnswers.addDeployConfig) {
|
|
254
267
|
const system = await this.systemLookup.getSystemByName(this.configAnswers.system);
|
|
@@ -303,7 +316,8 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
303
316
|
layer: this.layer,
|
|
304
317
|
packageJson,
|
|
305
318
|
logger: this.toolsLogger,
|
|
306
|
-
toolsId: this.toolsId
|
|
319
|
+
toolsId: this.toolsId,
|
|
320
|
+
keyUserChanges: this.keyUserPrompter?.changes
|
|
307
321
|
});
|
|
308
322
|
if (config.options) {
|
|
309
323
|
config.options.templatePathOverwrite = (0, templates_1.getTemplatesOverwritePath)();
|
|
@@ -446,7 +460,8 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
446
460
|
ui5ValidationCli: { hide: true },
|
|
447
461
|
enableTypeScript: { hide: true },
|
|
448
462
|
addFlpConfig: { hide: true },
|
|
449
|
-
addDeployConfig: { hide: true }
|
|
463
|
+
addDeployConfig: { hide: true },
|
|
464
|
+
importKeyUserChanges: { hide: true }
|
|
450
465
|
};
|
|
451
466
|
const projectPath = this.destinationPath();
|
|
452
467
|
const attributesQuestions = (0, attributes_1.getPrompts)(projectPath, {
|
|
@@ -590,6 +605,7 @@ class default_1 extends yeoman_generator_1.default {
|
|
|
590
605
|
if (!deployPageExists) {
|
|
591
606
|
(0, steps_1.updateWizardSteps)(this.prompts, (0, steps_1.getDeployPage)(), (0, i18n_1.t)('yuiNavSteps.projectAttributesName'), this.attributeAnswers.addDeployConfig);
|
|
592
607
|
}
|
|
608
|
+
(0, steps_1.updateWizardSteps)(this.prompts, (0, steps_1.getKeyUserImportPage)(), (0, i18n_1.t)('yuiNavSteps.projectAttributesName'), !!this.attributeAnswers.importKeyUserChanges);
|
|
593
609
|
if (!flpPagesExist) {
|
|
594
610
|
(0, steps_1.updateFlpWizardSteps)(!!this.prompter.baseAppInbounds, this.prompts, this.attributeAnswers.projectName, !!this.attributeAnswers.addFlpConfig);
|
|
595
611
|
}
|
|
@@ -31,7 +31,8 @@ function getPrompts(path, config, promptOptions) {
|
|
|
31
31
|
[types_1.attributePromptNames.ui5ValidationCli]: getUi5VersionValidationPromptForCli(),
|
|
32
32
|
[types_1.attributePromptNames.enableTypeScript]: getEnableTypeScriptPrompt(promptOptions?.[types_1.attributePromptNames.enableTypeScript]),
|
|
33
33
|
[types_1.attributePromptNames.addDeployConfig]: getAddDeployConfigPrompt(prompts, promptOptions?.[types_1.attributePromptNames.addDeployConfig]),
|
|
34
|
-
[types_1.attributePromptNames.addFlpConfig]: getFlpConfigPrompt(prompts, isCloudProject, promptOptions?.[types_1.attributePromptNames.addFlpConfig])
|
|
34
|
+
[types_1.attributePromptNames.addFlpConfig]: getFlpConfigPrompt(prompts, isCloudProject, promptOptions?.[types_1.attributePromptNames.addFlpConfig]),
|
|
35
|
+
[types_1.attributePromptNames.importKeyUserChanges]: getImportKeyUserChangesPrompt(prompts, promptOptions?.[types_1.attributePromptNames.importKeyUserChanges])
|
|
35
36
|
};
|
|
36
37
|
const questions = Object.entries(keyedPrompts)
|
|
37
38
|
.filter(([promptName]) => {
|
|
@@ -246,4 +247,26 @@ function getFlpConfigPrompt(prompts, isCloudProject, options) {
|
|
|
246
247
|
}
|
|
247
248
|
};
|
|
248
249
|
}
|
|
250
|
+
/**
|
|
251
|
+
* Creates the Import Key User Changes confirm prompt.
|
|
252
|
+
*
|
|
253
|
+
* @param {YeomanUiSteps} prompts - The Yeoman UI pages.
|
|
254
|
+
* @param {ImportKeyUserChangesPromptOptions} options - Optional prompt options.
|
|
255
|
+
* @returns {AttributesQuestion} The prompt configuration for copying key user changes.
|
|
256
|
+
*/
|
|
257
|
+
function getImportKeyUserChangesPrompt(prompts, options) {
|
|
258
|
+
return {
|
|
259
|
+
type: 'confirm',
|
|
260
|
+
name: types_1.attributePromptNames.importKeyUserChanges,
|
|
261
|
+
message: (0, i18n_1.t)('prompts.importKeyUserChangesLabel'),
|
|
262
|
+
default: options?.default ?? false,
|
|
263
|
+
guiOptions: {
|
|
264
|
+
breadcrumb: true
|
|
265
|
+
},
|
|
266
|
+
validate: (value) => {
|
|
267
|
+
(0, steps_1.updateWizardSteps)(prompts, (0, steps_1.getKeyUserImportPage)(), (0, i18n_1.t)('yuiNavSteps.projectAttributesName'), value);
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
249
272
|
//# sourceMappingURL=attributes.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AppRouterType } from '@sap-ux/adp-tooling';
|
|
2
|
-
import type { CFApp, SourceApplication } from '@sap-ux/adp-tooling';
|
|
2
|
+
import type { CFApp, Endpoint, SourceApplication } from '@sap-ux/adp-tooling';
|
|
3
|
+
import type { AdaptationDescriptor } from '@sap-ux/axios-extension';
|
|
3
4
|
interface Choice {
|
|
4
5
|
name: string;
|
|
5
6
|
value: SourceApplication;
|
|
@@ -32,5 +33,26 @@ export declare const getAppRouterChoices: (isInternalUsage: boolean) => {
|
|
|
32
33
|
name: AppRouterType;
|
|
33
34
|
value: AppRouterType;
|
|
34
35
|
}[];
|
|
36
|
+
/**
|
|
37
|
+
* Returns the choices for the adaptation prompt.
|
|
38
|
+
*
|
|
39
|
+
* @param {AdaptationDescriptor[]} adaptations - The adaptations to get the choices for.
|
|
40
|
+
* @returns {Array<{ name: string; value: AdaptationDescriptor }>} The choices for the adaptation prompt.
|
|
41
|
+
*/
|
|
42
|
+
export declare const getAdaptationChoices: (adaptations: AdaptationDescriptor[]) => Array<{
|
|
43
|
+
name: string;
|
|
44
|
+
value: AdaptationDescriptor;
|
|
45
|
+
}>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the choices for the system prompt.
|
|
48
|
+
*
|
|
49
|
+
* @param {string[]} systems - The systems to get the choices for.
|
|
50
|
+
* @param {string} defaultSystem - The default system.
|
|
51
|
+
* @returns {Array<{ name: string; value: string }>} The choices for the system prompt.
|
|
52
|
+
*/
|
|
53
|
+
export declare const getKeyUserSystemChoices: (systems: Endpoint[], defaultSystem: string) => Array<{
|
|
54
|
+
name: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}>;
|
|
35
57
|
export {};
|
|
36
58
|
//# sourceMappingURL=choices.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAppRouterChoices = exports.getCFAppChoices = exports.getApplicationChoices = void 0;
|
|
3
|
+
exports.getKeyUserSystemChoices = exports.getAdaptationChoices = exports.getAppRouterChoices = exports.getCFAppChoices = exports.getApplicationChoices = void 0;
|
|
4
4
|
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
5
5
|
/**
|
|
6
6
|
* Creates a list of choices from a list of applications, formatted for display or selection in a UI.
|
|
@@ -58,4 +58,34 @@ const getAppRouterChoices = (isInternalUsage) => {
|
|
|
58
58
|
return options;
|
|
59
59
|
};
|
|
60
60
|
exports.getAppRouterChoices = getAppRouterChoices;
|
|
61
|
+
/**
|
|
62
|
+
* Returns the choices for the adaptation prompt.
|
|
63
|
+
*
|
|
64
|
+
* @param {AdaptationDescriptor[]} adaptations - The adaptations to get the choices for.
|
|
65
|
+
* @returns {Array<{ name: string; value: AdaptationDescriptor }>} The choices for the adaptation prompt.
|
|
66
|
+
*/
|
|
67
|
+
const getAdaptationChoices = (adaptations) => {
|
|
68
|
+
return adaptations?.map((adaptation) => ({
|
|
69
|
+
name: adaptation.title ? `${adaptation.title} (${adaptation.id})` : adaptation.id,
|
|
70
|
+
value: adaptation
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
exports.getAdaptationChoices = getAdaptationChoices;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the choices for the system prompt.
|
|
76
|
+
*
|
|
77
|
+
* @param {string[]} systems - The systems to get the choices for.
|
|
78
|
+
* @param {string} defaultSystem - The default system.
|
|
79
|
+
* @returns {Array<{ name: string; value: string }>} The choices for the system prompt.
|
|
80
|
+
*/
|
|
81
|
+
const getKeyUserSystemChoices = (systems, defaultSystem) => {
|
|
82
|
+
const endpointNames = (0, adp_tooling_1.getEndpointNames)(systems);
|
|
83
|
+
return endpointNames.map((name) => {
|
|
84
|
+
return {
|
|
85
|
+
name: name === defaultSystem ? `${name} (Source system)` : name,
|
|
86
|
+
value: name
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
exports.getKeyUserSystemChoices = getKeyUserSystemChoices;
|
|
61
91
|
//# sourceMappingURL=choices.js.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { AbapServiceProvider, FlexVersion, KeyUserChangeContent } from '@sap-ux/axios-extension';
|
|
2
|
+
import type { ToolsLogger } from '@sap-ux/logger';
|
|
3
|
+
import { type SystemLookup } from '@sap-ux/adp-tooling';
|
|
4
|
+
import type { KeyUserImportPromptOptions, KeyUserImportQuestion } from '../types';
|
|
5
|
+
export declare const DEFAULT_ADAPTATION_ID = "DEFAULT";
|
|
6
|
+
/**
|
|
7
|
+
* Determines the flex version to be used. If the first version is the draft (versionId "0"), use the second version (active version).
|
|
8
|
+
*
|
|
9
|
+
* @param {FlexVersion[]} flexVersions - The list of flex versions.
|
|
10
|
+
* @returns {string} The flex version to be used.
|
|
11
|
+
*/
|
|
12
|
+
export declare function determineFlexVersion(flexVersions: FlexVersion[]): string;
|
|
13
|
+
/**
|
|
14
|
+
* Prompter class that guides the user through importing key-user changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare class KeyUserImportPrompter {
|
|
17
|
+
private readonly systemLookup;
|
|
18
|
+
private readonly componentId;
|
|
19
|
+
private readonly defaultProvider;
|
|
20
|
+
private readonly defaultSystem;
|
|
21
|
+
private readonly logger;
|
|
22
|
+
/**
|
|
23
|
+
* Instance of AbapServiceProvider.
|
|
24
|
+
*/
|
|
25
|
+
private provider;
|
|
26
|
+
/**
|
|
27
|
+
* List of adaptations.
|
|
28
|
+
*/
|
|
29
|
+
private adaptations;
|
|
30
|
+
/**
|
|
31
|
+
* List of key-user changes.
|
|
32
|
+
*/
|
|
33
|
+
private keyUserChanges;
|
|
34
|
+
/**
|
|
35
|
+
* List of flex versions.
|
|
36
|
+
*/
|
|
37
|
+
private flexVersions;
|
|
38
|
+
/**
|
|
39
|
+
* Indicates if authentication is required.
|
|
40
|
+
*/
|
|
41
|
+
private isAuthRequired;
|
|
42
|
+
/**
|
|
43
|
+
* Constructs a new KeyUserImportPrompter.
|
|
44
|
+
*
|
|
45
|
+
* @param {SystemLookup} systemLookup - The system lookup.
|
|
46
|
+
* @param {string} componentId - The component ID.
|
|
47
|
+
* @param {AbapServiceProvider} defaultProvider - The default provider.
|
|
48
|
+
* @param {string} defaultSystem - The default system.
|
|
49
|
+
* @param {ToolsLogger} logger - The logger.
|
|
50
|
+
*/
|
|
51
|
+
constructor(systemLookup: SystemLookup, componentId: string, defaultProvider: AbapServiceProvider, defaultSystem: string, logger: ToolsLogger);
|
|
52
|
+
/**
|
|
53
|
+
* Returns the key-user changes.
|
|
54
|
+
*
|
|
55
|
+
* @returns {KeyUserChangeContent[]} The key-user changes.
|
|
56
|
+
*/
|
|
57
|
+
get changes(): KeyUserChangeContent[];
|
|
58
|
+
/**
|
|
59
|
+
* Builds the prompts for the key-user import page.
|
|
60
|
+
*
|
|
61
|
+
* @param {KeyUserImportPromptOptions} [promptOptions] - Per-prompt settings (hide/default).
|
|
62
|
+
* @returns {KeyUserImportQuestion[]} Questions for the key-user import page.
|
|
63
|
+
*/
|
|
64
|
+
getPrompts(promptOptions?: KeyUserImportPromptOptions): KeyUserImportQuestion[];
|
|
65
|
+
/**
|
|
66
|
+
* Returns the system prompt.
|
|
67
|
+
*
|
|
68
|
+
* @param {KeyUserSystemPromptOptions} [options] - The options for the system prompt.
|
|
69
|
+
* @returns {KeyUserImportQuestion} The system prompt.
|
|
70
|
+
*/
|
|
71
|
+
private getSystemPrompt;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the username prompt.
|
|
74
|
+
*
|
|
75
|
+
* @param {KeyUserUsernamePromptOptions} [options] - The options for the username prompt.
|
|
76
|
+
* @returns {KeyUserImportQuestion} The username prompt.
|
|
77
|
+
*/
|
|
78
|
+
private getUsernamePrompt;
|
|
79
|
+
/**
|
|
80
|
+
* Returns the password prompt.
|
|
81
|
+
*
|
|
82
|
+
* @param {KeyUserPasswordPromptOptions} [options] - The options for the password prompt.
|
|
83
|
+
* @returns {KeyUserImportQuestion} The password prompt.
|
|
84
|
+
*/
|
|
85
|
+
private getPasswordPrompt;
|
|
86
|
+
/**
|
|
87
|
+
* Returns the adaptation prompt.
|
|
88
|
+
*
|
|
89
|
+
* @param {KeyUserAdaptationPromptOptions} [_] - The options for the adaptation prompt.
|
|
90
|
+
* @returns {KeyUserImportQuestion} The adaptation prompt.
|
|
91
|
+
*/
|
|
92
|
+
private getAdaptationPrompt;
|
|
93
|
+
/**
|
|
94
|
+
* Loads adaptations for the current provider.
|
|
95
|
+
*/
|
|
96
|
+
private loadAdaptations;
|
|
97
|
+
/**
|
|
98
|
+
* Loads flex versions for the current provider.
|
|
99
|
+
*/
|
|
100
|
+
private loadFlexVersions;
|
|
101
|
+
/**
|
|
102
|
+
* Resets the state by clearing adaptations, flex versions, and key-user changes.
|
|
103
|
+
*/
|
|
104
|
+
private resetState;
|
|
105
|
+
/**
|
|
106
|
+
* Loads flex versions and adaptations, then validates key-user changes if only DEFAULT adaptation exists.
|
|
107
|
+
*
|
|
108
|
+
* @returns The result of key-user validation if only DEFAULT exists, or true.
|
|
109
|
+
*/
|
|
110
|
+
private loadDataAndValidateKeyUserChanges;
|
|
111
|
+
/**
|
|
112
|
+
* Validates the system selection by testing the connection.
|
|
113
|
+
*
|
|
114
|
+
* @param {string} system - The selected system.
|
|
115
|
+
* @param {KeyUserImportAnswers} answers - The configuration answers provided by the user.
|
|
116
|
+
* @returns An error message if validation fails, or true if the system selection is valid.
|
|
117
|
+
*/
|
|
118
|
+
private validateSystem;
|
|
119
|
+
/**
|
|
120
|
+
* Validates the password by testing the connection.
|
|
121
|
+
*
|
|
122
|
+
* @param {string} password - The inputted password.
|
|
123
|
+
* @param {KeyUserImportAnswers} answers - The configuration answers provided by the user.
|
|
124
|
+
* @returns An error message if validation fails, or true if the password is valid.
|
|
125
|
+
*/
|
|
126
|
+
private validatePassword;
|
|
127
|
+
/**
|
|
128
|
+
* Validates the key-user changes by testing the connection.
|
|
129
|
+
*
|
|
130
|
+
* @param {string} adaptationId - The selected adaptation.
|
|
131
|
+
* @returns An error message if validation fails, or true if the key-user changes are valid.
|
|
132
|
+
*/
|
|
133
|
+
private validateKeyUserChanges;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=key-user.d.ts.map
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyUserImportPrompter = exports.DEFAULT_ADAPTATION_ID = void 0;
|
|
4
|
+
exports.determineFlexVersion = determineFlexVersion;
|
|
5
|
+
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
6
|
+
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
7
|
+
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
8
|
+
const i18n_1 = require("../../utils/i18n");
|
|
9
|
+
const types_1 = require("../types");
|
|
10
|
+
const choices_1 = require("./helper/choices");
|
|
11
|
+
exports.DEFAULT_ADAPTATION_ID = 'DEFAULT';
|
|
12
|
+
/**
|
|
13
|
+
* Determines the flex version to be used. If the first version is the draft (versionId "0"), use the second version (active version).
|
|
14
|
+
*
|
|
15
|
+
* @param {FlexVersion[]} flexVersions - The list of flex versions.
|
|
16
|
+
* @returns {string} The flex version to be used.
|
|
17
|
+
*/
|
|
18
|
+
function determineFlexVersion(flexVersions) {
|
|
19
|
+
if (!flexVersions?.length) {
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
if (flexVersions[0]?.versionId === '0') {
|
|
23
|
+
return flexVersions[1]?.versionId ?? '';
|
|
24
|
+
}
|
|
25
|
+
return flexVersions[0]?.versionId ?? '';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Prompter class that guides the user through importing key-user changes.
|
|
29
|
+
*/
|
|
30
|
+
class KeyUserImportPrompter {
|
|
31
|
+
systemLookup;
|
|
32
|
+
componentId;
|
|
33
|
+
defaultProvider;
|
|
34
|
+
defaultSystem;
|
|
35
|
+
logger;
|
|
36
|
+
/**
|
|
37
|
+
* Instance of AbapServiceProvider.
|
|
38
|
+
*/
|
|
39
|
+
provider;
|
|
40
|
+
/**
|
|
41
|
+
* List of adaptations.
|
|
42
|
+
*/
|
|
43
|
+
adaptations = [];
|
|
44
|
+
/**
|
|
45
|
+
* List of key-user changes.
|
|
46
|
+
*/
|
|
47
|
+
keyUserChanges = [];
|
|
48
|
+
/**
|
|
49
|
+
* List of flex versions.
|
|
50
|
+
*/
|
|
51
|
+
flexVersions = [];
|
|
52
|
+
/**
|
|
53
|
+
* Indicates if authentication is required.
|
|
54
|
+
*/
|
|
55
|
+
isAuthRequired = false;
|
|
56
|
+
/**
|
|
57
|
+
* Constructs a new KeyUserImportPrompter.
|
|
58
|
+
*
|
|
59
|
+
* @param {SystemLookup} systemLookup - The system lookup.
|
|
60
|
+
* @param {string} componentId - The component ID.
|
|
61
|
+
* @param {AbapServiceProvider} defaultProvider - The default provider.
|
|
62
|
+
* @param {string} defaultSystem - The default system.
|
|
63
|
+
* @param {ToolsLogger} logger - The logger.
|
|
64
|
+
*/
|
|
65
|
+
constructor(systemLookup, componentId, defaultProvider, defaultSystem, logger) {
|
|
66
|
+
this.systemLookup = systemLookup;
|
|
67
|
+
this.componentId = componentId;
|
|
68
|
+
this.defaultProvider = defaultProvider;
|
|
69
|
+
this.defaultSystem = defaultSystem;
|
|
70
|
+
this.logger = logger;
|
|
71
|
+
this.provider = defaultProvider;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Returns the key-user changes.
|
|
75
|
+
*
|
|
76
|
+
* @returns {KeyUserChangeContent[]} The key-user changes.
|
|
77
|
+
*/
|
|
78
|
+
get changes() {
|
|
79
|
+
return this.keyUserChanges;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Builds the prompts for the key-user import page.
|
|
83
|
+
*
|
|
84
|
+
* @param {KeyUserImportPromptOptions} [promptOptions] - Per-prompt settings (hide/default).
|
|
85
|
+
* @returns {KeyUserImportQuestion[]} Questions for the key-user import page.
|
|
86
|
+
*/
|
|
87
|
+
getPrompts(promptOptions) {
|
|
88
|
+
const keyedPrompts = {
|
|
89
|
+
[types_1.keyUserPromptNames.keyUserSystem]: this.getSystemPrompt(promptOptions?.[types_1.keyUserPromptNames.keyUserSystem]),
|
|
90
|
+
[types_1.keyUserPromptNames.keyUserUsername]: this.getUsernamePrompt(promptOptions?.[types_1.keyUserPromptNames.keyUserUsername]),
|
|
91
|
+
[types_1.keyUserPromptNames.keyUserPassword]: this.getPasswordPrompt(promptOptions?.[types_1.keyUserPromptNames.keyUserPassword]),
|
|
92
|
+
[types_1.keyUserPromptNames.keyUserAdaptation]: this.getAdaptationPrompt(promptOptions?.[types_1.keyUserPromptNames.keyUserAdaptation])
|
|
93
|
+
};
|
|
94
|
+
const questions = Object.entries(keyedPrompts)
|
|
95
|
+
.filter(([promptName, _]) => {
|
|
96
|
+
const options = promptOptions?.[promptName];
|
|
97
|
+
return !(options && 'hide' in options && options.hide);
|
|
98
|
+
})
|
|
99
|
+
.map(([_, question]) => question);
|
|
100
|
+
return questions;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns the system prompt.
|
|
104
|
+
*
|
|
105
|
+
* @param {KeyUserSystemPromptOptions} [options] - The options for the system prompt.
|
|
106
|
+
* @returns {KeyUserImportQuestion} The system prompt.
|
|
107
|
+
*/
|
|
108
|
+
getSystemPrompt(options) {
|
|
109
|
+
return {
|
|
110
|
+
type: 'list',
|
|
111
|
+
name: types_1.keyUserPromptNames.keyUserSystem,
|
|
112
|
+
message: (0, i18n_1.t)('prompts.systemLabel'),
|
|
113
|
+
choices: async () => {
|
|
114
|
+
const systems = await this.systemLookup.getSystems();
|
|
115
|
+
return (0, choices_1.getKeyUserSystemChoices)(systems, this.defaultSystem);
|
|
116
|
+
},
|
|
117
|
+
guiOptions: {
|
|
118
|
+
mandatory: true,
|
|
119
|
+
breadcrumb: true
|
|
120
|
+
},
|
|
121
|
+
default: options?.default ?? '',
|
|
122
|
+
validate: async (value, answers) => await this.validateSystem(value, answers)
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Returns the username prompt.
|
|
127
|
+
*
|
|
128
|
+
* @param {KeyUserUsernamePromptOptions} [options] - The options for the username prompt.
|
|
129
|
+
* @returns {KeyUserImportQuestion} The username prompt.
|
|
130
|
+
*/
|
|
131
|
+
getUsernamePrompt(options) {
|
|
132
|
+
return {
|
|
133
|
+
type: 'input',
|
|
134
|
+
name: types_1.keyUserPromptNames.keyUserUsername,
|
|
135
|
+
message: (0, i18n_1.t)('prompts.usernameLabel'),
|
|
136
|
+
default: options?.default ?? '',
|
|
137
|
+
filter: (val) => val.trim(),
|
|
138
|
+
guiOptions: {
|
|
139
|
+
mandatory: true
|
|
140
|
+
},
|
|
141
|
+
when: (answers) => !!answers.keyUserSystem && this.isAuthRequired,
|
|
142
|
+
validate: (value) => (0, project_input_validator_1.validateEmptyString)(value)
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns the password prompt.
|
|
147
|
+
*
|
|
148
|
+
* @param {KeyUserPasswordPromptOptions} [options] - The options for the password prompt.
|
|
149
|
+
* @returns {KeyUserImportQuestion} The password prompt.
|
|
150
|
+
*/
|
|
151
|
+
getPasswordPrompt(options) {
|
|
152
|
+
return {
|
|
153
|
+
type: 'password',
|
|
154
|
+
name: types_1.keyUserPromptNames.keyUserPassword,
|
|
155
|
+
message: (0, i18n_1.t)('prompts.passwordLabel'),
|
|
156
|
+
mask: '*',
|
|
157
|
+
default: options?.default ?? '',
|
|
158
|
+
guiOptions: {
|
|
159
|
+
mandatory: true,
|
|
160
|
+
type: 'login'
|
|
161
|
+
},
|
|
162
|
+
when: (answers) => !!answers.keyUserSystem && this.isAuthRequired,
|
|
163
|
+
validate: async (value, answers) => await this.validatePassword(value, answers)
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Returns the adaptation prompt.
|
|
168
|
+
*
|
|
169
|
+
* @param {KeyUserAdaptationPromptOptions} [_] - The options for the adaptation prompt.
|
|
170
|
+
* @returns {KeyUserImportQuestion} The adaptation prompt.
|
|
171
|
+
*/
|
|
172
|
+
getAdaptationPrompt(_) {
|
|
173
|
+
return {
|
|
174
|
+
type: 'list',
|
|
175
|
+
name: types_1.keyUserPromptNames.keyUserAdaptation,
|
|
176
|
+
message: (0, i18n_1.t)('prompts.keyUserAdaptationLabel'),
|
|
177
|
+
guiOptions: {
|
|
178
|
+
mandatory: true,
|
|
179
|
+
breadcrumb: (0, i18n_1.t)('prompts.keyUserAdaptationBreadcrumb')
|
|
180
|
+
},
|
|
181
|
+
choices: () => (0, choices_1.getAdaptationChoices)(this.adaptations),
|
|
182
|
+
default: () => (0, choices_1.getAdaptationChoices)(this.adaptations)[0]?.name,
|
|
183
|
+
validate: async (adaptation) => await this.validateKeyUserChanges(adaptation?.id),
|
|
184
|
+
when: () => this.adaptations.length > 1
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Loads adaptations for the current provider.
|
|
189
|
+
*/
|
|
190
|
+
async loadAdaptations() {
|
|
191
|
+
const version = determineFlexVersion(this.flexVersions);
|
|
192
|
+
const lrep = this.provider?.getLayeredRepository();
|
|
193
|
+
const response = await lrep?.listAdaptations(this.componentId, version);
|
|
194
|
+
this.adaptations = response?.adaptations ?? [];
|
|
195
|
+
this.logger.log(`Loaded adaptations: ${JSON.stringify(this.adaptations, null, 2)}`);
|
|
196
|
+
if (!this.adaptations.length) {
|
|
197
|
+
throw new Error((0, i18n_1.t)('error.keyUserNoAdaptations'));
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Loads flex versions for the current provider.
|
|
202
|
+
*/
|
|
203
|
+
async loadFlexVersions() {
|
|
204
|
+
const lrep = this.provider?.getLayeredRepository();
|
|
205
|
+
const response = await lrep?.getFlexVersions(this.componentId);
|
|
206
|
+
this.flexVersions = response?.versions ?? [];
|
|
207
|
+
this.logger.log(`Loaded flex versions: ${JSON.stringify(this.flexVersions, null, 2)}`);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Resets the state by clearing adaptations, flex versions, and key-user changes.
|
|
211
|
+
*/
|
|
212
|
+
resetState() {
|
|
213
|
+
this.flexVersions = [];
|
|
214
|
+
this.adaptations = [];
|
|
215
|
+
this.keyUserChanges = [];
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Loads flex versions and adaptations, then validates key-user changes if only DEFAULT adaptation exists.
|
|
219
|
+
*
|
|
220
|
+
* @returns The result of key-user validation if only DEFAULT exists, or true.
|
|
221
|
+
*/
|
|
222
|
+
async loadDataAndValidateKeyUserChanges() {
|
|
223
|
+
/**
|
|
224
|
+
* Ensure provider is authenticated for CloudReady systems before making API calls
|
|
225
|
+
*/
|
|
226
|
+
await this.provider.isAbapCloud();
|
|
227
|
+
await this.loadFlexVersions();
|
|
228
|
+
await this.loadAdaptations();
|
|
229
|
+
if (this.adaptations.length === 1 && this.adaptations[0]?.id === exports.DEFAULT_ADAPTATION_ID) {
|
|
230
|
+
return await this.validateKeyUserChanges(exports.DEFAULT_ADAPTATION_ID);
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Validates the system selection by testing the connection.
|
|
236
|
+
*
|
|
237
|
+
* @param {string} system - The selected system.
|
|
238
|
+
* @param {KeyUserImportAnswers} answers - The configuration answers provided by the user.
|
|
239
|
+
* @returns An error message if validation fails, or true if the system selection is valid.
|
|
240
|
+
*/
|
|
241
|
+
async validateSystem(system, answers) {
|
|
242
|
+
const validationResult = (0, project_input_validator_1.validateEmptyString)(system);
|
|
243
|
+
if (typeof validationResult === 'string') {
|
|
244
|
+
return validationResult;
|
|
245
|
+
}
|
|
246
|
+
try {
|
|
247
|
+
this.resetState();
|
|
248
|
+
if (system === this.defaultSystem && this.defaultProvider) {
|
|
249
|
+
this.provider = this.defaultProvider;
|
|
250
|
+
this.isAuthRequired = false;
|
|
251
|
+
return await this.loadDataAndValidateKeyUserChanges();
|
|
252
|
+
}
|
|
253
|
+
this.isAuthRequired = await this.systemLookup.getSystemRequiresAuth(system);
|
|
254
|
+
if (!this.isAuthRequired) {
|
|
255
|
+
const options = {
|
|
256
|
+
system,
|
|
257
|
+
client: undefined,
|
|
258
|
+
username: answers.keyUserUsername,
|
|
259
|
+
password: answers.keyUserPassword
|
|
260
|
+
};
|
|
261
|
+
this.provider = await (0, adp_tooling_1.getConfiguredProvider)(options, this.logger);
|
|
262
|
+
return await this.loadDataAndValidateKeyUserChanges();
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
catch (e) {
|
|
266
|
+
return e.message;
|
|
267
|
+
}
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Validates the password by testing the connection.
|
|
272
|
+
*
|
|
273
|
+
* @param {string} password - The inputted password.
|
|
274
|
+
* @param {KeyUserImportAnswers} answers - The configuration answers provided by the user.
|
|
275
|
+
* @returns An error message if validation fails, or true if the password is valid.
|
|
276
|
+
*/
|
|
277
|
+
async validatePassword(password, answers) {
|
|
278
|
+
const validationResult = (0, project_input_validator_1.validateEmptyString)(password);
|
|
279
|
+
if (typeof validationResult === 'string') {
|
|
280
|
+
return validationResult;
|
|
281
|
+
}
|
|
282
|
+
try {
|
|
283
|
+
this.resetState();
|
|
284
|
+
const options = {
|
|
285
|
+
system: answers.keyUserSystem,
|
|
286
|
+
client: undefined,
|
|
287
|
+
username: answers.keyUserUsername,
|
|
288
|
+
password
|
|
289
|
+
};
|
|
290
|
+
this.provider = await (0, adp_tooling_1.getConfiguredProvider)(options, this.logger);
|
|
291
|
+
return await this.loadDataAndValidateKeyUserChanges();
|
|
292
|
+
}
|
|
293
|
+
catch (e) {
|
|
294
|
+
return e.message;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Validates the key-user changes by testing the connection.
|
|
299
|
+
*
|
|
300
|
+
* @param {string} adaptationId - The selected adaptation.
|
|
301
|
+
* @returns An error message if validation fails, or true if the key-user changes are valid.
|
|
302
|
+
*/
|
|
303
|
+
async validateKeyUserChanges(adaptationId) {
|
|
304
|
+
try {
|
|
305
|
+
if (!this.provider || !adaptationId) {
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
const lrep = this.provider?.getLayeredRepository();
|
|
309
|
+
const data = await lrep?.getKeyUserData(this.componentId, adaptationId);
|
|
310
|
+
this.keyUserChanges = data?.contents ?? [];
|
|
311
|
+
this.logger.debug(`Retrieved ${this.keyUserChanges.length} key-user change(s) for adaptation ${adaptationId}`);
|
|
312
|
+
if (!this.keyUserChanges.length) {
|
|
313
|
+
if (adaptationId === exports.DEFAULT_ADAPTATION_ID && this.adaptations.length === 1) {
|
|
314
|
+
return (0, i18n_1.t)('error.keyUserNoChangesDefault');
|
|
315
|
+
}
|
|
316
|
+
this.logger.warn(`No key-user changes found for adaptation: ${adaptationId}`);
|
|
317
|
+
return (0, i18n_1.t)('error.keyUserNoChangesAdaptation', { adaptationId });
|
|
318
|
+
}
|
|
319
|
+
return true;
|
|
320
|
+
}
|
|
321
|
+
catch (e) {
|
|
322
|
+
this.logger.error(`Error validating key-user changes for adaptation ${adaptationId}: ${e.message}`);
|
|
323
|
+
this.logger.debug(e);
|
|
324
|
+
if ((0, axios_extension_1.isAxiosError)(e) && (e.response?.status === 405 || e.response?.status === 404)) {
|
|
325
|
+
return (0, i18n_1.t)('error.keyUserNotSupported');
|
|
326
|
+
}
|
|
327
|
+
return e.message;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
exports.KeyUserImportPrompter = KeyUserImportPrompter;
|
|
332
|
+
//# sourceMappingURL=key-user.js.map
|
|
@@ -2,6 +2,7 @@ import type Generator from 'yeoman-generator';
|
|
|
2
2
|
import type { AppWizard } from '@sap-devx/yeoman-ui-types';
|
|
3
3
|
import type { YUIQuestion } from '@sap-ux/inquirer-common';
|
|
4
4
|
import type { TelemetryData } from '@sap-ux/fiori-generator-shared';
|
|
5
|
+
import type { AdaptationDescriptor } from '@sap-ux/axios-extension';
|
|
5
6
|
import type { AttributesAnswers, ConfigAnswers } from '@sap-ux/adp-tooling';
|
|
6
7
|
export interface AdpGeneratorOptions extends Generator.GeneratorOptions {
|
|
7
8
|
/**
|
|
@@ -96,7 +97,8 @@ export declare enum attributePromptNames {
|
|
|
96
97
|
ui5ValidationCli = "ui5ValidationCli",
|
|
97
98
|
enableTypeScript = "enableTypeScript",
|
|
98
99
|
addDeployConfig = "addDeployConfig",
|
|
99
|
-
addFlpConfig = "addFlpConfig"
|
|
100
|
+
addFlpConfig = "addFlpConfig",
|
|
101
|
+
importKeyUserChanges = "importKeyUserChanges"
|
|
100
102
|
}
|
|
101
103
|
export type AttributesQuestion = YUIQuestion<AttributesAnswers>;
|
|
102
104
|
export interface ProjectNamePromptOptions {
|
|
@@ -128,6 +130,10 @@ export interface AddFlpConfigPromptOptions {
|
|
|
128
130
|
hide?: boolean;
|
|
129
131
|
hasBaseAppInbounds?: boolean;
|
|
130
132
|
}
|
|
133
|
+
export interface ImportKeyUserChangesPromptOptions {
|
|
134
|
+
hide?: boolean;
|
|
135
|
+
default?: boolean;
|
|
136
|
+
}
|
|
131
137
|
export type AttributePromptOptions = Partial<{
|
|
132
138
|
[attributePromptNames.projectName]: ProjectNamePromptOptions;
|
|
133
139
|
[attributePromptNames.title]: ApplicationTitlePromptOptions;
|
|
@@ -138,7 +144,49 @@ export type AttributePromptOptions = Partial<{
|
|
|
138
144
|
[attributePromptNames.enableTypeScript]: EnableTypeScriptPromptOptions;
|
|
139
145
|
[attributePromptNames.addDeployConfig]: AddDeployConfigPromptOptions;
|
|
140
146
|
[attributePromptNames.addFlpConfig]: AddFlpConfigPromptOptions;
|
|
147
|
+
[attributePromptNames.importKeyUserChanges]: ImportKeyUserChangesPromptOptions;
|
|
141
148
|
}>;
|
|
149
|
+
export type KeyUserImportQuestion = YUIQuestion<KeyUserImportAnswers>;
|
|
150
|
+
/**
|
|
151
|
+
* Enumeration of prompt names used in the key-user import.
|
|
152
|
+
*/
|
|
153
|
+
export declare enum keyUserPromptNames {
|
|
154
|
+
keyUserSystem = "keyUserSystem",
|
|
155
|
+
keyUserUsername = "keyUserUsername",
|
|
156
|
+
keyUserPassword = "keyUserPassword",
|
|
157
|
+
keyUserAdaptation = "keyUserAdaptation"
|
|
158
|
+
}
|
|
159
|
+
export interface KeyUserSystemPromptOptions {
|
|
160
|
+
default?: string;
|
|
161
|
+
hide?: boolean;
|
|
162
|
+
}
|
|
163
|
+
export interface KeyUserUsernamePromptOptions {
|
|
164
|
+
default?: string;
|
|
165
|
+
hide?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export interface KeyUserPasswordPromptOptions {
|
|
168
|
+
default?: string;
|
|
169
|
+
hide?: boolean;
|
|
170
|
+
}
|
|
171
|
+
export interface KeyUserAdaptationPromptOptions {
|
|
172
|
+
default?: string;
|
|
173
|
+
hide?: boolean;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Options for the key-user import inquirer & the prompts.
|
|
177
|
+
*/
|
|
178
|
+
export type KeyUserImportPromptOptions = Partial<{
|
|
179
|
+
[keyUserPromptNames.keyUserSystem]: KeyUserSystemPromptOptions;
|
|
180
|
+
[keyUserPromptNames.keyUserUsername]: KeyUserUsernamePromptOptions;
|
|
181
|
+
[keyUserPromptNames.keyUserPassword]: KeyUserPasswordPromptOptions;
|
|
182
|
+
[keyUserPromptNames.keyUserAdaptation]: KeyUserAdaptationPromptOptions;
|
|
183
|
+
}>;
|
|
184
|
+
export interface KeyUserImportAnswers {
|
|
185
|
+
keyUserSystem: string;
|
|
186
|
+
keyUserUsername?: string;
|
|
187
|
+
keyUserPassword?: string;
|
|
188
|
+
keyUserAdaptation: AdaptationDescriptor;
|
|
189
|
+
}
|
|
142
190
|
export declare enum targetEnvPromptNames {
|
|
143
191
|
targetEnv = "targetEnv"
|
|
144
192
|
}
|
package/generators/app/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cfLoginPromptNames = exports.TargetEnv = exports.targetEnvPromptNames = exports.attributePromptNames = exports.configPromptNames = void 0;
|
|
3
|
+
exports.cfLoginPromptNames = exports.TargetEnv = exports.targetEnvPromptNames = exports.keyUserPromptNames = exports.attributePromptNames = exports.configPromptNames = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Enumeration of prompt names used in the configuration.
|
|
6
6
|
*/
|
|
@@ -27,7 +27,18 @@ var attributePromptNames;
|
|
|
27
27
|
attributePromptNames["enableTypeScript"] = "enableTypeScript";
|
|
28
28
|
attributePromptNames["addDeployConfig"] = "addDeployConfig";
|
|
29
29
|
attributePromptNames["addFlpConfig"] = "addFlpConfig";
|
|
30
|
+
attributePromptNames["importKeyUserChanges"] = "importKeyUserChanges";
|
|
30
31
|
})(attributePromptNames || (exports.attributePromptNames = attributePromptNames = {}));
|
|
32
|
+
/**
|
|
33
|
+
* Enumeration of prompt names used in the key-user import.
|
|
34
|
+
*/
|
|
35
|
+
var keyUserPromptNames;
|
|
36
|
+
(function (keyUserPromptNames) {
|
|
37
|
+
keyUserPromptNames["keyUserSystem"] = "keyUserSystem";
|
|
38
|
+
keyUserPromptNames["keyUserUsername"] = "keyUserUsername";
|
|
39
|
+
keyUserPromptNames["keyUserPassword"] = "keyUserPassword";
|
|
40
|
+
keyUserPromptNames["keyUserAdaptation"] = "keyUserAdaptation";
|
|
41
|
+
})(keyUserPromptNames || (exports.keyUserPromptNames = keyUserPromptNames = {}));
|
|
31
42
|
var targetEnvPromptNames;
|
|
32
43
|
(function (targetEnvPromptNames) {
|
|
33
44
|
targetEnvPromptNames["targetEnv"] = "targetEnv";
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
"configurationDescr": "Configure the system and select an application.",
|
|
5
5
|
"projectAttributesName": "Project Attributes",
|
|
6
6
|
"projectAttributesDescr": "Configure the main project attributes.",
|
|
7
|
+
"keyUserImportName": "Import Key User Changes",
|
|
8
|
+
"keyUserImportDescr": "You can either continue with the pre-selected source system or choose a system from which the key-user changes are taken over.",
|
|
7
9
|
"flpConfigName": "SAP Fiori Launchpad Configuration: Tile Settings",
|
|
8
10
|
"tileSettingsName": "SAP Fiori Launchpad Configuration: Tile Handling",
|
|
9
11
|
"tileSettingsDescr": "Add a new tile or replace existing tiles of the base application.\nProject: {{projectName}}",
|
|
@@ -48,6 +50,9 @@
|
|
|
48
50
|
"ui5VersionTooltip": "Select the SAPUI5 version you want to use to preview your app variant.",
|
|
49
51
|
"addDeployConfig": "Add Deployment Configuration",
|
|
50
52
|
"addFlpConfig": "Add SAP Fiori Launchpad Configuration",
|
|
53
|
+
"importKeyUserChangesLabel": "Import Key User Changes",
|
|
54
|
+
"keyUserAdaptationLabel": "Context-Based Adaptation",
|
|
55
|
+
"keyUserAdaptationBreadcrumb": "Adaptation",
|
|
51
56
|
"targetEnvLabel": "Environment",
|
|
52
57
|
"targetEnvTooltip": "Select the target environment for your Adaptation Project.",
|
|
53
58
|
"targetEnvBreadcrumb": "Target Environment",
|
|
@@ -104,7 +109,11 @@
|
|
|
104
109
|
"projectDoesNotExist": "The project does not exist. Please select an MTA project.",
|
|
105
110
|
"projectDoesNotExistMta": "Provide the path to the MTA project where you want to have your Adaptation Project created.",
|
|
106
111
|
"noAdaptableBusinessServiceFoundInMta": "No adaptable business service found in the MTA.",
|
|
107
|
-
"fetchBaseInboundsFailed": "Fetching base application inbounds failed: {{error}}."
|
|
112
|
+
"fetchBaseInboundsFailed": "Fetching base application inbounds failed: {{error}}.",
|
|
113
|
+
"keyUserNoChangesDefault": "Only a single adaptation ('DEFAULT') was found and no key-user changes were found for it. Please select a different system to continue, or navigate back to the 'Project Attributes' page and choose not to import key-user changes.",
|
|
114
|
+
"keyUserNoChangesAdaptation": "No key-user changes have been found for the '{{adaptationId}}' adaptation. Please select a different adaptation.",
|
|
115
|
+
"keyUserNoAdaptations": "No context-based adaptations have been found for the selected application. Please refer to the documentation.",
|
|
116
|
+
"keyUserNotSupported": "The selected system does not allow or support the import of key-user changes. Please refer to the documentation."
|
|
108
117
|
},
|
|
109
118
|
"validators": {
|
|
110
119
|
"ui5VersionNotDetectedError": "The SAPUI5 version of the selected system cannot be determined. You are able to create and edit adaptation projects that use the latest SAPUI5 version, but they are not usable on this system until the system's SAPUI5 version is upgraded to version 1.71 or higher."
|
|
@@ -37,6 +37,12 @@ export declare function updateFlpWizardSteps(hasBaseAppInbound: boolean, prompts
|
|
|
37
37
|
* @returns {IPrompt} The deployment configuration wizard page.
|
|
38
38
|
*/
|
|
39
39
|
export declare function getDeployPage(): IPrompt;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the key user import page step.
|
|
42
|
+
*
|
|
43
|
+
* @returns {IPrompt} The key user import wizard page.
|
|
44
|
+
*/
|
|
45
|
+
export declare function getKeyUserImportPage(): IPrompt;
|
|
40
46
|
/**
|
|
41
47
|
* Dynamically adds or removes a step in the Yeoman UI wizard.
|
|
42
48
|
*
|
|
@@ -5,6 +5,7 @@ exports.updateCfWizardSteps = updateCfWizardSteps;
|
|
|
5
5
|
exports.getFlpPages = getFlpPages;
|
|
6
6
|
exports.updateFlpWizardSteps = updateFlpWizardSteps;
|
|
7
7
|
exports.getDeployPage = getDeployPage;
|
|
8
|
+
exports.getKeyUserImportPage = getKeyUserImportPage;
|
|
8
9
|
exports.updateWizardSteps = updateWizardSteps;
|
|
9
10
|
exports.getSubGenErrorPage = getSubGenErrorPage;
|
|
10
11
|
exports.getSubGenAuthPages = getSubGenAuthPages;
|
|
@@ -94,6 +95,14 @@ function updateFlpWizardSteps(hasBaseAppInbound, prompts, projectName, shouldAdd
|
|
|
94
95
|
function getDeployPage() {
|
|
95
96
|
return { name: (0, i18n_1.t)('yuiNavSteps.deployConfigName'), description: (0, i18n_1.t)('yuiNavSteps.deployConfigDescr') };
|
|
96
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Returns the key user import page step.
|
|
100
|
+
*
|
|
101
|
+
* @returns {IPrompt} The key user import wizard page.
|
|
102
|
+
*/
|
|
103
|
+
function getKeyUserImportPage() {
|
|
104
|
+
return { name: (0, i18n_1.t)('yuiNavSteps.keyUserImportName'), description: (0, i18n_1.t)('yuiNavSteps.keyUserImportDescr') };
|
|
105
|
+
}
|
|
97
106
|
/**
|
|
98
107
|
* Dynamically adds or removes a step in the Yeoman UI wizard.
|
|
99
108
|
*
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"displayName": "SAPUI5 Adaptation Project",
|
|
4
4
|
"homepage": "https://help.sap.com/viewer/584e0bcbfd4a4aff91c815cefa0bce2d/Cloud/en-US/ada9567b767941aba8d49fdb4fdedea7.html",
|
|
5
5
|
"description": "Adaptation project allows you to create an app variant for an existing SAP Fiori elements-based or SAPUI5 freestyle application, without changing the original application.",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.8.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"i18next": "25.8.0",
|
|
31
31
|
"yeoman-generator": "5.10.0",
|
|
32
32
|
"uuid": "10.0.0",
|
|
33
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
34
|
-
"@sap-ux/axios-extension": "1.25.
|
|
33
|
+
"@sap-ux/adp-tooling": "0.18.45",
|
|
34
|
+
"@sap-ux/axios-extension": "1.25.7",
|
|
35
35
|
"@sap-ux/btp-utils": "1.1.6",
|
|
36
36
|
"@sap-ux/feature-toggle": "0.3.5",
|
|
37
37
|
"@sap-ux/inquirer-common": "0.10.17",
|
|
38
38
|
"@sap-ux/logger": "0.8.0",
|
|
39
39
|
"@sap-ux/project-access": "1.34.2",
|
|
40
40
|
"@sap-ux/store": "1.5.1",
|
|
41
|
-
"@sap-ux/system-access": "0.6.
|
|
41
|
+
"@sap-ux/system-access": "0.6.43",
|
|
42
42
|
"@sap-ux/project-input-validator": "0.6.46",
|
|
43
43
|
"@sap-ux/fiori-generator-shared": "0.13.57",
|
|
44
44
|
"@sap-ux/odata-service-writer": "0.29.9",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"fs-extra": "10.0.0",
|
|
58
58
|
"rimraf": "6.0.1",
|
|
59
59
|
"yeoman-test": "6.3.0",
|
|
60
|
-
"@sap-ux/deploy-config-sub-generator": "0.5.
|
|
60
|
+
"@sap-ux/deploy-config-sub-generator": "0.5.54"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=20.x"
|