@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
@@ -0,0 +1,78 @@
1
+
2
+ /*!
3
+ * OpenUI5
4
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
5
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
6
+ */
7
+
8
+ sap.ui.define([
9
+ "sap/ui/fl/util/changePropertyValueByPath",
10
+ "sap/ui/fl/util/DescriptorChangeCheck"
11
+ ], function(
12
+ changePropertyValueByPath,
13
+ DescriptorChangeCheck
14
+ ) {
15
+ "use strict";
16
+
17
+ const SUPPORTED_OPERATIONS = ["UPDATE", "UPSERT", "DELETE", "INSERT"];
18
+ const SUPPORTED_PROPERTIES = ["settings/*"];
19
+
20
+ const SUPPORTED_TYPES = {
21
+ settings: typeof {}
22
+ };
23
+
24
+ const RESOURCE_MODEL = "sap.ui.model.resource.ResourceModel";
25
+
26
+ /**
27
+ * Descriptor change merger for change type <code>appdescr_ui5_changeModel</code>.
28
+ * Changes the settings object of the model by changing the manifest value <code>sap.ui5/models/modelId</code>.
29
+ *
30
+ * Available for both runtime and build {@link sap.ui.fl.apply._internal.changes.descriptor.RegistrationBuild}.
31
+ *
32
+ * @namespace
33
+ * @alias sap.ui.fl.apply._internal.changes.descriptor.app.ChangeModel
34
+ * @version 1.130.1
35
+ * @private
36
+ * @ui5-restricted sap.ui.fl.apply._internal
37
+ */
38
+ const ChangeModel = /** @lends sap.ui.fl.apply._internal.changes.descriptor.app.ChangeModel */ {
39
+
40
+ /**
41
+ * Applies the <code>appdescr_ui5_changeModel</code> change to the manifest.
42
+ *
43
+ * @param {object} oManifest - Original manifest
44
+ * @param {sap.ui.fl.apply._internal.flexObjects.AppDescriptorChange} oChange - Change with type <code>appdescr_ui5_changeModel</code>
45
+ * @param {object} oChange.content - Details of the change
46
+ * @param {string} oChange.content.modelId - ID of <code>sap.ui5/models/modelId</code> that is being changed
47
+ * @param {object|array} oChange.content.entityPropertyChange - Entity property change or an array of multiple entity property changes
48
+ * @param {string} oChange.content.entityPropertyChange.propertyPath - Path to the property which should be changed. Supported properties: <code>settings</code>
49
+ * @param {string} oChange.content.entityPropertyChange.operation - Operation that is performed on the property defined under propertyPath. Possible values: <code>UPDATE</code> and <code>UPSERT</code>
50
+ * @param {string} oChange.content.entityPropertyChange.propertyValue - New value of the <code>model</code> property defined under propertyPath
51
+ * @returns {object} Updated manifest with changed <code>sap.ui5/models/model</code>
52
+ *
53
+ * @private
54
+ * @ui5-restricted sap.ui.fl.apply._internal
55
+ */
56
+ applyChange(oManifest, oChange) {
57
+ const oModels = oManifest["sap.ui5"].models;
58
+ const oChangeContent = oChange.getContent();
59
+ DescriptorChangeCheck.checkEntityPropertyChange(oChangeContent, SUPPORTED_PROPERTIES, SUPPORTED_OPERATIONS, null, null, SUPPORTED_TYPES);
60
+ if (oModels) {
61
+ const oModel = oModels[oChangeContent.modelId];
62
+ if (oModel) {
63
+ if (oModel.type === RESOURCE_MODEL) {
64
+ throw new Error(`Model '${oChangeContent.modelId}' is of type '${RESOURCE_MODEL}'. Changing models of type '${RESOURCE_MODEL}' are not supported.`);
65
+ }
66
+ changePropertyValueByPath(oChangeContent.entityPropertyChange, oModel);
67
+ } else {
68
+ throw new Error(`Nothing to update. Model with ID "${oChangeContent.modelId}" does not exist in the manifest.json.`);
69
+ }
70
+ } else {
71
+ throw new Error("sap.ui5/models section have not been found in manifest.json.");
72
+ }
73
+ return oManifest;
74
+ }
75
+ };
76
+
77
+ return ChangeModel;
78
+ });
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  *
21
21
  * @namespace
22
22
  * @alias sap.ui.fl.apply._internal.changes.descriptor.ui5.SetFlexExtensionPointEnabled
23
- * @version 1.129.0
23
+ * @version 1.130.1
24
24
  * @private
25
25
  * @ui5-restricted sap.ui.fl.apply._internal
26
26
  */
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @namespace
23
23
  * @alias sap.ui.fl.apply._internal.changes.descriptor.ui5.SetMinUI5Version
24
- * @version 1.129.0
24
+ * @version 1.130.1
25
25
  * @private
26
26
  * @ui5-restricted sap.ui.fl.apply._internal
27
27
  */
@@ -12,7 +12,7 @@ sap.ui.define([], function() {
12
12
  *
13
13
  * @namespace sap.ui.fl.initial._internal.connectors.Utils
14
14
  * @since 1.70
15
- * @version 1.129.0
15
+ * @version 1.130.1
16
16
  * @private
17
17
  * @ui5-restricted sap.ui.fl.initial._internal, sap.ui.fl.write._internal
18
18
  */
@@ -36,7 +36,7 @@ sap.ui.define([
36
36
  * @class
37
37
  * @constructor
38
38
  * @author SAP SE
39
- * @version 1.129.0
39
+ * @version 1.130.1
40
40
  */
41
41
  var Processor;
42
42
 
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  * @alias sap.ui.fl.apply._internal.extensionPoint.Registry
19
19
  *
20
20
  * @author SAP SE
21
- * @version 1.129.0
21
+ * @version 1.130.1
22
22
  *
23
23
  * @private
24
24
  * @ui5-restricted sap.ui.fl
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  * @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
19
19
  * @alias sap.ui.fl.apply._internal.flexObjects.AnnotationChange
20
20
  * @since 1.128
21
- * @version 1.129.0
21
+ * @version 1.130.1
22
22
  * @private
23
23
  * @ui5-restricted
24
24
  */
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  * @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
19
19
  * @alias sap.ui.fl.apply._internal.flexObjects.AppDescriptorChange
20
20
  * @since 1.105
21
- * @version 1.129.0
21
+ * @version 1.130.1
22
22
  * @private
23
23
  * @ui5-restricted
24
24
  */
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @extends sap.ui.fl.apply._internal.flexObjects.Variant
33
33
  * @alias sap.ui.fl.apply._internal.flexObjects.CompVariant
34
34
  * @since 1.103
35
- * @version 1.129.0
35
+ * @version 1.130.1
36
36
  * @private
37
37
  * @ui5-restricted sap.ui.fl, sap.ui.comp
38
38
  */
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  * @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
21
21
  * @alias sap.ui.fl.apply._internal.flexObjects.ControllerExtensionChange
22
22
  * @since 1.105
23
- * @version 1.129.0
23
+ * @version 1.130.1
24
24
  * @private
25
25
  * @ui5-restricted sap.ui.fl
26
26
  */
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @extends sap.ui.fl.apply._internal.flexObjects.Variant
23
23
  * @alias sap.ui.fl.apply._internal.flexObjects.FlVariant
24
24
  * @since 1.104
25
- * @version 1.129.0
25
+ * @version 1.130.1
26
26
  * @private
27
27
  * @ui5-restricted sap.ui.fl
28
28
  */
@@ -69,7 +69,7 @@ sap.ui.define([
69
69
  * @extends sap.ui.base.ManagedObject
70
70
  * @alias sap.ui.fl.apply._internal.flexObjects.FlexObject
71
71
  * @since 1.100
72
- * @version 1.129.0
72
+ * @version 1.130.1
73
73
  * @private
74
74
  * @ui5-restricted sap.ui.fl
75
75
  */
@@ -15,6 +15,7 @@ sap.ui.define([
15
15
  "sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor",
16
16
  "sap/ui/fl/apply/_internal/flexObjects/States",
17
17
  "sap/ui/fl/apply/_internal/flexObjects/UIChange",
18
+ "sap/ui/fl/apply/_internal/flexObjects/UpdatableChange",
18
19
  "sap/ui/fl/registry/Settings",
19
20
  "sap/ui/fl/Layer",
20
21
  "sap/ui/fl/LayerUtils",
@@ -31,6 +32,7 @@ sap.ui.define([
31
32
  getVariantAuthor,
32
33
  States,
33
34
  UIChange,
35
+ UpdatableChange,
34
36
  Settings,
35
37
  Layer,
36
38
  LayerUtils,
@@ -39,13 +41,13 @@ sap.ui.define([
39
41
  "use strict";
40
42
 
41
43
  const FLEX_OBJECT_TYPES = {
42
- BASE_FLEX_OBJECT: FlexObject,
43
44
  COMP_VARIANT_OBJECT: CompVariant,
44
45
  FL_VARIANT_OBJECT: FlVariant,
45
46
  CONTROLLER_EXTENSION: ControllerExtensionChange,
46
47
  APP_DESCRIPTOR_CHANGE: AppDescriptorChange,
47
48
  ANNOTATION_CHANGE: AnnotationChange,
48
- UI_CHANGE: UIChange
49
+ UI_CHANGE: UIChange,
50
+ UPDATABLE_CHANGE: UpdatableChange
49
51
  };
50
52
 
51
53
  function getFlexObjectClass(oNewFileContent) {
@@ -59,6 +61,8 @@ sap.ui.define([
59
61
  return FLEX_OBJECT_TYPES.APP_DESCRIPTOR_CHANGE;
60
62
  } else if (oNewFileContent.fileType === "annotation_change") {
61
63
  return FLEX_OBJECT_TYPES.ANNOTATION_CHANGE;
64
+ } else if (oNewFileContent.fileType === "change" && oNewFileContent.changeType === "defaultVariant") {
65
+ return FLEX_OBJECT_TYPES.UPDATABLE_CHANGE;
62
66
  }
63
67
  return FLEX_OBJECT_TYPES.UI_CHANGE;
64
68
  }
@@ -102,7 +106,7 @@ sap.ui.define([
102
106
  *
103
107
  * @namespace sap.ui.fl.apply._internal.flexObjects.FlexObjectFactory
104
108
  * @since 1.100
105
- * @version 1.129.0
109
+ * @version 1.130.1
106
110
  * @private
107
111
  * @ui5-restricted sap.ui.fl
108
112
  */
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
27
27
  * @alias sap.ui.fl.apply._internal.flexObjects.UIChange
28
28
  * @since 1.109
29
- * @version 1.129.0
29
+ * @version 1.130.1
30
30
  * @private
31
31
  * @ui5-restricted
32
32
  */
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @extends sap.ui.fl.apply._internal.flexObjects.FlexObject
20
20
  * @alias sap.ui.fl.apply._internal.flexObjects.Variant
21
21
  * @since 1.103
22
- * @version 1.129.0
22
+ * @version 1.130.1
23
23
  * @private
24
24
  * @ui5-restricted sap.ui.fl
25
25
  */
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @function
23
23
  * @since 1.121
24
- * @version 1.129.0
24
+ * @version 1.130.1
25
25
  * @private
26
26
  * @ui5-restricted sap.ui.fl
27
27
  * @alias module:sap/ui/fl/apply/_internal/flexState/compVariants/getVariantAuthor
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * @namespace
40
40
  * @alias sap.ui.fl.apply._internal.flexState.FlexObjectState
41
41
  * @since 1.83
42
- * @version 1.129.0
42
+ * @version 1.130.1
43
43
  * @private
44
44
  * @ui5-restricted sap.ui.fl
45
45
  */
@@ -89,7 +89,7 @@ sap.ui.define([
89
89
  *
90
90
  * @namespace sap.ui.fl.apply._internal.flexState.FlexState
91
91
  * @since 1.73
92
- * @version 1.129.0
92
+ * @version 1.130.1
93
93
  * @private
94
94
  * @ui5-restricted sap.ui.fl.apply._internal
95
95
  */
@@ -264,10 +264,6 @@ sap.ui.define([
264
264
  oFlexObjectsDataSelector.checkUpdate({ reference: sReference });
265
265
  }
266
266
 
267
- function getCompVariantsMap(sReference) {
268
- return getInstanceEntryOrThrowError(sReference, "compVariants");
269
- }
270
-
271
267
  function buildRuntimePersistence(oFlexStateInstance, aExternalFlexObjects) {
272
268
  const oStorageResponse = oFlexStateInstance.storageResponse;
273
269
  var oRuntimePersistence = {
@@ -345,7 +341,6 @@ sap.ui.define([
345
341
  }
346
342
  if (!_mInstances[sReference].storageResponse) {
347
343
  _mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
348
- _mInstances[sReference].maxLayer = FlexInfoSession.getByReference(sReference).maxLayer;
349
344
  // Flex objects need to be recreated
350
345
  delete _mInstances[sReference].runtimePersistence;
351
346
  bDataUpdated = true;
@@ -370,9 +365,10 @@ sap.ui.define([
370
365
 
371
366
  function filterByMaxLayer(sReference, mResponse) {
372
367
  const mFilteredReturn = merge({}, mResponse);
368
+ mFilteredReturn.changes = { ...StorageUtils.getEmptyFlexDataResponse(), ...mFilteredReturn.changes };
373
369
  const mFlexObjects = mFilteredReturn.changes;
370
+ const oFlexInfoSession = FlexInfoSession.getByReference(sReference);
374
371
  if (LayerUtils.isLayerFilteringRequired(sReference)) {
375
- const oFlexInfoSession = FlexInfoSession.getByReference(sReference);
376
372
  each(_mFlexObjectInfo, function(iIndex, mFlexObjectInfo) {
377
373
  mFlexObjectInfo.pathInResponse.forEach(function(sPath) {
378
374
  const aFilterByMaxLayer = ObjectPath.get(sPath, mFlexObjects).filter(function(oChangeDefinition) {
@@ -382,6 +378,7 @@ sap.ui.define([
382
378
  });
383
379
  });
384
380
  }
381
+ _mInstances[sReference].maxLayer = oFlexInfoSession.maxLayer;
385
382
  return mFilteredReturn;
386
383
  }
387
384
 
@@ -549,6 +546,32 @@ sap.ui.define([
549
546
  return !!_mInstances[sReference];
550
547
  };
551
548
 
549
+ /**
550
+ * Updates the saved backend response and the runtime persistence with new data.
551
+ * The new data must not be already available in the storageResponse or runtimePersistence.
552
+ * As of now this does not work with nested structures (comp related objects) or ui2personalization.
553
+ *
554
+ * @param {object} mPropertyBag - Contains additional data needed for reading and storing changes
555
+ * @param {string} mPropertyBag.reference - Flex reference of the app
556
+ * @param {object} mPropertyBag.newData - New Data to be added. Needs to have the structure of the storageResponse.changes object
557
+ */
558
+ FlexState.updateWithDataProvided = function(mPropertyBag) {
559
+ if (!_mInstances[mPropertyBag.reference]) {
560
+ initializeEmptyState(mPropertyBag.reference);
561
+ }
562
+ const oInstance = _mInstances[mPropertyBag.reference];
563
+ Object.entries(mPropertyBag.newData).forEach(([sKey, vValue]) => {
564
+ oInstance.unfilteredStorageResponse.changes[sKey].push(...vValue);
565
+ });
566
+ oInstance.storageResponse = filterByMaxLayer(mPropertyBag.reference, oInstance.unfilteredStorageResponse);
567
+ oInstance.runtimePersistence.flexObjects =
568
+ [
569
+ ...oInstance.runtimePersistence.flexObjects,
570
+ ...createFlexObjects(filterByMaxLayer(mPropertyBag.reference, { changes: mPropertyBag.newData }))
571
+ ];
572
+ oFlexObjectsDataSelector.checkUpdate({ reference: mPropertyBag.reference });
573
+ };
574
+
552
575
  /**
553
576
  * Triggers a call to the backend to fetch new data and update the runtime persistence
554
577
  *
@@ -563,8 +586,8 @@ sap.ui.define([
563
586
  */
564
587
  FlexState.update = async function(mPropertyBag) {
565
588
  enhancePropertyBag(mPropertyBag);
566
- var sReference = mPropertyBag.reference;
567
- var oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
589
+ const sReference = mPropertyBag.reference;
590
+ const oCurrentRuntimePersistence = _mInstances[sReference].runtimePersistence;
568
591
 
569
592
  const oOldInitPromise = _mInitPromises[sReference].promise;
570
593
  const oNewInitPromise = new Deferred();
@@ -572,8 +595,7 @@ sap.ui.define([
572
595
  await oOldInitPromise;
573
596
  await loadFlexData(mPropertyBag);
574
597
  _mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
575
- _mInstances[sReference].maxLayer = FlexInfoSession.getByReference(sReference).maxLayer;
576
- var bUpdated = updateRuntimePersistence(
598
+ const bUpdated = updateRuntimePersistence(
577
599
  sReference,
578
600
  _mInstances[sReference].storageResponse,
579
601
  oCurrentRuntimePersistence
@@ -743,7 +765,6 @@ sap.ui.define([
743
765
  if (_mInstances[sReference]) {
744
766
  _mInstances[sReference].preparedMaps = {};
745
767
  _mInstances[sReference].storageResponse = filterByMaxLayer(sReference, _mInstances[sReference].unfilteredStorageResponse);
746
- _mInstances[sReference].maxLayer = FlexInfoSession.getByReference(sReference).maxLayer;
747
768
  // Storage response has changed, recreate the flex objects
748
769
  _mInstances[sReference].runtimePersistence = buildRuntimePersistence(
749
770
  _mInstances[sReference],
@@ -834,7 +855,7 @@ sap.ui.define([
834
855
  };
835
856
 
836
857
  FlexState.getCompVariantsMap = function(sReference) {
837
- return getCompVariantsMap(sReference);
858
+ return getInstanceEntryOrThrowError(sReference, "compVariants");
838
859
  };
839
860
 
840
861
  FlexState.callPrepareFunction = function(sMapName, mPropertyBag) {
@@ -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.129.0
105
+ * @version 1.130.1
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.129.0
81
+ * @version 1.130.1
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.129.0
19
+ * @version 1.130.1
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.129.0
23
+ * @version 1.130.1
24
24
  * @private
25
25
  * @ui5-restricted sap.ui.fl
26
26
  */
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  *
42
42
  * @namespace sap.ui.fl.apply._internal.flexState.changes.ExtensionPointState
43
43
  * @since 1.79
44
- * @version 1.129.0
44
+ * @version 1.130.1
45
45
  * @private
46
46
  * @ui5-restricted
47
47
  */
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @namespace
25
25
  * @alias sap.ui.fl.apply._internal.flexState.changes.UIChangesState
26
26
  * @since 1.121
27
- * @version 1.129.0
27
+ * @version 1.130.1
28
28
  * @private
29
29
  * @ui5-restricted
30
30
  */
@@ -0,0 +1,108 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/ui/fl/apply/_internal/flexState/FlexState",
9
+ "sap/ui/fl/apply/_internal/flexState/DataSelector",
10
+ "sap/ui/fl/apply/_internal/flexObjects/CompVariant"
11
+ ], function(
12
+ FlexState,
13
+ DataSelector,
14
+ CompVariant
15
+ ) {
16
+ "use strict";
17
+
18
+ /**
19
+ * Handler class provide data of smart control variant changes and its map.
20
+ *
21
+ * @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantManagementState
22
+ * @since 1.129
23
+ * @version 1.130.1
24
+ * @private
25
+ * @ui5-restricted
26
+ */
27
+ const CompVariantManagementState = {};
28
+
29
+ const sUpdatableChangeNameSpace = "sap.ui.fl.apply._internal.flexObjects.UpdatableChange";
30
+
31
+ const isSetDefaultChange = (oFlexObject) => {
32
+ return oFlexObject?.isA(sUpdatableChangeNameSpace)
33
+ && oFlexObject.getFileType() === "change"
34
+ && oFlexObject.getChangeType() === "defaultVariant";
35
+ };
36
+
37
+ const oSetDefaultDataSelector = new DataSelector({
38
+ id: "compSetDefault",
39
+ parameterKey: "persistencyKey",
40
+ parentDataSelector: FlexState.getFlexObjectsDataSelector(),
41
+ executeFunction(aFlexObjects, mPropertyBag) {
42
+ return aFlexObjects.filter((oFlexObject) =>
43
+ isSetDefaultChange(oFlexObject)
44
+ && String(oFlexObject.getSelector()?.persistencyKey) === mPropertyBag.persistencyKey
45
+ );
46
+ },
47
+ checkInvalidation(mParameters, oUpdateInfo) {
48
+ const bRelevantType = ["addFlexObject", "removeFlexObject"].includes(oUpdateInfo.type);
49
+ return bRelevantType && isSetDefaultChange(oUpdateInfo.updatedObject);
50
+ }
51
+ });
52
+
53
+ /**
54
+ * Access to the variant management set default selector.
55
+ *
56
+ * @returns {object} The data selector for the variant set default changes
57
+ *
58
+ * @private
59
+ * @ui5-restricted sap.ui.fl.qunit
60
+ */
61
+ CompVariantManagementState.getSetDefaultDataSelector = function() {
62
+ return oSetDefaultDataSelector;
63
+ };
64
+
65
+ /**
66
+ * Returns the default variant ID for a given variant management
67
+ *
68
+ * @param {object} mPropertyBag Object with the necessary properties
69
+ * @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
70
+ * @param {string} mPropertyBag.reference - Component reference
71
+ * @param {sap.ui.fl.apply._internal.flexObjects.CompVariant[]} mPropertyBag.variants - Array of variants which exist for the given variant management
72
+ *
73
+ * @returns {string | undefined} ID of the default variant
74
+ *
75
+ * @private
76
+ * @ui5-restricted sap.ui.fl
77
+ */
78
+ CompVariantManagementState.getDefaultVariantId = (mPropertyBag) => {
79
+ const aVariants = mPropertyBag.variants;
80
+ const aVariantIds = aVariants.map((oVariant) => oVariant.getVariantId());
81
+ aVariantIds.push(CompVariant.STANDARD_VARIANT_ID);
82
+
83
+ mPropertyBag.persistencyKey = String(mPropertyBag.persistencyKey);
84
+ const aDefaultChanges = [...oSetDefaultDataSelector.get(mPropertyBag)].reverse();
85
+ const aDefaultVariantIds = aDefaultChanges.map((oChange) => oChange.getContent().defaultVariantName);
86
+
87
+ return aDefaultVariantIds.find((sDefaultVariantId) => aVariantIds.includes(sDefaultVariantId)) || "";
88
+ };
89
+
90
+ /**
91
+ * Returns the 'defaultVariant' changes for a given variant management
92
+ *
93
+ * @param {object} mPropertyBag Object with the necessary properties
94
+ * @param {string} mPropertyBag.persistencyKey - Persistency key of the variant management
95
+ * @param {string} mPropertyBag.reference - Component reference
96
+ *
97
+ * @returns {sap.ui.fl.apply._internal.flexObjects.UpdatableChange[]} 'defaultVariant' changes of the variant management
98
+ *
99
+ * @private
100
+ * @ui5-restricted sap.ui.fl
101
+ */
102
+ CompVariantManagementState.getDefaultChanges = (mPropertyBag) => {
103
+ mPropertyBag.persistencyKey = String(mPropertyBag.persistencyKey);
104
+ return oSetDefaultDataSelector.get(mPropertyBag);
105
+ };
106
+
107
+ return CompVariantManagementState;
108
+ });
@@ -125,7 +125,7 @@ sap.ui.define([
125
125
  *
126
126
  * @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
127
127
  * @since 1.86
128
- * @version 1.129.0
128
+ * @version 1.130.1
129
129
  * @private
130
130
  * @ui5-restricted sap.ui.fl
131
131
  */
@@ -215,7 +215,7 @@ sap.ui.define([
215
215
  *
216
216
  * @function
217
217
  * @since 1.89
218
- * @version 1.129.0
218
+ * @version 1.130.1
219
219
  * @private
220
220
  * @ui5-restricted sap.ui.fl
221
221
  *
@@ -75,7 +75,7 @@ sap.ui.define([
75
75
  *
76
76
  * @namespace sap.ui.fl.apply._internal.flexState.controlVariants.Switcher
77
77
  * @since 1.74
78
- * @version 1.129.0
78
+ * @version 1.130.1
79
79
  * @private
80
80
  * @ui5-restricted
81
81
  */