@sap-ux/fe-fpm-writer 0.24.6 → 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.
|
@@ -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/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",
|