@sap-ux/preview-middleware 1.0.21 → 1.0.23
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/README.md +24 -24
- package/dist/base/config.d.ts +2 -1
- package/dist/base/config.js +10 -4
- package/dist/base/flp.js +3 -3
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -15,30 +15,30 @@ When this middleware is used together with the `reload-middleware`, then the ord
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## [Configuration Options](#configuration-options)
|
|
18
|
-
| Option | Value Type | Requirement Type | Default Value | Description
|
|
19
|
-
|
|
20
|
-
| `flp` | --- | optional | --- | Configuration object for the local SAP Fiori launchpad
|
|
21
|
-
| `flp.path` | `string` | optional | `/test/flp.html` | The mount point of the local SAP Fiori launchpad. In case no file is found at the given path, a virtual endpoint will be instantiated.
|
|
22
|
-
| `flp.init` | `string` | optional | `undefined` | UI5 module/script to be executed after the standard initialization
|
|
23
|
-
| `flp.intent` | --- | optional | --- | Intent object to be used for the application
|
|
24
|
-
| `flp.intent.object` | `string` | optional | `app` | Name of the semantic object
|
|
25
|
-
| `flp.intent.action` | `string` | optional | `preview` | Name of the action
|
|
26
|
-
| `flp.apps` | `array` | optional | `undefined` | Additional local apps that are available in the local SAP Fiori launchpad
|
|
27
|
-
| `flp.libs` | `boolean` | optional | `false` | Flag to add a generic script fetching the paths of used libraries not available in UI5. To disable it, set it to `false`. If not set, then the project is checked for a `load-reuse-libs` script and, if available, the libraries are fetched as well
|
|
28
|
-
| `flp.theme` | `string` | optional | `(calculated)` | Name of the UI5 theme to be used (default is `sap_horizon` or the first entry in the sap.ui.supportedThemes list provided in the manifest.json file if `sap_horizon` is not contained in the list)
|
|
29
|
-
| `flp.enhancedHomePage` | `boolean` | optional | `false` | Flag for enabling enhanced FLP homepage, available only from UI5 version 1.123.0 onwards
|
|
30
|
-
| `adp.target` | --- | mandatory for adaptation projects | --- | Configuration object defining the connected back end
|
|
31
|
-
| `adp.ignoreCertErrors` | `boolean` | optional | `false` | Flag to ignore certification validation errors when working with development systems with self-signed certificates, for example
|
|
32
|
-
| `adp.cfBuildPath` | `string` | optional (experimental, CF only) | `undefined` | **Experimental**: For CF ADP projects only. Path to build output folder (e.g., `dist`) to serve built resources directly. When set, the middleware serves static files from this path and reads manifest.json from it.
|
|
33
|
-
| `rta` | --- | 🚫 deprecated</br> *use `editors.rta` instead* | --- | Configuration allowing to add mount points for runtime adaptation
|
|
34
|
-
| `editors` | `array` | optional | `undefined` | List of configurations allowing to add mount points for additional editors
|
|
35
|
-
| `editors.rta` | `array` | optional | `undefined` | Configuration allowing to add mount points for runtime adaptation
|
|
36
|
-
| `editors.rta.layer` | `string` | optional | `(calculated)` | Property for defining the runtime adaptation layer for changes (default is `CUSTOMER_BASE` or read from the project for adaptation projects)
|
|
37
|
-
| `editors.rta.endpoints` | `array` | optional | `undefined` | List of mount points for editing
|
|
38
|
-
| `editors.cardGenerator` | --- | optional | `undefined` | Configuration object that enables card generation for an application. The generated cards are only available when the application is deployed to an ABAP-based SAP Fiori launchpad, such as SAP Fiori launchpad in SAP S/4HANA Cloud Public Edition.
|
|
39
|
-
| `editors.cardGenerator.path` | `string` | optional | `test/flpGeneratorSandbox.html` | The mount point of the local SAP Fiori launchpad which will be considered for card generation.
|
|
40
|
-
| `test` | `array` | optional | `undefined` | List of configurations for automated testing.
|
|
41
|
-
| `debug` | `boolean` | optional | `false` | Enables the debug output
|
|
18
|
+
| Option | Value Type | Requirement Type | Default Value | Description |
|
|
19
|
+
|-------------------------|------------|------------------------------------------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
20
|
+
| `flp` | --- | optional | --- | Configuration object for the local SAP Fiori launchpad |
|
|
21
|
+
| `flp.path` | `string` | optional | `/test/flp.html` | The mount point of the local SAP Fiori launchpad. In case no file is found at the given path, a virtual endpoint will be instantiated. |
|
|
22
|
+
| `flp.init` | `string` | optional | `undefined` | UI5 module/script to be executed after the standard initialization |
|
|
23
|
+
| `flp.intent` | --- | optional | --- | Intent object to be used for the application |
|
|
24
|
+
| `flp.intent.object` | `string` | optional | `app` | Name of the semantic object |
|
|
25
|
+
| `flp.intent.action` | `string` | optional | `preview` | Name of the action |
|
|
26
|
+
| `flp.apps` | `array` | optional | `undefined` | Additional local apps that are available in the local SAP Fiori launchpad |
|
|
27
|
+
| `flp.libs` | `boolean` | optional | `false` | Flag to add a generic script fetching the paths of used libraries not available in UI5. To disable it, set it to `false`. If not set, then the project is checked for a `load-reuse-libs` script and, if available, the libraries are fetched as well |
|
|
28
|
+
| `flp.theme` | `string` | optional | `(calculated)` | Name of the UI5 theme to be used (default is `sap_horizon` or the first entry in the sap.ui.supportedThemes list provided in the manifest.json file if `sap_horizon` is not contained in the list) |
|
|
29
|
+
| `flp.enhancedHomePage` | `boolean` | optional | `false` | Flag for enabling enhanced FLP homepage, available only from UI5 version 1.123.0 onwards |
|
|
30
|
+
| `adp.target` | --- | mandatory for adaptation projects | --- | Configuration object defining the connected back end |
|
|
31
|
+
| `adp.ignoreCertErrors` | `boolean` | optional | `false` | Flag to ignore certification validation errors when working with development systems with self-signed certificates, for example |
|
|
32
|
+
| `adp.cfBuildPath` | `string` | optional (experimental, CF only) | `undefined` | **Experimental**: For CF ADP projects only. Path to build output folder (e.g., `dist`) to serve built resources directly. When set, the middleware serves static files from this path and reads manifest.json from it. |
|
|
33
|
+
| `rta` | --- | 🚫 deprecated</br> *use `editors.rta` instead* | --- | Configuration allowing to add mount points for runtime adaptation |
|
|
34
|
+
| `editors` | `array` | optional | `undefined` | List of configurations allowing to add mount points for additional editors |
|
|
35
|
+
| `editors.rta` | `array` | optional | `undefined` | Configuration allowing to add mount points for runtime adaptation |
|
|
36
|
+
| `editors.rta.layer` | `string` | optional | `(calculated)` | Property for defining the runtime adaptation layer for changes (default is `CUSTOMER_BASE` or read from the project for adaptation projects) |
|
|
37
|
+
| `editors.rta.endpoints` | `array` | optional | `undefined` | List of mount points for editing |
|
|
38
|
+
| `editors.cardGenerator` | --- | optional | `undefined` | Configuration object that enables card generation for an application. The generated cards are only available when the application is deployed to an ABAP-based SAP Fiori launchpad, such as SAP Fiori launchpad in SAP S/4HANA Cloud Public Edition. Available only from UI5 version 1.149.0 onwards for CAP node apps and from UI5 version 1.121.0 onwards for ABAP backends |
|
|
39
|
+
| `editors.cardGenerator.path` | `string` | optional | `test/flpGeneratorSandbox.html` | The mount point of the local SAP Fiori launchpad which will be considered for card generation. |
|
|
40
|
+
| `test` | `array` | optional | `undefined` | List of configurations for automated testing. |
|
|
41
|
+
| `debug` | `boolean` | optional | `false` | Enables the debug output |
|
|
42
42
|
|
|
43
43
|
### [`flp.apps`](#configuration-option-flpapps)
|
|
44
44
|
Array of additional application configurations:
|
package/dist/base/config.d.ts
CHANGED
|
@@ -157,9 +157,10 @@ export declare function remapResourcesForPath(config: TemplateConfig, newPagePat
|
|
|
157
157
|
* @param config FLP configuration
|
|
158
158
|
* @param manifest application manifest
|
|
159
159
|
* @param resources additional resources
|
|
160
|
+
* @param isAdp whether this is an adaptation project
|
|
160
161
|
* @returns configuration object for the sandbox.html template
|
|
161
162
|
*/
|
|
162
|
-
export declare function createFlpTemplateConfig(config: FlpConfig, manifest: Partial<Manifest>, resources?: Record<string, string
|
|
163
|
+
export declare function createFlpTemplateConfig(config: FlpConfig, manifest: Partial<Manifest>, resources?: Record<string, string>, isAdp?: boolean): TemplateConfig;
|
|
163
164
|
/**
|
|
164
165
|
* Creates the configuration object for the test template.
|
|
165
166
|
*
|
package/dist/base/config.js
CHANGED
|
@@ -164,12 +164,13 @@ export function sanitizeRtaConfig(deprecatedRtaConfig, logger) {
|
|
|
164
164
|
/**
|
|
165
165
|
* Retrieves the configuration settings for UI5 flexibility services.
|
|
166
166
|
*
|
|
167
|
+
* @param isAdp whether this is an adaptation project - LocalStorageConnector is omitted for ADP
|
|
167
168
|
* @returns An array of flexibility service configurations, each specifying a connector
|
|
168
169
|
* and its options, such as the layers it applies to and its service URL, if applicable.
|
|
169
170
|
*/
|
|
170
|
-
function getFlexSettings() {
|
|
171
|
+
function getFlexSettings(isAdp = false) {
|
|
171
172
|
const localConnectorPath = 'open/ux/preview/client/flp/WorkspaceConnector';
|
|
172
|
-
|
|
173
|
+
const connectors = [
|
|
173
174
|
{ connector: 'LrepConnector', layers: [], url: '/sap/bc/lrep' },
|
|
174
175
|
{
|
|
175
176
|
applyConnector: localConnectorPath,
|
|
@@ -177,6 +178,10 @@ function getFlexSettings() {
|
|
|
177
178
|
custom: true
|
|
178
179
|
}
|
|
179
180
|
];
|
|
181
|
+
if (!isAdp) {
|
|
182
|
+
connectors.push({ connector: 'LocalStorageConnector', layers: ['CUSTOMER', 'USER'] });
|
|
183
|
+
}
|
|
184
|
+
return connectors;
|
|
180
185
|
}
|
|
181
186
|
/**
|
|
182
187
|
* Add an application to the local FLP preview.
|
|
@@ -278,10 +283,11 @@ export function remapResourcesForPath(config, newPagePath, appId) {
|
|
|
278
283
|
* @param config FLP configuration
|
|
279
284
|
* @param manifest application manifest
|
|
280
285
|
* @param resources additional resources
|
|
286
|
+
* @param isAdp whether this is an adaptation project
|
|
281
287
|
* @returns configuration object for the sandbox.html template
|
|
282
288
|
*/
|
|
283
|
-
export function createFlpTemplateConfig(config, manifest, resources = {}) {
|
|
284
|
-
const flex = getFlexSettings();
|
|
289
|
+
export function createFlpTemplateConfig(config, manifest, resources = {}, isAdp = false) {
|
|
290
|
+
const flex = getFlexSettings(isAdp);
|
|
285
291
|
const supportedThemes = manifest['sap.ui5']?.supportedThemes ?? [DEFAULT_THEME];
|
|
286
292
|
const ui5Theme = config.theme ?? (supportedThemes.includes(DEFAULT_THEME) ? DEFAULT_THEME : supportedThemes[0]);
|
|
287
293
|
const id = manifest['sap.app']?.id ?? '';
|
package/dist/base/flp.js
CHANGED
|
@@ -80,7 +80,7 @@ export class FlpSandbox {
|
|
|
80
80
|
this.createFlexHandler();
|
|
81
81
|
this.flpConfig.libs ??= await this.hasLocateReuseLibsScript();
|
|
82
82
|
const id = manifest['sap.app']?.id ?? '';
|
|
83
|
-
this.templateConfig = createFlpTemplateConfig(this.flpConfig, manifest, resources);
|
|
83
|
+
this.templateConfig = createFlpTemplateConfig(this.flpConfig, manifest, resources, adp !== undefined);
|
|
84
84
|
this.adp = adp;
|
|
85
85
|
this.manifest = manifest;
|
|
86
86
|
await addApp(this.templateConfig, manifest, {
|
|
@@ -226,7 +226,7 @@ export class FlpSandbox {
|
|
|
226
226
|
* @returns Promise that resolves when the application dependencies are set
|
|
227
227
|
*/
|
|
228
228
|
async setApplicationDependencies() {
|
|
229
|
-
if (this.adp) {
|
|
229
|
+
if (this.adp && !this.adp.isCloudFoundry) {
|
|
230
230
|
await this.adp.sync();
|
|
231
231
|
const appName = getAppName(this.manifest, this.flpConfig.intent);
|
|
232
232
|
this.templateConfig.apps[appName].applicationDependencies = this.adp.descriptor;
|
|
@@ -954,7 +954,7 @@ export class FlpSandbox {
|
|
|
954
954
|
if ('cfBuildPath' in config) {
|
|
955
955
|
const manifest = this.setupCfBuildMode(config.cfBuildPath);
|
|
956
956
|
configureRta(this.rta, layer, variant.id, false, true);
|
|
957
|
-
await this.init(manifest, variant.reference);
|
|
957
|
+
await this.init(manifest, variant.reference, {}, adp);
|
|
958
958
|
await this.setupAdpCommonHandlers(adp);
|
|
959
959
|
return;
|
|
960
960
|
}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"bugs": {
|
|
11
11
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
|
|
12
12
|
},
|
|
13
|
-
"version": "1.0.
|
|
13
|
+
"version": "1.0.23",
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
15
|
"author": "@SAP/ux-tools-team",
|
|
16
16
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"mem-fs-editor": "9.4.0",
|
|
29
29
|
"qrcode": "1.5.4",
|
|
30
30
|
"@sap/bas-sdk": "3.13.7",
|
|
31
|
-
"@sap-ux/adp-tooling": "1.0.
|
|
31
|
+
"@sap-ux/adp-tooling": "1.0.16",
|
|
32
32
|
"@sap-ux/btp-utils": "2.0.2",
|
|
33
33
|
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@1.0.5",
|
|
34
34
|
"@sap-ux/feature-toggle": "1.0.2",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"nock": "14.0.11",
|
|
55
55
|
"npm-run-all2": "8.0.4",
|
|
56
56
|
"supertest": "7.2.2",
|
|
57
|
-
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@1.0.
|
|
57
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@1.0.23",
|
|
58
58
|
"@sap-ux-private/playwright": "1.0.2",
|
|
59
59
|
"@sap-ux/axios-extension": "2.0.3",
|
|
60
60
|
"@sap-ux/store": "2.0.1",
|