@openui5/sap.ui.rta 1.140.0 → 1.141.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRDPARTY.txt +2 -2
- package/package.json +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 +6 -8
- package/src/sap/ui/rta/command/AddProperty.js +2 -2
- package/src/sap/ui/rta/command/AddXML.js +3 -3
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +17 -19
- package/src/sap/ui/rta/command/AnnotationCommand.js +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +3 -4
- package/src/sap/ui/rta/command/BindProperty.js +4 -4
- package/src/sap/ui/rta/command/Combine.js +4 -4
- package/src/sap/ui/rta/command/CommandFactory.js +55 -77
- package/src/sap/ui/rta/command/CompositeCommand.js +19 -39
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +16 -20
- package/src/sap/ui/rta/command/ControlVariantSave.js +19 -28
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +38 -43
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +15 -26
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +29 -50
- package/src/sap/ui/rta/command/CreateContainer.js +3 -3
- package/src/sap/ui/rta/command/CustomAdd.js +2 -2
- package/src/sap/ui/rta/command/ExtendControllerCommand.js +2 -4
- package/src/sap/ui/rta/command/FlexCommand.js +34 -44
- package/src/sap/ui/rta/command/LREPSerializer.js +20 -23
- package/src/sap/ui/rta/command/LocalReset.js +3 -3
- package/src/sap/ui/rta/command/ManifestCommand.js +1 -1
- package/src/sap/ui/rta/command/Move.js +5 -5
- package/src/sap/ui/rta/command/Property.js +3 -3
- package/src/sap/ui/rta/command/Remove.js +4 -4
- package/src/sap/ui/rta/command/Rename.js +3 -3
- package/src/sap/ui/rta/command/Resize.js +2 -2
- package/src/sap/ui/rta/command/Reveal.js +3 -3
- package/src/sap/ui/rta/command/Settings.js +2 -2
- package/src/sap/ui/rta/command/Split.js +3 -3
- package/src/sap/ui/rta/command/Stack.js +51 -55
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +10 -10
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +4 -4
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +11 -11
- package/src/sap/ui/rta/command/manifest/AddLibrary.js +4 -8
- package/src/sap/ui/rta/enablement/elementActionTest.js +21 -9
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle_da.properties +1 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +1 -1
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/AddXMLPlugin.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 +65 -87
- 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/ExtendControllerPlugin.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +26 -35
- 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/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 +7 -6
- 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/AdditionalElementsAnalyzer.js +17 -5
- 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/annotations/AnnotationChangeDialog.js +1 -1
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +1 -1
- package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- package/src/sap/ui/rta/plugin/rename/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/rename/RenameDialog.js +2 -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/service/SupportTools.js +1 -1
- 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/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +3 -3
- package/src/sap/ui/rta/util/ReloadManager.js +1 -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/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
- package/src/sap/ui/rta/util/changeVisualization/resolveBinding.js +1 -1
- package/src/sap/ui/rta/util/guidedTour/GuidedTour.js +1 -1
- package/src/sap/ui/rta/util/guidedTour/content/GeneralTour.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
|
@@ -12,13 +12,13 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
12
12
|
* @class
|
|
13
13
|
* @extends sap.ui.rta.command.FlexCommand
|
|
14
14
|
* @author SAP SE
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.141.0
|
|
16
16
|
* @constructor
|
|
17
17
|
* @private
|
|
18
18
|
* @since 1.44
|
|
19
19
|
* @alias sap.ui.rta.command.Settings
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
const Settings = FlexCommand.extend("sap.ui.rta.command.Settings", {
|
|
22
22
|
metadata: {
|
|
23
23
|
library: "sap.ui.rta",
|
|
24
24
|
properties: {
|
|
@@ -14,13 +14,13 @@ sap.ui.define([
|
|
|
14
14
|
* @class
|
|
15
15
|
* @extends sap.ui.rta.command.FlexCommand
|
|
16
16
|
* @author SAP SE
|
|
17
|
-
* @version 1.
|
|
17
|
+
* @version 1.141.0
|
|
18
18
|
* @constructor
|
|
19
19
|
* @private
|
|
20
20
|
* @since 1.46
|
|
21
21
|
* @alias sap.ui.rta.command.Split
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
const Split = FlexCommand.extend("sap.ui.rta.command.Split", {
|
|
24
24
|
metadata: {
|
|
25
25
|
library: "sap.ui.rta",
|
|
26
26
|
properties: {
|
|
@@ -46,7 +46,7 @@ sap.ui.define([
|
|
|
46
46
|
* @override
|
|
47
47
|
*/
|
|
48
48
|
Split.prototype._getChangeSpecificData = function() {
|
|
49
|
-
|
|
49
|
+
const mSpecificInfo = {
|
|
50
50
|
changeType: this.getChangeType(),
|
|
51
51
|
content: {
|
|
52
52
|
newElementIds: this.getNewElementIds(),
|
|
@@ -28,24 +28,16 @@ sap.ui.define([
|
|
|
28
28
|
) {
|
|
29
29
|
"use strict";
|
|
30
30
|
|
|
31
|
-
function toAvailableChanges(mChanges, aChanges, sFileName) {
|
|
32
|
-
var oChange = mChanges[sFileName];
|
|
33
|
-
if (oChange) {
|
|
34
|
-
aChanges.push(oChange);
|
|
35
|
-
}
|
|
36
|
-
return aChanges;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
31
|
function pushToStack(oComponent, mComposite, oStack, oChange) {
|
|
40
|
-
|
|
41
|
-
|
|
32
|
+
const oSelector = oChange.getSelector && oChange.getSelector();
|
|
33
|
+
const oCommand = new Settings({
|
|
42
34
|
selector: oSelector,
|
|
43
35
|
changeType: oChange.getChangeType(),
|
|
44
36
|
element: JsControlTreeModifier.bySelector(oSelector, oComponent)
|
|
45
37
|
});
|
|
46
38
|
oCommand._oPreparedChange = oChange;
|
|
47
39
|
// check if change belongs to a composite command
|
|
48
|
-
|
|
40
|
+
const sCompositeId = oChange.getSupportInformation().compositeCommand;
|
|
49
41
|
if (sCompositeId) {
|
|
50
42
|
if (!mComposite[sCompositeId]) {
|
|
51
43
|
mComposite[sCompositeId] = new CompositeCommand();
|
|
@@ -92,13 +84,13 @@ sap.ui.define([
|
|
|
92
84
|
* @class
|
|
93
85
|
* @extends sap.ui.base.ManagedObject
|
|
94
86
|
* @author SAP SE
|
|
95
|
-
* @version 1.
|
|
87
|
+
* @version 1.141.0
|
|
96
88
|
* @constructor
|
|
97
89
|
* @private
|
|
98
90
|
* @since 1.34
|
|
99
91
|
* @alias sap.ui.rta.command.Stack
|
|
100
92
|
*/
|
|
101
|
-
|
|
93
|
+
const Stack = ManagedObject.extend("sap.ui.rta.command.Stack", {
|
|
102
94
|
metadata: {
|
|
103
95
|
library: "sap.ui.rta",
|
|
104
96
|
properties: {
|
|
@@ -146,33 +138,35 @@ sap.ui.define([
|
|
|
146
138
|
* Creates a stack prefilled with Settings commands. Every command contains a change from the given file name list
|
|
147
139
|
*
|
|
148
140
|
* @param {sap.ui.base.ManagedObject} oControl - Used to get the component
|
|
149
|
-
* @param {string[]} aFileNames - Array of file names of changes the stack should be initialized with
|
|
141
|
+
* @param {string[]} [aFileNames] - Array of file names of changes the stack should be initialized with
|
|
150
142
|
* @returns {Promise} Resolves with a stack as parameter
|
|
151
143
|
*/
|
|
152
|
-
Stack.initializeWithChanges = function(oControl, aFileNames) {
|
|
153
|
-
|
|
144
|
+
Stack.initializeWithChanges = async function(oControl, aFileNames) {
|
|
145
|
+
const oStack = new Stack();
|
|
154
146
|
oStack._aPersistedChanges = aFileNames;
|
|
155
|
-
if (aFileNames
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
if (aFileNames?.length > 0) {
|
|
148
|
+
const oComponent = FlUtils.getAppComponentForControl(oControl);
|
|
149
|
+
const mPropertyBag = {
|
|
158
150
|
selector: oComponent,
|
|
159
151
|
invalidateCache: false
|
|
160
152
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
aChanges.forEach(function(oChange) {
|
|
167
|
-
mChanges[oChange.getId()] = oChange;
|
|
168
|
-
});
|
|
169
|
-
aFileNames
|
|
170
|
-
.reduce(toAvailableChanges.bind(null, mChanges), [])
|
|
171
|
-
.forEach(pushToStack.bind(null, oComponent, mComposite, oStack));
|
|
172
|
-
return oStack;
|
|
153
|
+
const aChanges = await PersistenceWriteAPI._getUIChanges(mPropertyBag);
|
|
154
|
+
const mComposite = {};
|
|
155
|
+
const mChanges = {};
|
|
156
|
+
aChanges.forEach((oChange) => {
|
|
157
|
+
mChanges[oChange.getId()] = oChange;
|
|
173
158
|
});
|
|
159
|
+
aFileNames
|
|
160
|
+
.reduce((aChanges, sFileName) => {
|
|
161
|
+
const oChange = mChanges[sFileName];
|
|
162
|
+
if (oChange) {
|
|
163
|
+
aChanges.push(oChange);
|
|
164
|
+
}
|
|
165
|
+
return aChanges;
|
|
166
|
+
}, [])
|
|
167
|
+
.forEach(pushToStack.bind(null, oComponent, mComposite, oStack));
|
|
174
168
|
}
|
|
175
|
-
return
|
|
169
|
+
return oStack;
|
|
176
170
|
};
|
|
177
171
|
|
|
178
172
|
Stack.prototype.init = function() {
|
|
@@ -221,12 +215,12 @@ sap.ui.define([
|
|
|
221
215
|
};
|
|
222
216
|
|
|
223
217
|
Stack.prototype.removeCommand = function(vObject, bSuppressInvalidate) {
|
|
224
|
-
|
|
218
|
+
const oRemovedCommand = this.removeAggregation("commands", vObject, bSuppressInvalidate);
|
|
225
219
|
return oRemovedCommand;
|
|
226
220
|
};
|
|
227
221
|
|
|
228
222
|
Stack.prototype.removeAllCommands = function(bSuppressInvalidate) {
|
|
229
|
-
|
|
223
|
+
const aCommands = this.removeAllAggregation("commands", bSuppressInvalidate);
|
|
230
224
|
this._toBeExecuted = -1;
|
|
231
225
|
this.fireModified();
|
|
232
226
|
return aCommands;
|
|
@@ -297,10 +291,12 @@ sap.ui.define([
|
|
|
297
291
|
|
|
298
292
|
Stack.prototype.execute = function() {
|
|
299
293
|
this.setLastCommandExecuted(
|
|
300
|
-
this.getLastCommandExecuted()
|
|
294
|
+
this.getLastCommandExecuted()
|
|
295
|
+
.catch(() => {
|
|
301
296
|
// continue also if previous command failed
|
|
302
|
-
})
|
|
303
|
-
|
|
297
|
+
})
|
|
298
|
+
.then(async () => {
|
|
299
|
+
const oCommand = this._getCommandToBeExecuted();
|
|
304
300
|
if (oCommand) {
|
|
305
301
|
try {
|
|
306
302
|
await addCommandChangesToPersistence.call(this, oCommand);
|
|
@@ -318,7 +314,7 @@ sap.ui.define([
|
|
|
318
314
|
this._toBeExecuted--;
|
|
319
315
|
// Remove Flex Changes for failed command from persistence
|
|
320
316
|
removeCommandChangesFromPersistence.call(this, oError.command);
|
|
321
|
-
|
|
317
|
+
const oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
|
|
322
318
|
// AddXMLAtExtensionPoint errors explain to the user what they did wrong, so they shouldn't open an incident
|
|
323
319
|
const sErrorMessage = oCommand.isA("sap.ui.rta.command.AddXMLAtExtensionPoint") ?
|
|
324
320
|
oError.message : oRtaResourceBundle.getText("MSG_GENERIC_ERROR_MESSAGE", [oError.message]);
|
|
@@ -338,13 +334,15 @@ sap.ui.define([
|
|
|
338
334
|
|
|
339
335
|
Stack.prototype._unExecute = function() {
|
|
340
336
|
this.setLastCommandUnExecuted(
|
|
341
|
-
this.getLastCommandUnExecuted()
|
|
337
|
+
this.getLastCommandUnExecuted()
|
|
338
|
+
.catch(() => {
|
|
342
339
|
// continue also if previous undo failed
|
|
343
|
-
})
|
|
340
|
+
})
|
|
341
|
+
.then(async () => {
|
|
344
342
|
if (this.canUndo()) {
|
|
345
343
|
this._bUndoneCommands = true;
|
|
346
344
|
this._toBeExecuted++;
|
|
347
|
-
|
|
345
|
+
const oCommand = this._getCommandToBeExecuted();
|
|
348
346
|
const aDiscardedChanges = oCommand.getDiscardedChanges?.();
|
|
349
347
|
if (oCommand) {
|
|
350
348
|
await oCommand.undo();
|
|
@@ -365,9 +363,7 @@ sap.ui.define([
|
|
|
365
363
|
};
|
|
366
364
|
|
|
367
365
|
Stack.prototype.canSave = function() {
|
|
368
|
-
return this.canUndo() && this.getAllExecutedCommands().some(
|
|
369
|
-
return oCommand.getRelevantForSave();
|
|
370
|
-
});
|
|
366
|
+
return this.canUndo() && this.getAllExecutedCommands().some((oCommand) => oCommand.getRelevantForSave());
|
|
371
367
|
};
|
|
372
368
|
|
|
373
369
|
Stack.prototype.undo = function() {
|
|
@@ -394,10 +390,10 @@ sap.ui.define([
|
|
|
394
390
|
* @public
|
|
395
391
|
*/
|
|
396
392
|
Stack.prototype.getAllExecutedCommands = function() {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
for (
|
|
400
|
-
|
|
393
|
+
let aAllExecutedCommands = [];
|
|
394
|
+
const aCommands = this.getCommands();
|
|
395
|
+
for (let i = aCommands.length - 1; i > this._toBeExecuted; i--) {
|
|
396
|
+
const aSubCommands = this.getSubCommands(aCommands[i]);
|
|
401
397
|
aAllExecutedCommands = aAllExecutedCommands.concat(aSubCommands);
|
|
402
398
|
}
|
|
403
399
|
return aAllExecutedCommands;
|
|
@@ -411,12 +407,12 @@ sap.ui.define([
|
|
|
411
407
|
* @private
|
|
412
408
|
*/
|
|
413
409
|
Stack.prototype.getSubCommands = function(oCommand) {
|
|
414
|
-
|
|
410
|
+
let aCommands = [];
|
|
415
411
|
if (oCommand.getCommands) {
|
|
416
|
-
oCommand.getCommands().forEach(
|
|
417
|
-
|
|
412
|
+
oCommand.getCommands().forEach((oSubCommand) => {
|
|
413
|
+
const aSubCommands = this.getSubCommands(oSubCommand);
|
|
418
414
|
aCommands = aCommands.concat(aSubCommands);
|
|
419
|
-
}
|
|
415
|
+
});
|
|
420
416
|
} else {
|
|
421
417
|
aCommands.push(oCommand);
|
|
422
418
|
}
|
|
@@ -430,10 +426,10 @@ sap.ui.define([
|
|
|
430
426
|
* @private
|
|
431
427
|
*/
|
|
432
428
|
Stack.prototype.compositeLastTwoCommands = function() {
|
|
433
|
-
|
|
434
|
-
|
|
429
|
+
const oLastCommand = this.pop();
|
|
430
|
+
const oSecondLastCommand = this.pop();
|
|
435
431
|
|
|
436
|
-
|
|
432
|
+
const oCompositeCommand = new CompositeCommand();
|
|
437
433
|
oCompositeCommand.addCommand(oSecondLastCommand);
|
|
438
434
|
oCompositeCommand.addCommand(oLastCommand);
|
|
439
435
|
this.push(oCompositeCommand);
|
|
@@ -20,13 +20,13 @@ sap.ui.define([
|
|
|
20
20
|
* @class
|
|
21
21
|
* @extends sap.ui.rta.command.BaseCommand
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.141.0
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.102
|
|
27
27
|
* @alias sap.ui.rta.command.compVariant.CompVariantContent
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
const CompVariantContent = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantContent", {
|
|
30
30
|
metadata: {
|
|
31
31
|
library: "sap.ui.rta",
|
|
32
32
|
properties: {
|
|
@@ -47,7 +47,7 @@ sap.ui.define([
|
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
function callFlAPIFunction(sFunctionName, sKey, oValue) {
|
|
50
|
-
|
|
50
|
+
const mPropertyBag = {
|
|
51
51
|
...oValue,
|
|
52
52
|
...this.mInformation,
|
|
53
53
|
id: sKey,
|
|
@@ -58,11 +58,11 @@ sap.ui.define([
|
|
|
58
58
|
|
|
59
59
|
// private function of the SmartVariantManagement are approved and documented to be used from here
|
|
60
60
|
function setVariantContent(oContent) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
const oVariantManagementControl = this.getElement();
|
|
62
|
+
const oCurrentVariantContent = oVariantManagementControl._getVariantContent(this.getVariantId());
|
|
63
|
+
let oNewVariantContent = { ...oCurrentVariantContent };
|
|
64
64
|
if (oVariantManagementControl.isPageVariant()) {
|
|
65
|
-
|
|
65
|
+
const oContentToBeSet = {};
|
|
66
66
|
oContentToBeSet[this.getPersistencyKey()] = oContent;
|
|
67
67
|
oVariantManagementControl._applyVariantByPersistencyKey(this.getPersistencyKey(), oContentToBeSet, "KEY_USER");
|
|
68
68
|
oNewVariantContent[this.getPersistencyKey()] = oContent;
|
|
@@ -84,15 +84,15 @@ sap.ui.define([
|
|
|
84
84
|
|
|
85
85
|
CompVariantContent.prototype.execute = function() {
|
|
86
86
|
this.getElement().setModified(true);
|
|
87
|
-
|
|
87
|
+
const oNewVariantContent = setVariantContent.call(this, this.getNewContent());
|
|
88
88
|
callFlAPIFunction.call(this, "updateVariantContent", this.getVariantId(), {content: oNewVariantContent});
|
|
89
89
|
return Promise.resolve();
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
CompVariantContent.prototype.undo = function() {
|
|
93
|
-
|
|
93
|
+
const oVariant = callFlAPIFunction.call(this, "revert", this.getVariantId(), {});
|
|
94
94
|
this.getElement().setModified(this.getIsModifiedBefore());
|
|
95
|
-
|
|
95
|
+
const oVariantManagementControl = this.getElement();
|
|
96
96
|
if (oVariantManagementControl.isPageVariant()) {
|
|
97
97
|
setVariantContent.call(this, oVariant.getContent()[this.getPersistencyKey()]);
|
|
98
98
|
} else {
|
|
@@ -20,13 +20,13 @@ sap.ui.define([
|
|
|
20
20
|
* @class
|
|
21
21
|
* @extends sap.ui.rta.command.BaseCommand
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.141.0
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.87
|
|
27
27
|
* @alias sap.ui.rta.command.compVariant.CompVariantSaveAs
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
const CompVariantSaveAs = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantSaveAs", {
|
|
30
30
|
metadata: {
|
|
31
31
|
library: "sap.ui.rta",
|
|
32
32
|
properties: {
|
|
@@ -71,8 +71,8 @@ sap.ui.define([
|
|
|
71
71
|
* @returns {Promise} Returns resolve after execution
|
|
72
72
|
*/
|
|
73
73
|
CompVariantSaveAs.prototype.execute = function() {
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
const oNewVariantProperties = this.getNewVariantProperties();
|
|
75
|
+
const mPropertyBag = {
|
|
76
76
|
changeSpecificData: {
|
|
77
77
|
// in case of redo the variant is still saved and the ID should be reused
|
|
78
78
|
id: this._oVariant ? this._oVariant.getVariantId() : undefined,
|
|
@@ -18,13 +18,13 @@ sap.ui.define([
|
|
|
18
18
|
* @class
|
|
19
19
|
* @extends sap.ui.rta.command.BaseCommand
|
|
20
20
|
* @author SAP SE
|
|
21
|
-
* @version 1.
|
|
21
|
+
* @version 1.141.0
|
|
22
22
|
* @constructor
|
|
23
23
|
* @private
|
|
24
24
|
* @since 1.87
|
|
25
25
|
* @alias sap.ui.rta.command.compVariant.CompVariantSwitch
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
const CompVariantSwitch = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantSwitch", {
|
|
28
28
|
metadata: {
|
|
29
29
|
library: "sap.ui.rta",
|
|
30
30
|
properties: {
|
|
@@ -22,13 +22,13 @@ sap.ui.define([
|
|
|
22
22
|
* @class
|
|
23
23
|
* @extends sap.ui.rta.command.BaseCommand
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.141.0
|
|
26
26
|
* @constructor
|
|
27
27
|
* @private
|
|
28
28
|
* @since 1.87
|
|
29
29
|
* @alias sap.ui.rta.command.compVariant.CompVariantUpdate
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
const CompVariantUpdate = BaseCommand.extend("sap.ui.rta.command.compVariant.CompVariantUpdate", {
|
|
32
32
|
metadata: {
|
|
33
33
|
library: "sap.ui.rta",
|
|
34
34
|
properties: {
|
|
@@ -69,7 +69,7 @@ sap.ui.define([
|
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
function callFlAPIFunction(sFunctionName, sKey, oValue) {
|
|
72
|
-
|
|
72
|
+
const mPropertyBag = {
|
|
73
73
|
...oValue,
|
|
74
74
|
...this.mInformation,
|
|
75
75
|
id: sKey,
|
|
@@ -87,10 +87,10 @@ sap.ui.define([
|
|
|
87
87
|
if (this.getOnlySave()) {
|
|
88
88
|
this.setIsModifiedBefore(this.getElement().getModified());
|
|
89
89
|
this.getElement().setModified(false);
|
|
90
|
-
|
|
90
|
+
const sKey = Object.keys(this.getNewVariantProperties())[0];
|
|
91
91
|
callFlAPIFunction.call(this, "saveVariantContent", sKey, this.getNewVariantProperties()[sKey]);
|
|
92
92
|
} else {
|
|
93
|
-
each(this.getNewVariantProperties(),
|
|
93
|
+
each(this.getNewVariantProperties(), (sVariantId, oValue) => {
|
|
94
94
|
if (oValue.deleted) {
|
|
95
95
|
callFlAPIFunction.call(this, "removeVariant", sVariantId, {});
|
|
96
96
|
this.getElement().removeVariant({variantId: sVariantId});
|
|
@@ -100,10 +100,10 @@ sap.ui.define([
|
|
|
100
100
|
this.getElement().activateVariant("*standard*");
|
|
101
101
|
}
|
|
102
102
|
} else {
|
|
103
|
-
|
|
103
|
+
const oVariant = callFlAPIFunction.call(this, "updateVariantMetadata", sVariantId, oValue);
|
|
104
104
|
this.getElement().updateVariant(oVariant);
|
|
105
105
|
}
|
|
106
|
-
}
|
|
106
|
+
});
|
|
107
107
|
if (this.getNewDefaultVariantId()) {
|
|
108
108
|
callFlAPIFunction.call(this, "setDefaultVariantId", undefined, {defaultVariantId: this.getNewDefaultVariantId()});
|
|
109
109
|
this.getElement().setDefaultVariantId(this.getNewDefaultVariantId());
|
|
@@ -119,12 +119,12 @@ sap.ui.define([
|
|
|
119
119
|
*/
|
|
120
120
|
CompVariantUpdate.prototype.undo = function() {
|
|
121
121
|
if (this.getOnlySave()) {
|
|
122
|
-
|
|
122
|
+
const sVariantId = Object.keys(this.getNewVariantProperties())[0];
|
|
123
123
|
callFlAPIFunction.call(this, "revert", sVariantId, {});
|
|
124
124
|
this.getElement().setModified(this.getIsModifiedBefore());
|
|
125
125
|
} else {
|
|
126
|
-
each(this.getNewVariantProperties(),
|
|
127
|
-
|
|
126
|
+
each(this.getNewVariantProperties(), (sVariantId, oValue) => {
|
|
127
|
+
const oVariant = callFlAPIFunction.call(this, "revert", sVariantId, {});
|
|
128
128
|
if (oValue.deleted) {
|
|
129
129
|
this.getElement().addVariant(oVariant);
|
|
130
130
|
// If the current selected variant is deleted, the undo action should reactivate it
|
|
@@ -134,7 +134,7 @@ sap.ui.define([
|
|
|
134
134
|
} else {
|
|
135
135
|
this.getElement().updateVariant(oVariant);
|
|
136
136
|
}
|
|
137
|
-
}
|
|
137
|
+
});
|
|
138
138
|
if (this.getNewDefaultVariantId()) {
|
|
139
139
|
callFlAPIFunction.call(this, "revertSetDefaultVariantId", this.getOldDefaultVariantId());
|
|
140
140
|
this.getElement().setDefaultVariantId(this.getOldDefaultVariantId());
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* @extends sap.ui.rta.command.ManifestCommand
|
|
20
20
|
*
|
|
21
21
|
* @author SAP SE
|
|
22
|
-
* @version 1.
|
|
22
|
+
* @version 1.141.0
|
|
23
23
|
*
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|
|
@@ -39,19 +39,15 @@ sap.ui.define([
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Execute the change (load the required libraries)
|
|
42
|
-
* @return {Promise}
|
|
42
|
+
* @return {Promise} Resolves if libraries could be loaded; rejects if not
|
|
43
43
|
*/
|
|
44
44
|
AddLibrary.prototype.execute = function() {
|
|
45
|
-
const aPromises = [];
|
|
46
|
-
|
|
47
45
|
if (this.getParameters().libraries) {
|
|
48
46
|
const aLibraries = Object.keys(this.getParameters().libraries);
|
|
49
|
-
aLibraries.
|
|
50
|
-
aPromises.push(Lib.load({name: sLibrary}));
|
|
51
|
-
});
|
|
47
|
+
return Promise.all(aLibraries.map((sLibrary) => Lib.load({name: sLibrary})));
|
|
52
48
|
}
|
|
53
49
|
|
|
54
|
-
return Promise.
|
|
50
|
+
return Promise.resolve();
|
|
55
51
|
};
|
|
56
52
|
|
|
57
53
|
return AddLibrary;
|
|
@@ -7,42 +7,46 @@
|
|
|
7
7
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"sap/ui/core/mvc/XMLView",
|
|
10
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
10
11
|
"sap/ui/core/ComponentContainer",
|
|
11
12
|
"sap/ui/core/UIComponent",
|
|
12
|
-
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
13
13
|
"sap/ui/dt/DesignTime",
|
|
14
14
|
"sap/ui/dt/DesignTimeStatus",
|
|
15
15
|
"sap/ui/dt/OverlayRegistry",
|
|
16
16
|
"sap/ui/fl/apply/_internal/changes/Utils",
|
|
17
|
+
"sap/ui/fl/apply/_internal/flexState/FlexState",
|
|
17
18
|
"sap/ui/fl/changeHandler/condenser/Classification",
|
|
19
|
+
"sap/ui/fl/initial/_internal/ManifestUtils",
|
|
18
20
|
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
19
21
|
"sap/ui/fl/Layer",
|
|
20
22
|
"sap/ui/model/Model",
|
|
23
|
+
"sap/ui/qunit/utils/nextUIUpdate",
|
|
21
24
|
"sap/ui/rta/command/CommandFactory",
|
|
22
25
|
"sap/ui/rta/util/changeVisualization/ChangeCategories",
|
|
23
26
|
"sap/ui/rta/util/changeVisualization/ChangeVisualization",
|
|
24
|
-
"sap/ui/qunit/utils/nextUIUpdate",
|
|
25
27
|
"sap/ui/thirdparty/sinon-4",
|
|
26
28
|
"test-resources/sap/ui/fl/api/FlexTestAPI",
|
|
27
29
|
"test-resources/sap/ui/fl/qunit/FlQUnitUtils",
|
|
28
30
|
"sap/ui/fl/library" // we have to ensure to load fl, so that change handler gets registered
|
|
29
31
|
], function(
|
|
30
32
|
XMLView,
|
|
33
|
+
JsControlTreeModifier,
|
|
31
34
|
ComponentContainer,
|
|
32
35
|
UIComponent,
|
|
33
|
-
JsControlTreeModifier,
|
|
34
36
|
DesignTime,
|
|
35
37
|
DesignTimeStatus,
|
|
36
38
|
OverlayRegistry,
|
|
37
39
|
ChangesUtils,
|
|
40
|
+
FlexState,
|
|
38
41
|
CondenserClassification,
|
|
42
|
+
ManifestUtils,
|
|
39
43
|
PersistenceWriteAPI,
|
|
40
44
|
Layer,
|
|
41
45
|
Model,
|
|
46
|
+
nextUIUpdate,
|
|
42
47
|
CommandFactory,
|
|
43
48
|
ChangeCategories,
|
|
44
49
|
ChangeVisualization,
|
|
45
|
-
nextUIUpdate,
|
|
46
50
|
sinon,
|
|
47
51
|
FlexTestAPI,
|
|
48
52
|
FlQUnitUtils
|
|
@@ -61,7 +65,7 @@ sap.ui.define([
|
|
|
61
65
|
* E.g. <code>elementActionTest.only("Remove");</code>
|
|
62
66
|
*
|
|
63
67
|
* @author SAP SE
|
|
64
|
-
* @version 1.
|
|
68
|
+
* @version 1.141.0
|
|
65
69
|
*
|
|
66
70
|
* @static
|
|
67
71
|
* @since 1.42
|
|
@@ -613,16 +617,24 @@ sap.ui.define([
|
|
|
613
617
|
// Wait for each change to be applied individually to allow dependencies
|
|
614
618
|
// between changes of different actions
|
|
615
619
|
this.oUiComponentContainer.destroy();
|
|
616
|
-
PersistenceWriteAPI.add({
|
|
620
|
+
const aFlexObjects = [PersistenceWriteAPI.add({
|
|
617
621
|
change: oCommand.getPreparedChange(),
|
|
618
622
|
selector: oAppComponent
|
|
619
|
-
});
|
|
623
|
+
})];
|
|
620
624
|
if (oSecondCommand) {
|
|
621
|
-
PersistenceWriteAPI.add({
|
|
625
|
+
aFlexObjects.push(PersistenceWriteAPI.add({
|
|
622
626
|
change: oSecondCommand.getPreparedChange(),
|
|
623
627
|
selector: oAppComponent
|
|
624
|
-
});
|
|
628
|
+
}));
|
|
625
629
|
}
|
|
630
|
+
const sReference = ManifestUtils.getFlexReferenceForControl(oAppComponent);
|
|
631
|
+
FlexState.update(sReference, aFlexObjects.map((oFlexObject) => {
|
|
632
|
+
return {
|
|
633
|
+
type: "add",
|
|
634
|
+
flexObject: oFlexObject.convertToFileContent()
|
|
635
|
+
};
|
|
636
|
+
}));
|
|
637
|
+
|
|
626
638
|
return await createViewInComponent.call(this, ASYNC);
|
|
627
639
|
}
|
|
628
640
|
|
|
@@ -22,14 +22,14 @@ sap.ui.define([
|
|
|
22
22
|
* @namespace
|
|
23
23
|
* @alias sap.ui.rta
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.141.0
|
|
26
26
|
* @since 1.50
|
|
27
27
|
* @private
|
|
28
28
|
*/
|
|
29
29
|
var thisLib = Lib.init({
|
|
30
30
|
name: "sap.ui.rta",
|
|
31
31
|
apiVersion: 2,
|
|
32
|
-
version: "1.
|
|
32
|
+
version: "1.141.0",
|
|
33
33
|
dependencies: ["sap.ui.core", "sap.m", "sap.ui.fl", "sap.ui.dt"],
|
|
34
34
|
types: [],
|
|
35
35
|
interfaces: [],
|
|
@@ -77,7 +77,7 @@ TXT_VERSION_TITLE_INPUT_PLACEHOLDER=Indtast en versionstitel
|
|
|
77
77
|
BUT_VERSION_TITLE_DIALOG_CONFIRM=Bekr\u00E6ft
|
|
78
78
|
BUT_VERSION_TITLE_DIALOG_CANCEL=Afbryd
|
|
79
79
|
TOL_ACTIVATE=Aktiver ny version
|
|
80
|
-
TOL_DISCARD_DRAFT=
|
|
80
|
+
TOL_DISCARD_DRAFT=Kasser udkast
|
|
81
81
|
TOL_PUBLISH_VERSION=Publicer version
|
|
82
82
|
TIT_SWITCH_VERSION_DIALOG=Skift version
|
|
83
83
|
MSG_SWITCH_VERSION_DIALOG=Du har UI-\u00E6ndringer, der ikke er gemt. Vil du gemme dem, inden du skifter?
|
|
@@ -456,4 +456,4 @@ TXT_WHATS_NEW_DIALOG_TEXT_ARRANGEMENT_TEXT_3=\u206A\u206A\u206A\u200C\u200B\u200
|
|
|
456
456
|
TIT_WHATS_NEW_EXTENDED_ACTIONS_TITLE=\u206A\u206A\u206A\u200D\u200D\u200C\u200B\u200C\u200C\u200B\u200D\u200B\u200B\u200B\u200D\u200C\u200C\u200D\u200C\u200B\u200C\u200D\u200C\u200C\u200B\u200C\u200D\u200D\u200C\u200B\u200D\u200B\u200C\u200C\u200B\u200C\u200D\u200B\u200D\u200C\u200D\u200B\u200B\u206AExtended Actions\u206A\u206A
|
|
457
457
|
TXT_WHATS_NEW_DIALOG_EXTENDED_ACTIONS_DESCRIPTION=\u206A\u206A\u206A\u200D\u200C\u200D\u200D\u200D\u200B\u200C\u200D\u200C\u200D\u200C\u200B\u200D\u200B\u200D\u200D\u200D\u200B\u200B\u200D\u200C\u200C\u200C\u200D\u200D\u200B\u200C\u200D\u200D\u200D\u200C\u200D\u200B\u200B\u200D\u200B\u200B\u200B\u200D\u200B\u206AImportant actions are now presented more centrally.\u206A\u206A
|
|
458
458
|
TXT_WHATS_NEW_DIALOG_EXTENDED_ACTIONS_TEXT_1=\u206A\u206A\u206A\u200D\u200D\u200C\u200C\u200C\u200C\u200D\u200C\u200B\u200D\u200B\u200B\u200B\u200B\u200C\u200D\u200C\u200B\u200C\u200D\u200B\u200B\u200D\u200B\u200D\u200D\u200C\u200B\u200B\u200C\u200B\u200D\u200D\u200D\u200D\u200D\u200C\u200B\u206ACertain actions are of central importance for their respective controls and should also be accessible from their sub-controls.\u206A\u206A
|
|
459
|
-
TXT_WHATS_NEW_DIALOG_EXTENDED_ACTIONS_TEXT_2=\u206A\u206A\u206A\u200C\u200D\u200B\u200C\u200B\u200C\u200C\u200C\u200B\u200B\u200D\u200B\u200D\u200D\u200B\u200C\u200D\u200B\u200B\u200D\u200D\u200D\u200B\u200C\u200B\u200C\u200D\u200D\u200B\u200B\u200B\u200D\u200B\u200D\u200C\u200D\u200D\u200D\u200D\u200B\u206AWhen working
|
|
459
|
+
TXT_WHATS_NEW_DIALOG_EXTENDED_ACTIONS_TEXT_2=\u206A\u206A\u206A\u200C\u200D\u200B\u200C\u200B\u200C\u200C\u200C\u200B\u200B\u200D\u200B\u200D\u200D\u200B\u200C\u200D\u200B\u200B\u200D\u200D\u200D\u200B\u200C\u200B\u200C\u200D\u200D\u200B\u200B\u200B\u200D\u200B\u200D\u200C\u200D\u200D\u200D\u200D\u200B\u206AWhen working with a table for example, key users should always be able to access the table settings directly, even when selecting the toolbar or a column. These actions will be propagated to the context menu of child controls, so they are always just one click away. The control and its propagated actions can be found in the "Extended Actions" section at the bottom of the context menu.\u206A\u206A
|