@openui5/sap.ui.fl 1.123.1 → 1.124.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 (164) 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 +39 -48
  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 +3 -34
  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 +113 -270
  13. package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
  14. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +36 -3
  15. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  16. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
  17. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  18. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  19. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
  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/RemoveAllInboundsExceptOne.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +49 -5
  37. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +28 -27
  39. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
  48. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
  49. package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +75 -41
  51. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +30 -11
  55. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +67 -70
  56. package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +14 -6
  57. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  58. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/Utils.js +4 -0
  59. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +8 -7
  60. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +108 -41
  61. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +8 -15
  62. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +7 -12
  63. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +15 -19
  64. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  65. package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +13 -86
  66. package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +14 -11
  67. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  70. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +14 -29
  72. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  73. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  76. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  78. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  82. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +2 -2
  83. package/src/sap/ui/fl/changeHandler/common/createIFrame.js +5 -2
  84. package/src/sap/ui/fl/descriptorRelated/Utils.js +16 -7
  85. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  86. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  87. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  88. package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +26 -0
  89. package/src/sap/ui/fl/designtime/util/editIFrame.js +8 -5
  90. package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
  91. package/src/sap/ui/fl/initial/_internal/Storage.js +5 -2
  92. package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
  93. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  94. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
  95. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  96. package/src/sap/ui/fl/initial/_internal/connectors/KeyUserConnector.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/messagebundle_sh.properties +9 -9
  103. package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
  104. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  105. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  106. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  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/support/apps/contentbrowser/view/ContentDetails.view.xml +0 -1
  115. package/src/sap/ui/fl/support/apps/contentbrowser/view/ContentDetailsEdit.view.xml +0 -1
  116. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  117. package/src/sap/ui/fl/util/IFrame.js +51 -64
  118. package/src/sap/ui/fl/util/IFrameRenderer.js +15 -9
  119. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  120. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  121. package/src/sap/ui/fl/variants/VariantModel.js +5 -5
  122. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  123. package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
  124. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  125. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  126. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  127. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +2 -2
  128. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
  129. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  130. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
  132. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
  133. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
  134. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  135. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  136. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  137. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  138. package/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js +5 -5
  139. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  141. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  142. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  143. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  144. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  145. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  146. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  147. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +12 -23
  148. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  149. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  150. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  151. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  152. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  153. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +63 -95
  154. package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  155. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +2 -1
  156. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  157. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  158. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  159. package/src/sap/ui/fl/write/api/LocalResetAPI.js +9 -8
  160. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +3 -7
  161. package/src/sap/ui/fl/write/api/SACIntegrationUpdateVariant.js +78 -0
  162. package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +9 -1
  163. package/src/sap/ui/fl/apply/_internal/DelegateMediatorNew.js +0 -193
  164. package/src/sap/ui/fl/apply/_internal/flexState/appDescriptorChanges/prepareAppDescriptorMap.js +0 -39
@@ -7,13 +7,13 @@
7
7
  sap.ui.define([
8
8
  "sap/ui/core/Component",
9
9
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
10
- "sap/ui/fl/ChangePersistenceFactory",
10
+ "sap/ui/fl/apply/_internal/flexState/FlexState",
11
11
  "sap/ui/fl/Utils",
12
12
  "sap/base/Log"
13
13
  ], function(
14
14
  Component,
15
15
  ManifestUtils,
16
- ChangePersistenceFactory,
16
+ FlexState,
17
17
  Utils,
18
18
  Log
19
19
  ) {
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @class
27
27
  * @constructor
28
28
  * @author SAP SE
29
- * @version 1.123.1
29
+ * @version 1.124.1
30
30
  * @since 1.27.0
31
31
  * @private
32
32
  * @ui5-restricted sap.ui.fl, sap.ui.core
@@ -43,10 +43,6 @@ sap.ui.define([
43
43
  }
44
44
 
45
45
  function getExtensionModules(aCodeExtModuleNames) {
46
- if (aCodeExtModuleNames.length === 0) {
47
- return Promise.resolve([]);
48
- }
49
-
50
46
  return new Promise(function(resolve) {
51
47
  sap.ui.require(
52
48
  aCodeExtModuleNames,
@@ -74,7 +70,6 @@ sap.ui.define([
74
70
  ControllerExtension.prototype.getControllerExtensions = function(sControllerName, sComponentId, bAsync) {
75
71
  if (bAsync) {
76
72
  if (!sComponentId) {
77
- Log.warning("No component ID for determining the anchor of the code extensions was passed.");
78
73
  // always return a promise if async
79
74
  return Promise.resolve([]);
80
75
  }
@@ -83,18 +78,17 @@ sap.ui.define([
83
78
  var oAppComponent = Utils.getAppComponentForControl(oComponent);
84
79
  // In case an application of a component can not be identified, ex: FLP plugins components, return a promise of no extension
85
80
  if (!oAppComponent) {
86
- Log.warning("No application component for determining the anchor of the code extensions was identified.");
87
81
  return Promise.resolve([]);
88
82
  }
89
83
  if (!Utils.isApplication(oAppComponent.getManifestObject())) {
90
- // we only consider components whose type is application. Otherwise, we might send request for components that can never have changes.
84
+ // we only consider components whose type is application
91
85
  return Promise.resolve([]);
92
86
  }
93
87
  var sFlexReference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
94
88
 
95
- var oChangePersistence = ChangePersistenceFactory.getChangePersistenceForComponent(sFlexReference);
96
- return oChangePersistence.getChangesForComponent().then(function(aChanges) {
97
- var aExtensionModules = aChanges.filter(function(oChange) {
89
+ return FlexState.waitForInitialization(sFlexReference).then(() => {
90
+ const aFlexObjects = FlexState.getFlexObjectsDataSelector().get({reference: sFlexReference});
91
+ var aExtensionModules = aFlexObjects.filter(function(oChange) {
98
92
  return isCodeExt(oChange) && isForController(sControllerName, oChange);
99
93
  }).map(function(oChange) {
100
94
  return oChange.getModuleName();
@@ -104,9 +98,8 @@ sap.ui.define([
104
98
  });
105
99
  }
106
100
 
107
- Log.warning("Synchronous extensions are not supported via UI5 Flexibility");
108
101
  return [];
109
102
  };
110
103
 
111
104
  return ControllerExtension;
112
- });
105
+ });
@@ -13,7 +13,6 @@ sap.ui.define([
13
13
  "sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor",
14
14
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
15
15
  "sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks",
16
- "sap/ui/fl/apply/_internal/DelegateMediator",
17
16
  "sap/ui/fl/apply/api/DelegateMediatorAPI",
18
17
  "sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration",
19
18
  "sap/ui/base/DesignTime",
@@ -28,7 +27,6 @@ sap.ui.define([
28
27
  Preprocessor,
29
28
  ManifestUtils,
30
29
  ComponentLifecycleHooks,
31
- DelegateMediator,
32
30
  DelegateMediatorAPI,
33
31
  ChangeHandlerRegistration,
34
32
  DesignTime
@@ -42,7 +40,7 @@ sap.ui.define([
42
40
  * @class
43
41
  * @constructor
44
42
  * @author SAP SE
45
- * @version 1.123.1
43
+ * @version 1.124.1
46
44
  * @since 1.43.0
47
45
  * @private
48
46
  */
@@ -89,21 +87,18 @@ sap.ui.define([
89
87
  ExtensionPoint.registerExtensionProvider(getExtensionPointProvider);
90
88
  }
91
89
 
92
- function registerDefaultDelegate() {
93
- DelegateMediatorAPI.registerDefaultDelegate({
90
+ function registerModelSpecificReadDelegates() {
91
+ DelegateMediatorAPI.registerReadDelegate({
94
92
  modelType: "sap.ui.model.odata.v4.ODataModel",
95
- delegate: "sap/ui/fl/write/_internal/delegates/ODataV4ReadDelegate",
96
- delegateType: DelegateMediator.types.READONLY
93
+ delegate: "sap/ui/fl/write/_internal/delegates/ODataV4ReadDelegate"
97
94
  });
98
95
  DelegateMediatorAPI.registerReadDelegate({
99
96
  modelType: "sap.ui.model.odata.v2.ODataModel",
100
- delegate: "sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate",
101
- delegateType: DelegateMediator.types.READONLY
97
+ delegate: "sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate"
102
98
  });
103
99
  DelegateMediatorAPI.registerReadDelegate({
104
100
  modelType: "sap.ui.model.odata.ODataModel",
105
- delegate: "sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate",
106
- delegateType: DelegateMediator.types.READONLY
101
+ delegate: "sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate"
107
102
  });
108
103
  }
109
104
 
@@ -120,7 +115,7 @@ sap.ui.define([
120
115
  registerXMLPreprocessor();
121
116
  registerDescriptorChangeHandler();
122
117
  registerExtensionPointProvider();
123
- registerDefaultDelegate();
118
+ registerModelSpecificReadDelegates();
124
119
  };
125
120
 
126
121
  return RegistrationDelegator;
@@ -8,24 +8,24 @@ sap.ui.define([
8
8
  "sap/base/util/merge",
9
9
  "sap/ui/core/util/reflection/XmlTreeModifier",
10
10
  "sap/ui/core/Component",
11
+ "sap/ui/fl/apply/_internal/changes/Applier",
11
12
  "sap/ui/fl/apply/_internal/changes/Utils",
12
13
  "sap/ui/fl/apply/_internal/flexState/changes/UIChangesState",
14
+ "sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
13
15
  "sap/ui/fl/apply/_internal/flexState/FlexState",
14
16
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
15
- "sap/ui/fl/apply/api/ControlVariantApplyAPI",
16
- "sap/ui/fl/apply/_internal/changes/Applier",
17
17
  "sap/ui/fl/Utils",
18
18
  "sap/base/Log"
19
19
  ], function(
20
20
  merge,
21
21
  XmlTreeModifier,
22
22
  Component,
23
+ Applier,
23
24
  ChangesUtils,
24
25
  UIChangesState,
26
+ VariantManagementState,
25
27
  FlexState,
26
28
  ManifestUtils,
27
- ControlVariantApplyAPI,
28
- Applier,
29
29
  Utils,
30
30
  Log
31
31
  ) {
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @class
39
39
  * @constructor
40
40
  * @author SAP SE
41
- * @version 1.123.1
41
+ * @version 1.124.1
42
42
  * @since 1.27.0
43
43
  * @private
44
44
  */
@@ -104,6 +104,9 @@ sap.ui.define([
104
104
  }
105
105
 
106
106
  const sReference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
107
+
108
+ await FlexState.waitForInitialization(sReference);
109
+
107
110
  const mPropertyBag = merge({
108
111
  appComponent: oAppComponent,
109
112
  modifier: XmlTreeModifier,
@@ -145,35 +148,28 @@ sap.ui.define([
145
148
  * @public
146
149
  */
147
150
  XmlPreprocessor.getCacheKey = async function(mProperties) {
148
- var oComponent = Component.getComponentById(mProperties.componentId);
149
- var oAppComponent = Utils.getAppComponentForControl(oComponent);
151
+ const oComponent = Component.getComponentById(mProperties.componentId);
152
+ const oAppComponent = Utils.getAppComponentForControl(oComponent);
150
153
 
151
154
  // no caching possible with startup parameter based variants
152
155
  if (Utils.isVariantByStartupParameter(oAppComponent)) {
153
156
  return undefined;
154
157
  }
155
158
 
156
- var sFlexReference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
157
-
159
+ const sFlexReference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
158
160
  let sCacheKey = XmlPreprocessor.NOTAG;
159
161
  if (sFlexReference) {
160
162
  const oWrappedChangeFileContent = await FlexState.getStorageResponse(sFlexReference);
161
163
  if (oWrappedChangeFileContent?.cacheKey) {
162
164
  sCacheKey = trimEtag(oWrappedChangeFileContent.cacheKey);
163
165
 
164
- const oVariantModel = await ControlVariantApplyAPI.getVariantModel(oAppComponent);
165
166
  // If there are no changes, the standard variant is created after the variant management control is instantiated
166
167
  // When the cache key is calculated before this happens, the standard variant id is unknown
167
168
  // To avoid inconsistencies between page load and navigation scenarios, all standard variants are filtered
168
- var aVariantManagementControlIds = oVariantModel.getVariantManagementControlIds();
169
- var aCurrentControlVariantIds = oVariantModel.getCurrentControlVariantIds()
170
- .filter(function(sVariantId) {
171
- // FIXME: The standard variant flag should be part of the variant instance
172
- // This can be changed once the variant data selector is ready
173
- // For now rely on the fact that standard variants have the same name as the vm control
174
- return !aVariantManagementControlIds.includes(sVariantId);
175
- });
176
- sCacheKey = concatControlVariantIdWithCacheKey(sCacheKey, aCurrentControlVariantIds.join("-"));
169
+ const aFilteredCurrentControlVariantIds = VariantManagementState.getAllCurrentVariants(sFlexReference)
170
+ .filter((oVariant) => !oVariant.getStandardVariant())
171
+ .map((oVariant) => oVariant.getId());
172
+ sCacheKey = concatControlVariantIdWithCacheKey(sCacheKey, aFilteredCurrentControlVariantIds.join("-"));
177
173
  }
178
174
  }
179
175
 
@@ -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.123.1
47
+ * @version 1.124.1
48
48
  * @public
49
49
  */
50
50
  var ControlVariantApplyAPI = /** @lends sap.ui.fl.apply.api.ControlVariantApplyAPI */{
@@ -5,11 +5,9 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/ui/fl/apply/_internal/DelegateMediator",
9
- "sap/ui/fl/apply/_internal/DelegateMediatorNew"
8
+ "sap/ui/fl/apply/_internal/DelegateMediator"
10
9
  ], function(
11
- DelegateMediator,
12
- DelegateMediatorNew
10
+ DelegateMediator
13
11
  ) {
14
12
  "use strict";
15
13
 
@@ -22,85 +20,42 @@ sap.ui.define([
22
20
  * @ui5-restricted
23
21
  */
24
22
  const DelegateMediatorAPI = /** @lends sap.ui.fl.apply.api.DelegateMediatorAPI */{
25
- // @deprecated
26
- types: {
27
- READONLY: DelegateMediator.types.READONLY,
28
- WRITEONLY: DelegateMediator.types.WRITEONLY,
29
- COMPLETE: DelegateMediator.types.COMPLETE
30
- },
31
-
32
23
  /**
33
- * Registers the default delegate by model type.
34
- *
35
- * @param {object} mPropertyBag - Property bag for default delegate
36
- * @param {object} mPropertyBag.modelType - Default delegate model type
37
- * @param {object} mPropertyBag.delegate - Path to default delegate
38
- * @param {object} mPropertyBag.delegateType - Defines the type of the default delegate.
39
- * Please look at <code>DelegageMediatorAPI.types</code> for possible entries
40
- * @param {object} [mPropertyBag.requiredLibraries] - Map of required libraries
41
- * @deprecated since 1.123.0
42
- */
43
- registerDefaultDelegate(mPropertyBag) {
44
- DelegateMediator.registerDefaultDelegate(mPropertyBag);
45
- },
46
-
47
- /**
48
- * Register model specific read delegate by the model type.
24
+ * Register model-specific read delegate by the model type.
49
25
  *
50
26
  * @param {object} mPropertyBag - Property bag for read delegate
51
27
  * @param {object} mPropertyBag.modelType - Read delegate model type
52
28
  * @param {object} mPropertyBag.delegate - Path to read delegate
53
29
  */
54
30
  registerReadDelegate(mPropertyBag) {
55
- DelegateMediatorNew.registerReadDelegate(mPropertyBag);
31
+ DelegateMediator.registerReadDelegate(mPropertyBag);
56
32
  },
57
33
 
58
34
  /**
59
- * Registers a control specific write delegate by control type.
35
+ * Registers a control-specific write delegate by control type.
60
36
  *
61
- * @param {object} mPropertyBag - Property bag for control specific delegate
37
+ * @param {object} mPropertyBag - Property bag for control-specific delegate
62
38
  * @param {object} mPropertyBag.controlType - Control type
63
- * @param {object} mPropertyBag.delegate - path to control specific delegate
39
+ * @param {object} mPropertyBag.delegate - Path to control-specific delegate
64
40
  * @param {object} [mPropertyBag.requiredLibraries] - Map of required libraries
65
41
  * @param {object} [mPropertyBag.payload] - Payload for the delegate
66
42
  */
67
43
  registerWriteDelegate(mPropertyBag) {
68
- DelegateMediatorNew.registerWriteDelegate(mPropertyBag);
69
- },
70
-
71
- /**
72
- * Returns the delegate object for the requested control.
73
- *
74
- * @param {object} mPropertyBag - Property bag
75
- * @param {sap.ui.core.Element|DomNode} mPropertyBag.control - Control for which the corresponding delegate should be returned
76
- * @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Control tree modifier
77
- * @param {string} [mPropertyBag.modelType] - Model type; required in case you passed the <code>XmlTreeModifier</code>
78
- * @param {boolean} [mPropertyBag.supportsDefault] - Include default delegate if no instance specific delegate is available
79
- * @returns {Promise.<sap.ui.core.util.reflection.FlexDelegateInfo>} Delegate information including the lazy loaded instance of the delegate
80
- * @deprecated since 1.123.0
81
- */
82
- getDelegateForControl(mPropertyBag) {
83
- return DelegateMediator.getDelegateForControl(
84
- mPropertyBag.control,
85
- mPropertyBag.modifier,
86
- mPropertyBag.modelType,
87
- mPropertyBag.supportsDefault
88
- );
44
+ DelegateMediator.registerWriteDelegate(mPropertyBag);
89
45
  },
90
46
 
91
47
  /**
92
- * Returns the model specific read delegate for the requested control.
93
- * The instancespcific read delegate is returned if available.
48
+ * Returns the model-specific read delegate for the requested control.
49
+ * The instance-specific read delegate is returned if available.
94
50
  *
95
51
  * @param {object} mPropertyBag - Property bag
96
52
  * @param {sap.ui.core.Element|DomNode} mPropertyBag.control - Control for which the corresponding delegate should be returned
97
53
  * @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Control tree modifier
98
54
  * @param {string} [mPropertyBag.modelType] - Model type; required in case you passed the <code>XmlTreeModifier</code>
99
- * @param {boolean} [mPropertyBag.supportsDefault] - Include default delegate if no instance specific delegate is available
100
55
  * @returns {Promise.<sap.ui.core.util.reflection.FlexDelegateInfo>} Delegate information including the lazy loaded instance of the delegate
101
56
  */
102
57
  getReadDelegateForControl(mPropertyBag) {
103
- return DelegateMediatorNew.getReadDelegateForControl(
58
+ return DelegateMediator.getReadDelegateForControl(
104
59
  mPropertyBag.control,
105
60
  mPropertyBag.modifier,
106
61
  mPropertyBag.modelType,
@@ -110,7 +65,7 @@ sap.ui.define([
110
65
 
111
66
  /**
112
67
  * Returns the write delegate for the requested control.
113
- * The instancespecific write delegate is returned if available.
68
+ * The instance-specific write delegate is returned if available.
114
69
  *
115
70
  * @param {object} mPropertyBag - Property bag
116
71
  * @param {sap.ui.core.Element|DomNode} mPropertyBag.control - Control for which the corresponding delegate should be returned
@@ -118,38 +73,10 @@ sap.ui.define([
118
73
  * @returns {Promise.<sap.ui.core.util.reflection.FlexDelegateInfo>} Delegate information including the lazy loaded instance of the delegate
119
74
  */
120
75
  getWriteDelegateForControl(mPropertyBag) {
121
- return DelegateMediatorNew.getWriteDelegateForControl(
76
+ return DelegateMediator.getWriteDelegateForControl(
122
77
  mPropertyBag.control,
123
78
  mPropertyBag.modifier
124
79
  );
125
- },
126
-
127
- /**
128
- * Returns a list of library names which needs to be required to get default delegates loaded.
129
- * @returns {array} List of library names
130
- * @deprecated since 1.123.0
131
- */
132
- getKnownDefaultDelegateLibraries() {
133
- return DelegateMediator.getKnownDefaultDelegateLibraries();
134
- },
135
-
136
- /**
137
- * Returns a list of required libraries for the given default delegate.
138
- * If it is not a default delegate, an empty list is returned.
139
- *
140
- * @param {object} mPropertyBag - Property bag
141
- * @param {string} mPropertyBag.sDelegateName - Name of the delegate
142
- * @param {sap.ui.core.Element} mPropertyBag.oControl - Control for which the corresponding delegate was returned
143
- * @param {string} [mPropertyBag.sModelType] - Model type, if none is provided the default model of oControl is taken instead
144
- * @returns {string[]} Required libraries
145
- * @deprecated since 1.123.0
146
- */
147
- getRequiredLibrariesForDefaultDelegate(mPropertyBag) {
148
- return DelegateMediator.getRequiredLibrariesForDefaultDelegate(
149
- mPropertyBag.delegateName,
150
- mPropertyBag.control,
151
- mPropertyBag.modelType
152
- );
153
80
  }
154
81
  };
155
82
 
@@ -8,10 +8,10 @@ sap.ui.define([
8
8
  "sap/base/Log",
9
9
  "sap/ui/core/util/reflection/JsControlTreeModifier",
10
10
  "sap/ui/fl/apply/_internal/controlVariants/Utils",
11
+ "sap/ui/fl/apply/_internal/flexState/FlexState",
11
12
  "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
12
13
  "sap/ui/fl/initial/_internal/FlexConfiguration",
13
14
  "sap/ui/fl/initial/_internal/FlexInfoSession",
14
- "sap/ui/fl/ChangePersistenceFactory",
15
15
  "sap/ui/fl/FlexControllerFactory",
16
16
  "sap/ui/fl/Layer",
17
17
  "sap/ui/fl/Utils",
@@ -20,10 +20,10 @@ sap.ui.define([
20
20
  Log,
21
21
  JsControlTreeModifier,
22
22
  VariantUtils,
23
+ FlexState,
23
24
  ManifestUtils,
24
25
  FlexConfiguration,
25
26
  FlexInfoSession,
26
- ChangePersistenceFactory,
27
27
  FlexControllerFactory,
28
28
  Layer,
29
29
  Utils,
@@ -58,6 +58,10 @@ sap.ui.define([
58
58
  return Promise.reject(sMessage);
59
59
  }
60
60
 
61
+ function filterByLayer(oChange) {
62
+ return oChange.getLayer() === Layer.USER;
63
+ }
64
+
61
65
  function filterByValidFileType(oChange) {
62
66
  return oChange.getFileType() === "change";
63
67
  }
@@ -86,15 +90,14 @@ sap.ui.define([
86
90
  return logAndReject("App Component could not be determined");
87
91
  }
88
92
 
89
- var oChangePersistence = ChangePersistenceFactory.getChangePersistenceForControl(oAppComponent);
90
- return oChangePersistence.getChangesForComponent({currentLayer: Layer.USER, includeCtrlVariants: true})
91
- .then(function(aChanges) {
92
- return aChanges
93
- .filter(filterByValidFileType)
94
- .filter(filterBySelectors.bind(this, oAppComponent, mPropertyBag.selectors))
95
- .filter(filterByChangeType.bind(this, mPropertyBag.changeTypes))
96
- .length > 0;
97
- }.bind(this));
93
+ const sFlexReference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
94
+ const aFlexObjects = FlexState.getFlexObjectsDataSelector().get({reference: sFlexReference})
95
+ .filter(filterByValidFileType)
96
+ .filter(filterByLayer)
97
+ .filter(filterBySelectors.bind(this, oAppComponent, mPropertyBag.selectors))
98
+ .filter(filterByChangeType.bind(this, mPropertyBag.changeTypes));
99
+
100
+ return Promise.resolve(aFlexObjects.length > 0);
98
101
  },
99
102
 
100
103
  /**
@@ -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.123.1
25
+ * @version 1.124.1
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.123.1
19
+ * @version 1.124.1
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.123.1
21
+ * @version 1.124.1
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.123.1
17
+ * @version 1.124.1
18
18
  * @private
19
19
  * @ui5-restricted change handlers
20
20
  */
@@ -23,24 +23,13 @@ sap.ui.define([
23
23
  return typeof fn === "function";
24
24
  }
25
25
 
26
- function getModelType(mChangeContent) {
27
- if (mChangeContent.modelType) {
28
- return mChangeContent.modelType;
29
- } else if (mChangeContent.oDataServiceVersion) {
30
- // fallback for changes created with old addODataProperty action
31
- // that was replaced by default OData V2 delegate
32
- return "sap.ui.model.odata.v2.ODataModel";
33
- }
34
- return undefined;
35
- }
36
-
37
26
  /**
38
27
  * Base Change Handler for AddViaDelegate
39
28
  *
40
29
  * @constructor
41
30
  * @alias sap.ui.fl.changeHandler.BaseAddViaDelegate
42
31
  * @author SAP SE
43
- * @version 1.123.1
32
+ * @version 1.124.1
44
33
  * @private
45
34
  */
46
35
  const BaseAddViaDelegate = {
@@ -56,7 +45,6 @@ sap.ui.define([
56
45
  * @param {string} mAddViaDelegateSettings.fieldSuffix - Aggregation name to be passed to the delegate
57
46
  * @param {boolean|function} [mAddViaDelegateSettings.skipCreateLabel] - Skip delegate method, is a function is passed it has to return a boolean
58
47
  * @param {boolean|function} [mAddViaDelegateSettings.skipCreateLayout] - Skip delegate method, is a function is passed it has to return a boolean
59
- * @param {boolean} [mAddViaDelegateSettings.supportsDefault] - Are default delegates supported?
60
48
  * @return {any} The addViaDelegate change handler object
61
49
  * @public
62
50
  */
@@ -88,14 +76,11 @@ sap.ui.define([
88
76
  // or the handler opts out
89
77
 
90
78
  const oControl = mPropertyBag.modifier.bySelector(mChange.getSelector(), mPropertyBag.appComponent);
91
- const sModelType = getModelType(mChange.getContent());
92
79
 
93
80
  const DelegateMediatorAPI = await requireAsync("sap/ui/fl/apply/api/DelegateMediatorAPI");
94
- const oDelegate = await DelegateMediatorAPI.getDelegateForControl({
81
+ const oDelegate = await DelegateMediatorAPI.getWriteDelegateForControl({
95
82
  control: oControl,
96
- modifier: mPropertyBag.modifier,
97
- modelType: sModelType,
98
- supportsDefault: mAddViaDelegateSettings.supportsDefault
83
+ modifier: mPropertyBag.modifier
99
84
  });
100
85
  const bCondensingSupported = !isFunction(oDelegate.instance.createLayout);
101
86
  return bCondensingSupported || skipCreateLayout(mChange.getSupportInformation().oDataInformation);
@@ -119,6 +104,9 @@ sap.ui.define([
119
104
  }
120
105
 
121
106
  async function getControlsFromDelegate(oChangeContent, mDelegate, mPropertyBag, oChangeODataInformation) {
107
+ if (!mDelegate) {
108
+ return undefined;
109
+ }
122
110
  const mDelegatePropertyBag = merge({
123
111
  aggregationName: mAddViaDelegateSettings.aggregationName,
124
112
  payload: mDelegate.payload || {},
@@ -180,15 +168,17 @@ sap.ui.define([
180
168
  // so that the addProperty-hook can access it and enhance it
181
169
  oChange.setRevertData(oRevertData);
182
170
 
183
- const sModelType = getModelType(oChangeContent);
184
-
185
171
  const DelegateMediatorAPI = await requireAsync("sap/ui/fl/apply/api/DelegateMediatorAPI");
186
- const mDelegate = await DelegateMediatorAPI.getDelegateForControl({
172
+ const mDelegate = await DelegateMediatorAPI.getWriteDelegateForControl({
187
173
  control: oControl,
188
- modifier: mPropertyBag.modifier,
189
- modelType: sModelType,
190
- supportsDefault: mAddViaDelegateSettings.supportsDefault
174
+ modifier: mPropertyBag.modifier
191
175
  });
176
+ if (!mDelegate) {
177
+ Base.markAsNotApplicable(
178
+ `No delegate found for control ${mPropertyBag.modifier.getId(oControl)}`,
179
+ /* bAsync */false
180
+ );
181
+ }
192
182
  const mInnerControls = await getControlsFromDelegate(
193
183
  oChangeContent,
194
184
  mDelegate,
@@ -274,7 +264,6 @@ sap.ui.define([
274
264
  * @param {string} mSpecificChangeInfo.parentId FormContainer where the new control will be added
275
265
  * @param {number} mSpecificChangeInfo.index The index where the field will be added
276
266
  * @param {string} [mSpecificChangeInfo.oDataServiceVersion] The OData service version
277
- * @param {string} [mSpecificChangeInfo.modelType] Then UI5 model type name, only pass it if default delegate should be taken
278
267
  * @param {Object} mPropertyBag The property bag containing the App Component
279
268
  * @param {object} mPropertyBag.modifier Modifier for the controls
280
269
  * @param {object} mPropertyBag.appComponent Application component
@@ -319,10 +308,6 @@ sap.ui.define([
319
308
  // used to connect to change handler mediator
320
309
  oContent.oDataServiceVersion = mSpecificChangeInfo.oDataServiceVersion;
321
310
  }
322
- if (mSpecificChangeInfo.modelType && mAddViaDelegateSettings.supportsDefault) {
323
- // used to connect to default delegate
324
- oContent.modelType = mSpecificChangeInfo.modelType;
325
- }
326
311
  oChange.setContent(oContent);
327
312
  },
328
313
 
@@ -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.123.1
25
+ * @version 1.124.1
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.123.1
20
+ * @version 1.124.1
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.123.1
24
+ * @version 1.124.1
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.123.1
22
+ * @version 1.124.1
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.123.1
15
+ * @version 1.124.1
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.123.1
21
+ * @version 1.124.1
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.123.1
25
+ * @version 1.124.1
26
26
  * @since 1.36
27
27
  * @private
28
28
  */