@openui5/sap.ui.fl 1.92.0 → 1.95.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/{.eslintrc → .eslintrc.json} +0 -0
- package/.reuse/dep5 +1 -6
- package/THIRDPARTY.txt +4 -10
- 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 +44 -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/appVariant/DescriptorChangeTypes.js +2 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +117 -70
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +173 -43
- 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 +3 -2
- 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/SetAbstract.js +52 -0
- 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 +52 -4
- package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +5 -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 +12 -7
- 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 +10 -8
- 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 +29 -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 -22
- 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 +18 -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 +24 -0
- package/src/sap/ui/fl/messagebundle_ar.properties +17 -1
- package/src/sap/ui/fl/messagebundle_bg.properties +17 -1
- package/src/sap/ui/fl/messagebundle_ca.properties +18 -2
- package/src/sap/ui/fl/messagebundle_cs.properties +17 -1
- package/src/sap/ui/fl/messagebundle_cy.properties +17 -1
- package/src/sap/ui/fl/messagebundle_da.properties +17 -1
- package/src/sap/ui/fl/messagebundle_de.properties +17 -1
- package/src/sap/ui/fl/messagebundle_el.properties +17 -1
- package/src/sap/ui/fl/messagebundle_en.properties +16 -0
- package/src/sap/ui/fl/messagebundle_en_GB.properties +16 -0
- package/src/sap/ui/fl/messagebundle_en_US_sappsd.properties +16 -0
- package/src/sap/ui/fl/messagebundle_en_US_saptrc.properties +16 -0
- package/src/sap/ui/fl/messagebundle_es.properties +18 -2
- package/src/sap/ui/fl/messagebundle_es_MX.properties +17 -1
- package/src/sap/ui/fl/messagebundle_et.properties +17 -1
- package/src/sap/ui/fl/messagebundle_fi.properties +17 -1
- package/src/sap/ui/fl/messagebundle_fr.properties +16 -0
- package/src/sap/ui/fl/messagebundle_fr_CA.properties +16 -0
- package/src/sap/ui/fl/messagebundle_hi.properties +17 -1
- package/src/sap/ui/fl/messagebundle_hr.properties +17 -1
- package/src/sap/ui/fl/messagebundle_hu.properties +17 -1
- package/src/sap/ui/fl/messagebundle_id.properties +17 -1
- package/src/sap/ui/fl/messagebundle_it.properties +17 -1
- package/src/sap/ui/fl/messagebundle_iw.properties +17 -1
- package/src/sap/ui/fl/messagebundle_ja.properties +17 -1
- package/src/sap/ui/fl/messagebundle_kk.properties +17 -1
- package/src/sap/ui/fl/messagebundle_ko.properties +17 -1
- package/src/sap/ui/fl/messagebundle_lt.properties +17 -1
- package/src/sap/ui/fl/messagebundle_lv.properties +17 -1
- package/src/sap/ui/fl/messagebundle_ms.properties +17 -1
- package/src/sap/ui/fl/messagebundle_nl.properties +17 -1
- package/src/sap/ui/fl/messagebundle_no.properties +17 -1
- package/src/sap/ui/fl/messagebundle_pl.properties +17 -1
- package/src/sap/ui/fl/messagebundle_pt.properties +17 -1
- package/src/sap/ui/fl/messagebundle_pt_PT.properties +17 -1
- package/src/sap/ui/fl/messagebundle_ro.properties +16 -0
- package/src/sap/ui/fl/messagebundle_ru.properties +17 -1
- package/src/sap/ui/fl/messagebundle_sh.properties +19 -3
- package/src/sap/ui/fl/messagebundle_sk.properties +17 -1
- package/src/sap/ui/fl/messagebundle_sl.properties +17 -1
- package/src/sap/ui/fl/messagebundle_sv.properties +17 -1
- package/src/sap/ui/fl/messagebundle_th.properties +17 -1
- package/src/sap/ui/fl/messagebundle_tr.properties +17 -1
- package/src/sap/ui/fl/messagebundle_uk.properties +19 -3
- package/src/sap/ui/fl/messagebundle_vi.properties +17 -1
- package/src/sap/ui/fl/messagebundle_zh_CN.properties +17 -1
- package/src/sap/ui/fl/messagebundle_zh_TW.properties +17 -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 +5 -0
- 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 +133 -36
- package/src/sap/ui/fl/variants/VariantModel.js +57 -23
- 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 +20 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +23 -12
- 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 +37 -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 +1 -0
- 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 +172 -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 -1
- 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.95.0
|
|
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
|
|
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* @namespace sap.ui.fl.apply._internal.changes.descriptor.RegistrationBuild
|
|
22
22
|
* @experimental
|
|
23
23
|
* @since 1.77
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.95.0
|
|
25
25
|
* @private
|
|
26
26
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
27
27
|
*/
|
|
@@ -34,7 +34,8 @@ sap.ui.define([
|
|
|
34
34
|
appdescr_ui5_setFlexExtensionPointEnabled: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled"),
|
|
35
35
|
appdescr_ui5_addNewModel: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel"),
|
|
36
36
|
appdescr_app_addAnnotationsToOData: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData"),
|
|
37
|
-
appdescr_app_changeInbound: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound")
|
|
37
|
+
appdescr_app_changeInbound: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound"),
|
|
38
|
+
appdescr_fiori_setAbstract: requireAsync.bind(this, "sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract")
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
var RegistrationCopy = Object.assign({}, Registration);
|
|
@@ -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.95.0
|
|
143
143
|
* @private
|
|
144
144
|
* @ui5-restricted sap.ui.fl.apply._internal
|
|
145
145
|
*/
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
|
|
2
|
+
/*!
|
|
3
|
+
* OpenUI5
|
|
4
|
+
* (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
sap.ui.define([
|
|
9
|
+
"sap/base/util/ObjectPath"
|
|
10
|
+
], function(
|
|
11
|
+
ObjectPath
|
|
12
|
+
) {
|
|
13
|
+
"use strict";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Descriptor change merger for change type <code>appdescr_fiori_setAbstract</code>.
|
|
17
|
+
* Sets and overwrites boolean flag (only to <code>false</code>) for <code>sap.fiori/abstract</code>.
|
|
18
|
+
*
|
|
19
|
+
* Only available during build time {@link sap.ui.fl.apply._internal.changes.descriptor.RegistrationBuild}.
|
|
20
|
+
*
|
|
21
|
+
* @namespace sap.ui.fl.apply._internal.changes.descriptor.fiori.SetAbstract
|
|
22
|
+
* @experimental
|
|
23
|
+
* @version 1.95.0
|
|
24
|
+
* @private
|
|
25
|
+
* @ui5-restricted sap.ui.fl.apply._internal
|
|
26
|
+
*/
|
|
27
|
+
var SetAbstract = /** @lends sap.ui.fl.apply._internal.changes.descriptor.fiori.SetAbstract */ {
|
|
28
|
+
/**
|
|
29
|
+
* Method to apply the <code>appdescr_fiori_setAbstract</code> change to the manifest.
|
|
30
|
+
* @param {object} oManifest - Original manifest
|
|
31
|
+
* @param {object} oChange - Change with type <code>appdescr_fiori_setAbstract</code>
|
|
32
|
+
* @param {boolean} oChange.content.abstract - Boolean flag (only allowed value is <code>false</code>)
|
|
33
|
+
* @returns {object} Updated manifest with changed <code>appdescr_fiori_setAbstract</code>
|
|
34
|
+
*
|
|
35
|
+
* @private
|
|
36
|
+
* @ui5-restricted sap.ui.fl.apply._internal
|
|
37
|
+
*/
|
|
38
|
+
applyChange: function(oManifest, oChange) {
|
|
39
|
+
if (!oChange.getContent().hasOwnProperty("abstract")) {
|
|
40
|
+
throw new Error("No abstract in change content provided");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (oChange.getContent().abstract !== false) {
|
|
44
|
+
throw new Error("The current change value of property abstract is '" + oChange.getContent().abstract + "'. Only allowed value for property abstract is boolean 'false'");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
ObjectPath.set(["sap.fiori", "abstract"], oChange.getContent().abstract, oManifest);
|
|
48
|
+
return oManifest;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
return SetAbstract;
|
|
52
|
+
});
|
|
@@ -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.95.0
|
|
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.
|
|
@@ -5,17 +5,65 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
+
"sap/base/util/deepClone",
|
|
8
9
|
"sap/ui/fl/apply/_internal/flexState/ManifestUtils",
|
|
9
10
|
"sap/ui/fl/initial/_internal/Storage",
|
|
10
11
|
"sap/ui/fl/Utils"
|
|
11
12
|
], function(
|
|
13
|
+
deepClone,
|
|
12
14
|
ManifestUtils,
|
|
13
15
|
ApplyStorage,
|
|
14
16
|
Utils
|
|
15
17
|
) {
|
|
16
18
|
"use strict";
|
|
17
19
|
|
|
18
|
-
function
|
|
20
|
+
function getIdIsLocalTrueObject(vSelector) {
|
|
21
|
+
if (typeof vSelector === "string") {
|
|
22
|
+
vSelector = {id: vSelector};
|
|
23
|
+
}
|
|
24
|
+
vSelector.idIsLocal = true;
|
|
25
|
+
|
|
26
|
+
return vSelector;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function migrateSelectorFlags(bMigrationNeeded, mFlexData) {
|
|
30
|
+
if (bMigrationNeeded) {
|
|
31
|
+
[
|
|
32
|
+
mFlexData.changes,
|
|
33
|
+
mFlexData.variantChanges,
|
|
34
|
+
mFlexData.variantDependentControlChanges,
|
|
35
|
+
mFlexData.variantManagementChanges
|
|
36
|
+
].forEach(function (aFlexItems) {
|
|
37
|
+
// a for is used due to the alteration of the array and its length
|
|
38
|
+
for (var i = aFlexItems.length - 1; i >= 0; i--) {
|
|
39
|
+
var oFlexItem = aFlexItems[i];
|
|
40
|
+
if (!oFlexItem.selector.idIsLocal) {
|
|
41
|
+
var oFlexItemCopy = deepClone(oFlexItem);
|
|
42
|
+
// ensure a UID of the change for dependency handling
|
|
43
|
+
oFlexItemCopy.fileName = oFlexItemCopy.fileName + "_localIdClone";
|
|
44
|
+
oFlexItemCopy.selector = getIdIsLocalTrueObject(oFlexItemCopy.selector);
|
|
45
|
+
|
|
46
|
+
// do the same for dependentSelectors
|
|
47
|
+
if (oFlexItemCopy.dependentSelector) {
|
|
48
|
+
Object.keys(oFlexItemCopy.dependentSelector).forEach(function (oFlexItemCopy, sCategory) {
|
|
49
|
+
oFlexItemCopy.dependentSelector[sCategory] = oFlexItemCopy.dependentSelector[sCategory].map(getIdIsLocalTrueObject);
|
|
50
|
+
}.bind(undefined, oFlexItemCopy));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
aFlexItems.splice(i, 0, oFlexItemCopy);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return mFlexData;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function isMigrationNeeded(oManifest) {
|
|
63
|
+
return oManifest && !!ManifestUtils.getOvpEntry(oManifest);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function formatFlexData(mFlexData) {
|
|
19
67
|
// TODO: rename "changes" everywhere to avoid oResponse.changes.changes calls
|
|
20
68
|
return {
|
|
21
69
|
changes: mFlexData,
|
|
@@ -29,7 +77,7 @@ sap.ui.define([
|
|
|
29
77
|
* @namespace sap.ui.fl.apply._internal.flexState.Loader
|
|
30
78
|
* @experimental
|
|
31
79
|
* @since 1.74
|
|
32
|
-
* @version 1.
|
|
80
|
+
* @version 1.95.0
|
|
33
81
|
* @private
|
|
34
82
|
* @ui5-restricted sap.ui.fl.apply._internal.flexState
|
|
35
83
|
*/
|
|
@@ -60,7 +108,7 @@ sap.ui.define([
|
|
|
60
108
|
reference: mPropertyBag.reference,
|
|
61
109
|
componentName: sComponentName,
|
|
62
110
|
partialFlexData: mPropertyBag.partialFlexData
|
|
63
|
-
}).then(
|
|
111
|
+
}).then(formatFlexData);
|
|
64
112
|
}
|
|
65
113
|
|
|
66
114
|
// the cache key cannot be used in case of a reinitialization
|
|
@@ -74,7 +122,7 @@ sap.ui.define([
|
|
|
74
122
|
appDescriptor: mPropertyBag.manifest.getRawJson ? mPropertyBag.manifest.getRawJson() : mPropertyBag.manifest,
|
|
75
123
|
version: mPropertyBag.version,
|
|
76
124
|
allContexts: mPropertyBag.allContexts
|
|
77
|
-
}).then(
|
|
125
|
+
}).then(migrateSelectorFlags.bind(undefined, isMigrationNeeded(mPropertyBag.manifest))).then(formatFlexData);
|
|
78
126
|
}
|
|
79
127
|
};
|
|
80
128
|
});
|
|
@@ -37,7 +37,7 @@ function(
|
|
|
37
37
|
* @namespace sap.ui.fl.apply._internal.flexState.ManifestUtils
|
|
38
38
|
* @experimental
|
|
39
39
|
* @since 1.74
|
|
40
|
-
* @version 1.
|
|
40
|
+
* @version 1.95.0
|
|
41
41
|
* @private
|
|
42
42
|
*/
|
|
43
43
|
var ManifestUtils = {
|
|
@@ -80,6 +80,10 @@ function(
|
|
|
80
80
|
return appendComponentToReference(Utils.getAppIdFromManifest(oManifest));
|
|
81
81
|
},
|
|
82
82
|
|
|
83
|
+
getOvpEntry: function (oManifest) {
|
|
84
|
+
return oManifest.getEntry ? oManifest.getEntry("sap.ovp") : oManifest["sap.ovp"];
|
|
85
|
+
},
|
|
86
|
+
|
|
83
87
|
getCacheKeyFromAsyncHints: function(sReference, oAsyncHints) {
|
|
84
88
|
if (oAsyncHints && oAsyncHints.requests && Array.isArray(oAsyncHints.requests)) {
|
|
85
89
|
var oFlAsyncHint = getFlAsyncHint(oAsyncHints);
|