@sap-ux/flp-config-inquirer 0.5.11 → 1.0.1
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/i18n.js +14 -25
- package/dist/index.d.ts +7 -7
- package/dist/index.js +11 -26
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.js +1 -17
- package/dist/prompts/prompts.d.ts +1 -1
- package/dist/prompts/prompts.js +19 -23
- package/dist/prompts/questions/advanced.d.ts +1 -1
- package/dist/prompts/questions/advanced.js +27 -34
- package/dist/prompts/questions/basic.d.ts +1 -1
- package/dist/prompts/questions/basic.js +29 -36
- package/dist/prompts/questions/index.d.ts +3 -3
- package/dist/prompts/questions/index.js +3 -19
- package/dist/prompts/questions/tile-settings.d.ts +1 -1
- package/dist/prompts/questions/tile-settings.js +10 -13
- package/dist/types.js +5 -8
- package/dist/utils.d.ts +1 -1
- package/dist/utils.js +11 -15
- package/package.json +12 -10
package/dist/i18n.js
CHANGED
|
@@ -1,36 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
exports.i18n = exports.FLP_CONFIG_NAMESPACE = void 0;
|
|
7
|
-
exports.addi18nResourceBundle = addi18nResourceBundle;
|
|
8
|
-
exports.initI18n = initI18n;
|
|
9
|
-
exports.t = t;
|
|
10
|
-
const i18next_1 = __importDefault(require("i18next"));
|
|
11
|
-
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
12
|
-
const flp_config_inquirer_i18n_json_1 = __importDefault(require("./translations/flp-config-inquirer.i18n.json"));
|
|
13
|
-
exports.FLP_CONFIG_NAMESPACE = 'flp-config-inquirer';
|
|
14
|
-
exports.i18n = i18next_1.default.createInstance();
|
|
1
|
+
import i18next from 'i18next';
|
|
2
|
+
import { addi18nResourceBundle as addProjectInputI18nResourceBundle } from '@sap-ux/project-input-validator';
|
|
3
|
+
import translations from './translations/flp-config-inquirer.i18n.json' with { type: 'json' };
|
|
4
|
+
export const FLP_CONFIG_NAMESPACE = 'flp-config-inquirer';
|
|
5
|
+
export const i18n = i18next.createInstance();
|
|
15
6
|
/**
|
|
16
7
|
* Adds the `flp-config-inquirer` resource bundle to i18next.
|
|
17
8
|
* May be required to load i18n translations after initialising in the consumer module.
|
|
18
9
|
*/
|
|
19
|
-
function addi18nResourceBundle() {
|
|
20
|
-
|
|
10
|
+
export function addi18nResourceBundle() {
|
|
11
|
+
i18n.addResourceBundle('en', FLP_CONFIG_NAMESPACE, translations);
|
|
21
12
|
}
|
|
22
13
|
/**
|
|
23
14
|
* Initialize i18next with the translations for this module.
|
|
24
15
|
*/
|
|
25
|
-
async function initI18n() {
|
|
26
|
-
await
|
|
16
|
+
export async function initI18n() {
|
|
17
|
+
await i18n.init({
|
|
27
18
|
lng: 'en',
|
|
28
19
|
fallbackLng: 'en',
|
|
29
20
|
showSupportNotice: false
|
|
30
21
|
});
|
|
31
22
|
addi18nResourceBundle();
|
|
32
23
|
// add the project-input-validator i18n resource bundle to ensure all translations are available
|
|
33
|
-
(
|
|
24
|
+
addProjectInputI18nResourceBundle();
|
|
34
25
|
}
|
|
35
26
|
/**
|
|
36
27
|
* Helper function facading the call to i18next. Unless a namespace option is provided the local namespace will be used.
|
|
@@ -39,13 +30,11 @@ async function initI18n() {
|
|
|
39
30
|
* @param options additional options
|
|
40
31
|
* @returns {string} localized string stored for the given key
|
|
41
32
|
*/
|
|
42
|
-
function t(key, options) {
|
|
33
|
+
export function t(key, options) {
|
|
43
34
|
if (!options?.ns) {
|
|
44
|
-
options = Object.assign(options ?? {}, { ns:
|
|
35
|
+
options = Object.assign(options ?? {}, { ns: FLP_CONFIG_NAMESPACE });
|
|
45
36
|
}
|
|
46
|
-
return
|
|
37
|
+
return i18n.t(key, options);
|
|
47
38
|
}
|
|
48
|
-
initI18n().catch(() =>
|
|
49
|
-
// Needed for lint
|
|
50
|
-
});
|
|
39
|
+
void initI18n().catch(() => undefined);
|
|
51
40
|
//# sourceMappingURL=i18n.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { ManifestNamespace } from '@sap-ux/project-access';
|
|
2
2
|
import type { InquirerAdapter, PromptDefaultValue } from '@sap-ux/inquirer-common';
|
|
3
|
-
import { addi18nResourceBundle } from './i18n';
|
|
4
|
-
import { promptNames } from './types';
|
|
5
|
-
import { getExistingFlpConfigInfoPrompt } from './prompts/questions';
|
|
6
|
-
import { getTileSettingsQuestions } from './prompts';
|
|
7
|
-
import type { FLPConfigAnswers, FLPConfigQuestion, FLPConfigPromptOptions, TileSettingsAnswers } from './types';
|
|
8
|
-
import { getAdpFlpConfigPromptOptions, getAdpFlpInboundsWriterConfig } from './utils';
|
|
3
|
+
import { addi18nResourceBundle } from './i18n.js';
|
|
4
|
+
import { promptNames } from './types.js';
|
|
5
|
+
import { getExistingFlpConfigInfoPrompt } from './prompts/questions/index.js';
|
|
6
|
+
import { getTileSettingsQuestions } from './prompts/index.js';
|
|
7
|
+
import type { FLPConfigAnswers, FLPConfigQuestion, FLPConfigPromptOptions, TileSettingsAnswers } from './types.js';
|
|
8
|
+
import { getAdpFlpConfigPromptOptions, getAdpFlpInboundsWriterConfig } from './utils.js';
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves the inquirer prompts for the FLP configuration.
|
|
11
11
|
*
|
|
@@ -24,5 +24,5 @@ declare function getPrompts(inbounds?: ManifestNamespace.Inbound, promptOptions?
|
|
|
24
24
|
*/
|
|
25
25
|
declare function prompt(adapter: InquirerAdapter, inbounds?: ManifestNamespace.Inbound, promptOptions?: FLPConfigPromptOptions): Promise<FLPConfigAnswers>;
|
|
26
26
|
export { getPrompts, getExistingFlpConfigInfoPrompt, prompt, addi18nResourceBundle, promptNames, type InquirerAdapter, type PromptDefaultValue, type FLPConfigAnswers, type FLPConfigPromptOptions, type FLPConfigQuestion, type TileSettingsAnswers, getAdpFlpConfigPromptOptions, getAdpFlpInboundsWriterConfig, getTileSettingsQuestions };
|
|
27
|
-
export { tileActions, tilePromptNames } from './types';
|
|
27
|
+
export { tileActions, tilePromptNames } from './types.js';
|
|
28
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.getPrompts = getPrompts;
|
|
8
|
-
exports.prompt = prompt;
|
|
9
|
-
const isNil_1 = __importDefault(require("lodash/isNil"));
|
|
10
|
-
const i18n_1 = require("./i18n");
|
|
11
|
-
Object.defineProperty(exports, "addi18nResourceBundle", { enumerable: true, get: function () { return i18n_1.addi18nResourceBundle; } });
|
|
12
|
-
const types_1 = require("./types");
|
|
13
|
-
Object.defineProperty(exports, "promptNames", { enumerable: true, get: function () { return types_1.promptNames; } });
|
|
14
|
-
const questions_1 = require("./prompts/questions");
|
|
15
|
-
Object.defineProperty(exports, "getExistingFlpConfigInfoPrompt", { enumerable: true, get: function () { return questions_1.getExistingFlpConfigInfoPrompt; } });
|
|
16
|
-
const prompts_1 = require("./prompts");
|
|
17
|
-
Object.defineProperty(exports, "getTileSettingsQuestions", { enumerable: true, get: function () { return prompts_1.getTileSettingsQuestions; } });
|
|
18
|
-
const utils_1 = require("./utils");
|
|
19
|
-
Object.defineProperty(exports, "getAdpFlpConfigPromptOptions", { enumerable: true, get: function () { return utils_1.getAdpFlpConfigPromptOptions; } });
|
|
20
|
-
Object.defineProperty(exports, "getAdpFlpInboundsWriterConfig", { enumerable: true, get: function () { return utils_1.getAdpFlpInboundsWriterConfig; } });
|
|
1
|
+
import isNil from 'lodash/isNil.js';
|
|
2
|
+
import { initI18n, addi18nResourceBundle } from './i18n.js';
|
|
3
|
+
import { promptNames } from './types.js';
|
|
4
|
+
import { getExistingFlpConfigInfoPrompt } from './prompts/questions/index.js';
|
|
5
|
+
import { getQuestions, getTileSettingsQuestions } from './prompts/index.js';
|
|
6
|
+
import { getAdpFlpConfigPromptOptions, getAdpFlpInboundsWriterConfig } from './utils.js';
|
|
21
7
|
/**
|
|
22
8
|
* Retrieves the inquirer prompts for the FLP configuration.
|
|
23
9
|
*
|
|
@@ -26,8 +12,8 @@ Object.defineProperty(exports, "getAdpFlpInboundsWriterConfig", { enumerable: tr
|
|
|
26
12
|
* @returns {Promise<FLPConfigQuestion[]>} A promise that resolves to an array of FLP configuration questions.
|
|
27
13
|
*/
|
|
28
14
|
async function getPrompts(inbounds, promptOptions) {
|
|
29
|
-
await
|
|
30
|
-
return
|
|
15
|
+
await initI18n();
|
|
16
|
+
return getQuestions(inbounds, promptOptions);
|
|
31
17
|
}
|
|
32
18
|
/**
|
|
33
19
|
* Prompts the user for FLP configuration inputs.
|
|
@@ -61,7 +47,7 @@ function applyPromptOptionDefaults(answers, promptOptions) {
|
|
|
61
47
|
const promptKey = key;
|
|
62
48
|
// Do we have an answer? If not, apply the default
|
|
63
49
|
const defaultValueOrFunc = promptOpt.default;
|
|
64
|
-
if ((
|
|
50
|
+
if (isNil(answers[promptKey]) && defaultValueOrFunc !== undefined) {
|
|
65
51
|
const defaultValue = getDefaultValue(answers, defaultValueOrFunc);
|
|
66
52
|
Object.assign(defaultAnswers, {
|
|
67
53
|
[promptKey]: defaultValue
|
|
@@ -84,7 +70,6 @@ function getDefaultValue(answers, promptDefault) {
|
|
|
84
70
|
}
|
|
85
71
|
return promptDefault;
|
|
86
72
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
Object.defineProperty(exports, "tilePromptNames", { enumerable: true, get: function () { return types_2.tilePromptNames; } });
|
|
73
|
+
export { getPrompts, getExistingFlpConfigInfoPrompt, prompt, addi18nResourceBundle, promptNames, getAdpFlpConfigPromptOptions, getAdpFlpInboundsWriterConfig, getTileSettingsQuestions };
|
|
74
|
+
export { tileActions, tilePromptNames } from './types.js';
|
|
90
75
|
//# sourceMappingURL=index.js.map
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './prompts';
|
|
1
|
+
export * from './prompts.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/prompts/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./prompts"), exports);
|
|
1
|
+
export * from './prompts.js';
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ManifestNamespace } from '@sap-ux/project-access';
|
|
2
|
-
import type { FLPConfigPromptOptions, FLPConfigQuestion, TileSettingsAnswers } from '../types';
|
|
2
|
+
import type { FLPConfigPromptOptions, FLPConfigQuestion, TileSettingsAnswers } from '../types.js';
|
|
3
3
|
import type { YUIQuestion } from '@sap-ux/inquirer-common';
|
|
4
4
|
/**
|
|
5
5
|
* Generates a list of prompts for FLP (Fiori Launchpad) configuration.
|
package/dist/prompts/prompts.js
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.getTileSettingsQuestions = getTileSettingsQuestions;
|
|
5
|
-
const fiori_generator_shared_1 = require("@sap-ux/fiori-generator-shared");
|
|
6
|
-
const questions_1 = require("./questions");
|
|
7
|
-
const types_1 = require("../types");
|
|
1
|
+
import { getHostEnvironment, hostEnvironment } from '@sap-ux/fiori-generator-shared';
|
|
2
|
+
import { getSemanticObjectPrompt, getActionPrompt, getTitlePrompt, getSubTitlePrompt, getOverwritePrompt, getInboundIdsPrompt, getParameterStringPrompt, getIconPrompt, getExistingFlpConfigInfoPrompt, getTileSettingsPrompts, getConfirmReplacePrompt } from './questions/index.js';
|
|
3
|
+
import { promptNames } from '../types.js';
|
|
8
4
|
/**
|
|
9
5
|
* Generates a list of prompts for FLP (Fiori Launchpad) configuration.
|
|
10
6
|
*
|
|
@@ -16,22 +12,22 @@ const types_1 = require("../types");
|
|
|
16
12
|
* @param {FLPConfigPromptOptions | undefined} [promptOptions] - Optional configuration to control prompt behavior and defaults.
|
|
17
13
|
* @returns {FLPConfigQuestion[]} An array of FLPConfigQuestion objects to be used for prompting the user.
|
|
18
14
|
*/
|
|
19
|
-
function getQuestions(inbounds, promptOptions) {
|
|
15
|
+
export function getQuestions(inbounds, promptOptions) {
|
|
20
16
|
const inboundKeys = Object.keys(inbounds ?? {});
|
|
21
|
-
const isCLI =
|
|
17
|
+
const isCLI = getHostEnvironment() === hostEnvironment.cli;
|
|
22
18
|
const existingKeyRef = { value: false };
|
|
23
19
|
const silentOverwrite = promptOptions?.silentOverwrite ?? false;
|
|
24
20
|
const keyedPrompts = {
|
|
25
|
-
[
|
|
26
|
-
[
|
|
27
|
-
[
|
|
28
|
-
[
|
|
29
|
-
[
|
|
30
|
-
[
|
|
31
|
-
[
|
|
32
|
-
[
|
|
33
|
-
[
|
|
34
|
-
[
|
|
21
|
+
[promptNames.existingFlpConfigInfo]: getExistingFlpConfigInfoPrompt(isCLI),
|
|
22
|
+
[promptNames.inboundId]: getInboundIdsPrompt(inbounds ?? {}),
|
|
23
|
+
[promptNames.semanticObject]: getSemanticObjectPrompt(isCLI, promptOptions?.[promptNames.semanticObject]),
|
|
24
|
+
[promptNames.action]: getActionPrompt(isCLI, promptOptions?.[promptNames.action], inbounds),
|
|
25
|
+
[promptNames.overwrite]: getOverwritePrompt(inboundKeys, isCLI, existingKeyRef, promptOptions?.[promptNames.overwrite]),
|
|
26
|
+
[promptNames.title]: getTitlePrompt(existingKeyRef, silentOverwrite, isCLI, promptOptions?.[promptNames.title]),
|
|
27
|
+
[promptNames.subTitle]: getSubTitlePrompt(existingKeyRef, silentOverwrite, promptOptions?.[promptNames.subTitle]),
|
|
28
|
+
[promptNames.icon]: getIconPrompt(promptOptions?.[promptNames.icon]),
|
|
29
|
+
[promptNames.additionalParameters]: getParameterStringPrompt(),
|
|
30
|
+
[promptNames.confirmReplace]: getConfirmReplacePrompt(promptOptions?.[promptNames.confirmReplace])
|
|
35
31
|
};
|
|
36
32
|
const questions = Object.entries(keyedPrompts)
|
|
37
33
|
.filter(([promptName]) => {
|
|
@@ -47,11 +43,11 @@ function getQuestions(inbounds, promptOptions) {
|
|
|
47
43
|
* @param {FLPConfigPromptOptions} [promptOptions] - Optional configuration to control prompt behavior and defaults.
|
|
48
44
|
* @returns {YUIQuestion<TileSettingsAnswers>[] | FLPConfigQuestion[]} An array of questions for tile settings.
|
|
49
45
|
*/
|
|
50
|
-
function getTileSettingsQuestions(promptOptions) {
|
|
51
|
-
const isCLI =
|
|
52
|
-
const questions =
|
|
46
|
+
export function getTileSettingsQuestions(promptOptions) {
|
|
47
|
+
const isCLI = getHostEnvironment() === hostEnvironment.cli;
|
|
48
|
+
const questions = getTileSettingsPrompts();
|
|
53
49
|
if (!promptOptions?.existingFlpConfigInfo?.hide) {
|
|
54
|
-
questions.unshift(
|
|
50
|
+
questions.unshift(getExistingFlpConfigInfoPrompt(isCLI));
|
|
55
51
|
}
|
|
56
52
|
return questions;
|
|
57
53
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FLPConfigQuestion, IconPromptOptions, ConfirmReplacePromptOptions } from '../../types';
|
|
1
|
+
import type { FLPConfigQuestion, IconPromptOptions, ConfirmReplacePromptOptions } from '../../types.js';
|
|
2
2
|
import type { ManifestNamespace } from '@sap-ux/project-access';
|
|
3
3
|
/**
|
|
4
4
|
* Creates the 'inboundId' prompt for FLP configuration.
|
|
@@ -1,36 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.getExistingFlpConfigInfoPrompt = getExistingFlpConfigInfoPrompt;
|
|
6
|
-
exports.getIconPrompt = getIconPrompt;
|
|
7
|
-
exports.getConfirmReplacePrompt = getConfirmReplacePrompt;
|
|
8
|
-
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
9
|
-
const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
|
|
10
|
-
const i18n_1 = require("../../i18n");
|
|
11
|
-
const types_1 = require("../../types");
|
|
1
|
+
import { validateEmptyString } from '@sap-ux/project-input-validator';
|
|
2
|
+
import { Severity } from '@sap-devx/yeoman-ui-types';
|
|
3
|
+
import { t } from '../../i18n.js';
|
|
4
|
+
import { promptNames } from '../../types.js';
|
|
12
5
|
/**
|
|
13
6
|
* Creates the 'inboundId' prompt for FLP configuration.
|
|
14
7
|
*
|
|
15
8
|
* @param {ManifestNamespace.Inbound} inbounds - List of existing inbounds to populate the prompt choices.
|
|
16
9
|
* @returns {FLPConfigQuestion} The prompt configuration for selecting an inbound ID.
|
|
17
10
|
*/
|
|
18
|
-
function getInboundIdsPrompt(inbounds) {
|
|
11
|
+
export function getInboundIdsPrompt(inbounds) {
|
|
19
12
|
const choices = Object.entries(inbounds).map(([inboundId, data]) => ({
|
|
20
13
|
name: inboundId,
|
|
21
14
|
value: data
|
|
22
15
|
}));
|
|
23
16
|
return {
|
|
24
17
|
type: 'list',
|
|
25
|
-
name:
|
|
26
|
-
message:
|
|
18
|
+
name: promptNames.inboundId,
|
|
19
|
+
message: t('prompts.inboundIds'),
|
|
27
20
|
choices: choices,
|
|
28
21
|
default: () => choices[0]?.value,
|
|
29
|
-
validate: (value) =>
|
|
22
|
+
validate: (value) => validateEmptyString(value.semanticObject) && validateEmptyString(value.action),
|
|
30
23
|
when: choices?.length > 0,
|
|
31
24
|
guiOptions: {
|
|
32
|
-
hint:
|
|
33
|
-
breadcrumb:
|
|
25
|
+
hint: t('tooltips.inboundId'),
|
|
26
|
+
breadcrumb: t('prompts.inboundIds'),
|
|
34
27
|
mandatory: true
|
|
35
28
|
}
|
|
36
29
|
};
|
|
@@ -40,11 +33,11 @@ function getInboundIdsPrompt(inbounds) {
|
|
|
40
33
|
*
|
|
41
34
|
* @returns {FLPConfigQuestion} The prompt configuration for specifying a parameter string.
|
|
42
35
|
*/
|
|
43
|
-
function getParameterStringPrompt() {
|
|
36
|
+
export function getParameterStringPrompt() {
|
|
44
37
|
return {
|
|
45
38
|
type: 'editor',
|
|
46
|
-
name:
|
|
47
|
-
message:
|
|
39
|
+
name: promptNames.additionalParameters,
|
|
40
|
+
message: t('prompts.additionalParameters'),
|
|
48
41
|
default: (answers) => {
|
|
49
42
|
const parameters = answers?.inboundId?.signature?.parameters;
|
|
50
43
|
return parameters ? JSON.stringify(parameters, null, 2) : '';
|
|
@@ -58,11 +51,11 @@ function getParameterStringPrompt() {
|
|
|
58
51
|
return true;
|
|
59
52
|
}
|
|
60
53
|
catch {
|
|
61
|
-
return
|
|
54
|
+
return t('validators.invalidParameterString');
|
|
62
55
|
}
|
|
63
56
|
},
|
|
64
57
|
guiOptions: {
|
|
65
|
-
hint:
|
|
58
|
+
hint: t('tooltips.additionalParameters'),
|
|
66
59
|
mandatory: false
|
|
67
60
|
}
|
|
68
61
|
};
|
|
@@ -73,11 +66,11 @@ function getParameterStringPrompt() {
|
|
|
73
66
|
* @param isCLI - Indicates if the platform is CLI (unused).
|
|
74
67
|
* @returns {FLPConfigQuestion} The prompt configuration for displaying existing FLP config info.
|
|
75
68
|
*/
|
|
76
|
-
function getExistingFlpConfigInfoPrompt(isCLI) {
|
|
69
|
+
export function getExistingFlpConfigInfoPrompt(isCLI) {
|
|
77
70
|
return {
|
|
78
71
|
type: 'input',
|
|
79
|
-
name:
|
|
80
|
-
message:
|
|
72
|
+
name: promptNames.existingFlpConfigInfo,
|
|
73
|
+
message: t('prompts.existingFLPConfig'),
|
|
81
74
|
when: () => !isCLI,
|
|
82
75
|
guiOptions: {
|
|
83
76
|
type: 'label',
|
|
@@ -91,14 +84,14 @@ function getExistingFlpConfigInfoPrompt(isCLI) {
|
|
|
91
84
|
* @param {IconPromptOptions} [options] - Optional configuration for the icon prompt, including default values.
|
|
92
85
|
* @returns {FLPConfigQuestion} The prompt configuration for the icon.
|
|
93
86
|
*/
|
|
94
|
-
function getIconPrompt(options) {
|
|
87
|
+
export function getIconPrompt(options) {
|
|
95
88
|
return {
|
|
96
|
-
name:
|
|
89
|
+
name: promptNames.icon,
|
|
97
90
|
type: 'input',
|
|
98
91
|
guiOptions: {
|
|
99
92
|
breadcrumb: true
|
|
100
93
|
},
|
|
101
|
-
message:
|
|
94
|
+
message: t('prompts.icon'),
|
|
102
95
|
default: (answers) => {
|
|
103
96
|
if (options?.default) {
|
|
104
97
|
return options.default;
|
|
@@ -114,18 +107,18 @@ function getIconPrompt(options) {
|
|
|
114
107
|
* @param {ConfirmReplacePromptOptions} [options] - Optional configuration for the confirm replace prompt, including default values.
|
|
115
108
|
* @returns {FLPConfigQuestion} The prompt configuration for confirming tile replacement.
|
|
116
109
|
*/
|
|
117
|
-
function getConfirmReplacePrompt(options) {
|
|
110
|
+
export function getConfirmReplacePrompt(options) {
|
|
118
111
|
return {
|
|
119
112
|
type: 'confirm',
|
|
120
|
-
name:
|
|
121
|
-
message:
|
|
113
|
+
name: promptNames.confirmReplace,
|
|
114
|
+
message: t('prompts.confirmReplace'),
|
|
122
115
|
default: false,
|
|
123
116
|
validate: (value) => (value ? true : ' '),
|
|
124
117
|
additionalMessages: () => ({
|
|
125
|
-
severity:
|
|
118
|
+
severity: Severity.information,
|
|
126
119
|
message: options?.isCF
|
|
127
|
-
?
|
|
128
|
-
:
|
|
120
|
+
? t('additionalMessages.confirmReplaceAdditionalMessageCF')
|
|
121
|
+
: t('additionalMessages.confirmReplaceAdditionalMessage')
|
|
129
122
|
})
|
|
130
123
|
};
|
|
131
124
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActionPromptOptions, ExistingInboundRef, FLPConfigQuestion, OverwritePromptOptions, SemanticObjectPromptOptions, SubTitlePromptOptions, TitlePromptOptions } from '../../types';
|
|
1
|
+
import type { ActionPromptOptions, ExistingInboundRef, FLPConfigQuestion, OverwritePromptOptions, SemanticObjectPromptOptions, SubTitlePromptOptions, TitlePromptOptions } from '../../types.js';
|
|
2
2
|
import type { ManifestNamespace } from '@sap-ux/project-access';
|
|
3
3
|
/**
|
|
4
4
|
* Creates the 'semanticObject' prompt for FLP configuration.
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
exports.getOverwritePrompt = getOverwritePrompt;
|
|
6
|
-
exports.getTitlePrompt = getTitlePrompt;
|
|
7
|
-
exports.getSubTitlePrompt = getSubTitlePrompt;
|
|
8
|
-
const yeoman_ui_types_1 = require("@sap-devx/yeoman-ui-types");
|
|
9
|
-
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
10
|
-
const i18n_1 = require("../../i18n");
|
|
11
|
-
const types_1 = require("../../types");
|
|
1
|
+
import { Severity } from '@sap-devx/yeoman-ui-types';
|
|
2
|
+
import { validateText } from '@sap-ux/project-input-validator';
|
|
3
|
+
import { t } from '../../i18n.js';
|
|
4
|
+
import { promptNames } from '../../types.js';
|
|
12
5
|
/**
|
|
13
6
|
* Creates the 'semanticObject' prompt for FLP configuration.
|
|
14
7
|
*
|
|
@@ -16,19 +9,19 @@ const types_1 = require("../../types");
|
|
|
16
9
|
* @param {SemanticObjectPromptOptions} [options] - Optional configuration for the semantic object prompt, including default values.
|
|
17
10
|
* @returns {FLPConfigQuestion} The prompt configuration for the semantic object.
|
|
18
11
|
*/
|
|
19
|
-
function getSemanticObjectPrompt(isCLI, options) {
|
|
12
|
+
export function getSemanticObjectPrompt(isCLI, options) {
|
|
20
13
|
const guiOptions = {
|
|
21
14
|
mandatory: true,
|
|
22
15
|
breadcrumb: true
|
|
23
16
|
};
|
|
24
17
|
if (options?.showTooltip) {
|
|
25
|
-
guiOptions.hint =
|
|
18
|
+
guiOptions.hint = t('tooltips.semObjectActionDuplication');
|
|
26
19
|
}
|
|
27
20
|
return {
|
|
28
|
-
name:
|
|
21
|
+
name: promptNames.semanticObject,
|
|
29
22
|
type: 'input',
|
|
30
23
|
guiOptions,
|
|
31
|
-
message:
|
|
24
|
+
message: t('prompts.semanticObject'),
|
|
32
25
|
default: (answers) => {
|
|
33
26
|
if (options?.default) {
|
|
34
27
|
return options.default;
|
|
@@ -36,7 +29,7 @@ function getSemanticObjectPrompt(isCLI, options) {
|
|
|
36
29
|
return answers?.inboundId?.semanticObject ? `${answers?.inboundId?.semanticObject}_New` : '';
|
|
37
30
|
},
|
|
38
31
|
filter: (val) => val?.trim(),
|
|
39
|
-
validate: (val) =>
|
|
32
|
+
validate: (val) => validateText(val, isCLI, 30, ['_'])
|
|
40
33
|
};
|
|
41
34
|
}
|
|
42
35
|
/**
|
|
@@ -47,19 +40,19 @@ function getSemanticObjectPrompt(isCLI, options) {
|
|
|
47
40
|
* @param {ManifestNamespace.Inbound} [inbounds] - Existing inbound configuration to derive default action.
|
|
48
41
|
* @returns {FLPConfigQuestion} The prompt configuration for the action.
|
|
49
42
|
*/
|
|
50
|
-
function getActionPrompt(isCLI, options, inbounds) {
|
|
43
|
+
export function getActionPrompt(isCLI, options, inbounds) {
|
|
51
44
|
const guiOptions = {
|
|
52
45
|
mandatory: true,
|
|
53
46
|
breadcrumb: true
|
|
54
47
|
};
|
|
55
48
|
if (options?.showTooltip) {
|
|
56
|
-
guiOptions.hint =
|
|
49
|
+
guiOptions.hint = t('tooltips.semObjectActionDuplication');
|
|
57
50
|
}
|
|
58
51
|
return {
|
|
59
|
-
name:
|
|
52
|
+
name: promptNames.action,
|
|
60
53
|
type: 'input',
|
|
61
54
|
guiOptions,
|
|
62
|
-
message:
|
|
55
|
+
message: t('prompts.action'),
|
|
63
56
|
default: (answers) => {
|
|
64
57
|
if (options?.default) {
|
|
65
58
|
return options.default;
|
|
@@ -68,7 +61,7 @@ function getActionPrompt(isCLI, options, inbounds) {
|
|
|
68
61
|
},
|
|
69
62
|
filter: (val) => val?.trim(),
|
|
70
63
|
validate: (val, answers) => {
|
|
71
|
-
const textValidation =
|
|
64
|
+
const textValidation = validateText(val, isCLI, 60, ['_']);
|
|
72
65
|
if (textValidation !== true) {
|
|
73
66
|
return textValidation;
|
|
74
67
|
}
|
|
@@ -80,7 +73,7 @@ function getActionPrompt(isCLI, options, inbounds) {
|
|
|
80
73
|
return true;
|
|
81
74
|
}
|
|
82
75
|
const isDuplicate = Object.values(inbounds).some((inbound) => inbound.semanticObject === answers.semanticObject && inbound.action === val);
|
|
83
|
-
return isDuplicate ?
|
|
76
|
+
return isDuplicate ? t('validators.duplicateInbound') : true;
|
|
84
77
|
}
|
|
85
78
|
};
|
|
86
79
|
}
|
|
@@ -93,15 +86,15 @@ function getActionPrompt(isCLI, options, inbounds) {
|
|
|
93
86
|
* @param {OverwritePromptOptions} [options] - Optional configuration for the overwrite prompt, including default behavior and visibility.
|
|
94
87
|
* @returns {FLPConfigQuestion} The prompt configuration for overwrite.
|
|
95
88
|
*/
|
|
96
|
-
function getOverwritePrompt(inboundKeys, isCLI, existingKeyRef, options) {
|
|
89
|
+
export function getOverwritePrompt(inboundKeys, isCLI, existingKeyRef, options) {
|
|
97
90
|
return {
|
|
98
91
|
type: 'confirm',
|
|
99
|
-
name:
|
|
92
|
+
name: promptNames.overwrite,
|
|
100
93
|
message: (previousAnswers) => `${isCLI
|
|
101
|
-
?
|
|
94
|
+
? t('validators.inboundConfigKeyExists', {
|
|
102
95
|
inboundKey: `${previousAnswers.semanticObject}-${previousAnswers.action}`
|
|
103
96
|
})
|
|
104
|
-
: ''} ${
|
|
97
|
+
: ''} ${t('validators.flpConfigOverwrite')}`,
|
|
105
98
|
guiOptions: {
|
|
106
99
|
applyDefaultWhenDirty: true
|
|
107
100
|
},
|
|
@@ -112,10 +105,10 @@ function getOverwritePrompt(inboundKeys, isCLI, existingKeyRef, options) {
|
|
|
112
105
|
return existingKeyRef.value;
|
|
113
106
|
},
|
|
114
107
|
additionalMessages: (_, previousAnswers) => ({
|
|
115
|
-
message:
|
|
108
|
+
message: t('validators.inboundConfigKeyExists', {
|
|
116
109
|
inboundKey: `${previousAnswers.semanticObject}-${previousAnswers.action}`
|
|
117
110
|
}),
|
|
118
|
-
severity:
|
|
111
|
+
severity: Severity.warning
|
|
119
112
|
})
|
|
120
113
|
};
|
|
121
114
|
}
|
|
@@ -128,16 +121,16 @@ function getOverwritePrompt(inboundKeys, isCLI, existingKeyRef, options) {
|
|
|
128
121
|
* @param {TitlePromptOptions} [options] - Optional configuration for the title prompt, including default values.
|
|
129
122
|
* @returns {FLPConfigQuestion} The prompt configuration for the title.
|
|
130
123
|
*/
|
|
131
|
-
function getTitlePrompt(existingKeyRef, silentOverwrite, isCLI, options) {
|
|
124
|
+
export function getTitlePrompt(existingKeyRef, silentOverwrite, isCLI, options) {
|
|
132
125
|
return {
|
|
133
126
|
when: ({ overwrite }) => overwrite !== false || !existingKeyRef.value || silentOverwrite,
|
|
134
|
-
name:
|
|
127
|
+
name: promptNames.title,
|
|
135
128
|
type: 'input',
|
|
136
129
|
guiOptions: {
|
|
137
130
|
mandatory: true,
|
|
138
131
|
breadcrumb: true
|
|
139
132
|
},
|
|
140
|
-
message:
|
|
133
|
+
message: t('prompts.title'),
|
|
141
134
|
default: (answers) => {
|
|
142
135
|
if (options?.default) {
|
|
143
136
|
return options.default;
|
|
@@ -145,7 +138,7 @@ function getTitlePrompt(existingKeyRef, silentOverwrite, isCLI, options) {
|
|
|
145
138
|
return answers?.inboundId?.title ?? '';
|
|
146
139
|
},
|
|
147
140
|
filter: (val) => val?.trim(),
|
|
148
|
-
validate: (val) =>
|
|
141
|
+
validate: (val) => validateText(val, isCLI, 0)
|
|
149
142
|
};
|
|
150
143
|
}
|
|
151
144
|
/**
|
|
@@ -156,15 +149,15 @@ function getTitlePrompt(existingKeyRef, silentOverwrite, isCLI, options) {
|
|
|
156
149
|
* @param {SubTitlePromptOptions} [options] - Optional configuration for the subtitle prompt, including default values.
|
|
157
150
|
* @returns {FLPConfigQuestion} The prompt configuration for the subtitle.
|
|
158
151
|
*/
|
|
159
|
-
function getSubTitlePrompt(existingKeyRef, silentOverwrite, options) {
|
|
152
|
+
export function getSubTitlePrompt(existingKeyRef, silentOverwrite, options) {
|
|
160
153
|
return {
|
|
161
154
|
when: ({ overwrite }) => overwrite !== false || !existingKeyRef.value || silentOverwrite,
|
|
162
|
-
name:
|
|
155
|
+
name: promptNames.subTitle,
|
|
163
156
|
type: 'input',
|
|
164
157
|
guiOptions: {
|
|
165
|
-
breadcrumb:
|
|
158
|
+
breadcrumb: t('prompts.subTitle')
|
|
166
159
|
},
|
|
167
|
-
message:
|
|
160
|
+
message: t('prompts.subTitle'),
|
|
168
161
|
default: (answers) => {
|
|
169
162
|
if (options?.default) {
|
|
170
163
|
return options.default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './basic';
|
|
2
|
-
export * from './advanced';
|
|
3
|
-
export * from './tile-settings';
|
|
1
|
+
export * from './basic.js';
|
|
2
|
+
export * from './advanced.js';
|
|
3
|
+
export * from './tile-settings.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,20 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./basic"), exports);
|
|
18
|
-
__exportStar(require("./advanced"), exports);
|
|
19
|
-
__exportStar(require("./tile-settings"), exports);
|
|
1
|
+
export * from './basic.js';
|
|
2
|
+
export * from './advanced.js';
|
|
3
|
+
export * from './tile-settings.js';
|
|
20
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getTileSettingsPrompts = getTileSettingsPrompts;
|
|
4
|
-
const types_1 = require("../../types");
|
|
5
|
-
const i18n_1 = require("../../i18n");
|
|
1
|
+
import { tileActions, tilePromptNames } from '../../types.js';
|
|
2
|
+
import { t } from '../../i18n.js';
|
|
6
3
|
/**
|
|
7
4
|
* Returns the list of questions for tile handling actions.
|
|
8
5
|
*
|
|
9
6
|
* @returns {YUIQuestion<TileSettingsAnswers>[]} Array of tile action questions.
|
|
10
7
|
*/
|
|
11
|
-
function getTileSettingsPrompts() {
|
|
8
|
+
export function getTileSettingsPrompts() {
|
|
12
9
|
return [
|
|
13
10
|
{
|
|
14
11
|
type: 'list',
|
|
15
|
-
name:
|
|
16
|
-
message:
|
|
12
|
+
name: tilePromptNames.tileHandlingAction,
|
|
13
|
+
message: t('prompts.tileHandlingAction'),
|
|
17
14
|
choices: [
|
|
18
|
-
{ name:
|
|
19
|
-
{ name:
|
|
15
|
+
{ name: t('choices.addNewTile'), value: tileActions.ADD },
|
|
16
|
+
{ name: t('choices.replaceOriginalTile'), value: tileActions.REPLACE }
|
|
20
17
|
],
|
|
21
18
|
store: false,
|
|
22
19
|
guiOptions: {
|
|
@@ -26,14 +23,14 @@ function getTileSettingsPrompts() {
|
|
|
26
23
|
},
|
|
27
24
|
{
|
|
28
25
|
type: 'confirm',
|
|
29
|
-
name:
|
|
30
|
-
message:
|
|
26
|
+
name: tilePromptNames.copyFromExisting,
|
|
27
|
+
message: t('prompts.copyFromExisting'),
|
|
31
28
|
default: false,
|
|
32
29
|
guiOptions: {
|
|
33
30
|
mandatory: true,
|
|
34
31
|
breadcrumb: true
|
|
35
32
|
},
|
|
36
|
-
when: (answers) => answers.tileHandlingAction ===
|
|
33
|
+
when: (answers) => answers.tileHandlingAction === tileActions.ADD
|
|
37
34
|
}
|
|
38
35
|
];
|
|
39
36
|
}
|
package/dist/types.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tileActions = exports.tilePromptNames = exports.promptNames = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* Enumeration of prompt names used in the FLP configuration.
|
|
6
3
|
*/
|
|
7
|
-
var promptNames;
|
|
4
|
+
export var promptNames;
|
|
8
5
|
(function (promptNames) {
|
|
9
6
|
promptNames["existingFlpConfigInfo"] = "existingFlpConfigInfo";
|
|
10
7
|
promptNames["inboundId"] = "inboundId";
|
|
@@ -16,13 +13,13 @@ var promptNames;
|
|
|
16
13
|
promptNames["icon"] = "icon";
|
|
17
14
|
promptNames["additionalParameters"] = "additionalParameters";
|
|
18
15
|
promptNames["confirmReplace"] = "confirmReplace";
|
|
19
|
-
})(promptNames || (
|
|
20
|
-
var tilePromptNames;
|
|
16
|
+
})(promptNames || (promptNames = {}));
|
|
17
|
+
export var tilePromptNames;
|
|
21
18
|
(function (tilePromptNames) {
|
|
22
19
|
tilePromptNames["tileHandlingAction"] = "tileHandlingAction";
|
|
23
20
|
tilePromptNames["copyFromExisting"] = "copyFromExisting";
|
|
24
|
-
})(tilePromptNames || (
|
|
25
|
-
|
|
21
|
+
})(tilePromptNames || (tilePromptNames = {}));
|
|
22
|
+
export const tileActions = {
|
|
26
23
|
REPLACE: 'replace',
|
|
27
24
|
ADD: 'add'
|
|
28
25
|
};
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type DescriptorVariant, type NewInboundNavigation, type InternalInboundNavigation } from '@sap-ux/adp-tooling';
|
|
2
2
|
import type { ManifestNamespace, UI5FlexLayer } from '@sap-ux/project-access';
|
|
3
|
-
import { type FLPConfigPromptOptions, type FLPConfigAnswers, type TileSettingsAnswers } from './types';
|
|
3
|
+
import { type FLPConfigPromptOptions, type FLPConfigAnswers, type TileSettingsAnswers } from './types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Returns FLP configuration prompt options based on the provided inbounds, variant, and tile settings answers.
|
|
6
6
|
*
|
package/dist/utils.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getAdpFlpConfigPromptOptions = getAdpFlpConfigPromptOptions;
|
|
4
|
-
exports.getAdpFlpInboundsWriterConfig = getAdpFlpInboundsWriterConfig;
|
|
5
|
-
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
6
|
-
const types_1 = require("./types");
|
|
1
|
+
import { FlexLayer, flpConfigurationExists, NamespacePrefix } from '@sap-ux/adp-tooling';
|
|
2
|
+
import { tileActions } from './types.js';
|
|
7
3
|
/**
|
|
8
4
|
* Returns FLP configuration prompt options based on the provided inbounds, variant, and tile settings answers.
|
|
9
5
|
*
|
|
@@ -13,11 +9,11 @@ const types_1 = require("./types");
|
|
|
13
9
|
* @param {boolean} isCfProject - Indicates if the project is a Cloud Foundry project.
|
|
14
10
|
* @returns {FLPConfigPromptOptions} The FLP configuration prompt options.
|
|
15
11
|
*/
|
|
16
|
-
function getAdpFlpConfigPromptOptions(tileSettingsAnswers, inbounds, variant, isCfProject) {
|
|
12
|
+
export function getAdpFlpConfigPromptOptions(tileSettingsAnswers, inbounds, variant, isCfProject) {
|
|
17
13
|
const { tileHandlingAction, copyFromExisting } = tileSettingsAnswers ?? {};
|
|
18
14
|
// If the user chooses to add a new tile and copy the original, semantic object and action are required
|
|
19
|
-
if (!inbounds || (tileHandlingAction ===
|
|
20
|
-
const hideExistingFlpConfigInfo = variant ? !(!inbounds &&
|
|
15
|
+
if (!inbounds || (tileHandlingAction === tileActions.ADD && copyFromExisting === false)) {
|
|
16
|
+
const hideExistingFlpConfigInfo = variant ? !(!inbounds && flpConfigurationExists(variant)) : true;
|
|
21
17
|
return {
|
|
22
18
|
existingFlpConfigInfo: { hide: hideExistingFlpConfigInfo },
|
|
23
19
|
action: { executeDuplicateValidation: true },
|
|
@@ -27,7 +23,7 @@ function getAdpFlpConfigPromptOptions(tileSettingsAnswers, inbounds, variant, is
|
|
|
27
23
|
};
|
|
28
24
|
}
|
|
29
25
|
// If the user chooses to replace the original tile, are not required and are taken from the existing selected inbound
|
|
30
|
-
if (tileHandlingAction ===
|
|
26
|
+
if (tileHandlingAction === tileActions.REPLACE) {
|
|
31
27
|
return {
|
|
32
28
|
existingFlpConfigInfo: { hide: true },
|
|
33
29
|
overwrite: { hide: true },
|
|
@@ -64,8 +60,8 @@ function buildReplaceInboundConfig(layer, inbounds) {
|
|
|
64
60
|
return Object.entries(inbounds).map(([inboundKey, inboundData]) => {
|
|
65
61
|
const { semanticObject, action, signature: { parameters } = {} } = inboundData;
|
|
66
62
|
let inboundId = inboundKey;
|
|
67
|
-
if (inboundId && layer ===
|
|
68
|
-
inboundId = `${
|
|
63
|
+
if (inboundId && layer === FlexLayer.CUSTOMER_BASE) {
|
|
64
|
+
inboundId = `${NamespacePrefix.CUSTOMER}${inboundId}`;
|
|
69
65
|
}
|
|
70
66
|
return {
|
|
71
67
|
inboundId,
|
|
@@ -90,7 +86,7 @@ function buildAddInboundConfig(flpConfigAnswers, layer) {
|
|
|
90
86
|
? ''
|
|
91
87
|
: `${flpConfigAnswers.semanticObject}-${flpConfigAnswers.action}`;
|
|
92
88
|
if (inboundId) {
|
|
93
|
-
inboundId = layer ===
|
|
89
|
+
inboundId = layer === FlexLayer.CUSTOMER_BASE ? `${NamespacePrefix.CUSTOMER}${inboundId}` : inboundId;
|
|
94
90
|
}
|
|
95
91
|
return [
|
|
96
92
|
{
|
|
@@ -113,9 +109,9 @@ function buildAddInboundConfig(flpConfigAnswers, layer) {
|
|
|
113
109
|
* @param {ManifestNamespace.Inbound} inbounds - The inbound configuration.
|
|
114
110
|
* @returns {InternalInboundNavigation | NewInboundNavigation} The configuration for FLP inbounds writer.
|
|
115
111
|
*/
|
|
116
|
-
function getAdpFlpInboundsWriterConfig(flpConfigAnswers, layer, tileSettingsAnswers, inbounds) {
|
|
112
|
+
export function getAdpFlpInboundsWriterConfig(flpConfigAnswers, layer, tileSettingsAnswers, inbounds) {
|
|
117
113
|
const { tileHandlingAction } = tileSettingsAnswers ?? {};
|
|
118
|
-
if (tileHandlingAction ===
|
|
114
|
+
if (tileHandlingAction === tileActions.REPLACE) {
|
|
119
115
|
return buildReplaceInboundConfig(layer, inbounds);
|
|
120
116
|
}
|
|
121
117
|
return buildAddInboundConfig(flpConfigAnswers, layer);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/flp-config-inquirer",
|
|
3
3
|
"description": "Prompts module that can prompt users for inputs required for FLP configuration",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aflp-config-inquirer"
|
|
12
12
|
},
|
|
13
|
+
"type": "module",
|
|
13
14
|
"license": "Apache-2.0",
|
|
14
15
|
"main": "dist/index.js",
|
|
15
16
|
"files": [
|
|
@@ -21,15 +22,16 @@
|
|
|
21
22
|
"dependencies": {
|
|
22
23
|
"i18next": "25.10.10",
|
|
23
24
|
"lodash": "4.18.1",
|
|
24
|
-
"@sap-ux/inquirer-common": "0.
|
|
25
|
-
"@sap-ux/btp-utils": "
|
|
26
|
-
"@sap-ux/project-input-validator": "0.
|
|
27
|
-
"@sap-ux/fiori-generator-shared": "0.
|
|
28
|
-
"@sap-ux/project-access": "
|
|
29
|
-
"@sap-ux/axios-extension": "
|
|
30
|
-
"@sap-ux/adp-tooling": "0.
|
|
25
|
+
"@sap-ux/inquirer-common": "1.0.1",
|
|
26
|
+
"@sap-ux/btp-utils": "2.0.0",
|
|
27
|
+
"@sap-ux/project-input-validator": "1.0.1",
|
|
28
|
+
"@sap-ux/fiori-generator-shared": "1.0.1",
|
|
29
|
+
"@sap-ux/project-access": "2.0.1",
|
|
30
|
+
"@sap-ux/axios-extension": "2.0.0",
|
|
31
|
+
"@sap-ux/adp-tooling": "1.0.1"
|
|
31
32
|
},
|
|
32
33
|
"devDependencies": {
|
|
34
|
+
"@jest/globals": "30.3.0",
|
|
33
35
|
"@sap-devx/yeoman-ui-types": "1.25.0",
|
|
34
36
|
"@types/inquirer": "8.2.6",
|
|
35
37
|
"@types/lodash": "4.17.24",
|
|
@@ -44,8 +46,8 @@
|
|
|
44
46
|
"watch": "tsc --watch",
|
|
45
47
|
"lint": "eslint",
|
|
46
48
|
"lint:fix": "eslint --fix",
|
|
47
|
-
"test": "jest --ci --forceExit --detectOpenHandles --colors",
|
|
48
|
-
"test-u": "jest --ci --forceExit --detectOpenHandles --colors -u",
|
|
49
|
+
"test": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors",
|
|
50
|
+
"test-u": "cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors -u",
|
|
49
51
|
"link": "pnpm link --global",
|
|
50
52
|
"unlink": "pnpm unlink --global"
|
|
51
53
|
}
|