@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
@@ -93,10 +93,10 @@ sap.ui.define([
93
93
  return (sKey !== "dataSource") ? aObjectKeys[aObjectKeys.length - 1] : aObjectKeys;
94
94
  }
95
95
 
96
- function checkChange(oEntityPropertyChange, aSupportedProperties, aSupportedOperations, oSupportedPropertyPattern, aNotAllowedToBeDeleteProperties) {
96
+ function checkChange(oEntityPropertyChange, aSupportedProperties, aSupportedOperations, oSupportedPropertyPattern, aNotAllowedToBeDeleteProperties, oSupportedPropertyTypes) {
97
97
  const aEntityPropertyChanges = Array.isArray(oEntityPropertyChange) ? oEntityPropertyChange : [oEntityPropertyChange];
98
98
  aEntityPropertyChanges.forEach(function(oChange) {
99
- formatEntityCheck(oChange, aSupportedProperties, aSupportedOperations, aNotAllowedToBeDeleteProperties);
99
+ formatEntityCheck(oChange, aSupportedProperties, aSupportedOperations, aNotAllowedToBeDeleteProperties, oSupportedPropertyTypes);
100
100
  checkPropertyValuePattern(oChange, oSupportedPropertyPattern);
101
101
  });
102
102
  }
@@ -132,13 +132,20 @@ sap.ui.define([
132
132
  * @returns {boolean} Property Path is supported or is not supported
133
133
  */
134
134
  function isGenericPropertyPathSupported(aSupportedProperties, sPropertyPath) {
135
- var aClearedGenericPath = getClearedGenericPath(aSupportedProperties);
136
- return aClearedGenericPath.some(function(path) {
137
- return sPropertyPath.startsWith(path);
135
+ const aClearedGenericPath = getClearedGenericPath(aSupportedProperties);
136
+ let bIsGenericPathSupported = false;
137
+ aClearedGenericPath.forEach(function(path) {
138
+ if (sPropertyPath.startsWith(path)) {
139
+ const sPathWithoutRoot = sPropertyPath.replace(path, "");
140
+ if (sPathWithoutRoot.startsWith("/") || sPathWithoutRoot === "") {
141
+ bIsGenericPathSupported = true;
142
+ }
143
+ }
138
144
  });
145
+ return bIsGenericPathSupported;
139
146
  }
140
147
 
141
- function formatEntityCheck(oChangeEntity, aSupportedProperties, aSupportedOperations, aNotAllowedToBeDeleteProperties) {
148
+ function formatEntityCheck(oChangeEntity, aSupportedProperties, aSupportedOperations, aNotAllowedToBeDeleteProperties, oSupportedPropertyTypes) {
142
149
  if (!oChangeEntity.propertyPath) {
143
150
  throw new Error("Invalid change format: The mandatory 'propertyPath' is not defined. Please define the mandatory property 'propertyPath'");
144
151
  }
@@ -147,8 +154,10 @@ sap.ui.define([
147
154
  }
148
155
  const sOpertationUpperCase = oChangeEntity.operation.toUpperCase();
149
156
  if (sOpertationUpperCase === "DELETE") {
150
- if (aNotAllowedToBeDeleteProperties.includes(oChangeEntity.propertyPath)) {
151
- throw new Error(`The property '${oChangeEntity.propertyPath}' was attempted to be deleted. The mandatory properties ${aNotAllowedToBeDeleteProperties.join("|")} cannot be deleted.`);
157
+ if (aNotAllowedToBeDeleteProperties) {
158
+ if (aNotAllowedToBeDeleteProperties.includes(oChangeEntity.propertyPath)) {
159
+ throw new Error(`The property '${oChangeEntity.propertyPath}' was attempted to be deleted. The mandatory properties ${aNotAllowedToBeDeleteProperties.join("|")} cannot be deleted.`);
160
+ }
152
161
  }
153
162
  if (oChangeEntity.hasOwnProperty("propertyValue")) {
154
163
  throw new Error(`The property 'propertyValue' must not be provided in a 'DELETE' operation. Please remove 'propertyValue'.`);
@@ -158,10 +167,18 @@ sap.ui.define([
158
167
  if (!oChangeEntity.hasOwnProperty("propertyValue")) {
159
168
  throw new Error("Invalid change format: The mandatory 'propertyValue' is not defined. Please define the mandatory property 'propertyValue'");
160
169
  }
161
-
162
170
  if (!aSupportedProperties.includes(oChangeEntity.propertyPath) && !isGenericPropertyPathSupported(aSupportedProperties, oChangeEntity.propertyPath)) {
163
171
  throw new Error(`Changing ${oChangeEntity.propertyPath} is not supported. The supported 'propertyPath' is: ${aSupportedProperties.join("|")}`);
164
172
  }
173
+ if (oSupportedPropertyTypes) {
174
+ const aPropertyPath = oChangeEntity.propertyPath.split("/");
175
+ const sProperty = aPropertyPath[aPropertyPath.length - 1];
176
+ if (oSupportedPropertyTypes[sProperty]) {
177
+ if (String(typeof oChangeEntity.propertyValue) !== oSupportedPropertyTypes[sProperty]) {
178
+ throw new Error(`The property '${sProperty}' is type of '${typeof oChangeEntity.propertyValue}'. Supported type for property '${sProperty}' is '${oSupportedPropertyTypes[sProperty]}'.`);
179
+ }
180
+ }
181
+ }
165
182
  }
166
183
  if (!aSupportedOperations.includes(sOpertationUpperCase)) {
167
184
  throw new Error(`Operation ${sOpertationUpperCase} is not supported. The supported 'operation' is ${aSupportedOperations.join("|")}`);
@@ -180,7 +197,7 @@ sap.ui.define([
180
197
  * @private
181
198
  * @ui5-restricted sap.ui.fl, sap.suite.ui.generic.template
182
199
  */
183
- function checkEntityPropertyChange(oChange, aSupportedProperties, aSupportedOperations, oSupportedPropertyPattern, aNotAllowedToBeDeleteProperties) {
200
+ function checkEntityPropertyChange(oChange, aSupportedProperties, aSupportedOperations, oSupportedPropertyPattern, aNotAllowedToBeDeleteProperties, oSupportedPropertyTypes) {
184
201
  var sId = Object.keys(oChange).filter(function(sKey) {
185
202
  return sKey.endsWith("Id");
186
203
  }).shift();
@@ -191,7 +208,7 @@ sap.ui.define([
191
208
  throw new Error(`Changes for "${oChange[sId]}" are not provided.`);
192
209
  }
193
210
 
194
- checkChange(oChange.entityPropertyChange, aSupportedProperties, aSupportedOperations, oSupportedPropertyPattern, aNotAllowedToBeDeleteProperties);
211
+ checkChange(oChange.entityPropertyChange, aSupportedProperties, aSupportedOperations, oSupportedPropertyPattern, aNotAllowedToBeDeleteProperties, oSupportedPropertyTypes);
195
212
  }
196
213
 
197
214
  var layer_prefixes = {};
@@ -250,11 +267,13 @@ sap.ui.define([
250
267
  * @ui5-restricted sap.ui.fl, sap.suite.ui.generic.template
251
268
  */
252
269
  function checkPropertyValuePattern(oChange, oSupportedPattern) {
253
- // if no pattern is provided, everything is allowed
254
- if (!Object.keys(oSupportedPattern).includes(oChange.propertyPath)) { return; }
255
- if (!oChange.propertyValue.match(oSupportedPattern[oChange.propertyPath])) {
256
- throw new Error(`Not supported format for propertyPath ${oChange.propertyPath}. ` +
257
- `The supported pattern is ${oSupportedPattern[oChange.propertyPath]}`);
270
+ if (oSupportedPattern) {
271
+ // if no pattern is provided, everything is allowed
272
+ if (!Object.keys(oSupportedPattern).includes(oChange.propertyPath)) { return; }
273
+ if (!oChange.propertyValue.match(oSupportedPattern[oChange.propertyPath])) {
274
+ throw new Error(`Not supported format for propertyPath ${oChange.propertyPath}. ` +
275
+ `The supported pattern is ${oSupportedPattern[oChange.propertyPath]}`);
276
+ }
258
277
  }
259
278
  }
260
279
 
@@ -50,7 +50,7 @@ sap.ui.define([
50
50
  * @extends sap.ui.core.Control
51
51
  *
52
52
  * @author SAP SE
53
- * @version 1.129.0
53
+ * @version 1.130.1
54
54
  *
55
55
  * @constructor
56
56
  * @private
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @extends sap.ui.core.Element
26
26
  *
27
27
  * @author SAP SE
28
- * @version 1.129.0
28
+ * @version 1.130.1
29
29
  *
30
30
  * @constructor
31
31
  * @private
@@ -34,7 +34,7 @@ sap.ui.define([
34
34
  *
35
35
  * @function
36
36
  * @author SAP SE
37
- * @version 1.129.0
37
+ * @version 1.130.1
38
38
  * @alias sap.ui.fl.util.resolveBinding
39
39
  * @since 1.91
40
40
  * @private
@@ -29,6 +29,7 @@ sap.ui.define([
29
29
  "sap/ui/fl/registry/Settings",
30
30
  "sap/ui/fl/write/_internal/flexState/changes/UIChangeManager",
31
31
  "sap/ui/fl/write/_internal/flexState/FlexObjectManager",
32
+ "sap/ui/fl/write/_internal/controlVariants/ControlVariantWriteUtils",
32
33
  "sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
33
34
  "sap/ui/fl/Layer",
34
35
  "sap/ui/fl/LayerUtils",
@@ -60,6 +61,7 @@ sap.ui.define([
60
61
  Settings,
61
62
  UIChangeManager,
62
63
  FlexObjectManager,
64
+ ControlVariantWriteUtils,
63
65
  ContextBasedAdaptationsAPI,
64
66
  Layer,
65
67
  LayerUtils,
@@ -313,7 +315,7 @@ sap.ui.define([
313
315
  * @class Variant model implementation for JSON format.
314
316
  * @extends sap.ui.model.json.JSONModel
315
317
  * @author SAP SE
316
- * @version 1.129.0
318
+ * @version 1.130.1
317
319
  * @param {object} oData - Either the URL where to load the JSON from or a JS object
318
320
  * @param {object} mPropertyBag - Map of properties required for the constructor
319
321
  * @param {sap.ui.fl.FlexController} mPropertyBag.flexController - <code>FlexController</code> instance for the component which uses the variant model
@@ -821,6 +823,7 @@ sap.ui.define([
821
823
  const aModelVariants = oData.variants;
822
824
  const aChanges = [];
823
825
  const oSettings = Settings.getInstanceOrUndef();
826
+ const aVariantsToBeDeleted = [];
824
827
 
825
828
  const findVariant = (sVariantKey) => {
826
829
  return aModelVariants.find((oModelVariant) => oModelVariant.key === sVariantKey);
@@ -885,6 +888,7 @@ sap.ui.define([
885
888
  visible: false
886
889
  }
887
890
  );
891
+ aVariantsToBeDeleted.push(sVariantKey);
888
892
  });
889
893
  oEvent.getParameter("contexts")?.forEach(({key: sVariantKey, contexts: aNewContexts}) => {
890
894
  const oVariant = findVariant(sVariantKey);
@@ -908,7 +912,10 @@ sap.ui.define([
908
912
  });
909
913
  }
910
914
 
911
- return aChanges;
915
+ return {
916
+ changes: aChanges,
917
+ variantsToBeDeleted: aVariantsToBeDeleted
918
+ };
912
919
  };
913
920
 
914
921
  /**
@@ -1204,33 +1211,48 @@ sap.ui.define([
1204
1211
 
1205
1212
  VariantModel.prototype._initializeManageVariantsEvents = function() {
1206
1213
  this.fnManageClickRta = function(oEvent, oData) {
1207
- var aConfiguredChanges = this._collectModelChanges(oData.variantManagementReference, oData.layer, oEvent);
1208
- oData.resolve(aConfiguredChanges);
1214
+ const oModelChanges = this._collectModelChanges(oData.variantManagementReference, oData.layer, oEvent);
1215
+ oData.resolve(oModelChanges);
1209
1216
  };
1210
1217
 
1211
1218
  this.fnManageClick = function(oEvent, oData) {
1212
1219
  (async () => {
1220
+ const sVMReference = oData.variantManagementReference;
1213
1221
  if (!this.oFlexController || !this.getData()) {
1214
1222
  return;
1215
1223
  }
1216
- var aConfigurationChangesContent = this._collectModelChanges(oData.variantManagementReference, Layer.USER, oEvent);
1224
+ const {
1225
+ changes: aConfigurationChangesContent,
1226
+ variantsToBeDeleted: aVariantsToBeDeleted
1227
+ } = this._collectModelChanges(sVMReference, Layer.USER, oEvent);
1217
1228
 
1218
1229
  if (aConfigurationChangesContent.some((oChange) => {
1219
1230
  return oChange.visible === false
1220
- && oChange.variantReference === this.getCurrentVariantReference(oData.variantManagementReference);
1231
+ && oChange.variantReference === this.getCurrentVariantReference(sVMReference);
1221
1232
  })) {
1222
1233
  await this.updateCurrentVariant({
1223
- variantManagementReference: oData.variantManagementReference,
1224
- newVariantReference: oData.variantManagementReference
1234
+ variantManagementReference: sVMReference,
1235
+ newVariantReference: sVMReference
1225
1236
  });
1226
1237
  }
1227
1238
 
1228
- var aChanges = [];
1229
1239
  aConfigurationChangesContent.forEach(function(oChangeProperties) {
1230
1240
  oChangeProperties.appComponent = this.oAppComponent;
1231
1241
  }.bind(this));
1232
- aChanges = aChanges.concat(this.addVariantChanges(oData.variantManagementReference, aConfigurationChangesContent));
1233
- this.oChangePersistence.saveDirtyChanges(this.oAppComponent, false, aChanges);
1242
+
1243
+ this.addVariantChanges(sVMReference, aConfigurationChangesContent);
1244
+ aVariantsToBeDeleted
1245
+ .forEach((sVariantKey) => {
1246
+ const oVariant = VariantManagementState.getVariant({
1247
+ reference: this.sFlexReference,
1248
+ vmReference: sVMReference,
1249
+ vReference: sVariantKey
1250
+ });
1251
+ if (oVariant.layer === Layer.USER) {
1252
+ ControlVariantWriteUtils.deleteVariant(this.sFlexReference, sVMReference, sVariantKey);
1253
+ }
1254
+ });
1255
+ this.oChangePersistence.saveDirtyChanges(this.oAppComponent, false);
1234
1256
  })();
1235
1257
  };
1236
1258
  };
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  *
23
23
  * @namespace sap.ui.fl.write._internal.Storage
24
24
  * @since 1.67
25
- * @version 1.129.0
25
+ * @version 1.130.1
26
26
  * @private
27
27
  * @ui5-restricted sap.ui.fl
28
28
  */
@@ -159,7 +159,7 @@ sap.ui.define([
159
159
  *
160
160
  * @namespace sap.ui.fl.write._internal.Versions
161
161
  * @since 1.74
162
- * @version 1.129.0
162
+ * @version 1.130.1
163
163
  * @private
164
164
  * @ui5-restricted sap.ui.fl
165
165
  */
@@ -323,6 +323,7 @@ sap.ui.define([
323
323
  * @param {object} mPropertyBag - Property Bag
324
324
  * @param {string} mPropertyBag.reference - ID of the application for which the versions are requested (this reference must not contain the ".Component" suffix)
325
325
  * @param {string} mPropertyBag.layer - Layer for which the versions should be retrieved
326
+ * @param {boolean} [mPropertyBag.discardDraftAndKeepActiveVersion] - discard draft and keep active version
326
327
  * @returns {Promise<object>} Promise resolving to an object to indicate if a discarding took place on backend side and/or dirty changes were discarded;
327
328
  * rejects if an error occurs or the layer does not support draft handling
328
329
  */
@@ -334,8 +335,11 @@ sap.ui.define([
334
335
  return oDiscardPromise.then(function() {
335
336
  var aVersions = oModel.getProperty("/versions");
336
337
  aVersions.shift();
337
- _updateVersionModelWhenDiscardOrActivate(oModel, oModel.getProperty("/activeVersion"));
338
-
338
+ let sDisplayedVersion = oModel.getProperty("/activeVersion");
339
+ if (mPropertyBag.discardDraftAndKeepActiveVersion) {
340
+ sDisplayedVersion = oModel.getProperty("/displayedVersion");
341
+ }
342
+ _updateVersionModelWhenDiscardOrActivate(oModel, sDisplayedVersion);
339
343
  return {
340
344
  backendChangesDiscarded: bBackendDraftExists
341
345
  };
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  * @constructor
36
36
  * @alias sap.ui.fl.write._internal.appVariant.AppVariant
37
37
  * @author SAP SE
38
- * @version 1.129.0
38
+ * @version 1.130.1
39
39
  * @private
40
40
  * @ui5-restricted sap.ui.rta, smart business
41
41
  */
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @namespace
33
33
  * @alias sap.ui.fl.write._internal.appVariant.AppVariantFactory
34
34
  * @author SAP SE
35
- * @version 1.129.0
35
+ * @version 1.130.1
36
36
  * @private
37
37
  * @ui5-restricted sap.ui.rta, smart business
38
38
  */
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @constructor
29
29
  * @alias sap.ui.fl.write._internal.appVariant.AppVariantInlineChange
30
30
  * @author SAP SE
31
- * @version 1.129.0
31
+ * @version 1.130.1
32
32
  * @private
33
33
  * @ui5-restricted sap.ui.rta, smart business
34
34
  */
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @namespace
34
34
  * @alias sap.ui.fl.write._internal.appVariant.AppVariantInlineChangeFactory
35
35
  * @author SAP SE
36
- * @version 1.129.0
36
+ * @version 1.130.1
37
37
  * @private
38
38
  * @ui5-restricted sap.ui.rta, smart business
39
39
  */
@@ -988,6 +988,39 @@ sap.ui.define([
988
988
  return _createAppVariantInlineChange(mPropertyBag);
989
989
  };
990
990
 
991
+ /**
992
+ * Creates an inline change of change type <code>appdescr_fe_addNewPage</code>.
993
+ *
994
+ * @param {object} mPropertyBag Parameters of the change type
995
+ * @param {string} mPropertyBag.changeType Inline change type of an app variant
996
+ * @param {object} mPropertyBag.sourcePage Source page details
997
+ * @param {string} mPropertyBag.sourcePage.id ID of the source page
998
+ * @param {string} mPropertyBag.sourcePage.navigationSource Navigation source of the source page
999
+ * @param {object} mPropertyBag.targetPage Target page details
1000
+ * @param {string} mPropertyBag.targetPage.id ID of the target page
1001
+ * @param {string} mPropertyBag.targetPage.type Type of the target page
1002
+ * @param {string} mPropertyBag.targetPage.name Name of the target page component
1003
+ * @param {string} mPropertyBag.targetPage.routePattern Route pattern for navigation
1004
+ * @param {object} mPropertyBag.targetPage.settings Additional settings for the target page
1005
+ *
1006
+ * @return {Promise} Resolving when creating the app variant inline change was successful (without back end access)
1007
+ *
1008
+ * @private
1009
+ */
1010
+ AppVariantInlineChangeFactory.create_fe_addNewPage = function(mPropertyBag) {
1011
+ Utils.checkParameterAndType(mPropertyBag.sourcePage, "id", "string");
1012
+ Utils.checkParameterAndType(mPropertyBag.sourcePage, "navigationSource", "string");
1013
+ Utils.checkParameterAndType(mPropertyBag.targetPage, "id", "string");
1014
+ Utils.checkParameterAndType(mPropertyBag.targetPage, "type", "string");
1015
+ Utils.checkParameterAndType(mPropertyBag.targetPage, "name", "string");
1016
+ Utils.checkParameterAndType(mPropertyBag.targetPage, "routePattern", "string");
1017
+ Utils.checkParameterAndType(mPropertyBag.targetPage, "settings", "object");
1018
+ Utils.checkParameterAndType(mPropertyBag.targetPage.settings, "contextPath", "string");
1019
+ Utils.checkParameterAndType(mPropertyBag.targetPage.settings, "pageLayout", "string");
1020
+ Utils.checkParameterAndType(mPropertyBag.targetPage.settings, "controlConfiguration", "object");
1021
+ return _createAppVariantInlineChange(mPropertyBag);
1022
+ };
1023
+
991
1024
  /**
992
1025
  * Creates an inline change of change type <code>appdescr_ui_generic_app_changePageConfiguration</code>.
993
1026
  *