@openui5/sap.ui.fl 1.118.0 → 1.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRDPARTY.txt +2 -2
- package/package.json +3 -3
- package/src/sap/ui/fl/.library +1 -1
- package/src/sap/ui/fl/ChangePersistence.js +1 -1
- 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 +14 -7
- package/src/sap/ui/fl/Utils.js +72 -172
- package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Applier.js +8 -4
- package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
- package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyStrategyFactory.js +28 -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/AddNewInbound.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/RemoveAllInboundsExceptOne.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/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/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 +5 -1
- package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
- 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/flexState/FlexState.js +17 -88
- 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/compVariants/Utils.js +6 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
- package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +96 -77
- package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
- package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
- package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
- 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 +45 -59
- package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/MoveControls.js +168 -260
- package/src/sap/ui/fl/changeHandler/MoveElements.js +33 -87
- 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 +31 -53
- package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
- package/src/sap/ui/fl/changeHandler/UnstashControl.js +24 -26
- package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +3 -5
- package/src/sap/ui/fl/changeHandler/common/createIFrame.js +2 -0
- 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/designtime/util/IFrame.designtime.js +5 -0
- package/src/sap/ui/fl/{write → initial}/_internal/FlexInfoSession.js +11 -3
- package/src/sap/ui/fl/initial/_internal/Storage.js +5 -5
- package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
- package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
- 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 +1 -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/messagebundle_bg.properties +2 -2
- package/src/sap/ui/fl/messagebundle_en.properties +2 -2
- package/src/sap/ui/fl/messagebundle_ja.properties +6 -6
- package/src/sap/ui/fl/messagebundle_sl.properties +2 -2
- package/src/sap/ui/fl/messagebundle_uk.properties +1 -1
- package/src/sap/ui/fl/support/_internal/getChangeDependencies.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/IFrame.js +60 -27
- package/src/sap/ui/fl/util/IFrameRenderer.js +9 -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 +17 -18
- package/src/sap/ui/fl/variants/VariantModel.js +2 -1
- package/src/sap/ui/fl/variants/context/manifest.json +2 -2
- package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
- package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
- package/src/sap/ui/fl/write/_internal/Versions.js +3 -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 +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
- package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
- package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +2 -2
- 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/extensionPoint/Processor.js +1 -1
- package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.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/FlexObjectState.js +1 -1
- package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +63 -43
- 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/ContextBasedAdaptationsAPI.js +1 -1
- package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
- package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +1 -1
- package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +12 -2
- package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +14 -11
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/Log",
|
|
9
|
-
"sap/ui/fl/changeHandler/condenser/Classification"
|
|
10
|
-
"sap/ui/fl/Utils"
|
|
9
|
+
"sap/ui/fl/changeHandler/condenser/Classification"
|
|
11
10
|
],
|
|
12
11
|
function(
|
|
13
12
|
Log,
|
|
14
|
-
CondenserClassification
|
|
15
|
-
FlUtils
|
|
13
|
+
CondenserClassification
|
|
16
14
|
) {
|
|
17
15
|
"use strict";
|
|
18
16
|
|
|
@@ -21,7 +19,7 @@ function(
|
|
|
21
19
|
*
|
|
22
20
|
* @alias sap.ui.fl.changeHandler.MoveControls
|
|
23
21
|
* @author SAP SE
|
|
24
|
-
* @version 1.
|
|
22
|
+
* @version 1.119.0
|
|
25
23
|
* @since 1.46
|
|
26
24
|
*/
|
|
27
25
|
var MoveControls = { };
|
|
@@ -31,63 +29,59 @@ function(
|
|
|
31
29
|
MoveControls.TARGET_ALIAS = "target";
|
|
32
30
|
MoveControls.MOVED_ELEMENTS_ALIAS = "movedElements";
|
|
33
31
|
|
|
34
|
-
function
|
|
32
|
+
function checkConditions(oChange, oModifier, oView, oAppComponent) {
|
|
35
33
|
if (!oChange) {
|
|
36
|
-
|
|
34
|
+
throw new Error("No change instance");
|
|
37
35
|
}
|
|
38
36
|
|
|
39
37
|
var oChangeContent = oChange.getContent();
|
|
40
38
|
|
|
41
39
|
if (!oChangeContent || !oChangeContent.movedElements || oChangeContent.movedElements.length === 0) {
|
|
42
|
-
|
|
40
|
+
throw new Error("Change format invalid");
|
|
43
41
|
}
|
|
44
42
|
if (!oChangeContent.source || !oChangeContent.source.selector) {
|
|
45
|
-
|
|
43
|
+
throw new Error("No source supplied for move");
|
|
46
44
|
}
|
|
47
45
|
if (!oChangeContent.target || !oChangeContent.target.selector) {
|
|
48
|
-
|
|
46
|
+
throw new Error("No target supplied for move");
|
|
49
47
|
}
|
|
50
48
|
if (!oModifier.bySelector(oChangeContent.source.selector, oAppComponent, oView)) {
|
|
51
|
-
|
|
49
|
+
throw new Error("Move source parent not found");
|
|
52
50
|
}
|
|
53
51
|
if (!oModifier.bySelector(oChangeContent.target.selector, oAppComponent, oView)) {
|
|
54
|
-
|
|
52
|
+
throw new Error("Move target parent not found");
|
|
55
53
|
}
|
|
56
54
|
if (!oChangeContent.source.selector.aggregation) {
|
|
57
|
-
|
|
55
|
+
throw new Error("No source aggregation supplied for move");
|
|
58
56
|
}
|
|
59
57
|
if (!oChangeContent.target.selector.aggregation) {
|
|
60
|
-
|
|
58
|
+
throw new Error("No target aggregation supplied for move");
|
|
61
59
|
}
|
|
62
|
-
return Promise.resolve();
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
function
|
|
62
|
+
async function getElementControlOrThrowError(mMovedElement, oModifier, oAppComponent, oView) {
|
|
66
63
|
if (!mMovedElement.selector && !mMovedElement.id) {
|
|
67
|
-
|
|
64
|
+
throw new Error("Change format invalid - moveElements element has no id attribute");
|
|
68
65
|
}
|
|
69
66
|
if (typeof mMovedElement.targetIndex !== "number") {
|
|
70
|
-
|
|
67
|
+
throw new Error(
|
|
71
68
|
`Missing targetIndex for element with id '${mMovedElement.selector.id}' in movedElements supplied`
|
|
72
|
-
)
|
|
69
|
+
);
|
|
73
70
|
}
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
return oControl;
|
|
82
|
-
});
|
|
72
|
+
const oControl = await oModifier.bySelector(mMovedElement.selector || mMovedElement.id, oAppComponent, oView);
|
|
73
|
+
if (!oControl) {
|
|
74
|
+
throw new Error(`Control to move was not found. Id: '${mMovedElement.selector.id}'`);
|
|
75
|
+
}
|
|
76
|
+
return oControl;
|
|
83
77
|
}
|
|
84
78
|
|
|
85
|
-
function
|
|
79
|
+
function checkCompleteChangeContentConditions(mSpecificChangeInfo) {
|
|
86
80
|
if (!mSpecificChangeInfo.movedElements) {
|
|
87
|
-
|
|
81
|
+
throw new Error("mSpecificChangeInfo.movedElements attribute required");
|
|
88
82
|
}
|
|
89
83
|
if (mSpecificChangeInfo.movedElements.length === 0) {
|
|
90
|
-
|
|
84
|
+
throw new Error("MovedElements array is empty");
|
|
91
85
|
}
|
|
92
86
|
|
|
93
87
|
mSpecificChangeInfo.movedElements.forEach(function(mElement) {
|
|
@@ -101,56 +95,45 @@ function(
|
|
|
101
95
|
throw new Error("TargetIndex attribute at MovedElements element is no number");
|
|
102
96
|
}
|
|
103
97
|
});
|
|
104
|
-
return Promise.resolve();
|
|
105
98
|
}
|
|
106
99
|
|
|
107
|
-
function
|
|
100
|
+
async function completeSpecificChangeInfo(oModifier, mSpecificChangeInfo, oAppComponent) {
|
|
108
101
|
delete mSpecificChangeInfo.source.publicAggregation;
|
|
109
102
|
delete mSpecificChangeInfo.target.publicAggregation;
|
|
110
103
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
oSourceParent
|
|
120
|
-
|
|
121
|
-
})
|
|
122
|
-
.then(function(oReturnedTargetParent) {
|
|
123
|
-
oTargetParent = oReturnedTargetParent;
|
|
124
|
-
var sSourceAggregation = mSpecificChangeInfo.source.aggregation;
|
|
125
|
-
var sTargetAggregation = mSpecificChangeInfo.target.aggregation;
|
|
126
|
-
var mAdditionalSourceInfo = {
|
|
127
|
-
aggregation: mSpecificChangeInfo.source.aggregation,
|
|
128
|
-
type: oModifier.getControlType(oSourceParent)
|
|
129
|
-
};
|
|
104
|
+
const oSourceParent =
|
|
105
|
+
mSpecificChangeInfo.source.parent || await oModifier.bySelector(mSpecificChangeInfo.source.id, oAppComponent);
|
|
106
|
+
const oTargetParent =
|
|
107
|
+
mSpecificChangeInfo.target.parent || await oModifier.bySelector(mSpecificChangeInfo.target.id, oAppComponent);
|
|
108
|
+
var sSourceAggregation = mSpecificChangeInfo.source.aggregation;
|
|
109
|
+
var sTargetAggregation = mSpecificChangeInfo.target.aggregation;
|
|
110
|
+
var mAdditionalSourceInfo = {
|
|
111
|
+
aggregation: mSpecificChangeInfo.source.aggregation,
|
|
112
|
+
type: oModifier.getControlType(oSourceParent)
|
|
113
|
+
};
|
|
130
114
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
115
|
+
var mAdditionalTargetInfo = {
|
|
116
|
+
aggregation: mSpecificChangeInfo.target.aggregation,
|
|
117
|
+
type: oModifier.getControlType(oTargetParent)
|
|
118
|
+
};
|
|
135
119
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
120
|
+
var mSpecificInfo = {
|
|
121
|
+
source: {
|
|
122
|
+
id: oSourceParent.getId(),
|
|
123
|
+
aggregation: sSourceAggregation,
|
|
124
|
+
type: mAdditionalSourceInfo.type,
|
|
125
|
+
selector: oModifier.getSelector(mSpecificChangeInfo.source.id, oAppComponent, mAdditionalSourceInfo)
|
|
126
|
+
},
|
|
127
|
+
target: {
|
|
128
|
+
id: oTargetParent.getId(),
|
|
129
|
+
aggregation: sTargetAggregation,
|
|
130
|
+
type: mAdditionalTargetInfo.type,
|
|
131
|
+
selector: oModifier.getSelector(mSpecificChangeInfo.target.id, oAppComponent, mAdditionalTargetInfo)
|
|
132
|
+
},
|
|
133
|
+
movedElements: mSpecificChangeInfo.movedElements
|
|
134
|
+
};
|
|
151
135
|
|
|
152
|
-
|
|
153
|
-
});
|
|
136
|
+
return mSpecificInfo;
|
|
154
137
|
}
|
|
155
138
|
|
|
156
139
|
/**
|
|
@@ -170,101 +153,61 @@ function(
|
|
|
170
153
|
* @function
|
|
171
154
|
* @name sap.ui.fl.changeHandler.MoveControls#applyChange
|
|
172
155
|
*/
|
|
173
|
-
MoveControls.applyChange = function(oChange, oRelevantContainer, mPropertyBag) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
.
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
return Promise.resolve();
|
|
229
|
-
})
|
|
230
|
-
.then(function(oRetrievedSourceParent) {
|
|
231
|
-
if (oRetrievedSourceParent) {
|
|
232
|
-
oSourceParent = oRetrievedSourceParent;
|
|
233
|
-
}
|
|
234
|
-
if (iSourceIndex > -1) {
|
|
235
|
-
aRevertData.unshift({
|
|
236
|
-
index: iSourceIndex,
|
|
237
|
-
aggregation: sSourceAggregation,
|
|
238
|
-
sourceParent: oModifier.getSelector(oSourceParent, oAppComponent)
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
if (!bChangeAlreadyPerformed) {
|
|
242
|
-
return Promise.resolve()
|
|
243
|
-
.then(oModifier.removeAggregation.bind(
|
|
244
|
-
oModifier,
|
|
245
|
-
oSourceParent,
|
|
246
|
-
sSourceAggregation,
|
|
247
|
-
oMovedElement
|
|
248
|
-
))
|
|
249
|
-
.then(oModifier.insertAggregation.bind(
|
|
250
|
-
oModifier,
|
|
251
|
-
oTargetParent,
|
|
252
|
-
sTargetAggregation,
|
|
253
|
-
oMovedElement,
|
|
254
|
-
iInsertIndex,
|
|
255
|
-
oView
|
|
256
|
-
));
|
|
257
|
-
}
|
|
258
|
-
return Promise.resolve();
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
aPromises.push(fnPromise);
|
|
262
|
-
}, this);
|
|
263
|
-
return FlUtils.execPromiseQueueSequentially(aPromises, true, true);
|
|
264
|
-
}.bind(this))
|
|
265
|
-
.then(function() {
|
|
266
|
-
oChange.setRevertData(aRevertData);
|
|
267
|
-
});
|
|
156
|
+
MoveControls.applyChange = async function(oChange, oRelevantContainer, mPropertyBag) {
|
|
157
|
+
const oModifier = mPropertyBag.modifier;
|
|
158
|
+
const oView = mPropertyBag.view;
|
|
159
|
+
const oAppComponent = mPropertyBag.appComponent;
|
|
160
|
+
const oChangeContent = oChange.getContent();
|
|
161
|
+
const aRevertData = [];
|
|
162
|
+
let bChangeAlreadyPerformed = false;
|
|
163
|
+
|
|
164
|
+
checkConditions(oChange, oModifier, oView, oAppComponent);
|
|
165
|
+
for (const mMovedElement of oChangeContent.movedElements) {
|
|
166
|
+
const oMovedElement = await getElementControlOrThrowError(mMovedElement, oModifier, oAppComponent, oView);
|
|
167
|
+
let oSourceParent = oModifier.getParent(oMovedElement);
|
|
168
|
+
// mPropertyBag.sourceAggregation and mPropertyBag.targetAggregation should always be used when available
|
|
169
|
+
let sSourceAggregation =
|
|
170
|
+
mPropertyBag.sourceAggregation || await oModifier.getParentAggregationName(oMovedElement, oSourceParent);
|
|
171
|
+
const oTargetParent = await oModifier.bySelector(oChangeContent.target.selector, oAppComponent, oView);
|
|
172
|
+
const sTargetAggregation = mPropertyBag.targetAggregation || oChangeContent.target.selector.aggregation;
|
|
173
|
+
// save the current index, sourceParent and sourceAggregation for revert
|
|
174
|
+
let iSourceIndex = await oModifier.findIndexInParentAggregation(oMovedElement);
|
|
175
|
+
const iInsertIndex = mMovedElement.targetIndex;
|
|
176
|
+
if (iSourceIndex > -1) {
|
|
177
|
+
// if iIndex === iInsertIndex and source===target the operation was already performed (e.g. drag&drop in RTA)
|
|
178
|
+
// in this case we need the sourceIndex and sourceParent that is saved in the change in order to revert it
|
|
179
|
+
// to the correct index and we can't use the current aggregations/parents
|
|
180
|
+
if (
|
|
181
|
+
iSourceIndex === iInsertIndex &&
|
|
182
|
+
sSourceAggregation === sTargetAggregation &&
|
|
183
|
+
oModifier.getParent(oMovedElement) === oTargetParent
|
|
184
|
+
) {
|
|
185
|
+
iSourceIndex = mMovedElement.sourceIndex;
|
|
186
|
+
sSourceAggregation = mPropertyBag.sourceAggregation || oChangeContent.source.selector.aggregation;
|
|
187
|
+
bChangeAlreadyPerformed = true;
|
|
188
|
+
oSourceParent = await oModifier.bySelector(oChangeContent.source.selector, oAppComponent, oView) || oSourceParent;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (iSourceIndex > -1) {
|
|
192
|
+
aRevertData.unshift({
|
|
193
|
+
index: iSourceIndex,
|
|
194
|
+
aggregation: sSourceAggregation,
|
|
195
|
+
sourceParent: oModifier.getSelector(oSourceParent, oAppComponent)
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
if (!bChangeAlreadyPerformed) {
|
|
199
|
+
await oModifier.moveAggregation(
|
|
200
|
+
oSourceParent,
|
|
201
|
+
sSourceAggregation,
|
|
202
|
+
oTargetParent,
|
|
203
|
+
sTargetAggregation,
|
|
204
|
+
oMovedElement,
|
|
205
|
+
iInsertIndex,
|
|
206
|
+
oView
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
oChange.setRevertData(aRevertData);
|
|
268
211
|
};
|
|
269
212
|
|
|
270
213
|
/**
|
|
@@ -282,7 +225,7 @@ function(
|
|
|
282
225
|
* @function
|
|
283
226
|
* @name sap.ui.fl.changeHandler.MoveControls#revertChange
|
|
284
227
|
*/
|
|
285
|
-
MoveControls.revertChange = function(oChange, oRelevantContainer, mPropertyBag) {
|
|
228
|
+
MoveControls.revertChange = async function(oChange, oRelevantContainer, mPropertyBag) {
|
|
286
229
|
var oModifier = mPropertyBag.modifier;
|
|
287
230
|
var oView = mPropertyBag.view;
|
|
288
231
|
var oAppComponent = mPropertyBag.appComponent;
|
|
@@ -291,62 +234,38 @@ function(
|
|
|
291
234
|
// because for XML changes this data can't be stored in the revertData yet.
|
|
292
235
|
var oChangeContent = oChange.getContent();
|
|
293
236
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
var mRevertData = aRevertData[iElementIndex];
|
|
327
|
-
sSourceAggregation = mRevertData.aggregation;
|
|
328
|
-
iInsertIndex = mRevertData.index;
|
|
329
|
-
return oModifier.bySelector(mRevertData.sourceParent, oAppComponent, oView);
|
|
330
|
-
}
|
|
331
|
-
return Promise.resolve();
|
|
332
|
-
})
|
|
333
|
-
.then(function(oRetrievedSourceParent) {
|
|
334
|
-
if (oRetrievedSourceParent) {
|
|
335
|
-
oSourceParent = oRetrievedSourceParent;
|
|
336
|
-
}
|
|
337
|
-
return oModifier.removeAggregation(oTargetParent, sTargetAggregation, oMovedElement);
|
|
338
|
-
})
|
|
339
|
-
.then(function() {
|
|
340
|
-
return oModifier.insertAggregation(oSourceParent, sSourceAggregation, oMovedElement, iInsertIndex, oView);
|
|
341
|
-
});
|
|
342
|
-
}.bind(this);
|
|
343
|
-
aPromises.push(fnPromise);
|
|
344
|
-
}, this);
|
|
345
|
-
return FlUtils.execPromiseQueueSequentially(aPromises, true, true);
|
|
346
|
-
}.bind(this))
|
|
347
|
-
.then(function() {
|
|
348
|
-
oChange.resetRevertData();
|
|
349
|
-
});
|
|
237
|
+
checkConditions(oChange, oModifier, oView, oAppComponent);
|
|
238
|
+
let oSourceParent = await oModifier.bySelector(oChangeContent.source.selector, oAppComponent, oView);
|
|
239
|
+
const oTargetParent = await oModifier.bySelector(oChangeContent.target.selector, oAppComponent, oView);
|
|
240
|
+
let sSourceAggregation = oChangeContent.source.selector.aggregation;
|
|
241
|
+
const sTargetAggregation = oChangeContent.target.selector.aggregation;
|
|
242
|
+
const aRevertData = oChange.getRevertData();
|
|
243
|
+
oChangeContent.movedElements.reverse();
|
|
244
|
+
let iElementIndex = 0;
|
|
245
|
+
for (const mMovedElement of oChangeContent.movedElements) {
|
|
246
|
+
const oMovedElement = await getElementControlOrThrowError(mMovedElement, oModifier, oAppComponent, oView);
|
|
247
|
+
if (!oMovedElement) {
|
|
248
|
+
throw new Error("Element to move not found");
|
|
249
|
+
}
|
|
250
|
+
let iInsertIndex = mMovedElement.sourceIndex;
|
|
251
|
+
if (aRevertData) {
|
|
252
|
+
var mRevertData = aRevertData[iElementIndex];
|
|
253
|
+
sSourceAggregation = mRevertData.aggregation;
|
|
254
|
+
iInsertIndex = mRevertData.index;
|
|
255
|
+
oSourceParent = await oModifier.bySelector(mRevertData.sourceParent, oAppComponent, oView) || oSourceParent;
|
|
256
|
+
}
|
|
257
|
+
await oModifier.moveAggregation(
|
|
258
|
+
oTargetParent,
|
|
259
|
+
sTargetAggregation,
|
|
260
|
+
oSourceParent,
|
|
261
|
+
sSourceAggregation,
|
|
262
|
+
oMovedElement,
|
|
263
|
+
iInsertIndex,
|
|
264
|
+
oView
|
|
265
|
+
);
|
|
266
|
+
iElementIndex++;
|
|
267
|
+
}
|
|
268
|
+
oChange.resetRevertData();
|
|
350
269
|
};
|
|
351
270
|
|
|
352
271
|
/**
|
|
@@ -362,47 +281,36 @@ function(
|
|
|
362
281
|
* @function
|
|
363
282
|
* @name sap.ui.fl.changeHandler.MoveControls#completeChangeContent
|
|
364
283
|
*/
|
|
365
|
-
MoveControls.completeChangeContent = function(oChange, mSpecificChangeInfo, mPropertyBag) {
|
|
284
|
+
MoveControls.completeChangeContent = async function(oChange, mSpecificChangeInfo, mPropertyBag) {
|
|
366
285
|
var oModifier = mPropertyBag.modifier;
|
|
367
286
|
var oAppComponent = mPropertyBag.appComponent;
|
|
368
287
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
};
|
|
288
|
+
checkCompleteChangeContentConditions(mSpecificChangeInfo);
|
|
289
|
+
const mCompleteSpecificChangeInfo = await completeSpecificChangeInfo(oModifier, mSpecificChangeInfo, oAppComponent);
|
|
290
|
+
var oContent = {
|
|
291
|
+
movedElements: [],
|
|
292
|
+
source: {
|
|
293
|
+
selector: mCompleteSpecificChangeInfo.source.selector
|
|
294
|
+
},
|
|
295
|
+
target: {
|
|
296
|
+
selector: mCompleteSpecificChangeInfo.target.selector
|
|
297
|
+
}
|
|
298
|
+
};
|
|
381
299
|
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
.
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
.then(function(oElement) {
|
|
389
|
-
oContent.movedElements.push({
|
|
390
|
-
selector: oModifier.getSelector(oElement, oAppComponent),
|
|
391
|
-
sourceIndex: mElement.sourceIndex,
|
|
392
|
-
targetIndex: mElement.targetIndex
|
|
393
|
-
});
|
|
394
|
-
oChange.addDependentControl(mSpecificChangeInfo.source.id, MoveControls.SOURCE_ALIAS, mPropertyBag);
|
|
395
|
-
oChange.addDependentControl(mSpecificChangeInfo.target.id, MoveControls.TARGET_ALIAS, mPropertyBag);
|
|
396
|
-
oChange.addDependentControl(mSpecificChangeInfo.movedElements.map(function(element) {
|
|
397
|
-
return element.id;
|
|
398
|
-
}), MoveControls.MOVED_ELEMENTS_ALIAS, mPropertyBag);
|
|
399
|
-
});
|
|
400
|
-
aPromises.push(oPromise);
|
|
401
|
-
});
|
|
402
|
-
return Promise.all(aPromises).then(function() {
|
|
403
|
-
oChange.setContent(oContent);
|
|
300
|
+
for (const mElement of mCompleteSpecificChangeInfo.movedElements) {
|
|
301
|
+
const oElement = mElement.element || await oModifier.bySelector(mElement.id, oAppComponent);
|
|
302
|
+
oContent.movedElements.push({
|
|
303
|
+
selector: oModifier.getSelector(oElement, oAppComponent),
|
|
304
|
+
sourceIndex: mElement.sourceIndex,
|
|
305
|
+
targetIndex: mElement.targetIndex
|
|
404
306
|
});
|
|
405
|
-
|
|
307
|
+
oChange.addDependentControl(mCompleteSpecificChangeInfo.source.id, MoveControls.SOURCE_ALIAS, mPropertyBag);
|
|
308
|
+
oChange.addDependentControl(mCompleteSpecificChangeInfo.target.id, MoveControls.TARGET_ALIAS, mPropertyBag);
|
|
309
|
+
oChange.addDependentControl(mCompleteSpecificChangeInfo.movedElements.map(function(element) {
|
|
310
|
+
return element.id;
|
|
311
|
+
}), MoveControls.MOVED_ELEMENTS_ALIAS, mPropertyBag);
|
|
312
|
+
}
|
|
313
|
+
oChange.setContent(oContent);
|
|
406
314
|
};
|
|
407
315
|
|
|
408
316
|
/**
|