@sap-ux/preview-middleware 0.19.19 → 0.19.20

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 (73) hide show
  1. package/dist/client/adp/api-handler.js +153 -153
  2. package/dist/client/adp/command-executor.js +75 -75
  3. package/dist/client/adp/control-utils.js +44 -44
  4. package/dist/client/adp/controllers/ControllerExtension.controller.js +210 -210
  5. package/dist/client/adp/controllers/ExtensionPoint.controller.js +139 -139
  6. package/dist/client/adp/controllers/FileExistsDialog.controller.js +66 -66
  7. package/dist/client/adp/dialog-factory.js +135 -135
  8. package/dist/client/adp/init-dialogs.js +138 -138
  9. package/dist/client/adp/quick-actions/add-new-subpage-quick-action-base.js +96 -96
  10. package/dist/client/adp/quick-actions/common/add-controller-to-page.js +60 -60
  11. package/dist/client/adp/quick-actions/common/create-page-action.js +54 -54
  12. package/dist/client/adp/quick-actions/common/op-add-custom-section.js +39 -39
  13. package/dist/client/adp/quick-actions/common/op-add-header-field.js +67 -67
  14. package/dist/client/adp/quick-actions/common/utils.js +18 -18
  15. package/dist/client/adp/quick-actions/control-types.js +23 -23
  16. package/dist/client/adp/quick-actions/dialog-enablement-validator.js +24 -24
  17. package/dist/client/adp/quick-actions/enablement-validator.js +4 -4
  18. package/dist/client/adp/quick-actions/fe-v2/add-new-subpage.js +81 -81
  19. package/dist/client/adp/quick-actions/fe-v2/change-table-actions.js +67 -67
  20. package/dist/client/adp/quick-actions/fe-v2/change-table-columns.js +101 -101
  21. package/dist/client/adp/quick-actions/fe-v2/create-table-action.js +107 -107
  22. package/dist/client/adp/quick-actions/fe-v2/create-table-custom-column.js +99 -99
  23. package/dist/client/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.js +78 -78
  24. package/dist/client/adp/quick-actions/fe-v2/lr-enable-table-filtering.js +77 -77
  25. package/dist/client/adp/quick-actions/fe-v2/lr-enable-variant-management.js +69 -69
  26. package/dist/client/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.js +59 -59
  27. package/dist/client/adp/quick-actions/fe-v2/op-enable-empty-row-mode.js +93 -93
  28. package/dist/client/adp/quick-actions/fe-v2/op-enable-variant-management.js +84 -84
  29. package/dist/client/adp/quick-actions/fe-v2/registry.js +77 -77
  30. package/dist/client/adp/quick-actions/fe-v2/utils.js +116 -116
  31. package/dist/client/adp/quick-actions/fe-v4/add-new-subpage.js +138 -138
  32. package/dist/client/adp/quick-actions/fe-v4/change-table-actions.js +79 -79
  33. package/dist/client/adp/quick-actions/fe-v4/change-table-columns.js +73 -73
  34. package/dist/client/adp/quick-actions/fe-v4/create-table-action.js +53 -53
  35. package/dist/client/adp/quick-actions/fe-v4/create-table-custom-column.js +49 -49
  36. package/dist/client/adp/quick-actions/fe-v4/enable-variant-management.js +81 -81
  37. package/dist/client/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.js +56 -56
  38. package/dist/client/adp/quick-actions/fe-v4/lr-enable-table-filtering.js +82 -82
  39. package/dist/client/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.js +53 -53
  40. package/dist/client/adp/quick-actions/fe-v4/op-enable-empty-row-mode.js +89 -89
  41. package/dist/client/adp/quick-actions/fe-v4/registry.js +60 -60
  42. package/dist/client/adp/quick-actions/fe-v4/utils.js +72 -72
  43. package/dist/client/adp/quick-actions/load.js +44 -44
  44. package/dist/client/adp/quick-actions/quick-action-base.js +64 -64
  45. package/dist/client/adp/utils.js +218 -218
  46. package/dist/client/cpe/changes/index.js +10 -10
  47. package/dist/client/cpe/changes/validator.js +39 -39
  48. package/dist/client/cpe/documentation.js +164 -164
  49. package/dist/client/cpe/feature-service.js +36 -36
  50. package/dist/client/cpe/logger.js +30 -30
  51. package/dist/client/cpe/outline/editable.js +37 -37
  52. package/dist/client/cpe/outline/nodes.js +203 -203
  53. package/dist/client/cpe/quick-actions/quick-action-definition.js +4 -4
  54. package/dist/client/cpe/quick-actions/registry.js +143 -143
  55. package/dist/client/cpe/quick-actions/utils.js +92 -92
  56. package/dist/client/cpe/types.js +4 -4
  57. package/dist/client/cpe/ui5-utils.js +33 -33
  58. package/dist/client/cpe/utils.js +111 -111
  59. package/dist/client/flp/WorkspaceConnector.js +86 -86
  60. package/dist/client/flp/common.js +28 -28
  61. package/dist/client/flp/enableFakeConnector.js +83 -83
  62. package/dist/client/flp/homepage/Component.js +14 -14
  63. package/dist/client/flp/initCdm.js +117 -117
  64. package/dist/client/flp/initConnectors.js +28 -28
  65. package/dist/client/flp/initRta.js +178 -178
  66. package/dist/client/i18n.js +56 -56
  67. package/dist/client/utils/application.js +32 -32
  68. package/dist/client/utils/core.js +84 -84
  69. package/dist/client/utils/error.js +19 -19
  70. package/dist/client/utils/fe-v2.js +56 -56
  71. package/dist/client/utils/fe-v4.js +140 -140
  72. package/dist/client/utils/version.js +104 -104
  73. package/package.json +2 -2
@@ -1,113 +1,113 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/core", "sap/ui/dt/OverlayRegistry", "sap/ui/dt/OverlayUtil"], function (XMLView, UIComponent, ___utils_core, OverlayRegistry, OverlayUtil) {
4
- "use strict";
5
-
6
- const getComponent = ___utils_core["getComponent"];
7
- /**
8
- * Get runtime control.
9
- *
10
- * @param overlayControl - element overlay.
11
- * @returns ManagedObject
12
- */
13
- function getRuntimeControl(overlayControl) {
14
- let runtimeControl;
15
- if (overlayControl.getElementInstance) {
16
- runtimeControl = overlayControl.getElementInstance();
17
- } else {
18
- runtimeControl = overlayControl.getElement();
19
- }
20
- return runtimeControl;
21
- }
22
-
23
- /**
24
- * Get library of a control name.
25
- *
26
- * @param controlName - name of the ui5 control eg: sap.m.Button.
27
- * @returns Promise<string>
28
- */
29
- async function getLibrary(controlName) {
30
- return new Promise(resolve => {
31
- const controlPath = controlName.replace(/\./g, '/');
32
- sap.ui.require([controlPath], control => {
33
- const contMetadata = control.getMetadata();
34
- // getLibraryName method does not exist on events
35
- if (contMetadata?.getLibraryName) {
36
- const contLibName = contMetadata.getLibraryName();
37
- resolve(contLibName);
38
- } else {
39
- resolve(''); // return empty for events
40
- }
41
- });
42
- });
43
- }
44
-
45
- /**
46
- * Gets the root view of component for the provided ComponentContainer control.
47
- *
48
- * @param container ComponentContainer control.
49
- * @returns XMLView which is the root control of the component if it exists.
50
- */
51
- function getRootControlFromComponentContainer(container) {
52
- if (container) {
53
- const componentId = container.getComponent();
54
- const component = getComponent(componentId);
55
- if (component instanceof UIComponent) {
56
- const rootControl = component.getRootControl();
57
- if (rootControl instanceof XMLView) {
58
- return rootControl;
59
- }
60
- }
61
- }
62
- return undefined;
63
- }
64
- function getManifestProperties(control, changeService, controlOverlay) {
65
- const overlayData = controlOverlay?.getDesignTimeMetadata().getData();
66
- if (!controlOverlay || !overlayData?.manifestSettings) {
67
- return {};
68
- }
69
- const manifestPropertiesValue = overlayData?.manifestSettingsValues(overlayData?.manifestSettings(control), control);
70
- const manifestProperties = overlayData?.manifestSettings(control).reduce((acc, item) => {
71
- const propertyId = item.id;
72
- const value = changeService.getConfigurationPropertyValue(control.getId(), propertyId);
73
- let propertyValue = value === 0 || value === false || value ? value : manifestPropertiesValue[propertyId];
74
- if (item?.type && ['boolean', 'number', 'string'].includes(item?.type)) {
75
- if (propertyValue === undefined) {
76
- propertyValue = item.value; // set default value of property
77
- }
78
- }
79
- if (!acc[propertyId]) {
80
- acc[propertyId] = {
81
- ...item,
82
- defaultValue: item.value,
83
- configuration: true,
84
- name: item.id,
85
- readableName: item.name,
86
- manifestPropertyPath: `${overlayData?.manifestPropertyPath(control)}/${propertyId}`,
87
- type: item.type === 'number' ? 'int' : item.type,
88
- value: propertyValue
89
- };
90
- }
91
- return acc;
92
- }, {});
93
- return manifestProperties;
94
- }
95
- const getOverlay = control => {
96
- let controlOverlay = OverlayRegistry.getOverlay(control);
97
- if (!controlOverlay?.getDomRef()) {
98
- //look for closest control
99
- controlOverlay = OverlayUtil.getClosestOverlayFor(control);
100
- }
101
- return controlOverlay;
102
- };
103
- var __exports = {
104
- __esModule: true
105
- };
106
- __exports.getRuntimeControl = getRuntimeControl;
107
- __exports.getLibrary = getLibrary;
108
- __exports.getRootControlFromComponentContainer = getRootControlFromComponentContainer;
109
- __exports.getManifestProperties = getManifestProperties;
110
- __exports.getOverlay = getOverlay;
111
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/mvc/XMLView", "sap/ui/core/UIComponent", "../utils/core", "sap/ui/dt/OverlayRegistry", "sap/ui/dt/OverlayUtil"], function (XMLView, UIComponent, ___utils_core, OverlayRegistry, OverlayUtil) {
4
+ "use strict";
5
+
6
+ const getComponent = ___utils_core["getComponent"];
7
+ /**
8
+ * Get runtime control.
9
+ *
10
+ * @param overlayControl - element overlay.
11
+ * @returns ManagedObject
12
+ */
13
+ function getRuntimeControl(overlayControl) {
14
+ let runtimeControl;
15
+ if (overlayControl.getElementInstance) {
16
+ runtimeControl = overlayControl.getElementInstance();
17
+ } else {
18
+ runtimeControl = overlayControl.getElement();
19
+ }
20
+ return runtimeControl;
21
+ }
22
+
23
+ /**
24
+ * Get library of a control name.
25
+ *
26
+ * @param controlName - name of the ui5 control eg: sap.m.Button.
27
+ * @returns Promise<string>
28
+ */
29
+ async function getLibrary(controlName) {
30
+ return new Promise(resolve => {
31
+ const controlPath = controlName.replace(/\./g, '/');
32
+ sap.ui.require([controlPath], control => {
33
+ const contMetadata = control.getMetadata();
34
+ // getLibraryName method does not exist on events
35
+ if (contMetadata?.getLibraryName) {
36
+ const contLibName = contMetadata.getLibraryName();
37
+ resolve(contLibName);
38
+ } else {
39
+ resolve(''); // return empty for events
40
+ }
41
+ });
42
+ });
43
+ }
44
+
45
+ /**
46
+ * Gets the root view of component for the provided ComponentContainer control.
47
+ *
48
+ * @param container ComponentContainer control.
49
+ * @returns XMLView which is the root control of the component if it exists.
50
+ */
51
+ function getRootControlFromComponentContainer(container) {
52
+ if (container) {
53
+ const componentId = container.getComponent();
54
+ const component = getComponent(componentId);
55
+ if (component instanceof UIComponent) {
56
+ const rootControl = component.getRootControl();
57
+ if (rootControl instanceof XMLView) {
58
+ return rootControl;
59
+ }
60
+ }
61
+ }
62
+ return undefined;
63
+ }
64
+ function getManifestProperties(control, changeService, controlOverlay) {
65
+ const overlayData = controlOverlay?.getDesignTimeMetadata().getData();
66
+ if (!controlOverlay || !overlayData?.manifestSettings) {
67
+ return {};
68
+ }
69
+ const manifestPropertiesValue = overlayData?.manifestSettingsValues(overlayData?.manifestSettings(control), control);
70
+ const manifestProperties = overlayData?.manifestSettings(control).reduce((acc, item) => {
71
+ const propertyId = item.id;
72
+ const value = changeService.getConfigurationPropertyValue(control.getId(), propertyId);
73
+ let propertyValue = value === 0 || value === false || value ? value : manifestPropertiesValue[propertyId];
74
+ if (item?.type && ['boolean', 'number', 'string'].includes(item?.type)) {
75
+ if (propertyValue === undefined) {
76
+ propertyValue = item.value; // set default value of property
77
+ }
78
+ }
79
+ if (!acc[propertyId]) {
80
+ acc[propertyId] = {
81
+ ...item,
82
+ defaultValue: item.value,
83
+ configuration: true,
84
+ name: item.id,
85
+ readableName: item.name,
86
+ manifestPropertyPath: `${overlayData?.manifestPropertyPath(control)}/${propertyId}`,
87
+ type: item.type === 'number' ? 'int' : item.type,
88
+ value: propertyValue
89
+ };
90
+ }
91
+ return acc;
92
+ }, {});
93
+ return manifestProperties;
94
+ }
95
+ const getOverlay = control => {
96
+ let controlOverlay = OverlayRegistry.getOverlay(control);
97
+ if (!controlOverlay?.getDomRef()) {
98
+ //look for closest control
99
+ controlOverlay = OverlayUtil.getClosestOverlayFor(control);
100
+ }
101
+ return controlOverlay;
102
+ };
103
+ var __exports = {
104
+ __esModule: true
105
+ };
106
+ __exports.getRuntimeControl = getRuntimeControl;
107
+ __exports.getLibrary = getLibrary;
108
+ __exports.getRootControlFromComponentContainer = getRootControlFromComponentContainer;
109
+ __exports.getManifestProperties = getManifestProperties;
110
+ __exports.getOverlay = getOverlay;
111
+ return __exports;
112
112
  });
113
113
  //# sourceMappingURL=utils.js.map
@@ -1,88 +1,88 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/base/util/merge", "sap/ui/fl/write/api/connectors/ObjectStorageConnector", "sap/ui/fl/Layer", "./common", "../utils/version"], function (merge, ObjectStorageConnector, Layer, ___common, ___utils_version) {
4
- "use strict";
5
-
6
- const CHANGES_API_PATH = ___common["CHANGES_API_PATH"];
7
- const getFlexSettings = ___common["getFlexSettings"];
8
- const getUi5Version = ___utils_version["getUi5Version"];
9
- const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
10
- const connector = merge({}, ObjectStorageConnector, {
11
- layers: [Layer.VENDOR, Layer.CUSTOMER_BASE],
12
- storage: {
13
- _itemsStoredAsObjects: true,
14
- fileChangeRequestNotifier: undefined,
15
- setItem: function (_key, change) {
16
- const settings = getFlexSettings();
17
- if (settings) {
18
- change.support ??= {};
19
- change.support.generator = settings.generator;
20
- }
21
- if (typeof this.fileChangeRequestNotifier === 'function' && change.fileName) {
22
- try {
23
- this.fileChangeRequestNotifier(change.fileName, 'create', change);
24
- } catch (e) {
25
- // exceptions in the listener call are ignored
26
- }
27
- }
28
- return fetch(CHANGES_API_PATH, {
29
- method: 'POST',
30
- body: JSON.stringify(change, null, 2),
31
- headers: {
32
- 'content-type': 'application/json'
33
- }
34
- });
35
- },
36
- removeItem: function (key) {
37
- if (typeof this.fileChangeRequestNotifier === 'function') {
38
- try {
39
- this.fileChangeRequestNotifier(key, 'delete');
40
- } catch (e) {
41
- // exceptions in the listener call are ignored
42
- }
43
- }
44
- return fetch(CHANGES_API_PATH, {
45
- method: 'DELETE',
46
- body: JSON.stringify({
47
- fileName: key
48
- }),
49
- headers: {
50
- 'content-type': 'application/json'
51
- }
52
- });
53
- },
54
- clear: function () {
55
- // not implemented
56
- },
57
- getItem: function (_key) {
58
- // not implemented
59
- },
60
- getItems: async function () {
61
- const response = await fetch(CHANGES_API_PATH, {
62
- method: 'GET',
63
- headers: {
64
- 'content-type': 'application/json'
65
- }
66
- });
67
- return await response.json();
68
- }
69
- },
70
- loadFeatures: async function () {
71
- const features = await ObjectStorageConnector.loadFeatures();
72
- features.isVariantAdaptationEnabled = !isLowerThanMinimalUi5Version(await getUi5Version(), {
73
- major: 1,
74
- minor: 90
75
- });
76
- const settings = getFlexSettings();
77
- if (settings?.developerMode) {
78
- features.isVariantAdaptationEnabled = false;
79
- }
80
- if (settings?.scenario === 'ADAPTATION_PROJECT') {
81
- features.isVariantAdaptationEnabled = true;
82
- }
83
- return features;
84
- }
85
- });
86
- return connector;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/base/util/merge", "sap/ui/fl/write/api/connectors/ObjectStorageConnector", "sap/ui/fl/Layer", "./common", "../utils/version"], function (merge, ObjectStorageConnector, Layer, ___common, ___utils_version) {
4
+ "use strict";
5
+
6
+ const CHANGES_API_PATH = ___common["CHANGES_API_PATH"];
7
+ const getFlexSettings = ___common["getFlexSettings"];
8
+ const getUi5Version = ___utils_version["getUi5Version"];
9
+ const isLowerThanMinimalUi5Version = ___utils_version["isLowerThanMinimalUi5Version"];
10
+ const connector = merge({}, ObjectStorageConnector, {
11
+ layers: [Layer.VENDOR, Layer.CUSTOMER_BASE],
12
+ storage: {
13
+ _itemsStoredAsObjects: true,
14
+ fileChangeRequestNotifier: undefined,
15
+ setItem: function (_key, change) {
16
+ const settings = getFlexSettings();
17
+ if (settings) {
18
+ change.support ??= {};
19
+ change.support.generator = settings.generator;
20
+ }
21
+ if (typeof this.fileChangeRequestNotifier === 'function' && change.fileName) {
22
+ try {
23
+ this.fileChangeRequestNotifier(change.fileName, 'create', change);
24
+ } catch (e) {
25
+ // exceptions in the listener call are ignored
26
+ }
27
+ }
28
+ return fetch(CHANGES_API_PATH, {
29
+ method: 'POST',
30
+ body: JSON.stringify(change, null, 2),
31
+ headers: {
32
+ 'content-type': 'application/json'
33
+ }
34
+ });
35
+ },
36
+ removeItem: function (key) {
37
+ if (typeof this.fileChangeRequestNotifier === 'function') {
38
+ try {
39
+ this.fileChangeRequestNotifier(key, 'delete');
40
+ } catch (e) {
41
+ // exceptions in the listener call are ignored
42
+ }
43
+ }
44
+ return fetch(CHANGES_API_PATH, {
45
+ method: 'DELETE',
46
+ body: JSON.stringify({
47
+ fileName: key
48
+ }),
49
+ headers: {
50
+ 'content-type': 'application/json'
51
+ }
52
+ });
53
+ },
54
+ clear: function () {
55
+ // not implemented
56
+ },
57
+ getItem: function (_key) {
58
+ // not implemented
59
+ },
60
+ getItems: async function () {
61
+ const response = await fetch(CHANGES_API_PATH, {
62
+ method: 'GET',
63
+ headers: {
64
+ 'content-type': 'application/json'
65
+ }
66
+ });
67
+ return await response.json();
68
+ }
69
+ },
70
+ loadFeatures: async function () {
71
+ const features = await ObjectStorageConnector.loadFeatures();
72
+ features.isVariantAdaptationEnabled = !isLowerThanMinimalUi5Version(await getUi5Version(), {
73
+ major: 1,
74
+ minor: 90
75
+ });
76
+ const settings = getFlexSettings();
77
+ if (settings?.developerMode) {
78
+ features.isVariantAdaptationEnabled = false;
79
+ }
80
+ if (settings?.scenario === 'ADAPTATION_PROJECT') {
81
+ features.isVariantAdaptationEnabled = true;
82
+ }
83
+ return features;
84
+ }
85
+ });
86
+ return connector;
87
87
  });
88
88
  //# sourceMappingURL=WorkspaceConnector.js.map
@@ -1,30 +1,30 @@
1
- "use strict";
2
-
3
- sap.ui.define([], function () {
4
- "use strict";
5
-
6
- const CHANGES_API_PATH = '/preview/api/changes';
7
-
8
- /**
9
- * Retrieves Flex settings from a 'sap-ui-bootstrap' element's data attribute.
10
- * Parses the 'data-open-ux-preview-flex-settings' attribute as JSON.
11
- *
12
- * @returns {FlexSettings | undefined} The parsed Flex settings if available, otherwise undefined.
13
- */
14
- function getFlexSettings() {
15
- let result;
16
- const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
17
- const flexSetting = bootstrapConfig?.getAttribute('data-open-ux-preview-flex-settings');
18
- if (flexSetting) {
19
- result = JSON.parse(flexSetting);
20
- }
21
- return result;
22
- }
23
- var __exports = {
24
- __esModule: true
25
- };
26
- __exports.CHANGES_API_PATH = CHANGES_API_PATH;
27
- __exports.getFlexSettings = getFlexSettings;
28
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define([], function () {
4
+ "use strict";
5
+
6
+ const CHANGES_API_PATH = '/preview/api/changes';
7
+
8
+ /**
9
+ * Retrieves Flex settings from a 'sap-ui-bootstrap' element's data attribute.
10
+ * Parses the 'data-open-ux-preview-flex-settings' attribute as JSON.
11
+ *
12
+ * @returns {FlexSettings | undefined} The parsed Flex settings if available, otherwise undefined.
13
+ */
14
+ function getFlexSettings() {
15
+ let result;
16
+ const bootstrapConfig = document.getElementById('sap-ui-bootstrap');
17
+ const flexSetting = bootstrapConfig?.getAttribute('data-open-ux-preview-flex-settings');
18
+ if (flexSetting) {
19
+ result = JSON.parse(flexSetting);
20
+ }
21
+ return result;
22
+ }
23
+ var __exports = {
24
+ __esModule: true
25
+ };
26
+ __exports.CHANGES_API_PATH = CHANGES_API_PATH;
27
+ __exports.getFlexSettings = getFlexSettings;
28
+ return __exports;
29
29
  });
30
30
  //# sourceMappingURL=common.js.map
@@ -1,85 +1,85 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/fl/LrepConnector", "sap/ui/fl/FakeLrepConnector", "./common"], function (LrepConnector, FakeLrepConnector, ___common) {
4
- "use strict";
5
-
6
- const CHANGES_API_PATH = ___common["CHANGES_API_PATH"];
7
- const getFlexSettings = ___common["getFlexSettings"];
8
- /**
9
- * Processes an array of FlexChange objects.
10
- * It updates each change object with settings and sends them to a API endpoint.
11
- *
12
- * @param {FlexChange | FlexChange[]} changes - Array of FlexChange objects to be processed.
13
- * @returns {Promise<void>} A promise that resolves when all changes are processed.
14
- */
15
- async function create(changes) {
16
- const settings = getFlexSettings();
17
- await Promise.all((Array.isArray(changes) ? changes : [changes]).map(change => {
18
- if (settings) {
19
- change.support ??= {};
20
- change.support.generator = settings.generator;
21
- }
22
- if (typeof FakeLrepConnector.fileChangeRequestNotifier === 'function' && change.fileName) {
23
- try {
24
- FakeLrepConnector.fileChangeRequestNotifier(change.fileName, 'create', change);
25
- } catch (e) {
26
- // exceptions in the listener call are ignored
27
- }
28
- }
29
- return fetch(CHANGES_API_PATH, {
30
- method: 'POST',
31
- body: JSON.stringify(change, null, 2),
32
- headers: {
33
- 'content-type': 'application/json'
34
- }
35
- });
36
- }));
37
- }
38
-
39
- /**
40
- * Loads changes from a given path and processes them using an LrepConnector instance.
41
- * The changes are then formatted and returned in a specified structure.
42
- *
43
- * @returns {Promise<LoadChangesResult>} A promise that resolves to an object of type LoadChangesResult.
44
- */
45
- async function loadChanges() {
46
- const lrep = new LrepConnector();
47
- const response = await fetch(CHANGES_API_PATH, {
48
- method: 'GET',
49
- headers: {
50
- 'content-type': 'application/json'
51
- }
52
- });
53
- const changes = await response.json();
54
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
- args[_key] = arguments[_key];
56
- }
57
- return LrepConnector.prototype.loadChanges.apply(lrep, args).then(res => {
58
- res.changes.changes = Object.values(changes);
59
- return res;
60
- });
61
- }
62
-
63
- /**
64
- * Configures and enables the FakeLrepConnector based on the SAP UI5 version.
65
- * If the minor version of the SAP UI5 is less than 72, this function extends
66
- * the FakeLrepConnector's prototype with specific methods and enables the fake connector.
67
- *
68
- * Assumes the existence of a global 'sap' object with a 'ui.version' property,
69
- * and global jQuery object with 'extend' method.
70
- *
71
- * @returns {void}
72
- */
73
- var __exports = function () {
74
- jQuery.extend(FakeLrepConnector.prototype, {
75
- create,
76
- loadChanges,
77
- loadSettings: () => Promise.resolve()
78
- });
79
- FakeLrepConnector.enableFakeConnector();
80
- };
81
- __exports.create = create;
82
- __exports.loadChanges = loadChanges;
83
- return __exports;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/fl/LrepConnector", "sap/ui/fl/FakeLrepConnector", "./common"], function (LrepConnector, FakeLrepConnector, ___common) {
4
+ "use strict";
5
+
6
+ const CHANGES_API_PATH = ___common["CHANGES_API_PATH"];
7
+ const getFlexSettings = ___common["getFlexSettings"];
8
+ /**
9
+ * Processes an array of FlexChange objects.
10
+ * It updates each change object with settings and sends them to a API endpoint.
11
+ *
12
+ * @param {FlexChange | FlexChange[]} changes - Array of FlexChange objects to be processed.
13
+ * @returns {Promise<void>} A promise that resolves when all changes are processed.
14
+ */
15
+ async function create(changes) {
16
+ const settings = getFlexSettings();
17
+ await Promise.all((Array.isArray(changes) ? changes : [changes]).map(change => {
18
+ if (settings) {
19
+ change.support ??= {};
20
+ change.support.generator = settings.generator;
21
+ }
22
+ if (typeof FakeLrepConnector.fileChangeRequestNotifier === 'function' && change.fileName) {
23
+ try {
24
+ FakeLrepConnector.fileChangeRequestNotifier(change.fileName, 'create', change);
25
+ } catch (e) {
26
+ // exceptions in the listener call are ignored
27
+ }
28
+ }
29
+ return fetch(CHANGES_API_PATH, {
30
+ method: 'POST',
31
+ body: JSON.stringify(change, null, 2),
32
+ headers: {
33
+ 'content-type': 'application/json'
34
+ }
35
+ });
36
+ }));
37
+ }
38
+
39
+ /**
40
+ * Loads changes from a given path and processes them using an LrepConnector instance.
41
+ * The changes are then formatted and returned in a specified structure.
42
+ *
43
+ * @returns {Promise<LoadChangesResult>} A promise that resolves to an object of type LoadChangesResult.
44
+ */
45
+ async function loadChanges() {
46
+ const lrep = new LrepConnector();
47
+ const response = await fetch(CHANGES_API_PATH, {
48
+ method: 'GET',
49
+ headers: {
50
+ 'content-type': 'application/json'
51
+ }
52
+ });
53
+ const changes = await response.json();
54
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
55
+ args[_key] = arguments[_key];
56
+ }
57
+ return LrepConnector.prototype.loadChanges.apply(lrep, args).then(res => {
58
+ res.changes.changes = Object.values(changes);
59
+ return res;
60
+ });
61
+ }
62
+
63
+ /**
64
+ * Configures and enables the FakeLrepConnector based on the SAP UI5 version.
65
+ * If the minor version of the SAP UI5 is less than 72, this function extends
66
+ * the FakeLrepConnector's prototype with specific methods and enables the fake connector.
67
+ *
68
+ * Assumes the existence of a global 'sap' object with a 'ui.version' property,
69
+ * and global jQuery object with 'extend' method.
70
+ *
71
+ * @returns {void}
72
+ */
73
+ var __exports = function () {
74
+ jQuery.extend(FakeLrepConnector.prototype, {
75
+ create,
76
+ loadChanges,
77
+ loadSettings: () => Promise.resolve()
78
+ });
79
+ FakeLrepConnector.enableFakeConnector();
80
+ };
81
+ __exports.create = create;
82
+ __exports.loadChanges = loadChanges;
83
+ return __exports;
84
84
  });
85
85
  //# sourceMappingURL=enableFakeConnector.js.map
@@ -1,16 +1,16 @@
1
- "use strict";
2
-
3
- sap.ui.define(["sap/ui/core/UIComponent"], function (BaseComponent) {
4
- "use strict";
5
-
6
- /**
7
- * @namespace open.ux.preview.client.flp.homepage
8
- */
9
- const Component = BaseComponent.extend("open.ux.preview.client.flp.homepage.Component", {
10
- metadata: {
11
- manifest: 'json'
12
- }
13
- });
14
- return Component;
1
+ "use strict";
2
+
3
+ sap.ui.define(["sap/ui/core/UIComponent"], function (BaseComponent) {
4
+ "use strict";
5
+
6
+ /**
7
+ * @namespace open.ux.preview.client.flp.homepage
8
+ */
9
+ const Component = BaseComponent.extend("open.ux.preview.client.flp.homepage.Component", {
10
+ metadata: {
11
+ manifest: 'json'
12
+ }
13
+ });
14
+ return Component;
15
15
  });
16
16
  //# sourceMappingURL=Component.js.map