@openui5/sap.ui.rta 1.123.1 → 1.124.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/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +1 -1
- package/src/sap/ui/rta/RuntimeAuthoring.js +1 -1
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +4 -4
- package/src/sap/ui/rta/command/AddProperty.js +1 -1
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +1 -1
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/CreateContainer.js +1 -1
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +1 -1
- package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/Resize.js +1 -1
- package/src/sap/ui/rta/command/Reveal.js +1 -1
- package/src/sap/ui/rta/command/Settings.js +1 -1
- package/src/sap/ui/rta/command/Split.js +1 -1
- package/src/sap/ui/rta/command/Stack.js +1 -1
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/TestDelegate.js +23 -4
- package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +10 -4
- package/src/sap/ui/rta/messagebundle_ar.properties +5 -2
- package/src/sap/ui/rta/messagebundle_bg.properties +6 -3
- package/src/sap/ui/rta/messagebundle_ca.properties +5 -2
- package/src/sap/ui/rta/messagebundle_cnr.properties +5 -2
- package/src/sap/ui/rta/messagebundle_cs.properties +5 -2
- package/src/sap/ui/rta/messagebundle_cy.properties +6 -3
- package/src/sap/ui/rta/messagebundle_da.properties +5 -2
- package/src/sap/ui/rta/messagebundle_de.properties +6 -3
- package/src/sap/ui/rta/messagebundle_el.properties +6 -3
- package/src/sap/ui/rta/messagebundle_en.properties +5 -326
- package/src/sap/ui/rta/messagebundle_en_GB.properties +6 -3
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +5 -3
- package/src/sap/ui/rta/messagebundle_es.properties +5 -2
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -2
- package/src/sap/ui/rta/messagebundle_et.properties +5 -2
- package/src/sap/ui/rta/messagebundle_fi.properties +6 -3
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -2
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -2
- package/src/sap/ui/rta/messagebundle_hi.properties +5 -2
- package/src/sap/ui/rta/messagebundle_hr.properties +6 -3
- package/src/sap/ui/rta/messagebundle_hu.properties +6 -3
- package/src/sap/ui/rta/messagebundle_id.properties +6 -3
- package/src/sap/ui/rta/messagebundle_it.properties +6 -3
- package/src/sap/ui/rta/messagebundle_iw.properties +6 -3
- package/src/sap/ui/rta/messagebundle_ja.properties +6 -3
- package/src/sap/ui/rta/messagebundle_kk.properties +5 -2
- package/src/sap/ui/rta/messagebundle_ko.properties +5 -2
- package/src/sap/ui/rta/messagebundle_lt.properties +6 -3
- package/src/sap/ui/rta/messagebundle_lv.properties +5 -2
- package/src/sap/ui/rta/messagebundle_mk.properties +7 -4
- package/src/sap/ui/rta/messagebundle_ms.properties +6 -3
- package/src/sap/ui/rta/messagebundle_nl.properties +5 -2
- package/src/sap/ui/rta/messagebundle_no.properties +5 -2
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -2
- package/src/sap/ui/rta/messagebundle_pt.properties +6 -3
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +6 -3
- package/src/sap/ui/rta/messagebundle_ro.properties +6 -3
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -2
- package/src/sap/ui/rta/messagebundle_sh.properties +107 -104
- package/src/sap/ui/rta/messagebundle_sk.properties +5 -2
- package/src/sap/ui/rta/messagebundle_sl.properties +7 -4
- package/src/sap/ui/rta/messagebundle_sr.properties +5 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +5 -2
- package/src/sap/ui/rta/messagebundle_th.properties +5 -2
- package/src/sap/ui/rta/messagebundle_tr.properties +5 -2
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -2
- package/src/sap/ui/rta/messagebundle_vi.properties +6 -3
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -2
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +5 -2
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +1 -1
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +5 -4
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +1 -1
- package/src/sap/ui/rta/plugin/Settings.js +1 -1
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +110 -134
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +14 -11
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +126 -24
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +19 -9
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +44 -30
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
- package/src/sap/ui/rta/service/Outline.js +1 -1
- package/src/sap/ui/rta/service/Property.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +1 -1
- package/src/sap/ui/rta/service/SupportTools.js +1 -1
- package/src/sap/ui/rta/themes/base/AddIFrame.less +0 -5
- package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +24 -9
- package/src/sap/ui/rta/util/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +6 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/ServiceManager.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +0 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +1 -1
|
@@ -34,29 +34,11 @@ sap.ui.define([
|
|
|
34
34
|
* handled by the AdditionalElements Plugin (Reveal, Add Via Delegate, Add Custom)
|
|
35
35
|
*
|
|
36
36
|
* @author SAP SE
|
|
37
|
-
* @version 1.
|
|
37
|
+
* @version 1.124.0
|
|
38
38
|
* @private
|
|
39
39
|
* @since 1.94
|
|
40
40
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
function loadKnownDefaultDelegateLibraries() {
|
|
44
|
-
var aLoadLibraryPromises = [];
|
|
45
|
-
var aRequiredLibraries = DelegateMediatorAPI.getKnownDefaultDelegateLibraries();
|
|
46
|
-
aRequiredLibraries.forEach(function(sLibrary) {
|
|
47
|
-
var oLoadLibraryPromise = Lib.load({name: sLibrary})
|
|
48
|
-
.then(function() {
|
|
49
|
-
return Promise.resolve(sLibrary);
|
|
50
|
-
})
|
|
51
|
-
.catch(function(vError) {
|
|
52
|
-
Log.warning("Required library not available: ", vError);
|
|
53
|
-
// Ignore the error here as the default delegate might not be required
|
|
54
|
-
return Promise.resolve();
|
|
55
|
-
});
|
|
56
|
-
aLoadLibraryPromises.push(oLoadLibraryPromise);
|
|
57
|
-
});
|
|
58
|
-
return Promise.all(aLoadLibraryPromises);
|
|
59
|
-
}
|
|
41
|
+
const ActionExtractor = {};
|
|
60
42
|
|
|
61
43
|
function getAddViaDelegateActionData(mAction, oDesignTimeMetadata, oPlugin) {
|
|
62
44
|
return oPlugin.hasChangeHandler(mAction.changeType, mAction.element)
|
|
@@ -82,23 +64,23 @@ sap.ui.define([
|
|
|
82
64
|
}
|
|
83
65
|
|
|
84
66
|
function getInvisibleElements(oParentOverlay, sAggregationName, oPlugin) {
|
|
85
|
-
|
|
67
|
+
const oParentElement = oParentOverlay.getElement();
|
|
86
68
|
if (!oParentElement) {
|
|
87
69
|
return [];
|
|
88
70
|
}
|
|
89
71
|
|
|
90
72
|
// Returns a list of all invisible elements belonging to an aggregation including the aggregation name
|
|
91
|
-
|
|
92
|
-
|
|
73
|
+
const aInvisibleElements = ElementUtil.getAggregation(oParentElement, sAggregationName, oPlugin).filter(function(oControl) {
|
|
74
|
+
const oOverlay = OverlayRegistry.getOverlay(oControl);
|
|
93
75
|
|
|
94
76
|
if (!oPlugin.hasStableId(oOverlay)) {
|
|
95
77
|
return false;
|
|
96
78
|
}
|
|
97
79
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
80
|
+
const oRelevantContainer = oParentOverlay.getRelevantContainer(true);
|
|
81
|
+
const oRelevantContainerOverlay = OverlayRegistry.getOverlay(oRelevantContainer);
|
|
82
|
+
let oOverlayToCheck = oParentOverlay;
|
|
83
|
+
let bAnyParentInvisible = false;
|
|
102
84
|
// check all the parents until the relevantContainerOverlay for invisibility
|
|
103
85
|
do {
|
|
104
86
|
bAnyParentInvisible = !oOverlayToCheck.getElementVisibility();
|
|
@@ -132,7 +114,7 @@ sap.ui.define([
|
|
|
132
114
|
}
|
|
133
115
|
|
|
134
116
|
function isValidAction(oCheckElementOverlay, mParents, mAction, oPlugin) {
|
|
135
|
-
|
|
117
|
+
let bValidAction = mAction.changeType && oPlugin.hasStableId(oCheckElementOverlay);
|
|
136
118
|
if (bValidAction && oCheckElementOverlay !== mParents.relevantContainerOverlay) {
|
|
137
119
|
// relevant container is needed for some changes, so it must have a stable ID
|
|
138
120
|
bValidAction = oPlugin.hasStableId(mParents.relevantContainerOverlay);
|
|
@@ -140,71 +122,22 @@ sap.ui.define([
|
|
|
140
122
|
return bValidAction;
|
|
141
123
|
}
|
|
142
124
|
|
|
143
|
-
function filterValidAddPropertyActions(aActions, mParents, oPlugin, aDefaultDelegateLibraries) {
|
|
144
|
-
function fnFilterActions(aFilteredActions, mAction) {
|
|
145
|
-
var oCheckElement = mAction.changeOnRelevantContainer ? mParents.relevantContainer : mParents.parent;
|
|
146
|
-
var oCheckElementOverlay = OverlayRegistry.getOverlay(oCheckElement);
|
|
147
|
-
var bValidAction = isValidAction(oCheckElementOverlay, mParents, mAction, oPlugin);
|
|
148
|
-
if (bValidAction) {
|
|
149
|
-
mAction.element = oCheckElement;
|
|
150
|
-
return DelegateMediatorAPI.getDelegateForControl({
|
|
151
|
-
control: mParents.relevantContainer, // delegate will always be added on the relevant container
|
|
152
|
-
modifier: JsControlTreeModifier,
|
|
153
|
-
supportsDefault: mAction.supportsDefaultDelegate
|
|
154
|
-
})
|
|
155
|
-
.then(function(mDelegateInfo) {
|
|
156
|
-
// Only complete delegators can be used for additional elements
|
|
157
|
-
if (
|
|
158
|
-
mDelegateInfo &&
|
|
159
|
-
mDelegateInfo.names &&
|
|
160
|
-
mDelegateInfo.names.length &&
|
|
161
|
-
mDelegateInfo.delegateType === DelegateMediatorAPI.types.COMPLETE
|
|
162
|
-
) {
|
|
163
|
-
var aRequiredLibraries = DelegateMediatorAPI.getRequiredLibrariesForDefaultDelegate({
|
|
164
|
-
delegateName: mDelegateInfo.names,
|
|
165
|
-
control: mParents.relevantContainer
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
// Check if all required libraries were successfully loaded
|
|
169
|
-
if (
|
|
170
|
-
difference(
|
|
171
|
-
aRequiredLibraries,
|
|
172
|
-
aDefaultDelegateLibraries.filter(Boolean)
|
|
173
|
-
).length === 0
|
|
174
|
-
) {
|
|
175
|
-
mAction.delegateInfo = mDelegateInfo;
|
|
176
|
-
aFilteredActions.push(mAction);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
return aFilteredActions;
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
return aFilteredActions;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return aActions.reduce(function(oPreviousActionsPromise, mAction) {
|
|
186
|
-
return oPreviousActionsPromise
|
|
187
|
-
.then(function(aFilteredActions) {
|
|
188
|
-
return fnFilterActions(aFilteredActions, mAction);
|
|
189
|
-
});
|
|
190
|
-
}, Promise.resolve([]));
|
|
191
|
-
}
|
|
192
|
-
|
|
193
125
|
// Return all elements that can be made visible in each aggregation (including elements from other aggregations)
|
|
194
126
|
function getRevealActionFromAggregations(aParents, _mReveal, sAggregationName, aAggregationNames, oPlugin) {
|
|
195
|
-
|
|
196
|
-
|
|
127
|
+
const aInvisibleElements = aParents.reduce(function(aInvisibleChildren, oParentOverlay) {
|
|
128
|
+
let aInvisibleChildrenPerAggregation = [];
|
|
197
129
|
aAggregationNames.forEach(function(sAggregation) {
|
|
198
|
-
aInvisibleChildrenPerAggregation = aInvisibleChildrenPerAggregation.concat(
|
|
130
|
+
aInvisibleChildrenPerAggregation = aInvisibleChildrenPerAggregation.concat(
|
|
131
|
+
getInvisibleElements.call(this, oParentOverlay, sAggregation, oPlugin));
|
|
199
132
|
}.bind(this), []);
|
|
200
133
|
return oParentOverlay ? aInvisibleChildren.concat(aInvisibleChildrenPerAggregation) : aInvisibleChildren;
|
|
201
134
|
}.bind(this), []);
|
|
202
135
|
|
|
203
|
-
|
|
136
|
+
const oInitialRevealObject = {
|
|
204
137
|
elements: [],
|
|
205
138
|
controlTypeNames: []
|
|
206
139
|
};
|
|
207
|
-
|
|
140
|
+
const mRevealPromise = aInvisibleElements.reduce(function(oPreviousPromise, mInvisibleElement) {
|
|
208
141
|
return oPreviousPromise.then(function(mReveal) {
|
|
209
142
|
return checkAndEnrichReveal(mReveal, mInvisibleElement, oPlugin, sAggregationName);
|
|
210
143
|
});
|
|
@@ -220,29 +153,80 @@ sap.ui.define([
|
|
|
220
153
|
});
|
|
221
154
|
}
|
|
222
155
|
|
|
156
|
+
function filterValidAddPropertyActions(aActions, mParents, oPlugin) {
|
|
157
|
+
return aActions.filter((mAction) => {
|
|
158
|
+
const oCheckElement = mAction.changeOnRelevantContainer ? mParents.relevantContainer : mParents.parent;
|
|
159
|
+
const oCheckElementOverlay = OverlayRegistry.getOverlay(oCheckElement);
|
|
160
|
+
return isValidAction(oCheckElementOverlay, mParents, mAction, oPlugin);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function loadRequiredLibraries(mRequiredLibraries) {
|
|
165
|
+
const aRequiredLibraries = Object.keys(mRequiredLibraries || {});
|
|
166
|
+
const aRequireLibrariesPromise = [];
|
|
167
|
+
aRequiredLibraries.forEach((sLibrary) => {
|
|
168
|
+
aRequireLibrariesPromise.push(
|
|
169
|
+
Lib.load({name: sLibrary})
|
|
170
|
+
);
|
|
171
|
+
});
|
|
172
|
+
return Promise.all(aRequireLibrariesPromise)
|
|
173
|
+
.then(() => true)
|
|
174
|
+
.catch((vError) => {
|
|
175
|
+
Log.error("Required library not available: ", vError);
|
|
176
|
+
// Ignore the error here as the write delegate might not be required
|
|
177
|
+
return false;
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function filterValidDelegateForAction(aActions, mParents) {
|
|
182
|
+
const oFilterPromise = aActions.reduce(async function(aValidActionPromiseChain, mAction) {
|
|
183
|
+
const aValidActions = await aValidActionPromiseChain;
|
|
184
|
+
const oCheckElement = mAction.changeOnRelevantContainer ? mParents.relevantContainer : mParents.parent;
|
|
185
|
+
const mReadDelegateInfo = await DelegateMediatorAPI.getReadDelegateForControl({
|
|
186
|
+
control: oCheckElement,
|
|
187
|
+
modifier: JsControlTreeModifier
|
|
188
|
+
});
|
|
189
|
+
const mWriteDelegateInfo = await DelegateMediatorAPI.getWriteDelegateForControl({
|
|
190
|
+
control: oCheckElement,
|
|
191
|
+
modifier: JsControlTreeModifier
|
|
192
|
+
});
|
|
193
|
+
const bAllRequiredLibrariesLoaded = await loadRequiredLibraries(mWriteDelegateInfo?.requiredLibraries);
|
|
194
|
+
if (mReadDelegateInfo?.instance && mWriteDelegateInfo?.controlType && bAllRequiredLibrariesLoaded) {
|
|
195
|
+
mAction.element = oCheckElement;
|
|
196
|
+
mAction.delegateInfo = mReadDelegateInfo;
|
|
197
|
+
mAction.delegateInfo.requiredLibraries = mWriteDelegateInfo.requiredLibraries; // required for addLibrary command
|
|
198
|
+
aValidActions.push(mAction);
|
|
199
|
+
}
|
|
200
|
+
return aValidActions;
|
|
201
|
+
}, Promise.resolve([]));
|
|
202
|
+
|
|
203
|
+
return oFilterPromise;
|
|
204
|
+
}
|
|
205
|
+
|
|
223
206
|
function checkAndEnrichReveal(mReveal, mInvisibleElement, oPlugin, sTargetAggregation) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
207
|
+
const oInvisibleElement = mInvisibleElement.element;
|
|
208
|
+
let oDesignTimeMetadata;
|
|
209
|
+
let mRevealAction;
|
|
210
|
+
let bRevealEnabled = false;
|
|
211
|
+
let oHasChangeHandlerPromise = Promise.resolve(false);
|
|
212
|
+
const sSourceAggregation = mInvisibleElement.sourceAggregation;
|
|
213
|
+
|
|
214
|
+
const oOverlay = OverlayRegistry.getOverlay(oInvisibleElement);
|
|
232
215
|
if (oOverlay) {
|
|
233
216
|
oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
234
217
|
|
|
235
218
|
mRevealAction = oDesignTimeMetadata && oDesignTimeMetadata.getAction("reveal", oInvisibleElement);
|
|
236
219
|
if (mRevealAction && mRevealAction.changeType) {
|
|
237
|
-
|
|
220
|
+
let oRevealSelector = oInvisibleElement;
|
|
238
221
|
if (mRevealAction.changeOnRelevantContainer) {
|
|
239
222
|
oRevealSelector = oOverlay.getRelevantContainer();
|
|
240
223
|
}
|
|
241
224
|
|
|
242
|
-
oHasChangeHandlerPromise = oPlugin.hasChangeHandler(mRevealAction.changeType, oRevealSelector)
|
|
225
|
+
oHasChangeHandlerPromise = oPlugin.hasChangeHandler(mRevealAction.changeType, oRevealSelector)
|
|
226
|
+
.then(function(bHasChangeHandler) {
|
|
243
227
|
// Element can be made invalid while the check is running (e.g. destroyed during undo of split)
|
|
244
228
|
if (ElementUtil.isElementValid(oInvisibleElement)) {
|
|
245
|
-
|
|
229
|
+
const mParents = AdditionalElementsUtils.getParents(true, oOverlay, oPlugin);
|
|
246
230
|
if (bHasChangeHandler) {
|
|
247
231
|
if (mRevealAction.changeOnRelevantContainer) {
|
|
248
232
|
// we have the child overlay, so we need the parents
|
|
@@ -255,7 +239,7 @@ sap.ui.define([
|
|
|
255
239
|
|
|
256
240
|
// Check if the invisible element can be moved to the target aggregation
|
|
257
241
|
if (bRevealEnabled && (sSourceAggregation !== sTargetAggregation)) {
|
|
258
|
-
|
|
242
|
+
const oAggregationOverlay = mParents.parentOverlay.getAggregationOverlay(sTargetAggregation);
|
|
259
243
|
return Utils.checkTargetZone(oAggregationOverlay, oOverlay, oPlugin);
|
|
260
244
|
}
|
|
261
245
|
}
|
|
@@ -274,7 +258,7 @@ sap.ui.define([
|
|
|
274
258
|
sourceAggregation: sSourceAggregation,
|
|
275
259
|
targetAggregation: sTargetAggregation
|
|
276
260
|
});
|
|
277
|
-
|
|
261
|
+
const mName = oDesignTimeMetadata.getName(oInvisibleElement);
|
|
278
262
|
if (mName) {
|
|
279
263
|
mReveal.controlTypeNames.push(mName);
|
|
280
264
|
}
|
|
@@ -310,24 +294,25 @@ sap.ui.define([
|
|
|
310
294
|
* @param {sap.ui.dt.ElementOverlay} oSourceElementOverlay - Elements will be added in relation (sibling/parent) to this overlay
|
|
311
295
|
* @param {sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin} oPlugin - Instance of the AdditionalElementsPlugin
|
|
312
296
|
* @param {boolean} [bInvalidate] - Option to prevent cached actions to be returned
|
|
297
|
+
* @param {sap.ui.dt.DesignTime} oDesignTime - DesignTime instance
|
|
313
298
|
*
|
|
314
299
|
* @return {Promise} Resolving to a structure with all "add/reveal" action relevant data collected
|
|
315
300
|
*/
|
|
316
301
|
ActionExtractor.getActions = function(bSibling, oSourceElementOverlay, oPlugin, bInvalidate, oDesignTime) {
|
|
317
|
-
|
|
302
|
+
const sSiblingOrChild = bSibling ? "asSibling" : "asChild";
|
|
318
303
|
if (!bInvalidate && oSourceElementOverlay._mAddActions) {
|
|
319
304
|
return Promise.resolve(oSourceElementOverlay._mAddActions[sSiblingOrChild]);
|
|
320
305
|
}
|
|
321
306
|
|
|
322
|
-
|
|
323
|
-
|
|
307
|
+
const oRevealActionsPromise = this._getRevealActions(bSibling, oSourceElementOverlay, oPlugin, oDesignTime);
|
|
308
|
+
const oAddPropertyActionsPromise = this._getAddViaDelegateActions(bSibling, oSourceElementOverlay, oPlugin);
|
|
324
309
|
|
|
325
310
|
return Promise.all([
|
|
326
311
|
oRevealActionsPromise,
|
|
327
312
|
oAddPropertyActionsPromise
|
|
328
313
|
]).then(function(aAllActions) {
|
|
329
314
|
// join and condense all action data
|
|
330
|
-
|
|
315
|
+
const mAllActions = merge(aAllActions[0], aAllActions[1]);
|
|
331
316
|
oSourceElementOverlay._mAddActions ||= {asSibling: {}, asChild: {}};
|
|
332
317
|
oSourceElementOverlay._mAddActions[sSiblingOrChild] = mAllActions;
|
|
333
318
|
return mAllActions;
|
|
@@ -341,18 +326,19 @@ sap.ui.define([
|
|
|
341
326
|
* @returns {object/undefined} - Object with all "add/reveal" action relevant data collected or undefined if no actions available
|
|
342
327
|
*/
|
|
343
328
|
ActionExtractor.getActionsOrUndef = function(bSibling, oOverlay) {
|
|
344
|
-
|
|
329
|
+
const sSiblingOrChild = bSibling ? "asSibling" : "asChild";
|
|
345
330
|
return oOverlay._mAddActions && oOverlay._mAddActions[sSiblingOrChild];
|
|
346
331
|
};
|
|
347
332
|
|
|
348
|
-
|
|
349
|
-
|
|
333
|
+
let mRevealCache = {};
|
|
334
|
+
let bIsSyncRegistered = true;
|
|
350
335
|
|
|
351
336
|
/**
|
|
352
337
|
* Returns the Reveal actions data (parameters + elements) for an Overlay
|
|
353
338
|
* @param {boolean} bSibling - If source element overlay should be sibling or parent to the newly added fields
|
|
354
339
|
* @param {sap.ui.dt.ElementOverlay} oSourceElementOverlay - Overlay where the action is triggered
|
|
355
340
|
* @param {sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin} oPlugin - Instance of the AdditionalElements plugin
|
|
341
|
+
* @param {sap.ui.dt.DesignTime} oDesignTime - DesignTime instance
|
|
356
342
|
*
|
|
357
343
|
* @returns {Promise<object>} Reveal action data
|
|
358
344
|
*/
|
|
@@ -365,8 +351,8 @@ sap.ui.define([
|
|
|
365
351
|
}, this);
|
|
366
352
|
}
|
|
367
353
|
|
|
368
|
-
|
|
369
|
-
|
|
354
|
+
const mParents = AdditionalElementsUtils.getParents(bSibling, oSourceElementOverlay, oPlugin);
|
|
355
|
+
let aParents = [mParents.parentOverlay];
|
|
370
356
|
if (mParents.relevantContainer !== mParents.parent) {
|
|
371
357
|
aParents = ElementUtil.findAllSiblingsInContainer(mParents.parent, mParents.relevantContainer).map(function(oParent) {
|
|
372
358
|
return OverlayRegistry.getOverlay(oParent);
|
|
@@ -374,9 +360,9 @@ sap.ui.define([
|
|
|
374
360
|
return oOverlay;
|
|
375
361
|
});
|
|
376
362
|
}
|
|
377
|
-
|
|
363
|
+
let aAggregationNames = [];
|
|
378
364
|
if (mParents.parentOverlay) {
|
|
379
|
-
|
|
365
|
+
const mCachedResult = mRevealCache[mParents.parentOverlay.getId()];
|
|
380
366
|
if (mCachedResult && bSibling) {
|
|
381
367
|
return mCachedResult;
|
|
382
368
|
}
|
|
@@ -408,34 +394,24 @@ sap.ui.define([
|
|
|
408
394
|
*
|
|
409
395
|
* @returns {Promise<object>} AddViaDelegate action data
|
|
410
396
|
*/
|
|
411
|
-
ActionExtractor._getAddViaDelegateActions = function(bSibling, oSourceElementOverlay, oPlugin) {
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
397
|
+
ActionExtractor._getAddViaDelegateActions = async function(bSibling, oSourceElementOverlay, oPlugin) {
|
|
398
|
+
const mParents = AdditionalElementsUtils.getParents(bSibling, oSourceElementOverlay, oPlugin);
|
|
399
|
+
const oDesignTimeMetadata = mParents.parentOverlay && mParents.parentOverlay.getDesignTimeMetadata();
|
|
400
|
+
let aActions = oDesignTimeMetadata
|
|
401
|
+
? await oDesignTimeMetadata.getActionDataFromAggregations("add", mParents.parent, undefined, "delegate")
|
|
402
|
+
: [];
|
|
403
|
+
aActions = await filterValidAddPropertyActions(aActions, mParents, oPlugin);
|
|
404
|
+
aActions = await filterValidDelegateForAction(aActions, mParents);
|
|
405
|
+
return aActions.reduce(async function(oPreviousPromise, oAction) {
|
|
406
|
+
const oReturn = await oPreviousPromise;
|
|
407
|
+
const mAction = await getAddViaDelegateActionData.call(this, oAction, oDesignTimeMetadata, oPlugin);
|
|
408
|
+
if (mAction) {
|
|
409
|
+
mAction.addPropertyActionData.relevantContainer = mParents.relevantContainer;
|
|
410
|
+
oReturn[mAction.aggregationName] ||= {};
|
|
411
|
+
oReturn[mAction.aggregationName].addViaDelegate = mAction.addPropertyActionData;
|
|
420
412
|
}
|
|
421
|
-
return
|
|
422
|
-
}.bind(this))
|
|
423
|
-
.then(function(aActions) {
|
|
424
|
-
return aActions.reduce(function(oPreviousPromise, oAction) {
|
|
425
|
-
return oPreviousPromise
|
|
426
|
-
.then(function(oReturn) {
|
|
427
|
-
return getAddViaDelegateActionData.call(this, oAction, oDesignTimeMetadata, oPlugin)
|
|
428
|
-
.then(function(mAction) {
|
|
429
|
-
if (mAction) {
|
|
430
|
-
mAction.addPropertyActionData.relevantContainer = mParents.relevantContainer;
|
|
431
|
-
oReturn[mAction.aggregationName] ||= {};
|
|
432
|
-
oReturn[mAction.aggregationName].addViaDelegate = mAction.addPropertyActionData;
|
|
433
|
-
}
|
|
434
|
-
return oReturn;
|
|
435
|
-
});
|
|
436
|
-
}.bind(this));
|
|
437
|
-
}.bind(this), Promise.resolve({}));
|
|
438
|
-
}.bind(this));
|
|
413
|
+
return oReturn;
|
|
414
|
+
}.bind(this), Promise.resolve({}));
|
|
439
415
|
};
|
|
440
416
|
|
|
441
417
|
return ActionExtractor;
|
|
@@ -87,10 +87,9 @@ sap.ui.define([
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
function getAllPropertiesFromDelegate(oElement, sAggregationName) {
|
|
90
|
-
return DelegateMediatorAPI.
|
|
90
|
+
return DelegateMediatorAPI.getReadDelegateForControl({
|
|
91
91
|
control: oElement,
|
|
92
|
-
modifier: JsControlTreeModifier
|
|
93
|
-
supportsDefault: true
|
|
92
|
+
modifier: JsControlTreeModifier
|
|
94
93
|
}).then(function(mDelegateInfo) {
|
|
95
94
|
if (mDelegateInfo && mDelegateInfo.instance) {
|
|
96
95
|
return mDelegateInfo.instance.getPropertyInfo({
|
|
@@ -388,18 +387,20 @@ sap.ui.define([
|
|
|
388
387
|
return !bHasAddViaDelegate;
|
|
389
388
|
}
|
|
390
389
|
|
|
391
|
-
function _enhanceByMetadata(oElement, sAggregationName,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
390
|
+
function _enhanceByMetadata(oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties) {
|
|
391
|
+
const mAddViaDelegate = mActions.addViaDelegate;
|
|
392
|
+
const sModelName = _getModelName(mAddViaDelegate);
|
|
393
|
+
const oModel = oElement.getModel(sModelName);
|
|
394
|
+
let bIncludeElement = true;
|
|
395
|
+
let aBindingPaths = [];
|
|
396
|
+
const oInvisibleElement = mInvisibleElement.element;
|
|
397
|
+
const iDepth = mInvisibleElement.action.depthOfRelevantBindings;
|
|
397
398
|
|
|
398
399
|
if (aRepresentedProperties) {
|
|
399
400
|
aBindingPaths = _getRepresentedBindingPathsOfInvisibleElement(oInvisibleElement, aRepresentedProperties);
|
|
400
401
|
// BCP: 1880498671
|
|
401
402
|
} else if (_getBindingContextPath(oElement, sAggregationName, sModelName) === _getBindingContextPath(oInvisibleElement, sAggregationName, sModelName)) {
|
|
402
|
-
aBindingPaths = BindingsExtractor.collectBindingPaths(oInvisibleElement, oModel).bindingPaths;
|
|
403
|
+
aBindingPaths = BindingsExtractor.collectBindingPaths(oInvisibleElement, oModel, null, iDepth).bindingPaths;
|
|
403
404
|
} else if (mAddViaDelegate && BindingsExtractor.getBindings({
|
|
404
405
|
element: oInvisibleElement,
|
|
405
406
|
model: oModel
|
|
@@ -453,7 +454,9 @@ sap.ui.define([
|
|
|
453
454
|
|
|
454
455
|
oInvisibleElement.__label = ElementUtil.getLabelForElement(oInvisibleElement, mRevealAction.getLabel);
|
|
455
456
|
|
|
456
|
-
var bIncludeElement = _enhanceByMetadata(
|
|
457
|
+
var bIncludeElement = _enhanceByMetadata(
|
|
458
|
+
oElement, sAggregationName, mInvisibleElement, mActions, aRepresentedProperties, aProperties
|
|
459
|
+
);
|
|
457
460
|
|
|
458
461
|
if (bIncludeElement) {
|
|
459
462
|
aAllElementData.push({
|
|
@@ -119,7 +119,7 @@ sap.ui.define([
|
|
|
119
119
|
* @class The plugin allows to add additional elements that exist either hidden in the UI or in the OData service
|
|
120
120
|
* @extends sap.ui.rta.plugin.Plugin
|
|
121
121
|
* @author SAP SE
|
|
122
|
-
* @version 1.
|
|
122
|
+
* @version 1.124.0
|
|
123
123
|
* @constructor
|
|
124
124
|
* @private
|
|
125
125
|
* @since 1.44
|
|
@@ -52,7 +52,7 @@ sap.ui.define([
|
|
|
52
52
|
width: sWidth,
|
|
53
53
|
height: sHeight,
|
|
54
54
|
title: mSettings.title,
|
|
55
|
-
|
|
55
|
+
advancedSettings: mSettings.advancedSettings
|
|
56
56
|
}, oDesignTimeMetadata, sVariantManagementKey);
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -119,7 +119,7 @@ sap.ui.define([
|
|
|
119
119
|
* @class The AddIFrame allows trigger AddIFrame operations on the overlay.
|
|
120
120
|
* @extends sap.ui.rta.plugin.BaseCreate
|
|
121
121
|
* @author SAP SE
|
|
122
|
-
* @version 1.
|
|
122
|
+
* @version 1.124.0
|
|
123
123
|
* @constructor
|
|
124
124
|
* @private
|
|
125
125
|
* @since 1.75
|