@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
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/fl/Utils",
|
|
9
8
|
"sap/base/Log",
|
|
10
9
|
"sap/ui/core/CustomData" // needs to be preloaded
|
|
11
10
|
], function(
|
|
12
|
-
FlUtils,
|
|
13
11
|
Log
|
|
14
12
|
) {
|
|
15
13
|
"use strict";
|
|
@@ -31,9 +29,9 @@ sap.ui.define([
|
|
|
31
29
|
* @since 1.61.0
|
|
32
30
|
* @private
|
|
33
31
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
32
|
+
* @version 1.130.1
|
|
35
33
|
*/
|
|
36
|
-
|
|
34
|
+
const FlexCustomData = {};
|
|
37
35
|
|
|
38
36
|
FlexCustomData.appliedChangesCustomDataKey = "sap.ui.fl.appliedChanges";
|
|
39
37
|
FlexCustomData.failedChangesCustomDataKeyJs = "sap.ui.fl.failedChanges.js";
|
|
@@ -41,7 +39,7 @@ sap.ui.define([
|
|
|
41
39
|
FlexCustomData.notApplicableChangesCustomDataKey = "sap.ui.fl.notApplicableChanges";
|
|
42
40
|
|
|
43
41
|
function writeCustomData(oControl, sKey, sValue, mPropertyBag) {
|
|
44
|
-
|
|
42
|
+
const mCustomData = mPropertyBag.modifier.getCustomDataInfo(oControl, sKey);
|
|
45
43
|
if (!mCustomData.customData) {
|
|
46
44
|
return mPropertyBag.modifier.createAndAddCustomData(oControl, sKey, sValue, mPropertyBag.appComponent);
|
|
47
45
|
}
|
|
@@ -49,7 +47,7 @@ sap.ui.define([
|
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
function getCustomValueData(bSaveRevertData, oChange) {
|
|
52
|
-
|
|
50
|
+
const vRevertData = oChange.getRevertData();
|
|
53
51
|
if (bSaveRevertData && vRevertData !== undefined) {
|
|
54
52
|
return JSON.stringify(vRevertData);
|
|
55
53
|
}
|
|
@@ -66,7 +64,9 @@ sap.ui.define([
|
|
|
66
64
|
* @returns {string|undefined} Custom data or 'undefined'
|
|
67
65
|
*/
|
|
68
66
|
FlexCustomData.getAppliedCustomDataValue = function(oControl, oChange, oModifier) {
|
|
69
|
-
|
|
67
|
+
const mCustomData = oModifier.getCustomDataInfo(
|
|
68
|
+
oControl, FlexCustomData._getCustomDataKey(oChange, FlexCustomData.appliedChangesCustomDataKey)
|
|
69
|
+
);
|
|
70
70
|
return mCustomData.customDataValue;
|
|
71
71
|
};
|
|
72
72
|
|
|
@@ -80,7 +80,7 @@ sap.ui.define([
|
|
|
80
80
|
* @returns {object|undefined} Returns the revert data from the custom data as object or 'undefined'
|
|
81
81
|
*/
|
|
82
82
|
FlexCustomData.getParsedRevertDataFromCustomData = function(oControl, oChange, oModifier) {
|
|
83
|
-
|
|
83
|
+
const sCustomDataValue = FlexCustomData.getAppliedCustomDataValue(oControl, oChange, oModifier);
|
|
84
84
|
try {
|
|
85
85
|
return sCustomDataValue && JSON.parse(sCustomDataValue);
|
|
86
86
|
} catch (oError) {
|
|
@@ -99,17 +99,23 @@ sap.ui.define([
|
|
|
99
99
|
* @returns {boolean} <code>true</code> if the custom data is there.
|
|
100
100
|
*/
|
|
101
101
|
FlexCustomData.hasChangeApplyFinishedCustomData = function(oControl, oChange, oModifier) {
|
|
102
|
-
|
|
102
|
+
const oAppliedCD = oModifier.getCustomDataInfo(
|
|
103
|
+
oControl, FlexCustomData._getCustomDataKey(oChange, FlexCustomData.appliedChangesCustomDataKey)
|
|
104
|
+
);
|
|
103
105
|
if (oAppliedCD.customData) {
|
|
104
106
|
return true;
|
|
105
107
|
}
|
|
106
108
|
|
|
107
|
-
|
|
109
|
+
const oFailedCD = oModifier.getCustomDataInfo(
|
|
110
|
+
oControl, FlexCustomData._getCustomDataKey(oChange, FlexCustomData.failedChangesCustomDataKeyJs)
|
|
111
|
+
);
|
|
108
112
|
if (oFailedCD.customData) {
|
|
109
113
|
return true;
|
|
110
114
|
}
|
|
111
115
|
|
|
112
|
-
|
|
116
|
+
const oNotApplicableCD = oModifier.getCustomDataInfo(
|
|
117
|
+
oControl, FlexCustomData._getCustomDataKey(oChange, FlexCustomData.notApplicableChangesCustomDataKey)
|
|
118
|
+
);
|
|
113
119
|
if (oNotApplicableCD.customData) {
|
|
114
120
|
return true;
|
|
115
121
|
}
|
|
@@ -131,8 +137,8 @@ sap.ui.define([
|
|
|
131
137
|
* @returns {Promise} resolves when custom data is written
|
|
132
138
|
*/
|
|
133
139
|
FlexCustomData.addAppliedCustomData = function(oControl, oChange, mPropertyBag, bSaveRevertData) {
|
|
134
|
-
|
|
135
|
-
|
|
140
|
+
const sCustomDataValue = getCustomValueData(bSaveRevertData, oChange);
|
|
141
|
+
const sCustomDataKey = FlexCustomData._getCustomDataKey(oChange, FlexCustomData.appliedChangesCustomDataKey);
|
|
136
142
|
return writeCustomData(oControl, sCustomDataKey, sCustomDataValue, mPropertyBag);
|
|
137
143
|
};
|
|
138
144
|
|
|
@@ -150,7 +156,7 @@ sap.ui.define([
|
|
|
150
156
|
* @returns {Promise} resolves when custom data is written
|
|
151
157
|
*/
|
|
152
158
|
FlexCustomData.addFailedCustomData = function(oControl, oChange, mPropertyBag, sIdentifier) {
|
|
153
|
-
|
|
159
|
+
const sCustomDataKey = FlexCustomData._getCustomDataKey(oChange, sIdentifier);
|
|
154
160
|
return writeCustomData(oControl, sCustomDataKey, "true", mPropertyBag);
|
|
155
161
|
};
|
|
156
162
|
|
|
@@ -162,8 +168,8 @@ sap.ui.define([
|
|
|
162
168
|
* @param {sap.ui.core.util.reflection.BaseTreeModifier} oModifier The control tree modifier
|
|
163
169
|
*/
|
|
164
170
|
FlexCustomData.destroyAppliedCustomData = function(oControl, oChange, oModifier) {
|
|
165
|
-
|
|
166
|
-
|
|
171
|
+
const sKey = FlexCustomData._getCustomDataKey(oChange, FlexCustomData.appliedChangesCustomDataKey);
|
|
172
|
+
const mCustomData = oModifier.getCustomDataInfo(oControl, sKey);
|
|
167
173
|
if (mCustomData.customData) {
|
|
168
174
|
oModifier.destroy(mCustomData.customData);
|
|
169
175
|
}
|
|
@@ -209,4 +215,4 @@ sap.ui.define([
|
|
|
209
215
|
};
|
|
210
216
|
|
|
211
217
|
return FlexCustomData;
|
|
212
|
-
}
|
|
218
|
+
});
|
|
@@ -23,19 +23,17 @@ sap.ui.define([
|
|
|
23
23
|
) {
|
|
24
24
|
"use strict";
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
const Reverter = {};
|
|
27
27
|
|
|
28
|
-
function
|
|
28
|
+
async function waitForApplyIfNecessary(oChange) {
|
|
29
29
|
if (!oChange.isApplyProcessFinished() && oChange.hasApplyProcessStarted()) {
|
|
30
30
|
// wait for the change to be applied
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
31
|
+
const oResult = await oChange.addPromiseForApplyProcessing();
|
|
32
|
+
if (oResult && oResult.error) {
|
|
33
|
+
oChange.markRevertFinished(oResult.error);
|
|
34
|
+
throw Error(oResult.error);
|
|
35
|
+
}
|
|
37
36
|
}
|
|
38
|
-
return Promise.resolve();
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
function removeChangeFromMaps(oChange, sReference) {
|
|
@@ -63,41 +61,33 @@ sap.ui.define([
|
|
|
63
61
|
* @param {object} mPropertyBag.appDescriptor - App descriptor containing the metadata of the current application
|
|
64
62
|
* @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Polymorph reuse operations handling the changes on the given view type
|
|
65
63
|
* @param {sap.ui.core.mvc.View} mPropertyBag.view - View to process
|
|
66
|
-
* @returns {Promise
|
|
64
|
+
* @returns {Promise} Resolving Promise with either the control (success) or <code>false</code> (failure) as value
|
|
67
65
|
*/
|
|
68
|
-
Reverter.revertChangeOnControl = function(oChange, oControl, mPropertyBag) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
oChangeHandler = oReturnedChangeHandler;
|
|
74
|
-
})
|
|
75
|
-
.then(_waitForApplyIfNecessary.bind(null, oChange))
|
|
76
|
-
.then(function() {
|
|
66
|
+
Reverter.revertChangeOnControl = async function(oChange, oControl, mPropertyBag) {
|
|
67
|
+
const mControl = Utils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag);
|
|
68
|
+
try {
|
|
69
|
+
const oChangeHandler = await Utils.getChangeHandler(oChange, mControl, mPropertyBag);
|
|
70
|
+
await waitForApplyIfNecessary(oChange);
|
|
77
71
|
if (oChange.isSuccessfullyApplied()) {
|
|
78
72
|
oChange.startReverting();
|
|
79
|
-
|
|
73
|
+
} else {
|
|
74
|
+
throw Error("Change was never applied");
|
|
80
75
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
.then(function() {
|
|
76
|
+
|
|
77
|
+
await oChangeHandler.revertChange(oChange, mControl.control, mPropertyBag);
|
|
84
78
|
// After revert the relevant control for the change might have changed, therefore it must be retrieved again (e.g. stashing)
|
|
85
79
|
mControl.control = mPropertyBag.modifier.bySelector(oChange.getSelector(), mPropertyBag.appComponent, mPropertyBag.view);
|
|
86
80
|
if (mControl.bTemplateAffected) {
|
|
87
|
-
|
|
81
|
+
await mPropertyBag.modifier.updateAggregation(mControl.control, oChange.getContent().boundAggregation);
|
|
88
82
|
}
|
|
89
|
-
return undefined;
|
|
90
|
-
})
|
|
91
|
-
.then(function() {
|
|
92
83
|
oChange.markRevertFinished();
|
|
93
84
|
return mControl.control;
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
var sErrorMessage = `Change could not be reverted: ${oError.message}`;
|
|
85
|
+
} catch (oError) {
|
|
86
|
+
const sErrorMessage = `Change could not be reverted: ${oError.message}`;
|
|
97
87
|
Log.error(sErrorMessage);
|
|
98
88
|
oChange.markRevertFinished(sErrorMessage);
|
|
99
89
|
return false;
|
|
100
|
-
}
|
|
90
|
+
}
|
|
101
91
|
};
|
|
102
92
|
|
|
103
93
|
/**
|
|
@@ -111,18 +101,18 @@ sap.ui.define([
|
|
|
111
101
|
* @returns {Promise|sap.ui.fl.Utils.FakePromise} Promise/FakePromise that resolves as soon as all changes are reverted
|
|
112
102
|
*/
|
|
113
103
|
Reverter.revertMultipleChanges = function(aChanges, mPropertyBag) {
|
|
114
|
-
|
|
115
|
-
aChanges.forEach(
|
|
104
|
+
const aPromiseStack = [];
|
|
105
|
+
aChanges.forEach((oChange) => {
|
|
116
106
|
// Queued 'state' will be removed once the revert process is done
|
|
117
107
|
oChange.setQueuedForRevert();
|
|
118
|
-
aPromiseStack.push(
|
|
119
|
-
|
|
120
|
-
|
|
108
|
+
aPromiseStack.push(() => {
|
|
109
|
+
const oSelector = oChange.getSelector && oChange.getSelector();
|
|
110
|
+
const oControl = mPropertyBag.modifier.bySelector(oSelector, mPropertyBag.appComponent);
|
|
121
111
|
if (!oControl) {
|
|
122
112
|
removeChangeFromMaps(oChange, mPropertyBag.reference);
|
|
123
113
|
return (FlUtils.FakePromise ? new FlUtils.FakePromise() : Promise.resolve());
|
|
124
114
|
}
|
|
125
|
-
|
|
115
|
+
const mRevertProperties = {
|
|
126
116
|
modifier: mPropertyBag.modifier,
|
|
127
117
|
appComponent: mPropertyBag.appComponent,
|
|
128
118
|
view: FlUtils.getViewForControl(oControl)
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
*
|
|
23
23
|
* @namespace sap.ui.fl.apply._internal.changes.Utils
|
|
24
24
|
* @since 1.70
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.130.1
|
|
26
26
|
* @private
|
|
27
27
|
* @ui5-restricted sap.ui.fl.apply._internal, sap.ui.fl.write._internal
|
|
28
28
|
*/
|
|
@@ -36,7 +36,7 @@ sap.ui.define([
|
|
|
36
36
|
return true;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
const Utils = {
|
|
40
40
|
/**
|
|
41
41
|
* Returns the control map containing control, controlType, bTemplateAffected and originalControl
|
|
42
42
|
*
|
|
@@ -45,16 +45,16 @@ sap.ui.define([
|
|
|
45
45
|
* @param {object} mPropertyBag - Contains additional data that are needed for reading of changes
|
|
46
46
|
* @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Control tree modifier
|
|
47
47
|
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Component instance that is currently loading
|
|
48
|
-
* @param {object} mPropertyBag.view - The
|
|
48
|
+
* @param {object} mPropertyBag.view - The currently loaded view
|
|
49
49
|
* @returns {object} Contains the information about the control
|
|
50
50
|
* @private
|
|
51
51
|
*/
|
|
52
52
|
getControlIfTemplateAffected(oChange, oControl, mPropertyBag) {
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const oModifier = mPropertyBag.modifier;
|
|
54
|
+
const mControl = {
|
|
55
55
|
originalControl: oControl
|
|
56
56
|
};
|
|
57
|
-
|
|
57
|
+
const oOriginalDependentSelector = oChange.getOriginalSelector();
|
|
58
58
|
if (oChange.getContent().boundAggregation && oOriginalDependentSelector) {
|
|
59
59
|
mControl.control = oModifier.bySelector(oOriginalDependentSelector, mPropertyBag.appComponent, mPropertyBag.view);
|
|
60
60
|
mControl.controlType = oModifier.getControlType(mControl.control);
|
|
@@ -79,38 +79,33 @@ sap.ui.define([
|
|
|
79
79
|
* @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Control tree modifier
|
|
80
80
|
* @returns {Promise} Promise resolving with the change handler or an empty object
|
|
81
81
|
*/
|
|
82
|
-
getChangeHandler(oChange, mControl, mPropertyBag) {
|
|
83
|
-
|
|
82
|
+
async getChangeHandler(oChange, mControl, mPropertyBag) {
|
|
83
|
+
const sLibraryName = await mPropertyBag.modifier.getLibraryName(mControl.control);
|
|
84
84
|
// the ChangeHandlerRegistration includes all the predefined ChangeHandlers.
|
|
85
85
|
// With this as a standard import the ChangeHandlers would not be able to access API classes due to circular dependencies.
|
|
86
86
|
// TODO should be removed as soon as the ChangePersistence / FlexController are gone
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
.
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.then(function() {
|
|
95
|
-
var sChangeType = oChange.getChangeType();
|
|
96
|
-
var sLayer = oChange.getLayer();
|
|
97
|
-
return ChangeHandlerStorage.getChangeHandler(sChangeType, mControl.controlType, mControl.control, mPropertyBag.modifier, sLayer);
|
|
98
|
-
});
|
|
87
|
+
const ChangeHandlerRegistration = await requireAsync("sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration");
|
|
88
|
+
await ChangeHandlerRegistration.waitForChangeHandlerRegistration(sLibraryName);
|
|
89
|
+
const sChangeType = oChange.getChangeType();
|
|
90
|
+
const sLayer = oChange.getLayer();
|
|
91
|
+
return ChangeHandlerStorage.getChangeHandler(
|
|
92
|
+
sChangeType, mControl.controlType, mControl.control, mPropertyBag.modifier, sLayer
|
|
93
|
+
);
|
|
99
94
|
},
|
|
100
95
|
|
|
101
96
|
checkIfDependencyIsStillValid(oAppComponent, oModifier, mChangesMap, sChangeId) {
|
|
102
|
-
|
|
97
|
+
const oChange = FlUtils.getChangeFromChangesMap(mChangesMap.mChanges, sChangeId);
|
|
103
98
|
// Change could be deleted after a save (condensing) so it is no longer a relevant dependency
|
|
104
99
|
if (!oChange) {
|
|
105
100
|
return false;
|
|
106
101
|
}
|
|
107
|
-
|
|
102
|
+
const oControl = oModifier.bySelector(oChange.getSelector(), oAppComponent);
|
|
108
103
|
// if the control is currently not available,
|
|
109
104
|
// the change is also not applied anymore and the dependency is still valid
|
|
110
105
|
if (!oControl) {
|
|
111
106
|
return true;
|
|
112
107
|
}
|
|
113
|
-
|
|
108
|
+
const bHasChangeApplyFinishedCustomData = FlexCustomData.hasChangeApplyFinishedCustomData(oControl, oChange, oModifier);
|
|
114
109
|
return isDependencyStillValid(oChange, bHasChangeApplyFinishedCustomData);
|
|
115
110
|
},
|
|
116
111
|
|
|
@@ -125,19 +120,19 @@ sap.ui.define([
|
|
|
125
120
|
* @returns {boolean} <code>true</code> if the change belongs to the given view
|
|
126
121
|
*/
|
|
127
122
|
isChangeInView(mPropertyBag, oChange) {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
const oModifier = mPropertyBag.modifier;
|
|
124
|
+
const oAppComponent = mPropertyBag.appComponent;
|
|
125
|
+
const oSelector = oChange.getSelector();
|
|
131
126
|
if (!oSelector) {
|
|
132
127
|
return false;
|
|
133
128
|
}
|
|
134
129
|
if (oSelector.viewSelector) {
|
|
135
|
-
|
|
130
|
+
const sSelectorViewId = oModifier.getControlIdBySelector(oSelector.viewSelector, oAppComponent);
|
|
136
131
|
return sSelectorViewId === mPropertyBag.viewId;
|
|
137
132
|
}
|
|
138
|
-
|
|
133
|
+
const sSelectorId = oSelector.id;
|
|
139
134
|
if (sSelectorId) {
|
|
140
|
-
|
|
135
|
+
let sViewId;
|
|
141
136
|
if (oChange.getSelector().idIsLocal) {
|
|
142
137
|
if (oAppComponent) {
|
|
143
138
|
sViewId = oAppComponent.getLocalId(mPropertyBag.viewId);
|
|
@@ -145,8 +140,8 @@ sap.ui.define([
|
|
|
145
140
|
} else {
|
|
146
141
|
sViewId = mPropertyBag.viewId;
|
|
147
142
|
}
|
|
148
|
-
|
|
149
|
-
|
|
143
|
+
let iIndex = 0;
|
|
144
|
+
let sSelectorIdViewPrefix;
|
|
150
145
|
do {
|
|
151
146
|
iIndex = sSelectorId.indexOf("--", iIndex);
|
|
152
147
|
sSelectorIdViewPrefix = sSelectorId.slice(0, iIndex);
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
*
|
|
18
18
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.Registration
|
|
19
19
|
* @since 1.74
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.130.1
|
|
21
21
|
* @private
|
|
22
22
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
23
23
|
*/
|
|
@@ -30,7 +30,8 @@ sap.ui.define([
|
|
|
30
30
|
appdescr_ovp_removeCard: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard"),
|
|
31
31
|
appdescr_ui_generic_app_addNewObjectPage: requireAsync.bind(this, "sap/suite/ui/generic/template/manifestMerger/AddNewObjectPage"),
|
|
32
32
|
appdescr_ui_generic_app_changePageConfiguration: requireAsync.bind(this, "sap/suite/ui/generic/template/manifestMerger/ChangePageConfiguration"),
|
|
33
|
-
appdescr_fe_changePageConfiguration: requireAsync.bind(this, "sap/fe/core/manifestMerger/ChangePageConfiguration")
|
|
33
|
+
appdescr_fe_changePageConfiguration: requireAsync.bind(this, "sap/fe/core/manifestMerger/ChangePageConfiguration"),
|
|
34
|
+
appdescr_fe_addNewPage: requireAsync.bind(this, "sap/fe/core/manifestMerger/AddNewPage")
|
|
34
35
|
};
|
|
35
36
|
return Registration;
|
|
36
37
|
});
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
*
|
|
21
21
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.RegistrationBuild
|
|
22
22
|
* @since 1.77
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.130.1
|
|
24
24
|
* @private
|
|
25
25
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
26
26
|
*/
|
|
@@ -28,6 +28,7 @@ sap.ui.define([
|
|
|
28
28
|
appdescr_app_changeDataSource: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource"),
|
|
29
29
|
appdescr_ui5_addNewModelEnhanceWith: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith"),
|
|
30
30
|
appdescr_ui5_addComponentUsages: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages"),
|
|
31
|
+
appdescr_ui5_changeModel: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ui5/ChangeModel"),
|
|
31
32
|
appdescr_ui5_setMinUI5Version: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version"),
|
|
32
33
|
appdescr_fiori_setRegistrationIds: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds"),
|
|
33
34
|
appdescr_ui5_setFlexExtensionPointEnabled: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled"),
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* Available for both runtime and build {@link sap.ui.fl.apply._internal.changes.descriptor.Registration}.
|
|
20
20
|
*
|
|
21
21
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.app.SetDescription
|
|
22
|
-
* @version 1.
|
|
22
|
+
* @version 1.130.1
|
|
23
23
|
* @private
|
|
24
24
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
25
25
|
*/
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* Available for both runtime and build {@link sap.ui.fl.apply._internal.changes.descriptor.Registration}.
|
|
20
20
|
*
|
|
21
21
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.app.SetTitle
|
|
22
|
-
* @version 1.
|
|
22
|
+
* @version 1.130.1
|
|
23
23
|
* @private
|
|
24
24
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
25
25
|
*/
|
|
@@ -18,7 +18,7 @@ sap.ui.define([
|
|
|
18
18
|
* Available for both runtime and build {@link sap.ui.fl.apply._internal.changes.descriptor.Registration}.
|
|
19
19
|
*
|
|
20
20
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.ovp.DeleteCard
|
|
21
|
-
* @version 1.
|
|
21
|
+
* @version 1.130.1
|
|
22
22
|
* @private
|
|
23
23
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
24
24
|
*/
|