@openui5/sap.ui.rta 1.120.6 → 1.121.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/.reuse/dep5 +23 -21
- package/THIRDPARTY.txt +6 -43
- 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 +507 -759
- package/src/sap/ui/rta/Utils.js +1 -146
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -3
- package/src/sap/ui/rta/appVariant/Utils.js +3 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +27 -27
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_mk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +1 -1
- 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 +3 -3
- 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 +7 -5
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +10 -4
- 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 +4 -3
- 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 +23 -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/elementActionTest.js +180 -258
- package/src/sap/ui/rta/library.js +3 -2
- package/src/sap/ui/rta/messagebundle.properties +8 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +4 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +5 -1
- package/src/sap/ui/rta/messagebundle_ca.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cnr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_cs.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +8 -4
- package/src/sap/ui/rta/messagebundle_da.properties +4 -0
- package/src/sap/ui/rta/messagebundle_de.properties +5 -1
- package/src/sap/ui/rta/messagebundle_el.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +322 -318
- package/src/sap/ui/rta/messagebundle_es.properties +4 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -1
- package/src/sap/ui/rta/messagebundle_et.properties +6 -2
- package/src/sap/ui/rta/messagebundle_fi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_hu.properties +4 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -1
- package/src/sap/ui/rta/messagebundle_it.properties +10 -6
- package/src/sap/ui/rta/messagebundle_iw.properties +9 -5
- package/src/sap/ui/rta/messagebundle_ja.properties +4 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +4 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +11 -7
- package/src/sap/ui/rta/messagebundle_mk.properties +15 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +4 -0
- package/src/sap/ui/rta/messagebundle_no.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +8 -4
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +7 -3
- package/src/sap/ui/rta/messagebundle_sr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +4 -0
- package/src/sap/ui/rta/messagebundle_th.properties +9 -5
- package/src/sap/ui/rta/messagebundle_tr.properties +7 -3
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -2
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +16 -11
- 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/CompVariant.js +43 -1
- package/src/sap/ui/rta/plugin/ControlVariant.js +3 -2
- 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/EasyAdd.js +2 -2
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +18 -10
- 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 +2 -2
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +24 -9
- package/src/sap/ui/rta/plugin/Settings.js +17 -15
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +14 -13
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +134 -67
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +6 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +57 -47
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +21 -8
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +56 -41
- 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 +22 -18
- 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 +23 -19
- package/src/sap/ui/rta/toolbar/Adaptation.js +16 -18
- 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/Personalization.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 +12 -5
- 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 +19 -59
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/ServiceManager.js +193 -0
- package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +90 -45
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +32 -25
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +98 -132
- package/LICENSES/BSD-2-Clause.txt +0 -22
|
@@ -7,33 +7,35 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/each",
|
|
9
9
|
"sap/base/Log",
|
|
10
|
+
"sap/ui/core/EventBus",
|
|
10
11
|
"sap/ui/core/IconPool",
|
|
11
12
|
"sap/ui/core/Lib",
|
|
12
13
|
"sap/ui/dt/OverlayRegistry",
|
|
13
14
|
"sap/ui/dt/OverlayUtil",
|
|
14
15
|
"sap/ui/fl/write/api/FieldExtensibility",
|
|
16
|
+
"sap/ui/rta/plugin/additionalElements/ActionExtractor",
|
|
15
17
|
"sap/ui/rta/plugin/additionalElements/AddElementsDialog",
|
|
16
18
|
"sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer",
|
|
17
|
-
"sap/ui/rta/plugin/Plugin",
|
|
18
|
-
"sap/ui/rta/Utils",
|
|
19
19
|
"sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils",
|
|
20
20
|
"sap/ui/rta/plugin/additionalElements/CommandBuilder",
|
|
21
|
-
"sap/ui/rta/plugin/
|
|
21
|
+
"sap/ui/rta/plugin/Plugin",
|
|
22
|
+
"sap/ui/rta/Utils"
|
|
22
23
|
], function(
|
|
23
24
|
each,
|
|
24
25
|
Log,
|
|
26
|
+
EventBus,
|
|
25
27
|
IconPool,
|
|
26
28
|
Lib,
|
|
27
29
|
OverlayRegistry,
|
|
28
30
|
OverlayUtil,
|
|
29
31
|
FieldExtensibility,
|
|
32
|
+
ActionExtractor,
|
|
30
33
|
AddElementsDialog,
|
|
31
34
|
AdditionalElementsAnalyzer,
|
|
32
|
-
Plugin,
|
|
33
|
-
Utils,
|
|
34
35
|
AdditionalElementsUtils,
|
|
35
36
|
CommandBuilder,
|
|
36
|
-
|
|
37
|
+
Plugin,
|
|
38
|
+
Utils
|
|
37
39
|
) {
|
|
38
40
|
"use strict";
|
|
39
41
|
|
|
@@ -47,23 +49,33 @@ sap.ui.define([
|
|
|
47
49
|
});
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Utility function to check if the OData service is updated in the meantime
|
|
54
|
+
*
|
|
55
|
+
* @param {sap.ui.core.Control} oControl - Control to be checked
|
|
56
|
+
* @returns {Promise} resolves if service is up to date, rejects otherwise
|
|
57
|
+
*/
|
|
58
|
+
async function isServiceUpToDate(oControl) {
|
|
59
|
+
const oModel = oControl.getModel();
|
|
60
|
+
if (oModel && oModel.sServiceUrl) {
|
|
61
|
+
const bServiceOutdated = await FieldExtensibility.isServiceOutdated(oModel.sServiceUrl);
|
|
62
|
+
if (bServiceOutdated) {
|
|
63
|
+
FieldExtensibility.setServiceValid(oModel.sServiceUrl);
|
|
64
|
+
// needs FLP to trigger UI restart popup
|
|
65
|
+
EventBus.getInstance().publish("sap.ui.core.UnrecoverableClientStateCorruption", "RequestReload", {});
|
|
64
66
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function handleExtensibility(oControl) {
|
|
71
|
+
await FieldExtensibility.onControlSelected(oControl);
|
|
72
|
+
const bExtensibilityEnabled = await FieldExtensibility.isExtensibilityEnabled(oControl);
|
|
73
|
+
|
|
74
|
+
if (bExtensibilityEnabled) {
|
|
75
|
+
await isServiceUpToDate(oControl);
|
|
76
|
+
return FieldExtensibility.getExtensionData(oControl);
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
67
79
|
}
|
|
68
80
|
|
|
69
81
|
/**
|
|
@@ -77,7 +89,7 @@ sap.ui.define([
|
|
|
77
89
|
* @class The plugin allows to add additional elements that exist either hidden in the UI or in the OData service
|
|
78
90
|
* @extends sap.ui.rta.plugin.Plugin
|
|
79
91
|
* @author SAP SE
|
|
80
|
-
* @version 1.
|
|
92
|
+
* @version 1.121.0
|
|
81
93
|
* @constructor
|
|
82
94
|
* @private
|
|
83
95
|
* @since 1.44
|
|
@@ -86,6 +98,7 @@ sap.ui.define([
|
|
|
86
98
|
var AdditionalElementsPlugin = Plugin.extend("sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin", {
|
|
87
99
|
// eslint-disable-next-line object-shorthand
|
|
88
100
|
constructor: function(...aArgs) {
|
|
101
|
+
this._getMenuItemsPromise = Promise.resolve();
|
|
89
102
|
const [oPropertyBag] = aArgs;
|
|
90
103
|
oPropertyBag.dialog = new AddElementsDialog();
|
|
91
104
|
Plugin.apply(this, aArgs);
|
|
@@ -280,7 +293,14 @@ sap.ui.define([
|
|
|
280
293
|
|
|
281
294
|
.then(function() {
|
|
282
295
|
var aSelectedElements = this.getDialog().getSelectedElements();
|
|
283
|
-
return CommandBuilder.createCommands(mParents,
|
|
296
|
+
return CommandBuilder.createCommands(mParents,
|
|
297
|
+
vSiblingElement,
|
|
298
|
+
mActions,
|
|
299
|
+
iIndex,
|
|
300
|
+
aSelectedElements,
|
|
301
|
+
sAggregationName,
|
|
302
|
+
this
|
|
303
|
+
);
|
|
284
304
|
}.bind(this))
|
|
285
305
|
|
|
286
306
|
.then(function() {
|
|
@@ -306,7 +326,13 @@ sap.ui.define([
|
|
|
306
326
|
},
|
|
307
327
|
|
|
308
328
|
_setDialogTitle(mActions, oParentElement, sControlName) {
|
|
309
|
-
var sDialogTitle = AdditionalElementsUtils.getText(
|
|
329
|
+
var sDialogTitle = AdditionalElementsUtils.getText(
|
|
330
|
+
"HEADER_ADDITIONAL_ELEMENTS",
|
|
331
|
+
mActions,
|
|
332
|
+
oParentElement,
|
|
333
|
+
PLURAL,
|
|
334
|
+
sControlName
|
|
335
|
+
);
|
|
310
336
|
this.getDialog().setTitle(sDialogTitle);
|
|
311
337
|
},
|
|
312
338
|
|
|
@@ -324,7 +350,10 @@ sap.ui.define([
|
|
|
324
350
|
* @protected
|
|
325
351
|
*/
|
|
326
352
|
_isEditable(oOverlay, mPropertyBag) {
|
|
327
|
-
return Promise.all([
|
|
353
|
+
return Promise.all([
|
|
354
|
+
this._isEditableCheck(mPropertyBag.sourceElementOverlay, true),
|
|
355
|
+
this._isEditableCheck(mPropertyBag.sourceElementOverlay, false)
|
|
356
|
+
])
|
|
328
357
|
.then(function(aPromiseValues) {
|
|
329
358
|
return {
|
|
330
359
|
asSibling: aPromiseValues[0],
|
|
@@ -336,43 +365,36 @@ sap.ui.define([
|
|
|
336
365
|
});
|
|
337
366
|
},
|
|
338
367
|
|
|
339
|
-
_isEditableCheck(oOverlay, bOverlayIsSibling) {
|
|
340
|
-
|
|
341
|
-
.then(function() {
|
|
342
|
-
var mParents = AdditionalElementsUtils.getParents(bOverlayIsSibling, oOverlay, this);
|
|
368
|
+
async _isEditableCheck(oOverlay, bOverlayIsSibling) {
|
|
369
|
+
var mParents = AdditionalElementsUtils.getParents(bOverlayIsSibling, oOverlay, this);
|
|
343
370
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
371
|
+
if (!mParents.relevantContainerOverlay) {
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
347
374
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
return bEditable;
|
|
365
|
-
}.bind(this));
|
|
375
|
+
const mActions = await ActionExtractor.getActions(bOverlayIsSibling, oOverlay, this, true, this.getDesignTime());
|
|
376
|
+
// Prevents clear cached elements during the getMenuItems promise is pending
|
|
377
|
+
await this._getMenuItemsPromise;
|
|
378
|
+
this.clearCachedElements();
|
|
379
|
+
return Utils.doIfAllControlsAreAvailable([oOverlay, mParents.parentOverlay], function() {
|
|
380
|
+
var bEditable = false;
|
|
381
|
+
// For the sibling case, check if anything is available for the same aggregation
|
|
382
|
+
if (bOverlayIsSibling) {
|
|
383
|
+
bEditable = isThereAnAggregationActionForSameAggregation(mActions, mParents);
|
|
384
|
+
} else {
|
|
385
|
+
bEditable = Object.keys(mActions).some(function(sAggregationName) {
|
|
386
|
+
if (mActions[sAggregationName].addViaDelegate) {
|
|
387
|
+
bEditable = this.checkAggregationsOnSelf(mParents.parentOverlay, "add", undefined, "delegate");
|
|
388
|
+
}
|
|
389
|
+
if (!bEditable && mActions[sAggregationName].reveal) {
|
|
390
|
+
return true;
|
|
366
391
|
}
|
|
367
392
|
return bEditable;
|
|
368
393
|
}.bind(this));
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
&& this.hasStableId(mParents.parentOverlay);
|
|
374
|
-
return bEditable;
|
|
375
|
-
}.bind(this));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
bEditable &&= this.hasStableId(oOverlay) && this.hasStableId(mParents.parentOverlay);
|
|
397
|
+
return bEditable;
|
|
376
398
|
}.bind(this));
|
|
377
399
|
},
|
|
378
400
|
|
|
@@ -408,8 +430,12 @@ sap.ui.define([
|
|
|
408
430
|
aPromises.push({
|
|
409
431
|
aggregation: sAggregationName,
|
|
410
432
|
elementPromises: [
|
|
411
|
-
mActions.reveal
|
|
412
|
-
|
|
433
|
+
mActions.reveal
|
|
434
|
+
? AdditionalElementsAnalyzer.enhanceInvisibleElements(mParents.parent, mActions)
|
|
435
|
+
: Promise.resolve([]),
|
|
436
|
+
mActions.addViaDelegate
|
|
437
|
+
? AdditionalElementsAnalyzer.getUnrepresentedDelegateProperties(mParents.parent, mActions.addViaDelegate)
|
|
438
|
+
: Promise.resolve([])
|
|
413
439
|
]
|
|
414
440
|
});
|
|
415
441
|
});
|
|
@@ -446,8 +472,13 @@ sap.ui.define([
|
|
|
446
472
|
var aMenuItems = [];
|
|
447
473
|
var oMenuItem;
|
|
448
474
|
this.clearCachedElements();
|
|
475
|
+
// Prevents clearing of cached elements before menu items are build. This happens when evaluate editable is running in parallel
|
|
476
|
+
this._getMenuItemsPromise =
|
|
449
477
|
// getAllElements() is called to set cached elements for the overlay -> which will result in menu item being enabled
|
|
450
|
-
|
|
478
|
+
Promise.all([
|
|
479
|
+
this.getAllElements(false, aElementOverlays),
|
|
480
|
+
this.getAllElements(true, aElementOverlays)
|
|
481
|
+
])
|
|
451
482
|
.then(function(aElementsWithAggregations) {
|
|
452
483
|
var bHasChildren = aElementsWithAggregations[0].length > 0;
|
|
453
484
|
var bHasMultipleAggregations = aElementsWithAggregations[0].length > 1;
|
|
@@ -456,22 +487,51 @@ sap.ui.define([
|
|
|
456
487
|
var bIsAvailableForSibling = this.isAvailable(aElementOverlays, true);
|
|
457
488
|
if (bIsAvailableForSibling && (!bIsAvailableForChildren || !bHasChildren)) {
|
|
458
489
|
// Case 1: Only siblings -> No submenu required
|
|
459
|
-
oMenuItem = this._buildMenuItem(
|
|
490
|
+
oMenuItem = this._buildMenuItem(
|
|
491
|
+
"CTX_ADD_ELEMENTS_AS_SIBLING",
|
|
492
|
+
true,
|
|
493
|
+
aElementOverlays,
|
|
494
|
+
aElementsWithAggregations,
|
|
495
|
+
false
|
|
496
|
+
);
|
|
460
497
|
} else if (!bIsAvailableForSibling && bIsAvailableForChildren && !bHasMultipleAggregations) {
|
|
461
498
|
// Case 2: Only children, one aggregation -> No submenu required
|
|
462
|
-
oMenuItem = this._buildMenuItem(
|
|
499
|
+
oMenuItem = this._buildMenuItem(
|
|
500
|
+
"CTX_ADD_ELEMENTS_AS_CHILD",
|
|
501
|
+
false,
|
|
502
|
+
aElementOverlays,
|
|
503
|
+
aElementsWithAggregations,
|
|
504
|
+
false
|
|
505
|
+
);
|
|
463
506
|
} else if (!bIsAvailableForSibling && bIsAvailableForChildren && bHasMultipleAggregations) {
|
|
464
507
|
// Case 3: Only children, multiple aggregations -> Submenu required
|
|
465
|
-
oMenuItem = this._buildMenuItem(
|
|
508
|
+
oMenuItem = this._buildMenuItem(
|
|
509
|
+
"CTX_ADD_ELEMENTS_AS_CHILD",
|
|
510
|
+
false,
|
|
511
|
+
aElementOverlays,
|
|
512
|
+
aElementsWithAggregations,
|
|
513
|
+
true
|
|
514
|
+
);
|
|
466
515
|
} else if (bIsAvailableForChildren && bIsAvailableForSibling && bHasChildren && bHasSiblings) {
|
|
467
516
|
// Case 4: Children and siblings -> Submenu required
|
|
468
|
-
oMenuItem = this._buildMenuItem(
|
|
517
|
+
oMenuItem = this._buildMenuItem(
|
|
518
|
+
"CTX_ADD_ELEMENTS_CHILD_AND_SIBLING",
|
|
519
|
+
false,
|
|
520
|
+
aElementOverlays,
|
|
521
|
+
aElementsWithAggregations,
|
|
522
|
+
true
|
|
523
|
+
);
|
|
469
524
|
}
|
|
470
525
|
if (oMenuItem) {
|
|
471
|
-
aMenuItems.push(this.enhanceItemWithResponsibleElement(
|
|
526
|
+
aMenuItems.push(this.enhanceItemWithResponsibleElement(
|
|
527
|
+
oMenuItem,
|
|
528
|
+
aElementOverlays,
|
|
529
|
+
["addViaDelegate", "reveal", "custom"]
|
|
530
|
+
));
|
|
472
531
|
}
|
|
473
532
|
return aMenuItems;
|
|
474
533
|
}.bind(this));
|
|
534
|
+
return this._getMenuItemsPromise;
|
|
475
535
|
},
|
|
476
536
|
|
|
477
537
|
_buildMenuItem(sPluginId, bOverlayIsSibling, aElementOverlays, aElementsWithAggregations, bHasSubMenu) {
|
|
@@ -549,7 +609,14 @@ sap.ui.define([
|
|
|
549
609
|
}.bind(this),
|
|
550
610
|
handler: function(bOverlayIsSibling, aElementOverlays) {
|
|
551
611
|
// showAvailableElements has optional parameters
|
|
552
|
-
return this.showAvailableElements(
|
|
612
|
+
return this.showAvailableElements(
|
|
613
|
+
bOverlayIsSibling,
|
|
614
|
+
sAggregationName,
|
|
615
|
+
aElementOverlays,
|
|
616
|
+
undefined,
|
|
617
|
+
undefined,
|
|
618
|
+
sDisplayText
|
|
619
|
+
);
|
|
553
620
|
}.bind(this, bOverlayIsSibling),
|
|
554
621
|
icon: bOverlayIsSibling ? "sap-icon://BusinessSuiteInAppSymbols/icon-add-outside" : "sap-icon://add"
|
|
555
622
|
};
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* Helper object to build the RTA commands resulting from the AdditionalElements Plugin
|
|
26
26
|
*
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.121.0
|
|
29
29
|
* @private
|
|
30
30
|
* @since 1.94
|
|
31
31
|
*/
|
|
@@ -199,6 +199,10 @@ sap.ui.define([
|
|
|
199
199
|
return sUri;
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
function createFieldLabelId(oParentControl, sEntityType, sBindingPath) {
|
|
203
|
+
return (`${oParentControl.getId()}_${sEntityType}_${sBindingPath}`).replace("/", "_");
|
|
204
|
+
}
|
|
205
|
+
|
|
202
206
|
function createAddViaDelegateCommand(mPropertyBag, oParentAggregationDTMetadata) {
|
|
203
207
|
var oSelectedElement = mPropertyBag.selectedElement;
|
|
204
208
|
var mParents = mPropertyBag.parents;
|
|
@@ -216,7 +220,7 @@ sap.ui.define([
|
|
|
216
220
|
var sServiceUri = getODataServiceUriFromManifest(oManifest);
|
|
217
221
|
|
|
218
222
|
return oPlugin.getCommandFactory().getCommandFor(mParents.parent, sCommandName, {
|
|
219
|
-
newControlId:
|
|
223
|
+
newControlId: createFieldLabelId(oParent, oSelectedElement.entityType, oSelectedElement.bindingPath),
|
|
220
224
|
index: iIndex !== undefined ? iIndex : iAddTargetIndex,
|
|
221
225
|
bindingString: oSelectedElement.bindingPath,
|
|
222
226
|
entityType: oSelectedElement.entityType, // needed for custom field support tool
|
|
@@ -85,7 +85,7 @@ sap.ui.define([
|
|
|
85
85
|
parameters: mURLParameters,
|
|
86
86
|
asContainer: bAsContainer
|
|
87
87
|
};
|
|
88
|
-
return oAddIFrameDialog.open(mAddIFrameDialogSettings);
|
|
88
|
+
return oAddIFrameDialog.open(mAddIFrameDialogSettings, oParent);
|
|
89
89
|
})
|
|
90
90
|
.then(function(mSettings) {
|
|
91
91
|
if (!mSettings) {
|
|
@@ -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.121.0
|
|
123
123
|
* @constructor
|
|
124
124
|
* @private
|
|
125
125
|
* @since 1.75
|