@openui5/sap.ui.fl 1.128.0 → 1.129.0

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 (170) hide show
  1. package/THIRDPARTY.txt +1 -1
  2. package/package.json +3 -3
  3. package/src/sap/ui/fl/.library +1 -1
  4. package/src/sap/ui/fl/ChangePersistence.js +13 -421
  5. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  6. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  7. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  8. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  9. package/src/sap/ui/fl/FlexController.js +27 -51
  10. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  11. package/src/sap/ui/fl/LayerUtils.js +1 -1
  12. package/src/sap/ui/fl/Utils.js +1 -1
  13. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  14. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  15. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
  16. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +5 -5
  17. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  18. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +5 -4
  19. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewDataSource.js +152 -0
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +12 -18
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +67 -0
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +11 -9
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +5 -3
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetCloudDevAdaptationStatus.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +18 -5
  45. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +2 -2
  48. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +2 -4
  49. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +19 -10
  50. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +4 -3
  51. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +4 -3
  52. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +16 -12
  53. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +17 -20
  54. package/src/sap/ui/fl/apply/_internal/flexObjects/States.js +4 -3
  55. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +6 -5
  56. package/src/sap/ui/fl/apply/_internal/flexObjects/UpdatableChange.js +1 -1
  57. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +4 -3
  58. package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
  59. package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +4 -4
  60. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +17 -61
  61. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  62. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  63. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  64. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  65. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +10 -6
  66. package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
  67. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  68. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +16 -15
  69. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +10 -12
  70. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +13 -6
  71. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  72. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
  73. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  74. package/src/sap/ui/fl/apply/api/AnnotationChangeHandlerAPI.js +63 -0
  75. package/src/sap/ui/fl/changeHandler/AddIFrame.js +4 -4
  76. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +2 -1
  78. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  82. package/src/sap/ui/fl/changeHandler/HideControl.js +26 -5
  83. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  84. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  85. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  86. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  87. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  88. package/src/sap/ui/fl/changeHandler/UnhideControl.js +33 -1
  89. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  90. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  91. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +14 -13
  92. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  93. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  94. package/src/sap/ui/fl/designtime/util/editIFrame.js +2 -1
  95. package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
  96. package/src/sap/ui/fl/initial/_internal/Storage.js +10 -8
  97. package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
  98. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +3 -3
  99. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +23 -1
  100. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +54 -22
  101. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  102. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  103. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  104. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  105. package/src/sap/ui/fl/library.js +43 -43
  106. package/src/sap/ui/fl/registry/Settings.js +1 -1
  107. package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +29 -58
  108. package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
  109. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +12 -66
  110. package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +7 -4
  111. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +30 -19
  112. package/src/sap/ui/fl/support/api/SupportAPI.js +8 -4
  113. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  114. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  115. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  116. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  117. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  118. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  119. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  120. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  121. package/src/sap/ui/fl/util/DescriptorChangeCheck.js +106 -12
  122. package/src/sap/ui/fl/util/IFrame.js +3 -3
  123. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  124. package/src/sap/ui/fl/util/changePropertyValueByPath.js +15 -4
  125. package/src/sap/ui/fl/util/resolveBinding.js +9 -9
  126. package/src/sap/ui/fl/variants/VariantModel.js +49 -32
  127. package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +2 -2
  128. package/src/sap/ui/fl/write/_internal/SaveAs.js +12 -3
  129. package/src/sap/ui/fl/write/_internal/Storage.js +6 -6
  130. package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  132. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  133. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  134. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
  135. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +3 -3
  136. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  137. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  138. package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
  139. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +43 -2
  141. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  142. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +3 -3
  143. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  144. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  145. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  146. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  147. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  148. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  149. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  150. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  151. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +122 -77
  152. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  153. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  154. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  155. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +18 -18
  156. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  157. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +12 -11
  158. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +6 -8
  159. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectManager.js +181 -5
  160. package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  161. package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +86 -0
  162. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +43 -43
  163. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  164. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  165. package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +22 -19
  166. package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +56 -30
  167. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  168. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +28 -51
  169. package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +11 -7
  170. package/src/sap/ui/fl/write/api/VersionsAPI.js +6 -4
package/THIRDPARTY.txt CHANGED
@@ -468,7 +468,7 @@ License: Apache-2.0
468
468
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
469
469
  Contained in: lib/jsdoc/ui5/plugin.js
470
470
 
471
- Component: SAP Theming Base Content, version: 11.16.1
471
+ Component: SAP Theming Base Content, version: 11.18.0
472
472
  Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
473
473
  License: Apache-2.0
474
474
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.fl",
3
- "version": "1.128.0",
3
+ "version": "1.129.0",
4
4
  "description": "OpenUI5 UI Library sap.ui.fl",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.m": "1.128.0",
18
- "@openui5/sap.ui.core": "1.128.0"
17
+ "@openui5/sap.m": "1.129.0",
18
+ "@openui5/sap.ui.core": "1.129.0"
19
19
  }
20
20
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.128.0</version>
9
+ <version>1.129.0</version>
10
10
 
11
11
  <documentation>SAPUI5 library with sap.ui.fl controls.</documentation>
12
12
 
@@ -6,69 +6,41 @@
6
6
 
7
7
  sap.ui.define([
8
8
  "sap/base/Log",
9
- "sap/ui/core/util/reflection/JsControlTreeModifier",
10
- "sap/ui/core/Component",
11
- "sap/ui/fl/apply/_internal/changes/Applier",
12
- "sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
13
9
  "sap/ui/fl/apply/_internal/flexObjects/States",
14
10
  "sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
15
11
  "sap/ui/fl/apply/_internal/flexState/changes/UIChangesState",
16
- "sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
17
- "sap/ui/fl/apply/_internal/flexState/DataSelector",
18
12
  "sap/ui/fl/apply/_internal/flexState/FlexObjectState",
19
13
  "sap/ui/fl/apply/_internal/flexState/FlexState",
20
14
  "sap/ui/fl/initial/api/Version",
21
15
  "sap/ui/fl/registry/Settings",
22
16
  "sap/ui/fl/write/_internal/condenser/Condenser",
17
+ "sap/ui/fl/write/_internal/flexState/FlexObjectManager",
23
18
  "sap/ui/fl/write/_internal/Storage",
24
19
  "sap/ui/fl/Layer",
25
- "sap/ui/fl/LayerUtils",
26
- "sap/ui/fl/Utils"
20
+ "sap/ui/fl/LayerUtils"
27
21
  ], function(
28
22
  Log,
29
- JsControlTreeModifier,
30
- Component,
31
- Applier,
32
- FlexObjectFactory,
33
23
  States,
34
24
  DependencyHandler,
35
25
  UIChangesState,
36
- VariantManagementState,
37
- DataSelector,
38
26
  FlexObjectState,
39
27
  FlexState,
40
28
  Version,
41
29
  Settings,
42
30
  Condenser,
31
+ FlexObjectManager,
43
32
  Storage,
44
33
  Layer,
45
- LayerUtils,
46
- Utils
34
+ LayerUtils
47
35
  ) {
48
36
  "use strict";
49
37
 
50
- const oVariantIndependentUIChangesDataSelector = new DataSelector({
51
- id: "variantIndependentUIChanges",
52
- parentDataSelector: FlexState.getFlexObjectsDataSelector(),
53
- executeFunction(aFlexObjects) {
54
- return aFlexObjects.filter(function(oFlexObject) {
55
- const bIsUIChange = oFlexObject.isA("sap.ui.fl.apply._internal.flexObjects.UIChange");
56
- const bIsControllerExtension = oFlexObject.isA("sap.ui.fl.apply._internal.flexObjects.ControllerExtensionChange");
57
- const bCorrectFileType = oFlexObject.getFileType() === "change" || oFlexObject.getFileType() === "codeExt";
58
- return (bIsUIChange || bIsControllerExtension)
59
- && bCorrectFileType
60
- && !oFlexObject.getVariantReference()
61
- && !oFlexObject.getSelector().persistencyKey;
62
- });
63
- }
64
- });
65
-
66
38
  /**
67
39
  * Helper object to access a change from the back end. Access helper object for each change (and variant) which was fetched from the back end
68
40
  *
69
41
  * @constructor
70
42
  * @author SAP SE
71
- * @version 1.128.0
43
+ * @version 1.129.0
72
44
  * @since 1.25.0
73
45
  * @private
74
46
  * @param {object} mComponent - Component data to initiate <code>ChangePersistence</code> instance
@@ -83,186 +55,6 @@ sap.ui.define([
83
55
  }
84
56
 
85
57
  this._oMessagebundle = undefined;
86
- oVariantIndependentUIChangesDataSelector.clearCachedResult({reference: this._mComponent.name});
87
- };
88
-
89
- async function getChangesFromFlexState(sReference, mPropertyBag, bInvalidateCache) {
90
- try {
91
- if (bInvalidateCache) {
92
- await FlexState.update(mPropertyBag);
93
- }
94
-
95
- await FlexState.getStorageResponse(sReference);
96
- } catch (oError) {
97
- Log.warning("Problem during ChangePersistence.prototype.getChangesForComponent");
98
- }
99
- }
100
-
101
- /**
102
- * Calls the back end asynchronously and fetches all changes for the component
103
- * New changes (dirty state) that are not yet saved to the back end won't be returned.
104
- * @param {object} [mPropertyBag] Contains additional data needed for reading changes
105
- * @param {object} [mPropertyBag.appDescriptor] Manifest that belongs to the current running component
106
- * @param {string} [mPropertyBag.siteId] ID of the site belonging to the current running component
107
- * @param {string} [mPropertyBag.currentLayer] Specifies a single layer for loading changes. If this parameter is set, the max layer filtering is not applied
108
- * @param {boolean} [mPropertyBag.ignoreMaxLayerParameter] Indicates that changes shall be loaded without layer filtering
109
- * @param {boolean} [mPropertyBag.includeCtrlVariants] - Indicates that control variant changes shall be included
110
- * @param {string} [mPropertyBag.cacheKey] Key to validate the cache entry stored on client side
111
- * @param {string} [mPropertyBag.version] Number of the version to retrieve changes for
112
- * @param {boolean} bInvalidateCache - should the cache be invalidated
113
- * @returns {Promise} Promise resolving with an array of changes
114
- * @public
115
- */
116
- ChangePersistence.prototype.getChangesForComponent = async function(mPropertyBag, bInvalidateCache) {
117
- mPropertyBag ||= {};
118
- await getChangesFromFlexState(this._mComponent.name, mPropertyBag, bInvalidateCache);
119
-
120
- const aAllChanges = FlexState.getFlexObjectsDataSelector().get({reference: this._mComponent.name});
121
- if (!aAllChanges.length) {
122
- return [];
123
- }
124
-
125
- // TODO: remove and use UIChangesState
126
- let aRelevantUIChanges = oVariantIndependentUIChangesDataSelector.get({reference: this._mComponent.name});
127
-
128
- if (!mPropertyBag.includeCtrlVariants) {
129
- aRelevantUIChanges = aRelevantUIChanges.concat(
130
- VariantManagementState.getInitialUIChanges({reference: this._mComponent.name})
131
- );
132
- } else {
133
- aRelevantUIChanges = aRelevantUIChanges.concat(
134
- VariantManagementState.getVariantDependentFlexObjects(this._mComponent.name)
135
- );
136
- }
137
-
138
- if (mPropertyBag.currentLayer) {
139
- aRelevantUIChanges = LayerUtils.filterChangeOrChangeDefinitionsByCurrentLayer(aRelevantUIChanges, mPropertyBag.currentLayer);
140
- }
141
- return aRelevantUIChanges;
142
- };
143
-
144
- /**
145
- * Adds a new change into dependency map positioned right after the referenced change and updates the change dependencies
146
- *
147
- * @param {sap.ui.core.Component} oAppComponent - Application component for the view
148
- * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - Change instance
149
- * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} [oReferenceChange] - Reference change. New change is positioned right after this one in the dependency map
150
- */
151
- ChangePersistence.prototype.addChangeAndUpdateDependencies = function(oAppComponent, oChange, oReferenceChange) {
152
- // the change status should always be initial when it gets added to the map / dependencies
153
- // if the component gets recreated the status of the change might not be initial
154
- oChange.setInitialApplyState();
155
- if (oReferenceChange) {
156
- DependencyHandler.insertChange(oChange, this.getDependencyMapForComponent(), oReferenceChange);
157
- }
158
- DependencyHandler.addChangeAndUpdateDependencies(oChange, oAppComponent, this.getDependencyMapForComponent());
159
- };
160
-
161
- ChangePersistence.prototype._addRunTimeCreatedChangeToDependencyMap = function(oAppComponent, oChange) {
162
- DependencyHandler.addRuntimeChangeToMap(oChange, oAppComponent, this.getDependencyMapForComponent());
163
- };
164
-
165
- /**
166
- * Getter for the private aggregation containing sap.ui.fl.apply._internal.flexObjects.FlexObject objects mapped by their selector ids.
167
- * @return {Object<string,object>} mChanges mapping with changes sorted by their selector ids
168
- * @public
169
- */
170
- ChangePersistence.prototype.getDependencyMapForComponent = function() {
171
- return FlexObjectState.getLiveDependencyMap(this._mComponent.name);
172
- };
173
-
174
- function finalizeChangeCreation(oChange, oAppComponent) {
175
- this._addRunTimeCreatedChangeToDependencyMap(oAppComponent, oChange);
176
- this._addPropagationListener(oAppComponent);
177
- }
178
-
179
- /**
180
- * Adds a new change and returns the id of the new change.
181
- *
182
- * @param {object} vChange - The complete and finalized JSON object representation the file content of the change or a Change instance
183
- * @param {sap.ui.core.Component} oAppComponent - Application component instance
184
- * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} the newly created change
185
- * @public
186
- */
187
- ChangePersistence.prototype.addChange = function(vChange, oAppComponent) {
188
- var oChange = this.addDirtyChange(vChange);
189
- finalizeChangeCreation.call(this, oChange, oAppComponent);
190
- return oChange;
191
- };
192
-
193
- /**
194
- * Adds new changes and returns the ids of the new changes.
195
- *
196
- * @param {object[]} aChanges - Array with complete and finalized JSON object representation the file content of the changes or Change instances
197
- * @param {sap.ui.core.Component} oAppComponent - Application component instance
198
- * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} the newly created changes
199
- * @public
200
- */
201
- ChangePersistence.prototype.addChanges = function(aChanges, oAppComponent) {
202
- var aNewChanges = this.addDirtyChanges(aChanges);
203
- aNewChanges.forEach(function(oChange) {
204
- finalizeChangeCreation.call(this, oChange, oAppComponent);
205
- }.bind(this));
206
- return aNewChanges;
207
- };
208
-
209
- function createChange(vChange) {
210
- return (
211
- typeof vChange.isA === "function"
212
- && vChange.isA("sap.ui.fl.apply._internal.flexObjects.FlexObject")
213
- )
214
- ? vChange
215
- : FlexObjectFactory.createFromFileContent(vChange);
216
- }
217
-
218
- /**
219
- * Adds a new dirty change.
220
- *
221
- * @param {object} vChange - JSON object of change or change object
222
- * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject} The prepared change object
223
- * @public
224
- */
225
- ChangePersistence.prototype.addDirtyChange = function(vChange) {
226
- const oNewChange = createChange(vChange);
227
- FlexState.addDirtyFlexObject(this._mComponent.name, oNewChange);
228
- return oNewChange;
229
- };
230
-
231
- /**
232
- * Adds new dirty changes.
233
- *
234
- * @param {object[]} aChanges - JSON objects of changes or change objects
235
- * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} The prepared change objects
236
- * @public
237
- */
238
- ChangePersistence.prototype.addDirtyChanges = function(aChanges) {
239
- const aNewChanges = aChanges.map(createChange);
240
- FlexState.addDirtyFlexObjects(this._mComponent.name, aNewChanges);
241
- return aNewChanges;
242
- };
243
-
244
- /**
245
- * If the first changes were created, the <code>propagationListener</code> of <code>sap.ui.fl</code> might not yet
246
- * be attached to the application component and must be added then.
247
- *
248
- * @param {sap.ui.core.UIComponent} oComponent Component having an app component that might not have a propagation listener yet
249
- * @private
250
- */
251
- ChangePersistence.prototype._addPropagationListener = function(oComponent) {
252
- var oAppComponent = Utils.getAppComponentForControl(oComponent);
253
- if (oAppComponent instanceof Component) {
254
- var fnCheckIsNotFlPropagationListener = function(fnPropagationListener) {
255
- return !fnPropagationListener._bIsSapUiFlFlexControllerApplyChangesOnControl;
256
- };
257
-
258
- var bNoFlPropagationListenerAttached = oAppComponent.getPropagationListeners().every(fnCheckIsNotFlPropagationListener);
259
-
260
- if (bNoFlPropagationListenerAttached) {
261
- var fnPropagationListener = Applier.applyAllChangesForControl.bind(Applier, oAppComponent, this._mComponent.name);
262
- fnPropagationListener._bIsSapUiFlFlexControllerApplyChangesOnControl = true;
263
- oAppComponent.addPropagationListener(fnPropagationListener);
264
- }
265
- }
266
58
  };
267
59
 
268
60
  ChangePersistence.prototype._deleteNotSavedChanges = function(aChanges, aCondensedChanges, bAlreadyDeletedViaCondense) {
@@ -276,7 +68,10 @@ sap.ui.define([
276
68
  // Remove also from Cache if the persisted change is still there (e.g. navigate away and back to the app)
277
69
  FlexState.updateStorageResponse(this._mComponent.name, [{flexObject: oChange.convertToFileContent(), type: "delete"}]);
278
70
  } else {
279
- this.deleteChange(oChange);
71
+ FlexObjectManager.deleteFlexObjects({
72
+ reference: this._mComponent.name,
73
+ flexObjects: [oChange]
74
+ });
280
75
  }
281
76
  }.bind(this));
282
77
  };
@@ -558,7 +353,7 @@ sap.ui.define([
558
353
  flexObject: oDirtyChange.convertToFileContent()
559
354
  }]);
560
355
  break;
561
- case States.LifecycleState.DIRTY:
356
+ case States.LifecycleState.UPDATED:
562
357
  FlexState.updateStorageResponse(this._mComponent.name, [{
563
358
  type: "update",
564
359
  flexObject: oDirtyChange.convertToFileContent()
@@ -618,57 +413,8 @@ sap.ui.define([
618
413
  return aChanges;
619
414
  }
620
415
 
621
- /**
622
- * Prepares a change to be deleted with the next call to
623
- * @see {ChangePersistence#saveDirtyChanges};
624
- *
625
- * If the given change is already in the dirty changes and
626
- * has the 'NEW' state it will be removed, assuming,
627
- * it has just been created in the current session;
628
- *
629
- * Otherwise it will be marked for deletion.
630
- *
631
- * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange the change to be deleted
632
- * @param {boolean} [bRunTimeCreatedChange] set if the change was created at runtime
633
- * @param {boolean} [bSkipRemoveFromFlexState] set if the change should not be removed from the FlexState
634
- */
635
- ChangePersistence.prototype.deleteChange = function(oChange, bRunTimeCreatedChange, bSkipRemoveFromFlexState) {
636
- const nIndexInDirtyChanges = FlexObjectState.getDirtyFlexObjects(this._mComponent.name).indexOf(oChange);
637
-
638
- if (nIndexInDirtyChanges > -1) {
639
- if (oChange.getState() === States.LifecycleState.DELETED) {
640
- return;
641
- }
642
- if (!bSkipRemoveFromFlexState) {
643
- FlexState.removeDirtyFlexObject(this._mComponent.name, oChange);
644
- }
645
- this._deleteChangeInMap(oChange, bRunTimeCreatedChange);
646
- return;
647
- }
648
-
649
- oChange.markForDeletion();
650
- this.addDirtyChange(oChange);
651
- this._deleteChangeInMap(oChange, bRunTimeCreatedChange);
652
- };
653
-
654
- /**
655
- * Prepares multiple changes to be deleted with the next call to
656
- * @see {ChangePersistence#saveDirtyChanges};
657
- *
658
- * Removal from the FlexState happens in one go to trigger only one invalidation.
659
- *
660
- * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} aChanges the changes to be deleted
661
- * @param {boolean} [bRunTimeCreatedChanges] set if the change was created at runtime
662
- */
663
- ChangePersistence.prototype.deleteChanges = function(aChanges, bRunTimeCreatedChanges) {
664
- aChanges.forEach(function(oChange) {
665
- this.deleteChange(oChange, bRunTimeCreatedChanges, true);
666
- }.bind(this));
667
- FlexState.removeDirtyFlexObjects(this._mComponent.name, aChanges);
668
- };
669
-
670
416
  ChangePersistence.prototype.removeChange = function(oChange) {
671
- FlexState.removeDirtyFlexObject(this._mComponent.name, oChange);
417
+ FlexState.removeDirtyFlexObjects(this._mComponent.name, [oChange]);
672
418
  this._deleteChangeInMap(oChange);
673
419
  };
674
420
 
@@ -681,164 +427,10 @@ sap.ui.define([
681
427
  */
682
428
  ChangePersistence.prototype._deleteChangeInMap = function(oChange, bRunTimeCreatedChange) {
683
429
  var sChangeKey = oChange.getId();
684
- DependencyHandler.removeChangeFromMap(this.getDependencyMapForComponent(), sChangeKey);
430
+ DependencyHandler.removeChangeFromMap(FlexObjectState.getLiveDependencyMap(this._mComponent.name), sChangeKey);
685
431
  if (!bRunTimeCreatedChange) {
686
- DependencyHandler.removeChangeFromDependencies(this.getDependencyMapForComponent(), sChangeKey);
687
- }
688
- };
689
-
690
- function isLocalAndInLayer(sLayer, oObject) {
691
- return (oObject.getRequest() === "$TMP" || oObject.getRequest() === "") && oObject.getLayer() === sLayer;
692
- }
693
-
694
- function isPersistedAndInLayer(sLayer, oObject) {
695
- return oObject.getState() === States.LifecycleState.PERSISTED && oObject.getLayer() === sLayer;
696
- }
697
-
698
- function getAllCompVariantsEntities() {
699
- var aCompVariantEntities = [];
700
- var mCompVariantsMap = FlexState.getCompVariantsMap(this._mComponent.name);
701
- for (var sPersistencyKey in mCompVariantsMap) {
702
- for (var sId in mCompVariantsMap[sPersistencyKey].byId) {
703
- aCompVariantEntities.push(mCompVariantsMap[sPersistencyKey].byId[sId]);
704
- }
705
- }
706
- return aCompVariantEntities;
707
- }
708
- /**
709
- * Transports all the UI changes and app variant descriptor (if exists) to the target system
710
- *
711
- * @param {object} oRootControl - the root control of the running application
712
- * @param {string} sStyleClass - RTA style class name
713
- * @param {string} sLayer - Working layer
714
- * @param {array} [aAppVariantDescriptors] - an array of app variant descriptors which needs to be transported
715
- * @returns {Promise} promise that resolves when all the artifacts are successfully transported
716
- */
717
- ChangePersistence.prototype.transportAllUIChanges = function(oRootControl, sStyleClass, sLayer, aAppVariantDescriptors) {
718
- return this.getChangesForComponent({currentLayer: sLayer, includeCtrlVariants: true}).then(function(aLocalChanges) {
719
- var aCompVariantEntities = getAllCompVariantsEntities.call(this);
720
-
721
- aLocalChanges = aLocalChanges.concat(
722
- aCompVariantEntities.filter(isLocalAndInLayer.bind(this, sLayer)));
723
-
724
- return Storage.publish({
725
- transportDialogSettings: {
726
- styleClass: sStyleClass
727
- },
728
- layer: sLayer,
729
- reference: this._mComponent.name,
730
- localChanges: aLocalChanges,
731
- appVariantDescriptors: aAppVariantDescriptors
732
- });
733
- }.bind(this));
734
- };
735
-
736
- /**
737
- * Removes unsaved changes.
738
- *
739
- * @param {string|string[]} [vLayer] - Layer or multiple layers for which changes shall be deleted. If omitted, changes on all layers are considered.
740
- * @param {sap.ui.core.Component} [oComponent] - Component instance, required if oControl is specified
741
- * @param {string} [oControl] - Control for which the changes should be deleted. If omitted, all changes for the app component are considered.
742
- * @param {string} [sGenerator] - Generator of changes (optional)
743
- * @param {string[]} [aChangeTypes] - Types of changes (optional)
744
- *
745
- * @returns {Promise} Promise that resolves after the deletion took place
746
- */
747
- ChangePersistence.prototype.removeDirtyChanges = function(vLayer, oComponent, oControl, sGenerator, aChangeTypes) {
748
- var aLayers = [].concat(vLayer || []);
749
- var aDirtyChanges = FlexObjectState.getDirtyFlexObjects(this._mComponent.name);
750
-
751
- var aChangesToBeRemoved = aDirtyChanges.filter(function(oChange) {
752
- var bChangeValid = true;
753
-
754
- if (aLayers.length && !aLayers.includes(oChange.getLayer())) {
755
- return false;
756
- }
757
-
758
- if (sGenerator && oChange.getSupportInformation().generator !== sGenerator) {
759
- return false;
760
- }
761
-
762
- if (oControl) {
763
- var vSelector = oChange.getSelector();
764
- bChangeValid = oControl.getId() === JsControlTreeModifier.getControlIdBySelector(vSelector, oComponent);
765
- }
766
-
767
- if (aChangeTypes) {
768
- bChangeValid &&= aChangeTypes.indexOf(oChange.getChangeType()) !== -1;
769
- }
770
-
771
- return bChangeValid;
772
- });
773
-
774
- FlexState.removeDirtyFlexObjects(this._mComponent.name, aChangesToBeRemoved);
775
- aChangesToBeRemoved.forEach(function(oChange) {
776
- var nIndex = aDirtyChanges.indexOf(oChange);
777
- aDirtyChanges.splice(nIndex, 1);
778
- });
779
-
780
- return Promise.resolve(aChangesToBeRemoved);
781
- };
782
-
783
- /**
784
- * Reset changes on the server. Specification of a generator, selector string or change type string is optional
785
- * but at least one of these parameters has to be filled.
786
- * This function returns an array of changes which need to be reverted from UI. When neither a selector nor a change type is provided,
787
- * an empty array is returned (this triggers a reset of the changes for an entire application component and reloads it).
788
- *
789
- * @param {string} sLayer Layer for which changes shall be deleted
790
- * @param {string} [sGenerator] Generator of changes (optional)
791
- * @param {string[]} [aSelectorIds] Selector IDs in local format (optional)
792
- * @param {string[]} [aChangeTypes] Types of changes (optional)
793
- *
794
- * @returns {Promise} Promise that resolves with an array of changes which need to be reverted from UI
795
- */
796
- ChangePersistence.prototype.resetChanges = async function(sLayer, sGenerator, aSelectorIds, aChangeTypes) {
797
- const bSelectorIdsProvided = aSelectorIds && aSelectorIds.length > 0;
798
- const bChangeTypesProvided = aChangeTypes && aChangeTypes.length > 0;
799
-
800
- // In case of application reset and PUBLIC layer available, also includes comp variant entities
801
- const isPublicLayerAvailable = Settings.getInstanceOrUndef() && Settings.getInstanceOrUndef().isPublicLayerAvailable();
802
- const isApplicationReset = sGenerator === undefined && aSelectorIds === undefined && aChangeTypes === undefined;
803
- const aCompVariantsEntries = (isPublicLayerAvailable && isApplicationReset) ?
804
- getAllCompVariantsEntities.call(this).filter(isPersistedAndInLayer.bind(this, sLayer))
805
- : [];
806
-
807
- const aUiChanges = await this.getChangesForComponent({currentLayer: sLayer, includeCtrlVariants: true});
808
- const aFlexObjects = aUiChanges.concat(aCompVariantsEntries);
809
- const mParams = {
810
- reference: this._mComponent.name,
811
- layer: sLayer,
812
- changes: aFlexObjects
813
- };
814
- if (sGenerator) {
815
- mParams.generator = sGenerator;
816
- }
817
- if (bSelectorIdsProvided) {
818
- mParams.selectorIds = aSelectorIds;
819
- }
820
- if (bChangeTypesProvided) {
821
- mParams.changeTypes = aChangeTypes;
822
- }
823
-
824
- const oResponse = await Storage.reset(mParams);
825
- // If reset changes for control, returns an array of deleted changes for reverting
826
- if (aSelectorIds || aChangeTypes) {
827
- const aNames = [];
828
- if (oResponse && oResponse.response && oResponse.response.length > 0) {
829
- oResponse.response.forEach(function(oChangeContentId) {
830
- aNames.push(oChangeContentId.fileName);
831
- });
832
- }
833
- const aChangesToRevert = UIChangesState.getAllUIChanges(this._mComponent.name).filter(function(oChange) {
834
- return aNames.indexOf(oChange.getId()) !== -1;
835
- });
836
- FlexState.updateStorageResponse(this._mComponent.name, aChangesToRevert.map((oFlexObject) => {
837
- return {flexObject: oFlexObject.convertToFileContent(), type: "delete"};
838
- }));
839
- return aChangesToRevert;
432
+ DependencyHandler.removeChangeFromDependencies(FlexObjectState.getLiveDependencyMap(this._mComponent.name), sChangeKey);
840
433
  }
841
- return [];
842
434
  };
843
435
 
844
436
  return ChangePersistence;
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @alias sap.ui.fl.ChangePersistenceFactory
20
20
  * @since 1.27.0
21
21
  * @author SAP SE
22
- * @version 1.128.0
22
+ * @version 1.129.0
23
23
  * @private
24
24
  * @ui5-restricted sap.ui.fl
25
25
  */
@@ -20,7 +20,7 @@ function(
20
20
  * @namespace
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.128.0
23
+ * @version 1.129.0
24
24
  *
25
25
  * @private
26
26
  * @since 1.48
@@ -20,7 +20,7 @@ function(
20
20
  * @namespace
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.128.0
23
+ * @version 1.129.0
24
24
  *
25
25
  * @private
26
26
  * @since 1.58
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * @namespace
18
18
  *
19
19
  * @author SAP SE
20
- * @version 1.128.0
20
+ * @version 1.129.0
21
21
  *
22
22
  * @private
23
23
  * @since 1.48