@openui5/sap.ui.fl 1.92.0 → 1.93.3
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/{.eslintrc → .eslintrc.json} +0 -0
- package/.reuse/dep5 +5 -0
- package/THIRDPARTY.txt +10 -1
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/Cache.js +1 -1
- package/src/sap/ui/fl/Change.js +41 -27
- package/src/sap/ui/fl/ChangePersistence.js +63 -22
- package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
- package/src/sap/ui/fl/ControlPersonalizationAPI.js +1 -1
- package/src/sap/ui/fl/EventHistory.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/PreprocessorImpl.js +1 -1
- package/src/sap/ui/fl/RegistrationDelegator.js +1 -1
- package/src/sap/ui/fl/Utils.js +50 -2
- package/src/sap/ui/fl/Variant.js +20 -20
- package/src/sap/ui/fl/XmlPreprocessorImpl.js +1 -1
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +2 -2
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +85 -40
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +196 -38
- package/src/sap/ui/fl/apply/_internal/changes/Reverter.js +91 -85
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +19 -8
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -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/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/SetTitle.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/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/flexState/FlexState.js +13 -1
- 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/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 +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- package/src/sap/ui/fl/apply/api/SmartVariantManagementApplyAPI.js +2 -0
- package/src/sap/ui/fl/changeHandler/AddIFrame.js +23 -9
- package/src/sap/ui/fl/changeHandler/AddXML.js +2 -3
- package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +40 -29
- package/src/sap/ui/fl/changeHandler/Base.js +1 -1
- package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +43 -30
- package/src/sap/ui/fl/changeHandler/BaseAddXml.js +65 -26
- package/src/sap/ui/fl/changeHandler/BaseRename.js +26 -18
- package/src/sap/ui/fl/changeHandler/HideControl.js +21 -18
- package/src/sap/ui/fl/changeHandler/MoveControls.js +250 -172
- package/src/sap/ui/fl/changeHandler/MoveElements.js +90 -61
- package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +12 -12
- package/src/sap/ui/fl/changeHandler/PropertyChange.js +27 -23
- package/src/sap/ui/fl/changeHandler/StashControl.js +51 -23
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +13 -14
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +23 -16
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +45 -21
- package/src/sap/ui/fl/changeHandler/common/createIFrame.js +6 -2
- package/src/sap/ui/fl/changeHandler/common/getTargetAggregationIndex.js +8 -4
- package/src/sap/ui/fl/changeHandler/common/revertAddedControls.js +17 -7
- package/src/sap/ui/fl/codeExt/CodeExtManager.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/descriptorRelated/internal/Utils.js +1 -0
- package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +3 -0
- package/src/sap/ui/fl/initial/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +5 -0
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeRegistryItem.js +1 -1
- package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +2 -2
- package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
- package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
- package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
- package/src/sap/ui/fl/library.js +9 -9
- package/src/sap/ui/fl/messagebundle.properties +15 -0
- package/src/sap/ui/fl/messagebundle_ar.properties +9 -1
- package/src/sap/ui/fl/messagebundle_bg.properties +9 -1
- package/src/sap/ui/fl/messagebundle_ca.properties +9 -1
- package/src/sap/ui/fl/messagebundle_cs.properties +9 -1
- package/src/sap/ui/fl/messagebundle_cy.properties +9 -1
- package/src/sap/ui/fl/messagebundle_da.properties +9 -1
- package/src/sap/ui/fl/messagebundle_de.properties +9 -1
- package/src/sap/ui/fl/messagebundle_el.properties +9 -1
- package/src/sap/ui/fl/messagebundle_en.properties +8 -0
- package/src/sap/ui/fl/messagebundle_en_GB.properties +8 -0
- package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +10 -0
- package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +8 -0
- package/src/sap/ui/fl/messagebundle_es.properties +9 -1
- package/src/sap/ui/fl/messagebundle_es_MX.properties +9 -1
- package/src/sap/ui/fl/messagebundle_et.properties +9 -1
- package/src/sap/ui/fl/messagebundle_fi.properties +9 -1
- package/src/sap/ui/fl/messagebundle_fr.properties +8 -0
- package/src/sap/ui/fl/messagebundle_fr_CA.properties +8 -0
- package/src/sap/ui/fl/messagebundle_hi.properties +9 -1
- package/src/sap/ui/fl/messagebundle_hr.properties +9 -1
- package/src/sap/ui/fl/messagebundle_hu.properties +9 -1
- package/src/sap/ui/fl/messagebundle_id.properties +9 -1
- package/src/sap/ui/fl/messagebundle_it.properties +9 -1
- package/src/sap/ui/fl/messagebundle_iw.properties +9 -1
- package/src/sap/ui/fl/messagebundle_ja.properties +9 -1
- package/src/sap/ui/fl/messagebundle_kk.properties +9 -1
- package/src/sap/ui/fl/messagebundle_ko.properties +9 -1
- package/src/sap/ui/fl/messagebundle_lt.properties +9 -1
- package/src/sap/ui/fl/messagebundle_lv.properties +9 -1
- package/src/sap/ui/fl/messagebundle_ms.properties +9 -1
- package/src/sap/ui/fl/messagebundle_nl.properties +9 -1
- package/src/sap/ui/fl/messagebundle_no.properties +9 -1
- package/src/sap/ui/fl/messagebundle_pl.properties +9 -1
- package/src/sap/ui/fl/messagebundle_pt.properties +9 -1
- package/src/sap/ui/fl/messagebundle_pt_PT.properties +9 -1
- package/src/sap/ui/fl/messagebundle_ro.properties +8 -0
- package/src/sap/ui/fl/messagebundle_ru.properties +9 -1
- package/src/sap/ui/fl/messagebundle_sh.properties +9 -1
- package/src/sap/ui/fl/messagebundle_sk.properties +9 -1
- package/src/sap/ui/fl/messagebundle_sl.properties +9 -1
- package/src/sap/ui/fl/messagebundle_sv.properties +9 -1
- package/src/sap/ui/fl/messagebundle_th.properties +9 -1
- package/src/sap/ui/fl/messagebundle_tr.properties +9 -1
- package/src/sap/ui/fl/messagebundle_uk.properties +9 -1
- package/src/sap/ui/fl/messagebundle_vi.properties +9 -1
- package/src/sap/ui/fl/messagebundle_zh_CN.properties +9 -1
- package/src/sap/ui/fl/messagebundle_zh_TW.properties +9 -1
- package/src/sap/ui/fl/registry/Settings.js +27 -23
- package/src/sap/ui/fl/support/Flexibility.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 +7 -7
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +2 -2
- package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
- package/src/sap/ui/fl/support/diagnostics/Flexibility.controller.js +1 -1
- package/src/sap/ui/fl/themes/base/VariantManagement.less +11 -38
- package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
- package/src/sap/ui/fl/util/IFrame.flexibility.js +2 -1
- package/src/sap/ui/fl/util/IFrame.js +29 -2
- package/src/sap/ui/fl/util/IFrameRenderer.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/VariantManagement.js +86 -29
- package/src/sap/ui/fl/variants/VariantModel.js +41 -18
- package/src/sap/ui/fl/write/_internal/Storage.js +2 -2
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +4 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +1 -1
- 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 +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +11 -10
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +2 -24
- package/src/sap/ui/fl/write/_internal/condenser/Utils.js +8 -5
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Create.js +10 -8
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Destroy.js +14 -11
- package/src/sap/ui/fl/write/_internal/condenser/classifications/Move.js +31 -20
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/LocalStorageConnector.js +3 -1
- package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
- 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/delegates/ODataV4ReadDelegate.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +7 -5
- 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 +2 -2
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +129 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.fragment.xml +33 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +163 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/getEditorConfig.js +209 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/annotationsEditor/AnnotationsEditor.js +49 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.fragment.xml +6 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +41 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/dateEditor/DateEditor.js +43 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/dateTimeEditor/DateTimeEditor.js +38 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.fragment.xml +22 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +84 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.fragment.xml +10 -0
- package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +70 -0
- package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +16 -10
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +11 -4
- 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 +1 -0
- package/src/sap/ui/fl/write/api/FeaturesAPI.js +1 -0
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +24 -9
- package/src/sap/ui/fl/write/api/LocalResetAPI.js +9 -8
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +32 -26
- package/src/sap/ui/fl/write/api/SmartVariantManagementWriteAPI.js +1 -0
|
@@ -17,6 +17,8 @@ sap.ui.define([
|
|
|
17
17
|
) {
|
|
18
18
|
"use strict";
|
|
19
19
|
|
|
20
|
+
var Reverter = {};
|
|
21
|
+
|
|
20
22
|
function _waitForApplyIfNecessary(oChange) {
|
|
21
23
|
if (!oChange.isApplyProcessFinished() && oChange.hasApplyProcessStarted()) {
|
|
22
24
|
// wait for the change to be applied
|
|
@@ -30,98 +32,102 @@ sap.ui.define([
|
|
|
30
32
|
return Promise.resolve();
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Component instance that is currently loading
|
|
41
|
-
* @param {object} mPropertyBag.appDescriptor - App descriptor containing the metadata of the current application
|
|
42
|
-
* @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Polymorph reuse operations handling the changes on the given view type
|
|
43
|
-
* @param {sap.ui.core.mvc.View} mPropertyBag.view - View to process
|
|
44
|
-
* @returns {Promise|sap.ui.fl.Utils.FakePromise} Resolving Promise/FakePromise with either the control (success) or <code>false</code> (failure) as value
|
|
45
|
-
*/
|
|
46
|
-
revertChangeOnControl: function(oChange, oControl, mPropertyBag) {
|
|
47
|
-
var mControl = Utils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag);
|
|
48
|
-
var oChangeHandler;
|
|
49
|
-
|
|
50
|
-
return Utils.getChangeHandler(oChange, mControl, mPropertyBag).then(function(oReturnedChangeHandler) {
|
|
51
|
-
oChangeHandler = oReturnedChangeHandler;
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
.then(_waitForApplyIfNecessary.bind(null, oChange))
|
|
55
|
-
|
|
56
|
-
.then(function() {
|
|
57
|
-
if (oChange.isApplyProcessFinished()) {
|
|
58
|
-
oChange.startReverting();
|
|
59
|
-
return oChangeHandler.revertChange(oChange, mControl.control, mPropertyBag);
|
|
60
|
-
}
|
|
61
|
-
throw Error("Change was never applied");
|
|
35
|
+
function revertAndDeleteChangeOnControl(oChange, oControl, mRevertProperties, mPropertyBag) {
|
|
36
|
+
return Reverter.revertChangeOnControl(oChange, oControl, mRevertProperties)
|
|
37
|
+
.then(function(vRevertResult) {
|
|
38
|
+
return FlexCustomData.destroyAppliedCustomData(vRevertResult || oControl, oChange, mPropertyBag.modifier)
|
|
39
|
+
.then(function () {
|
|
40
|
+
return !!vRevertResult;
|
|
41
|
+
});
|
|
62
42
|
})
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
if (mControl.bTemplateAffected) {
|
|
68
|
-
mPropertyBag.modifier.updateAggregation(mControl.control, oChange.getContent().boundAggregation);
|
|
43
|
+
.then(function(bSuccess) {
|
|
44
|
+
if (bSuccess) {
|
|
45
|
+
// TODO should be changed as soon as new flex persistence is in place
|
|
46
|
+
mPropertyBag.flexController._oChangePersistence._deleteChangeInMap(oChange);
|
|
69
47
|
}
|
|
70
|
-
oChange.markRevertFinished();
|
|
71
|
-
return mControl.control;
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
.catch(function(oError) {
|
|
75
|
-
var sErrorMessage = "Change could not be reverted: " + oError.message;
|
|
76
|
-
Log.error(sErrorMessage);
|
|
77
|
-
oChange.markRevertFinished(sErrorMessage);
|
|
78
|
-
return false;
|
|
79
48
|
});
|
|
80
|
-
|
|
49
|
+
}
|
|
81
50
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
aPromiseStack.push(function() {
|
|
98
|
-
var oSelector = oChange.getSelector && oChange.getSelector();
|
|
99
|
-
var oControl = mPropertyBag.modifier.bySelector(oSelector, mPropertyBag.appComponent);
|
|
100
|
-
if (!oControl) {
|
|
101
|
-
Log.warning("A flexibility change tries to revert changes on a nonexistent control with id " + oSelector.id);
|
|
102
|
-
return new FlUtils.FakePromise();
|
|
103
|
-
}
|
|
104
|
-
var mRevertProperties = {
|
|
105
|
-
modifier: mPropertyBag.modifier,
|
|
106
|
-
appComponent: mPropertyBag.appComponent,
|
|
107
|
-
view: FlUtils.getViewForControl(oControl)
|
|
108
|
-
};
|
|
51
|
+
/**
|
|
52
|
+
* Reverts a specific change on the passed control if it is currently applied.
|
|
53
|
+
*
|
|
54
|
+
* @param {sap.ui.fl.Change} oChange - Change object that should be reverted on the passed control
|
|
55
|
+
* @param {sap.ui.core.Control} oControl - Control which is the target of the passed change
|
|
56
|
+
* @param {object} mPropertyBag - Object with parameters as properties
|
|
57
|
+
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Component instance that is currently loading
|
|
58
|
+
* @param {object} mPropertyBag.appDescriptor - App descriptor containing the metadata of the current application
|
|
59
|
+
* @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Polymorph reuse operations handling the changes on the given view type
|
|
60
|
+
* @param {sap.ui.core.mvc.View} mPropertyBag.view - View to process
|
|
61
|
+
* @returns {Promise|sap.ui.fl.Utils.FakePromise} Resolving Promise/FakePromise with either the control (success) or <code>false</code> (failure) as value
|
|
62
|
+
*/
|
|
63
|
+
Reverter.revertChangeOnControl = function(oChange, oControl, mPropertyBag) {
|
|
64
|
+
var mControl = Utils.getControlIfTemplateAffected(oChange, oControl, mPropertyBag);
|
|
65
|
+
var oChangeHandler;
|
|
109
66
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
67
|
+
return Utils.getChangeHandler(oChange, mControl, mPropertyBag).then(function(oReturnedChangeHandler) {
|
|
68
|
+
oChangeHandler = oReturnedChangeHandler;
|
|
69
|
+
})
|
|
70
|
+
.then(_waitForApplyIfNecessary.bind(null, oChange))
|
|
71
|
+
.then(function() {
|
|
72
|
+
if (oChange.isApplyProcessFinished()) {
|
|
73
|
+
oChange.startReverting();
|
|
74
|
+
return oChangeHandler.revertChange(oChange, mControl.control, mPropertyBag);
|
|
75
|
+
}
|
|
76
|
+
throw Error("Change was never applied");
|
|
77
|
+
})
|
|
78
|
+
.then(function() {
|
|
79
|
+
// After revert the relevant control for the change might have changed, therefore it must be retrieved again (e.g. stashing)
|
|
80
|
+
mControl.control = mPropertyBag.modifier.bySelector(oChange.getSelector(), mPropertyBag.appComponent, mPropertyBag.view);
|
|
81
|
+
if (mControl.bTemplateAffected) {
|
|
82
|
+
return mPropertyBag.modifier.updateAggregation(mControl.control, oChange.getContent().boundAggregation);
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
})
|
|
86
|
+
.then(function () {
|
|
87
|
+
oChange.markRevertFinished();
|
|
88
|
+
return mControl.control;
|
|
89
|
+
})
|
|
90
|
+
.catch(function(oError) {
|
|
91
|
+
var sErrorMessage = "Change could not be reverted: " + oError.message;
|
|
92
|
+
Log.error(sErrorMessage);
|
|
93
|
+
oChange.markRevertFinished(sErrorMessage);
|
|
94
|
+
return false;
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Reverts all given changes in one app component.
|
|
100
|
+
*
|
|
101
|
+
* @param {sap.ui.fl.Change[]} aChanges - Array of changes to be reverted
|
|
102
|
+
* @param {object} mPropertyBag - Object with additional properties
|
|
103
|
+
* @param {sap.ui.core.Component} mPropertyBag.appComponent - Component instance that is currently loading
|
|
104
|
+
* @param {sap.ui.core.util.reflection.BaseTreeModifier} mPropertyBag.modifier - Polymorph reuse operations handling the changes on the given view type
|
|
105
|
+
* @param {sap.ui.fl.FlexController} mPropertyBag.flexController - Instance of the flex controller the change is saved in
|
|
106
|
+
* @returns {Promise|sap.ui.fl.Utils.FakePromise} Promise/FakePromise that resolves as soon as all changes are reverted
|
|
107
|
+
*/
|
|
108
|
+
Reverter.revertMultipleChanges = function(aChanges, mPropertyBag) {
|
|
109
|
+
var aPromiseStack = [];
|
|
110
|
+
aChanges.forEach(function(oChange) {
|
|
111
|
+
// Queued 'state' will be removed once the revert process is done
|
|
112
|
+
oChange.setQueuedForRevert();
|
|
113
|
+
aPromiseStack.push(function() {
|
|
114
|
+
var oSelector = oChange.getSelector && oChange.getSelector();
|
|
115
|
+
var oControl = mPropertyBag.modifier.bySelector(oSelector, mPropertyBag.appComponent);
|
|
116
|
+
if (!oControl) {
|
|
117
|
+
Log.warning("A flexibility change tries to revert changes on a nonexistent control with id " + oSelector.id);
|
|
118
|
+
return new FlUtils.FakePromise();
|
|
119
|
+
}
|
|
120
|
+
var mRevertProperties = {
|
|
121
|
+
modifier: mPropertyBag.modifier,
|
|
122
|
+
appComponent: mPropertyBag.appComponent,
|
|
123
|
+
view: FlUtils.getViewForControl(oControl)
|
|
124
|
+
};
|
|
125
|
+
return revertAndDeleteChangeOnControl(oChange, oControl, mRevertProperties, mPropertyBag);
|
|
121
126
|
});
|
|
127
|
+
});
|
|
122
128
|
|
|
123
|
-
|
|
124
|
-
}
|
|
129
|
+
return FlUtils.execPromiseQueueSequentially(aPromiseStack);
|
|
125
130
|
};
|
|
131
|
+
|
|
126
132
|
return Reverter;
|
|
127
133
|
});
|
|
@@ -20,11 +20,20 @@ sap.ui.define([
|
|
|
20
20
|
*
|
|
21
21
|
* @namespace sap.ui.fl.apply._internal.connectors.changes.Utils
|
|
22
22
|
* @since 1.70
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.93.3
|
|
24
24
|
* @private
|
|
25
25
|
* @ui5-restricted sap.ui.fl.apply._internal, sap.ui.fl.write._internal
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
|
+
function isDependencyStillValid(oChange, bHasChangeApplyFinishedCustomData) {
|
|
29
|
+
// if change is already applied OR if apply process has started,
|
|
30
|
+
// then dependency is no more valid
|
|
31
|
+
if (bHasChangeApplyFinishedCustomData || oChange.hasApplyProcessStarted()) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
|
|
28
37
|
var Utils = {
|
|
29
38
|
/**
|
|
30
39
|
* Returns the control map containing control, controlType, bTemplateAffected and originalControl
|
|
@@ -87,16 +96,18 @@ sap.ui.define([
|
|
|
87
96
|
});
|
|
88
97
|
},
|
|
89
98
|
|
|
90
|
-
|
|
99
|
+
checkIfDependencyIsStillValidSync: function(oAppComponent, oModifier, mChangesMap, sChangeId) {
|
|
91
100
|
var oChange = FlUtils.getChangeFromChangesMap(mChangesMap.mChanges, sChangeId);
|
|
92
101
|
var oControl = oModifier.bySelector(oChange.getSelector(), oAppComponent);
|
|
102
|
+
var bHasChangeApplyFinishedCustomData = FlexCustomData.sync.hasChangeApplyFinishedCustomData(oControl, oChange);
|
|
103
|
+
return isDependencyStillValid(oChange, bHasChangeApplyFinishedCustomData);
|
|
104
|
+
},
|
|
93
105
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
return true;
|
|
106
|
+
checkIfDependencyIsStillValid: function(oAppComponent, oModifier, mChangesMap, sChangeId) {
|
|
107
|
+
var oChange = FlUtils.getChangeFromChangesMap(mChangesMap.mChanges, sChangeId);
|
|
108
|
+
var oControl = oModifier.bySelector(oChange.getSelector(), oAppComponent);
|
|
109
|
+
return FlexCustomData.hasChangeApplyFinishedCustomData(oControl, oChange, oModifier)
|
|
110
|
+
.then(isDependencyStillValid.bind(null, oChange));
|
|
100
111
|
}
|
|
101
112
|
};
|
|
102
113
|
|
|
@@ -139,7 +139,7 @@ sap.ui.define([
|
|
|
139
139
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.app.AddAnnotationsToOData
|
|
140
140
|
* @experimental
|
|
141
141
|
* @since 1.87
|
|
142
|
-
* @version 1.
|
|
142
|
+
* @version 1.93.3
|
|
143
143
|
* @private
|
|
144
144
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
145
145
|
*/
|
|
@@ -70,7 +70,7 @@ sap.ui.define([
|
|
|
70
70
|
* @namespace sap.ui.fl.apply._internal.flexState.FlexState
|
|
71
71
|
* @experimental
|
|
72
72
|
* @since 1.73
|
|
73
|
-
* @version 1.
|
|
73
|
+
* @version 1.93.3
|
|
74
74
|
* @private
|
|
75
75
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
76
76
|
*/
|
|
@@ -97,6 +97,7 @@ sap.ui.define([
|
|
|
97
97
|
pathInResponse: ["comp.variants", "comp.standardVariants", "comp.defaultVariants", "comp.changes"]
|
|
98
98
|
}
|
|
99
99
|
};
|
|
100
|
+
var _mExternalCompVariantInputData = {};
|
|
100
101
|
|
|
101
102
|
function updateComponentData(mPropertyBag) {
|
|
102
103
|
var oComponent = Component.get(mPropertyBag.componentId);
|
|
@@ -332,6 +333,17 @@ sap.ui.define([
|
|
|
332
333
|
}
|
|
333
334
|
};
|
|
334
335
|
|
|
336
|
+
FlexState.setInitialNonFlCompVariantData = function(sReference, sPersistencyKey, oStandardVariant, aVariants) {
|
|
337
|
+
_mExternalCompVariantInputData[sReference] = {};
|
|
338
|
+
_mExternalCompVariantInputData[sReference][sPersistencyKey] = {};
|
|
339
|
+
_mExternalCompVariantInputData[sReference][sPersistencyKey].standardVariant = oStandardVariant;
|
|
340
|
+
_mExternalCompVariantInputData[sReference][sPersistencyKey].variants = aVariants;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
FlexState.getInitialNonFlCompVariantData = function(sReference) {
|
|
344
|
+
return _mExternalCompVariantInputData[sReference];
|
|
345
|
+
};
|
|
346
|
+
|
|
335
347
|
/**
|
|
336
348
|
* Removes the saved filtered storage response and internal maps for the given reference.
|
|
337
349
|
* The next initialize call will add it again.
|
|
@@ -114,7 +114,7 @@ sap.ui.define([
|
|
|
114
114
|
*
|
|
115
115
|
* @namespace sap.ui.fl.apply._internal.flexState.compVariants.CompVariantMerger
|
|
116
116
|
* @since 1.86
|
|
117
|
-
* @version 1.
|
|
117
|
+
* @version 1.93.3
|
|
118
118
|
* @private
|
|
119
119
|
* @ui5-restricted sap.ui.fl
|
|
120
120
|
*/
|
|
@@ -179,7 +179,7 @@ sap.ui.define([
|
|
|
179
179
|
*
|
|
180
180
|
* @function
|
|
181
181
|
* @since 1.89
|
|
182
|
-
* @version 1.
|
|
182
|
+
* @version 1.93.3
|
|
183
183
|
* @private
|
|
184
184
|
* @ui5-restricted sap.ui.fl
|
|
185
185
|
*
|
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* @namespace sap.ui.fl.apply.api.ControlVariantApplyAPI
|
|
22
22
|
* @experimental Since 1.67
|
|
23
23
|
* @since 1.67
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.93.3
|
|
25
25
|
* @public
|
|
26
26
|
*/
|
|
27
27
|
var ControlVariantApplyAPI = /** @lends sap.ui.fl.apply.api.ControlVariantApplyAPI */{
|
|
@@ -49,6 +49,8 @@ sap.ui.define([
|
|
|
49
49
|
}).then(function () {
|
|
50
50
|
var sPersistencyKey = CompVariantUtils.getPersistencyKey(oControl);
|
|
51
51
|
var mCompVariantsMap = FlexState.getCompVariantsMap(sReference);
|
|
52
|
+
//Store external input data to FlexState so they can be restored after invalidating cache
|
|
53
|
+
FlexState.setInitialNonFlCompVariantData(sReference, sPersistencyKey, mPropertyBag.standardVariant, mPropertyBag.variants);
|
|
52
54
|
return mCompVariantsMap._initialize(sPersistencyKey, mPropertyBag.variants);
|
|
53
55
|
});
|
|
54
56
|
}
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
*
|
|
21
21
|
* @alias sap.ui.fl.changeHandler.AddIFrame
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.93.3
|
|
24
24
|
* @since 1.72
|
|
25
25
|
* @private
|
|
26
26
|
*/
|
|
@@ -33,6 +33,7 @@ sap.ui.define([
|
|
|
33
33
|
* @param {sap.ui.core.Control} oControl Control that matches the change selector for applying the change
|
|
34
34
|
* @param {object} mPropertyBag Map of properties
|
|
35
35
|
* @param {object} mPropertyBag.modifier Modifier for the controls
|
|
36
|
+
* @returns {Promise} Promise resolving when the change is successfully applied
|
|
36
37
|
* @ui5-restricted sap.ui.fl
|
|
37
38
|
*/
|
|
38
39
|
AddIFrame.applyChange = function(oChange, oControl, mPropertyBag) {
|
|
@@ -40,14 +41,27 @@ sap.ui.define([
|
|
|
40
41
|
var oChangeDefinition = oChange.getDefinition();
|
|
41
42
|
var oView = mPropertyBag.view;
|
|
42
43
|
var sAggregationName = oChangeDefinition.content.targetAggregation;
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
var iIndex;
|
|
45
|
+
var oIFrame;
|
|
46
|
+
return Promise.resolve()
|
|
47
|
+
.then(oModifier.findAggregation.bind(oModifier, oControl, sAggregationName))
|
|
48
|
+
.then(function(oAggregationDefinition) {
|
|
49
|
+
if (!oAggregationDefinition) {
|
|
50
|
+
throw new Error("The given Aggregation is not available in the given control: " + oModifier.getId(oControl));
|
|
51
|
+
}
|
|
52
|
+
return getTargetAggregationIndex(oChange, oControl, mPropertyBag);
|
|
53
|
+
})
|
|
54
|
+
.then(function(iRetrievedIndex) {
|
|
55
|
+
iIndex = iRetrievedIndex;
|
|
56
|
+
return createIFrame(oChange, mPropertyBag, oChangeDefinition.content.selector);
|
|
57
|
+
})
|
|
58
|
+
.then(function(oCreatedIFrame) {
|
|
59
|
+
oIFrame = oCreatedIFrame;
|
|
60
|
+
return oModifier.insertAggregation(oControl, sAggregationName, oIFrame, iIndex, oView);
|
|
61
|
+
})
|
|
62
|
+
.then(function() {
|
|
63
|
+
oChange.setRevertData([oModifier.getId(oIFrame)]);
|
|
64
|
+
});
|
|
51
65
|
};
|
|
52
66
|
|
|
53
67
|
/**
|