@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,46 +1,46 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- /**
7
- * Handles calling control specific functions for retrieving control data
8
- */
9
- class ControlUtils {
10
- /**
11
- * Returns ManagedObject runtime control
12
- *
13
- * @param overlayControl Overlay
14
- * @returns {ManagedObject} Managed Object instance
15
- */
16
- static getRuntimeControl(overlayControl) {
17
- let runtimeControl;
18
- if (overlayControl.getElementInstance) {
19
- runtimeControl = overlayControl.getElementInstance();
20
- } else {
21
- runtimeControl = overlayControl.getElement();
22
- }
23
- return runtimeControl;
24
- }
25
-
26
- /**
27
- * Returns control aggregation names in an array
28
- *
29
- * @param control Managed Object runtime control
30
- * @param name Aggregation name
31
- * @returns Array of control aggregations
32
- */
33
- static getControlAggregationByName(control, name) {
34
- let result = [];
35
- const aggregation = (control ? control.getMetadata().getAllAggregations() : {})[name];
36
- if (aggregation) {
37
- // This executes a _sGetter function that can vary from control to control (_sGetter can be: getContent, getItems, etc)
38
- const names = aggregation._sGetter && control[aggregation._sGetter]() || [];
39
- result = Array.isArray(names) ? names : [names];
40
- }
41
- return result;
42
- }
43
- }
44
- return ControlUtils;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ /**
7
+ * Handles calling control specific functions for retrieving control data
8
+ */
9
+ class ControlUtils {
10
+ /**
11
+ * Returns ManagedObject runtime control
12
+ *
13
+ * @param overlayControl Overlay
14
+ * @returns {ManagedObject} Managed Object instance
15
+ */
16
+ static getRuntimeControl(overlayControl) {
17
+ let runtimeControl;
18
+ if (overlayControl.getElementInstance) {
19
+ runtimeControl = overlayControl.getElementInstance();
20
+ } else {
21
+ runtimeControl = overlayControl.getElement();
22
+ }
23
+ return runtimeControl;
24
+ }
25
+
26
+ /**
27
+ * Returns control aggregation names in an array
28
+ *
29
+ * @param control Managed Object runtime control
30
+ * @param name Aggregation name
31
+ * @returns Array of control aggregations
32
+ */
33
+ static getControlAggregationByName(control, name) {
34
+ let result = [];
35
+ const aggregation = (control ? control.getMetadata().getAllAggregations() : {})[name];
36
+ if (aggregation) {
37
+ // This executes a _sGetter function that can vary from control to control (_sGetter can be: getContent, getItems, etc)
38
+ const names = aggregation._sGetter && control[aggregation._sGetter]() || [];
39
+ result = Array.isArray(names) ? names : [names];
40
+ }
41
+ return result;
42
+ }
43
+ }
44
+ return ControlUtils;
45
45
  });
46
46
  //# sourceMappingURL=control-utils.js.map
@@ -143,7 +143,7 @@ sap.ui.define([
143
143
  const flexSettings = this.rta.getFlexSettings();
144
144
  const overlay = OverlayRegistry.getOverlay(this.runtimeControl);
145
145
  const designMetadata = overlay.getDesignTimeMetadata();
146
- const command = await this.commandExecutor.getCommand(this.runtimeControl, 'addXML', modifiedValue, designMetadata, flexSettings);
146
+ const command = await this.commandExecutor.getCommand(this.runtimeControl, 'addXML', modifiedValue, flexSettings, designMetadata);
147
147
  await this.commandExecutor.pushAndExecuteCommand(command);
148
148
  }
149
149
  });
@@ -243,8 +243,8 @@ export default class AddFragment extends BaseDialog<AddFragmentModel> {
243
243
  this.runtimeControl,
244
244
  'addXML',
245
245
  modifiedValue,
246
- designMetadata,
247
- flexSettings
246
+ flexSettings,
247
+ designMetadata
248
248
  );
249
249
 
250
250
  await this.commandExecutor.pushAndExecuteCommand(command);
@@ -160,7 +160,7 @@ sap.ui.define([
160
160
  targetAggregation: fragment.targetAggregation === ITEMS_AGGREGATION ? CELLS_AGGREGATION : fragment.targetAggregation
161
161
  };
162
162
  const targetObject = fragment.targetAggregation === COLUMNS_AGGREGATION ? this.runtimeControl : this.runtimeControl.getAggregation(ITEMS_AGGREGATION)[0];
163
- const command = await this.commandExecutor.getCommand(targetObject, 'addXML', modifiedValue, designMetadata, flexSettings);
163
+ const command = await this.commandExecutor.getCommand(targetObject, 'addXML', modifiedValue, flexSettings, designMetadata);
164
164
  const templateName = fragment.targetAggregation === COLUMNS_AGGREGATION ? `V2_SMART_TABLE_COLUMN` : 'V2_SMART_TABLE_CELL';
165
165
  const preparedChange = command.getPreparedChange();
166
166
  setAdditionalChangeInfoForChangeFile(preparedChange.getDefinition().fileName, { templateName });
@@ -283,8 +283,8 @@ export default class AddTableColumnFragments extends BaseDialog<AddTableColumnsF
283
283
  targetObject,
284
284
  'addXML',
285
285
  modifiedValue,
286
- designMetadata,
287
- flexSettings
286
+ flexSettings,
287
+ designMetadata
288
288
  );
289
289
 
290
290
  const templateName =
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  return obj && obj.__esModule && typeof obj.default !== 'undefined' ? obj.default : obj;
17
17
  }
18
18
  const ValueState = sap_ui_core_library['ValueState'];
19
- const matchesFragmentName = ___utils['matchesFragmentName'];
19
+ const checkForExistingChange = ___utils['checkForExistingChange'];
20
20
  const getError = ____utils_error['getError'];
21
21
  const getControlById = ____utils_core['getControlById'];
22
22
  const ControlUtils = _interopRequireDefault(__ControlUtils);
@@ -118,7 +118,7 @@ sap.ui.define([
118
118
  updateDialogState(ValueState.Error, 'A fragment file name cannot contain more than 64 characters.');
119
119
  return;
120
120
  }
121
- const changeExists = this.checkForExistingChange(fragmentName);
121
+ const changeExists = checkForExistingChange(this.rta, 'addXMLAtExtensionPoint', 'content.fragmentPath', `${ fragmentName }.fragment.xml`);
122
122
  if (changeExists) {
123
123
  updateDialogState(ValueState.Error, 'Enter a different name. The fragment name entered matches the name of an unsaved fragment.');
124
124
  return;
@@ -126,17 +126,6 @@ sap.ui.define([
126
126
  updateDialogState(ValueState.Success);
127
127
  this.model.setProperty('/newFragmentName', fragmentName);
128
128
  },
129
- checkForExistingChange: function _checkForExistingChange(fragmentName) {
130
- const allCommands = this.rta.getCommandStack().getCommands();
131
- return allCommands.some(command => {
132
- if (typeof command.getCommands === 'function') {
133
- const addXmlCommand = command.getCommands().find(c => c?.getProperty('name') === 'addXMLAtExtensionPoint');
134
- return addXmlCommand && matchesFragmentName(addXmlCommand, fragmentName);
135
- } else {
136
- return matchesFragmentName(command, fragmentName);
137
- }
138
- });
139
- },
140
129
  setEscapeHandler: function _setEscapeHandler() {
141
130
  this.dialog.setEscapeHandler(_ref => {
142
131
  let {resolve} = _ref;
@@ -7,10 +7,9 @@ import { ValueState } from 'sap/ui/core/library';
7
7
  import Controller from 'sap/ui/core/mvc/Controller';
8
8
  import JSONModel from 'sap/ui/model/json/JSONModel';
9
9
  import RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring';
10
- import FlexCommand from 'sap/ui/rta/command/FlexCommand';
11
10
  import MessageToast from 'sap/m/MessageToast';
12
11
  import CommandExecutor from '../command-executor';
13
- import { matchesFragmentName } from '../utils';
12
+ import { checkForExistingChange } from '../utils';
14
13
  import type { Fragments } from '../api-handler';
15
14
  import { getError } from '../../utils/error';
16
15
  import ManagedObjectMetadata from 'sap/ui/base/ManagedObjectMetadata';
@@ -168,7 +167,12 @@ export default abstract class BaseDialog<T extends BaseDialogModel = BaseDialogM
168
167
  return;
169
168
  }
170
169
 
171
- const changeExists = this.checkForExistingChange(fragmentName);
170
+ const changeExists = checkForExistingChange(
171
+ this.rta,
172
+ 'addXMLAtExtensionPoint',
173
+ 'content.fragmentPath',
174
+ `${fragmentName}.fragment.xml`
175
+ );
172
176
 
173
177
  if (changeExists) {
174
178
  updateDialogState(
@@ -182,28 +186,6 @@ export default abstract class BaseDialog<T extends BaseDialogModel = BaseDialogM
182
186
  this.model.setProperty('/newFragmentName', fragmentName);
183
187
  }
184
188
 
185
- /**
186
- * Checks for the existence of a change associated with a specific fragment name in the RTA command stack.
187
- *
188
- * @param {string} fragmentName - The name of the fragment to check for existing changes.
189
- * @returns {Promise<boolean>} A promise that resolves to `true` if a matching change is found, otherwise `false`.
190
- */
191
- checkForExistingChange(fragmentName: string): boolean {
192
- const allCommands = this.rta.getCommandStack().getCommands();
193
-
194
- return allCommands.some((command: FlexCommand) => {
195
- if (typeof command.getCommands === 'function') {
196
- const addXmlCommand = command
197
- .getCommands()
198
- .find((c: FlexCommand) => c?.getProperty('name') === 'addXMLAtExtensionPoint');
199
-
200
- return addXmlCommand && matchesFragmentName(addXmlCommand, fragmentName);
201
- } else {
202
- return matchesFragmentName(command, fragmentName);
203
- }
204
- });
205
- }
206
-
207
189
  /**
208
190
  * Sets custom function that fires when user presses escape key.
209
191
  */