@sap-ux/fe-fpm-writer 0.24.5 → 0.24.7
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/common/event-handler.js +4 -1
- package/dist/common/types.d.ts +4 -0
- package/dist/page/common.js +3 -3
- package/dist/page/types.d.ts +4 -0
- package/package.json +2 -2
- package/templates/page/custom/1.84/manifest.json +2 -2
- package/templates/page/custom/1.94/manifest.json +3 -3
- package/templates/page/list/manifest.json +2 -2
- package/templates/page/object/manifest.json +3 -3
|
@@ -40,6 +40,7 @@ function applyEventHandlerConfiguration(fs, config, eventHandler, eventHandlerOp
|
|
|
40
40
|
return eventHandler;
|
|
41
41
|
}
|
|
42
42
|
let insertScript;
|
|
43
|
+
let controllerPrefix = '';
|
|
43
44
|
// By default - use config name for created file name
|
|
44
45
|
let fileName = config.name;
|
|
45
46
|
if (typeof eventHandler === 'object') {
|
|
@@ -51,6 +52,7 @@ function applyEventHandlerConfiguration(fs, config, eventHandler, eventHandlerOp
|
|
|
51
52
|
// Use passed file name
|
|
52
53
|
fileName = eventHandler.fileName;
|
|
53
54
|
}
|
|
55
|
+
controllerPrefix = eventHandler.controllerPrefix;
|
|
54
56
|
}
|
|
55
57
|
const ext = typescript ? 'ts' : 'js';
|
|
56
58
|
const controllerPath = (0, path_1.join)(config.path || '', `${fileName}${controllerSuffix ? '.controller' : ''}.${ext}`);
|
|
@@ -71,7 +73,8 @@ function applyEventHandlerConfiguration(fs, config, eventHandler, eventHandlerOp
|
|
|
71
73
|
fs.write(controllerPath, content);
|
|
72
74
|
}
|
|
73
75
|
// Return full namespace path to method
|
|
74
|
-
|
|
76
|
+
const fullNamespace = `${config.ns}.${fileName}.${eventHandlerFnName}`;
|
|
77
|
+
return controllerPrefix ? `${controllerPrefix}.${fullNamespace}` : `${fullNamespace}`;
|
|
75
78
|
}
|
|
76
79
|
exports.applyEventHandlerConfiguration = applyEventHandlerConfiguration;
|
|
77
80
|
//# sourceMappingURL=event-handler.js.map
|
package/dist/common/types.d.ts
CHANGED
|
@@ -142,6 +142,10 @@ export interface EventHandlerConfiguration {
|
|
|
142
142
|
* If file exists, then existing file should be appended with passed script fragment.
|
|
143
143
|
*/
|
|
144
144
|
insertScript?: TextFragmentInsertion;
|
|
145
|
+
/**
|
|
146
|
+
* Controller extension prefix.
|
|
147
|
+
*/
|
|
148
|
+
controllerPrefix?: '.extension';
|
|
145
149
|
}
|
|
146
150
|
export interface EventHandler {
|
|
147
151
|
/**
|
package/dist/page/common.js
CHANGED
|
@@ -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:
|
package/dist/page/types.d.ts
CHANGED
|
@@ -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
|
+
"version": "0.24.7",
|
|
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.
|
|
36
|
+
"@sap-ux/project-access": "1.17.2"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"pnpm": ">=6.26.1 < 7.0.0 || >=7.1.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"sap.ui5": {
|
|
3
3
|
"routing": {
|
|
4
4
|
"targets": {
|
|
5
|
-
"
|
|
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": "
|
|
19
|
+
"route": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %><%- name %><% } %>"
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"sap.ui5": {
|
|
3
3
|
"routing": {
|
|
4
4
|
"targets": {
|
|
5
|
-
"
|
|
5
|
+
"<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %><%- name %><% } %>": {
|
|
6
6
|
"type": "Component",
|
|
7
|
-
"id": "
|
|
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": "
|
|
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
|
-
"
|
|
5
|
+
"<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ListReport<% } %>": {
|
|
6
6
|
"type": "Component",
|
|
7
|
-
"id": "
|
|
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
|
-
"
|
|
5
|
+
"<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ObjectPage<% } %>": {
|
|
6
6
|
"type": "Component",
|
|
7
|
-
"id": "
|
|
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": "
|
|
20
|
+
"route": "<% if (typeof id !== 'undefined') { %><%- id %><% } else { %><%- entity %>ObjectPage<% } %>"
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|