@sap-ux/fe-fpm-writer 0.24.4 → 0.24.6

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.
@@ -81,7 +81,7 @@ exports.generateRouteTarget = generateRouteTarget;
81
81
  */
82
82
  function getManifestJsonExtensionHelper(config) {
83
83
  return (key, value) => {
84
- var _a;
84
+ var _a, _b, _c;
85
85
  switch (key) {
86
86
  case 'routing':
87
87
  value.routes = (_a = value.routes) !== null && _a !== void 0 ? _a : [];
@@ -89,9 +89,9 @@ function getManifestJsonExtensionHelper(config) {
89
89
  case 'routes':
90
90
  const routes = value;
91
91
  routes.push({
92
- name: `${config.entity}${config.name}`,
92
+ name: (_b = config.id) !== null && _b !== void 0 ? _b : `${config.entity}${config.name}`,
93
93
  pattern: generateRoutePattern(routes, config.entity, config.navigation),
94
- target: generateRouteTarget(routes, `${config.entity}${config.name}`, config.fcl, config.navigation)
94
+ target: generateRouteTarget(routes, (_c = config.id) !== null && _c !== void 0 ? _c : `${config.entity}${config.name}`, config.fcl, config.navigation)
95
95
  });
96
96
  break;
97
97
  default:
@@ -34,6 +34,10 @@ export type ListReportSettings = StandardPageSettings & {
34
34
  * Common settings for any page supporting the Fiori elements flexible programming model.
35
35
  */
36
36
  export interface FpmPage {
37
+ /**
38
+ * Optional unique id parameter.
39
+ */
40
+ id?: string;
37
41
  /**
38
42
  * Name of the entity used for the custom page.
39
43
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/fe-fpm-writer",
3
3
  "description": "SAP Fiori elements flexible programming model writer",
4
- "version": "0.24.4",
4
+ "version": "0.24.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -33,7 +33,7 @@
33
33
  "@types/mem-fs": "1.1.2",
34
34
  "@types/mem-fs-editor": "7.0.1",
35
35
  "@types/semver": "7.5.2",
36
- "@sap-ux/project-access": "1.17.0"
36
+ "@sap-ux/project-access": "1.17.1"
37
37
  },
38
38
  "engines": {
39
39
  "pnpm": ">=6.26.1 < 7.0.0 || >=7.1.0",
@@ -2,7 +2,7 @@ import ControllerExtension from 'sap/ui/core/mvc/ControllerExtension';
2
2
  import ExtensionAPI from 'sap/fe/<%- typeof extension === "object" ? `templates/${extension.pageType}` : "core" -%>/ExtensionAPI';
3
3
 
4
4
  /**
5
- * @namespace <%- ns %>.<%- name %>
5
+ * @namespace <%- ns %>
6
6
  * @controller
7
7
  */
8
8
  export default class <%- name %> extends ControllerExtension<ExtensionAPI> {
@@ -1,7 +1,7 @@
1
1
  import Controller from 'sap/ui/core/mvc/Controller'; /** If UI5 version 1.94 or newer can be used, the change the base controller to sap/fe/core/PageController to get full FEv4 FPM support */
2
2
 
3
3
  /**
4
- * @namespace <%- ns %>.<%- name %>.controller
4
+ * @namespace <%- ns %>
5
5
  */
6
6
  export default class <%- name %> extends Controller {
7
7
 
@@ -2,7 +2,7 @@
2
2
  "sap.ui5": {
3
3
  "routing": {
4
4
  "targets": {
5
- "<%- entity %><%- name %>": {
5
+ "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %><%- name %><% } %>": {
6
6
  "viewId": "<%- name %>View",
7
7
  "viewName": "<%- ns %>.<%- name %>",<%if (locals.controlAggregation) {%>
8
8
  "controlAggregation": "<%- locals.controlAggregation %>",<% } %>
@@ -16,7 +16,7 @@
16
16
  "navigation": {
17
17
  "<%- navigation.navEntity %>": {
18
18
  "detail": {
19
- "route": "<%- entity %><%- name %>"
19
+ "route": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %><%- name %><% } %>"
20
20
  }
21
21
  }
22
22
  }
@@ -1,7 +1,7 @@
1
1
  import Controller from "sap/fe/core/PageController";
2
2
 
3
3
  /**
4
- * @namespace <%- ns %>.<%- name %>.controller
4
+ * @namespace <%- ns %>
5
5
  */
6
6
  export default class <%- name %> extends Controller {
7
7
 
@@ -2,9 +2,9 @@
2
2
  "sap.ui5": {
3
3
  "routing": {
4
4
  "targets": {
5
- "<%- entity %><%- name %>": {
5
+ "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %><%- name %><% } %>": {
6
6
  "type": "Component",
7
- "id": "<%- entity %><%- name %>",
7
+ "id": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %><%- name %><% } %>",
8
8
  "name": "sap.fe.core.fpm",<%if (locals.controlAggregation) {%>
9
9
  "controlAggregation": "<%- locals.controlAggregation %>",<% } %>
10
10
  "options": {
@@ -17,7 +17,7 @@
17
17
  "navigation": {
18
18
  "<%- navigation.navEntity %>": {
19
19
  "detail": {
20
- "route": "<%- entity %><%- name %>"
20
+ "route": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %><%- name %><% } %>"
21
21
  }
22
22
  }
23
23
  }
@@ -2,9 +2,9 @@
2
2
  "sap.ui5": {
3
3
  "routing": {
4
4
  "targets": {
5
- "<%- entity %>ListReport": {
5
+ "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ListReport<% } %>": {
6
6
  "type": "Component",
7
- "id": "<%- entity %>ListReport",
7
+ "id": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ListReport<% } %>",
8
8
  "name": "sap.fe.templates.ListReport",<%if (locals.controlAggregation) {%>
9
9
  "controlAggregation": "<%- locals.controlAggregation %>",<% } %>
10
10
  "options": {
@@ -2,9 +2,9 @@
2
2
  "sap.ui5": {
3
3
  "routing": {
4
4
  "targets": {
5
- "<%- entity %>ObjectPage": {
5
+ "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ObjectPage<% } %>": {
6
6
  "type": "Component",
7
- "id": "<%- entity %>ObjectPage",
7
+ "id": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ObjectPage<% } %>",
8
8
  "name": "sap.fe.templates.ObjectPage",<%if (locals.controlAggregation) {%>
9
9
  "controlAggregation": "<%- locals.controlAggregation %>",<% } %>
10
10
  "options": {
@@ -17,7 +17,7 @@
17
17
  "navigation": {
18
18
  "<%- navigation.navEntity %>": {
19
19
  "detail": {
20
- "route": "<%- entity %>ObjectPage"
20
+ "route": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ObjectPage<% } %>"
21
21
  }
22
22
  }
23
23
  }