@openui5/sap.ui.fl 1.129.0 → 1.130.1

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 (172) hide show
  1. package/THIRDPARTY.txt +1 -1
  2. package/package.json +3 -3
  3. package/src/sap/ui/fl/.library +1 -1
  4. package/src/sap/ui/fl/ChangePersistence.js +26 -38
  5. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  6. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  7. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  8. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  9. package/src/sap/ui/fl/FlexController.js +1 -1
  10. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  11. package/src/sap/ui/fl/LayerUtils.js +1 -1
  12. package/src/sap/ui/fl/Utils.js +8 -8
  13. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  14. package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
  15. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +152 -197
  16. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +23 -17
  17. package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +27 -37
  18. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +26 -31
  19. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +3 -2
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +2 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewDataSource.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetCloudDevAdaptationStatus.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/ChangeModel.js +78 -0
  45. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  48. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  49. package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +1 -1
  51. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
  55. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
  56. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +7 -3
  57. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
  58. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
  59. package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
  60. package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +1 -1
  61. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +34 -13
  62. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  63. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  64. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  65. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  66. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  67. package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
  68. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +108 -0
  69. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  70. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
  71. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +57 -9
  72. package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +2 -2
  73. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  74. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +6 -6
  75. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  76. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +25 -10
  77. package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +18 -45
  78. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  82. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  83. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  84. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  85. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  86. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  87. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  88. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  89. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  90. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  91. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  92. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  93. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  94. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  95. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  96. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  97. package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
  98. package/src/sap/ui/fl/initial/_internal/Storage.js +37 -1
  99. package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
  100. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  101. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +3 -2
  102. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  103. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  104. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  105. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +15 -1
  106. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  107. package/src/sap/ui/fl/library.js +43 -43
  108. package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
  109. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  110. package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +1 -1
  111. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  112. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  113. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  114. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  115. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  116. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  117. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  118. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  119. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  120. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  121. package/src/sap/ui/fl/util/DescriptorChangeCheck.js +35 -16
  122. package/src/sap/ui/fl/util/IFrame.js +1 -1
  123. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  124. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  125. package/src/sap/ui/fl/variants/VariantModel.js +33 -11
  126. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  127. package/src/sap/ui/fl/write/_internal/Versions.js +7 -3
  128. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  129. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  130. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +34 -1
  132. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +163 -176
  133. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +62 -61
  134. package/src/sap/ui/fl/write/_internal/condenser/Utils.js +17 -19
  135. package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +13 -13
  136. package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +17 -19
  137. package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +32 -35
  138. package/src/sap/ui/fl/write/_internal/condenser/classifications/Update.js +2 -10
  139. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
  141. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
  142. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +56 -4
  143. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  144. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  145. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  146. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  147. package/src/sap/ui/fl/write/_internal/controlVariants/ControlVariantWriteUtils.js +59 -0
  148. package/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js +1 -2
  149. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  150. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  151. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  152. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  153. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  154. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  155. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  156. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  157. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  158. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  159. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  160. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  161. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  162. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  163. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectManager.js +33 -2
  164. package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  165. package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +26 -3
  166. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +20 -12
  167. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  168. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  169. package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +73 -3
  170. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  171. package/src/sap/ui/fl/write/api/LocalResetAPI.js +17 -27
  172. package/src/sap/ui/fl/write/api/VersionsAPI.js +26 -4
@@ -5,43 +5,43 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
+ "sap/base/util/restricted/_isEqual",
8
9
  "sap/base/util/each",
9
10
  "sap/base/util/isPlainObject",
10
11
  "sap/base/util/ObjectPath",
11
12
  "sap/base/Log",
12
13
  "sap/ui/core/util/reflection/JsControlTreeModifier",
13
14
  "sap/ui/core/Element",
14
- "sap/ui/fl/changeHandler/condenser/Classification",
15
15
  "sap/ui/fl/apply/_internal/changes/Utils",
16
- "sap/ui/fl/apply/_internal/flexObjects/UIChange",
17
16
  "sap/ui/fl/apply/_internal/flexObjects/States",
17
+ "sap/ui/fl/apply/_internal/flexObjects/UIChange",
18
+ "sap/ui/fl/changeHandler/condenser/Classification",
18
19
  "sap/ui/fl/write/_internal/condenser/classifications/LastOneWins",
19
20
  "sap/ui/fl/write/_internal/condenser/classifications/Reverse",
20
21
  "sap/ui/fl/write/_internal/condenser/classifications/Update",
21
22
  "sap/ui/fl/write/_internal/condenser/UIReconstruction",
22
23
  "sap/ui/fl/write/_internal/condenser/Utils",
23
24
  "sap/ui/fl/Utils",
24
- "sap/ui/performance/Measurement",
25
- "sap/base/util/restricted/_isEqual"
25
+ "sap/ui/performance/Measurement"
26
26
  ], function(
27
+ _isEqual,
27
28
  each,
28
29
  isPlainObject,
29
30
  ObjectPath,
30
31
  Log,
31
32
  JsControlTreeModifier,
32
33
  Element,
33
- CondenserClassification,
34
34
  ChangesUtils,
35
- UIChange,
36
35
  States,
36
+ UIChange,
37
+ CondenserClassification,
37
38
  LastOneWins,
38
39
  Reverse,
39
40
  Update,
40
41
  UIReconstruction,
41
42
  CondenserUtils,
42
43
  FlUtils,
43
- Measurement,
44
- _isEqual
44
+ Measurement
45
45
  ) {
46
46
  "use strict";
47
47
 
@@ -51,34 +51,35 @@ sap.ui.define([
51
51
  * @namespace
52
52
  * @alias sap.ui.fl.write._internal.condenser.Condenser
53
53
  * @author SAP SE
54
- * @version 1.129.0
54
+ * @version 1.130.1
55
55
  */
56
- var Condenser = {};
56
+ const Condenser = {};
57
57
 
58
- var UNCLASSIFIED = "unclassified";
58
+ const UNCLASSIFIED = "unclassified";
59
59
 
60
60
  /**
61
61
  * Classification of the non-index-related changes
62
62
  *
63
63
  * @type {{lastOneWins: addLastOneWinsChange, reverse: addReverseChange}}
64
64
  */
65
- var NON_INDEX_RELEVANT = {
65
+ const NON_INDEX_RELEVANT = {
66
66
  lastOneWins: LastOneWins,
67
67
  reverse: Reverse,
68
68
  update: Update
69
69
  };
70
70
 
71
- var PROPERTIES_WITH_SELECTORS = ["affectedControl", "sourceContainer", "targetContainer", "updateControl"];
71
+ const PROPERTIES_WITH_SELECTORS = ["affectedControl", "sourceContainer", "targetContainer", "updateControl"];
72
72
 
73
73
  /**
74
- * Verify 'move' subtype has already been added to the data structure before 'create' subtype and they both belong to the same targetContainer
74
+ * Verify 'move' subtype has already been added to the data structure before 'create' subtype
75
+ * and they both belong to the same targetContainer
75
76
  *
76
77
  * @param {object} mSubtypes - Map of properties that holds key-value pairs. A key is a unique identifier. A value is an array object that contains changes
77
78
  * @param {object} oCondenserInfo - Condenser specific information that is delivered by the change handler
78
79
  * @returns {boolean} <code>true</code> if the 'move' subtype has been added to the data structure before 'create' subtype
79
80
  */
80
81
  function isCreateAfterMoveSubtype(mSubtypes, oCondenserInfo) {
81
- var aMoveSubType = mSubtypes[CondenserClassification.Move];
82
+ const aMoveSubType = mSubtypes[CondenserClassification.Move];
82
83
  return oCondenserInfo.classification === CondenserClassification.Create
83
84
  && aMoveSubType
84
85
  && aMoveSubType[aMoveSubType.length - 1].targetContainer === oCondenserInfo.targetContainer;
@@ -115,12 +116,12 @@ sap.ui.define([
115
116
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - Change instance that will be added to the array
116
117
  * @returns {Promise} resolves when the change is added to the data structure
117
118
  */
118
- function addIndexRelatedChange(mClassifications, mUIReconstructions, oCondenserInfo, oChange) {
119
+ async function addIndexRelatedChange(mClassifications, mUIReconstructions, oCondenserInfo, oChange) {
119
120
  if (
120
121
  !isMoveAfterDestroySubtype(mClassifications, oCondenserInfo)
121
122
  && !isCreateAfterDestroySubtype(mClassifications, oCondenserInfo)
122
123
  ) {
123
- var sClassification = oCondenserInfo.classification;
124
+ const sClassification = oCondenserInfo.classification;
124
125
  if (!mClassifications[sClassification]) {
125
126
  oCondenserInfo.change = oChange;
126
127
  oChange.condenserState = "select";
@@ -138,19 +139,19 @@ sap.ui.define([
138
139
  || isCreateAfterDestroySubtype(mClassifications, oCondenserInfo)
139
140
  ) {
140
141
  if (mClassifications[CondenserClassification.Move]) {
141
- mClassifications[CondenserClassification.Move].forEach(function(oCondenserInfo) {
142
+ mClassifications[CondenserClassification.Move].forEach((oCondenserInfo) => {
142
143
  oCondenserInfo.change.condenserState = "delete";
143
144
  });
144
145
  delete mClassifications[CondenserClassification.Move];
145
146
  }
146
147
  if (mClassifications[CondenserClassification.Destroy]) {
147
- mClassifications[CondenserClassification.Destroy].forEach(function(oCondenserInfo) {
148
+ mClassifications[CondenserClassification.Destroy].forEach((oCondenserInfo) => {
148
149
  oCondenserInfo.change.condenserState = "delete";
149
150
  });
150
151
  delete mClassifications[CondenserClassification.Destroy];
151
152
  }
152
153
  }
153
- return UIReconstruction.addChange(mUIReconstructions, oCondenserInfo);
154
+ await UIReconstruction.addChange(mUIReconstructions, oCondenserInfo);
154
155
  }
155
156
 
156
157
  /**
@@ -158,13 +159,11 @@ sap.ui.define([
158
159
  * @param {object} mClassifications - Map of properties that holds key-value pairs. A key is a unique identifier. A value is an array object that contains changes
159
160
  * @param {object} oCondenserInfo - Condenser specific information that is delivered by the change handler
160
161
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - Change instance that will be added to the array
161
- * @returns {Promise} returns when change is added to the map
162
162
  */
163
163
  function addNonIndexRelatedChange(mClassifications, oCondenserInfo, oChange) {
164
164
  mClassifications[oCondenserInfo.classification] ||= {};
165
- var mProperties = mClassifications[oCondenserInfo.classification];
165
+ const mProperties = mClassifications[oCondenserInfo.classification];
166
166
  NON_INDEX_RELEVANT[oCondenserInfo.classification].addToChangesMap(mProperties, oCondenserInfo, oChange);
167
- return Promise.resolve();
168
167
  }
169
168
 
170
169
  /**
@@ -177,18 +176,18 @@ sap.ui.define([
177
176
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - Change instance that will be added to the array
178
177
  * @returns {Promise} returns when change is added to the data structures
179
178
  */
180
- function addClassifiedChange(mTypes, mUIReconstructions, aIndexRelatedChanges, oCondenserInfo, oChange) {
179
+ async function addClassifiedChange(mTypes, mUIReconstructions, aIndexRelatedChanges, oCondenserInfo, oChange) {
181
180
  mTypes[oCondenserInfo.type] ||= {};
182
- var mClassifications = mTypes[oCondenserInfo.type];
181
+ const mClassifications = mTypes[oCondenserInfo.type];
183
182
 
184
183
  if (oCondenserInfo.type === CondenserUtils.NOT_INDEX_RELEVANT) {
185
- return addNonIndexRelatedChange(mClassifications, oCondenserInfo, oChange);
184
+ addNonIndexRelatedChange(mClassifications, oCondenserInfo, oChange);
185
+ } else {
186
+ aIndexRelatedChanges.push(oChange);
187
+ // with custom aggregations multiple aggregations can have the same affectedControl
188
+ mClassifications[oCondenserInfo.targetAggregation] ||= {};
189
+ await addIndexRelatedChange(mClassifications[oCondenserInfo.targetAggregation], mUIReconstructions, oCondenserInfo, oChange);
186
190
  }
187
-
188
- aIndexRelatedChanges.push(oChange);
189
- // with custom aggregations multiple aggregations can have the same affectedControl
190
- mClassifications[oCondenserInfo.targetAggregation] ||= {};
191
- return addIndexRelatedChange(mClassifications[oCondenserInfo.targetAggregation], mUIReconstructions, oCondenserInfo, oChange);
192
191
  }
193
192
 
194
193
  /**
@@ -211,44 +210,36 @@ sap.ui.define([
211
210
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - Change instance
212
211
  * @returns {Promise.<object>} - Resolves with the condenser information or undefined
213
212
  */
214
- function getCondenserInfoFromChangeHandler(oAppComponent, oChange) {
215
- var sControlId = JsControlTreeModifier.getControlIdBySelector(oChange.getSelector(), oAppComponent);
216
- var oControl = Element.getElementById(sControlId);
213
+ async function getCondenserInfoFromChangeHandler(oAppComponent, oChange) {
214
+ const sControlId = JsControlTreeModifier.getControlIdBySelector(oChange.getSelector(), oAppComponent);
215
+ const oControl = Element.getElementById(sControlId);
217
216
  if (oControl) {
218
- var mPropertyBag = {
217
+ const mPropertyBag = {
219
218
  modifier: JsControlTreeModifier,
220
219
  appComponent: oAppComponent,
221
220
  view: FlUtils.getViewForControl(oControl)
222
221
  };
223
- var mControl = ChangesUtils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag);
224
- return Promise.resolve(ChangesUtils.getChangeHandler(oChange, mControl, mPropertyBag))
225
- .then(function(oChangeHandler) {
226
- if (oChangeHandler && typeof oChangeHandler.getCondenserInfo === "function") {
227
- return oChangeHandler.getCondenserInfo(oChange, mPropertyBag);
228
- }
229
- return undefined;
230
- })
231
- .then(function(oCondenserInfo) {
232
- // changes in templates get the binding holder as selector but have the original selector
233
- // inside the template as dependent selector. As there might be multiple different controls in the template
234
- // the selectors have to be changed back before the maps gets created
235
- if (oCondenserInfo && mControl.bTemplateAffected) {
236
- replaceTemplateSelector(oCondenserInfo, oChange);
222
+ const mControl = ChangesUtils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag);
223
+ try {
224
+ const oChangeHandler = await ChangesUtils.getChangeHandler(oChange, mControl, mPropertyBag);
225
+ if (typeof oChangeHandler.getCondenserInfo === "function") {
226
+ const oCondenserInfo = await oChangeHandler.getCondenserInfo(oChange, mPropertyBag);
227
+ if (oCondenserInfo && mControl.bTemplateAffected) {
228
+ replaceTemplateSelector(oCondenserInfo, oChange);
229
+ }
230
+ return oCondenserInfo;
237
231
  }
238
- return oCondenserInfo;
239
- })
240
- .catch(function() {
232
+ } catch (oError) {
241
233
  return undefined;
242
- });
234
+ }
243
235
  }
244
-
245
- return Promise.resolve();
236
+ return undefined;
246
237
  }
247
238
 
248
239
  function replaceTemplateSelector(oCondenserInfo, oChange) {
249
- var oOriginalSelector = oChange.getOriginalSelector();
250
- var oTemplateSelector = oChange.getSelector();
251
- PROPERTIES_WITH_SELECTORS.forEach(function(sPropertyName) {
240
+ const oOriginalSelector = oChange.getOriginalSelector();
241
+ const oTemplateSelector = oChange.getSelector();
242
+ PROPERTIES_WITH_SELECTORS.forEach((sPropertyName) => {
252
243
  if (oCondenserInfo[sPropertyName] && oCondenserInfo[sPropertyName] === oTemplateSelector) {
253
244
  oCondenserInfo[sPropertyName] = oOriginalSelector;
254
245
  }
@@ -265,16 +256,16 @@ sap.ui.define([
265
256
  * @returns {object} Classification types map
266
257
  */
267
258
  function getTypesMap(mReducedChanges, oCondenserInfo, oChange, oAppComponent) {
268
- var sAffectedControlId = oCondenserInfo !== undefined
259
+ const sAffectedControlId = oCondenserInfo !== undefined
269
260
  ? oCondenserInfo.affectedControl
270
261
  : JsControlTreeModifier.getControlIdBySelector(oChange.getSelector(), oAppComponent);
271
262
  mReducedChanges[sAffectedControlId] ||= {};
272
263
  // If an updateControl is present, it means that the update has a different selector from the other changes
273
264
  // (e.g. iFrame added as Section) and the changes must be brought to the same group (= same affected control)
274
265
  if (oCondenserInfo && oCondenserInfo.updateControl) {
275
- var sUpdateControlId = oCondenserInfo.updateControl;
276
- var aPath = [CondenserUtils.NOT_INDEX_RELEVANT, CondenserClassification.Update, oCondenserInfo.uniqueKey];
277
- var oUpdateCondenserInfo = ObjectPath.get(aPath, mReducedChanges[sUpdateControlId]);
266
+ const sUpdateControlId = oCondenserInfo.updateControl;
267
+ const aPath = [CondenserUtils.NOT_INDEX_RELEVANT, CondenserClassification.Update, oCondenserInfo.uniqueKey];
268
+ const oUpdateCondenserInfo = ObjectPath.get(aPath, mReducedChanges[sUpdateControlId]);
278
269
  if (oUpdateCondenserInfo) {
279
270
  ObjectPath.set(aPath, oUpdateCondenserInfo, mReducedChanges[sAffectedControlId]);
280
271
  delete mReducedChanges[sUpdateControlId][CondenserUtils.NOT_INDEX_RELEVANT]
@@ -331,29 +322,26 @@ sap.ui.define([
331
322
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} aChanges - All Change instances
332
323
  * @returns {Promise} Resolves when all changes were added to the maps
333
324
  */
334
- function defineMaps(oAppComponent, mReducedChanges, mUIReconstructions, aIndexRelatedChanges, aChanges) {
335
- return aChanges.reduce(function(oPromise, oChange) {
336
- return oPromise.then(addChangeToMap.bind(this, oAppComponent, mReducedChanges, mUIReconstructions, aIndexRelatedChanges, oChange));
337
- }.bind(this), Promise.resolve());
325
+ async function defineMaps(oAppComponent, mReducedChanges, mUIReconstructions, aIndexRelatedChanges, aChanges) {
326
+ for (const oChange of aChanges) {
327
+ await addChangeToMap(oAppComponent, mReducedChanges, mUIReconstructions, aIndexRelatedChanges, oChange);
328
+ }
338
329
  }
339
330
 
340
- function addChangeToMap(oAppComponent, mReducedChanges, mUIReconstructions, aIndexRelatedChanges, oChange) {
341
- return getCondenserInfoFromChangeHandler(oAppComponent, oChange).then(function(oCondenserInfo) {
342
- changeSelectorsToIdsInCondenserInfo(oCondenserInfo, oAppComponent);
343
- var mTypes = getTypesMap(mReducedChanges, oCondenserInfo, oChange, oAppComponent);
344
- if (oCondenserInfo !== undefined) {
345
- addType(oCondenserInfo);
346
- return addClassifiedChange(mTypes, mUIReconstructions, aIndexRelatedChanges, oCondenserInfo, oChange)
347
- .then(function() {
348
- if (oCondenserInfo.update) {
349
- condenseUpdateChange(mTypes, oCondenserInfo, oChange);
350
- }
351
- });
331
+ async function addChangeToMap(oAppComponent, mReducedChanges, mUIReconstructions, aIndexRelatedChanges, oChange) {
332
+ const oCondenserInfo = await getCondenserInfoFromChangeHandler(oAppComponent, oChange);
333
+ changeSelectorsToIdsInCondenserInfo(oCondenserInfo, oAppComponent);
334
+ const mTypes = getTypesMap(mReducedChanges, oCondenserInfo, oChange, oAppComponent);
335
+ if (oCondenserInfo !== undefined) {
336
+ addType(oCondenserInfo);
337
+ await addClassifiedChange(mTypes, mUIReconstructions, aIndexRelatedChanges, oCondenserInfo, oChange);
338
+ if (oCondenserInfo.update) {
339
+ condenseUpdateChange(mTypes, oCondenserInfo, oChange);
352
340
  }
341
+ } else {
353
342
  addUnclassifiedChange(mTypes, UNCLASSIFIED, oChange);
354
343
  mReducedChanges[UNCLASSIFIED] = true;
355
- return undefined;
356
- });
344
+ }
357
345
  }
358
346
 
359
347
  function addType(oCondenserInfo) {
@@ -365,7 +353,7 @@ sap.ui.define([
365
353
  }
366
354
 
367
355
  function changeSelectorsToIdsInCondenserInfo(oCondenserInfo, oAppComponent) {
368
- PROPERTIES_WITH_SELECTORS.forEach(function(sPropertyName) {
356
+ PROPERTIES_WITH_SELECTORS.forEach((sPropertyName) => {
369
357
  if (oCondenserInfo && oCondenserInfo[sPropertyName]) {
370
358
  oCondenserInfo[sPropertyName] = JsControlTreeModifier.getControlIdBySelector(oCondenserInfo[sPropertyName], oAppComponent);
371
359
  }
@@ -383,8 +371,8 @@ sap.ui.define([
383
371
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject} oChange - The change that is getting updated
384
372
  */
385
373
  function condenseUpdateChange(mTypes, oCondenserInfo, oChange) {
386
- var aPath = [CondenserUtils.NOT_INDEX_RELEVANT, CondenserClassification.Update, oCondenserInfo.uniqueKey];
387
- var oUpdateCondenserInfo = ObjectPath.get(aPath, mTypes);
374
+ const aPath = [CondenserUtils.NOT_INDEX_RELEVANT, CondenserClassification.Update, oCondenserInfo.uniqueKey];
375
+ const oUpdateCondenserInfo = ObjectPath.get(aPath, mTypes);
388
376
  if (oUpdateCondenserInfo) {
389
377
  oUpdateCondenserInfo.change.condenserState = "delete";
390
378
  if (oChange.condenserState === "delete") {
@@ -407,15 +395,15 @@ sap.ui.define([
407
395
  * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} All necessary changes in the map of reduced changes
408
396
  */
409
397
  function getChanges(mObjects, aChanges) {
410
- each(mObjects, function(sKey, vSubObjects) {
398
+ each(mObjects, (sKey, vSubObjects) => {
411
399
  if (NON_INDEX_RELEVANT[sKey] && NON_INDEX_RELEVANT[sKey].getChangesFromMap) {
412
- NON_INDEX_RELEVANT[sKey].getChangesFromMap(mObjects, sKey).forEach(function(oChange) {
400
+ NON_INDEX_RELEVANT[sKey].getChangesFromMap(mObjects, sKey).forEach((oChange) => {
413
401
  aChanges.push(oChange);
414
402
  });
415
403
  } else if (isPlainObject(vSubObjects)) {
416
404
  return getChanges(vSubObjects, aChanges);
417
405
  } else if (Array.isArray(vSubObjects)) {
418
- vSubObjects.forEach(function(oObject) {
406
+ vSubObjects.forEach((oObject) => {
419
407
  if (oObject instanceof UIChange) {
420
408
  aChanges.push(oObject);
421
409
  } else {
@@ -445,11 +433,11 @@ sap.ui.define([
445
433
  * @returns {object[]} Array of objects that contain condenser-specific information and change instance
446
434
  */
447
435
  function getCondenserInfos(mReducedChanges, aCondenserInfos) {
448
- each(mReducedChanges, function(sKey, vSubObjects) {
436
+ Object.values(mReducedChanges).forEach((vSubObjects) => {
449
437
  if (isPlainObject(vSubObjects)) {
450
438
  getCondenserInfos(vSubObjects, aCondenserInfos);
451
439
  } else if (Array.isArray(vSubObjects)) {
452
- vSubObjects.forEach(function(oObject) {
440
+ vSubObjects.forEach((oObject) => {
453
441
  if (!(oObject instanceof UIChange)) {
454
442
  aCondenserInfos.push(oObject);
455
443
  }
@@ -466,23 +454,23 @@ sap.ui.define([
466
454
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} aReducedChanges - Array of reduced changes
467
455
  */
468
456
  function sortByInitialOrder(aChanges, aReducedChanges) {
469
- aReducedChanges.sort(function(a, b) {
457
+ aReducedChanges.sort((a, b) => {
470
458
  return aChanges.indexOf(a) - aChanges.indexOf(b);
471
459
  });
472
460
  }
473
461
 
474
462
  function sortCondenserInfosByInitialOrder(aChanges, aCondenserInfos) {
475
- aCondenserInfos.sort(function(a, b) {
463
+ aCondenserInfos.sort((a, b) => {
476
464
  return aChanges.indexOf(a.change) - aChanges.indexOf(b.change);
477
465
  });
478
466
  }
479
467
 
480
468
  function addAllIndexRelatedChanges(aReducedChanges, aIndexRelatedChanges) {
481
- var aReducedChangeIds = aReducedChanges.map(function(oChange) {
469
+ const aReducedChangeIds = aReducedChanges.map((oChange) => {
482
470
  return oChange.getId();
483
471
  });
484
472
 
485
- aIndexRelatedChanges.forEach(function(oChange) {
473
+ aIndexRelatedChanges.forEach((oChange) => {
486
474
  if (aReducedChangeIds.indexOf(oChange.getId()) === -1) {
487
475
  aReducedChanges.push(oChange);
488
476
  }
@@ -501,8 +489,8 @@ sap.ui.define([
501
489
  * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} Updated reduced changes
502
490
  */
503
491
  function handleChangeUpdate(aCondenserInfos, aReducedChanges, aReducedIndexRelatedChangesPerContainer) {
504
- aCondenserInfos.forEach(function(oCondenserInfo) {
505
- var oUpdateChange = oCondenserInfo.updateChange;
492
+ aCondenserInfos.forEach((oCondenserInfo) => {
493
+ const oUpdateChange = oCondenserInfo.updateChange;
506
494
  if (
507
495
  oUpdateChange
508
496
  // "Update" only modifies the change content. If we support other
@@ -510,20 +498,20 @@ sap.ui.define([
510
498
  && !_isEqual(oUpdateChange.getContent(), oCondenserInfo.change.getContent())
511
499
  && oUpdateChange.getState() !== States.LifecycleState.NEW
512
500
  ) {
513
- var oLastChange = oCondenserInfo.change;
501
+ const oLastChange = oCondenserInfo.change;
514
502
  if (oUpdateChange.getId() !== oLastChange.getId()) {
515
- var oNewContent = oLastChange.getContent();
503
+ const oNewContent = oLastChange.getContent();
516
504
  oUpdateChange.setContent(oNewContent);
517
505
  oUpdateChange.setRevertData(oLastChange.getRevertData());
518
506
  oLastChange.condenserState = "delete";
519
- aReducedChanges = aReducedChanges.map(function(oChange) {
507
+ aReducedChanges = aReducedChanges.map((oChange) => {
520
508
  if (oChange.getId() === oLastChange.getId()) {
521
509
  return oUpdateChange;
522
510
  }
523
511
  return oChange;
524
512
  });
525
- aReducedIndexRelatedChangesPerContainer.forEach(function(aReducedIndexRelatedChanges, iIndex) {
526
- aReducedIndexRelatedChangesPerContainer[iIndex] = aReducedIndexRelatedChanges.map(function(oChange) {
513
+ aReducedIndexRelatedChangesPerContainer.forEach((aReducedIndexRelatedChanges, iIndex) => {
514
+ aReducedIndexRelatedChangesPerContainer[iIndex] = aReducedIndexRelatedChanges.map((oChange) => {
527
515
  if (oChange.getId() === oLastChange.getId()) {
528
516
  return oUpdateChange;
529
517
  }
@@ -542,7 +530,8 @@ sap.ui.define([
542
530
  /**
543
531
  * The condensing algorithm gets an array of changes that should be reduced to the bare minimum.
544
532
  * The steps of the algorithm are:
545
- * (1) Before starting the iteration process through the array of changes, the condenser reverses the array of changes to start the iteration backwards.
533
+ * (1) Before starting the iteration process through the array of changes,
534
+ * the condenser reverses the array of changes to start the iteration backwards.
546
535
  * By iterating through the array of changes, the condenser defines two data structures.
547
536
  * The first one contains reduced changes that are stored according to the classification per control.
548
537
  * The second one contains UI reconstructions of the corresponding UI parts.
@@ -558,21 +547,22 @@ sap.ui.define([
558
547
  * @param {sap.ui.fl.apply._internal.flexObjects.FlexObject[]} aChanges - Array of changes
559
548
  * @returns {Promise} Promise resolved with the reduced array of changes
560
549
  */
561
- Condenser.condense = function(oAppComponent, aChanges) {
550
+ Condenser.condense = async function(oAppComponent, aChanges) {
562
551
  Measurement.start("Condenser_overall", "Condenser overall - CondenserClass", ["sap.ui.fl", "Condenser"]);
563
- var mReducedChanges = {};
564
- var mUIReconstructions = {};
565
- var aAllIndexRelatedChanges = [];
552
+ const mReducedChanges = {};
553
+ const mUIReconstructions = {};
554
+ const aAllIndexRelatedChanges = [];
566
555
 
567
556
  // filter out objects which are not of type change, e.g. Variants, AppVariants, AppVariantInlineChange
568
557
  // or are not applied (e.g. not part of the active variant) or were deleted
569
- var aNotCondensableChanges = [];
570
- var aCondensableChanges = [];
571
- aChanges.slice(0).reverse().forEach(function(oChange) {
558
+ const aNotCondensableChanges = [];
559
+ const aCondensableChanges = [];
560
+ aChanges.slice(0).reverse().forEach((oChange) => {
561
+ if (oChange.getState() === States.LifecycleState.DELETED) {
562
+ oChange.condenserState = "delete";
563
+ }
572
564
  if (oChange instanceof UIChange) {
573
- if (oChange.getState() === States.LifecycleState.DELETED) {
574
- oChange.condenserState = "delete";
575
- } else if (oChange.isSuccessfullyApplied()) {
565
+ if (oChange.isSuccessfullyApplied()) {
576
566
  aCondensableChanges.push(oChange);
577
567
  } else {
578
568
  aNotCondensableChanges.push(oChange);
@@ -583,80 +573,77 @@ sap.ui.define([
583
573
  });
584
574
 
585
575
  Measurement.start("Condenser_defineMaps", "defining of maps - CondenserClass", ["sap.ui.fl", "Condenser"]);
576
+ await defineMaps(oAppComponent, mReducedChanges, mUIReconstructions, aAllIndexRelatedChanges, aCondensableChanges);
577
+ Measurement.end("Condenser_defineMaps");
586
578
 
587
- return defineMaps(oAppComponent, mReducedChanges, mUIReconstructions, aAllIndexRelatedChanges, aCondensableChanges)
579
+ const bUnclassifiedChanges = mReducedChanges[UNCLASSIFIED];
580
+ if (!bUnclassifiedChanges) {
581
+ UIReconstruction.compareAndUpdate(mReducedChanges, mUIReconstructions);
582
+ }
583
+ let aReducedChanges = getAllReducedChanges(mReducedChanges);
584
+
585
+ // with unclassified changes no index relevant changes can be reduced
586
+ if (bUnclassifiedChanges) {
587
+ aAllIndexRelatedChanges.forEach((oChange) => {
588
+ // If the index-relevant change is only being updated, this does not cause side effects
589
+ // If they are being removed (condenserState "delete"), they must be set to "select"
590
+ if (oChange.condenserState !== "update") {
591
+ oChange.condenserState = "select";
592
+ }
593
+ });
594
+ addAllIndexRelatedChanges(aReducedChanges, aAllIndexRelatedChanges);
595
+ }
588
596
 
589
- .then(function() {
590
- Measurement.end("Condenser_defineMaps");
591
- var bUnclassifiedChanges = mReducedChanges[UNCLASSIFIED];
592
- if (!bUnclassifiedChanges) {
593
- UIReconstruction.compareAndUpdate(mReducedChanges, mUIReconstructions);
597
+ aReducedChanges = aReducedChanges.concat(aNotCondensableChanges);
598
+ sortByInitialOrder(aChanges, aReducedChanges);
599
+
600
+ if (!bUnclassifiedChanges) {
601
+ Measurement.start("Condenser_handleIndexRelatedChanges", "handle index related changes - CondenserClass", ["sap.ui.fl", "Condenser"]);
602
+
603
+ let bSuccess = true;
604
+ let aCondenserInfos = getCondenserInfos(mReducedChanges, []);
605
+ sortCondenserInfosByInitialOrder(aChanges, aCondenserInfos);
606
+ let aReducedIndexRelatedChangesPerContainer;
607
+ try {
608
+ Measurement.start("Condenser_sort", "sort index related changes - CondenserClass", ["sap.ui.fl", "Condenser"]);
609
+ aReducedIndexRelatedChangesPerContainer = UIReconstruction.sortIndexRelatedChanges(mUIReconstructions, aCondenserInfos);
610
+ } catch (oError) {
611
+ // an error here has to be treated similar to if there were some unclassified changes
612
+ // TODO: could be improved to only add all the changes of that specific container
613
+ Log.error(`Error during Condensing: ${oError.message}`, "No Condensing performed for index-relevant changes.");
614
+ bSuccess = false;
594
615
  }
595
- var aReducedChanges = getAllReducedChanges(mReducedChanges);
596
-
597
- // with unclassified changes no index relevant changes can be reduced
598
- if (bUnclassifiedChanges) {
599
- aAllIndexRelatedChanges.forEach(function(oChange) {
600
- // If the index-relevant change is only being updated, this does not cause side effects
601
- // If they are being removed (condenserState "delete"), they must be set to "select"
602
- if (oChange.condenserState !== "update") {
603
- oChange.condenserState = "select";
604
- }
616
+ Measurement.end("Condenser_sort");
617
+
618
+ if (bSuccess) {
619
+ // during the simulation more changes can become obsolete
620
+ aReducedChanges = aReducedChanges.filter((oChange) => {
621
+ return oChange.condenserState !== "delete";
622
+ });
623
+ aCondenserInfos = aCondenserInfos.filter((oCondenserInfo) => {
624
+ return oCondenserInfo.change.condenserState !== "delete";
625
+ });
626
+ // until now aReducedChanges still has the newer changes.
627
+ // after replacing them with the older change they have to be sorted again
628
+ aReducedChanges = handleChangeUpdate(aCondenserInfos, aReducedChanges, aReducedIndexRelatedChangesPerContainer);
629
+ sortByInitialOrder(aChanges, aReducedChanges);
630
+ // sort the different containers independently
631
+ aReducedIndexRelatedChangesPerContainer.forEach((aReducedIndexRelatedChanges) => {
632
+ UIReconstruction.swapChanges(aReducedIndexRelatedChanges, aReducedChanges);
633
+ });
634
+ } else {
635
+ aAllIndexRelatedChanges.forEach((oChange) => {
636
+ oChange.condenserState = "select";
605
637
  });
606
638
  addAllIndexRelatedChanges(aReducedChanges, aAllIndexRelatedChanges);
639
+ sortByInitialOrder(aChanges, aReducedChanges);
607
640
  }
608
641
 
609
- aReducedChanges = aReducedChanges.concat(aNotCondensableChanges);
610
- sortByInitialOrder(aChanges, aReducedChanges);
611
-
612
- if (!bUnclassifiedChanges) {
613
- Measurement.start("Condenser_handleIndexRelatedChanges", "handle index related changes - CondenserClass", ["sap.ui.fl", "Condenser"]);
614
-
615
- var bSuccess = true;
616
- var aCondenserInfos = getCondenserInfos(mReducedChanges, []);
617
- sortCondenserInfosByInitialOrder(aChanges, aCondenserInfos);
618
- var aReducedIndexRelatedChangesPerContainer;
619
- try {
620
- Measurement.start("Condenser_sort", "sort index related changes - CondenserClass", ["sap.ui.fl", "Condenser"]);
621
- aReducedIndexRelatedChangesPerContainer = UIReconstruction.sortIndexRelatedChanges(mUIReconstructions, aCondenserInfos);
622
- } catch (oError) {
623
- // an error here has to be treated similar to if there were some unclassified changes
624
- // TODO: could be improved to only add all the changes of that specific container
625
- Log.error(`Error during Condensing: ${oError.message}`, "No Condensing performed for index-relevant changes.");
626
- bSuccess = false;
627
- }
628
- Measurement.end("Condenser_sort");
629
-
630
- if (bSuccess) {
631
- // during the simulation more changes can become obsolete
632
- aReducedChanges = aReducedChanges.filter(function(oChange) {
633
- return oChange.condenserState !== "delete";
634
- });
635
- aCondenserInfos = aCondenserInfos.filter(function(oCondenserInfo) {
636
- return oCondenserInfo.change.condenserState !== "delete";
637
- });
638
- // until now aReducedChanges still has the newer changes.
639
- // after replacing them with the older change they have to be sorted again
640
- aReducedChanges = handleChangeUpdate(aCondenserInfos, aReducedChanges, aReducedIndexRelatedChangesPerContainer);
641
- sortByInitialOrder(aChanges, aReducedChanges);
642
- // sort the different containers independently
643
- aReducedIndexRelatedChangesPerContainer.forEach(function(aReducedIndexRelatedChanges) {
644
- UIReconstruction.swapChanges(aReducedIndexRelatedChanges, aReducedChanges);
645
- });
646
- } else {
647
- aAllIndexRelatedChanges.forEach(function(oChange) {
648
- oChange.condenserState = "select";
649
- });
650
- addAllIndexRelatedChanges(aReducedChanges, aAllIndexRelatedChanges);
651
- sortByInitialOrder(aChanges, aReducedChanges);
652
- }
653
-
654
- Measurement.end("Condenser_handleIndexRelatedChanges");
655
- }
642
+ Measurement.end("Condenser_handleIndexRelatedChanges");
643
+ }
656
644
 
657
- Measurement.end("Condenser_overall");
658
- return aReducedChanges;
659
- });
645
+ Measurement.end("Condenser_overall");
646
+ return aReducedChanges;
660
647
  };
661
648
 
662
649
  return Condenser;