@openui5/sap.ui.fl 1.128.0 → 1.130.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.
- package/THIRDPARTY.txt +2 -2
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +38 -458
- 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 +27 -51
- 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 +5 -5
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +3 -2
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +6 -4
- 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 +152 -0
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +12 -18
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewOutbound.js +67 -0
- 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 +11 -9
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeOutbound.js +5 -3
- 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/controlVariants/URLHandler.js +18 -5
- 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 +2 -2
- package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +2 -4
- package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +19 -10
- package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +4 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +4 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +16 -12
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +23 -22
- package/src/sap/ui/fl/apply/_internal/flexObjects/States.js +4 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +6 -5
- package/src/sap/ui/fl/apply/_internal/flexObjects/UpdatableChange.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +4 -3
- package/src/sap/ui/fl/apply/_internal/flexObjects/getVariantAuthor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/FlexObjectState.js +4 -4
- package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +50 -73
- 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 +10 -6
- package/src/sap/ui/fl/apply/_internal/flexState/changes/UIChangesState.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantManagementState.js +105 -0
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
- package/src/sap/ui/fl/apply/_internal/flexState/compVariants/prepareCompVariantsMap.js +16 -15
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +10 -12
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +69 -14
- 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/AnnotationChangeHandlerAPI.js +63 -0
- 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 +4 -4
- package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +2 -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 +26 -5
- 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 +33 -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 +14 -13
- 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/designtime/util/editIFrame.js +2 -1
- package/src/sap/ui/fl/initial/_internal/FlexConfiguration.js +1 -1
- package/src/sap/ui/fl/initial/_internal/Storage.js +46 -8
- package/src/sap/ui/fl/initial/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +3 -3
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +25 -2
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +54 -22
- 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/registry/Settings.js +1 -1
- package/src/sap/ui/fl/support/_internal/extractChangeDependencies.js +29 -58
- package/src/sap/ui/fl/support/_internal/getAllUIChanges.js +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +12 -66
- package/src/sap/ui/fl/support/_internal/getFlexObjectInfos.js +7 -4
- package/src/sap/ui/fl/support/_internal/getFlexSettings.js +30 -19
- package/src/sap/ui/fl/support/api/SupportAPI.js +8 -4
- 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 +133 -20
- package/src/sap/ui/fl/util/IFrame.js +3 -3
- package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
- package/src/sap/ui/fl/util/changePropertyValueByPath.js +15 -4
- package/src/sap/ui/fl/util/resolveBinding.js +9 -9
- package/src/sap/ui/fl/variants/VariantModel.js +81 -42
- package/src/sap/ui/fl/variants/context/controller/ContextVisibility.controller.js +2 -2
- package/src/sap/ui/fl/write/_internal/SaveAs.js +12 -3
- package/src/sap/ui/fl/write/_internal/Storage.js +6 -6
- 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 +165 -178
- 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 +98 -5
- package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +3 -3
- 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 +122 -77
- 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 +18 -18
- 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 +12 -11
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +6 -8
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectManager.js +212 -5
- package/src/sap/ui/fl/write/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/changes/UIChangeManager.js +109 -0
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +62 -54
- 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/ContextBasedAdaptationsAPI.js +22 -19
- package/src/sap/ui/fl/write/api/ControlPersonalizationWriteAPI.js +56 -30
- 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/PersistenceWriteAPI.js +28 -51
- package/src/sap/ui/fl/write/api/SmartBusinessWriteAPI.js +11 -7
- package/src/sap/ui/fl/write/api/VersionsAPI.js +32 -8
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/base/util/restricted/_omit",
|
|
9
8
|
"sap/base/util/restricted/_isEqual",
|
|
9
|
+
"sap/base/util/restricted/_omit",
|
|
10
10
|
"sap/base/util/each",
|
|
11
11
|
"sap/base/util/isEmptyObject",
|
|
12
12
|
"sap/base/util/merge",
|
|
@@ -19,23 +19,26 @@ sap.ui.define([
|
|
|
19
19
|
"sap/ui/fl/apply/_internal/changes/Applier",
|
|
20
20
|
"sap/ui/fl/apply/_internal/changes/Reverter",
|
|
21
21
|
"sap/ui/fl/apply/_internal/controlVariants/URLHandler",
|
|
22
|
+
"sap/ui/fl/apply/_internal/controlVariants/Utils",
|
|
22
23
|
"sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory",
|
|
23
24
|
"sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler",
|
|
24
25
|
"sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher",
|
|
25
26
|
"sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState",
|
|
26
27
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
27
28
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
28
|
-
"sap/ui/fl/
|
|
29
|
+
"sap/ui/fl/registry/Settings",
|
|
30
|
+
"sap/ui/fl/write/_internal/flexState/changes/UIChangeManager",
|
|
31
|
+
"sap/ui/fl/write/_internal/flexState/FlexObjectManager",
|
|
32
|
+
"sap/ui/fl/write/_internal/controlVariants/ControlVariantWriteUtils",
|
|
29
33
|
"sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
|
|
30
34
|
"sap/ui/fl/Layer",
|
|
31
35
|
"sap/ui/fl/LayerUtils",
|
|
32
36
|
"sap/ui/fl/Utils",
|
|
33
|
-
"sap/ui/
|
|
34
|
-
"sap/ui/model/BindingMode"
|
|
35
|
-
"sap/ui/model/json/JSONModel"
|
|
37
|
+
"sap/ui/model/json/JSONModel",
|
|
38
|
+
"sap/ui/model/BindingMode"
|
|
36
39
|
], function(
|
|
37
|
-
_omit,
|
|
38
40
|
_isEqual,
|
|
41
|
+
_omit,
|
|
39
42
|
each,
|
|
40
43
|
isEmptyObject,
|
|
41
44
|
merge,
|
|
@@ -48,20 +51,23 @@ sap.ui.define([
|
|
|
48
51
|
Applier,
|
|
49
52
|
Reverter,
|
|
50
53
|
URLHandler,
|
|
54
|
+
VariantUtil,
|
|
51
55
|
FlexObjectFactory,
|
|
52
56
|
DependencyHandler,
|
|
53
57
|
Switcher,
|
|
54
58
|
VariantManagementState,
|
|
55
59
|
FlexObjectState,
|
|
56
60
|
ManifestUtils,
|
|
57
|
-
|
|
61
|
+
Settings,
|
|
62
|
+
UIChangeManager,
|
|
63
|
+
FlexObjectManager,
|
|
64
|
+
ControlVariantWriteUtils,
|
|
58
65
|
ContextBasedAdaptationsAPI,
|
|
59
66
|
Layer,
|
|
60
67
|
LayerUtils,
|
|
61
68
|
Utils,
|
|
62
|
-
|
|
63
|
-
BindingMode
|
|
64
|
-
JSONModel
|
|
69
|
+
JSONModel,
|
|
70
|
+
BindingMode
|
|
65
71
|
) {
|
|
66
72
|
"use strict";
|
|
67
73
|
|
|
@@ -156,7 +162,10 @@ sap.ui.define([
|
|
|
156
162
|
return undefined;
|
|
157
163
|
})
|
|
158
164
|
.then(function() {
|
|
159
|
-
|
|
165
|
+
FlexObjectManager.deleteFlexObjects({
|
|
166
|
+
reference: mPropertyBag.model.sFlexReference,
|
|
167
|
+
flexObjects: aVariantDirtyChanges
|
|
168
|
+
});
|
|
160
169
|
});
|
|
161
170
|
}
|
|
162
171
|
|
|
@@ -306,7 +315,7 @@ sap.ui.define([
|
|
|
306
315
|
* @class Variant model implementation for JSON format.
|
|
307
316
|
* @extends sap.ui.model.json.JSONModel
|
|
308
317
|
* @author SAP SE
|
|
309
|
-
* @version 1.
|
|
318
|
+
* @version 1.130.0
|
|
310
319
|
* @param {object} oData - Either the URL where to load the JSON from or a JS object
|
|
311
320
|
* @param {object} mPropertyBag - Map of properties required for the constructor
|
|
312
321
|
* @param {sap.ui.fl.FlexController} mPropertyBag.flexController - <code>FlexController</code> instance for the component which uses the variant model
|
|
@@ -362,22 +371,18 @@ sap.ui.define([
|
|
|
362
371
|
});
|
|
363
372
|
|
|
364
373
|
VariantModel.prototype.updateData = function() {
|
|
365
|
-
|
|
366
|
-
|
|
374
|
+
const oNewVariantsMap = this.oDataSelector.get({ reference: this.sFlexReference });
|
|
375
|
+
const oCurrentData = { ...this.getData() };
|
|
367
376
|
Object.entries(oNewVariantsMap).forEach(function(aVariants) {
|
|
368
|
-
|
|
369
|
-
|
|
377
|
+
const sVariantManagementKey = aVariants[0];
|
|
378
|
+
const oVariantMapEntry = { ...aVariants[1] };
|
|
370
379
|
oCurrentData[sVariantManagementKey] ||= {};
|
|
371
380
|
oCurrentData[sVariantManagementKey].variants = oVariantMapEntry.variants.map(function(oVariant) {
|
|
372
|
-
|
|
381
|
+
const oCurrentVariantData = (oCurrentData[sVariantManagementKey].variants || [])
|
|
373
382
|
.find(function(oVariantToCheck) {
|
|
374
383
|
return oVariantToCheck.key === oVariant.key;
|
|
375
384
|
});
|
|
376
|
-
return
|
|
377
|
-
{},
|
|
378
|
-
oCurrentVariantData || {},
|
|
379
|
-
oVariant
|
|
380
|
-
);
|
|
385
|
+
return { ...(oCurrentVariantData || {}), ...oVariant };
|
|
381
386
|
});
|
|
382
387
|
oCurrentData[sVariantManagementKey].currentVariant = oVariantMapEntry.currentVariant;
|
|
383
388
|
oCurrentData[sVariantManagementKey].defaultVariant = oVariantMapEntry.defaultVariant;
|
|
@@ -616,10 +621,12 @@ sap.ui.define([
|
|
|
616
621
|
* @returns {Promise} Promise resolving when all changes are applied
|
|
617
622
|
*/
|
|
618
623
|
VariantModel.prototype.addAndApplyChangesOnVariant = function(aChanges) {
|
|
619
|
-
this.
|
|
620
|
-
return
|
|
624
|
+
const aAddedChanges = UIChangeManager.addDirtyChanges(this.sFlexReference, aChanges, this.oAppComponent);
|
|
625
|
+
return aAddedChanges.reduce(function(oPreviousPromise, oChange) {
|
|
621
626
|
return oPreviousPromise.then(function() {
|
|
622
|
-
|
|
627
|
+
const oControl = Element.getElementById(
|
|
628
|
+
JsControlTreeModifier.getControlIdBySelector(oChange.getSelector(), this.oAppComponent)
|
|
629
|
+
);
|
|
623
630
|
return Applier.applyChangeOnControl(oChange, oControl, {
|
|
624
631
|
modifier: JsControlTreeModifier,
|
|
625
632
|
appComponent: this.oAppComponent,
|
|
@@ -628,7 +635,10 @@ sap.ui.define([
|
|
|
628
635
|
.then((oReturn) => {
|
|
629
636
|
if (!oReturn.success) {
|
|
630
637
|
var oException = oReturn.error || new Error("The change could not be applied.");
|
|
631
|
-
|
|
638
|
+
FlexObjectManager.deleteFlexObjects({
|
|
639
|
+
reference: this.sFlexReference,
|
|
640
|
+
flexObjects: [oChange]
|
|
641
|
+
});
|
|
632
642
|
throw oException;
|
|
633
643
|
}
|
|
634
644
|
});
|
|
@@ -770,7 +780,8 @@ sap.ui.define([
|
|
|
770
780
|
}
|
|
771
781
|
|
|
772
782
|
// sets copied variant and associated changes as dirty
|
|
773
|
-
aChanges =
|
|
783
|
+
aChanges = FlexObjectManager.addDirtyFlexObjects(
|
|
784
|
+
this.sFlexReference,
|
|
774
785
|
aChanges
|
|
775
786
|
.concat([oDuplicateVariantData.instance]
|
|
776
787
|
.concat(oDuplicateVariantData.controlChanges)
|
|
@@ -800,7 +811,10 @@ sap.ui.define([
|
|
|
800
811
|
newVariantReference: mPropertyBag.sourceVariantReference,
|
|
801
812
|
appComponent: mPropertyBag.component
|
|
802
813
|
}).then(function() {
|
|
803
|
-
|
|
814
|
+
FlexObjectManager.deleteFlexObjects({
|
|
815
|
+
reference: this.sFlexReference,
|
|
816
|
+
flexObjects: aChangesToBeDeleted
|
|
817
|
+
});
|
|
804
818
|
}.bind(this));
|
|
805
819
|
};
|
|
806
820
|
|
|
@@ -809,6 +823,7 @@ sap.ui.define([
|
|
|
809
823
|
const aModelVariants = oData.variants;
|
|
810
824
|
const aChanges = [];
|
|
811
825
|
const oSettings = Settings.getInstanceOrUndef();
|
|
826
|
+
const aVariantsToBeDeleted = [];
|
|
812
827
|
|
|
813
828
|
const findVariant = (sVariantKey) => {
|
|
814
829
|
return aModelVariants.find((oModelVariant) => oModelVariant.key === sVariantKey);
|
|
@@ -873,6 +888,7 @@ sap.ui.define([
|
|
|
873
888
|
visible: false
|
|
874
889
|
}
|
|
875
890
|
);
|
|
891
|
+
aVariantsToBeDeleted.push(sVariantKey);
|
|
876
892
|
});
|
|
877
893
|
oEvent.getParameter("contexts")?.forEach(({key: sVariantKey, contexts: aNewContexts}) => {
|
|
878
894
|
const oVariant = findVariant(sVariantKey);
|
|
@@ -896,7 +912,10 @@ sap.ui.define([
|
|
|
896
912
|
});
|
|
897
913
|
}
|
|
898
914
|
|
|
899
|
-
return
|
|
915
|
+
return {
|
|
916
|
+
changes: aChanges,
|
|
917
|
+
variantsToBeDeleted: aVariantsToBeDeleted
|
|
918
|
+
};
|
|
900
919
|
};
|
|
901
920
|
|
|
902
921
|
/**
|
|
@@ -972,7 +991,7 @@ sap.ui.define([
|
|
|
972
991
|
*/
|
|
973
992
|
VariantModel.prototype.addVariantChange = function(sVariantManagementReference, mPropertyBag) {
|
|
974
993
|
var oChange = this.createVariantChange(sVariantManagementReference, mPropertyBag);
|
|
975
|
-
this.
|
|
994
|
+
FlexObjectManager.addDirtyFlexObjects(this.sFlexReference, [oChange]);
|
|
976
995
|
|
|
977
996
|
return oChange;
|
|
978
997
|
};
|
|
@@ -987,7 +1006,7 @@ sap.ui.define([
|
|
|
987
1006
|
var aChanges = aChangePropertyMaps.map(function(mProperties) {
|
|
988
1007
|
return this.createVariantChange(sVariantManagementReference, mProperties);
|
|
989
1008
|
}.bind(this));
|
|
990
|
-
this.
|
|
1009
|
+
FlexObjectManager.addDirtyFlexObjects(this.sFlexReference, aChanges);
|
|
991
1010
|
|
|
992
1011
|
return aChanges;
|
|
993
1012
|
};
|
|
@@ -1000,7 +1019,10 @@ sap.ui.define([
|
|
|
1000
1019
|
*/
|
|
1001
1020
|
VariantModel.prototype.deleteVariantChange = function(sVariantManagementReference, mPropertyBag, oChange) {
|
|
1002
1021
|
this.setVariantProperties(sVariantManagementReference, mPropertyBag);
|
|
1003
|
-
|
|
1022
|
+
FlexObjectManager.deleteFlexObjects({
|
|
1023
|
+
reference: this.sFlexReference,
|
|
1024
|
+
flexObjects: [oChange]
|
|
1025
|
+
});
|
|
1004
1026
|
};
|
|
1005
1027
|
|
|
1006
1028
|
/**
|
|
@@ -1189,33 +1211,48 @@ sap.ui.define([
|
|
|
1189
1211
|
|
|
1190
1212
|
VariantModel.prototype._initializeManageVariantsEvents = function() {
|
|
1191
1213
|
this.fnManageClickRta = function(oEvent, oData) {
|
|
1192
|
-
|
|
1193
|
-
oData.resolve(
|
|
1214
|
+
const oModelChanges = this._collectModelChanges(oData.variantManagementReference, oData.layer, oEvent);
|
|
1215
|
+
oData.resolve(oModelChanges);
|
|
1194
1216
|
};
|
|
1195
1217
|
|
|
1196
1218
|
this.fnManageClick = function(oEvent, oData) {
|
|
1197
1219
|
(async () => {
|
|
1220
|
+
const sVMReference = oData.variantManagementReference;
|
|
1198
1221
|
if (!this.oFlexController || !this.getData()) {
|
|
1199
1222
|
return;
|
|
1200
1223
|
}
|
|
1201
|
-
|
|
1224
|
+
const {
|
|
1225
|
+
changes: aConfigurationChangesContent,
|
|
1226
|
+
variantsToBeDeleted: aVariantsToBeDeleted
|
|
1227
|
+
} = this._collectModelChanges(sVMReference, Layer.USER, oEvent);
|
|
1202
1228
|
|
|
1203
1229
|
if (aConfigurationChangesContent.some((oChange) => {
|
|
1204
1230
|
return oChange.visible === false
|
|
1205
|
-
&& oChange.variantReference === this.getCurrentVariantReference(
|
|
1231
|
+
&& oChange.variantReference === this.getCurrentVariantReference(sVMReference);
|
|
1206
1232
|
})) {
|
|
1207
1233
|
await this.updateCurrentVariant({
|
|
1208
|
-
variantManagementReference:
|
|
1209
|
-
newVariantReference:
|
|
1234
|
+
variantManagementReference: sVMReference,
|
|
1235
|
+
newVariantReference: sVMReference
|
|
1210
1236
|
});
|
|
1211
1237
|
}
|
|
1212
1238
|
|
|
1213
|
-
var aChanges = [];
|
|
1214
1239
|
aConfigurationChangesContent.forEach(function(oChangeProperties) {
|
|
1215
1240
|
oChangeProperties.appComponent = this.oAppComponent;
|
|
1216
1241
|
}.bind(this));
|
|
1217
|
-
|
|
1218
|
-
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);
|
|
1219
1256
|
})();
|
|
1220
1257
|
};
|
|
1221
1258
|
};
|
|
@@ -1555,8 +1592,10 @@ sap.ui.define([
|
|
|
1555
1592
|
return mCurrentVariant.controlChanges;
|
|
1556
1593
|
})
|
|
1557
1594
|
.flat();
|
|
1595
|
+
const oLiveDependencyMap = FlexObjectState.getLiveDependencyMap(this.sFlexReference);
|
|
1558
1596
|
aVariantDependentControlChanges.forEach((oChange) => {
|
|
1559
|
-
|
|
1597
|
+
DependencyHandler.removeChangeFromMap(oLiveDependencyMap, oChange.getId());
|
|
1598
|
+
DependencyHandler.removeChangeFromDependencies(oLiveDependencyMap, oChange.getId());
|
|
1560
1599
|
});
|
|
1561
1600
|
|
|
1562
1601
|
this.oDataSelector.removeUpdateListener(this.fnUpdateListener);
|
|
@@ -19,8 +19,8 @@ sap.ui.define([
|
|
|
19
19
|
"use strict";
|
|
20
20
|
|
|
21
21
|
function buildQueryParameterMap(mConfig) {
|
|
22
|
-
|
|
23
|
-
return
|
|
22
|
+
const mDefaultValues = { layer: Layer.CUSTOMER, type: "role" };
|
|
23
|
+
return { ...mDefaultValues, ...mConfig };
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
function assignDescriptionsToSelectedRoles(oSelectedRoles) {
|
|
@@ -11,9 +11,11 @@ sap.ui.define([
|
|
|
11
11
|
"sap/ui/fl/apply/_internal/appVariant/DescriptorChangeTypes",
|
|
12
12
|
"sap/ui/fl/apply/_internal/flexState/FlexObjectState",
|
|
13
13
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
14
|
+
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
14
15
|
"sap/ui/fl/registry/Settings",
|
|
15
16
|
"sap/ui/fl/write/_internal/appVariant/AppVariantFactory",
|
|
16
17
|
"sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory",
|
|
18
|
+
"sap/ui/fl/write/_internal/flexState/FlexObjectManager",
|
|
17
19
|
"sap/ui/fl/FlexControllerFactory",
|
|
18
20
|
"sap/ui/fl/Layer",
|
|
19
21
|
"sap/ui/fl/Utils"
|
|
@@ -24,9 +26,11 @@ sap.ui.define([
|
|
|
24
26
|
DescriptorChangeTypes,
|
|
25
27
|
FlexObjectState,
|
|
26
28
|
ManifestUtils,
|
|
29
|
+
FlexRuntimeInfoAPI,
|
|
27
30
|
Settings,
|
|
28
31
|
AppVariantFactory,
|
|
29
32
|
AppVariantInlineChangeFactory,
|
|
33
|
+
FlexObjectManager,
|
|
30
34
|
FlexControllerFactory,
|
|
31
35
|
Layer,
|
|
32
36
|
Utils
|
|
@@ -151,15 +155,19 @@ sap.ui.define([
|
|
|
151
155
|
}
|
|
152
156
|
|
|
153
157
|
function _deleteDescrChangesFromPersistence(vSelector) {
|
|
158
|
+
const sReference = ManifestUtils.getFlexReferenceForSelector(vSelector);
|
|
154
159
|
var aChangesToBeDeleted = [];
|
|
155
|
-
// In case of app variant, both
|
|
160
|
+
// In case of app variant, both persistencies hold descriptor changes and have to be removed from one of the persistencies
|
|
156
161
|
_getDirtyDescrChanges(vSelector).forEach(function(oChange) {
|
|
157
162
|
if (DescriptorChangeTypes.getChangeTypes().includes(oChange.getChangeType())) {
|
|
158
163
|
// If there are UI changes, they are sent to the backend in the last resolved promise and removed from the persistence
|
|
159
164
|
aChangesToBeDeleted.push(oChange);
|
|
160
165
|
}
|
|
161
166
|
});
|
|
162
|
-
|
|
167
|
+
FlexObjectManager.deleteFlexObjects({
|
|
168
|
+
reference: sReference,
|
|
169
|
+
flexObjects: aChangesToBeDeleted
|
|
170
|
+
});
|
|
163
171
|
}
|
|
164
172
|
|
|
165
173
|
function _addPackageAndTransport(oAppVariant, mPropertyBag) {
|
|
@@ -225,7 +233,8 @@ sap.ui.define([
|
|
|
225
233
|
// Save the dirty UI changes to backend => firing PersistenceWriteApi.save
|
|
226
234
|
return oFlexController.saveAll(Utils.getAppComponentForSelector(mPropertyBag.selector), true)
|
|
227
235
|
.then(function() {
|
|
228
|
-
|
|
236
|
+
const sReference = FlexRuntimeInfoAPI.getFlexReference({ element: mPropertyBag.selector });
|
|
237
|
+
FlexObjectManager.removeDirtyFlexObjects({ reference: sReference });
|
|
229
238
|
})
|
|
230
239
|
.catch(function(oError) {
|
|
231
240
|
// Delete the inconsistent app variant if the UI changes failed to save
|
|
@@ -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.
|
|
25
|
+
* @version 1.130.0
|
|
26
26
|
* @private
|
|
27
27
|
* @ui5-restricted sap.ui.fl
|
|
28
28
|
*/
|
|
@@ -238,22 +238,22 @@ sap.ui.define([
|
|
|
238
238
|
* @returns {Promise} Promise resolving as soon as the writing was completed or was not needed; or rejects in case of an error
|
|
239
239
|
*/
|
|
240
240
|
Storage.condense = async function(mPropertyBag) {
|
|
241
|
-
const mProperties =
|
|
241
|
+
const mProperties = { ...mPropertyBag };
|
|
242
242
|
const mCondense = await prepareCondensingForConnector(mProperties);
|
|
243
243
|
if (!mCondense) {
|
|
244
244
|
return Promise.reject("No changes were provided");
|
|
245
245
|
}
|
|
246
246
|
if (mCondense.create || mCondense.reorder || mCondense.update || mCondense.delete) {
|
|
247
|
-
|
|
247
|
+
let aCreatedChanges = [];
|
|
248
248
|
if (mCondense.create) {
|
|
249
|
-
|
|
249
|
+
aCreatedChanges = (mCondense.create.change ? mCondense.create.change : [])
|
|
250
250
|
.concat(mCondense.create.ctrl_variant ? mCondense.create.ctrl_variant : []);
|
|
251
251
|
}
|
|
252
252
|
mProperties.flexObjects = mCondense;
|
|
253
253
|
|
|
254
254
|
const oResult = await _executeActionByName("condense", mProperties);
|
|
255
|
-
if (oResult && oResult.status && oResult.status === 205 &&
|
|
256
|
-
|
|
255
|
+
if (oResult && oResult.status && oResult.status === 205 && aCreatedChanges.length) {
|
|
256
|
+
const aResponse = aCreatedChanges.map(function(oChange) {
|
|
257
257
|
return Object.values(oChange).pop();
|
|
258
258
|
});
|
|
259
259
|
oResult.response = aResponse;
|
|
@@ -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.0
|
|
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.0
|
|
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
|
*
|