@sap-ux/preview-middleware 0.16.161 → 0.16.163

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