@openui5/sap.ui.fl 1.120.6 → 1.121.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 (192) hide show
  1. package/.reuse/dep5 +23 -21
  2. package/THIRDPARTY.txt +6 -43
  3. package/package.json +3 -3
  4. package/src/sap/ui/fl/.library +1 -1
  5. package/src/sap/ui/fl/ChangePersistence.js +38 -133
  6. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  7. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  8. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  9. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  10. package/src/sap/ui/fl/FlexController.js +28 -15
  11. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  12. package/src/sap/ui/fl/LayerUtils.js +5 -5
  13. package/src/sap/ui/fl/Utils.js +15 -18
  14. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  15. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +19 -20
  16. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  17. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
  18. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  19. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +6 -2
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +9 -3
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +2 -2
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +17 -11
  40. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +7 -19
  41. package/src/sap/ui/fl/{write → apply}/_internal/extensionPoint/Registry.js +2 -2
  42. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -3
  46. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +13 -7
  48. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +3 -2
  49. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +8 -1
  50. package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +47 -0
  51. package/src/sap/ui/fl/apply/_internal/flexState/DataSelector.js +124 -34
  52. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +118 -45
  53. package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +25 -9
  54. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +17 -3
  55. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +21 -1
  56. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  57. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +108 -104
  58. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +93 -34
  59. package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +195 -0
  60. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +7 -6
  61. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/Utils.js +1 -1
  62. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +6 -6
  63. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +2 -2
  64. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +89 -11
  65. package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +20 -28
  66. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  67. package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
  68. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
  69. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  70. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  71. package/src/sap/ui/fl/{write → apply}/api/ExtensionPointRegistryAPI.js +3 -3
  72. package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +49 -8
  73. package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  76. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +7 -6
  77. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  78. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  82. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  83. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  84. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  85. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  86. package/src/sap/ui/fl/changeHandler/StashControl.js +2 -2
  87. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  88. package/src/sap/ui/fl/changeHandler/UnstashControl.js +4 -4
  89. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  90. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  91. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  92. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  93. package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +3 -91
  94. package/src/sap/ui/fl/designtime/util/editIFrame.js +94 -0
  95. package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
  96. package/src/sap/ui/fl/initial/_internal/FlexInfoSession.js +2 -23
  97. package/src/sap/ui/fl/initial/_internal/Storage.js +106 -39
  98. package/src/sap/ui/fl/{write → initial}/_internal/StorageFeaturesMerger.js +10 -7
  99. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +14 -8
  100. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
  101. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  102. package/src/sap/ui/fl/initial/_internal/connectors/BackendConnector.js +26 -4
  103. package/src/sap/ui/fl/initial/_internal/connectors/BtpServiceConnector.js +44 -0
  104. package/src/sap/ui/fl/initial/_internal/connectors/KeyUserConnector.js +8 -1
  105. package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +48 -2
  106. package/src/sap/ui/fl/initial/_internal/connectors/NeoLrepConnector.js +25 -4
  107. package/src/sap/ui/fl/initial/_internal/connectors/PersonalizationConnector.js +12 -1
  108. package/src/sap/ui/fl/initial/_internal/connectors/StaticFileConnector.js +14 -4
  109. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  110. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  111. package/src/sap/ui/fl/initial/api/Version.js +0 -1
  112. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +22 -1
  113. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  114. package/src/sap/ui/fl/library.js +48 -43
  115. package/src/sap/ui/fl/messagebundle.properties +3 -0
  116. package/src/sap/ui/fl/messagebundle_bg.properties +1 -1
  117. package/src/sap/ui/fl/messagebundle_en_US_saprigi.properties +39 -39
  118. package/src/sap/ui/fl/messagebundle_hu.properties +1 -1
  119. package/src/sap/ui/fl/messagebundle_it.properties +1 -1
  120. package/src/sap/ui/fl/messagebundle_lv.properties +1 -1
  121. package/src/sap/ui/fl/messagebundle_mk.properties +2 -2
  122. package/src/sap/ui/fl/messagebundle_no.properties +1 -1
  123. package/src/sap/ui/fl/registry/Settings.js +12 -1
  124. package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +40 -20
  125. package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +93 -0
  126. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +4 -4
  127. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  128. package/src/sap/ui/fl/support/api/SupportAPI.js +5 -2
  129. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  130. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  131. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  132. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  133. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  134. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  135. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  136. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  137. package/src/sap/ui/fl/util/DescriptorChangeCheck.js +34 -19
  138. package/src/sap/ui/fl/util/IFrame.js +67 -20
  139. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  140. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  141. package/src/sap/ui/fl/variants/VariantManagement.js +88 -49
  142. package/src/sap/ui/fl/variants/VariantModel.js +19 -6
  143. package/src/sap/ui/fl/write/_internal/Storage.js +5 -34
  144. package/src/sap/ui/fl/write/_internal/Versions.js +62 -63
  145. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +2 -2
  146. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +2 -2
  147. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +2 -2
  148. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +2 -2
  149. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
  150. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  151. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -16
  152. package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +55 -0
  153. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +3 -9
  154. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -26
  155. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +3 -20
  156. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +5 -1
  157. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -15
  158. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  159. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +11 -4
  160. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  161. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  162. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  163. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  164. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  165. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  166. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  167. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +7 -7
  168. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  169. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  170. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  171. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  172. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  173. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +22 -3
  174. package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  175. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +36 -4
  176. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  177. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  178. package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +1 -3
  179. package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +1 -1
  180. package/src/sap/ui/fl/write/api/FeaturesAPI.js +2 -2
  181. package/src/sap/ui/fl/write/api/FieldExtensibility.js +2 -2
  182. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +36 -7
  183. package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +88 -105
  184. package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +25 -2
  185. package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +1 -0
  186. package/src/sap/ui/fl/write/api/VersionsAPI.js +0 -1
  187. package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +241 -28
  188. package/src/sap/ui/fl/write/connectors/BaseConnector.js +2 -10
  189. package/ui5.yaml +37 -76
  190. package/LICENSES/BSD-2-Clause.txt +0 -22
  191. package/src/sap/ui/fl/apply/_internal/flexState/changes/prepareChangesMap.js +0 -26
  192. /package/src/sap/ui/fl/descriptorRelated/{internal/Utils.js → Utils.js} +0 -0
@@ -14,7 +14,6 @@ sap.ui.define([
14
14
  "sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
15
15
  "sap/ui/fl/apply/_internal/flexObjects/States",
16
16
  "sap/ui/fl/apply/_internal/flexState/appDescriptorChanges/prepareAppDescriptorMap",
17
- "sap/ui/fl/apply/_internal/flexState/changes/prepareChangesMap",
18
17
  "sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap",
19
18
  "sap/ui/fl/apply/_internal/flexState/DataSelector",
20
19
  "sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions",
@@ -33,7 +32,6 @@ sap.ui.define([
33
32
  FlexObjectFactory,
34
33
  States,
35
34
  prepareAppDescriptorMap,
36
- prepareChangesMap,
37
35
  prepareCompVariantsMap,
38
36
  DataSelector,
39
37
  InitialPrepareFunctions,
@@ -52,8 +50,6 @@ sap.ui.define([
52
50
  * {
53
51
  * preparedMaps: {
54
52
  * appDescriptorMap: {},
55
- * changesMap: {},
56
- * variantsMap: {},
57
53
  * compVariantsMap: {},
58
54
  * },
59
55
  * storageResponse: {
@@ -76,7 +72,9 @@ sap.ui.define([
76
72
  * unfilteredStorageResponse: {...}, // same as above but without layer filtering
77
73
  * runtimePersistence: {
78
74
  * flexObjects: [...],
79
- * runtimeOnlyData: {}
75
+ * runtimeOnlyData: {
76
+ * liveDependencyMap: {...}
77
+ * }
80
78
  * }
81
79
  * partialFlexState: <boolean>,
82
80
  * componentId: "<componentId>",
@@ -85,7 +83,7 @@ sap.ui.define([
85
83
  *
86
84
  * @namespace sap.ui.fl.apply._internal.flexState.FlexState
87
85
  * @since 1.73
88
- * @version 1.120.6
86
+ * @version 1.121.0
89
87
  * @private
90
88
  * @ui5-restricted sap.ui.fl.apply._internal
91
89
  */
@@ -101,7 +99,6 @@ sap.ui.define([
101
99
  },
102
100
  changes: {
103
101
  initialPreparationFunctionName: "uiChanges",
104
- prepareFunction: prepareChangesMap,
105
102
  pathInResponse: ["changes"]
106
103
  },
107
104
  variants: {
@@ -184,6 +181,7 @@ sap.ui.define([
184
181
  }
185
182
 
186
183
  function initializeState(sMapName, mPropertyBag, sReference) {
184
+ mPropertyBag.reference = sReference;
187
185
  var oUpdate = runInitialPreparation(sMapName, mPropertyBag);
188
186
  if (oUpdate) {
189
187
  updateInstance(sReference, oUpdate);
@@ -193,14 +191,14 @@ sap.ui.define([
193
191
  var oFlexObjectsDataSelector = new DataSelector({
194
192
  id: "flexObjects",
195
193
  parameterKey: "reference",
196
- executeFunction(oData, sReference) {
197
- if (!_mInstances[sReference]) {
194
+ executeFunction(oData, mParameters) {
195
+ if (!_mInstances[mParameters.reference]) {
198
196
  return [];
199
197
  }
200
- var oPersistence = _mInstances[sReference].runtimePersistence;
198
+ var oPersistence = _mInstances[mParameters.reference].runtimePersistence;
201
199
  return oPersistence.flexObjects.concat(
202
200
  oPersistence.runtimeOnlyData.flexObjects || [],
203
- _mExternalData.flexObjects[sReference][_mInstances[sReference].componentId] || []
201
+ _mExternalData.flexObjects[mParameters.reference][_mInstances[mParameters.reference].componentId] || []
204
202
  );
205
203
  }
206
204
  });
@@ -235,16 +233,13 @@ sap.ui.define([
235
233
  return getInstanceEntryOrThrowError(sReference, "appDescriptorChanges");
236
234
  }
237
235
 
238
- function getChangesMap(sReference) {
239
- return getInstanceEntryOrThrowError(sReference, "changes");
240
- }
241
-
242
236
  function getCompVariantsMap(sReference) {
243
237
  return getInstanceEntryOrThrowError(sReference, "compVariants");
244
238
  }
245
239
 
246
- function buildRuntimePersistence(oStorageResponse, aExternalFlexObjects) {
247
- var oFlexInstance = {
240
+ function buildRuntimePersistence(oFlexStateInstance, aExternalFlexObjects) {
241
+ const oStorageResponse = oFlexStateInstance.storageResponse;
242
+ var oRuntimePersistence = {
248
243
  flexObjects: createFlexObjects(oStorageResponse),
249
244
  runtimeOnlyData: {
250
245
  flexObjects: []
@@ -253,13 +248,15 @@ sap.ui.define([
253
248
  Object.keys(_mFlexObjectInfo).forEach(function(sMapName) {
254
249
  var oUpdate = runInitialPreparation(sMapName, {
255
250
  storageResponse: oStorageResponse,
256
- externalData: aExternalFlexObjects
251
+ externalData: aExternalFlexObjects,
252
+ flexObjects: oRuntimePersistence.flexObjects,
253
+ componentId: oFlexStateInstance.componentId
257
254
  });
258
255
  if (oUpdate) {
259
- oFlexInstance = merge(oFlexInstance, oUpdate);
256
+ oRuntimePersistence = merge(oRuntimePersistence, oUpdate);
260
257
  }
261
258
  });
262
- return oFlexInstance;
259
+ return oRuntimePersistence;
263
260
  }
264
261
 
265
262
  function updateRuntimePersistence(sReference, oStorageResponse, oRuntimePersistence) {
@@ -292,7 +289,9 @@ sap.ui.define([
292
289
  return oExistingFlexObject;
293
290
  }
294
291
  // If unknown change definitions are found, throw error (storage does not create flex objects)
295
- throw new Error("Error updating runtime persistence: storage returned unknown flex objects");
292
+ const sErrorText = "Error updating runtime persistence: storage returned unknown flex objects";
293
+ Log.error(sErrorText);
294
+ throw new Error(sErrorText);
296
295
  })
297
296
  });
298
297
 
@@ -325,7 +324,7 @@ sap.ui.define([
325
324
 
326
325
  if (!_mInstances[sReference].runtimePersistence) {
327
326
  _mInstances[sReference].runtimePersistence = buildRuntimePersistence(
328
- _mInstances[sReference].storageResponse,
327
+ _mInstances[sReference],
329
328
  _mExternalData.flexObjects[sReference][mPropertyBag.componentId] || []
330
329
  );
331
330
  bDataUpdated = true;
@@ -355,7 +354,10 @@ sap.ui.define([
355
354
 
356
355
  function loadFlexData(mPropertyBag) {
357
356
  _mInitPromises[mPropertyBag.reference] = Loader.loadFlexData(mPropertyBag)
358
- .then(function(mResponse) {
357
+ .then(async (mResponse) => {
358
+ mResponse.authors = await Loader.loadVariantsAuthors(mPropertyBag.reference);
359
+ return mResponse;
360
+ }).then((mResponse) => {
359
361
  // The following line is used by the Flex Support Tool to set breakpoints - please adjust the tool if you change it!
360
362
  _mInstances[mPropertyBag.reference] = merge({}, {
361
363
  unfilteredStorageResponse: mResponse,
@@ -379,9 +381,6 @@ sap.ui.define([
379
381
  function storeInfoInSession(sReference, mResponse) {
380
382
  var oResponse = mResponse && mResponse.changes || {};
381
383
  var oFlexInfoSession = FlexInfoSession.getByReference(sReference);
382
- if (oFlexInfoSession === null) {
383
- oFlexInfoSession = {};
384
- }
385
384
  if (oResponse.info !== undefined) {
386
385
  oFlexInfoSession = Object.assign(oFlexInfoSession, oResponse.info);
387
386
  }
@@ -418,6 +417,11 @@ sap.ui.define([
418
417
  });
419
418
  }
420
419
 
420
+ // TODO: the additional safeguard for the runtimePersistence will not be necessary after the FlexState.initialize rework
421
+ FlexState.getRuntimeOnlyData = function(sReference) {
422
+ return _mInstances[sReference]?.runtimePersistence?.runtimeOnlyData || {};
423
+ };
424
+
421
425
  /**
422
426
  * Initializes the FlexState for a given reference. A request for the flex data is sent to the Loader and the response is saved.
423
427
  * The FlexState can only be initialized once, every subsequent init call will just resolve as soon as it is initialized.
@@ -557,12 +561,13 @@ sap.ui.define([
557
561
 
558
562
  /**
559
563
  * Some save operations don't require a complete new data request, so the storage response gets a live update.
560
- * This will not invalidate the DataSelectors
564
+ * This will also update the runtime persistence.
561
565
  *
562
566
  * @param {string} sReference - Flex reference of the app
563
567
  * @param {object[]} aUpdates - All new FlexObjects in JSON format
564
568
  */
565
569
  FlexState.updateStorageResponse = function(sReference, aUpdates) {
570
+ const aFlexObjectUpdates = [];
566
571
  aUpdates.forEach((oUpdate) => {
567
572
  if (oUpdate.type === "ui2") {
568
573
  _mInstances[sReference].unfilteredStorageResponse.changes.ui2personalization = oUpdate.newData;
@@ -571,23 +576,45 @@ sap.ui.define([
571
576
  const sFileName = oUpdate.flexObject.fileName;
572
577
  const aUnfiltered = ObjectPath.get(vPath, _mInstances[sReference].unfilteredStorageResponse.changes);
573
578
  const aFiltered = ObjectPath.get(vPath, _mInstances[sReference].storageResponse.changes);
579
+ const iExistingFlexObjectIdx = _mInstances[sReference].runtimePersistence.flexObjects.findIndex(
580
+ (oFlexObject) => oFlexObject.getId() === sFileName
581
+ );
582
+ const oExistingFlexObject = _mInstances[sReference].runtimePersistence.flexObjects[iExistingFlexObjectIdx];
574
583
  switch (oUpdate.type) {
575
584
  case "add":
576
585
  aUnfiltered.push(oUpdate.flexObject);
577
586
  aFiltered.push(oUpdate.flexObject);
587
+ if (iExistingFlexObjectIdx < 0) {
588
+ throw new Error("Flex response includes unknown flex object");
589
+ }
578
590
  break;
579
591
  case "delete":
580
592
  aFiltered.splice(aFiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName), 1);
581
593
  aUnfiltered.splice(aUnfiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName), 1);
594
+ if (iExistingFlexObjectIdx >= 0) {
595
+ _mInstances[sReference].runtimePersistence.flexObjects.splice(iExistingFlexObjectIdx, 1);
596
+ aFlexObjectUpdates.push({ type: "removeFlexObject", updatedObject: oExistingFlexObject });
597
+ }
582
598
  break;
583
599
  case "update":
584
600
  aFiltered.splice(aFiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName), 1, oUpdate.flexObject);
585
- aUnfiltered.splice(aUnfiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName), 1, oUpdate.flexObject);
601
+ aUnfiltered.splice(
602
+ aUnfiltered.findIndex((oFlexObject) => oFlexObject.fileName === sFileName),
603
+ 1,
604
+ oUpdate.flexObject
605
+ );
606
+ if (oExistingFlexObject && oExistingFlexObject.getState() !== States.LifecycleState.PERSISTED) {
607
+ oExistingFlexObject.setResponse(oUpdate.flexObject);
608
+ aFlexObjectUpdates.push({ type: "updateFlexObject", updatedObject: oExistingFlexObject });
609
+ }
586
610
  break;
587
611
  default:
588
612
  }
589
613
  }
590
614
  });
615
+ if (aFlexObjectUpdates.length > 0) {
616
+ oFlexObjectsDataSelector.checkUpdate({ reference: sReference }, aFlexObjectUpdates);
617
+ }
591
618
  };
592
619
 
593
620
  FlexState.clearState = function(sReference) {
@@ -641,7 +668,10 @@ sap.ui.define([
641
668
  _mExternalData.flexObjects[sReference] ||= {};
642
669
  _mExternalData.flexObjects[sReference][sComponentId] ||= [];
643
670
  _mExternalData.flexObjects[sReference][sComponentId].push(oFlexObject);
644
- oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
671
+ oFlexObjectsDataSelector.checkUpdate(
672
+ { reference: sReference },
673
+ [{ type: "addFlexObject", updatedObject: oFlexObject }]
674
+ );
645
675
  };
646
676
 
647
677
  /**
@@ -671,29 +701,56 @@ sap.ui.define([
671
701
  _mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
672
702
  // Storage response has changed, recreate the flex objects
673
703
  _mInstances[sReference].runtimePersistence = buildRuntimePersistence(
674
- _mInstances[sReference].storageResponse,
704
+ _mInstances[sReference],
675
705
  _mExternalData.flexObjects[sReference][_mInstances[sReference].componentId] || []
676
706
  );
677
707
  oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
678
708
  }
679
709
  };
680
710
 
711
+ /**
712
+ * Adds a dirty flex object to the flex state.
713
+ *
714
+ * @param {string} sReference - Flexibility reference of the app
715
+ * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oFlexObject - Flexibility object
716
+ */
681
717
  FlexState.addDirtyFlexObject = function(sReference, oFlexObject) {
718
+ const sAdaptationLayer = FlexInfoSession.getByReference(sReference)?.adaptationLayer;
719
+ const bFlexObjectsOverAdaptationLayer = !!sAdaptationLayer
720
+ && LayerUtils.isOverLayer(oFlexObject.getLayer(), sAdaptationLayer);
682
721
  // FIXME: Currently called from the ChangePersistence which might be
683
722
  // independent of FlexState in some test cases
684
723
  // Once the ChangePersistence is no longer used
685
724
  // make sure to remove the safeguard
686
- if (_mInstances[sReference]) {
725
+ if (!bFlexObjectsOverAdaptationLayer && _mInstances[sReference]) {
687
726
  _mInstances[sReference].runtimePersistence.flexObjects.push(oFlexObject);
688
- oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
727
+ oFlexObjectsDataSelector.checkUpdate(
728
+ { reference: sReference },
729
+ [{ type: "addFlexObject", updatedObject: oFlexObject }]
730
+ );
689
731
  }
690
732
  };
691
733
 
734
+ /**
735
+ * Adds a list of dirty flex objects to the flex state.
736
+ *
737
+ * @param {string} sReference - Flexibility reference of the app
738
+ * @param {array.<sap.ui.fl.apply._internal.flexObjects.FlexObject>} aFlexObjects - Flexibility objects
739
+ */
692
740
  FlexState.addDirtyFlexObjects = function(sReference, aFlexObjects) {
741
+ const sAdaptationLayer = FlexInfoSession.getByReference(sReference)?.adaptationLayer;
742
+ aFlexObjects = !sAdaptationLayer ? aFlexObjects : aFlexObjects
743
+ .filter((oFlexObject) => !LayerUtils.isOverLayer(oFlexObject.getLayer(), sAdaptationLayer));
744
+
693
745
  if (aFlexObjects.length > 0 && _mInstances[sReference]) {
694
746
  _mInstances[sReference].runtimePersistence.flexObjects =
695
747
  _mInstances[sReference].runtimePersistence.flexObjects.concat(aFlexObjects);
696
- oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
748
+ oFlexObjectsDataSelector.checkUpdate(
749
+ { reference: sReference },
750
+ aFlexObjects.map(function(oFlexObject) {
751
+ return { type: "addFlexObject", updatedObject: oFlexObject };
752
+ })
753
+ );
697
754
  }
698
755
  };
699
756
 
@@ -703,10 +760,15 @@ sap.ui.define([
703
760
  // Once the ChangePersistence is no longer used
704
761
  // make sure to remove the safeguard
705
762
  if (_mInstances[sReference]) {
706
- var aFlexObjects = _mInstances[sReference].runtimePersistence.flexObjects;
707
- var iIndex = aFlexObjects.indexOf(oFlexObject);
708
- aFlexObjects.splice(iIndex, 1);
709
- oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
763
+ const aFlexObjects = _mInstances[sReference].runtimePersistence.flexObjects;
764
+ const iIndex = aFlexObjects.indexOf(oFlexObject);
765
+ if (iIndex >= 0) {
766
+ aFlexObjects.splice(iIndex, 1);
767
+ oFlexObjectsDataSelector.checkUpdate(
768
+ { reference: sReference },
769
+ [{ type: "removeFlexObject", updatedObject: oFlexObject }]
770
+ );
771
+ }
710
772
  }
711
773
  };
712
774
 
@@ -716,21 +778,32 @@ sap.ui.define([
716
778
  // Once the ChangePersistence is no longer used
717
779
  // make sure to remove the safeguard
718
780
  if (_mInstances[sReference] && aFlexObjects.length > 0) {
719
- var aCurrentFlexObjects = _mInstances[sReference].runtimePersistence.flexObjects;
781
+ let bFlexObjectRemoved = false;
782
+ const aCurrentFlexObjects = _mInstances[sReference].runtimePersistence.flexObjects;
720
783
  aFlexObjects.forEach(function(oFlexObject) {
721
- var iIndex = aCurrentFlexObjects.indexOf(oFlexObject);
722
- aCurrentFlexObjects.splice(iIndex, 1);
784
+ const iIndex = aCurrentFlexObjects.indexOf(oFlexObject);
785
+ if (iIndex >= 0) {
786
+ bFlexObjectRemoved = true;
787
+ aCurrentFlexObjects.splice(iIndex, 1);
788
+ }
723
789
  });
724
- oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
790
+ if (bFlexObjectRemoved) {
791
+ oFlexObjectsDataSelector.checkUpdate(
792
+ { reference: sReference },
793
+ aFlexObjects.map(function(oFlexObject) {
794
+ return { type: "removeFlexObject", updatedObject: oFlexObject };
795
+ })
796
+ );
797
+ }
725
798
  }
726
799
  };
727
800
 
728
- FlexState.getFlexObjectsDataSelector = function() {
729
- return oFlexObjectsDataSelector;
801
+ FlexState.getComponentIdForReference = function(sReference) {
802
+ return _mInstances[sReference]?.componentId;
730
803
  };
731
804
 
732
- FlexState.getUIChanges = function(sReference) {
733
- return getChangesMap(sReference).changes;
805
+ FlexState.getFlexObjectsDataSelector = function() {
806
+ return oFlexObjectsDataSelector;
734
807
  };
735
808
 
736
809
  FlexState.getAppDescriptorChanges = function(sReference) {
@@ -4,16 +4,18 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
  sap.ui.define([
7
- "sap/base/util/includes",
8
7
  "sap/ui/core/Lib",
9
8
  "sap/ui/fl/apply/_internal/controlVariants/Utils",
10
9
  "sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
10
+ "sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor",
11
+ "sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
11
12
  "sap/ui/fl/Layer"
12
13
  ], function(
13
- includes,
14
14
  Lib,
15
15
  ControlVariantUtils,
16
16
  FlexObjectFactory,
17
+ getVariantAuthor,
18
+ DependencyHandler,
17
19
  Layer
18
20
  ) {
19
21
  "use strict";
@@ -26,10 +28,16 @@ sap.ui.define([
26
28
  * @private
27
29
  * @ui5-restricted
28
30
  */
29
- var InitialPrepareFunctions = {};
31
+ const InitialPrepareFunctions = {};
30
32
 
31
33
  InitialPrepareFunctions.variants = function(mPropertyBag) {
32
- var aVariantIds = (mPropertyBag.storageResponse.changes.variants || [])
34
+ // Exchange author of fl variant from userID to user's name
35
+ mPropertyBag.flexObjects.forEach((oFlexObject) => {
36
+ if (oFlexObject.getFileType() === "ctrl_variant") {
37
+ oFlexObject.setAuthor(getVariantAuthor(oFlexObject, mPropertyBag.storageResponse.authors));
38
+ }
39
+ });
40
+ const aVariantIds = (mPropertyBag.storageResponse.changes.variants || [])
33
41
  .map(function(oVariantDef) {
34
42
  return oVariantDef.fileName;
35
43
  })
@@ -72,7 +80,7 @@ sap.ui.define([
72
80
  var sVariantReference = oFlexObject.fileType === "ctrl_variant"
73
81
  ? oFlexObject.variantManagementReference
74
82
  : oFlexObject.variantReference;
75
- if (sVariantReference && !includes(aVariantIds, sVariantReference)) {
83
+ if (sVariantReference && !aVariantIds.includes(sVariantReference)) {
76
84
  var oResourceBundle = Lib.getResourceBundleFor("sap.ui.fl");
77
85
  var oNewVariant = FlexObjectFactory.createFlVariant({
78
86
  id: sVariantReference,
@@ -90,10 +98,18 @@ sap.ui.define([
90
98
  return oUpdate;
91
99
  };
92
100
 
93
- InitialPrepareFunctions.uiChanges = function() {
94
- // For now this is handled by the ChangePersistence
95
- // to improve performance until we can distinguish changes during
96
- // the data selector invalidation
101
+ InitialPrepareFunctions.uiChanges = function(mPropertyBag) {
102
+ const oDependencyMap = DependencyHandler.createEmptyDependencyMap();
103
+ mPropertyBag.flexObjects.forEach((oFlexObject) => {
104
+ if (oFlexObject.isA("sap.ui.fl.apply._internal.flexObjects.UIChange") && !oFlexObject.getVariantReference()) {
105
+ DependencyHandler.addChangeAndUpdateDependencies(oFlexObject, mPropertyBag.componentId, oDependencyMap);
106
+ }
107
+ });
108
+ return {
109
+ runtimeOnlyData: {
110
+ liveDependencyMap: oDependencyMap
111
+ }
112
+ };
97
113
  };
98
114
 
99
115
  return InitialPrepareFunctions;
@@ -7,11 +7,13 @@
7
7
  sap.ui.define([
8
8
  "sap/ui/base/ManagedObject",
9
9
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
10
- "sap/ui/fl/initial/_internal/Storage"
10
+ "sap/ui/fl/initial/_internal/Storage",
11
+ "sap/ui/fl/registry/Settings"
11
12
  ], function(
12
13
  ManagedObject,
13
14
  ManifestUtils,
14
- ApplyStorage
15
+ ApplyStorage,
16
+ Settings
15
17
  ) {
16
18
  "use strict";
17
19
 
@@ -100,7 +102,7 @@ sap.ui.define([
100
102
  *
101
103
  * @namespace sap.ui.fl.apply._internal.flexState.Loader
102
104
  * @since 1.74
103
- * @version 1.120.6
105
+ * @version 1.121.0
104
106
  * @private
105
107
  * @ui5-restricted sap.ui.fl.apply._internal.flexState
106
108
  */
@@ -152,6 +154,18 @@ sap.ui.define([
152
154
  .then(filterInvalidFileNames.bind())
153
155
  .then(migrateSelectorFlags.bind(undefined, isMigrationNeeded(mPropertyBag.manifest)))
154
156
  .then(formatFlexData);
157
+ },
158
+
159
+ /**
160
+ * Load the names of variants' authors for a given application.
161
+ *
162
+ * @param {string} sReference - Flex reference of application
163
+ * @returns {Promise<object>} Resolving with a list of maps between user's ID and name
164
+ */
165
+ async loadVariantsAuthors(sReference) {
166
+ // Loading settings to check the naming feature availability and prepare access to current user during naming exchange
167
+ const oSettings = await Settings.getInstance();
168
+ return oSettings?.isVariantAuthorNameAvailable() ? ApplyStorage.loadVariantsAuthors(sReference) : {};
155
169
  }
156
170
  };
157
171
  });
@@ -64,12 +64,21 @@ function(
64
64
  throw new Error("No Manifest received, descriptor changes are not possible");
65
65
  }
66
66
 
67
+ function getAppVersionFromManifest(oManifest) {
68
+ if (oManifest) {
69
+ var oSapApp = (oManifest.getEntry) ? oManifest.getEntry("sap.app") : oManifest["sap.app"];
70
+ var sAppVersion = oSapApp.applicationVersion?.version;
71
+ return sAppVersion;
72
+ }
73
+ return undefined;
74
+ }
75
+
67
76
  /**
68
77
  * Provides utility functions for handling manifests; All function work with Manifest Objects or raw manifests
69
78
  *
70
79
  * @namespace sap.ui.fl.apply._internal.flexState.ManifestUtils
71
80
  * @since 1.74
72
- * @version 1.120.6
81
+ * @version 1.121.0
73
82
  * @private
74
83
  */
75
84
  var ManifestUtils = {
@@ -84,6 +93,17 @@ function(
84
93
  */
85
94
  getAppIdFromManifest,
86
95
 
96
+ /**
97
+ * Returns the app version
98
+ *
99
+ * @param {object|sap.ui.core.Manifest} oManifest - Manifest of the component
100
+ * @returns {string} Version of application if it is available in the manifest, otherwise an empty string
101
+ *
102
+ * @private
103
+ * @ui5-restricted sap.ui.fl, sap.ui.rta
104
+ */
105
+ getAppVersionFromManifest,
106
+
87
107
  getFlexReference,
88
108
 
89
109
  /**
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  *
17
17
  * @namespace sap.ui.fl.apply._internal.flexState.UI2Personalization.UI2PersonalizationState
18
18
  * @since 1.75
19
- * @version 1.120.6
19
+ * @version 1.121.0
20
20
  * @private
21
21
  * @ui5-restricted
22
22
  */