@openui5/sap.ui.fl 1.127.0 → 1.128.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 (165) hide show
  1. package/package.json +3 -3
  2. package/src/sap/ui/fl/.library +1 -1
  3. package/src/sap/ui/fl/ChangePersistence.js +37 -47
  4. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  5. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  6. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  7. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  8. package/src/sap/ui/fl/FlexController.js +11 -9
  9. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  10. package/src/sap/ui/fl/LayerUtils.js +1 -1
  11. package/src/sap/ui/fl/Utils.js +17 -12
  12. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  13. package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +3 -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 +1 -1
  17. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +2 -1
  18. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +3 -1
  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/AddNewInbound.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.js +75 -0
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +76 -0
  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/SetAch.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.js +44 -0
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetCloudDevAdaptationStatus.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +56 -9
  39. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +66 -0
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  48. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
  49. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +12 -1
  51. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +41 -1
  55. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +39 -39
  56. package/src/sap/ui/fl/apply/_internal/flexState/InitialPrepareFunctions.js +3 -0
  57. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  58. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  59. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  60. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  61. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  62. package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
  63. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +9 -2
  64. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/Utils.js +2 -2
  65. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
  66. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +1 -1
  67. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.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/changeHandler/AddIFrame.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  72. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  73. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +13 -4
  76. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  78. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  82. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  83. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  84. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  85. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  86. package/src/sap/ui/fl/descriptorRelated/Utils.js +19 -0
  87. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  88. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  89. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  90. package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
  91. package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
  92. package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
  93. package/src/sap/ui/fl/initial/_internal/StorageResultMerger.js +1 -0
  94. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +2 -1
  95. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
  96. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  97. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  98. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  99. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  100. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  101. package/src/sap/ui/fl/library.js +43 -43
  102. package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +9 -59
  103. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  104. package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +53 -0
  105. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  106. package/src/sap/ui/fl/support/api/SupportAPI.js +56 -5
  107. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  108. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  109. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  110. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  111. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  112. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  113. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  114. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  115. package/src/sap/ui/fl/util/IFrame.js +1 -1
  116. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  117. package/src/sap/ui/fl/util/changePropertyValueByPath.js +13 -2
  118. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  119. package/src/sap/ui/fl/variants/VariantManagement.js +23 -14
  120. package/src/sap/ui/fl/variants/VariantModel.js +7 -6
  121. package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saptrc.properties +12 -12
  122. package/src/sap/ui/fl/write/_internal/SaveAs.js +11 -12
  123. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  124. package/src/sap/ui/fl/write/_internal/Versions.js +8 -68
  125. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  126. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  127. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  128. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +65 -16
  129. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
  130. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  132. package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
  133. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
  134. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
  135. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  136. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  137. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  138. package/src/sap/ui/fl/write/_internal/connectors/SessionStorageConnector.js +1 -0
  139. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  141. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  142. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  143. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  144. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  145. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  146. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  147. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  148. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  149. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  150. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  151. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  152. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  153. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  154. package/src/sap/ui/fl/write/_internal/flexState/{FlexObjectState.js → FlexObjectManager.js} +26 -56
  155. package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  156. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +9 -6
  157. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  158. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  159. package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +6 -6
  160. package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +4 -2
  161. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  162. package/src/sap/ui/fl/write/api/LocalResetAPI.js +3 -4
  163. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +8 -8
  164. package/src/sap/ui/fl/write/api/TranslationAPI.js +6 -6
  165. package/src/sap/ui/fl/write/api/VersionsAPI.js +34 -9
@@ -10,9 +10,11 @@ sap.ui.define([
10
10
  "sap/ui/core/util/reflection/JsControlTreeModifier",
11
11
  "sap/ui/core/Element",
12
12
  "sap/ui/fl/apply/_internal/changes/Utils",
13
+ "sap/ui/fl/apply/_internal/flexObjects/States",
13
14
  "sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
14
15
  "sap/ui/fl/apply/_internal/flexState/changes/UIChangesState",
15
16
  "sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
17
+ "sap/ui/fl/apply/_internal/flexState/DataSelector",
16
18
  "sap/ui/fl/apply/_internal/flexState/FlexState",
17
19
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
18
20
  "sap/ui/fl/Utils"
@@ -22,9 +24,11 @@ sap.ui.define([
22
24
  JsControlTreeModifier,
23
25
  Element,
24
26
  ChangesUtils,
27
+ States,
25
28
  DependencyHandler,
26
29
  UIChangesState,
27
30
  VariantManagementState,
31
+ DataSelector,
28
32
  FlexState,
29
33
  ManifestUtils,
30
34
  Utils
@@ -35,12 +39,23 @@ sap.ui.define([
35
39
  * @namespace
36
40
  * @alias sap.ui.fl.apply._internal.flexState.FlexObjectState
37
41
  * @since 1.83
38
- * @version 1.127.0
42
+ * @version 1.128.0
39
43
  * @private
40
44
  * @ui5-restricted sap.ui.fl
41
45
  */
42
46
  const FlexObjectState = {};
43
47
 
48
+ // TODO: Think about a second DataSelector in the FlexState without any runtime FlexObjects
49
+ const oAllDirtyFlexObjectsDataSelector = new DataSelector({
50
+ id: "allDirtyFlexObjects",
51
+ parentDataSelector: FlexState.getFlexObjectsDataSelector(),
52
+ executeFunction(aFlexObjects) {
53
+ return aFlexObjects.filter((oFlexObject) => {
54
+ return oFlexObject.getState() !== States.LifecycleState.PERSISTED;
55
+ });
56
+ }
57
+ });
58
+
44
59
  function getCompleteDependency(oChange, sReference) {
45
60
  const mInitialDependencies = FlexObjectState.getCompleteDependencyMap(sReference).mDependencies;
46
61
  return mInitialDependencies[oChange.getId()] && Object.assign({}, mInitialDependencies[oChange.getId()]);
@@ -245,5 +260,30 @@ sap.ui.define([
245
260
  }));
246
261
  };
247
262
 
263
+ function getCompVariantEntities(sReference) {
264
+ const aEntities = [];
265
+ const mCompEntities = FlexState.getCompVariantsMap(sReference);
266
+ for (const sPersistencyKey in mCompEntities) {
267
+ const mCompVariantsOfPersistencyKey = mCompEntities[sPersistencyKey];
268
+ for (const sId in mCompVariantsOfPersistencyKey.byId) {
269
+ aEntities.push(mCompVariantsOfPersistencyKey.byId[sId]);
270
+ }
271
+ }
272
+ return aEntities;
273
+ }
274
+
275
+ /**
276
+ * Collects modified changes from the different states within the <code>sap.ui.fl</code> library.
277
+ * TODO: remove special CompVariant handling
278
+ *
279
+ * @param {object} sReference - Flex Reference
280
+ * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} All dirty Flex objects
281
+ */
282
+ FlexObjectState.getDirtyFlexObjects = function(sReference) {
283
+ const aCompVariantEntities = getCompVariantEntities(sReference);
284
+ return oAllDirtyFlexObjectsDataSelector.get({reference: sReference})
285
+ .concat(aCompVariantEntities.filter((oFlexObject) => oFlexObject.getState() !== States.LifecycleState.PERSISTED));
286
+ };
287
+
248
288
  return FlexObjectState;
249
289
  });
@@ -21,8 +21,7 @@ sap.ui.define([
21
21
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
22
22
  "sap/ui/fl/initial/_internal/FlexInfoSession",
23
23
  "sap/ui/fl/initial/_internal/StorageUtils",
24
- "sap/ui/fl/LayerUtils",
25
- "sap/ui/fl/requireAsync"
24
+ "sap/ui/fl/LayerUtils"
26
25
  ], function(
27
26
  _omit,
28
27
  Deferred,
@@ -40,12 +39,12 @@ sap.ui.define([
40
39
  ManifestUtils,
41
40
  FlexInfoSession,
42
41
  StorageUtils,
43
- LayerUtils,
44
- requireAsync
42
+ LayerUtils
45
43
  ) {
46
44
  "use strict";
47
45
 
48
46
  const sAppDescriptorNamespace = "sap.ui.fl.apply._internal.flexObjects.AppDescriptorChange";
47
+ const sAnnotationNamespace = "sap.ui.fl.apply._internal.flexObjects.AnnotationChange";
49
48
 
50
49
  /**
51
50
  * Flex state class to persist maps and raw state (cache) for a given component reference.
@@ -57,6 +56,8 @@ sap.ui.define([
57
56
  * },
58
57
  * storageResponse: {
59
58
  * changes: {
59
+ * annotationChanges: [...],
60
+ * appDescriptorChanges: [...],
60
61
  * changes: [...],
61
62
  * comp: {
62
63
  * variants: [...],
@@ -88,7 +89,7 @@ sap.ui.define([
88
89
  *
89
90
  * @namespace sap.ui.fl.apply._internal.flexState.FlexState
90
91
  * @since 1.73
91
- * @version 1.127.0
92
+ * @version 1.128.0
92
93
  * @private
93
94
  * @ui5-restricted sap.ui.fl.apply._internal
94
95
  */
@@ -96,11 +97,13 @@ sap.ui.define([
96
97
 
97
98
  var _mInstances = {};
98
99
  var _mInitPromises = {};
99
- var _oChangePersistenceFactory;
100
100
  var _mFlexObjectInfo = {
101
101
  appDescriptorChanges: {
102
102
  pathInResponse: []
103
103
  },
104
+ annotationChanges: {
105
+ pathInResponse: []
106
+ },
104
107
  changes: {
105
108
  initialPreparationFunctionName: "uiChanges",
106
109
  pathInResponse: ["changes"]
@@ -225,6 +228,20 @@ sap.ui.define([
225
228
  }
226
229
  });
227
230
 
231
+ const oAnnotationChangesDataSelector = new DataSelector({
232
+ id: "annotationChanges",
233
+ parentDataSelector: oFlexObjectsDataSelector,
234
+ executeFunction(aFlexObjects) {
235
+ return aFlexObjects.filter((oFlexObject) => {
236
+ return oFlexObject.isA(sAnnotationNamespace);
237
+ });
238
+ },
239
+ checkInvalidation(mParameters, oUpdateInfo) {
240
+ const bRelevantType = ["addFlexObject", "removeFlexObject"].includes(oUpdateInfo.type);
241
+ return bRelevantType && oUpdateInfo.updatedObject?.isA(sAnnotationNamespace);
242
+ }
243
+ });
244
+
228
245
  function getInstanceEntryOrThrowError(sReference, sMapName) {
229
246
  if (!_mInstances[sReference]) {
230
247
  initializeEmptyState(sReference);
@@ -433,17 +450,6 @@ sap.ui.define([
433
450
  }
434
451
  }
435
452
 
436
- // TODO: get rid of the following module dependencies as soon as the change state
437
- // is migrated from changePersistenceFactory to the FlexState
438
- function lazyLoadModules() {
439
- return requireAsync("sap/ui/fl/ChangePersistenceFactory").then(function(oModule) {
440
- _oChangePersistenceFactory = oModule;
441
- })
442
- .catch(function(oError) {
443
- Log.error(`Error loading modules: ${oError.message}`);
444
- });
445
- }
446
-
447
453
  function rebuildResponseIfMaxLayerChanged(sReference) {
448
454
  if (_mInstances[sReference]?.maxLayer !== FlexInfoSession.getByReference(sReference).maxLayer) {
449
455
  FlexState.rebuildFilteredResponse(sReference);
@@ -495,10 +501,8 @@ sap.ui.define([
495
501
  const sFlexReference = mProperties.reference;
496
502
 
497
503
  const oOldInitPromise = _mInitPromises[sFlexReference];
498
- // TODO: Switch to native promises once lazyLoadModules is removed, todos#2
499
504
  const oNewInitPromise = new Deferred();
500
505
  _mInitPromises[sFlexReference] = oNewInitPromise;
501
- await lazyLoadModules();
502
506
 
503
507
  if (oOldInitPromise) {
504
508
  await oOldInitPromise.promise;
@@ -565,15 +569,6 @@ sap.ui.define([
565
569
  var sReference = mPropertyBag.reference;
566
570
  var oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
567
571
 
568
- // TODO: get rid of the following persistence operations as soon as the change state
569
- // is migrated from ChangePersistenceFactory to the FlexState
570
- if (
571
- _oChangePersistenceFactory
572
- && (_oChangePersistenceFactory._instanceCache || {}).hasOwnProperty(sReference)
573
- ) {
574
- _oChangePersistenceFactory._instanceCache[sReference].removeDirtyChanges();
575
- }
576
-
577
572
  const oOldInitPromise = _mInitPromises[sReference].promise;
578
573
  const oNewInitPromise = new Deferred();
579
574
  _mInitPromises[sReference] = oNewInitPromise;
@@ -610,6 +605,8 @@ sap.ui.define([
610
605
  return "variantManagementChanges";
611
606
  case "variant":
612
607
  return ["comp", "variants"];
608
+ case "annotation_change":
609
+ return "annotationChanges";
613
610
  default:
614
611
  return "";
615
612
  }
@@ -675,14 +672,6 @@ sap.ui.define([
675
672
 
676
673
  FlexState.clearState = function(sReference) {
677
674
  if (sReference) {
678
- // TODO: get rid of the following deletes as soon as the change state
679
- // is migrated from changePersistenceFactory to the FlexState
680
- if (
681
- _oChangePersistenceFactory
682
- && (_oChangePersistenceFactory._instanceCache || {}).hasOwnProperty(sReference)
683
- ) {
684
- _oChangePersistenceFactory._instanceCache[sReference].removeDirtyChanges();
685
- }
686
675
  delete _mInstances[sReference];
687
676
  delete _mInitPromises[sReference];
688
677
  oFlexObjectsDataSelector.clearCachedResult({ reference: sReference });
@@ -721,6 +710,8 @@ sap.ui.define([
721
710
  * @param {object} oFlexObject - Flex object to be added as runtime-steady
722
711
  */
723
712
  FlexState.addRuntimeSteadyObject = function(sReference, sComponentId, oFlexObject) {
713
+ // with setting the state to persisted it is made sure that they not show up as a dirty flex object
714
+ oFlexObject.setState(States.LifecycleState.PERSISTED);
724
715
  _mExternalData.flexObjects[sReference] ||= {};
725
716
  _mExternalData.flexObjects[sReference][sComponentId] ||= [];
726
717
  _mExternalData.flexObjects[sReference][sComponentId].push(oFlexObject);
@@ -778,11 +769,12 @@ sap.ui.define([
778
769
  const sAdaptationLayer = FlexInfoSession.getByReference(sReference).adaptationLayer;
779
770
  const bFlexObjectsOverAdaptationLayer = !!sAdaptationLayer
780
771
  && LayerUtils.isOverLayer(oFlexObject.getLayer(), sAdaptationLayer);
772
+ const bAlreadyInRuntimePersistence = _mInstances[sReference].runtimePersistence.flexObjects.includes(oFlexObject);
781
773
  // FIXME: Currently called from the ChangePersistence which might be
782
774
  // independent of FlexState in some test cases
783
775
  // Once the ChangePersistence is no longer used
784
776
  // make sure to remove the safeguard
785
- if (!bFlexObjectsOverAdaptationLayer && _mInstances[sReference]) {
777
+ if (!bFlexObjectsOverAdaptationLayer && _mInstances[sReference] && !bAlreadyInRuntimePersistence) {
786
778
  _mInstances[sReference].runtimePersistence.flexObjects.push(oFlexObject);
787
779
  oFlexObjectsDataSelector.checkUpdate(
788
780
  { reference: sReference },
@@ -802,8 +794,12 @@ sap.ui.define([
802
794
  initializeEmptyState(sReference);
803
795
  }
804
796
  const sAdaptationLayer = FlexInfoSession.getByReference(sReference).adaptationLayer;
805
- aFlexObjects = !sAdaptationLayer ? aFlexObjects : aFlexObjects
806
- .filter((oFlexObject) => !LayerUtils.isOverLayer(oFlexObject.getLayer(), sAdaptationLayer));
797
+ aFlexObjects = aFlexObjects
798
+ .filter((oFlexObject) => !sAdaptationLayer || !LayerUtils.isOverLayer(oFlexObject.getLayer(), sAdaptationLayer))
799
+ .filter((oFlexObject) => (
800
+ !_mInstances[sReference].runtimePersistence.flexObjects
801
+ .some((oExistingFlexObject) => (oExistingFlexObject.getId() === oFlexObject.getId()))
802
+ ));
807
803
 
808
804
  if (aFlexObjects.length > 0 && _mInstances[sReference]) {
809
805
  _mInstances[sReference].runtimePersistence.flexObjects =
@@ -873,6 +869,10 @@ sap.ui.define([
873
869
  return oAppDescriptorChangesDataSelector.get({ reference: sReference });
874
870
  };
875
871
 
872
+ FlexState.getAnnotationChanges = function(sReference) {
873
+ return oAnnotationChangesDataSelector.get({ reference: sReference });
874
+ };
875
+
876
876
  FlexState.getUI2Personalization = function(sReference) {
877
877
  return merge({}, _mInstances[sReference].unfilteredStorageResponse.changes.ui2personalization);
878
878
  };
@@ -8,6 +8,7 @@ sap.ui.define([
8
8
  "sap/ui/fl/apply/_internal/controlVariants/Utils",
9
9
  "sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
10
10
  "sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor",
11
+ "sap/ui/fl/apply/_internal/flexObjects/States",
11
12
  "sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
12
13
  "sap/ui/fl/Layer"
13
14
  ], function(
@@ -15,6 +16,7 @@ sap.ui.define([
15
16
  ControlVariantUtils,
16
17
  FlexObjectFactory,
17
18
  getVariantAuthor,
19
+ States,
18
20
  DependencyHandler,
19
21
  Layer
20
22
  ) {
@@ -90,6 +92,7 @@ sap.ui.define([
90
92
  user: ControlVariantUtils.DEFAULT_AUTHOR,
91
93
  reference: oFlexObject.reference
92
94
  });
95
+ oNewVariant.setState(States.LifecycleState.PERSISTED);
93
96
  oUpdate.runtimeOnlyData.flexObjects.push(oNewVariant);
94
97
  aVariantIds.push(sVariantReference);
95
98
  }
@@ -102,7 +102,7 @@ sap.ui.define([
102
102
  *
103
103
  * @namespace sap.ui.fl.apply._internal.flexState.Loader
104
104
  * @since 1.74
105
- * @version 1.127.0
105
+ * @version 1.128.0
106
106
  * @private
107
107
  * @ui5-restricted sap.ui.fl.apply._internal.flexState
108
108
  */
@@ -78,7 +78,7 @@ function(
78
78
  *
79
79
  * @namespace sap.ui.fl.apply._internal.flexState.ManifestUtils
80
80
  * @since 1.74
81
- * @version 1.127.0
81
+ * @version 1.128.0
82
82
  * @private
83
83
  */
84
84
  var ManifestUtils = {
@@ -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.127.0
19
+ * @version 1.128.0
20
20
  * @private
21
21
  * @ui5-restricted
22
22
  */
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  *
21
21
  * @namespace sap.ui.fl.apply._internal.flexState.changes.DependencyHandler
22
22
  * @since 1.74
23
- * @version 1.127.0
23
+ * @version 1.128.0
24
24
  * @private
25
25
  * @ui5-restricted sap.ui.fl
26
26
  */
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  *
42
42
  * @namespace sap.ui.fl.apply._internal.flexState.changes.ExtensionPointState
43
43
  * @since 1.79
44
- * @version 1.127.0
44
+ * @version 1.128.0
45
45
  * @private
46
46
  * @ui5-restricted
47
47
  */
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @namespace
25
25
  * @alias sap.ui.fl.apply._internal.flexState.changes.UIChangesState
26
26
  * @since 1.121
27
- * @version 1.127.0
27
+ * @version 1.128.0
28
28
  * @private
29
29
  * @ui5-restricted
30
30
  */
@@ -7,11 +7,13 @@
7
7
  sap.ui.define([
8
8
  "sap/ui/fl/apply/_internal/flexObjects/CompVariant",
9
9
  "sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
10
+ "sap/ui/fl/apply/_internal/flexObjects/States",
10
11
  "sap/ui/fl/apply/_internal/flexState/compVariants/Utils",
11
12
  "sap/base/Log"
12
13
  ], function(
13
14
  CompVariant,
14
15
  FlexObjectFactory,
16
+ States,
15
17
  CompVariantUtils,
16
18
  Log
17
19
  ) {
@@ -123,7 +125,7 @@ sap.ui.define([
123
125
  *
124
126
  * @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
125
127
  * @since 1.86
126
- * @version 1.127.0
128
+ * @version 1.128.0
127
129
  * @private
128
130
  * @ui5-restricted sap.ui.fl
129
131
  */
@@ -150,6 +152,11 @@ sap.ui.define([
150
152
  });
151
153
  }
152
154
 
155
+ // with setting the state to persisted it is made sure that they not show up as a dirty flex object
156
+ (mCompData.nonPersistedVariants.concat([oStandardVariant])).forEach((oVariant) => {
157
+ oVariant.setState(States.LifecycleState.PERSISTED);
158
+ });
159
+
153
160
  // apply all changes on non-standard variants
154
161
  aVariants.forEach(applyChangesOnVariant.bind(undefined, mChanges));
155
162
 
@@ -208,7 +215,7 @@ sap.ui.define([
208
215
  *
209
216
  * @function
210
217
  * @since 1.89
211
- * @version 1.127.0
218
+ * @version 1.128.0
212
219
  * @private
213
220
  * @ui5-restricted sap.ui.fl
214
221
  *
@@ -34,8 +34,8 @@ sap.ui.define([], function() {
34
34
  if (oChange?.getContent().defaultVariantName === "*standard*") {
35
35
  return true;
36
36
  }
37
- return mCompVariantsMap.variants.some((oVariant) => {
38
- return oChange?.getContent().defaultVariantName === oVariant.getId();
37
+ return Object.keys(mCompVariantsMap.byId).some((sId) => {
38
+ return oChange?.getContent().defaultVariantName === sId;
39
39
  });
40
40
  });
41
41
  return oChange?.getContent().defaultVariantName || "";
@@ -77,7 +77,7 @@ sap.ui.define([
77
77
  *
78
78
  * @namespace sap.ui.fl.apply._internal.flexState.controlVariants.Switcher
79
79
  * @since 1.74
80
- * @version 1.127.0
80
+ * @version 1.128.0
81
81
  * @private
82
82
  * @ui5-restricted
83
83
  */
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  *
33
33
  * @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
34
34
  * @since 1.74
35
- * @version 1.127.0
35
+ * @version 1.128.0
36
36
  * @private
37
37
  * @ui5-restricted
38
38
  */
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @class
27
27
  * @constructor
28
28
  * @author SAP SE
29
- * @version 1.127.0
29
+ * @version 1.128.0
30
30
  * @since 1.27.0
31
31
  * @private
32
32
  * @ui5-restricted sap.ui.fl, sap.ui.core
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @class
41
41
  * @constructor
42
42
  * @author SAP SE
43
- * @version 1.127.0
43
+ * @version 1.128.0
44
44
  * @since 1.43.0
45
45
  * @private
46
46
  */
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @class
39
39
  * @constructor
40
40
  * @author SAP SE
41
- * @version 1.127.0
41
+ * @version 1.128.0
42
42
  * @since 1.27.0
43
43
  * @private
44
44
  */
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @alias sap.ui.fl.changeHandler.AddIFrame
24
24
  * @author SAP SE
25
- * @version 1.127.0
25
+ * @version 1.128.0
26
26
  * @since 1.72
27
27
  * @private
28
28
  */
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  *
17
17
  * @alias sap.ui.fl.changeHandler.AddXML
18
18
  * @author SAP SE
19
- * @version 1.127.0
19
+ * @version 1.128.0
20
20
  * @since 1.54
21
21
  * @private
22
22
  */
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  *
19
19
  * @alias sap.ui.fl.changeHandler.AddXMLAtExtensionPoint
20
20
  * @author SAP SE
21
- * @version 1.127.0
21
+ * @version 1.128.0
22
22
  * @since 1.75
23
23
  * @private
24
24
  */
@@ -14,7 +14,7 @@ sap.ui.define([
14
14
  /**
15
15
  * Base functionality for all change handlers, which provides some reuse methods
16
16
  * @namespace sap.ui.fl.changeHandler.Base
17
- * @version 1.127.0
17
+ * @version 1.128.0
18
18
  * @private
19
19
  * @ui5-restricted change handlers
20
20
  */
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @constructor
30
30
  * @alias sap.ui.fl.changeHandler.BaseAddViaDelegate
31
31
  * @author SAP SE
32
- * @version 1.127.0
32
+ * @version 1.128.0
33
33
  * @private
34
34
  * @ui5-restricted change handlers
35
35
  */
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @alias sap.ui.fl.changeHandler.BaseAddXml
24
24
  * @author SAP SE
25
- * @version 1.127.0
25
+ * @version 1.128.0
26
26
  * @since 1.75
27
27
  * @private
28
28
  * @ui5-restricted change handlers
@@ -62,7 +62,15 @@ sap.ui.define([
62
62
  aNewControls.forEach(function(oNewControl, iIterator) {
63
63
  var fnPromise = function() {
64
64
  return Promise.resolve()
65
- .then(oModifier.insertAggregation.bind(oModifier, oControl, sAggregationName, oNewControl, iIndex + iIterator, oView, mChangeInfo.skipAdjustIndex))
65
+ .then(oModifier.insertAggregation.bind(
66
+ oModifier,
67
+ oControl,
68
+ sAggregationName,
69
+ oNewControl,
70
+ iIndex + iIterator,
71
+ oView,
72
+ mChangeInfo.skipAdjustIndex
73
+ ))
66
74
  .then(function() {
67
75
  aRevertData.push({
68
76
  id: oModifier.getId(oNewControl),
@@ -72,7 +80,7 @@ sap.ui.define([
72
80
  };
73
81
  aPromises.push(fnPromise);
74
82
  });
75
- return FlUtils.execPromiseQueueSequentially(aPromises, true, true)
83
+ return FlUtils.execPromiseQueueSequentially(aPromises, true, true, true)
76
84
  .then(function() {
77
85
  oChange.setRevertData(aRevertData);
78
86
  return aNewControls;
@@ -107,11 +115,12 @@ sap.ui.define([
107
115
  BaseAddXml._destroyArrayOfControls(aNewControls);
108
116
  return Promise.reject(new Error(`The content of the xml fragment does not match the type of the targetAggregation: ${oAggregationDefinition.type}`));
109
117
  }
118
+ return undefined;
110
119
  });
111
120
  };
112
121
  aPromises.push(fnPromise);
113
122
  });
114
- return FlUtils.execPromiseQueueSequentially(aPromises, true, true)
123
+ return FlUtils.execPromiseQueueSequentially(aPromises, true, true, true)
115
124
  .then(fnAddControls);
116
125
  });
117
126
  };
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * @constructor
18
18
  * @alias sap.ui.fl.changeHandler.BaseRename
19
19
  * @author SAP SE
20
- * @version 1.127.0
20
+ * @version 1.128.0
21
21
  * @since 1.46
22
22
  *
23
23
  * @private
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * Change handler for hiding of a control.
22
22
  * @alias sap.ui.fl.changeHandler.HideControl
23
23
  * @author SAP SE
24
- * @version 1.127.0
24
+ * @version 1.128.0
25
25
  * @since 1.27.0
26
26
  */
27
27
  var HideControl = {};
@@ -19,7 +19,7 @@ function(
19
19
  *
20
20
  * @alias sap.ui.fl.changeHandler.MoveControls
21
21
  * @author SAP SE
22
- * @version 1.127.0
22
+ * @version 1.128.0
23
23
  * @since 1.46
24
24
  */
25
25
  var MoveControls = { };
@@ -12,7 +12,7 @@ sap.ui.define([], function() {
12
12
  *
13
13
  * @alias sap.ui.fl.changeHandler.MoveElements
14
14
  * @author SAP SE
15
- * @version 1.127.0
15
+ * @version 1.128.0
16
16
  * @since 1.34.0
17
17
  */
18
18
  var MoveElements = { };
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  *
19
19
  * @alias sap.ui.fl.changeHandler.PropertyBindingChange
20
20
  * @author SAP SE
21
- * @version 1.127.0
21
+ * @version 1.128.0
22
22
  * @since 1.38
23
23
  * @private
24
24
  */
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @alias sap.ui.fl.changeHandler.PropertyChange
24
24
  * @author SAP SE
25
- * @version 1.127.0
25
+ * @version 1.128.0
26
26
  * @since 1.36
27
27
  * @private
28
28
  */
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * Change handler for stashing of a control.
20
20
  * @alias sap.ui.fl.changeHandler.StashControl
21
21
  * @author SAP SE
22
- * @version 1.127.0
22
+ * @version 1.128.0
23
23
  * @since 1.27.0
24
24
  */
25
25
  var StashControl = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * Change handler for unhiding of a control.
20
20
  * @alias sap.ui.fl.changeHandler.UnhideControl
21
21
  * @author SAP SE
22
- * @version 1.127.0
22
+ * @version 1.128.0
23
23
  * @since 1.27.0
24
24
  */
25
25
  var UnhideControl = {};
@@ -15,7 +15,7 @@ sap.ui.define([
15
15
  * Change handler for unstashing of a control.
16
16
  * @alias sap.ui.fl.changeHandler.UnstashControl
17
17
  * @author SAP SE
18
- * @version 1.127.0
18
+ * @version 1.128.0
19
19
  * @since 1.27.0
20
20
  */
21
21
  var UnstashControl = {};
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  *
19
19
  * @alias sap.ui.fl.changeHandler.UpdateIFrame
20
20
  * @author SAP SE
21
- * @version 1.127.0
21
+ * @version 1.128.0
22
22
  * @since 1.72
23
23
  * @private
24
24
  */