@sap-ux/odata-service-inquirer 2.14.6 → 2.14.8
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/dist/prompts/datasources/sap-system/system-selection/prompt-helpers.d.ts +2 -1
- package/dist/prompts/datasources/sap-system/system-selection/prompt-helpers.js +8 -5
- package/dist/prompts/datasources/sap-system/system-selection/questions.js +1 -1
- package/dist/types.d.ts +4 -0
- package/package.json +2 -2
|
@@ -40,9 +40,10 @@ export declare function connectWithDestination(destination: Destination, connect
|
|
|
40
40
|
*
|
|
41
41
|
* @param destinationFilters the filters to apply to the destination choices
|
|
42
42
|
* @param includeCloudFoundryAbapEnvChoice whether to include the Cloud Foundry ABAP environment choice in the list
|
|
43
|
+
* @param hideNewSystem - if true it will prevent adding the 'New System' option to the list
|
|
43
44
|
* @returns a list of choices for the system selection prompt
|
|
44
45
|
*/
|
|
45
|
-
export declare function createSystemChoices(destinationFilters?: Partial<DestinationFilters>, includeCloudFoundryAbapEnvChoice?: boolean): Promise<ListChoiceOptions<SystemSelectionAnswerType>[]>;
|
|
46
|
+
export declare function createSystemChoices(destinationFilters?: Partial<DestinationFilters>, includeCloudFoundryAbapEnvChoice?: boolean, hideNewSystem?: boolean): Promise<ListChoiceOptions<SystemSelectionAnswerType>[]>;
|
|
46
47
|
/**
|
|
47
48
|
* Find the default selection index based on the default choice value.
|
|
48
49
|
*
|
|
@@ -138,9 +138,10 @@ function matchesFilters(destination, filters) {
|
|
|
138
138
|
*
|
|
139
139
|
* @param destinationFilters the filters to apply to the destination choices
|
|
140
140
|
* @param includeCloudFoundryAbapEnvChoice whether to include the Cloud Foundry ABAP environment choice in the list
|
|
141
|
+
* @param hideNewSystem - if true it will prevent adding the 'New System' option to the list
|
|
141
142
|
* @returns a list of choices for the system selection prompt
|
|
142
143
|
*/
|
|
143
|
-
async function createSystemChoices(destinationFilters, includeCloudFoundryAbapEnvChoice = false) {
|
|
144
|
+
async function createSystemChoices(destinationFilters, includeCloudFoundryAbapEnvChoice = false, hideNewSystem = false) {
|
|
144
145
|
let systemChoices = [];
|
|
145
146
|
let newSystemChoice;
|
|
146
147
|
// If this is BAS, return destinations, otherwise return stored backend systems
|
|
@@ -190,10 +191,12 @@ async function createSystemChoices(destinationFilters, includeCloudFoundryAbapEn
|
|
|
190
191
|
}
|
|
191
192
|
};
|
|
192
193
|
});
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
if (!hideNewSystem) {
|
|
195
|
+
newSystemChoice = {
|
|
196
|
+
name: (0, i18n_1.t)('prompts.systemSelection.newSystemChoiceLabel'),
|
|
197
|
+
value: { type: 'newSystemChoice', system: exports.NewSystemChoice }
|
|
198
|
+
};
|
|
199
|
+
}
|
|
197
200
|
}
|
|
198
201
|
systemChoices.sort(({ name: nameA }, { name: nameB }) => nameA.localeCompare(nameB, undefined, { numeric: true, caseFirst: 'lower' }));
|
|
199
202
|
if (newSystemChoice) {
|
|
@@ -99,7 +99,7 @@ async function getSystemSelectionQuestions(promptOptions, connectedSystem) {
|
|
|
99
99
|
async function getSystemConnectionQuestions(connectionValidator, promptOptions, cachedConnectedSystem) {
|
|
100
100
|
const requiredOdataVersion = promptOptions?.serviceSelection?.requiredOdataVersion;
|
|
101
101
|
const destinationFilters = promptOptions?.systemSelection?.destinationFilters;
|
|
102
|
-
const systemChoices = await (0, prompt_helpers_1.createSystemChoices)(destinationFilters, promptOptions?.systemSelection?.includeCloudFoundryAbapEnvChoice);
|
|
102
|
+
const systemChoices = await (0, prompt_helpers_1.createSystemChoices)(destinationFilters, promptOptions?.systemSelection?.includeCloudFoundryAbapEnvChoice, promptOptions?.systemSelection?.hideNewSystem);
|
|
103
103
|
const defaultChoiceIndex = (0, prompt_helpers_1.findDefaultSystemSelectionIndex)(systemChoices, promptOptions?.systemSelection?.defaultChoice);
|
|
104
104
|
const shouldOnlyShowDefaultChoice = promptOptions?.systemSelection?.onlyShowDefaultChoice && promptOptions?.systemSelection?.defaultChoice;
|
|
105
105
|
const questions = [
|
package/dist/types.d.ts
CHANGED
|
@@ -295,6 +295,10 @@ export type SystemSelectionPromptOptions = {
|
|
|
295
295
|
* this option will not be applied and the full list of choices will be presented to the user.
|
|
296
296
|
*/
|
|
297
297
|
onlyShowDefaultChoice?: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* If true, the 'New System' option is not added to the system selection list.
|
|
300
|
+
*/
|
|
301
|
+
hideNewSystem?: boolean;
|
|
298
302
|
};
|
|
299
303
|
export type MetadataPromptOptions = {
|
|
300
304
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/odata-service-inquirer",
|
|
3
3
|
"description": "Prompts module that can prompt users for inputs required for odata service writing",
|
|
4
|
-
"version": "2.14.
|
|
4
|
+
"version": "2.14.8",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@sap-ux/fiori-generator-shared": "0.13.54",
|
|
35
35
|
"@sap-ux/guided-answers-helper": "0.4.2",
|
|
36
36
|
"@sap-ux/telemetry": "0.6.56",
|
|
37
|
-
"@sap-ux/inquirer-common": "0.10.
|
|
37
|
+
"@sap-ux/inquirer-common": "0.10.14",
|
|
38
38
|
"@sap-ux/logger": "0.8.0",
|
|
39
39
|
"@sap-ux/nodejs-utils": "0.2.11",
|
|
40
40
|
"@sap-ux/project-access": "1.34.2",
|