@sap-ux/generator-adp 0.9.26 → 0.9.27
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/questions/cf-services.js +4 -6
- package/generators/app/questions/helper/validators.d.ts +3 -2
- package/generators/app/questions/helper/validators.js +9 -5
- package/generators/app/questions/target-env.js +1 -1
- package/generators/translations/generator-adp.i18n.json +3 -0
- package/package.json +3 -3
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.CFServicesPrompter = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
4
|
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
9
5
|
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
10
6
|
const i18n_1 = require("../../utils/i18n");
|
|
@@ -170,8 +166,7 @@ class CFServicesPrompter {
|
|
|
170
166
|
choices: (0, choices_1.getAppRouterChoices)(this.isInternalUsage),
|
|
171
167
|
when: () => {
|
|
172
168
|
const modules = (0, adp_tooling_1.getModuleNames)(mtaProjectPath);
|
|
173
|
-
const
|
|
174
|
-
const hasRouter = (0, adp_tooling_1.hasApprouter)(mtaProjectName, modules);
|
|
169
|
+
const hasRouter = (0, adp_tooling_1.hasApprouter)(modules);
|
|
175
170
|
if (hasRouter) {
|
|
176
171
|
this.approuter = (0, adp_tooling_1.getApprouterType)(mtaProjectPath);
|
|
177
172
|
}
|
|
@@ -262,6 +257,9 @@ class CFServicesPrompter {
|
|
|
262
257
|
}
|
|
263
258
|
this.apps = await (0, adp_tooling_1.getCfApps)(this.businessServiceInfo.serviceKeys, cfConfig, this.logger);
|
|
264
259
|
this.logger?.log(`Available applications: ${JSON.stringify(this.apps)}`);
|
|
260
|
+
if (this.apps.length === 0) {
|
|
261
|
+
return (0, i18n_1.t)('error.noAppsFoundForBusinessService');
|
|
262
|
+
}
|
|
265
263
|
}
|
|
266
264
|
catch (e) {
|
|
267
265
|
this.apps = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ToolsLogger } from '@sap-ux/logger';
|
|
2
|
-
import {
|
|
2
|
+
import type { CfConfig, SystemLookup } from '@sap-ux/adp-tooling';
|
|
3
3
|
interface JsonInputParams {
|
|
4
4
|
projectName: string;
|
|
5
5
|
targetFolder: string;
|
|
@@ -46,9 +46,10 @@ export declare function validateJsonInput(systemLookup: SystemLookup, isCustomer
|
|
|
46
46
|
*
|
|
47
47
|
* @param {string} value - The value to validate.
|
|
48
48
|
* @param {boolean} isCFLoggedIn - Whether Cloud Foundry is logged in.
|
|
49
|
+
* @param {CfConfig} cfConfig - The CF configuration.
|
|
49
50
|
* @returns {Promise<string | boolean>} Returns true if the environment is valid, otherwise returns an error message.
|
|
50
51
|
*/
|
|
51
|
-
export declare function validateEnvironment(value: string, isCFLoggedIn: boolean): Promise<string | boolean>;
|
|
52
|
+
export declare function validateEnvironment(value: string, isCFLoggedIn: boolean, cfConfig?: CfConfig): Promise<string | boolean>;
|
|
52
53
|
/**
|
|
53
54
|
* Validates the project path.
|
|
54
55
|
*
|
|
@@ -68,12 +68,16 @@ async function validateJsonInput(systemLookup, isCustomerBase, { projectName, ta
|
|
|
68
68
|
*
|
|
69
69
|
* @param {string} value - The value to validate.
|
|
70
70
|
* @param {boolean} isCFLoggedIn - Whether Cloud Foundry is logged in.
|
|
71
|
+
* @param {CfConfig} cfConfig - The CF configuration.
|
|
71
72
|
* @returns {Promise<string | boolean>} Returns true if the environment is valid, otherwise returns an error message.
|
|
72
73
|
*/
|
|
73
|
-
async function validateEnvironment(value, isCFLoggedIn) {
|
|
74
|
+
async function validateEnvironment(value, isCFLoggedIn, cfConfig) {
|
|
74
75
|
if (value === 'CF' && !isCFLoggedIn) {
|
|
75
76
|
return (0, i18n_1.t)('error.cfNotLoggedIn');
|
|
76
77
|
}
|
|
78
|
+
if (value === 'CF' && isCFLoggedIn && (!cfConfig?.org?.Name || !cfConfig?.space?.Name)) {
|
|
79
|
+
return (0, i18n_1.t)('error.cfOrgSpaceMissing');
|
|
80
|
+
}
|
|
77
81
|
return true;
|
|
78
82
|
}
|
|
79
83
|
/**
|
|
@@ -117,10 +121,10 @@ function validateBusinessSolutionName(value) {
|
|
|
117
121
|
if (typeof validationResult === 'string') {
|
|
118
122
|
return validationResult;
|
|
119
123
|
}
|
|
120
|
-
|
|
121
|
-
.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
if (!/^[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+$/.test(value)) {
|
|
125
|
+
if (/\s/.test(value) || /[^a-zA-Z0-9.]/.test(value)) {
|
|
126
|
+
return (0, i18n_1.t)('error.businessSolutionNameInvalidChars');
|
|
127
|
+
}
|
|
124
128
|
return (0, i18n_1.t)('error.businessSolutionNameInvalid');
|
|
125
129
|
}
|
|
126
130
|
return true;
|
|
@@ -30,7 +30,7 @@ function getTargetEnvPrompt(appWizard, isCfInstalled, isCFLoggedIn, cfConfig) {
|
|
|
30
30
|
hint: (0, i18n_1.t)('prompts.targetEnvTooltip'),
|
|
31
31
|
breadcrumb: (0, i18n_1.t)('prompts.targetEnvBreadcrumb')
|
|
32
32
|
},
|
|
33
|
-
validate: (value) => (0, validators_1.validateEnvironment)(value, isCFLoggedIn),
|
|
33
|
+
validate: (value) => (0, validators_1.validateEnvironment)(value, isCFLoggedIn, cfConfig),
|
|
34
34
|
additionalMessages: (value) => (0, additional_messages_1.getTargetEnvAdditionalMessages)(value, isCFLoggedIn, cfConfig)
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -109,14 +109,17 @@
|
|
|
109
109
|
"pleaseProvideAllRequiredData": "Please provide the required data and try again.",
|
|
110
110
|
"cfNotInstalled": "Cloud Foundry is not installed in your space. Please install it to continue.",
|
|
111
111
|
"cfNotLoggedIn": "You are not logged in to Cloud Foundry. Please login to continue.",
|
|
112
|
+
"cfOrgSpaceMissing": "You are logged in to the Cloud Foundry API endpoint but no organization and space are targeted. Target an organization and space to continue.",
|
|
112
113
|
"baseAppHasToBeSelected": "Base application has to be selected. Please select a base application.",
|
|
113
114
|
"businessServiceHasToBeSelected": "Business service has to be selected. Please select a business service.",
|
|
114
115
|
"businessServiceDoesNotExist": "The service chosen does not exist in cockpit or the user is not member of the needed space.",
|
|
115
116
|
"businessSolutionNameInvalid": "Business solution name must consist of at least two segments and they should be separated by period.",
|
|
117
|
+
"businessSolutionNameInvalidChars": "Business solution name must only contain alphanumeric characters separated by periods. Spaces and special characters are not allowed.",
|
|
116
118
|
"cfLoginCannotBeDetected": "CF Login cannot be detected as an extension in Visual Studio Code. For more information, see (link not yet available).",
|
|
117
119
|
"projectDoesNotExist": "The project does not exist. Please select an MTA project.",
|
|
118
120
|
"projectDoesNotExistMta": "Provide the path to the MTA project where you want to have your Adaptation Project created.",
|
|
119
121
|
"noAdaptableBusinessServiceFoundInMta": "No adaptable business service found in the MTA.",
|
|
122
|
+
"noAppsFoundForBusinessService": "No applications were found for the selected business service. Please check the service configuration.",
|
|
120
123
|
"fetchBaseInboundsFailed": "Fetching base application inbounds failed: {{error}}.",
|
|
121
124
|
"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.",
|
|
122
125
|
"keyUserNoChangesAdaptation": "No key-user changes have been found for the '{{adaptationId}}' adaptation. Please select a different adaptation.",
|
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.9.
|
|
6
|
+
"version": "0.9.27",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
9
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"i18next": "25.8.12",
|
|
31
31
|
"yeoman-generator": "5.10.0",
|
|
32
32
|
"uuid": "11.1.0",
|
|
33
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
33
|
+
"@sap-ux/adp-tooling": "0.18.90",
|
|
34
34
|
"@sap-ux/axios-extension": "1.25.22",
|
|
35
35
|
"@sap-ux/btp-utils": "1.1.9",
|
|
36
36
|
"@sap-ux/feature-toggle": "0.3.7",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"fs-extra": "11.3.4",
|
|
58
58
|
"rimraf": "6.1.3",
|
|
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.109"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=20.x"
|