@sap-ux/preview-middleware 0.20.0 → 0.20.2

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.
Files changed (96) hide show
  1. package/dist/client/adp/add-fragment.js +46 -46
  2. package/dist/client/adp/api-handler.js +159 -159
  3. package/dist/client/adp/command-executor.js +75 -75
  4. package/dist/client/adp/command-executor.ts +4 -4
  5. package/dist/client/adp/control-utils.js +44 -44
  6. package/dist/client/adp/controllers/AddFragment.controller.js +1 -1
  7. package/dist/client/adp/controllers/AddFragment.controller.ts +2 -2
  8. package/dist/client/adp/controllers/AddTableColumnFragments.controller.js +1 -1
  9. package/dist/client/adp/controllers/AddTableColumnFragments.controller.ts +2 -2
  10. package/dist/client/adp/controllers/BaseDialog.controller.js +2 -13
  11. package/dist/client/adp/controllers/BaseDialog.controller.ts +7 -25
  12. package/dist/client/adp/controllers/ControllerExtension.controller.js +268 -210
  13. package/dist/client/adp/controllers/ControllerExtension.controller.ts +110 -22
  14. package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
  15. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  16. package/dist/client/adp/dialog-factory.js +135 -135
  17. package/dist/client/adp/dialog-factory.ts +3 -1
  18. package/dist/client/adp/extend-controller.js +48 -0
  19. package/dist/client/adp/extend-controller.ts +49 -0
  20. package/dist/client/adp/init-dialogs.js +143 -163
  21. package/dist/client/adp/init-dialogs.ts +42 -20
  22. package/dist/client/adp/init.js +9 -1
  23. package/dist/client/adp/init.ts +6 -1
  24. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
  25. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +74 -60
  26. package/dist/client/adp/quick-actions/common/add-controller-to-page.ts +25 -3
  27. package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
  28. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
  29. package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
  30. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  31. package/dist/client/adp/quick-actions/control-types.js +23 -23
  32. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  33. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  34. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
  35. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
  36. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  37. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  38. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  39. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  40. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  41. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  42. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  43. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  44. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  45. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
  46. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  47. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  48. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
  49. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +75 -75
  50. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  51. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  52. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  53. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  54. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +84 -84
  55. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  56. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  57. package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -60
  58. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  59. package/dist/client/adp/quick-actions/load.js +44 -44
  60. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  61. package/dist/client/adp/ui/ControllerExtension.fragment.xml +14 -3
  62. package/dist/client/adp/utils.js +259 -218
  63. package/dist/client/adp/utils.ts +55 -7
  64. package/dist/client/cpe/additional-change-info/add-xml-additional-info.js +75 -75
  65. package/dist/client/cpe/changes/generic-change.js +326 -326
  66. package/dist/client/cpe/changes/index.js +10 -10
  67. package/dist/client/cpe/changes/validator.js +39 -39
  68. package/dist/client/cpe/connector-service.ts +1 -0
  69. package/dist/client/cpe/documentation.js +164 -164
  70. package/dist/client/cpe/feature-service.js +36 -36
  71. package/dist/client/cpe/logger.js +30 -30
  72. package/dist/client/cpe/outline/editable.js +37 -37
  73. package/dist/client/cpe/outline/nodes.js +203 -203
  74. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  75. package/dist/client/cpe/quick-actions/registry.js +143 -143
  76. package/dist/client/cpe/quick-actions/utils.js +92 -92
  77. package/dist/client/cpe/types.js +4 -4
  78. package/dist/client/cpe/ui5-utils.js +33 -33
  79. package/dist/client/cpe/utils.js +111 -111
  80. package/dist/client/flp/WorkspaceConnector.js +92 -92
  81. package/dist/client/flp/common.js +28 -28
  82. package/dist/client/flp/enableFakeConnector.js +89 -89
  83. package/dist/client/flp/homepage/Component.js +14 -14
  84. package/dist/client/flp/initCdm.js +117 -117
  85. package/dist/client/flp/initConnectors.js +28 -28
  86. package/dist/client/flp/initRta.js +178 -178
  87. package/dist/client/i18n.js +56 -56
  88. package/dist/client/messagebundle.properties +5 -0
  89. package/dist/client/utils/additional-change-info.js +54 -54
  90. package/dist/client/utils/application.js +32 -32
  91. package/dist/client/utils/core.js +84 -84
  92. package/dist/client/utils/error.js +19 -19
  93. package/dist/client/utils/fe-v2.js +56 -56
  94. package/dist/client/utils/fe-v4.js +140 -140
  95. package/dist/client/utils/version.js +104 -104
  96. package/package.json +4 -4
@@ -1,205 +1,205 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/base/Log", "../../utils/core", "../../utils/error", "../utils", "./editable", "../../utils/fe-v4"], function (Log, ____utils_core, ____utils_error, ___utils, ___editable, ____utils_fe_v4) {
4
- "use strict";
5
-
6
- const getControlById = ____utils_core["getControlById"];
7
- const getError = ____utils_error["getError"];
8
- const getOverlay = ___utils["getOverlay"];
9
- const isEditable = ___editable["isEditable"];
10
- const getConfigMapControlIdMap = ____utils_fe_v4["getConfigMapControlIdMap"];
11
- const getPageName = ____utils_fe_v4["getPageName"];
12
- /**
13
- * Retrieves additional data for a given control ID.
14
- *
15
- * @param id The unique identifier of the control.
16
- * @returns An object containing the text and the technical name of the control.
17
- */
18
- function getAdditionalData(id) {
19
- const control = getControlById(id);
20
- if (!control) {
21
- return {};
22
- }
23
- const metadata = control.getMetadata();
24
- let details = {};
25
- const technicalName = metadata.getElementName();
26
- if (technicalName) {
27
- details.technicalName = technicalName;
28
- }
29
- if (metadata.getProperty('text')) {
30
- const text = control.getProperty('text');
31
- if (typeof text === 'string' && text.trim() !== '') {
32
- details.text = text;
33
- }
34
- }
35
- return details;
36
- }
37
-
38
- /**
39
- * Gets the children nodes of an aggregation type node.
40
- *
41
- * @param current The current node to retrieve children from
42
- * @returns An array of children nodes, or an empty array if none are found
43
- */
44
- function getChildren(current) {
45
- return (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
46
- }
47
-
48
- /**
49
- * Adds a new child node to the extension point's children array based on the given control ID.
50
- *
51
- * @param {string} id - The unique identifier of the control to be added as a child node.
52
- * @param {OutlineNode[]} children - The array of children nodes to which the new node will be added.
53
- * @param {ChangeService} changeService - Change service for change stack event handling.
54
- */
55
- function addChildToExtensionPoint(id, children, changeService) {
56
- const {
57
- text,
58
- technicalName
59
- } = getAdditionalData(id);
60
- const editable = isEditable(changeService, id);
61
- children.push({
62
- controlId: id,
63
- controlType: technicalName ?? 'sap.ui.extensionpoint.child',
64
- name: text ?? id,
65
- visible: true,
66
- editable,
67
- children: [],
68
- hasDefaultContent: false
69
- });
70
- }
71
- /**
72
- * Creates control index for all controls in the app.
73
- *
74
- * @param {ControlTreeIndex} controlIndex - Control index for the ui5 app.
75
- * @param {OutlineNode} node - control node added to the outline.
76
- */
77
- function indexNode(controlIndex, node) {
78
- const indexedControls = controlIndex[node.controlType];
79
- if (indexedControls) {
80
- indexedControls.push(node);
81
- } else {
82
- controlIndex[node.controlType] = [node];
83
- }
84
- }
85
- function addToPropertyIdMap(node, propertyIdMap) {
86
- const control = getControlById(node.controlId);
87
- if (control) {
88
- const overlay = getOverlay(control);
89
- const overlayData = overlay?.getDesignTimeMetadata().getData();
90
- if (!overlayData?.manifestPropertyPath) {
91
- return;
92
- }
93
- if (overlayData) {
94
- const path = overlayData?.manifestPropertyPath?.(control);
95
- const pageName = getPageName(control);
96
- const key = getConfigMapControlIdMap(pageName, path.split('/').filter(item => item));
97
- if (key) {
98
- if (!propertyIdMap.get(key)) {
99
- propertyIdMap.set(key, []);
100
- }
101
- propertyIdMap.get(key)?.push(node.controlId);
102
- }
103
- }
104
- }
105
- }
106
-
107
- /**
108
- * Transform node.
109
- *
110
- * @param input outline view node
111
- * @param scenario type of project
112
- * @param controlIndex Control tree index
113
- * @param changeService ChangeService for change stack event handling.
114
- * @param propertyIdMap ChangeService for change stack event handling.
115
- * @returns transformed outline tree nodes
116
- */
117
- async function transformNodes(input, scenario, controlIndex, changeService, propertyIdMap) {
118
- const stack = [...input];
119
- const items = [];
120
- while (stack.length) {
121
- try {
122
- const current = stack.shift();
123
- const editable = isEditable(changeService, current?.id);
124
- const isAdp = scenario === 'ADAPTATION_PROJECT';
125
- const isExtPoint = current?.type === 'extensionPoint';
126
- if (current?.type === 'element') {
127
- const children = getChildren(current);
128
- const {
129
- text
130
- } = getAdditionalData(current.id);
131
- const technicalName = current.technicalName.split('.').slice(-1)[0];
132
- const transformedChildren = isAdp ? await handleDuplicateNodes(children, scenario, controlIndex, changeService, propertyIdMap) : await transformNodes(children, scenario, controlIndex, changeService, propertyIdMap);
133
- const node = {
134
- controlId: current.id,
135
- controlType: current.technicalName,
136
- name: text ?? technicalName,
137
- editable,
138
- visible: current.visible ?? true,
139
- children: transformedChildren
140
- };
141
- indexNode(controlIndex, node);
142
- addToPropertyIdMap(node, propertyIdMap);
143
- items.push(node);
144
- }
145
- if (isAdp && isExtPoint) {
146
- const {
147
- defaultContent = [],
148
- createdControls = []
149
- } = current.extensionPointInfo;
150
- let children = [];
151
- // We can combine both because there can only be either defaultContent or createdControls for one extension point node.
152
- [...defaultContent, ...createdControls].forEach(id => {
153
- addChildToExtensionPoint(id, children, changeService);
154
- });
155
- const node = {
156
- controlId: current.id,
157
- controlType: current.technicalName,
158
- name: current.name ?? '',
159
- editable,
160
- visible: current.visible ?? true,
161
- children,
162
- hasDefaultContent: defaultContent.length > 0
163
- };
164
- items.push(node);
165
- }
166
- } catch (error) {
167
- Log.error('Failed to transform outline node!', getError(error));
168
- }
169
- }
170
- return items;
171
- }
172
-
173
- /**
174
- * Handles duplicate nodes that are retrieved from extension point default content and created controls,
175
- * if they exist under an extension point these controls are removed from the children array
176
- *
177
- * @param children outline view node children
178
- * @param scenario type of project
179
- * @param controlIndex Control tree index
180
- * @param changeService ChangeService for change stack event handling.
181
- * @param propertyIdMap Map<string, string[]>.
182
- * @returns transformed outline tree nodes
183
- */
184
- async function handleDuplicateNodes(children, scenario, controlIndex, changeService, propertyIdMap) {
185
- const extPointIDs = new Set();
186
- children.forEach(child => {
187
- if (child.type === 'extensionPoint') {
188
- const {
189
- defaultContent = [],
190
- createdControls = []
191
- } = child.extensionPointInfo;
192
- [...defaultContent, ...createdControls].forEach(id => extPointIDs.add(id));
193
- }
194
- });
195
- const uniqueChildren = children.filter(child => !extPointIDs.has(child.id));
196
- return transformNodes(uniqueChildren, scenario, controlIndex, changeService, propertyIdMap);
197
- }
198
- var __exports = {
199
- __esModule: true
200
- };
201
- __exports.transformNodes = transformNodes;
202
- __exports.handleDuplicateNodes = handleDuplicateNodes;
203
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/base/Log", "../../utils/core", "../../utils/error", "../utils", "./editable", "../../utils/fe-v4"], function (Log, ____utils_core, ____utils_error, ___utils, ___editable, ____utils_fe_v4) {
4
+ "use strict";
5
+
6
+ const getControlById = ____utils_core["getControlById"];
7
+ const getError = ____utils_error["getError"];
8
+ const getOverlay = ___utils["getOverlay"];
9
+ const isEditable = ___editable["isEditable"];
10
+ const getConfigMapControlIdMap = ____utils_fe_v4["getConfigMapControlIdMap"];
11
+ const getPageName = ____utils_fe_v4["getPageName"];
12
+ /**
13
+ * Retrieves additional data for a given control ID.
14
+ *
15
+ * @param id The unique identifier of the control.
16
+ * @returns An object containing the text and the technical name of the control.
17
+ */
18
+ function getAdditionalData(id) {
19
+ const control = getControlById(id);
20
+ if (!control) {
21
+ return {};
22
+ }
23
+ const metadata = control.getMetadata();
24
+ let details = {};
25
+ const technicalName = metadata.getElementName();
26
+ if (technicalName) {
27
+ details.technicalName = technicalName;
28
+ }
29
+ if (metadata.getProperty('text')) {
30
+ const text = control.getProperty('text');
31
+ if (typeof text === 'string' && text.trim() !== '') {
32
+ details.text = text;
33
+ }
34
+ }
35
+ return details;
36
+ }
37
+
38
+ /**
39
+ * Gets the children nodes of an aggregation type node.
40
+ *
41
+ * @param current The current node to retrieve children from
42
+ * @returns An array of children nodes, or an empty array if none are found
43
+ */
44
+ function getChildren(current) {
45
+ return (current.elements ?? []).flatMap(element => element.type === 'aggregation' ? element.elements ?? [] : []);
46
+ }
47
+
48
+ /**
49
+ * Adds a new child node to the extension point's children array based on the given control ID.
50
+ *
51
+ * @param {string} id - The unique identifier of the control to be added as a child node.
52
+ * @param {OutlineNode[]} children - The array of children nodes to which the new node will be added.
53
+ * @param {ChangeService} changeService - Change service for change stack event handling.
54
+ */
55
+ function addChildToExtensionPoint(id, children, changeService) {
56
+ const {
57
+ text,
58
+ technicalName
59
+ } = getAdditionalData(id);
60
+ const editable = isEditable(changeService, id);
61
+ children.push({
62
+ controlId: id,
63
+ controlType: technicalName ?? 'sap.ui.extensionpoint.child',
64
+ name: text ?? id,
65
+ visible: true,
66
+ editable,
67
+ children: [],
68
+ hasDefaultContent: false
69
+ });
70
+ }
71
+ /**
72
+ * Creates control index for all controls in the app.
73
+ *
74
+ * @param {ControlTreeIndex} controlIndex - Control index for the ui5 app.
75
+ * @param {OutlineNode} node - control node added to the outline.
76
+ */
77
+ function indexNode(controlIndex, node) {
78
+ const indexedControls = controlIndex[node.controlType];
79
+ if (indexedControls) {
80
+ indexedControls.push(node);
81
+ } else {
82
+ controlIndex[node.controlType] = [node];
83
+ }
84
+ }
85
+ function addToPropertyIdMap(node, propertyIdMap) {
86
+ const control = getControlById(node.controlId);
87
+ if (control) {
88
+ const overlay = getOverlay(control);
89
+ const overlayData = overlay?.getDesignTimeMetadata().getData();
90
+ if (!overlayData?.manifestPropertyPath) {
91
+ return;
92
+ }
93
+ if (overlayData) {
94
+ const path = overlayData?.manifestPropertyPath?.(control);
95
+ const pageName = getPageName(control);
96
+ const key = getConfigMapControlIdMap(pageName, path.split('/').filter(item => item));
97
+ if (key) {
98
+ if (!propertyIdMap.get(key)) {
99
+ propertyIdMap.set(key, []);
100
+ }
101
+ propertyIdMap.get(key)?.push(node.controlId);
102
+ }
103
+ }
104
+ }
105
+ }
106
+
107
+ /**
108
+ * Transform node.
109
+ *
110
+ * @param input outline view node
111
+ * @param scenario type of project
112
+ * @param controlIndex Control tree index
113
+ * @param changeService ChangeService for change stack event handling.
114
+ * @param propertyIdMap ChangeService for change stack event handling.
115
+ * @returns transformed outline tree nodes
116
+ */
117
+ async function transformNodes(input, scenario, controlIndex, changeService, propertyIdMap) {
118
+ const stack = [...input];
119
+ const items = [];
120
+ while (stack.length) {
121
+ try {
122
+ const current = stack.shift();
123
+ const editable = isEditable(changeService, current?.id);
124
+ const isAdp = scenario === 'ADAPTATION_PROJECT';
125
+ const isExtPoint = current?.type === 'extensionPoint';
126
+ if (current?.type === 'element') {
127
+ const children = getChildren(current);
128
+ const {
129
+ text
130
+ } = getAdditionalData(current.id);
131
+ const technicalName = current.technicalName.split('.').slice(-1)[0];
132
+ const transformedChildren = isAdp ? await handleDuplicateNodes(children, scenario, controlIndex, changeService, propertyIdMap) : await transformNodes(children, scenario, controlIndex, changeService, propertyIdMap);
133
+ const node = {
134
+ controlId: current.id,
135
+ controlType: current.technicalName,
136
+ name: text ?? technicalName,
137
+ editable,
138
+ visible: current.visible ?? true,
139
+ children: transformedChildren
140
+ };
141
+ indexNode(controlIndex, node);
142
+ addToPropertyIdMap(node, propertyIdMap);
143
+ items.push(node);
144
+ }
145
+ if (isAdp && isExtPoint) {
146
+ const {
147
+ defaultContent = [],
148
+ createdControls = []
149
+ } = current.extensionPointInfo;
150
+ let children = [];
151
+ // We can combine both because there can only be either defaultContent or createdControls for one extension point node.
152
+ [...defaultContent, ...createdControls].forEach(id => {
153
+ addChildToExtensionPoint(id, children, changeService);
154
+ });
155
+ const node = {
156
+ controlId: current.id,
157
+ controlType: current.technicalName,
158
+ name: current.name ?? '',
159
+ editable,
160
+ visible: current.visible ?? true,
161
+ children,
162
+ hasDefaultContent: defaultContent.length > 0
163
+ };
164
+ items.push(node);
165
+ }
166
+ } catch (error) {
167
+ Log.error('Failed to transform outline node!', getError(error));
168
+ }
169
+ }
170
+ return items;
171
+ }
172
+
173
+ /**
174
+ * Handles duplicate nodes that are retrieved from extension point default content and created controls,
175
+ * if they exist under an extension point these controls are removed from the children array
176
+ *
177
+ * @param children outline view node children
178
+ * @param scenario type of project
179
+ * @param controlIndex Control tree index
180
+ * @param changeService ChangeService for change stack event handling.
181
+ * @param propertyIdMap Map<string, string[]>.
182
+ * @returns transformed outline tree nodes
183
+ */
184
+ async function handleDuplicateNodes(children, scenario, controlIndex, changeService, propertyIdMap) {
185
+ const extPointIDs = new Set();
186
+ children.forEach(child => {
187
+ if (child.type === 'extensionPoint') {
188
+ const {
189
+ defaultContent = [],
190
+ createdControls = []
191
+ } = child.extensionPointInfo;
192
+ [...defaultContent, ...createdControls].forEach(id => extPointIDs.add(id));
193
+ }
194
+ });
195
+ const uniqueChildren = children.filter(child => !extPointIDs.has(child.id));
196
+ return transformNodes(uniqueChildren, scenario, controlIndex, changeService, propertyIdMap);
197
+ }
198
+ var __exports = {
199
+ __esModule: true
200
+ };
201
+ __exports.transformNodes = transformNodes;
202
+ __exports.handleDuplicateNodes = handleDuplicateNodes;
203
+ return __exports;
204
204
  });
205
205
  //# sourceMappingURL=nodes.js.map
@@ -1,6 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
5
  });
6
6
  //# sourceMappingURL=quick-action-definition.js.map