@openui5/sap.ui.rta 1.115.0 → 1.116.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.json +33 -2
- package/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +60 -59
- package/src/sap/ui/rta/RuntimeAuthoring.js +253 -248
- package/src/sap/ui/rta/Utils.js +42 -42
- package/src/sap/ui/rta/api/startAdaptation.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +3 -3
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +27 -27
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +97 -97
- package/src/sap/ui/rta/appVariant/Feature.js +75 -77
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +6 -7
- package/src/sap/ui/rta/appVariant/Utils.js +17 -17
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +36 -36
- package/src/sap/ui/rta/command/AddIFrame.js +7 -7
- package/src/sap/ui/rta/command/AddProperty.js +7 -7
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +7 -7
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +18 -18
- package/src/sap/ui/rta/command/BaseCommand.js +1 -2
- 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 +11 -11
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +22 -22
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +11 -11
- package/src/sap/ui/rta/command/CreateContainer.js +2 -2
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +30 -30
- package/src/sap/ui/rta/command/LREPSerializer.js +2 -2
- 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 +4 -4
- 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 +92 -92
- package/src/sap/ui/rta/enablement/elementActionTest.js +230 -112
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +11 -1
- package/src/sap/ui/rta/messagebundle_ar.properties +5 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ca.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cs.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +5 -0
- package/src/sap/ui/rta/messagebundle_da.properties +5 -0
- package/src/sap/ui/rta/messagebundle_de.properties +5 -0
- package/src/sap/ui/rta/messagebundle_el.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es.properties +5 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -0
- package/src/sap/ui/rta/messagebundle_et.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hu.properties +5 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -0
- package/src/sap/ui/rta/messagebundle_it.properties +5 -0
- package/src/sap/ui/rta/messagebundle_iw.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ja.properties +5 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -0
- package/src/sap/ui/rta/messagebundle_nl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_no.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_th.properties +5 -0
- package/src/sap/ui/rta/messagebundle_tr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_vi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +5 -0
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +44 -44
- package/src/sap/ui/rta/plugin/BaseCreate.js +29 -29
- package/src/sap/ui/rta/plugin/Combine.js +9 -9
- package/src/sap/ui/rta/plugin/ControlVariant.js +21 -21
- package/src/sap/ui/rta/plugin/CreateContainer.js +6 -6
- package/src/sap/ui/rta/plugin/CutPaste.js +46 -46
- package/src/sap/ui/rta/plugin/DragDrop.js +2 -2
- package/src/sap/ui/rta/plugin/EasyAdd.js +4 -4
- package/src/sap/ui/rta/plugin/EasyRemove.js +5 -5
- package/src/sap/ui/rta/plugin/LocalReset.js +25 -25
- package/src/sap/ui/rta/plugin/Plugin.js +20 -20
- package/src/sap/ui/rta/plugin/RTAElementMover.js +42 -42
- package/src/sap/ui/rta/plugin/Remove.js +11 -11
- package/src/sap/ui/rta/plugin/Rename.js +7 -7
- package/src/sap/ui/rta/plugin/RenameHandler.js +17 -17
- package/src/sap/ui/rta/plugin/Resize.js +62 -62
- package/src/sap/ui/rta/plugin/Selection.js +14 -14
- package/src/sap/ui/rta/plugin/Settings.js +20 -20
- package/src/sap/ui/rta/plugin/Split.js +7 -7
- package/src/sap/ui/rta/plugin/Stretch.js +4 -4
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +94 -87
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +18 -18
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +98 -99
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +144 -144
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +67 -67
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +38 -39
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +1 -0
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +29 -29
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +5 -5
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +36 -37
- package/src/sap/ui/rta/service/ControllerExtension.js +4 -4
- package/src/sap/ui/rta/service/Outline.js +59 -59
- package/src/sap/ui/rta/service/Property.js +125 -125
- package/src/sap/ui/rta/service/Receiver.js +78 -77
- package/src/sap/ui/rta/service/Selection.js +6 -6
- package/src/sap/ui/rta/service/SupportTools.js +30 -30
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +74 -26
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +17 -15
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -2
- package/src/sap/ui/rta/toolbar/Fiori.js +8 -8
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +4 -4
- package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +13 -6
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +2 -8
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +2 -3
- package/src/sap/ui/rta/toolbar/translation/Translation.js +41 -41
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +9 -9
- package/src/sap/ui/rta/util/Animation.js +5 -5
- package/src/sap/ui/rta/util/BindingsExtractor.js +33 -33
- package/src/sap/ui/rta/util/PluginManager.js +25 -25
- package/src/sap/ui/rta/util/PopupManager.js +27 -27
- package/src/sap/ui/rta/util/ReloadManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +3 -4
- package/src/sap/ui/rta/util/StylesLoader.js +9 -9
- package/src/sap/ui/rta/util/UrlParser.js +19 -19
- package/src/sap/ui/rta/util/adaptationStarter.js +34 -31
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +21 -19
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +61 -61
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +73 -60
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +6 -6
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +2 -2
- package/src/sap/ui/rta/util/showMessageBox.js +4 -5
- package/src/sap/ui/rta/util/validateFlexEnabled.js +5 -5
- package/src/sap/ui/rta/util/validateStableIds.js +8 -8
|
@@ -77,38 +77,37 @@ sap.ui.define([
|
|
|
77
77
|
var oAddIFrameDialog = new AddIFrameDialog();
|
|
78
78
|
var sNewContainerTitle;
|
|
79
79
|
AddIFrameDialog.buildUrlBuilderParametersFor(oParent)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
});
|
|
103
|
-
}.bind(this))
|
|
104
|
-
.catch(function(vError) {
|
|
105
|
-
if (vError) {
|
|
106
|
-
throw DtUtil.createError("AddIFrame#handler", vError, "sap.ui.rta");
|
|
107
|
-
}
|
|
80
|
+
.then(function(mURLParameters) {
|
|
81
|
+
var mAddIFrameDialogSettings = {
|
|
82
|
+
parameters: mURLParameters,
|
|
83
|
+
asContainer: bAsContainer
|
|
84
|
+
};
|
|
85
|
+
return oAddIFrameDialog.open(mAddIFrameDialogSettings);
|
|
86
|
+
})
|
|
87
|
+
.then(function(mSettings) {
|
|
88
|
+
if (!mSettings) {
|
|
89
|
+
return Promise.reject(); // Cancel
|
|
90
|
+
}
|
|
91
|
+
mSettings.index = iIndex;
|
|
92
|
+
mSettings.aggregation = oAction.aggregation;
|
|
93
|
+
sNewContainerTitle = mSettings.title;
|
|
94
|
+
return getAddIFrameCommand.call(this, oParent, mSettings, oDesignTimeMetadata, sVariantManagementReference);
|
|
95
|
+
}.bind(this))
|
|
96
|
+
.then(function(oCommand) {
|
|
97
|
+
this.fireElementModified({
|
|
98
|
+
command: oCommand,
|
|
99
|
+
newControlId: oCommand.getBaseId(),
|
|
100
|
+
action: bAsContainer ? oAction : undefined,
|
|
101
|
+
title: sNewContainerTitle
|
|
108
102
|
});
|
|
103
|
+
}.bind(this))
|
|
104
|
+
.catch(function(vError) {
|
|
105
|
+
if (vError) {
|
|
106
|
+
throw DtUtil.createError("AddIFrame#handler", vError, "sap.ui.rta");
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
|
|
112
111
|
/**
|
|
113
112
|
* Constructor for a new AddIFrame plugin.
|
|
114
113
|
*
|
|
@@ -117,7 +116,7 @@ sap.ui.define([
|
|
|
117
116
|
* @class The AddIFrame allows trigger AddIFrame operations on the overlay.
|
|
118
117
|
* @extends sap.ui.rta.plugin.BaseCreate
|
|
119
118
|
* @author SAP SE
|
|
120
|
-
* @version 1.
|
|
119
|
+
* @version 1.116.0
|
|
121
120
|
* @constructor
|
|
122
121
|
* @private
|
|
123
122
|
* @since 1.75
|
|
@@ -196,15 +195,15 @@ sap.ui.define([
|
|
|
196
195
|
bIsSibling = false;
|
|
197
196
|
if (this.isAvailable(aElementOverlays, bIsSibling)) {
|
|
198
197
|
aMenuItems = aMenuItems.concat(this.getCreateActions(bIsSibling, aElementOverlays[0])
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
198
|
+
.map(function(oAction, iIndex) {
|
|
199
|
+
var oParentMenuItem = Object.assign({
|
|
200
|
+
action: oAction,
|
|
201
|
+
id: "CTX_CREATE_CHILD_IFRAME_" + oAction.aggregation.toUpperCase(),
|
|
202
|
+
rank: iBaseRank + 10 * iIndex
|
|
203
|
+
}, getCommonProperties.call(this, oAction.aggregation));
|
|
204
|
+
|
|
205
|
+
return this.enhanceItemWithResponsibleElement(oParentMenuItem, aElementOverlays);
|
|
206
|
+
}, this)
|
|
208
207
|
);
|
|
209
208
|
}
|
|
210
209
|
return aMenuItems;
|
|
@@ -229,6 +229,7 @@
|
|
|
229
229
|
text="{/text/previewUrlMessage}" textAlign="Center" visible="{= !${/previewUrl/value} }" />
|
|
230
230
|
<util:IFrame
|
|
231
231
|
id="sapUiRtaAddIFrameDialog_PreviewFrame"
|
|
232
|
+
height="100%"
|
|
232
233
|
title="{/text/previewFrameLabel}"
|
|
233
234
|
class="sapUiRtaAddIFrameDialogPreviewFrame"
|
|
234
235
|
visible="{= !!${/previewUrl/value} }"/>
|
|
@@ -133,7 +133,7 @@ sap.ui.define([
|
|
|
133
133
|
* @class Context - Dialog for IFrame settings in Runtime Authoring
|
|
134
134
|
* @extends sap.ui.base.ManagedObject
|
|
135
135
|
* @author SAP SE
|
|
136
|
-
* @version 1.
|
|
136
|
+
* @version 1.116.0
|
|
137
137
|
* @constructor
|
|
138
138
|
* @private
|
|
139
139
|
* @since 1.78
|
|
@@ -241,35 +241,35 @@ sap.ui.define([
|
|
|
241
241
|
*/
|
|
242
242
|
AddIFrameDialog.buildUrlBuilderParametersFor = function(oObject) {
|
|
243
243
|
return getContainerUserInfo()
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
});
|
|
253
|
-
var oBindingContext = oObject.getBindingContext();
|
|
254
|
-
var oDefaultBoundObjectParameters;
|
|
255
|
-
if (oBindingContext) {
|
|
256
|
-
var oDefaultBoundObject = oBindingContext.getObject();
|
|
257
|
-
oDefaultBoundObjectParameters = Object.keys(oDefaultBoundObject)
|
|
258
|
-
.filter(function(sProperty) {
|
|
259
|
-
return typeof oDefaultBoundObject[sProperty] !== "object";
|
|
260
|
-
})
|
|
261
|
-
.map(function(sProperty) {
|
|
262
|
-
return {
|
|
263
|
-
label: sProperty,
|
|
264
|
-
key: "{" + sProperty + "}",
|
|
265
|
-
value: oDefaultBoundObject[sProperty]
|
|
266
|
-
};
|
|
267
|
-
});
|
|
268
|
-
} else {
|
|
269
|
-
oDefaultBoundObjectParameters = [];
|
|
270
|
-
}
|
|
271
|
-
return oUserParameters.concat(oDefaultBoundObjectParameters);
|
|
244
|
+
.then(function(oUserInfo) {
|
|
245
|
+
var oUserParameters = Object.keys(oUserInfo)
|
|
246
|
+
.map(function(sUserSetting) {
|
|
247
|
+
return {
|
|
248
|
+
label: sUserSetting,
|
|
249
|
+
key: "{$user>/" + sUserSetting + "}",
|
|
250
|
+
value: oUserInfo[sUserSetting]
|
|
251
|
+
};
|
|
272
252
|
});
|
|
253
|
+
var oBindingContext = oObject.getBindingContext();
|
|
254
|
+
var oDefaultBoundObjectParameters;
|
|
255
|
+
if (oBindingContext) {
|
|
256
|
+
var oDefaultBoundObject = oBindingContext.getObject();
|
|
257
|
+
oDefaultBoundObjectParameters = Object.keys(oDefaultBoundObject)
|
|
258
|
+
.filter(function(sProperty) {
|
|
259
|
+
return typeof oDefaultBoundObject[sProperty] !== "object";
|
|
260
|
+
})
|
|
261
|
+
.map(function(sProperty) {
|
|
262
|
+
return {
|
|
263
|
+
label: sProperty,
|
|
264
|
+
key: "{" + sProperty + "}",
|
|
265
|
+
value: oDefaultBoundObject[sProperty]
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
} else {
|
|
269
|
+
oDefaultBoundObjectParameters = [];
|
|
270
|
+
}
|
|
271
|
+
return oUserParameters.concat(oDefaultBoundObjectParameters);
|
|
272
|
+
});
|
|
273
273
|
};
|
|
274
274
|
|
|
275
275
|
return AddIFrameDialog;
|
|
@@ -87,7 +87,7 @@ sap.ui.define([
|
|
|
87
87
|
}
|
|
88
88
|
var oIFrame = sap.ui.getCore().byId("sapUiRtaAddIFrameDialog_PreviewFrame");
|
|
89
89
|
oIFrame.setUrl(""); // Resets the preview first
|
|
90
|
-
//enable/disable expanding the Panel
|
|
90
|
+
// enable/disable expanding the Panel
|
|
91
91
|
var oPanel = sap.ui.getCore().byId("sapUiRtaAddIFrameDialog_PreviewLinkPanel");
|
|
92
92
|
var oPanelButton = oPanel.getDependents()[0];
|
|
93
93
|
if (sURL) {
|
|
@@ -238,8 +238,8 @@ sap.ui.define([
|
|
|
238
238
|
|
|
239
239
|
_areAllValueStateNones: function() {
|
|
240
240
|
var oData = this._oJSONModel.getData();
|
|
241
|
-
return _aTextInputFields.concat(_aNumericInputFields).every(function
|
|
242
|
-
return oData[sFieldName]
|
|
241
|
+
return _aTextInputFields.concat(_aNumericInputFields).every(function(sFieldName) {
|
|
242
|
+
return oData[sFieldName].valueState === ValueState.None;
|
|
243
243
|
}, this);
|
|
244
244
|
},
|
|
245
245
|
|
|
@@ -318,8 +318,8 @@ sap.ui.define([
|
|
|
318
318
|
_setFocusOnInvalidInput: function() {
|
|
319
319
|
var oData = this._oJSONModel.getData();
|
|
320
320
|
_aNumericInputFields.some(function(sFieldName) {
|
|
321
|
-
if (oData[sFieldName]
|
|
322
|
-
var oElement = sap.ui.getCore().byId(oData[sFieldName]
|
|
321
|
+
if (oData[sFieldName].valueState === ValueState.Error) {
|
|
322
|
+
var oElement = sap.ui.getCore().byId(oData[sFieldName].id);
|
|
323
323
|
oElement.focus();
|
|
324
324
|
return true;
|
|
325
325
|
}
|
|
@@ -9,7 +9,7 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/dt/Util",
|
|
10
10
|
"sap/base/util/restricted/_castArray",
|
|
11
11
|
"sap/base/util/restricted/_pick"
|
|
12
|
-
], function
|
|
12
|
+
], function(
|
|
13
13
|
OverlayRegistry,
|
|
14
14
|
DtUtil,
|
|
15
15
|
_castArray,
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @author SAP SE
|
|
26
26
|
* @experimental Since 1.58
|
|
27
27
|
* @since 1.58
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.116.0
|
|
29
29
|
* @private
|
|
30
30
|
* @ui5-restricted
|
|
31
31
|
*
|
|
@@ -58,39 +58,38 @@ sap.ui.define([
|
|
|
58
58
|
* @property {string} text - Action name
|
|
59
59
|
*/
|
|
60
60
|
|
|
61
|
-
|
|
62
|
-
return function (oRta) {
|
|
61
|
+
return function(oRta) {
|
|
63
62
|
function invoke(vValue, oOverlay) {
|
|
64
|
-
return typeof vValue ===
|
|
63
|
+
return typeof vValue === "function"
|
|
65
64
|
? vValue(oOverlay)
|
|
66
65
|
: vValue;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
function getActions(aElementOverlays) {
|
|
70
69
|
var aMenuItemPromises = oRta._oDesignTime.getPlugins()
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
.map(function(oPlugin) {
|
|
71
|
+
return oPlugin.getMenuItems(aElementOverlays);
|
|
72
|
+
});
|
|
74
73
|
return Promise.all(aMenuItemPromises)
|
|
75
|
-
|
|
74
|
+
.then(function(aMenuItems) {
|
|
75
|
+
return aMenuItems
|
|
76
|
+
.reduce(function(aResult, aMenuItems) {
|
|
76
77
|
return aMenuItems
|
|
77
|
-
.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
text: invoke(mMenuItem.text, aElementOverlays[0])
|
|
86
|
-
});
|
|
87
|
-
});
|
|
78
|
+
? aResult.concat(aMenuItems)
|
|
79
|
+
: aResult;
|
|
80
|
+
}, [])
|
|
81
|
+
.map(function(mMenuItem) {
|
|
82
|
+
return Object.assign({}, mMenuItem, {
|
|
83
|
+
enabled: invoke(mMenuItem.enabled, aElementOverlays),
|
|
84
|
+
text: invoke(mMenuItem.text, aElementOverlays[0])
|
|
85
|
+
});
|
|
88
86
|
});
|
|
87
|
+
});
|
|
89
88
|
}
|
|
90
89
|
|
|
91
90
|
function get(vControlIds) {
|
|
92
91
|
var aControlIds = _castArray(vControlIds);
|
|
93
|
-
var aElementOverlays = aControlIds.map(function
|
|
92
|
+
var aElementOverlays = aControlIds.map(function(sControlId) {
|
|
94
93
|
var oElementOverlay = OverlayRegistry.getOverlay(sControlId);
|
|
95
94
|
|
|
96
95
|
if (!oElementOverlay) {
|
|
@@ -101,16 +100,16 @@ sap.ui.define([
|
|
|
101
100
|
});
|
|
102
101
|
|
|
103
102
|
return getActions(aElementOverlays)
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
});
|
|
103
|
+
.then(function(aMenuItems) {
|
|
104
|
+
return aMenuItems.map(function(mMenuItem) {
|
|
105
|
+
return _pick(mMenuItem, ["id", "icon", "rank", "group", "enabled", "text"]);
|
|
108
106
|
});
|
|
107
|
+
});
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
function execute(vControlIds, sActionId) {
|
|
112
111
|
var aControlIds = _castArray(vControlIds);
|
|
113
|
-
var aElementOverlays = aControlIds.map(function
|
|
112
|
+
var aElementOverlays = aControlIds.map(function(sControlId) {
|
|
114
113
|
var oElementOverlay = OverlayRegistry.getOverlay(sControlId);
|
|
115
114
|
|
|
116
115
|
if (!oElementOverlay) {
|
|
@@ -121,17 +120,17 @@ sap.ui.define([
|
|
|
121
120
|
});
|
|
122
121
|
|
|
123
122
|
return getActions(aElementOverlays)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
123
|
+
.then(function(aActions) {
|
|
124
|
+
var mAction = aActions.filter(function(mAction) {
|
|
125
|
+
return mAction.id === sActionId;
|
|
126
|
+
}).pop();
|
|
127
|
+
|
|
128
|
+
if (!mAction) {
|
|
129
|
+
throw new Error("No action found by specified ID");
|
|
130
|
+
} else {
|
|
131
|
+
return mAction.handler(aElementOverlays, {});
|
|
132
|
+
}
|
|
133
|
+
});
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
return {
|
|
@@ -12,7 +12,7 @@ sap.ui.define([
|
|
|
12
12
|
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
13
13
|
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
14
14
|
"sap/ui/thirdparty/jquery"
|
|
15
|
-
], function
|
|
15
|
+
], function(
|
|
16
16
|
DtUtil,
|
|
17
17
|
OverlayRegistry,
|
|
18
18
|
FlexUtils,
|
|
@@ -31,12 +31,12 @@ sap.ui.define([
|
|
|
31
31
|
* @author SAP SE
|
|
32
32
|
* @experimental Since 1.58
|
|
33
33
|
* @since 1.58
|
|
34
|
-
* @version 1.
|
|
34
|
+
* @version 1.116.0
|
|
35
35
|
* @private
|
|
36
36
|
* @ui5-restricted
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
|
-
return function
|
|
39
|
+
return function(oRta) {
|
|
40
40
|
function makeAjaxCall(sPath) {
|
|
41
41
|
return new Promise(function(resolve, reject) {
|
|
42
42
|
var sUrl;
|
|
@@ -90,7 +90,7 @@ sap.ui.define([
|
|
|
90
90
|
var oView = sap.ui.getCore().byId(sViewId);
|
|
91
91
|
var oAppComponent = FlexUtils.getAppComponentForControl(oView);
|
|
92
92
|
var sControllerName = oView.getControllerName && oView.getControllerName() || oView.getController() && oView.getController().getMetadata().getName();
|
|
93
|
-
//Calculate moduleName for code extension
|
|
93
|
+
// Calculate moduleName for code extension
|
|
94
94
|
var sReference = FlexRuntimeInfoAPI.getFlexReference({element: oAppComponent});
|
|
95
95
|
var sModuleName = sReference.replace(/\.Component/g, "").replace(/\./g, "/");
|
|
96
96
|
sModuleName += "/changes/";
|
|
@@ -44,7 +44,7 @@ sap.ui.define([
|
|
|
44
44
|
* @author SAP SE
|
|
45
45
|
* @experimental Since 1.56
|
|
46
46
|
* @since 1.56
|
|
47
|
-
* @version 1.
|
|
47
|
+
* @version 1.116.0
|
|
48
48
|
* @private
|
|
49
49
|
* @ui5-restricted
|
|
50
50
|
*/
|
|
@@ -104,10 +104,10 @@ sap.ui.define([
|
|
|
104
104
|
|
|
105
105
|
oOutline._aConsideredExtensionPoints = [];
|
|
106
106
|
|
|
107
|
-
oOutline._attachNotConsideredExtensionPoints = function
|
|
107
|
+
oOutline._attachNotConsideredExtensionPoints = function(oOverlay, oData) {
|
|
108
108
|
var sViewId = FlUtils.getViewForControl(oOverlay.getElement()).getId();
|
|
109
109
|
var mExtensionPointInfos = getExtensionPointsForView(sViewId, this._aConsideredExtensionPoints);
|
|
110
|
-
Object.keys(mExtensionPointInfos).forEach(function
|
|
110
|
+
Object.keys(mExtensionPointInfos).forEach(function(sExtensionPointName, iIndex) {
|
|
111
111
|
var mExtensionPointInfo = mExtensionPointInfos[sExtensionPointName];
|
|
112
112
|
var mExtensionPointData = this._getExtensionPointData(mExtensionPointInfo);
|
|
113
113
|
mExtensionPointData.id = sViewId;
|
|
@@ -125,11 +125,11 @@ sap.ui.define([
|
|
|
125
125
|
* @param {int} [iDepth] - Depth of <code>childNode</code> levels that should be returned based on the given control
|
|
126
126
|
* @returns {OutlineObject[]} Array containing outline data for each root control
|
|
127
127
|
*/
|
|
128
|
-
oOutline._getOutline = function
|
|
128
|
+
oOutline._getOutline = function(sId, iDepth) {
|
|
129
129
|
var oResponse;
|
|
130
130
|
// Fix parameters if provided in different order
|
|
131
131
|
if (!iDepth && DtUtil.isInteger(sId)) {
|
|
132
|
-
//only depth, shift and start with the root
|
|
132
|
+
// only depth, shift and start with the root
|
|
133
133
|
iDepth = sId;
|
|
134
134
|
sId = undefined;
|
|
135
135
|
}
|
|
@@ -137,9 +137,9 @@ sap.ui.define([
|
|
|
137
137
|
var aInitialOverlays = [];
|
|
138
138
|
if (!sId) {
|
|
139
139
|
aInitialOverlays = oRta._oDesignTime.getRootElements()
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
.map(function(sRootElementId) {
|
|
141
|
+
return OverlayRegistry.getOverlay(sRootElementId);
|
|
142
|
+
});
|
|
143
143
|
} else {
|
|
144
144
|
var oPassedOverlay = OverlayRegistry.getOverlay(sId);
|
|
145
145
|
if (!oPassedOverlay) {
|
|
@@ -151,7 +151,7 @@ sap.ui.define([
|
|
|
151
151
|
aInitialOverlays.push(oPassedOverlay);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
oResponse = aInitialOverlays.map(function
|
|
154
|
+
oResponse = aInitialOverlays.map(function(oInitialOverlay) {
|
|
155
155
|
return this._getChildrenNodes(oInitialOverlay, iDepth);
|
|
156
156
|
}, this);
|
|
157
157
|
|
|
@@ -159,16 +159,16 @@ sap.ui.define([
|
|
|
159
159
|
return oResponse;
|
|
160
160
|
};
|
|
161
161
|
|
|
162
|
-
oOutline._getExtensionPoints = function
|
|
162
|
+
oOutline._getExtensionPoints = function(oData) {
|
|
163
163
|
var sParentId = oData.id;
|
|
164
164
|
var sAggregationName = oData.technicalName;
|
|
165
165
|
return ExtensionPointRegistryAPI.getExtensionPointInfoByParentId({parentId: sParentId})
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
166
|
+
.filter(function(mExtenstionPoint) {
|
|
167
|
+
return mExtenstionPoint.aggregationName === sAggregationName;
|
|
168
|
+
});
|
|
169
169
|
};
|
|
170
170
|
|
|
171
|
-
oOutline._getExtensionPointData = function
|
|
171
|
+
oOutline._getExtensionPointData = function(mExtensionPoint) {
|
|
172
172
|
return {
|
|
173
173
|
id: mExtensionPoint.targetControl.getId(),
|
|
174
174
|
name: mExtensionPoint.name,
|
|
@@ -176,24 +176,24 @@ sap.ui.define([
|
|
|
176
176
|
type: "extensionPoint",
|
|
177
177
|
icon: this.mExtensionPointMetadata.palette.icons.svg,
|
|
178
178
|
extensionPointInfo: {
|
|
179
|
-
defaultContent: mExtensionPoint.defaultContent.map(function
|
|
179
|
+
defaultContent: mExtensionPoint.defaultContent.map(function(oControl) {
|
|
180
180
|
return oControl.getId();
|
|
181
181
|
})
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
-
oOutline._enrichExtensionPointData = function
|
|
186
|
+
oOutline._enrichExtensionPointData = function(oData, oOverlay) {
|
|
187
187
|
var bIsDesignMode = Configuration.getDesignMode();
|
|
188
188
|
if (!bIsDesignMode) {
|
|
189
189
|
return undefined;
|
|
190
190
|
}
|
|
191
191
|
if (oData.type === "aggregation") {
|
|
192
192
|
var aExtensionPoints = this._getExtensionPoints(oData)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
aExtensionPoints.forEach(function
|
|
193
|
+
.sort(function(mExtensionPointA, mExtensionPointB) {
|
|
194
|
+
return mExtensionPointB.index - mExtensionPointA.index;
|
|
195
|
+
});
|
|
196
|
+
aExtensionPoints.forEach(function(mExtensionPoint) {
|
|
197
197
|
var mExtensionPointData = this._getExtensionPointData(mExtensionPoint);
|
|
198
198
|
oData.elements.splice(mExtensionPoint.index, 0, mExtensionPointData);
|
|
199
199
|
this._aConsideredExtensionPoints.push(mExtensionPointData.name);
|
|
@@ -214,28 +214,28 @@ sap.ui.define([
|
|
|
214
214
|
}, mInnerTemplateData[sAggregationName]);
|
|
215
215
|
}
|
|
216
216
|
return ((mTemplateData && mTemplateData.elements) || [])
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
.map(function(oElement) {
|
|
218
|
+
// Template
|
|
219
|
+
if (
|
|
220
|
+
oElement.type === "aggregationBindingTemplate"
|
|
221
221
|
|| oElement.parentAggregationName === sAggregationName
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
222
|
+
) {
|
|
223
|
+
return Object.assign({
|
|
224
|
+
templateFor: sAggregationOverlayId
|
|
225
|
+
}, oElement);
|
|
226
|
+
}
|
|
227
|
+
// Regular aggregation
|
|
228
|
+
return oElement.technicalName === sAggregationName && oElement;
|
|
229
|
+
})
|
|
230
|
+
.filter(Boolean)[0];
|
|
231
231
|
}
|
|
232
232
|
// Template root element
|
|
233
233
|
var aAggregationTemplateOverlays = (
|
|
234
234
|
oChildOverlay.getParentElementOverlay().getAggregationBindingTemplateOverlays
|
|
235
235
|
&& oChildOverlay.getParentElementOverlay().getAggregationBindingTemplateOverlays()
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
236
|
+
.reduce(function(aAllRootElementOverlaysInsideTemplates, oAggregationOverlay) {
|
|
237
|
+
return aAllRootElementOverlaysInsideTemplates.concat(oAggregationOverlay.getChildren());
|
|
238
|
+
}, [])
|
|
239
239
|
) || [];
|
|
240
240
|
if (aAggregationTemplateOverlays.includes(oChildOverlay)) {
|
|
241
241
|
return undefined;
|
|
@@ -263,7 +263,7 @@ sap.ui.define([
|
|
|
263
263
|
* @param {object} [mTemplateData] - Propagates template data to the aggregation template clones
|
|
264
264
|
* @returns {OutlineObject} Outline model data
|
|
265
265
|
*/
|
|
266
|
-
oOutline._getChildrenNodes = function
|
|
266
|
+
oOutline._getChildrenNodes = function(oOverlay, iDepth, oParentOverlay, mTemplateData) {
|
|
267
267
|
var bValidDepth = DtUtil.isInteger(iDepth);
|
|
268
268
|
var mAggregationTemplates = {};
|
|
269
269
|
|
|
@@ -271,11 +271,11 @@ sap.ui.define([
|
|
|
271
271
|
return {};
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
//get necessary properties from overlay
|
|
274
|
+
// get necessary properties from overlay
|
|
275
275
|
var oData = this._getNodeProperties(oOverlay, oParentOverlay, mTemplateData) || {};
|
|
276
276
|
|
|
277
277
|
var aChildren = oOverlay.getChildren();
|
|
278
|
-
//find aggregation binding template overlays
|
|
278
|
+
// find aggregation binding template overlays
|
|
279
279
|
var aAggregationTemplateOverlays = (
|
|
280
280
|
oOverlay.getAggregationBindingTemplateOverlays
|
|
281
281
|
&& oOverlay.getAggregationBindingTemplateOverlays()
|
|
@@ -289,30 +289,30 @@ sap.ui.define([
|
|
|
289
289
|
}, aChildren);
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
//check if the tree should be traversed deeper and children overlays are present
|
|
292
|
+
// check if the tree should be traversed deeper and children overlays are present
|
|
293
293
|
if ((!bValidDepth || (bValidDepth && iDepth > 0))
|
|
294
294
|
&& aChildren.length > 0
|
|
295
295
|
&& !isEmptyObject(oData)
|
|
296
296
|
) {
|
|
297
|
-
//decrement depth for children nodes
|
|
297
|
+
// decrement depth for children nodes
|
|
298
298
|
iDepth = bValidDepth ? iDepth - 1 : iDepth;
|
|
299
299
|
|
|
300
300
|
var mInnerTemplateData = {};
|
|
301
301
|
oData.elements = aChildren
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
//get extension point information if available
|
|
302
|
+
.map(function(oChildOverlay) {
|
|
303
|
+
var mNextTemplateData = getTemplateData(oChildOverlay, mTemplateData, mInnerTemplateData);
|
|
304
|
+
var oNextData = this._getChildrenNodes(oChildOverlay, iDepth, oChildOverlay.getParent(), mNextTemplateData);
|
|
305
|
+
if (oNextData.type === "aggregationBindingTemplate") {
|
|
306
|
+
var sAggregationName = mAggregationTemplates[oChildOverlay.getId()];
|
|
307
|
+
mInnerTemplateData[sAggregationName] = merge({}, oNextData);
|
|
308
|
+
}
|
|
309
|
+
return oNextData;
|
|
310
|
+
}, this)
|
|
311
|
+
.filter(function(oChildNode) {
|
|
312
|
+
return !isEmptyObject(oChildNode);
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// get extension point information if available
|
|
316
316
|
this._enrichExtensionPointData(oData, oOverlay);
|
|
317
317
|
}
|
|
318
318
|
|
|
@@ -414,7 +414,7 @@ sap.ui.define([
|
|
|
414
414
|
* @param {object} [mTemplateData] - Template data
|
|
415
415
|
* @returns {object} Data containing applicable properties
|
|
416
416
|
*/
|
|
417
|
-
oOutline._getNodeProperties = function
|
|
417
|
+
oOutline._getNodeProperties = function(oOverlay, oParentOverlay, mTemplateData) {
|
|
418
418
|
var oElement = oOverlay.getElement();
|
|
419
419
|
var oDtMetadata = oOverlay.getDesignTimeMetadata();
|
|
420
420
|
var oData = getDefaultData(oElement, oDtMetadata, mTemplateData);
|
|
@@ -525,13 +525,13 @@ sap.ui.define([
|
|
|
525
525
|
// Remove unwanted properties
|
|
526
526
|
oResponse = _omit(oResponse, ["elementOverlay", "editable", "target", "id", "elementId"]);
|
|
527
527
|
|
|
528
|
-
//Check if the new update already exists - if present remove the previous occurrence
|
|
528
|
+
// Check if the new update already exists - if present remove the previous occurrence
|
|
529
529
|
this.aUpdates = oOutline._removeDuplicate(this.aUpdates, oResponse);
|
|
530
530
|
|
|
531
531
|
this.aUpdates.push(oResponse);
|
|
532
532
|
|
|
533
533
|
if (this.sStatus === "initial") {
|
|
534
|
-
setTimeout(function
|
|
534
|
+
setTimeout(function() {
|
|
535
535
|
// need to check this.aUpdates still exists as destroy() can be called when setTimeout is still waiting
|
|
536
536
|
if (Array.isArray(this.aUpdates) && this.aUpdates.length > 0) {
|
|
537
537
|
this.sStatus = "initial";
|
|
@@ -546,7 +546,7 @@ sap.ui.define([
|
|
|
546
546
|
/**
|
|
547
547
|
* Detaches all event listeners that were attached from the outline service and performs a clean up.
|
|
548
548
|
*/
|
|
549
|
-
oOutline.destroy = function
|
|
549
|
+
oOutline.destroy = function() {
|
|
550
550
|
oRta._oDesignTime.detachEvent("elementOverlayCreated", this._updatesHandler, this);
|
|
551
551
|
oRta._oDesignTime.detachEvent("elementOverlayAdded", this._updatesHandler, this);
|
|
552
552
|
oRta._oDesignTime.detachEvent("elementOverlayMoved", this._updatesHandler, this);
|