@openui5/sap.ui.fl 1.97.1 → 1.100.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 (217) hide show
  1. package/.reuse/dep5 +25 -30
  2. package/THIRDPARTY.txt +15 -22
  3. package/package.json +3 -3
  4. package/src/sap/ui/fl/.library +1 -1
  5. package/src/sap/ui/fl/Cache.js +1 -1
  6. package/src/sap/ui/fl/Change.js +38 -230
  7. package/src/sap/ui/fl/ChangePersistence.js +113 -163
  8. package/src/sap/ui/fl/ChangePersistenceFactory.js +5 -3
  9. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +3 -4
  10. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +3 -4
  11. package/src/sap/ui/fl/FakeLrepLocalStorage.js +4 -4
  12. package/src/sap/ui/fl/FlexController.js +57 -71
  13. package/src/sap/ui/fl/FlexControllerFactory.js +6 -4
  14. package/src/sap/ui/fl/LayerUtils.js +1 -1
  15. package/src/sap/ui/fl/Utils.js +39 -313
  16. package/src/sap/ui/fl/Variant.js +5 -119
  17. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +2 -2
  18. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +10 -8
  19. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +46 -2
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +3 -2
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/controlVariants/URLHandler.js +6 -4
  42. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +15 -10
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariantRevertData.js +1 -1
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +452 -0
  46. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +68 -0
  47. package/src/sap/ui/fl/apply/_internal/flexObjects/RevertData.js +1 -1
  48. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +47 -23
  49. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +9 -5
  50. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +21 -22
  51. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +12 -10
  54. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  55. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -4
  56. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +17 -45
  57. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/prepareVariantsMap.js +6 -0
  58. package/src/sap/ui/fl/{PreprocessorImpl.js → apply/_internal/preprocessors/ControllerExtension.js} +43 -50
  59. package/src/sap/ui/fl/{EventHistory.js → apply/_internal/preprocessors/EventHistory.js} +7 -7
  60. package/src/sap/ui/fl/{RegistrationDelegator.js → apply/_internal/preprocessors/RegistrationDelegator.js} +40 -42
  61. package/src/sap/ui/fl/{XmlPreprocessorImpl.js → apply/_internal/preprocessors/XmlPreprocessor.js} +10 -8
  62. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  63. package/src/sap/ui/fl/apply/api/DelegateMediatorAPI.js +1 -1
  64. package/src/sap/ui/fl/apply/api/FlexRuntimeInfoAPI.js +13 -0
  65. package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +13 -2
  66. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  67. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  70. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  72. package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
  73. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
  76. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  78. package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
  79. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  80. package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
  81. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
  82. package/src/sap/ui/fl/codeExt/CodeExtManager.js +1 -1
  83. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  84. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  85. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  86. package/src/sap/ui/fl/designtime/variants/VariantManagement.designtime.js +9 -2
  87. package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
  88. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  89. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +9 -9
  90. package/src/sap/ui/fl/initial/_internal/connectors/BackendConnector.js +1 -1
  91. package/src/sap/ui/fl/initial/_internal/connectors/LrepConnector.js +16 -6
  92. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +4 -3
  93. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  94. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  95. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  96. package/src/sap/ui/fl/library.js +12 -12
  97. package/src/sap/ui/fl/messagebundle_ro.properties +1 -1
  98. package/src/sap/ui/fl/registry/Settings.js +52 -3
  99. package/src/sap/ui/fl/support/Flexibility.js +1 -1
  100. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +59 -0
  101. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +34 -0
  102. package/src/sap/ui/fl/support/api/SupportAPI.js +31 -0
  103. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +2 -2
  104. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  105. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  106. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  107. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  108. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +4 -4
  109. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +4 -4
  110. package/src/sap/ui/fl/support/apps/uiFlexibilityDiagnostics/helper/Extractor.js +3 -14
  111. package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
  112. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  113. package/src/sap/ui/fl/util/DescriptorChangeCheck.js +1 -1
  114. package/src/sap/ui/fl/util/IFrame.js +1 -1
  115. package/src/sap/ui/fl/util/IFrameRenderer.js +1 -1
  116. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  117. package/src/sap/ui/fl/util/changePropertyValueByPath.js +1 -1
  118. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  119. package/src/sap/ui/fl/variants/VariantManagement.js +7 -1
  120. package/src/sap/ui/fl/variants/VariantModel.js +32 -75
  121. package/src/sap/ui/fl/variants/context/Component.js +2 -6
  122. package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +6 -41
  123. package/src/sap/ui/fl/variants/context/i18n/i18n.properties +3 -7
  124. package/src/sap/ui/fl/variants/context/i18n/i18n_ar.properties +2 -4
  125. package/src/sap/ui/fl/variants/context/i18n/i18n_bg.properties +2 -4
  126. package/src/sap/ui/fl/variants/context/i18n/i18n_ca.properties +2 -4
  127. package/src/sap/ui/fl/variants/context/i18n/i18n_cs.properties +2 -4
  128. package/src/sap/ui/fl/variants/context/i18n/i18n_cy.properties +2 -4
  129. package/src/sap/ui/fl/variants/context/i18n/i18n_da.properties +2 -4
  130. package/src/sap/ui/fl/variants/context/i18n/i18n_de.properties +2 -4
  131. package/src/sap/ui/fl/variants/context/i18n/i18n_el.properties +2 -4
  132. package/src/sap/ui/fl/variants/context/i18n/i18n_en.properties +2 -4
  133. package/src/sap/ui/fl/variants/context/i18n/i18n_en_GB.properties +2 -4
  134. package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_sappsd.properties +2 -4
  135. package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saprigi.properties +2 -4
  136. package/src/sap/ui/fl/variants/context/i18n/i18n_en_US_saptrc.properties +2 -4
  137. package/src/sap/ui/fl/variants/context/i18n/i18n_es.properties +2 -4
  138. package/src/sap/ui/fl/variants/context/i18n/i18n_es_MX.properties +2 -4
  139. package/src/sap/ui/fl/variants/context/i18n/i18n_et.properties +2 -4
  140. package/src/sap/ui/fl/variants/context/i18n/i18n_fi.properties +2 -4
  141. package/src/sap/ui/fl/variants/context/i18n/i18n_fr.properties +2 -4
  142. package/src/sap/ui/fl/variants/context/i18n/i18n_fr_CA.properties +2 -4
  143. package/src/sap/ui/fl/variants/context/i18n/i18n_hi.properties +2 -4
  144. package/src/sap/ui/fl/variants/context/i18n/i18n_hr.properties +2 -4
  145. package/src/sap/ui/fl/variants/context/i18n/i18n_hu.properties +2 -4
  146. package/src/sap/ui/fl/variants/context/i18n/i18n_id.properties +2 -4
  147. package/src/sap/ui/fl/variants/context/i18n/i18n_it.properties +2 -4
  148. package/src/sap/ui/fl/variants/context/i18n/i18n_iw.properties +2 -4
  149. package/src/sap/ui/fl/variants/context/i18n/i18n_ja.properties +2 -4
  150. package/src/sap/ui/fl/variants/context/i18n/i18n_kk.properties +2 -4
  151. package/src/sap/ui/fl/variants/context/i18n/i18n_ko.properties +2 -4
  152. package/src/sap/ui/fl/variants/context/i18n/i18n_lt.properties +2 -4
  153. package/src/sap/ui/fl/variants/context/i18n/i18n_lv.properties +2 -4
  154. package/src/sap/ui/fl/variants/context/i18n/i18n_ms.properties +2 -4
  155. package/src/sap/ui/fl/variants/context/i18n/i18n_nl.properties +2 -4
  156. package/src/sap/ui/fl/variants/context/i18n/i18n_no.properties +2 -4
  157. package/src/sap/ui/fl/variants/context/i18n/i18n_pl.properties +2 -4
  158. package/src/sap/ui/fl/variants/context/i18n/i18n_pt.properties +2 -4
  159. package/src/sap/ui/fl/variants/context/i18n/i18n_pt_PT.properties +2 -4
  160. package/src/sap/ui/fl/variants/context/i18n/i18n_ro.properties +2 -4
  161. package/src/sap/ui/fl/variants/context/i18n/i18n_ru.properties +2 -4
  162. package/src/sap/ui/fl/variants/context/i18n/i18n_sh.properties +2 -4
  163. package/src/sap/ui/fl/variants/context/i18n/i18n_sk.properties +2 -4
  164. package/src/sap/ui/fl/variants/context/i18n/i18n_sl.properties +2 -4
  165. package/src/sap/ui/fl/variants/context/i18n/i18n_sv.properties +2 -4
  166. package/src/sap/ui/fl/variants/context/i18n/i18n_th.properties +2 -4
  167. package/src/sap/ui/fl/variants/context/i18n/i18n_tr.properties +2 -4
  168. package/src/sap/ui/fl/variants/context/i18n/i18n_uk.properties +2 -4
  169. package/src/sap/ui/fl/variants/context/i18n/i18n_vi.properties +2 -4
  170. package/src/sap/ui/fl/variants/context/i18n/i18n_zh_CN.properties +2 -4
  171. package/src/sap/ui/fl/variants/context/i18n/i18n_zh_TW.properties +2 -4
  172. package/src/sap/ui/fl/variants/context/view/ContextVisibility.view.xml +7 -6
  173. package/src/sap/ui/fl/write/_internal/Storage.js +47 -1
  174. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
  175. package/src/sap/ui/fl/write/_internal/Versions.js +18 -19
  176. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +5 -1
  177. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +4 -2
  178. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  179. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +24 -1
  180. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +2 -2
  181. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  182. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +3 -3
  183. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +60 -6
  184. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +59 -5
  185. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  186. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  187. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  188. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  189. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  190. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
  191. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +4 -4
  192. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  193. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  194. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  195. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  196. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  197. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  198. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +5 -5
  199. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  200. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  201. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  202. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  203. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  204. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +19 -5
  205. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +1 -1
  206. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  207. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  208. package/src/sap/ui/fl/write/api/AppVariantWriteAPI.js +13 -4
  209. package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +139 -39
  210. package/src/sap/ui/fl/write/api/FeaturesAPI.js +8 -2
  211. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  212. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +87 -4
  213. package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +4 -4
  214. package/src/sap/ui/fl/write/api/TranslationAPI.js +123 -0
  215. package/src/sap/ui/fl/write/api/VersionsAPI.js +1 -1
  216. package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +2 -1
  217. package/src/sap/ui/fl/write/connectors/BaseConnector.js +43 -0
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  ) {
36
36
  "use strict";
37
37
 
38
- function revertChangesAndUpdateVariantModel(oComponent, aChanges) {
38
+ function revertChangesAndUpdateVariantModel(oComponent, bSkipUrlUpdate, aChanges) {
39
39
  return Promise.resolve()
40
40
  .then(function () {
41
41
  if (aChanges.length !== 0) {
@@ -59,12 +59,15 @@ sap.ui.define([
59
59
  }
60
60
  });
61
61
 
62
- URLHandler.update({
63
- parameters: [],
64
- updateURL: true,
65
- updateHashEntry: true,
66
- model: oModel
67
- });
62
+ // Temporary fix, parameters generally should not be removed
63
+ if (!bSkipUrlUpdate) {
64
+ URLHandler.update({
65
+ parameters: [],
66
+ updateURL: true,
67
+ updateHashEntry: true,
68
+ model: oModel
69
+ });
70
+ }
68
71
  }
69
72
  }
70
73
 
@@ -81,20 +84,20 @@ sap.ui.define([
81
84
  * @alias sap.ui.fl.FlexController
82
85
  * @experimental Since 1.27.0
83
86
  * @author SAP SE
84
- * @version 1.97.1
87
+ * @version 1.100.0
85
88
  */
86
89
  var FlexController = function(sComponentName) {
87
90
  this._oChangePersistence = undefined;
88
91
  this._sComponentName = sComponentName || "";
89
92
  if (this._sComponentName) {
90
- this._createChangePersistence();
93
+ this._oChangePersistence = ChangePersistenceFactory.getChangePersistenceForComponent(this.getComponentName());
91
94
  }
92
95
  };
93
96
 
94
97
  /**
95
98
  * Returns the component name of the FlexController
96
99
  *
97
- * @returns {String} the name of the component
100
+ * @returns {string} the name of the component
98
101
  * @public
99
102
  */
100
103
  FlexController.prototype.getComponentName = function() {
@@ -104,7 +107,7 @@ sap.ui.define([
104
107
  /**
105
108
  * Sets the variant switch promise
106
109
  *
107
- * @param {promise} oPromise variant switch promise
110
+ * @param {Promise} oPromise variant switch promise
108
111
  */
109
112
  FlexController.prototype.setVariantSwitchPromise = function(oPromise) {
110
113
  this._oVariantSwitchPromise = oPromise;
@@ -113,7 +116,7 @@ sap.ui.define([
113
116
  /**
114
117
  * Returns the variant switch promise. By default this is a resolved promise
115
118
  *
116
- * @returns {promise} variant switch promise
119
+ * @returns {Promise} variant switch promise
117
120
  */
118
121
  FlexController.prototype.waitForVariantSwitch = function() {
119
122
  if (!this._oVariantSwitchPromise) {
@@ -158,7 +161,7 @@ sap.ui.define([
158
161
 
159
162
  var oChange = this.createBaseChange(oChangeSpecificData, oAppComponent);
160
163
 
161
- return this._getChangeHandler(oChange, sControlType, oControl, JsControlTreeModifier)
164
+ return ChangeHandlerStorage.getChangeHandler(oChange.getChangeType(), sControlType, oControl, JsControlTreeModifier, oChange.getLayer())
162
165
  .then(function(oChangeHandler) {
163
166
  if (oChangeHandler) {
164
167
  return oChangeHandler.completeChangeContent(oChange, oChangeSpecificData, {
@@ -440,21 +443,44 @@ sap.ui.define([
440
443
  return Promise.all(aPromises);
441
444
  };
442
445
 
446
+ FlexController.prototype._removeOtherLayerChanges = function(oAppComponent, sLayer, bRemoveOtherLayerChanges) {
447
+ if (bRemoveOtherLayerChanges && sLayer) {
448
+ var aLayersToReset = Object.values(Layer).filter(function(sLayerToCheck) {
449
+ return sLayerToCheck !== sLayer;
450
+ });
451
+ return this.removeDirtyChanges(aLayersToReset, oAppComponent, undefined, undefined, undefined, true);
452
+ }
453
+ return Promise.resolve();
454
+ };
455
+
443
456
  /**
444
457
  * Saves all changes of a persistence instance.
445
458
  *
446
459
  * @param {sap.ui.core.UIComponent} [oAppComponent] - AppComponent instance
447
460
  * @param {boolean} [bSkipUpdateCache=false] - Indicates the cache should not be updated
448
461
  * @param {boolean} [bDraft=false] - Indicates if changes should be written as a draft
462
+ * @param {string} [sLayer] - Layer for which the changes should be saved
463
+ * @param {boolean} [bRemoveOtherLayerChanges=false] - Whether to remove changes on other layers before saving
449
464
  * @returns {Promise} resolving with an array of responses or rejecting with the first error
450
465
  * @public
451
466
  */
452
- FlexController.prototype.saveAll = function(oAppComponent, bSkipUpdateCache, bDraft) {
453
- var nParentVersion = bDraft ? Versions.getVersionsModel({
454
- reference: Utils.normalizeReference(this._sComponentName),
455
- layer: Layer.CUSTOMER // only the customer layer has draft active
456
- }).getProperty("/persistedVersion") : undefined;
457
- return this._oChangePersistence.saveDirtyChanges(oAppComponent, bSkipUpdateCache, undefined, nParentVersion)
467
+ FlexController.prototype.saveAll = function(oAppComponent, bSkipUpdateCache, bDraft, sLayer, bRemoveOtherLayerChanges) {
468
+ var sParentVersion;
469
+ var aDraftFilenames;
470
+ if (bDraft) {
471
+ var oVersionModel = Versions.getVersionsModel({
472
+ reference: Utils.normalizeReference(this._sComponentName),
473
+ layer: Layer.CUSTOMER // only the customer layer has draft active
474
+ });
475
+ sParentVersion = oVersionModel.getProperty("/persistedVersion");
476
+ var aVersions = oVersionModel.getProperty("/versions");
477
+ if (aVersions && aVersions.length > 0) {
478
+ var oLatestVersion = aVersions[0];
479
+ aDraftFilenames = oLatestVersion.version === sap.ui.fl.Versions.Draft ? oLatestVersion.filenames : undefined;
480
+ }
481
+ }
482
+ return this._removeOtherLayerChanges(oAppComponent, sLayer, bRemoveOtherLayerChanges)
483
+ .then(this._oChangePersistence.saveDirtyChanges.bind(this._oChangePersistence, oAppComponent, bSkipUpdateCache, undefined, sParentVersion, aDraftFilenames))
458
484
  .then(function(oResult) {
459
485
  if (bDraft && oResult && oResult.response) {
460
486
  var vChangeDefinition = oResult.response;
@@ -491,29 +517,13 @@ sap.ui.define([
491
517
 
492
518
  return this._oChangePersistence.getChangesForView(mPropertyBag)
493
519
  .then(Applier.applyAllChangesForXMLView.bind(Applier, mPropertyBag))
494
- .catch(this._handlePromiseChainError.bind(this, mPropertyBag.view));
520
+ .catch(handleXMLApplyError.bind(this, mPropertyBag.view));
495
521
  };
496
522
 
497
- FlexController.prototype._handlePromiseChainError = function(oView, oError) {
523
+ function handleXMLApplyError(oView, oError) {
498
524
  Log.error("Error processing view " + oError + ".");
499
525
  return oView;
500
- };
501
-
502
- /**
503
- * Retrieves the change handler for the given change and control
504
- *
505
- * @param {sap.ui.fl.Change} oChange - Change instance
506
- * @param {string} sControlType - Mame of the ui5 control type i.e. sap.m.Button
507
- * @param {sap.ui.core.Control} oControl - Control for which to retrieve the change handler
508
- * @param {sap.ui.core.util.reflection.BaseTreeModifier} oModifier - Control tree modifier
509
- * @returns {Promise} Change handler or undefined if not found, wrapped in a promise.
510
- * @private
511
- */
512
- FlexController.prototype._getChangeHandler = function(oChange, sControlType, oControl, oModifier) {
513
- var sChangeType = oChange.getChangeType();
514
- var sLayer = oChange.getLayer();
515
- return ChangeHandlerStorage.getChangeHandler(sChangeType, sControlType, oControl, oModifier, sLayer);
516
- };
526
+ }
517
527
 
518
528
  /**
519
529
  * Retrieves the changes for the complete UI5 component
@@ -542,17 +552,6 @@ sap.ui.define([
542
552
  return this._oChangePersistence.checkForOpenDependenciesForControl(oSelector, oComponent);
543
553
  };
544
554
 
545
- /**
546
- * Creates a new instance of sap.ui.fl.Persistence based on the current component and caches the instance in a private member
547
- *
548
- * @returns {sap.ui.fl.Persistence} persistence instance
549
- * @private
550
- */
551
- FlexController.prototype._createChangePersistence = function() {
552
- this._oChangePersistence = ChangePersistenceFactory.getChangePersistenceForComponent(this.getComponentName());
553
- return this._oChangePersistence;
554
- };
555
-
556
555
  /**
557
556
  * Reset changes on the server
558
557
  * If the reset is performed for an entire component, a browser reload is required.
@@ -568,23 +567,24 @@ sap.ui.define([
568
567
  */
569
568
  FlexController.prototype.resetChanges = function(sLayer, sGenerator, oComponent, aSelectorIds, aChangeTypes) {
570
569
  return this._oChangePersistence.resetChanges(sLayer, sGenerator, aSelectorIds, aChangeTypes)
571
- .then(revertChangesAndUpdateVariantModel.bind(this, oComponent));
570
+ .then(revertChangesAndUpdateVariantModel.bind(this, oComponent, undefined));
572
571
  };
573
572
 
574
573
  /**
575
- * Removes unsaved changes and reverts these.
574
+ * Removes unsaved changes and reverts these. If no control is provided, all dirty changes are removed.
576
575
  *
577
- * @param {string} sLayer - Layer for which changes shall be deleted
576
+ * @param {string|string[]} vLayer - Layer or multiple layers for which changes shall be deleted
578
577
  * @param {sap.ui.core.Component} oComponent - Component instance
579
- * @param {sap.ui.core.Control} oControl - Control for which the changes should be removed
578
+ * @param {sap.ui.core.Control} [oControl] - Control for which the changes should be removed
580
579
  * @param {string} [sGenerator] - Generator of changes (optional)
581
580
  * @param {string[]} [aChangeTypes] - Types of changes (optional)
581
+ * @param {boolean} [bSkipUrlUpdate] - Whether to skip soft reload during variant model update
582
582
  *
583
583
  * @returns {Promise} Promise that resolves after the deletion took place
584
584
  */
585
- FlexController.prototype.removeDirtyChanges = function(sLayer, oComponent, oControl, sGenerator, aChangeTypes) {
586
- return this._oChangePersistence.removeDirtyChanges(sLayer, oComponent, oControl, sGenerator, aChangeTypes)
587
- .then(revertChangesAndUpdateVariantModel.bind(this, oComponent));
585
+ FlexController.prototype.removeDirtyChanges = function(vLayer, oComponent, oControl, sGenerator, aChangeTypes, bSkipUrlUpdate) {
586
+ return this._oChangePersistence.removeDirtyChanges(vLayer, oComponent, oControl, sGenerator, aChangeTypes)
587
+ .then(revertChangesAndUpdateVariantModel.bind(this, oComponent, bSkipUrlUpdate));
588
588
  };
589
589
 
590
590
  /**
@@ -626,19 +626,5 @@ sap.ui.define([
626
626
  return this._oChangePersistence.saveDirtyChanges(oAppComponent, false, aDirtyChanges);
627
627
  };
628
628
 
629
- /**
630
- * Send a flex/info request to the backend.
631
- *
632
- * @param {object} mPropertyBag Contains additional data needed for checking flex/info
633
- * @param {sap.ui.fl.Selector} mPropertyBag.selector Selector
634
- * @param {string} mPropertyBag.layer Layer on which the request is sent to the backend
635
- *
636
- * @returns {Promise<boolean>} Resolves the information if the application has content that can be reset and/or published
637
- */
638
- FlexController.prototype.getResetAndPublishInfo = function(mPropertyBag) {
639
- mPropertyBag.reference = this._sComponentName;
640
- return this._oChangePersistence.getResetAndPublishInfo(mPropertyBag);
641
- };
642
-
643
629
  return FlexController;
644
- }, true);
630
+ });
@@ -10,6 +10,7 @@ sap.ui.define([
10
10
  "sap/ui/fl/Layer",
11
11
  "sap/ui/fl/apply/_internal/changes/Applier",
12
12
  "sap/ui/fl/apply/_internal/flexState/FlexState",
13
+ "sap/ui/fl/apply/_internal/flexState/ManifestUtils",
13
14
  "sap/ui/fl/variants/VariantModel",
14
15
  "sap/base/Log",
15
16
  "sap/ui/performance/Measurement"
@@ -19,6 +20,7 @@ sap.ui.define([
19
20
  Layer,
20
21
  Applier,
21
22
  FlexState,
23
+ ManifestUtils,
22
24
  VariantModel,
23
25
  Log,
24
26
  Measurement
@@ -30,7 +32,7 @@ sap.ui.define([
30
32
  * @alias sap.ui.fl.FlexControllerFactory
31
33
  * @experimental Since 1.27.0
32
34
  * @author SAP SE
33
- * @version 1.97.1
35
+ * @version 1.100.0
34
36
  *
35
37
  * @private
36
38
  * @ui5-restricted sap.ui.fl
@@ -46,7 +48,7 @@ sap.ui.define([
46
48
  /**
47
49
  * Creates or returns an instance of the FlexController
48
50
  *
49
- * @param {String} sComponentName - Name of the component
51
+ * @param {string} sComponentName - Name of the component
50
52
  * @returns {sap.ui.fl.FlexController} instance
51
53
  *
52
54
  */
@@ -73,7 +75,7 @@ sap.ui.define([
73
75
  FlexControllerFactory.createForControl = function(oControl) {
74
76
  try {
75
77
  var oAppComponent = Utils.getAppComponentForControl(oControl);
76
- var sComponentName = Utils.getComponentClassName(oAppComponent || oControl);
78
+ var sComponentName = ManifestUtils.getFlexReferenceForControl(oAppComponent || oControl);
77
79
  return FlexControllerFactory.create(sComponentName);
78
80
  } catch (oError) {
79
81
  Log.error(oError.message, undefined, "sap.ui.fl.FlexControllerFactory");
@@ -97,7 +99,7 @@ sap.ui.define([
97
99
 
98
100
  var sRestartingComponent = window.sessionStorage.getItem("sap.ui.rta.restart." + Layer.CUSTOMER);
99
101
  if (sRestartingComponent) {
100
- var sComponentId = Utils.getComponentClassName(oComponent);
102
+ var sComponentId = ManifestUtils.getFlexReferenceForControl(oComponent);
101
103
  if (sRestartingComponent !== sComponentId && sRestartingComponent !== "true") {
102
104
  Log.error("an application component was started " +
103
105
  "which does not match the component for which the restart was triggered:\n" +
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  *
42
42
  * @namespace sap.ui.fl.LayerUtils
43
43
  * @author SAP SE
44
- * @version 1.97.1
44
+ * @version 1.100.0
45
45
  */
46
46
  var LayerUtils = {
47
47
  _mLayersIndex: mLayersIndex,