@sap-ux/preview-middleware 0.23.43 → 0.23.45
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 +1 -1
- package/dist/base/flp.js +3 -15
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -32,7 +32,7 @@ When this middleware is used together with the `reload-middleware`, then the ord
|
|
|
32
32
|
| `editors.rta` | `array` | optional | `undefined` | Configuration allowing to add mount points for runtime adaptation |
|
|
33
33
|
| `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) |
|
|
34
34
|
| `editors.rta.endpoints` | `array` | optional | `undefined` | List of mount points for editing |
|
|
35
|
-
| `editors.cardGenerator` | --- | optional | `undefined` | Configuration object
|
|
35
|
+
| `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. |
|
|
36
36
|
| `editors.cardGenerator.path` | `string` | optional | `test/flpGeneratorSandbox.html` | The mount point of the local SAP Fiori launchpad which will be considered for card generation. |
|
|
37
37
|
| `test` | `array` | optional | `undefined` | List of configurations for automated testing. |
|
|
38
38
|
| `debug` | `boolean` | optional | `false` | Enables the debug output |
|
package/dist/base/flp.js
CHANGED
|
@@ -301,7 +301,7 @@ class FlpSandbox {
|
|
|
301
301
|
*/
|
|
302
302
|
async editorGetHandler(req, res, rta, previewUrl, editor) {
|
|
303
303
|
if (!req.query['fiori-tools-rta-mode']) {
|
|
304
|
-
|
|
304
|
+
this.logger.debug(`Adjusting URL parameters for runtime adaptation mode. Redirecting to correct URL.`);
|
|
305
305
|
const url = 'ui5-patched-router' in req ? (0, node_path_1.join)(req['ui5-patched-router']?.baseUrl ?? '', previewUrl) : previewUrl;
|
|
306
306
|
const params = structuredClone(req.query);
|
|
307
307
|
params['sap-ui-xx-viewCache'] = 'false';
|
|
@@ -351,8 +351,8 @@ class FlpSandbox {
|
|
|
351
351
|
async flpGetHandler(req, res, next) {
|
|
352
352
|
// connect API (karma test runner) has no request query property
|
|
353
353
|
if ('query' in req && 'redirect' in res && !req.query['sap-ui-xx-viewCache']) {
|
|
354
|
+
this.logger.debug(`Adjusting URL parameters for preview. Redirecting to correct URL.`);
|
|
354
355
|
const url = 'ui5-patched-router' in req ? (0, node_path_1.join)(req['ui5-patched-router']?.baseUrl ?? '', req.path) : req.path;
|
|
355
|
-
// Redirect to the same URL but add the necessary parameter
|
|
356
356
|
const params = structuredClone(req.query);
|
|
357
357
|
params['sap-ui-xx-viewCache'] = 'false';
|
|
358
358
|
res.redirect(302, `${url}?${new URLSearchParams(params)}`);
|
|
@@ -401,13 +401,7 @@ class FlpSandbox {
|
|
|
401
401
|
const previewGeneratorPath = this.cardGenerator?.path ?? config_1.CARD_GENERATOR_DEFAULT.previewGeneratorSandbox;
|
|
402
402
|
this.logger.debug(`Add route for ${previewGeneratorPath}`);
|
|
403
403
|
this.router.get(previewGeneratorPath, async (req, res, next) => {
|
|
404
|
-
|
|
405
|
-
this.templateConfig.enableCardGenerator = !!this.cardGenerator?.path;
|
|
406
|
-
}
|
|
407
|
-
else {
|
|
408
|
-
this.logger.warn(`The Card Generator is not available for CAP projects.`);
|
|
409
|
-
this.templateConfig.enableCardGenerator = false;
|
|
410
|
-
}
|
|
404
|
+
this.templateConfig.enableCardGenerator = !!this.cardGenerator?.path;
|
|
411
405
|
await this.flpGetHandler(req, res, next);
|
|
412
406
|
});
|
|
413
407
|
}
|
|
@@ -829,9 +823,6 @@ class FlpSandbox {
|
|
|
829
823
|
* @returns {Promise<void>} A promise that resolves when the route is added.
|
|
830
824
|
*/
|
|
831
825
|
async addStoreCardManifestRoute() {
|
|
832
|
-
if (this.projectType !== 'EDMXBackend') {
|
|
833
|
-
return;
|
|
834
|
-
}
|
|
835
826
|
this.router.use(config_1.CARD_GENERATOR_DEFAULT.cardsStore, (0, express_1.json)());
|
|
836
827
|
this.logger.debug(`Add route for ${config_1.CARD_GENERATOR_DEFAULT.cardsStore}`);
|
|
837
828
|
this.router.post(config_1.CARD_GENERATOR_DEFAULT.cardsStore, async (req, res) => {
|
|
@@ -872,9 +863,6 @@ class FlpSandbox {
|
|
|
872
863
|
* @returns {Promise<void>} A promise that resolves when the route is added.
|
|
873
864
|
*/
|
|
874
865
|
async addStoreI18nKeysRoute() {
|
|
875
|
-
if (this.projectType !== 'EDMXBackend') {
|
|
876
|
-
return;
|
|
877
|
-
}
|
|
878
866
|
this.router.use(config_1.CARD_GENERATOR_DEFAULT.i18nStore, (0, express_1.json)());
|
|
879
867
|
this.logger.debug(`Add route for ${config_1.CARD_GENERATOR_DEFAULT.i18nStore}`);
|
|
880
868
|
this.router.post(config_1.CARD_GENERATOR_DEFAULT.i18nStore, async (req, res) => {
|
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.45",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"@sap/bas-sdk": "3.12.0",
|
|
30
30
|
"@sap-ux/adp-tooling": "0.17.5",
|
|
31
31
|
"@sap-ux/btp-utils": "1.1.4",
|
|
32
|
-
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.1",
|
|
33
32
|
"@sap-ux/feature-toggle": "0.3.3",
|
|
34
33
|
"@sap-ux/logger": "0.7.0",
|
|
35
34
|
"@sap-ux/project-access": "1.32.7",
|
|
36
35
|
"@sap-ux/system-access": "0.6.27",
|
|
36
|
+
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.7.1",
|
|
37
37
|
"@sap-ux/i18n": "0.3.4"
|
|
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.17.3",
|
|
57
|
-
"@sap-ux/axios-extension": "1.24.1",
|
|
58
56
|
"@sap-ux/store": "1.3.2",
|
|
59
|
-
"@
|
|
57
|
+
"@private/preview-middleware-client": "npm:@sap-ux-private/preview-middleware-client@0.17.3",
|
|
58
|
+
"@sap-ux/ui5-info": "0.13.0",
|
|
59
|
+
"@sap-ux/axios-extension": "1.24.1"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"express": "4"
|