@openui5/sap.ui.rta 1.92.0 → 1.93.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{.eslintrc → .eslintrc.json} +0 -0
- package/.reuse/dep5 +5 -0
- package/THIRDPARTY.txt +10 -1
- 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 +10 -2
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +1 -2
- 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 +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 +146 -125
- 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 +25 -14
- package/src/sap/ui/rta/command/LREPSerializer.js +25 -24
- 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/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 +2 -1
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.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 +47 -37
- package/src/sap/ui/rta/enablement/elementActionTest.js +29 -33
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +18 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +9 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +9 -0
- package/src/sap/ui/rta/messagebundle_ca.properties +9 -0
- package/src/sap/ui/rta/messagebundle_cs.properties +9 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +9 -0
- package/src/sap/ui/rta/messagebundle_da.properties +9 -0
- package/src/sap/ui/rta/messagebundle_de.properties +9 -0
- package/src/sap/ui/rta/messagebundle_el.properties +9 -0
- package/src/sap/ui/rta/messagebundle_en.properties +9 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +9 -0
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +9 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +9 -0
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +9 -0
- package/src/sap/ui/rta/messagebundle_es.properties +9 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +9 -0
- package/src/sap/ui/rta/messagebundle_et.properties +9 -0
- package/src/sap/ui/rta/messagebundle_fi.properties +9 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +9 -0
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +9 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +9 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +9 -0
- package/src/sap/ui/rta/messagebundle_hu.properties +9 -0
- package/src/sap/ui/rta/messagebundle_id.properties +9 -0
- package/src/sap/ui/rta/messagebundle_it.properties +9 -0
- package/src/sap/ui/rta/messagebundle_iw.properties +9 -0
- package/src/sap/ui/rta/messagebundle_ja.properties +9 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +9 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +9 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +9 -0
- package/src/sap/ui/rta/messagebundle_lv.properties +9 -0
- package/src/sap/ui/rta/messagebundle_ms.properties +9 -0
- package/src/sap/ui/rta/messagebundle_nl.properties +9 -0
- package/src/sap/ui/rta/messagebundle_no.properties +9 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +9 -0
- package/src/sap/ui/rta/messagebundle_pt.properties +9 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +9 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +9 -0
- package/src/sap/ui/rta/messagebundle_ru.properties +9 -0
- package/src/sap/ui/rta/messagebundle_sh.properties +9 -0
- package/src/sap/ui/rta/messagebundle_sk.properties +9 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +9 -0
- package/src/sap/ui/rta/messagebundle_sv.properties +9 -0
- package/src/sap/ui/rta/messagebundle_th.properties +9 -0
- package/src/sap/ui/rta/messagebundle_tr.properties +9 -0
- package/src/sap/ui/rta/messagebundle_uk.properties +9 -0
- package/src/sap/ui/rta/messagebundle_vi.properties +9 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +9 -0
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +9 -0
- 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/EasyAdd.js +1 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +2 -10
- 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 +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 +2 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +6 -5
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +14 -5
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +25 -4
- 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/toolbar/Adaptation.fragment.xml +12 -0
- package/src/sap/ui/rta/toolbar/Adaptation.js +10 -3
- package/src/sap/ui/rta/toolbar/Base.js +15 -10
- 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/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/DownloadTranslationDialog.fragment.xml +39 -0
- package/src/sap/ui/rta/toolbar/translation/Translation.js +115 -0
- package/src/sap/ui/rta/toolbar/translation/TranslationPopover.fragment.xml +19 -0
- package/src/sap/ui/rta/util/BindingsExtractor.js +14 -7
- 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/ServiceEventBus.js +1 -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 +3 -1
|
@@ -4,22 +4,23 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
+
"sap/base/util/merge",
|
|
8
|
+
"sap/base/Log",
|
|
7
9
|
"sap/ui/base/ManagedObject",
|
|
8
10
|
"sap/ui/dt/ElementUtil",
|
|
9
11
|
"sap/ui/dt/OverlayRegistry",
|
|
10
|
-
"sap/ui/fl/Utils",
|
|
11
|
-
"sap/ui/fl/Layer",
|
|
12
12
|
"sap/ui/dt/Util",
|
|
13
|
-
"sap/
|
|
14
|
-
|
|
15
|
-
function(
|
|
13
|
+
"sap/ui/fl/Utils",
|
|
14
|
+
"sap/ui/fl/Layer"
|
|
15
|
+
], function(
|
|
16
|
+
merge,
|
|
17
|
+
Log,
|
|
16
18
|
ManagedObject,
|
|
17
19
|
ElementUtil,
|
|
18
20
|
OverlayRegistry,
|
|
19
|
-
FlexUtils,
|
|
20
|
-
Layer,
|
|
21
21
|
DtUtil,
|
|
22
|
-
|
|
22
|
+
FlexUtils,
|
|
23
|
+
Layer
|
|
23
24
|
) {
|
|
24
25
|
"use strict";
|
|
25
26
|
|
|
@@ -71,14 +72,17 @@ function(
|
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
74
|
-
function configureActionCommand(
|
|
75
|
+
function configureActionCommand(oCommand, vAction) {
|
|
75
76
|
var sChangeType;
|
|
76
77
|
var bJsOnly = false;
|
|
77
|
-
|
|
78
|
+
var bVariantIndependent = false;
|
|
79
|
+
|
|
80
|
+
if (typeof vAction === "string") {
|
|
78
81
|
sChangeType = vAction;
|
|
79
|
-
} else {
|
|
80
|
-
sChangeType = vAction
|
|
81
|
-
bJsOnly = vAction
|
|
82
|
+
} else if (vAction) {
|
|
83
|
+
sChangeType = vAction.changeType;
|
|
84
|
+
bJsOnly = vAction.jsOnly === true;
|
|
85
|
+
bVariantIndependent = vAction.CAUTION_variantIndependent === true;
|
|
82
86
|
}
|
|
83
87
|
|
|
84
88
|
if (!sChangeType) {
|
|
@@ -87,6 +91,11 @@ function(
|
|
|
87
91
|
|
|
88
92
|
oCommand.setChangeType(sChangeType);
|
|
89
93
|
oCommand.setJsOnly(bJsOnly);
|
|
94
|
+
if (oCommand.setVariantIndependent) {
|
|
95
|
+
oCommand.setVariantIndependent(bVariantIndependent);
|
|
96
|
+
} else {
|
|
97
|
+
Log.error("the variant independent Flag is not available for the action used in: ", sChangeType);
|
|
98
|
+
}
|
|
90
99
|
return true;
|
|
91
100
|
}
|
|
92
101
|
|
|
@@ -95,7 +104,7 @@ function(
|
|
|
95
104
|
changeType: mSettings.name
|
|
96
105
|
};
|
|
97
106
|
if (oDesignTimeMetadata) {
|
|
98
|
-
|
|
107
|
+
Object.assign(oAction, oDesignTimeMetadata.getAction(mSettings.name, oElement));
|
|
99
108
|
}
|
|
100
109
|
return oAction;
|
|
101
110
|
}
|
|
@@ -244,205 +253,219 @@ function(
|
|
|
244
253
|
function configureCustomAddCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
245
254
|
var oAddAction = oDesignTimeMetadata.getAction("add", mSettings.element);
|
|
246
255
|
if (oAddAction && oAddAction.custom && typeof oAddAction.custom.getItems === "function") {
|
|
247
|
-
var oAction = {
|
|
256
|
+
var oAction = Object.assign(oAddAction.custom, {
|
|
248
257
|
changeOnRelevantContainer: mSettings.changeOnRelevantContainer,
|
|
249
258
|
changeType: mSettings.changeType
|
|
250
|
-
};
|
|
259
|
+
});
|
|
251
260
|
delete mSettings["changeOnRelevantContainer"]; // this property is not required for a sap.ui.rta.command.CustomAdd
|
|
252
261
|
return oAction;
|
|
253
262
|
}
|
|
263
|
+
return undefined;
|
|
254
264
|
}
|
|
255
265
|
|
|
256
|
-
|
|
266
|
+
function configureAddIFrame(oElement, mSettings, oDesignTimeMetadata) {
|
|
267
|
+
return oDesignTimeMetadata.getAction("addIFrame", mSettings.element) || oDesignTimeMetadata.getActionDataFromAggregations("addIFrame", mSettings.element)[0];
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function configureBindPropertyCommand() {
|
|
271
|
+
return "propertyBindingChange";
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function configurePropertyCommand() {
|
|
275
|
+
return "propertyChange";
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
var mCommands = { // Command names lower camel case
|
|
257
279
|
composite: {
|
|
258
|
-
clazz: "sap
|
|
280
|
+
clazz: "sap/ui/rta/command/CompositeCommand",
|
|
259
281
|
noSelector: true
|
|
260
282
|
},
|
|
261
283
|
property: {
|
|
262
|
-
clazz: "sap
|
|
263
|
-
adjustForBinding: adjustSelectorForCommand
|
|
284
|
+
clazz: "sap/ui/rta/command/Property",
|
|
285
|
+
adjustForBinding: adjustSelectorForCommand,
|
|
286
|
+
configure: configurePropertyCommand
|
|
264
287
|
},
|
|
265
288
|
bindProperty: {
|
|
266
|
-
clazz: "sap
|
|
289
|
+
clazz: "sap/ui/rta/command/BindProperty",
|
|
290
|
+
configure: configureBindPropertyCommand
|
|
267
291
|
},
|
|
268
292
|
addXML: {
|
|
269
|
-
clazz: "sap
|
|
293
|
+
clazz: "sap/ui/rta/command/AddXML",
|
|
270
294
|
configure: configureAddXmlCommand,
|
|
271
295
|
adjustForBinding: adjustSelectorForCommand
|
|
272
296
|
},
|
|
273
297
|
addXMLAtExtensionPoint: {
|
|
274
|
-
clazz: "sap
|
|
298
|
+
clazz: "sap/ui/rta/command/AddXMLAtExtensionPoint",
|
|
275
299
|
configure: configureAddXmlCommand,
|
|
276
300
|
adjustForBinding: adjustSelectorForCommand
|
|
277
301
|
},
|
|
278
302
|
createContainer: {
|
|
279
|
-
clazz: "sap
|
|
303
|
+
clazz: "sap/ui/rta/command/CreateContainer",
|
|
280
304
|
configure: configureCreateContainerCommand,
|
|
281
305
|
adjustForBinding: adjustCreateContainerCommand
|
|
282
306
|
},
|
|
283
307
|
move: {
|
|
284
|
-
clazz: "sap
|
|
308
|
+
clazz: "sap/ui/rta/command/Move",
|
|
285
309
|
configure: configureMoveCommand,
|
|
286
310
|
adjustForBinding: adjustMoveCommand
|
|
287
311
|
},
|
|
288
312
|
remove: {
|
|
289
|
-
clazz: "sap
|
|
313
|
+
clazz: "sap/ui/rta/command/Remove",
|
|
290
314
|
configure: configureRemoveCommand,
|
|
291
315
|
adjustForBinding: adjustRemoveCommand
|
|
292
316
|
},
|
|
293
317
|
localReset: {
|
|
294
|
-
clazz: "sap
|
|
318
|
+
clazz: "sap/ui/rta/command/LocalReset",
|
|
295
319
|
configure: configureLocalResetCommand
|
|
296
320
|
},
|
|
297
321
|
rename: {
|
|
298
|
-
clazz: "sap
|
|
322
|
+
clazz: "sap/ui/rta/command/Rename",
|
|
299
323
|
configure: configureRenameCommand,
|
|
300
324
|
adjustForBinding: adjustRenameCommand
|
|
301
325
|
},
|
|
302
326
|
addDelegateProperty: {
|
|
303
|
-
clazz: "sap
|
|
327
|
+
clazz: "sap/ui/rta/command/AddProperty",
|
|
304
328
|
configure: configureAddDelegatePropertyCommand,
|
|
305
329
|
adjustForBinding: adjustAddPropertyCommand
|
|
306
330
|
},
|
|
307
331
|
reveal: {
|
|
308
|
-
clazz: "sap
|
|
332
|
+
clazz: "sap/ui/rta/command/Reveal",
|
|
309
333
|
configure: configureRevealCommand,
|
|
310
334
|
adjustForBinding: adjustRevealCommand
|
|
311
335
|
},
|
|
312
336
|
customAdd: {
|
|
313
|
-
clazz: "sap
|
|
337
|
+
clazz: "sap/ui/rta/command/CustomAdd",
|
|
314
338
|
configure: configureCustomAddCommand
|
|
315
339
|
},
|
|
316
340
|
combine: {
|
|
317
|
-
clazz: "sap
|
|
341
|
+
clazz: "sap/ui/rta/command/Combine",
|
|
318
342
|
configure: configureCombineCommand,
|
|
319
343
|
adjustForBinding: adjustCombineCommand
|
|
320
344
|
},
|
|
321
345
|
split: {
|
|
322
|
-
clazz: "sap
|
|
346
|
+
clazz: "sap/ui/rta/command/Split",
|
|
323
347
|
configure: configureSplitCommand,
|
|
324
348
|
adjustForBinding: adjustSplitCommand
|
|
325
349
|
},
|
|
326
350
|
"switch": {
|
|
327
|
-
clazz: "sap
|
|
351
|
+
clazz: "sap/ui/rta/command/ControlVariantSwitch"
|
|
328
352
|
},
|
|
329
353
|
save: {
|
|
330
|
-
clazz: "sap
|
|
354
|
+
clazz: "sap/ui/rta/command/ControlVariantSave"
|
|
331
355
|
},
|
|
332
356
|
saveAs: {
|
|
333
|
-
clazz: "sap
|
|
357
|
+
clazz: "sap/ui/rta/command/ControlVariantSaveAs"
|
|
334
358
|
},
|
|
335
359
|
setTitle: {
|
|
336
|
-
clazz: "sap
|
|
360
|
+
clazz: "sap/ui/rta/command/ControlVariantSetTitle"
|
|
337
361
|
},
|
|
338
362
|
configure: {
|
|
339
|
-
clazz: "sap
|
|
363
|
+
clazz: "sap/ui/rta/command/ControlVariantConfigure"
|
|
340
364
|
},
|
|
341
365
|
settings: {
|
|
342
|
-
clazz: "sap
|
|
366
|
+
clazz: "sap/ui/rta/command/Settings"
|
|
343
367
|
},
|
|
344
368
|
addLibrary: {
|
|
345
|
-
clazz: "sap
|
|
369
|
+
clazz: "sap/ui/rta/command/appDescriptor/AddLibrary",
|
|
346
370
|
noSelector: true
|
|
347
371
|
},
|
|
348
372
|
appDescriptor: {
|
|
349
|
-
clazz: "sap
|
|
373
|
+
clazz: "sap/ui/rta/command/AppDescriptorCommand",
|
|
350
374
|
noSelector: true
|
|
351
375
|
},
|
|
352
376
|
addIFrame: {
|
|
353
|
-
clazz: "sap
|
|
377
|
+
clazz: "sap/ui/rta/command/AddIFrame",
|
|
378
|
+
configure: configureAddIFrame
|
|
354
379
|
},
|
|
355
380
|
compVariantSaveAs: {
|
|
356
|
-
clazz: "sap
|
|
381
|
+
clazz: "sap/ui/rta/command/compVariant/CompVariantSaveAs"
|
|
357
382
|
},
|
|
358
383
|
compVariantSwitch: {
|
|
359
|
-
clazz: "sap
|
|
384
|
+
clazz: "sap/ui/rta/command/compVariant/CompVariantSwitch"
|
|
360
385
|
},
|
|
361
386
|
compVariantUpdate: {
|
|
362
|
-
clazz: "sap
|
|
387
|
+
clazz: "sap/ui/rta/command/compVariant/CompVariantUpdate"
|
|
363
388
|
}
|
|
364
389
|
};
|
|
365
390
|
|
|
366
|
-
function
|
|
391
|
+
function getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings, sVariantManagementReference) {
|
|
392
|
+
var oCommand;
|
|
367
393
|
sCommand = sCommand[0].toLowerCase() + sCommand.slice(1); // first char of command name is lower case
|
|
368
394
|
var mCommand = mCommands[sCommand];
|
|
369
395
|
var mAllFlexSettings = mFlexSettings;
|
|
370
396
|
|
|
371
397
|
if (!mCommand) {
|
|
372
|
-
return Promise.reject(DtUtil.createError("CommandFactory#
|
|
398
|
+
return Promise.reject(DtUtil.createError("CommandFactory#getCommandFor", "Command '" + sCommand + "' doesn't exist, check typing", "sap.ui.rta"));
|
|
373
399
|
}
|
|
374
400
|
|
|
375
401
|
return new Promise(function (fnResolve) {
|
|
376
402
|
var sClassName = mCommand.clazz;
|
|
377
|
-
sap.ui.require([sClassName
|
|
403
|
+
sap.ui.require([sClassName], function (Command) {
|
|
378
404
|
fnResolve(Command);
|
|
379
405
|
});
|
|
380
406
|
})
|
|
381
407
|
|
|
382
|
-
|
|
383
|
-
|
|
408
|
+
.then(function (Command) {
|
|
409
|
+
var bIsUiElement = vElement instanceof ManagedObject;
|
|
384
410
|
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
411
|
+
// only sap.ui.rta.command.FlexCommand requires a selector property
|
|
412
|
+
if (!mCommand.noSelector) {
|
|
413
|
+
mSettings = Object.assign({}, mSettings, !bIsUiElement && {selector: vElement});
|
|
414
|
+
}
|
|
389
415
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
416
|
+
mSettings = Object.assign({}, mSettings, {
|
|
417
|
+
element: bIsUiElement ? vElement : undefined,
|
|
418
|
+
name: sCommand
|
|
419
|
+
});
|
|
394
420
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
421
|
+
var oAction;
|
|
422
|
+
if (mCommand.configure) {
|
|
423
|
+
oAction = mCommand.configure(vElement, mSettings, oDesignTimeMetadata);
|
|
424
|
+
}
|
|
399
425
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
426
|
+
var oElementOverlay;
|
|
427
|
+
if (bIsUiElement) {
|
|
428
|
+
oElementOverlay = OverlayRegistry.getOverlay(vElement);
|
|
429
|
+
}
|
|
404
430
|
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
431
|
+
if (oAction && oAction.changeOnRelevantContainer) {
|
|
432
|
+
Object.assign(mSettings, {
|
|
433
|
+
element: oElementOverlay.getRelevantContainer()
|
|
434
|
+
});
|
|
435
|
+
vElement = mSettings.element;
|
|
436
|
+
oElementOverlay = OverlayRegistry.getOverlay(vElement);
|
|
437
|
+
}
|
|
412
438
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
439
|
+
var mTemplateSettings;
|
|
440
|
+
if (oElementOverlay && vElement.sParentAggregationName) {
|
|
441
|
+
mTemplateSettings = evaluateTemplateBinding(oElementOverlay);
|
|
442
|
+
}
|
|
417
443
|
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
mAllFlexSettings = merge(mTemplateSettings, mAllFlexSettings);
|
|
444
|
+
if (mTemplateSettings) {
|
|
445
|
+
if (mCommand.adjustForBinding) {
|
|
446
|
+
mCommand.adjustForBinding(mSettings);
|
|
423
447
|
}
|
|
448
|
+
mAllFlexSettings = merge(mTemplateSettings, mAllFlexSettings);
|
|
449
|
+
}
|
|
424
450
|
|
|
425
|
-
|
|
451
|
+
oCommand = new Command(mSettings);
|
|
426
452
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
453
|
+
var bSuccessfullyConfigured = true; //configuration is optional
|
|
454
|
+
if (mCommand.configure) {
|
|
455
|
+
bSuccessfullyConfigured = configureActionCommand(oCommand, oAction);
|
|
456
|
+
}
|
|
431
457
|
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
oCommand.destroy();
|
|
444
|
-
return undefined;
|
|
445
|
-
});
|
|
458
|
+
if (bSuccessfullyConfigured) {
|
|
459
|
+
return oCommand.prepare(mAllFlexSettings, sVariantManagementReference, sCommand);
|
|
460
|
+
}
|
|
461
|
+
return undefined;
|
|
462
|
+
}).then(function(bPrepareStatus) {
|
|
463
|
+
if (bPrepareStatus) {
|
|
464
|
+
return oCommand;
|
|
465
|
+
}
|
|
466
|
+
oCommand.destroy();
|
|
467
|
+
return undefined;
|
|
468
|
+
});
|
|
446
469
|
}
|
|
447
470
|
|
|
448
471
|
/**
|
|
@@ -452,7 +475,7 @@ function(
|
|
|
452
475
|
* @extends sap.ui.base.ManagedObject
|
|
453
476
|
*
|
|
454
477
|
* @author SAP SE
|
|
455
|
-
* @version 1.
|
|
478
|
+
* @version 1.93.3
|
|
456
479
|
*
|
|
457
480
|
* @constructor
|
|
458
481
|
* @private
|
|
@@ -468,9 +491,7 @@ function(
|
|
|
468
491
|
flexSettings: {
|
|
469
492
|
type: "object"
|
|
470
493
|
}
|
|
471
|
-
}
|
|
472
|
-
associations: {},
|
|
473
|
-
events: {}
|
|
494
|
+
}
|
|
474
495
|
}
|
|
475
496
|
});
|
|
476
497
|
|
|
@@ -482,39 +503,39 @@ function(
|
|
|
482
503
|
};
|
|
483
504
|
|
|
484
505
|
/**
|
|
485
|
-
* Setter for flexSettings
|
|
506
|
+
* Setter for flexSettings. Extends the current flex Settings by the passed object
|
|
486
507
|
*
|
|
487
|
-
* @param {Object} [mFlexSettings]
|
|
508
|
+
* @param {Object} [mFlexSettings] - Property bag. See {@link sap.ui.rta.RuntimeAuthoring#setFlexSettings} method for more information
|
|
488
509
|
*/
|
|
489
510
|
CommandFactory.prototype.setFlexSettings = function (mFlexSettings) {
|
|
490
|
-
this.setProperty("flexSettings",
|
|
511
|
+
this.setProperty("flexSettings", Object.assign(this.getFlexSettings(), mFlexSettings));
|
|
491
512
|
};
|
|
492
513
|
|
|
493
514
|
/**
|
|
494
515
|
* Instance-specific method for generating command
|
|
495
|
-
* @param {sap.ui.core.Element|string} vElement -
|
|
496
|
-
* @param {string} sCommand -
|
|
497
|
-
* @param {object} mSettings -
|
|
498
|
-
* @param {sap.ui.dt.DesignTimeMetadata} oDesignTimeMetadata -
|
|
499
|
-
* @param {string} sVariantManagementReference -
|
|
516
|
+
* @param {sap.ui.core.Element|string} vElement - Could be either an element or a slector for the element for which the command is to be created
|
|
517
|
+
* @param {string} sCommand - Command type
|
|
518
|
+
* @param {object} mSettings - Initial settings for the new command (command specific settings, looks diffrent for each and every command)
|
|
519
|
+
* @param {sap.ui.dt.DesignTimeMetadata} oDesignTimeMetadata - Contains the action used in the command
|
|
520
|
+
* @param {string} sVariantManagementReference - Variant management reference
|
|
500
521
|
* @returns {Promise} A promise which will return the created command
|
|
501
522
|
*/
|
|
502
523
|
CommandFactory.prototype.getCommandFor = function (vElement, sCommand, mSettings, oDesignTimeMetadata, sVariantManagementReference) {
|
|
503
|
-
return
|
|
524
|
+
return getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, this.getFlexSettings(), sVariantManagementReference);
|
|
504
525
|
};
|
|
505
526
|
|
|
506
527
|
/**
|
|
507
528
|
* Static method for generating command
|
|
508
|
-
* @param {sap.ui.Element|string} vElement -
|
|
509
|
-
* @param {string} sCommand -
|
|
510
|
-
* @param {object} mSettings -
|
|
511
|
-
* @param {sap.ui.dt.DesignTimeMetadata} oDesignTimeMetadata -
|
|
512
|
-
* @param {Object} [mFlexSettings]
|
|
513
|
-
* @param {String} [mFlexSettings.layer] The Layer in which RTA should be started. Default: "CUSTOMER"
|
|
514
|
-
* @param {Boolean} [mFlexSettings.developerMode] Whether RTA is started in DeveloperMode Mode. Whether RTA is started in DeveloperMode Mode
|
|
515
|
-
* @param {String} [mFlexSettings.baseId]
|
|
516
|
-
* @param {String} [mFlexSettings.projectId]
|
|
517
|
-
* @param {String} [mFlexSettings.scenario] Key representing the current scenario
|
|
529
|
+
* @param {sap.ui.Element|string} vElement - Could be either an element or a slector for the element for which the command is to be created
|
|
530
|
+
* @param {string} sCommand - Command type
|
|
531
|
+
* @param {object} mSettings - Initial settings for the new command (command specific settings, looks diffrent for each and every command)
|
|
532
|
+
* @param {sap.ui.dt.DesignTimeMetadata} oDesignTimeMetadata - Contains the action used in the command
|
|
533
|
+
* @param {Object} [mFlexSettings] - Property bag
|
|
534
|
+
* @param {String} [mFlexSettings.layer] - The Layer in which RTA should be started. Default: "CUSTOMER"
|
|
535
|
+
* @param {Boolean} [mFlexSettings.developerMode] - Whether RTA is started in DeveloperMode Mode. Whether RTA is started in DeveloperMode Mode
|
|
536
|
+
* @param {String} [mFlexSettings.baseId] - Base ID of the app
|
|
537
|
+
* @param {String} [mFlexSettings.projectId] - Project ID
|
|
538
|
+
* @param {String} [mFlexSettings.scenario] - Key representing the current scenario
|
|
518
539
|
* @returns {Promise} A promise which will return the created command
|
|
519
540
|
*/
|
|
520
541
|
CommandFactory.getCommandFor = function (vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings) {
|
|
@@ -531,7 +552,7 @@ function(
|
|
|
531
552
|
mFlexSettings.namespace = sLRepRootNamespace + "changes/";
|
|
532
553
|
}
|
|
533
554
|
|
|
534
|
-
return
|
|
555
|
+
return getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings);
|
|
535
556
|
};
|
|
536
557
|
|
|
537
558
|
return CommandFactory;
|