@sap-ux/adp-tooling 0.18.101 → 0.18.102
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.
|
@@ -37,7 +37,7 @@ class ManifestServiceCF {
|
|
|
37
37
|
static async init(projectPath, logger) {
|
|
38
38
|
const service = new ManifestServiceCF(logger);
|
|
39
39
|
logger.debug('Triggering project build to generate dist folder');
|
|
40
|
-
await (0, project_builder_1.runBuild)(projectPath
|
|
40
|
+
await (0, project_builder_1.runBuild)(projectPath);
|
|
41
41
|
const manifestPath = (0, node_path_1.join)(projectPath, CF_BUILD_PATH, 'manifest.json');
|
|
42
42
|
logger.debug(`Reading manifest from '${manifestPath}'`);
|
|
43
43
|
const manifestContent = (0, node_fs_1.readFileSync)(manifestPath, 'utf-8');
|
|
@@ -4,6 +4,23 @@ exports.getPrompts = getPrompts;
|
|
|
4
4
|
const i18n_1 = require("../../i18n");
|
|
5
5
|
const project_access_1 = require("@sap-ux/project-access");
|
|
6
6
|
const project_input_validator_1 = require("@sap-ux/project-input-validator");
|
|
7
|
+
/**
|
|
8
|
+
* Checks if the selected service has server-side annotations.
|
|
9
|
+
* A server-side annotation is detected when:
|
|
10
|
+
* 1. The service has annotations referenced in its settings
|
|
11
|
+
* 2. The referenced annotation data source has a URI starting with '/'
|
|
12
|
+
*
|
|
13
|
+
* @param {Record<string, ManifestNamespace.DataSource>} dataSources - All data sources from the manifest.
|
|
14
|
+
* @param {string} serviceId - The selected service ID.
|
|
15
|
+
* @returns {boolean} True if server-side annotations are detected for the selected service.
|
|
16
|
+
*/
|
|
17
|
+
function hasServerSideAnnotations(dataSources, serviceId) {
|
|
18
|
+
const annotationId = dataSources[serviceId]?.settings?.annotations?.[0];
|
|
19
|
+
if (!annotationId) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return !!dataSources[annotationId]?.uri?.startsWith('/');
|
|
23
|
+
}
|
|
7
24
|
/**
|
|
8
25
|
* Validates the OData Source URI prompt.
|
|
9
26
|
*
|
|
@@ -85,7 +102,8 @@ function getPrompts(dataSources) {
|
|
|
85
102
|
guiOptions: {
|
|
86
103
|
hint: (0, i18n_1.t)('prompts.oDataAnnotationSourceURITooltip')
|
|
87
104
|
},
|
|
88
|
-
validate: validatePromptAnnotationURI
|
|
105
|
+
validate: validatePromptAnnotationURI,
|
|
106
|
+
when: (answers) => hasServerSideAnnotations(dataSources, answers.id)
|
|
89
107
|
}
|
|
90
108
|
];
|
|
91
109
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Aadp-tooling"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.18.
|
|
12
|
+
"version": "0.18.102",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|