@openui5/sap.ui.fl 1.92.0 → 1.95.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/{.eslintrc → .eslintrc.json} +0 -0
  2. package/.reuse/dep5 +1 -6
  3. package/THIRDPARTY.txt +4 -10
  4. package/package.json +3 -3
  5. package/src/sap/ui/fl/.library +1 -1
  6. package/src/sap/ui/fl/Cache.js +1 -1
  7. package/src/sap/ui/fl/Change.js +44 -27
  8. package/src/sap/ui/fl/ChangePersistence.js +63 -22
  9. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  10. package/src/sap/ui/fl/ControlPersonalizationAPI.js +1 -1
  11. package/src/sap/ui/fl/EventHistory.js +1 -1
  12. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  13. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  14. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  15. package/src/sap/ui/fl/FlexController.js +1 -1
  16. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  17. package/src/sap/ui/fl/LayerUtils.js +1 -1
  18. package/src/sap/ui/fl/PreprocessorImpl.js +1 -1
  19. package/src/sap/ui/fl/RegistrationDelegator.js +1 -1
  20. package/src/sap/ui/fl/Utils.js +50 -2
  21. package/src/sap/ui/fl/Variant.js +20 -20
  22. package/src/sap/ui/fl/XmlPreprocessorImpl.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +2 -2
  24. package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +117 -70
  26. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +173 -43
  27. package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +91 -85
  28. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +19 -8
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +3 -2
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +52 -0
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  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/flexState/FlexState.js +13 -1
  50. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +52 -4
  51. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +5 -1
  52. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  55. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  56. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
  57. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +12 -7
  58. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  59. package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +2 -0
  60. package/src/sap/ui/fl/changeHandler/AddIFrame.js +23 -9
  61. package/src/sap/ui/fl/changeHandler/AddXML.js +2 -3
  62. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +40 -29
  63. package/src/sap/ui/fl/changeHandler/Base.js +10 -8
  64. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +43 -30
  65. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +65 -26
  66. package/src/sap/ui/fl/changeHandler/BaseRename.js +29 -18
  67. package/src/sap/ui/fl/changeHandler/HideControl.js +21 -18
  68. package/src/sap/ui/fl/changeHandler/MoveControls.js +250 -172
  69. package/src/sap/ui/fl/changeHandler/MoveElements.js +90 -61
  70. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +12 -12
  71. package/src/sap/ui/fl/changeHandler/PropertyChange.js +27 -23
  72. package/src/sap/ui/fl/changeHandler/StashControl.js +51 -23
  73. package/src/sap/ui/fl/changeHandler/UnhideControl.js +13 -14
  74. package/src/sap/ui/fl/changeHandler/UnstashControl.js +23 -16
  75. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +45 -22
  76. package/src/sap/ui/fl/changeHandler/common/createIFrame.js +6 -2
  77. package/src/sap/ui/fl/changeHandler/common/getTargetAggregationIndex.js +8 -4
  78. package/src/sap/ui/fl/changeHandler/common/revertAddedControls.js +17 -7
  79. package/src/sap/ui/fl/codeExt/CodeExtManager.js +1 -1
  80. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  81. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +18 -1
  82. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  83. package/src/sap/ui/fl/descriptorRelated/internal/Utils.js +1 -0
  84. package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +3 -0
  85. package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
  86. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  87. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +5 -0
  88. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
  89. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +2 -2
  90. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  91. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  92. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  93. package/src/sap/ui/fl/library.js +9 -9
  94. package/src/sap/ui/fl/messagebundle.properties +24 -0
  95. package/src/sap/ui/fl/messagebundle_ar.properties +17 -1
  96. package/src/sap/ui/fl/messagebundle_bg.properties +17 -1
  97. package/src/sap/ui/fl/messagebundle_ca.properties +18 -2
  98. package/src/sap/ui/fl/messagebundle_cs.properties +17 -1
  99. package/src/sap/ui/fl/messagebundle_cy.properties +17 -1
  100. package/src/sap/ui/fl/messagebundle_da.properties +17 -1
  101. package/src/sap/ui/fl/messagebundle_de.properties +17 -1
  102. package/src/sap/ui/fl/messagebundle_el.properties +17 -1
  103. package/src/sap/ui/fl/messagebundle_en.properties +16 -0
  104. package/src/sap/ui/fl/messagebundle_en_GB.properties +16 -0
  105. package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +16 -0
  106. package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +16 -0
  107. package/src/sap/ui/fl/messagebundle_es.properties +18 -2
  108. package/src/sap/ui/fl/messagebundle_es_MX.properties +17 -1
  109. package/src/sap/ui/fl/messagebundle_et.properties +17 -1
  110. package/src/sap/ui/fl/messagebundle_fi.properties +17 -1
  111. package/src/sap/ui/fl/messagebundle_fr.properties +16 -0
  112. package/src/sap/ui/fl/messagebundle_fr_CA.properties +16 -0
  113. package/src/sap/ui/fl/messagebundle_hi.properties +17 -1
  114. package/src/sap/ui/fl/messagebundle_hr.properties +17 -1
  115. package/src/sap/ui/fl/messagebundle_hu.properties +17 -1
  116. package/src/sap/ui/fl/messagebundle_id.properties +17 -1
  117. package/src/sap/ui/fl/messagebundle_it.properties +17 -1
  118. package/src/sap/ui/fl/messagebundle_iw.properties +17 -1
  119. package/src/sap/ui/fl/messagebundle_ja.properties +17 -1
  120. package/src/sap/ui/fl/messagebundle_kk.properties +17 -1
  121. package/src/sap/ui/fl/messagebundle_ko.properties +17 -1
  122. package/src/sap/ui/fl/messagebundle_lt.properties +17 -1
  123. package/src/sap/ui/fl/messagebundle_lv.properties +17 -1
  124. package/src/sap/ui/fl/messagebundle_ms.properties +17 -1
  125. package/src/sap/ui/fl/messagebundle_nl.properties +17 -1
  126. package/src/sap/ui/fl/messagebundle_no.properties +17 -1
  127. package/src/sap/ui/fl/messagebundle_pl.properties +17 -1
  128. package/src/sap/ui/fl/messagebundle_pt.properties +17 -1
  129. package/src/sap/ui/fl/messagebundle_pt_PT.properties +17 -1
  130. package/src/sap/ui/fl/messagebundle_ro.properties +16 -0
  131. package/src/sap/ui/fl/messagebundle_ru.properties +17 -1
  132. package/src/sap/ui/fl/messagebundle_sh.properties +19 -3
  133. package/src/sap/ui/fl/messagebundle_sk.properties +17 -1
  134. package/src/sap/ui/fl/messagebundle_sl.properties +17 -1
  135. package/src/sap/ui/fl/messagebundle_sv.properties +17 -1
  136. package/src/sap/ui/fl/messagebundle_th.properties +17 -1
  137. package/src/sap/ui/fl/messagebundle_tr.properties +17 -1
  138. package/src/sap/ui/fl/messagebundle_uk.properties +19 -3
  139. package/src/sap/ui/fl/messagebundle_vi.properties +17 -1
  140. package/src/sap/ui/fl/messagebundle_zh_CN.properties +17 -1
  141. package/src/sap/ui/fl/messagebundle_zh_TW.properties +17 -1
  142. package/src/sap/ui/fl/registry/Settings.js +27 -23
  143. package/src/sap/ui/fl/support/Flexibility.js +1 -1
  144. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  145. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  146. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  147. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  148. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +7 -7
  149. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +2 -2
  150. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  151. package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
  152. package/src/sap/ui/fl/themes/base/VariantManagement.less +5 -0
  153. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  154. package/src/sap/ui/fl/util/IFrame.flexibility.js +2 -1
  155. package/src/sap/ui/fl/util/IFrame.js +29 -2
  156. package/src/sap/ui/fl/util/IFrameRenderer.js +1 -1
  157. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  158. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  159. package/src/sap/ui/fl/variants/VariantManagement.js +133 -36
  160. package/src/sap/ui/fl/variants/VariantModel.js +57 -23
  161. package/src/sap/ui/fl/write/_internal/Storage.js +2 -2
  162. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +4 -1
  163. package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
  164. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  165. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  166. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  167. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +20 -1
  168. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +23 -12
  169. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +2 -24
  170. package/src/sap/ui/fl/write/_internal/condenser/Utils.js +8 -5
  171. package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +10 -8
  172. package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +14 -11
  173. package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +37 -20
  174. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  175. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
  176. package/src/sap/ui/fl/write/_internal/connectors/LocalStorageConnector.js +1 -0
  177. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
  178. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  179. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  180. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  181. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  182. package/src/sap/ui/fl/write/_internal/delegates/ODataV4ReadDelegate.js +1 -1
  183. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  184. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +7 -5
  185. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  186. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  187. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  188. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  189. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  190. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  191. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  192. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +2 -2
  193. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +129 -0
  194. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.fragment.xml +33 -0
  195. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +172 -0
  196. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/getEditorConfig.js +209 -0
  197. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/annotationsEditor/AnnotationsEditor.js +49 -0
  198. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.fragment.xml +6 -0
  199. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +41 -0
  200. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/dateEditor/DateEditor.js +43 -0
  201. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/dateTimeEditor/DateTimeEditor.js +38 -0
  202. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.fragment.xml +22 -0
  203. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +84 -0
  204. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.fragment.xml +10 -0
  205. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +70 -0
  206. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +16 -10
  207. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +11 -4
  208. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  209. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  210. package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +1 -1
  211. package/src/sap/ui/fl/write/api/FeaturesAPI.js +1 -0
  212. package/src/sap/ui/fl/write/api/FieldExtensibility.js +24 -9
  213. package/src/sap/ui/fl/write/api/LocalResetAPI.js +9 -8
  214. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +32 -26
  215. package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +1 -0
@@ -5,9 +5,11 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/base/Log"
8
+ "sap/base/Log",
9
+ "sap/ui/fl/Utils"
9
10
  ], function(
10
- Log
11
+ Log,
12
+ FlUtils
11
13
  ) {
12
14
  "use strict";
13
15
 
@@ -16,13 +18,69 @@ sap.ui.define([
16
18
  *
17
19
  * @alias sap.ui.fl.changeHandler.MoveElements
18
20
  * @author SAP SE
19
- * @version 1.92.0
21
+ * @version 1.95.0
20
22
  * @experimental Since 1.34.0
21
23
  */
22
24
  var MoveElements = { };
23
25
 
24
26
  MoveElements.CHANGE_TYPE = "moveElements";
25
27
 
28
+ function fnCheckConditions(oChange, oModifier, oView, oAppComponent) {
29
+ if (!oChange) {
30
+ return Promise.reject(new Error("No change instance"));
31
+ }
32
+
33
+ var oChangeContent = oChange.getContent();
34
+
35
+ if (!oChangeContent || !oChangeContent.movedElements || oChangeContent.movedElements.length === 0) {
36
+ return Promise.reject(new Error("Change format invalid"));
37
+ }
38
+ if (!oChange.getSelector().aggregation) {
39
+ return Promise.reject(new Error("No source aggregation supplied via selector for move"));
40
+ }
41
+ if (!oChangeContent.target || !oChangeContent.target.selector) {
42
+ return Promise.reject(new Error("No target supplied for move"));
43
+ }
44
+ if (!oModifier.bySelector(oChangeContent.target.selector, oAppComponent, oView)) {
45
+ return Promise.reject(new Error("Move target parent not found"));
46
+ }
47
+ if (!oChangeContent.target.selector.aggregation) {
48
+ return Promise.reject(new Error("No target aggregation supplied for move"));
49
+ }
50
+
51
+ return Promise.resolve();
52
+ }
53
+
54
+ function fnGetElementControlOrThrowError(mMovedElement, oModifier, oAppComponent, oView) {
55
+ if (!mMovedElement.selector && !mMovedElement.id) {
56
+ return Promise.reject(new Error("Change format invalid - moveElements element has no id attribute"));
57
+ }
58
+ if (typeof mMovedElement.targetIndex !== "number") {
59
+ return Promise.reject(new Error("Missing targetIndex for element with id '" + mMovedElement.selector.id
60
+ + "' in movedElements supplied"));
61
+ }
62
+
63
+ return Promise.resolve()
64
+ .then(function() {
65
+ return oModifier.bySelector(mMovedElement.selector || mMovedElement.id, oAppComponent, oView);
66
+ });
67
+ }
68
+
69
+ function fnHandleMovedElement(mMovedElement, oModifier, oAppComponent, oView, oSourceParent, oTargetParent, sSourceAggregation, sTargetAggregation) {
70
+ var oMovedElement;
71
+ return fnGetElementControlOrThrowError(mMovedElement, oModifier, oAppComponent, oView)
72
+ .then(function(oRetrievedMovedElement) {
73
+ oMovedElement = oRetrievedMovedElement;
74
+ if (!oMovedElement) {
75
+ Log.warning("Element to move not found");
76
+ return Promise.reject();
77
+ }
78
+ return Promise.resolve()
79
+ .then(oModifier.removeAggregation.bind(oModifier, oSourceParent, sSourceAggregation, oMovedElement))
80
+ .then(oModifier.insertAggregation.bind(oModifier, oTargetParent, sTargetAggregation, oMovedElement, mMovedElement.targetIndex, oView));
81
+ });
82
+ }
83
+
26
84
  /**
27
85
  * Moves an element from one aggregation to another.
28
86
  *
@@ -32,79 +90,50 @@ sap.ui.define([
32
90
  * @param {object} mPropertyBag.view - xml node representing a ui5 view
33
91
  * @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - modifier for the controls
34
92
  * @param {sap.ui.core.UIComponent} mPropertyBag.appComponent - appComopnent
35
- * @return {boolean} true - if change could be applied
93
+ * @return {Promise} Promise resolving when change has been applied
36
94
  * @public
37
95
  * @function
38
96
  * @name sap.ui.fl.changeHandler.MoveElements#applyChange
39
97
  */
40
98
  MoveElements.applyChange = function(oChange, oSourceParent, mPropertyBag) {
41
- function checkConditions(oChange, oModifier, oView, oAppComponent) {
42
- if (!oChange) {
43
- throw new Error("No change instance");
44
- }
45
-
46
- var oChangeContent = oChange.getContent();
47
-
48
- if (!oChangeContent || !oChangeContent.movedElements || oChangeContent.movedElements.length === 0) {
49
- throw new Error("Change format invalid");
50
- }
51
- if (!oChange.getSelector().aggregation) {
52
- throw new Error("No source aggregation supplied via selector for move");
53
- }
54
- if (!oChangeContent.target || !oChangeContent.target.selector) {
55
- throw new Error("No target supplied for move");
56
- }
57
- if (!oModifier.bySelector(oChangeContent.target.selector, oAppComponent, oView)) {
58
- throw new Error("Move target parent not found");
59
- }
60
- if (!oChangeContent.target.selector.aggregation) {
61
- throw new Error("No target aggregation supplied for move");
62
- }
63
- }
64
-
65
- function getElementControlOrThrowError(mMovedElement, oModifier, oAppComponent, oView) {
66
- if (!mMovedElement.selector && !mMovedElement.id) {
67
- throw new Error("Change format invalid - moveElements element has no id attribute");
68
- }
69
- if (typeof mMovedElement.targetIndex !== "number") {
70
- throw new Error("Missing targetIndex for element with id '" + mMovedElement.selector.id
71
- + "' in movedElements supplied");
72
- }
73
-
74
- return oModifier.bySelector(mMovedElement.selector || mMovedElement.id, oAppComponent, oView);
75
- }
76
-
77
99
  var oModifier = mPropertyBag.modifier;
78
100
  var oView = mPropertyBag.view;
79
101
  var oAppComponent = mPropertyBag.appComponent;
80
-
81
- checkConditions(oChange, oModifier, oView, oAppComponent);
82
-
83
102
  var oChangeContent = oChange.getContent();
84
- var oTargetParent = oModifier.bySelector(oChangeContent.target.selector, oAppComponent, oView);
85
- var sSourceAggregation = oChange.getSelector().aggregation;
86
- var sTargetAggregation = oChangeContent.target.selector.aggregation;
87
-
88
- oChangeContent.movedElements.forEach(function(mMovedElement) {
89
- var oMovedElement = getElementControlOrThrowError(mMovedElement, oModifier, oAppComponent, oView);
90
-
91
- if (!oMovedElement) {
92
- Log.warning("Element to move not found");
93
- return;
94
- }
95
-
96
- oModifier.removeAggregation(oSourceParent, sSourceAggregation, oMovedElement);
97
- oModifier.insertAggregation(oTargetParent, sTargetAggregation, oMovedElement, mMovedElement.targetIndex, oView);
98
- });
99
-
100
- return true;
103
+ var sSourceAggregation;
104
+ var sTargetAggregation;
105
+ var oTargetParent;
106
+
107
+ return fnCheckConditions(oChange, oModifier, oView, oAppComponent)
108
+ .then(function() {
109
+ sSourceAggregation = oChange.getSelector().aggregation;
110
+ sTargetAggregation = oChangeContent.target.selector.aggregation;
111
+ return oModifier.bySelector(oChangeContent.target.selector, oAppComponent, oView);
112
+ })
113
+ .then(function(oRetrievedTargetParent) {
114
+ oTargetParent = oRetrievedTargetParent;
115
+ var aPromises = [];
116
+ oChangeContent.movedElements.forEach(function(mMovedElement) {
117
+ aPromises.push(fnHandleMovedElement.bind(
118
+ null,
119
+ mMovedElement,
120
+ oModifier,
121
+ oAppComponent,
122
+ oView,
123
+ oSourceParent,
124
+ oTargetParent,
125
+ sSourceAggregation,
126
+ sTargetAggregation));
127
+ });
128
+ return FlUtils.execPromiseQueueSequentially(aPromises, true, true);
129
+ });
101
130
  };
102
131
 
103
132
  /**
104
133
  * @deprecated
105
134
  */
106
135
  MoveElements.completeChangeContent = function() {
107
- throw new Error('Using deprecated change handler. Please consider of using \'MoveControls\' instead');
136
+ throw new Error('Using deprecated change handler. Please consider using \'MoveControls\' instead');
108
137
  };
109
138
 
110
139
  /**
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  *
17
17
  * @alias sap.ui.fl.changeHandler.PropertyBindingChange
18
18
  * @author SAP SE
19
- * @version 1.92.0
19
+ * @version 1.95.0
20
20
  * @since 1.38
21
21
  * @private
22
22
  * @experimental Since 1.38. This class is experimental and provides only limited functionality. Also the API might be changed in future.
@@ -32,8 +32,9 @@ sap.ui.define([
32
32
  /**
33
33
  * @param {object} oChange - change object with instructions to be applied on the control
34
34
  * @param {object} oControl - the control which has been determined by the selector id
35
- * @param {object} mPropertyBag
35
+ * @param {object} mPropertyBag - property bag
36
36
  * @param {object} mPropertyBag.modifier - modifier for the controls
37
+ * @returns {Promise} Promise that resolves with setting the property binding
37
38
  * @public
38
39
  * @name sap.ui.fl.changeHandler.PropertyBindingChange#applyChange
39
40
  */
@@ -48,18 +49,20 @@ sap.ui.define([
48
49
  // throw new Error(sNoBindingError);
49
50
  // }
50
51
 
51
- var vOriginalValue = oModifier.getPropertyBindingOrProperty(oControl, sPropertyName);
52
- oChange.setRevertData({
53
- originalValue: vOriginalValue
54
- });
55
-
56
- oModifier.setPropertyBinding(oControl, sPropertyName, vPropertyValue);
52
+ return Promise.resolve()
53
+ .then(oModifier.getPropertyBindingOrProperty.bind(oModifier, oControl, sPropertyName))
54
+ .then(function(vOriginalValue) {
55
+ oChange.setRevertData({
56
+ originalValue: vOriginalValue
57
+ });
58
+ oModifier.setPropertyBinding(oControl, sPropertyName, vPropertyValue);
59
+ });
57
60
  };
58
61
 
59
62
  /**
60
63
  * @param {object} oChange - change object with instructions to be applied on the control
61
64
  * @param {object} oControl - the control which has been determined by the selector id
62
- * @param {object} mPropertyBag
65
+ * @param {object} mPropertyBag - property bag
63
66
  * @param {object} mPropertyBag.modifier - modifier for the controls
64
67
  * @public
65
68
  * @name sap.ui.fl.changeHandler.PropertyBindingChange#revertChange
@@ -77,10 +80,7 @@ sap.ui.define([
77
80
  oChange.resetRevertData();
78
81
  } else {
79
82
  Log.error("Attempt to revert an unapplied change.");
80
- return false;
81
83
  }
82
-
83
- return true;
84
84
  };
85
85
 
86
86
  /**
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  *
21
21
  * @alias sap.ui.fl.changeHandler.PropertyChange
22
22
  * @author SAP SE
23
- * @version 1.92.0
23
+ * @version 1.95.0
24
24
  * @since 1.36
25
25
  * @private
26
26
  * @experimental Since 1.36. This class is experimental and provides only limited functionality. Also the API might be changed in future.
@@ -50,8 +50,9 @@ sap.ui.define([
50
50
  *
51
51
  * @param {object} oChange - change object with instructions to be applied on the control
52
52
  * @param {object} oControl - the control which has been determined by the selector id
53
- * @param {object} mPropertyBag
53
+ * @param {object} mPropertyBag - property bag
54
54
  * @param {object} mPropertyBag.modifier - modifier for the controls
55
+ * @returns {Promise} Promise resolving when change is applied
55
56
  * @public
56
57
  * @name sap.ui.fl.changeHandler.PropertyChange#applyChange
57
58
  */
@@ -66,11 +67,14 @@ sap.ui.define([
66
67
  // throw new Error(sBindingError);
67
68
  // }
68
69
 
69
- oChange.setRevertData({
70
- originalValue: oModifier.getPropertyBindingOrProperty(oControl, sPropertyName)
71
- });
72
-
73
- changeProperty(oControl, sPropertyName, vPropertyValue, oModifier);
70
+ return Promise.resolve()
71
+ .then(oModifier.getPropertyBindingOrProperty.bind(oModifier, oControl, sPropertyName))
72
+ .then(function(oOriginalValue) {
73
+ oChange.setRevertData({
74
+ originalValue: oOriginalValue
75
+ });
76
+ changeProperty(oControl, sPropertyName, vPropertyValue, oModifier);
77
+ });
74
78
  };
75
79
 
76
80
  /**
@@ -78,9 +82,8 @@ sap.ui.define([
78
82
  *
79
83
  * @param {object} oChange - change object with instructions to be applied on the control
80
84
  * @param {object} oControl - the control which has been determined by the selector id
81
- * @param {object} mPropertyBag
85
+ * @param {object} mPropertyBag - property bag
82
86
  * @param {object} mPropertyBag.modifier - modifier for the controls
83
- * @return {boolean} true - if change has been reverted
84
87
  * @public
85
88
  */
86
89
  PropertyChange.revertChange = function(oChange, oControl, mPropertyBag) {
@@ -96,10 +99,7 @@ sap.ui.define([
96
99
  oChange.resetRevertData();
97
100
  } else {
98
101
  Log.error("Attempt to revert an unapplied change.");
99
- return false;
100
102
  }
101
-
102
- return true;
103
103
  };
104
104
 
105
105
  /**
@@ -108,21 +108,25 @@ sap.ui.define([
108
108
  * @param {object} oChange change object to be completed
109
109
  * @param {object} oSpecificChangeInfo with attribute property which contains an array which holds objects which have attributes
110
110
  * id and index - id is the id of the field to property and index the new position of the field in the smart form group
111
+ * @returns {Promise} Promise that resolves completing the change content
111
112
  * @public
112
113
  * @name sap.ui.fl.changeHandler.PropertyChange#completeChangeContent
113
114
  */
114
115
  PropertyChange.completeChangeContent = function(oChange, oSpecificChangeInfo) {
115
- var oChangeJson = oChange.getDefinition();
116
-
117
- if (!oSpecificChangeInfo.content) {
118
- throw new Error("oSpecificChangeInfo attribute required");
119
- }
120
- // TODO: enable again when apps have adapted
121
- // if (isBinding(oSpecificChangeInfo.content.newValue)) {
122
- // throw new Error(sBindingError);
123
- // }
124
-
125
- oChangeJson.content = oSpecificChangeInfo.content;
116
+ return Promise.resolve()
117
+ .then(function() {
118
+ var oChangeJson = oChange.getDefinition();
119
+
120
+ if (!oSpecificChangeInfo.content) {
121
+ throw new Error("oSpecificChangeInfo attribute required");
122
+ }
123
+ // TODO: enable again when apps have adapted
124
+ // if (isBinding(oSpecificChangeInfo.content.newValue)) {
125
+ // throw new Error(sBindingError);
126
+ // }
127
+
128
+ oChangeJson.content = oSpecificChangeInfo.content;
129
+ });
126
130
  };
127
131
 
128
132
  /**
@@ -15,7 +15,7 @@ sap.ui.define([
15
15
  * Change handler for stashing of a control.
16
16
  * @alias sap.ui.fl.changeHandler.StashControl
17
17
  * @author SAP SE
18
- * @version 1.92.0
18
+ * @version 1.95.0
19
19
  * @experimental Since 1.27.0
20
20
  */
21
21
  var StashControl = {};
@@ -27,20 +27,43 @@ sap.ui.define([
27
27
  * @param {sap.ui.core.Control} oControl - Control that matches the change selector for applying the change
28
28
  * @param {object} mPropertyBag - Map of properties
29
29
  * @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Modifier for the controls
30
+ * @returns {Promise} Promise resolving when the change is applied.
30
31
  * @public
31
32
  */
32
33
  StashControl.applyChange = function(oChange, oControl, mPropertyBag) {
33
- var bStashed = mPropertyBag.modifier.getStashed(oControl);
34
- var iOriginalIndex = mPropertyBag.modifier.findIndexInParentAggregation(oControl);
35
- this.setChangeRevertData(oChange, bStashed, iOriginalIndex);
34
+ var bStashed;
35
+ var oModifier = mPropertyBag.modifier;
36
36
 
37
- if (LayerUtils.isDeveloperLayer(oChange.getLayer())) {
38
- mPropertyBag.modifier.setStashed(oControl, true);
39
- } else {
40
- mPropertyBag.modifier.setVisible(oControl, false);
41
- }
37
+ return Promise.resolve()
38
+ .then(oModifier.getStashed.bind(oModifier, oControl))
39
+ .then(function(bRetrievedStashed) {
40
+ bStashed = bRetrievedStashed;
41
+ return oModifier.findIndexInParentAggregation(oControl);
42
+ })
43
+ .then(function(iOriginalIndex) {
44
+ this.setChangeRevertData(oChange, bStashed, iOriginalIndex);
45
+ if (LayerUtils.isDeveloperLayer(oChange.getLayer())) {
46
+ return oModifier.setStashed(oControl, true);
47
+ }
48
+ return oModifier.setVisible(oControl, false);
49
+ }.bind(this));
42
50
  };
43
51
 
52
+ function fnHandleUnstashedControl(iUnstashedIndex, mRevertData, oUnstashedControl, oModifier) {
53
+ var sAggregationName;
54
+ if (iUnstashedIndex !== mRevertData.originalIndex) {
55
+ var oParent = oModifier.getParent(oUnstashedControl);
56
+ return Promise.return()
57
+ .then(oModifier.getParentAggregationName.bind(oModifier, oUnstashedControl))
58
+ .then(function(sRetrievedAggregationName) {
59
+ sAggregationName = sRetrievedAggregationName;
60
+ return oModifier.removeAggregation(oParent, sAggregationName, oUnstashedControl);
61
+ })
62
+ .then(oModifier.insertAggregation.bind(oModifier, oParent, sAggregationName, oUnstashedControl, mRevertData.originalIndex));
63
+ }
64
+ return Promise.resolve();
65
+ }
66
+
44
67
  /**
45
68
  * Reverts previously applied change
46
69
  *
@@ -48,26 +71,31 @@ sap.ui.define([
48
71
  * @param {sap.ui.core.Control} oControl - Control that matches the change selector for applying the change
49
72
  * @param {object} mPropertyBag - Map of properties
50
73
  * @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Modifier for the controls
74
+ * @returns {Promise} Promise resolving when change is reverted
51
75
  * @public
52
76
  */
53
77
  StashControl.revertChange = function(oChange, oControl, mPropertyBag) {
54
78
  var mRevertData = oChange.getRevertData();
79
+ var oModifier = mPropertyBag.modifier;
55
80
 
56
- if (LayerUtils.isDeveloperLayer(oChange.getLayer())) {
57
- var oUnstashedControl = mPropertyBag.modifier.setStashed(oControl, mRevertData.originalValue, mPropertyBag.appComponent);
58
- if (oUnstashedControl) {
59
- var iUnstashedIndex = mPropertyBag.modifier.findIndexInParentAggregation((oUnstashedControl));
60
- if (iUnstashedIndex !== mRevertData.originalIndex) {
61
- var oParent = mPropertyBag.modifier.getParent(oUnstashedControl);
62
- var sAggregationName = mPropertyBag.modifier.getParentAggregationName(oUnstashedControl);
63
- mPropertyBag.modifier.removeAggregation(oParent, sAggregationName, oUnstashedControl);
64
- mPropertyBag.modifier.insertAggregation(oParent, sAggregationName, oUnstashedControl, mRevertData.originalIndex);
81
+ return Promise.resolve()
82
+ .then(function() {
83
+ if (LayerUtils.isDeveloperLayer(oChange.getLayer())) {
84
+ var oUnstashedControl = oModifier.setStashed(oControl, mRevertData.originalValue, mPropertyBag.appComponent);
85
+ if (oUnstashedControl) {
86
+ return Promise.resolve()
87
+ .then(oModifier.findIndexInParentAggregation.bind(oModifier, oUnstashedControl))
88
+ .then(function(iUnstashedIndex) {
89
+ return fnHandleUnstashedControl(iUnstashedIndex, mRevertData, oUnstashedControl, oModifier);
90
+ });
91
+ }
92
+ return Promise.resolve();
65
93
  }
66
- }
67
- } else {
68
- mPropertyBag.modifier.setVisible(oControl, !mRevertData.originalValue);
69
- }
70
- oChange.resetRevertData();
94
+ return oModifier.setVisible(oControl, !mRevertData.originalValue);
95
+ })
96
+ .then(function() {
97
+ oChange.resetRevertData();
98
+ });
71
99
  };
72
100
 
73
101
  /**
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * Change handler for unhiding of a control.
18
18
  * @alias sap.ui.fl.changeHandler.UnhideControl
19
19
  * @author SAP SE
20
- * @version 1.92.0
20
+ * @version 1.95.0
21
21
  * @experimental Since 1.27.0
22
22
  */
23
23
  var UnhideControl = {};
@@ -27,18 +27,21 @@ sap.ui.define([
27
27
  *
28
28
  * @param {sap.ui.fl.Change} oChange change object with instructions to be applied on the control map
29
29
  * @param {sap.ui.core.Control} oControl control that matches the change selector for applying the change
30
- * @param {object} mPropertyBag
30
+ * @param {object} mPropertyBag - property bag
31
31
  * @param {object} mPropertyBag.modifier - modifier for the controls
32
- * @return {boolean} true - if change could be applied
32
+ * @return {Promise} Promise resolving when the change is applied successfully
33
33
  * @public
34
34
  */
35
35
  UnhideControl.applyChange = function(oChange, oControl, mPropertyBag) {
36
- oChange.setRevertData({
37
- originalValue: mPropertyBag.modifier.getProperty(oControl, PROPERTY_NAME)
38
- });
39
-
40
- mPropertyBag.modifier.setVisible(oControl, true);
41
- return true;
36
+ var oModifier = mPropertyBag.modifier;
37
+ return Promise.resolve()
38
+ .then(oModifier.getProperty.bind(oModifier, oControl, PROPERTY_NAME))
39
+ .then(function(oOriginalValue) {
40
+ oChange.setRevertData({
41
+ originalValue: oOriginalValue
42
+ });
43
+ mPropertyBag.modifier.setVisible(oControl, true);
44
+ });
42
45
  };
43
46
 
44
47
  /**
@@ -46,9 +49,8 @@ sap.ui.define([
46
49
  *
47
50
  * @param {sap.ui.fl.Change} oChange change object with instructions to be applied on the control map
48
51
  * @param {sap.ui.core.Control} oControl control that matches the change selector for applying the change
49
- * @param {object} mPropertyBag
52
+ * @param {object} mPropertyBag - property bag
50
53
  * @param {object} mPropertyBag.modifier - modifier for the controls
51
- * @return {boolean} true - if change has been reverted
52
54
  * @public
53
55
  */
54
56
  UnhideControl.revertChange = function(oChange, oControl, mPropertyBag) {
@@ -59,10 +61,7 @@ sap.ui.define([
59
61
  oChange.resetRevertData();
60
62
  } else {
61
63
  Log.error("Attempt to revert an unapplied change.");
62
- return false;
63
64
  }
64
-
65
- return true;
66
65
  };
67
66
 
68
67
  /**
@@ -11,7 +11,7 @@ sap.ui.define([], function() {
11
11
  * Change handler for unstashing of a control.
12
12
  * @alias sap.ui.fl.changeHandler.UnstashControl
13
13
  * @author SAP SE
14
- * @version 1.92.0
14
+ * @version 1.95.0
15
15
  * @experimental Since 1.27.0
16
16
  */
17
17
  var UnstashControl = {};
@@ -30,22 +30,29 @@ sap.ui.define([], function() {
30
30
  var mContent = oChange.getContent();
31
31
  var oModifier = mPropertyBag.modifier;
32
32
  var bStashed = false;
33
+ var oUnstashedControl;
33
34
 
34
- oChange.setRevertData({
35
- originalValue: mPropertyBag.modifier.getStashed(oControl)
36
- });
37
-
38
- var oUnstashedControl = oModifier.setStashed(oControl, bStashed, mPropertyBag.appComponent) || oControl;
39
-
40
- //old way including move, new way will have separate move change
41
- //only applicable for XML modifier
42
- if (mContent.parentAggregationName) {
43
- var sTargetAggregation = mContent.parentAggregationName;
44
- var oTargetParent = oModifier.getParent(oUnstashedControl);
45
- oModifier.removeAggregation(oTargetParent, sTargetAggregation, oUnstashedControl);
46
- oModifier.insertAggregation(oTargetParent, sTargetAggregation, oUnstashedControl, mContent.index, mPropertyBag.view);
47
- }
48
- return oUnstashedControl;
35
+ return Promise.resolve()
36
+ .then(oModifier.getStashed.bind(oModifier, oControl))
37
+ .then(function(bPreviouslyStashed) {
38
+ oChange.setRevertData({
39
+ originalValue: bPreviouslyStashed
40
+ });
41
+ oUnstashedControl = oModifier.setStashed(oControl, bStashed, mPropertyBag.appComponent) || oControl;
42
+ //old way including move, new way will have separate move change
43
+ //only applicable for XML modifier
44
+ if (mContent.parentAggregationName) {
45
+ var sTargetAggregation = mContent.parentAggregationName;
46
+ var oTargetParent = oModifier.getParent(oUnstashedControl);
47
+ return Promise.resolve()
48
+ .then(oModifier.removeAggregation.bind(oModifier, oTargetParent, sTargetAggregation, oUnstashedControl))
49
+ .then(oModifier.insertAggregation.bind(oModifier, oTargetParent, sTargetAggregation, oUnstashedControl, mContent.index, mPropertyBag.view));
50
+ }
51
+ return undefined;
52
+ })
53
+ .then(function() {
54
+ return oUnstashedControl;
55
+ });
49
56
  };
50
57
 
51
58
  /**