@openui5/sap.ui.fl 1.121.4 → 1.121.5

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 (143) 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 +1 -2
  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 +10 -6
  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 +1 -1
  12. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  13. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  14. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
  15. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  16. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  17. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  18. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  19. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +74 -60
  48. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  49. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  51. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  55. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +11 -30
  56. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +6 -2
  57. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  58. package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
  59. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
  60. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  61. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  62. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  63. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  64. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  65. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  66. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  67. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  70. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  72. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  73. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  76. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  78. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  79. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  80. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  81. package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
  82. package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
  83. package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
  84. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  85. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
  86. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  87. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  88. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  89. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  90. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  91. package/src/sap/ui/fl/library.js +43 -43
  92. package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
  93. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  94. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  95. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  96. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  97. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  98. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  99. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  100. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  101. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  102. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  103. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  104. package/src/sap/ui/fl/util/IFrame.js +1 -1
  105. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  106. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  107. package/src/sap/ui/fl/variants/VariantModel.js +18 -1
  108. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  109. package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
  110. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  111. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  112. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  113. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
  114. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
  115. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  116. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  117. package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
  118. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
  119. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
  120. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  121. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  122. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  123. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  124. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  125. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  126. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  127. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  128. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  129. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  130. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  132. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  133. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  134. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  135. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  136. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  137. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  138. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +1 -1
  139. package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +5 -1
  141. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  142. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  143. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
@@ -6,6 +6,7 @@
6
6
 
7
7
  sap.ui.define([
8
8
  "sap/base/util/restricted/_omit",
9
+ "sap/base/util/Deferred",
9
10
  "sap/base/util/each",
10
11
  "sap/base/util/merge",
11
12
  "sap/base/util/ObjectPath",
@@ -24,6 +25,7 @@ sap.ui.define([
24
25
  "sap/ui/fl/requireAsync"
25
26
  ], function(
26
27
  _omit,
28
+ Deferred,
27
29
  each,
28
30
  merge,
29
31
  ObjectPath,
@@ -83,7 +85,7 @@ sap.ui.define([
83
85
  *
84
86
  * @namespace sap.ui.fl.apply._internal.flexState.FlexState
85
87
  * @since 1.73
86
- * @version 1.121.4
88
+ * @version 1.121.5
87
89
  * @private
88
90
  * @ui5-restricted sap.ui.fl.apply._internal
89
91
  */
@@ -352,30 +354,25 @@ sap.ui.define([
352
354
  return mFilteredReturn;
353
355
  }
354
356
 
355
- function loadFlexData(mPropertyBag) {
356
- _mInitPromises[mPropertyBag.reference] = Loader.loadFlexData(mPropertyBag)
357
- .then(async (mResponse) => {
358
- mResponse.authors = await Loader.loadVariantsAuthors(mPropertyBag.reference);
359
- return mResponse;
360
- }).then((mResponse) => {
361
- // The following line is used by the Flex Support Tool to set breakpoints - please adjust the tool if you change it!
362
- _mInstances[mPropertyBag.reference] = merge({}, {
363
- unfilteredStorageResponse: mResponse,
364
- preparedMaps: {},
365
- componentId: mPropertyBag.componentId,
366
- componentData: mPropertyBag.componentData,
367
- partialFlexState: mPropertyBag.partialFlexState
368
- });
369
-
370
- storeInfoInSession(mPropertyBag.reference, mResponse);
371
-
372
- // no further changes to storageResponse properties allowed
373
- Object.freeze(_mInstances[mPropertyBag.reference].storageResponse);
374
- Object.freeze(_mInstances[mPropertyBag.reference].unfilteredStorageResponse);
375
- return mResponse;
357
+ async function loadFlexData(mPropertyBag) {
358
+ const mResponse = await Loader.loadFlexData(mPropertyBag);
359
+ mResponse.authors = await Loader.loadVariantsAuthors(mPropertyBag.reference);
360
+
361
+ // The following line is used by the Flex Support Tool to set breakpoints - please adjust the tool if you change it!
362
+ _mInstances[mPropertyBag.reference] = merge({}, {
363
+ unfilteredStorageResponse: mResponse,
364
+ preparedMaps: {},
365
+ componentId: mPropertyBag.componentId,
366
+ componentData: mPropertyBag.componentData,
367
+ partialFlexState: mPropertyBag.partialFlexState
376
368
  });
377
369
 
378
- return _mInitPromises[mPropertyBag.reference];
370
+ storeInfoInSession(mPropertyBag.reference, mResponse);
371
+
372
+ // no further changes to storageResponse properties allowed
373
+ Object.freeze(_mInstances[mPropertyBag.reference].storageResponse);
374
+ Object.freeze(_mInstances[mPropertyBag.reference].unfilteredStorageResponse);
375
+ return mResponse;
379
376
  }
380
377
 
381
378
  function storeInfoInSession(sReference, mResponse) {
@@ -438,30 +435,45 @@ sap.ui.define([
438
435
  * @param {boolean} [mPropertyBag.partialFlexState=false] - if true state is initialized partially and does not include flex bundles
439
436
  * @returns {Promise<undefined>} Resolves a promise as soon as FlexState is initialized
440
437
  */
441
- FlexState.initialize = function(mPropertyBag) {
442
- return Promise.all([
443
- lazyLoadModules()
444
- ])
445
- .then(function() {
446
- enhancePropertyBag(mPropertyBag);
447
- var sFlexReference = mPropertyBag.reference;
448
-
449
- if (_mInitPromises[sFlexReference]) {
450
- return _mInitPromises[sFlexReference]
451
- .then(checkPartialFlexState.bind(null, mPropertyBag))
452
- .then(checkComponentId)
453
- .then(function(mEvaluatedProperties) {
454
- return mEvaluatedProperties.reInitialize
455
- ? loadFlexData(mEvaluatedProperties)
456
- : _mInstances[sFlexReference].unfilteredStorageResponse;
457
- });
438
+ FlexState.initialize = async function(mPropertyBag) {
439
+ enhancePropertyBag(mPropertyBag);
440
+ const sFlexReference = mPropertyBag.reference;
441
+
442
+ const oOldInitPromise = _mInitPromises[sFlexReference];
443
+ const oNewInitPromise = new Deferred();
444
+ _mInitPromises[sFlexReference] = oNewInitPromise;
445
+ await lazyLoadModules();
446
+
447
+ if (oOldInitPromise) {
448
+ await oOldInitPromise.promise;
449
+ checkPartialFlexState(mPropertyBag);
450
+ checkComponentId(mPropertyBag);
451
+ if (mPropertyBag.reInitialize) {
452
+ await loadFlexData(mPropertyBag);
458
453
  }
454
+ } else {
455
+ await loadFlexData(mPropertyBag);
456
+ }
459
457
 
460
- return loadFlexData(mPropertyBag);
461
- })
462
- .then(function(mPropertyBag) {
463
- initializeNewInstance(mPropertyBag);
464
- }.bind(null, mPropertyBag));
458
+ initializeNewInstance(mPropertyBag);
459
+ oNewInitPromise.resolve();
460
+ };
461
+
462
+ /**
463
+ * Waits until the FlexState is initialized
464
+ * This is only necessary if <code>FlexState.initialize</code> cannot be called directly
465
+ * due to missing information for the backend request (e.g. asyncHints)
466
+ *
467
+ * @param {string} sFlexReference - Flex reference of the app
468
+ * @returns {Promise<undefined>} Promise that resolves as soon as FlexState is initialized
469
+ */
470
+ FlexState.waitForInitialization = function(sFlexReference) {
471
+ const oInitPromise = _mInitPromises[sFlexReference]?.promise;
472
+ if (!oInitPromise) {
473
+ Log.error("FlexState.waitForInitialization was called before FlexState.initialize");
474
+ return Promise.resolve();
475
+ }
476
+ return oInitPromise;
465
477
  };
466
478
 
467
479
  /**
@@ -507,7 +519,7 @@ sap.ui.define([
507
519
  * @param {string} [mPropertyBag.adaptationId] - Context-based adaptation for which the state should be updated
508
520
  * @returns {Promise<undefined>} Resolves when the data is loaded and the runtime persistence is updated
509
521
  */
510
- FlexState.update = function(mPropertyBag) {
522
+ FlexState.update = async function(mPropertyBag) {
511
523
  enhancePropertyBag(mPropertyBag);
512
524
  var sReference = mPropertyBag.reference;
513
525
  var oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
@@ -521,19 +533,21 @@ sap.ui.define([
521
533
  _oChangePersistenceFactory._instanceCache[sReference].removeDirtyChanges();
522
534
  }
523
535
 
524
- return (_mInitPromises[sReference] || Promise.resolve())
525
- .then(loadFlexData.bind(this, mPropertyBag))
526
- .then(function() {
527
- _mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
528
- var bUpdated = updateRuntimePersistence(
529
- sReference,
530
- _mInstances[sReference].storageResponse,
531
- oCurrentRuntimePersistence
532
- );
533
- if (bUpdated) {
534
- oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
535
- }
536
- });
536
+ const oOldInitPromise = _mInitPromises[sReference].promise;
537
+ const oNewInitPromise = new Deferred();
538
+ _mInitPromises[sReference] = oNewInitPromise;
539
+ await oOldInitPromise;
540
+ await loadFlexData(mPropertyBag);
541
+ oNewInitPromise.resolve();
542
+ _mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
543
+ var bUpdated = updateRuntimePersistence(
544
+ sReference,
545
+ _mInstances[sReference].storageResponse,
546
+ oCurrentRuntimePersistence
547
+ );
548
+ if (bUpdated) {
549
+ oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
550
+ }
537
551
  };
538
552
 
539
553
  function getChangeCategory(oChangeDefinition) {
@@ -826,7 +840,7 @@ sap.ui.define([
826
840
  // TODO: also used by the CompVariantState to mutate the storage response, this has to be changed
827
841
  FlexState.getStorageResponse = function(sReference) {
828
842
  if (_mInitPromises[sReference]) {
829
- return _mInitPromises[sReference].then(function() {
843
+ return _mInitPromises[sReference].promise.then(function() {
830
844
  return _mInstances[sReference].unfilteredStorageResponse;
831
845
  });
832
846
  }
@@ -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.121.4
105
+ * @version 1.121.5
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.121.4
81
+ * @version 1.121.5
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.121.4
19
+ * @version 1.121.5
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.121.4
23
+ * @version 1.121.5
24
24
  * @private
25
25
  * @ui5-restricted sap.ui.fl
26
26
  */
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  *
40
40
  * @namespace sap.ui.fl.apply._internal.flexState.changes.ExtensionPointState
41
41
  * @since 1.79
42
- * @version 1.121.4
42
+ * @version 1.121.5
43
43
  * @private
44
44
  * @ui5-restricted
45
45
  */
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  * @namespace
37
37
  * @alias sap.ui.fl.apply._internal.flexState.changes.UIChangesState
38
38
  * @since 1.121
39
- * @version 1.121.4
39
+ * @version 1.121.5
40
40
  * @private
41
41
  * @ui5-restricted
42
42
  */
@@ -123,7 +123,7 @@ sap.ui.define([
123
123
  *
124
124
  * @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
125
125
  * @since 1.86
126
- * @version 1.121.4
126
+ * @version 1.121.5
127
127
  * @private
128
128
  * @ui5-restricted sap.ui.fl
129
129
  */
@@ -208,7 +208,7 @@ sap.ui.define([
208
208
  *
209
209
  * @function
210
210
  * @since 1.89
211
- * @version 1.121.4
211
+ * @version 1.121.5
212
212
  * @private
213
213
  * @ui5-restricted sap.ui.fl
214
214
  *
@@ -22,7 +22,6 @@ sap.ui.define([
22
22
  * @param {string} mPropertyBag.vmReference - Variant management ID
23
23
  * @param {string} mPropertyBag.currentVReference - The ID of the currently used variant
24
24
  * @param {string} mPropertyBag.newVReference - ID of the newly selected variant
25
- * @param {object} mPropertyBag.changesMap - Changes inside the current changes map
26
25
  *
27
26
  * @typedef {object} sap.ui.fl.variants.SwitchChanges
28
27
  * @property {array} changesToBeReverted - Array of changes to be reverted
@@ -32,7 +31,7 @@ sap.ui.define([
32
31
  * @private
33
32
  * @ui5-restricted
34
33
  */
35
- function _getControlChangesForVariantSwitch(mPropertyBag) {
34
+ function getControlChangesForVariantSwitch(mPropertyBag) {
36
35
  var aCurrentVariantChanges = VariantManagementState.getControlChangesForVariant(
37
36
  Object.assign(
38
37
  _pick(mPropertyBag, ["vmReference", "variantsMap", "reference"]), {
@@ -47,25 +46,11 @@ sap.ui.define([
47
46
  }
48
47
  )
49
48
  );
50
- var aMapChanges = Object.keys(mPropertyBag.changesMap).reduce(function(aControlChanges, sControlId) {
51
- return aControlChanges.concat(mPropertyBag.changesMap[sControlId]);
52
- }, []);
53
- var aChangeKeysFromMap = aMapChanges.map(function(oCurrentVariantChange) {
54
- return oCurrentVariantChange.getId();
55
- });
56
-
57
- var aFilteredChangesFromMap = aCurrentVariantChanges.reduce(function(aFilteredChanges, oChange) {
58
- var iMapIndex = aChangeKeysFromMap.indexOf(oChange.getId());
59
- if (iMapIndex > -1) {
60
- aFilteredChanges = aFilteredChanges.concat(aMapChanges[iMapIndex]);
61
- }
62
- return aFilteredChanges;
63
- }, []);
64
49
 
65
50
  var aRevertChanges = [];
66
51
  if (aNewChanges.length > 0) {
67
- aRevertChanges = aFilteredChangesFromMap.slice();
68
- aFilteredChangesFromMap.some(function(oChange) {
52
+ aRevertChanges = aCurrentVariantChanges.slice();
53
+ aCurrentVariantChanges.some(function(oChange) {
69
54
  if (aNewChanges[0] && oChange.getId() === aNewChanges[0].getId()) {
70
55
  aNewChanges.shift();
71
56
  aRevertChanges.shift();
@@ -74,7 +59,7 @@ sap.ui.define([
74
59
  }
75
60
  });
76
61
  } else {
77
- aRevertChanges = aFilteredChangesFromMap;
62
+ aRevertChanges = aCurrentVariantChanges;
78
63
  }
79
64
 
80
65
  var mSwitches = {
@@ -90,7 +75,7 @@ sap.ui.define([
90
75
  *
91
76
  * @namespace sap.ui.fl.apply._internal.flexState.controlVariants.Switcher
92
77
  * @since 1.74
93
- * @version 1.121.4
78
+ * @version 1.121.5
94
79
  * @private
95
80
  * @ui5-restricted
96
81
  */
@@ -110,17 +95,13 @@ sap.ui.define([
110
95
  * @private
111
96
  * @ui5-restricted
112
97
  */
113
- switchVariant(mPropertyBag) {
114
- return Promise.resolve().then(function() {
115
- // TODO: should be a function in FlexState e.g. getUIChanges()
116
- mPropertyBag.changesMap = mPropertyBag.flexController._oChangePersistence.getDependencyMapForComponent().mChanges;
117
- var mChangesToBeSwitched = _getControlChangesForVariantSwitch(mPropertyBag);
98
+ async switchVariant(mPropertyBag) {
99
+ var mChangesToBeSwitched = getControlChangesForVariantSwitch(mPropertyBag);
118
100
 
119
- return Reverter.revertMultipleChanges(mChangesToBeSwitched.changesToBeReverted, mPropertyBag)
120
- // TODO: apply variantChanges() should be moved out of flex controller
121
- .then(mPropertyBag.flexController.applyVariantChanges.bind(mPropertyBag.flexController, mChangesToBeSwitched.changesToBeApplied, mPropertyBag.appComponent))
122
- .then(VariantManagementState.setCurrentVariant.bind(null, mPropertyBag));
123
- });
101
+ await Reverter.revertMultipleChanges(mChangesToBeSwitched.changesToBeReverted, mPropertyBag);
102
+ // TODO: apply variantChanges() should be moved out of flex controller
103
+ await mPropertyBag.flexController.applyVariantChanges(mChangesToBeSwitched.changesToBeApplied, mPropertyBag.appComponent);
104
+ VariantManagementState.setCurrentVariant(mPropertyBag);
124
105
  }
125
106
 
126
107
  };
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  *
37
37
  * @namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
38
38
  * @since 1.74
39
- * @version 1.121.4
39
+ * @version 1.121.5
40
40
  * @private
41
41
  * @ui5-restricted
42
42
  */
@@ -657,7 +657,11 @@ sap.ui.define([
657
657
  return aCurrentControls;
658
658
  }, []);
659
659
 
660
- return aControls.length ? mPropertyBag.flexController.waitForChangesToBeApplied(aControls) : Promise.resolve();
660
+ return aControls.length
661
+ // When waiting for the initial changes, no variant switch could have happened yet
662
+ // that needs to be waited for, thus skip waiting for the variant switch promise
663
+ ? mPropertyBag.flexController.waitForChangesToBeApplied(aControls, true)
664
+ : Promise.resolve();
661
665
  };
662
666
 
663
667
  return VariantManagementState;
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @class
27
27
  * @constructor
28
28
  * @author SAP SE
29
- * @version 1.121.4
29
+ * @version 1.121.5
30
30
  * @since 1.27.0
31
31
  * @private
32
32
  * @ui5-restricted sap.ui.fl, sap.ui.core
@@ -14,7 +14,7 @@ sap.ui.define(["sap/ui/core/EventBus"], function(EventBus) {
14
14
  * @alias sap.ui.fl.apply._internal.preprocessors.EventHistory
15
15
  * @since 1.47.0
16
16
  * @author SAP SE
17
- * @version 1.121.4
17
+ * @version 1.121.5
18
18
  *
19
19
  * @private
20
20
  * @ui5-restricted sap.ui.fl.apply._internal.preprocessors.RegistrationDelegator
@@ -44,7 +44,7 @@ sap.ui.define([
44
44
  * @class
45
45
  * @constructor
46
46
  * @author SAP SE
47
- * @version 1.121.4
47
+ * @version 1.121.5
48
48
  * @since 1.43.0
49
49
  * @private
50
50
  */
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  * @class
37
37
  * @constructor
38
38
  * @author SAP SE
39
- * @version 1.121.4
39
+ * @version 1.121.5
40
40
  * @since 1.27.0
41
41
  * @private
42
42
  */
@@ -44,7 +44,7 @@ sap.ui.define([
44
44
  *
45
45
  * @namespace sap.ui.fl.apply.api.ControlVariantApplyAPI
46
46
  * @since 1.67
47
- * @version 1.121.4
47
+ * @version 1.121.5
48
48
  * @public
49
49
  */
50
50
  var ControlVariantApplyAPI = /** @lends sap.ui.fl.apply.api.ControlVariantApplyAPI */{
@@ -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.121.4
25
+ * @version 1.121.5
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.121.4
19
+ * @version 1.121.5
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.121.4
21
+ * @version 1.121.5
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.121.4
17
+ * @version 1.121.5
18
18
  * @private
19
19
  * @ui5-restricted change handlers
20
20
  */
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @constructor
41
41
  * @alias sap.ui.fl.changeHandler.BaseAddViaDelegate
42
42
  * @author SAP SE
43
- * @version 1.121.4
43
+ * @version 1.121.5
44
44
  * @private
45
45
  */
46
46
  const BaseAddViaDelegate = {
@@ -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.121.4
25
+ * @version 1.121.5
26
26
  * @since 1.75
27
27
  * @private
28
28
  */
@@ -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.121.4
20
+ * @version 1.121.5
21
21
  * @since 1.46
22
22
  *
23
23
  */
@@ -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.121.4
24
+ * @version 1.121.5
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.121.4
22
+ * @version 1.121.5
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.121.4
15
+ * @version 1.121.5
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.121.4
21
+ * @version 1.121.5
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.121.4
25
+ * @version 1.121.5
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.121.4
22
+ * @version 1.121.5
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.121.4
22
+ * @version 1.121.5
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.121.4
18
+ * @version 1.121.5
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.121.4
21
+ * @version 1.121.5
22
22
  * @since 1.72
23
23
  * @private
24
24
  */
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @namespace
20
20
  * @name sap.ui.fl.descriptorRelated
21
21
  * @author SAP SE
22
- * @version 1.121.4
22
+ * @version 1.121.5
23
23
  * @private
24
24
  * @ui5-restricted sap.ui.rta, smart business
25
25
  */
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @namespace
30
30
  * @name sap.ui.fl.descriptorRelated.api
31
31
  * @author SAP SE
32
- * @version 1.121.4
32
+ * @version 1.121.5
33
33
  * @private
34
34
  * @ui5-restricted sap.ui.rta, smart business
35
35
  */
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  * @constructor
44
44
  * @alias sap.ui.fl.descriptorRelated.api.DescriptorChange
45
45
  * @author SAP SE
46
- * @version 1.121.4
46
+ * @version 1.121.5
47
47
  * @private
48
48
  * @ui5-restricted sap.ui.rta, smart business
49
49
  */
@@ -124,7 +124,7 @@ sap.ui.define([
124
124
  * @constructor
125
125
  * @alias sap.ui.fl.descriptorRelated.api.DescriptorChangeFactory
126
126
  * @author SAP SE
127
- * @version 1.121.4
127
+ * @version 1.121.5
128
128
  * @private
129
129
  * @ui5-restricted sap.ui.rta, smart business
130
130
  */
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @namespace
39
39
  * @alias sap.ui.fl.descriptorRelated.api.DescriptorInlineChangeFactory
40
40
  * @author SAP SE
41
- * @version 1.121.4
41
+ * @version 1.121.5
42
42
  * @private
43
43
  * @deprecated Since version 1.76
44
44
  * @ui5-restricted sap.ui.rta, smart business
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  * @namespace
17
17
  * @alias sap.ui.fl.descriptorRelated.api.DescriptorVariantFactory
18
18
  * @author SAP SE
19
- * @version 1.121.4
19
+ * @version 1.121.5
20
20
  * @private
21
21
  * @deprecated Since version 1.73
22
22
  * @ui5-restricted sap.ui.rta, smart business
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  * The flexibility Configuration.
17
17
  *
18
18
  * @author SAP SE
19
- * @version 1.121.4
19
+ * @version 1.121.5
20
20
  * @private
21
21
  * @alias module:sap/ui/fl/initial/_internal/FlexConfiguration
22
22
  * @namespace