@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.
- package/THIRDPARTY.txt +1 -1
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +26 -38
- package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
- package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
- package/src/sap/ui/fl/FlexController.js +1 -1
- package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
- package/src/sap/ui/fl/LayerUtils.js +1 -1
- package/src/sap/ui/fl/Utils.js +8 -8
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +152 -197
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +23 -17
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +27 -37
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +26 -31
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddTechnicalAttributes.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetAch.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetDescription.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetCloudDevAdaptationStatus.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/ChangeModel.js +78 -0
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
- package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/extensionPoint/Registry.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AnnotationChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +7 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +34 -13
- package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +108 -0
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +57 -9
- package/src/sap/ui/fl/apply/_internal/preprocessors/ComponentLifecycleHooks.js +2 -2
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +6 -6
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +25 -10
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +18 -45
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/fl/changeHandler/Base.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseRename.js +1 -1
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveElements.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
- package/src/sap/ui/fl/changeHandler/StashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
- package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +37 -1
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +3 -2
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +15 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +43 -43
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +1 -1
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
- package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/DescriptorChangeCheck.js +35 -16
- package/src/sap/ui/fl/util/IFrame.js +1 -1
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/util/resolveBinding.js +1 -1
- package/src/sap/ui/fl/variants/VariantModel.js +33 -11
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +7 -3
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
- package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +34 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +163 -176
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +62 -61
- package/src/sap/ui/fl/write/_internal/condenser/Utils.js +17 -19
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +13 -13
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +17 -19
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +32 -35
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Update.js +2 -10
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BtpServiceConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +56 -4
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/controlVariants/ControlVariantWriteUtils.js +59 -0
- package/src/sap/ui/fl/write/_internal/delegates/ODataV2ReadDelegate.js +1 -2
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectManager.js +33 -2
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +26 -3
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +20 -12
- package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
- package/src/sap/ui/fl/write/api/ChangesWriteAPI.js +73 -3
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +17 -27
- 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
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
|
151
|
-
|
|
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
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
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
|
|
|
@@ -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.
|
|
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
|
|
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
|
-
|
|
1208
|
-
oData.resolve(
|
|
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
|
-
|
|
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(
|
|
1231
|
+
&& oChange.variantReference === this.getCurrentVariantReference(sVMReference);
|
|
1221
1232
|
})) {
|
|
1222
1233
|
await this.updateCurrentVariant({
|
|
1223
|
-
variantManagementReference:
|
|
1224
|
-
newVariantReference:
|
|
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
|
-
|
|
1233
|
-
this.
|
|
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
|
};
|
|
@@ -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.
|
|
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
|
-
|
|
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
|
};
|
|
@@ -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.
|
|
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
|
*
|