@sap-ux/preview-middleware 0.23.67 → 0.23.70
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/base/config.js +10 -6
- package/dist/base/flp.js +10 -24
- package/dist/client/adp/controllers/AddSubpage.controller.js +2 -3
- package/dist/client/adp/controllers/AddSubpage.controller.ts +2 -4
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +3 -4
- package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.ts +3 -5
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +1 -2
- package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.ts +1 -2
- package/dist/client/cpe/init.js +1 -1
- package/dist/client/cpe/init.ts +1 -1
- package/dist/client/cpe/quick-actions/quick-action-service.js +1 -1
- package/dist/client/cpe/quick-actions/quick-action-service.ts +1 -1
- package/dist/types/index.d.ts +3 -0
- package/package.json +9 -9
package/dist/base/config.js
CHANGED
|
@@ -209,8 +209,9 @@ async function addApp(templateConfig, manifest, app, logger) {
|
|
|
209
209
|
const appName = getAppName(manifest, app.intent);
|
|
210
210
|
templateConfig.ui5.resources[id] = app.target;
|
|
211
211
|
templateConfig.apps[appName] = {
|
|
212
|
-
title: (await getI18nTextFromProperty(app.local, manifest['sap.app']?.title, logger)) ??
|
|
213
|
-
|
|
212
|
+
title: (await getI18nTextFromProperty(app.local, manifest['sap.app']?.title, manifest['sap.app']?.id, logger)) ??
|
|
213
|
+
id,
|
|
214
|
+
description: (await getI18nTextFromProperty(app.local, manifest['sap.app']?.description, manifest['sap.app']?.id, logger)) ?? '',
|
|
214
215
|
additionalInformation: `SAPUI5.Component=${app.componentId ?? id}`,
|
|
215
216
|
applicationType: 'URL',
|
|
216
217
|
url: app.target
|
|
@@ -236,18 +237,21 @@ function getAppName(manifest, intent) {
|
|
|
236
237
|
*
|
|
237
238
|
* @param projectRoot absolute path to the project root
|
|
238
239
|
* @param propertyValue value of the property
|
|
240
|
+
* @param appId application id
|
|
239
241
|
* @param logger logger instance
|
|
240
242
|
* @returns i18n text of the property
|
|
241
243
|
*/
|
|
242
|
-
async function getI18nTextFromProperty(projectRoot, propertyValue, logger) {
|
|
244
|
+
async function getI18nTextFromProperty(projectRoot, propertyValue, appId, logger) {
|
|
243
245
|
const propertyI18nKey = (0, i18n_1.extractDoubleCurlyBracketsKey)(propertyValue ?? '');
|
|
244
246
|
if (!projectRoot || !propertyI18nKey) {
|
|
245
247
|
return propertyValue;
|
|
246
248
|
}
|
|
247
|
-
const
|
|
248
|
-
const applicationIds = projectAccess.getApplicationIds();
|
|
249
|
+
const absolutePath = (0, node_path_1.resolve)(process.cwd(), projectRoot);
|
|
249
250
|
try {
|
|
250
|
-
const
|
|
251
|
+
const projectAccess = await (0, project_access_1.createProjectAccess)(absolutePath);
|
|
252
|
+
const appPath = await projectAccess.getApplicationIdByManifestAppId(appId ?? '');
|
|
253
|
+
const applicationAccess = projectAccess.getApplication(appPath ?? '');
|
|
254
|
+
const bundle = (await applicationAccess.getI18nBundles())['sap.app'];
|
|
251
255
|
return bundle[propertyI18nKey]?.[0]?.value?.value ?? propertyI18nKey;
|
|
252
256
|
}
|
|
253
257
|
catch (e) {
|
package/dist/base/flp.js
CHANGED
|
@@ -105,7 +105,8 @@ class FlpSandbox {
|
|
|
105
105
|
* @param adp optional reference to the ADP tooling
|
|
106
106
|
*/
|
|
107
107
|
async init(manifest, componentId, resources = {}, adp) {
|
|
108
|
-
|
|
108
|
+
const projectRoot = await (0, project_access_1.findProjectRoot)(process.cwd(), false, true);
|
|
109
|
+
this.projectType = await (0, project_access_1.getProjectType)(projectRoot);
|
|
109
110
|
this.createFlexHandler();
|
|
110
111
|
this.flpConfig.libs ??= await this.hasLocateReuseLibsScript();
|
|
111
112
|
const id = manifest['sap.app']?.id ?? '';
|
|
@@ -156,22 +157,22 @@ class FlpSandbox {
|
|
|
156
157
|
return new Map([
|
|
157
158
|
// Run application in design time mode
|
|
158
159
|
// Adds bindingString to BindingInfo objects. Required to create and read PropertyBinding changes
|
|
159
|
-
['xx-designMode', 'true'],
|
|
160
|
+
['data-sap-ui-xx-designMode', 'true'],
|
|
160
161
|
// In design mode, the controller code will not be executed by default, which is not desired in our case, so we suppress the deactivation
|
|
161
|
-
['xx-suppressDeactivationOfControllerCode', 'true'],
|
|
162
|
+
['data-sap-ui-xx-suppressDeactivationOfControllerCode', 'true'],
|
|
162
163
|
// Make sure that XML preprocessing results are correctly invalidated
|
|
163
|
-
['xx-viewCache', 'false']
|
|
164
|
+
['data-sap-ui-xx-viewCache', 'false']
|
|
164
165
|
]);
|
|
165
166
|
}
|
|
166
167
|
else {
|
|
167
168
|
return new Map([
|
|
168
169
|
// Run application in design time mode
|
|
169
170
|
// Adds bindingString to BindingInfo objects. Required to create and read PropertyBinding changes
|
|
170
|
-
['xx-design-mode', 'true'],
|
|
171
|
+
['data-sap-ui-xx-design-mode', 'true'],
|
|
171
172
|
// In design mode, the controller code will not be executed by default, which is not desired in our case, so we suppress the deactivation
|
|
172
|
-
['xx-suppress-deactivation-of-controller-code', 'true'],
|
|
173
|
+
['data-sap-ui-xx-suppress-deactivation-of-controller-code', 'true'],
|
|
173
174
|
// Make sure that XML preprocessing results are correctly invalidated
|
|
174
|
-
['xx-view-cache', 'false']
|
|
175
|
+
['data-sap-ui-xx-view-cache', 'false']
|
|
175
176
|
]);
|
|
176
177
|
}
|
|
177
178
|
}
|
|
@@ -936,28 +937,13 @@ class FlpSandbox {
|
|
|
936
937
|
}
|
|
937
938
|
exports.FlpSandbox = FlpSandbox;
|
|
938
939
|
/**
|
|
939
|
-
* Creates an attribute string that can be added to an HTML
|
|
940
|
-
*
|
|
941
|
-
* @param attributes map with attributes and their values
|
|
942
|
-
* @param indent indentation that's inserted before each attribute
|
|
943
|
-
* @param prefix value that should be added at the start of to all attribute names
|
|
944
|
-
* @returns attribute string
|
|
945
|
-
*/
|
|
946
|
-
function serializeDataAttributes(attributes, indent = '', prefix = 'data') {
|
|
947
|
-
return [...attributes.entries()]
|
|
948
|
-
.map(([name, value]) => {
|
|
949
|
-
return `${indent}${prefix}-${name}="${value}"`;
|
|
950
|
-
})
|
|
951
|
-
.join('\n');
|
|
952
|
-
}
|
|
953
|
-
/**
|
|
954
|
-
* Creates an attribute string that can be added to bootstrap script in a HTML file.
|
|
940
|
+
* Creates an attribute string that can be added to the UI5 bootstrap script of an HTML file.
|
|
955
941
|
*
|
|
956
942
|
* @param config ui5 configuration options
|
|
957
943
|
* @returns attribute string
|
|
958
944
|
*/
|
|
959
945
|
function serializeUi5Configuration(config) {
|
|
960
|
-
return '\n' +
|
|
946
|
+
return '\n' + [...config.entries()].map(([name, value]) => ` ${name}="${value}"`).join('\n');
|
|
961
947
|
}
|
|
962
948
|
/**
|
|
963
949
|
* Configure RTA (Runtime Adaptation) for the FLP sandbox.
|
|
@@ -35,7 +35,7 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "../../i18n", "../command-executor
|
|
|
35
35
|
setup: async function _setup(dialog) {
|
|
36
36
|
this.dialog = dialog;
|
|
37
37
|
this.setEscapeHandler();
|
|
38
|
-
|
|
38
|
+
this.buildDialogData();
|
|
39
39
|
const resourceModel = await getResourceModel('open.ux.preview.client');
|
|
40
40
|
this.dialog.setModel(resourceModel, 'i18n');
|
|
41
41
|
this.dialog.setModel(this.model);
|
|
@@ -118,7 +118,7 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "../../i18n", "../command-executor
|
|
|
118
118
|
/**
|
|
119
119
|
* Builds data that is used in the dialog
|
|
120
120
|
*/
|
|
121
|
-
buildDialogData:
|
|
121
|
+
buildDialogData: function _buildDialogData() {
|
|
122
122
|
this.getControlMetadata(); // is called to fill this.runtimeControl
|
|
123
123
|
|
|
124
124
|
const pageTypeOptions = [{
|
|
@@ -139,7 +139,6 @@ sap.ui.define(["sap/ui/model/json/JSONModel", "../../i18n", "../command-executor
|
|
|
139
139
|
});
|
|
140
140
|
this.model.setProperty('/navigationOptions', navigationOptions);
|
|
141
141
|
this.model.setProperty('/selectedNavigation', navigationOptions[0]);
|
|
142
|
-
return Promise.resolve();
|
|
143
142
|
}
|
|
144
143
|
});
|
|
145
144
|
return AddSubpage;
|
|
@@ -94,7 +94,7 @@ export default class AddSubpage extends BaseDialog<AddSubpageModel> {
|
|
|
94
94
|
|
|
95
95
|
this.setEscapeHandler();
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
this.buildDialogData();
|
|
98
98
|
const resourceModel = await getResourceModel('open.ux.preview.client');
|
|
99
99
|
|
|
100
100
|
this.dialog.setModel(resourceModel, 'i18n');
|
|
@@ -196,7 +196,7 @@ export default class AddSubpage extends BaseDialog<AddSubpageModel> {
|
|
|
196
196
|
/**
|
|
197
197
|
* Builds data that is used in the dialog
|
|
198
198
|
*/
|
|
199
|
-
|
|
199
|
+
buildDialogData(): void {
|
|
200
200
|
this.getControlMetadata(); // is called to fill this.runtimeControl
|
|
201
201
|
|
|
202
202
|
const pageTypeOptions: { key: string; value: string }[] = [
|
|
@@ -215,7 +215,5 @@ export default class AddSubpage extends BaseDialog<AddSubpageModel> {
|
|
|
215
215
|
});
|
|
216
216
|
this.model.setProperty('/navigationOptions', navigationOptions);
|
|
217
217
|
this.model.setProperty('/selectedNavigation', navigationOptions[0]);
|
|
218
|
-
|
|
219
|
-
return Promise.resolve();
|
|
220
218
|
}
|
|
221
219
|
}
|
|
@@ -53,16 +53,16 @@ sap.ui.define(["sap/ui/core/Component", "sap/ui/dt/OverlayRegistry", "../../cpe/
|
|
|
53
53
|
this.pageType = this.context.view.getViewName().split('.view.')[0];
|
|
54
54
|
const metaModel = this.getODataMetaModel();
|
|
55
55
|
if (!metaModel || !control) {
|
|
56
|
-
return
|
|
56
|
+
return;
|
|
57
57
|
}
|
|
58
58
|
const modifiedControl = getControlById(control.controlId);
|
|
59
59
|
if (!modifiedControl) {
|
|
60
|
-
return
|
|
60
|
+
return;
|
|
61
61
|
}
|
|
62
62
|
const component = Component.getOwnerComponentFor(modifiedControl);
|
|
63
63
|
const entitySetName = await this.getEntitySetNameFromPageComponent(component, metaModel);
|
|
64
64
|
if (!entitySetName) {
|
|
65
|
-
return
|
|
65
|
+
return;
|
|
66
66
|
}
|
|
67
67
|
this.entitySet = entitySetName;
|
|
68
68
|
this.navProperties = [];
|
|
@@ -72,7 +72,6 @@ sap.ui.define(["sap/ui/core/Component", "sap/ui/dt/OverlayRegistry", "../../cpe/
|
|
|
72
72
|
await this.prepareNavigationData(metaModel);
|
|
73
73
|
}
|
|
74
74
|
this.control = modifiedControl;
|
|
75
|
-
return Promise.resolve();
|
|
76
75
|
}
|
|
77
76
|
async execute() {
|
|
78
77
|
const overlay = OverlayRegistry.getOverlay(this.control);
|
|
@@ -95,18 +95,18 @@ export abstract class AddNewSubpageBase<ODataMetaModelType>
|
|
|
95
95
|
|
|
96
96
|
const metaModel = this.getODataMetaModel();
|
|
97
97
|
if (!metaModel || !control) {
|
|
98
|
-
return
|
|
98
|
+
return;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
const modifiedControl = getControlById<ObjectPageLayout>(control.controlId);
|
|
102
102
|
if (!modifiedControl) {
|
|
103
|
-
return
|
|
103
|
+
return;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
const component = Component.getOwnerComponentFor(modifiedControl);
|
|
107
107
|
const entitySetName = await this.getEntitySetNameFromPageComponent(component, metaModel);
|
|
108
108
|
if (!entitySetName) {
|
|
109
|
-
return
|
|
109
|
+
return;
|
|
110
110
|
}
|
|
111
111
|
this.entitySet = entitySetName;
|
|
112
112
|
|
|
@@ -117,8 +117,6 @@ export abstract class AddNewSubpageBase<ODataMetaModelType>
|
|
|
117
117
|
await this.prepareNavigationData(metaModel);
|
|
118
118
|
}
|
|
119
119
|
this.control = modifiedControl;
|
|
120
|
-
|
|
121
|
-
return Promise.resolve();
|
|
122
120
|
}
|
|
123
121
|
|
|
124
122
|
async execute(): Promise<FlexCommand[]> {
|
|
@@ -64,11 +64,10 @@ sap.ui.define(["../../../utils/fe-v2", "../add-new-subpage-quick-action-base", "
|
|
|
64
64
|
const targetEntitySet = entityContainer.entitySet.find(item => item.entityType === associationEnd.type);
|
|
65
65
|
await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet?.name, navProp.name);
|
|
66
66
|
}
|
|
67
|
-
return Promise.resolve();
|
|
68
67
|
}
|
|
69
68
|
async initialize() {
|
|
70
69
|
if (!(await areManifestChangesSupported(this.context.manifest))) {
|
|
71
|
-
return
|
|
70
|
+
return;
|
|
72
71
|
}
|
|
73
72
|
this.appComponent = getV2AppComponent(this.context.view);
|
|
74
73
|
return super.initialize();
|
|
@@ -75,12 +75,11 @@ export class AddNewSubpage extends AddNewSubpageBase<ODataMetaModelV2> {
|
|
|
75
75
|
const targetEntitySet = entityContainer.entitySet.find((item) => item.entityType === associationEnd.type);
|
|
76
76
|
await this.addNavigationOptionIfAvailable(metaModel, targetEntitySet?.name, navProp.name);
|
|
77
77
|
}
|
|
78
|
-
return Promise.resolve();
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
async initialize(): Promise<void> {
|
|
82
81
|
if (!(await areManifestChangesSupported(this.context.manifest))) {
|
|
83
|
-
return
|
|
82
|
+
return;
|
|
84
83
|
}
|
|
85
84
|
this.appComponent = getV2AppComponent(this.context.view);
|
|
86
85
|
return super.initialize();
|
package/dist/client/cpe/init.js
CHANGED
|
@@ -73,7 +73,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
73
73
|
return service.init(CommunicationService.sendAction, subscribe)?.catch(error => {
|
|
74
74
|
Log.error('Service Initialization Failed: ', getError(error));
|
|
75
75
|
});
|
|
76
|
-
});
|
|
76
|
+
}).filter(p => p !== undefined);
|
|
77
77
|
Promise.all(allPromises).then(() => {
|
|
78
78
|
CommunicationService.sendAction(appLoaded());
|
|
79
79
|
})
|
package/dist/client/cpe/init.ts
CHANGED
|
@@ -95,7 +95,7 @@ export default function init(
|
|
|
95
95
|
return service.init(CommunicationService.sendAction, subscribe)?.catch((error) => {
|
|
96
96
|
Log.error('Service Initialization Failed: ', getError(error));
|
|
97
97
|
});
|
|
98
|
-
});
|
|
98
|
+
}).filter((p): p is Promise<void> => p !== undefined);
|
|
99
99
|
Promise.all(allPromises)
|
|
100
100
|
.then(() => {
|
|
101
101
|
CommunicationService.sendAction(appLoaded());
|
|
@@ -148,7 +148,7 @@ sap.ui.define(["sap/base/Log", "open/ux/preview/client/thirdparty/@sap-ux-privat
|
|
|
148
148
|
if (payload.kind === NESTED_QUICK_ACTION_KIND && actionInstance.kind === NESTED_QUICK_ACTION_KIND) {
|
|
149
149
|
return actionInstance.execute(payload.path);
|
|
150
150
|
}
|
|
151
|
-
return
|
|
151
|
+
return [];
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
var __exports = {
|
|
@@ -172,6 +172,6 @@ export class QuickActionService implements Service {
|
|
|
172
172
|
if (payload.kind === NESTED_QUICK_ACTION_KIND && actionInstance.kind === NESTED_QUICK_ACTION_KIND) {
|
|
173
173
|
return actionInstance.execute(payload.path);
|
|
174
174
|
}
|
|
175
|
-
return
|
|
175
|
+
return [];
|
|
176
176
|
}
|
|
177
177
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ export interface Intent {
|
|
|
12
12
|
*/
|
|
13
13
|
export interface App {
|
|
14
14
|
target: string;
|
|
15
|
+
/**
|
|
16
|
+
* Either a local path to a folder containing the application or the componentId of a remote app
|
|
17
|
+
*/
|
|
15
18
|
local?: string;
|
|
16
19
|
/**
|
|
17
20
|
* Optional component id if it differs from the manifest (e.g. for adaptation projects)
|
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%3Apreview-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.23.
|
|
12
|
+
"version": "0.23.70",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"qrcode": "1.5.4",
|
|
29
29
|
"@sap/bas-sdk": "3.12.0",
|
|
30
|
-
"@sap-ux/adp-tooling": "0.18.
|
|
30
|
+
"@sap-ux/adp-tooling": "0.18.18",
|
|
31
31
|
"@sap-ux/btp-utils": "1.1.5",
|
|
32
|
-
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.
|
|
32
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.3",
|
|
33
33
|
"@sap-ux/feature-toggle": "0.3.4",
|
|
34
34
|
"@sap-ux/logger": "0.7.1",
|
|
35
|
-
"@sap-ux/project-access": "1.32.
|
|
36
|
-
"@sap-ux/system-access": "0.6.
|
|
35
|
+
"@sap-ux/project-access": "1.32.14",
|
|
36
|
+
"@sap-ux/system-access": "0.6.31",
|
|
37
37
|
"@sap-ux/i18n": "0.3.5"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"nock": "13.4.0",
|
|
54
54
|
"npm-run-all2": "6.2.0",
|
|
55
55
|
"supertest": "7.1.4",
|
|
56
|
-
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.
|
|
57
|
-
"@sap-ux/axios-extension": "1.24.
|
|
58
|
-
"@sap-ux/
|
|
59
|
-
"@sap-ux/
|
|
56
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.18.4",
|
|
57
|
+
"@sap-ux/axios-extension": "1.24.5",
|
|
58
|
+
"@sap-ux/store": "1.3.4",
|
|
59
|
+
"@sap-ux/ui5-info": "0.13.3"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"express": "4"
|