@openui5/sap.ui.rta 1.139.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 +7 -30
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +6 -41
- package/src/sap/ui/rta/appVariant/Feature.js +5 -4
- 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_ar.properties +32 -17
- package/src/sap/ui/rta/messagebundle_bg.properties +32 -17
- package/src/sap/ui/rta/messagebundle_ca.properties +32 -17
- package/src/sap/ui/rta/messagebundle_cnr.properties +31 -16
- package/src/sap/ui/rta/messagebundle_cs.properties +31 -16
- package/src/sap/ui/rta/messagebundle_cy.properties +30 -15
- package/src/sap/ui/rta/messagebundle_da.properties +32 -17
- package/src/sap/ui/rta/messagebundle_de.properties +33 -18
- package/src/sap/ui/rta/messagebundle_el.properties +32 -17
- package/src/sap/ui/rta/messagebundle_en.properties +32 -17
- package/src/sap/ui/rta/messagebundle_en_GB.properties +32 -17
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +11 -1
- package/src/sap/ui/rta/messagebundle_es.properties +32 -17
- package/src/sap/ui/rta/messagebundle_es_MX.properties +39 -24
- package/src/sap/ui/rta/messagebundle_et.properties +31 -16
- package/src/sap/ui/rta/messagebundle_fi.properties +30 -15
- package/src/sap/ui/rta/messagebundle_fr.properties +32 -17
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +30 -15
- package/src/sap/ui/rta/messagebundle_hi.properties +32 -17
- package/src/sap/ui/rta/messagebundle_hr.properties +31 -16
- package/src/sap/ui/rta/messagebundle_hu.properties +31 -16
- package/src/sap/ui/rta/messagebundle_id.properties +32 -17
- package/src/sap/ui/rta/messagebundle_it.properties +31 -16
- package/src/sap/ui/rta/messagebundle_iw.properties +30 -15
- package/src/sap/ui/rta/messagebundle_ja.properties +32 -17
- package/src/sap/ui/rta/messagebundle_kk.properties +32 -17
- package/src/sap/ui/rta/messagebundle_ko.properties +30 -15
- package/src/sap/ui/rta/messagebundle_lt.properties +31 -16
- package/src/sap/ui/rta/messagebundle_lv.properties +31 -16
- package/src/sap/ui/rta/messagebundle_mk.properties +31 -16
- package/src/sap/ui/rta/messagebundle_ms.properties +32 -17
- package/src/sap/ui/rta/messagebundle_nl.properties +32 -17
- package/src/sap/ui/rta/messagebundle_no.properties +31 -16
- package/src/sap/ui/rta/messagebundle_pl.properties +31 -16
- package/src/sap/ui/rta/messagebundle_pt.properties +32 -17
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +32 -17
- package/src/sap/ui/rta/messagebundle_ro.properties +31 -16
- package/src/sap/ui/rta/messagebundle_ru.properties +31 -16
- package/src/sap/ui/rta/messagebundle_sh.properties +31 -16
- package/src/sap/ui/rta/messagebundle_sk.properties +31 -16
- package/src/sap/ui/rta/messagebundle_sl.properties +31 -16
- package/src/sap/ui/rta/messagebundle_sr.properties +31 -16
- package/src/sap/ui/rta/messagebundle_sv.properties +31 -16
- package/src/sap/ui/rta/messagebundle_th.properties +30 -15
- package/src/sap/ui/rta/messagebundle_tr.properties +31 -16
- package/src/sap/ui/rta/messagebundle_uk.properties +31 -16
- package/src/sap/ui/rta/messagebundle_vi.properties +33 -18
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +31 -16
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +32 -17
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +10 -10
- 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 -7
- 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 +7 -7
- package/src/sap/ui/rta/toolbar/Fiori.js +8 -8
- package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +3 -3
- 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 +6 -6
- 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 +79 -0
- 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
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
* @class
|
|
24
24
|
* @extends sap.ui.base.ManagedObject
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.141.0
|
|
27
27
|
* @constructor
|
|
28
28
|
* @private
|
|
29
29
|
* @since 1.42
|
|
@@ -52,7 +52,7 @@ sap.ui.define([
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* Promise to ensure that the event triggered methods are executed
|
|
55
|
+
* Promise to ensure that the event triggered methods are executed sequentially.
|
|
56
56
|
*/
|
|
57
57
|
LREPSerializer.prototype._lastPromise = Promise.resolve();
|
|
58
58
|
|
|
@@ -67,14 +67,14 @@ sap.ui.define([
|
|
|
67
67
|
* @public
|
|
68
68
|
*/
|
|
69
69
|
LREPSerializer.prototype.needsReload = function() {
|
|
70
|
-
this._lastPromise = this._lastPromise
|
|
70
|
+
this._lastPromise = this._lastPromise
|
|
71
|
+
.catch(() => {
|
|
71
72
|
// _lastPromise chain must not be interrupted
|
|
72
|
-
})
|
|
73
|
+
})
|
|
74
|
+
.then(() => {
|
|
73
75
|
const aCommands = this.getCommandStack().getAllExecutedCommands();
|
|
74
|
-
return aCommands.some(
|
|
75
|
-
|
|
76
|
-
});
|
|
77
|
-
}.bind(this));
|
|
76
|
+
return aCommands.some((oCommand) => !!oCommand.needsReload);
|
|
77
|
+
});
|
|
78
78
|
return this._lastPromise;
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
@@ -92,15 +92,17 @@ sap.ui.define([
|
|
|
92
92
|
* @public
|
|
93
93
|
*/
|
|
94
94
|
LREPSerializer.prototype.saveCommands = function(mPropertyBag) {
|
|
95
|
-
this._lastPromise = this._lastPromise
|
|
95
|
+
this._lastPromise = this._lastPromise
|
|
96
|
+
.catch((oError) => {
|
|
96
97
|
Log.error(oError);
|
|
97
98
|
// _lastPromise chain must not be interrupted
|
|
98
|
-
})
|
|
99
|
+
})
|
|
100
|
+
.then(async () => {
|
|
99
101
|
const oRootControl = getRootControlInstance(this.getRootControl());
|
|
100
102
|
if (!oRootControl) {
|
|
101
103
|
throw new Error("Can't save commands without root control instance!");
|
|
102
104
|
}
|
|
103
|
-
|
|
105
|
+
await PersistenceWriteAPI.save({
|
|
104
106
|
selector: oRootControl,
|
|
105
107
|
skipUpdateCache: false,
|
|
106
108
|
draft: !!mPropertyBag.saveAsDraft,
|
|
@@ -110,12 +112,10 @@ sap.ui.define([
|
|
|
110
112
|
adaptationId: mPropertyBag.adaptationId,
|
|
111
113
|
condenseAnyLayer: mPropertyBag.condenseAnyLayer
|
|
112
114
|
});
|
|
113
|
-
}.bind(this))
|
|
114
|
-
.then(function() {
|
|
115
115
|
Log.info("UI adaptation successfully wrote changes to the persistence");
|
|
116
116
|
this.getCommandStack().setSaved(true);
|
|
117
117
|
this.getCommandStack().removeAllCommands();
|
|
118
|
-
}
|
|
118
|
+
});
|
|
119
119
|
|
|
120
120
|
return this._lastPromise;
|
|
121
121
|
};
|
|
@@ -145,21 +145,18 @@ sap.ui.define([
|
|
|
145
145
|
};
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* @description
|
|
149
148
|
* At this point command stack is not aware if the changes have been already booked for the new app variant.
|
|
150
149
|
* Therefore if there shall be some UI changes present in command stack, we undo all the changes till the beginning.
|
|
151
150
|
* In the last when user presses 'Save and Exit', there will be no change registered for the current app.
|
|
152
|
-
* @param {boolean} bRemoveChanges
|
|
153
|
-
* @returns {Promise}
|
|
151
|
+
* @param {boolean} bRemoveChanges - Whether LREPSerializer should clear the dirty changes in the persistence
|
|
152
|
+
* @returns {Promise} Resolves with true or false
|
|
154
153
|
*/
|
|
155
|
-
LREPSerializer.prototype.clearCommandStack = function(bRemoveChanges) {
|
|
154
|
+
LREPSerializer.prototype.clearCommandStack = async function(bRemoveChanges) {
|
|
156
155
|
const oCommandStack = this.getCommandStack();
|
|
157
156
|
|
|
158
|
-
|
|
159
|
-
.
|
|
160
|
-
|
|
161
|
-
return true;
|
|
162
|
-
});
|
|
157
|
+
await this._triggerUndoChanges(bRemoveChanges);
|
|
158
|
+
oCommandStack.removeAllCommands();
|
|
159
|
+
return true;
|
|
163
160
|
};
|
|
164
161
|
|
|
165
162
|
return LREPSerializer;
|
|
@@ -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.90
|
|
27
27
|
* @alias sap.ui.rta.command.LocalReset
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
const LocalReset = BaseCommand.extend("sap.ui.rta.command.LocalReset", {
|
|
30
30
|
metadata: {
|
|
31
31
|
library: "sap.ui.rta",
|
|
32
32
|
properties: {
|
|
@@ -49,7 +49,7 @@ sap.ui.define([
|
|
|
49
49
|
* @override
|
|
50
50
|
*/
|
|
51
51
|
LocalReset.prototype.prepare = function(mFlexSettings) {
|
|
52
|
-
|
|
52
|
+
const oContainerControl = this.getElement();
|
|
53
53
|
this._oAppComponent = FlUtils.getAppComponentForControl(oContainerControl);
|
|
54
54
|
this._aAffectedChanges = LocalResetAPI.getNestedUIChangesForControl(
|
|
55
55
|
oContainerControl,
|
|
@@ -17,13 +17,13 @@ function(
|
|
|
17
17
|
* @class
|
|
18
18
|
* @extends sap.ui.rta.command.FlexCommand
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.141.0
|
|
21
21
|
* @constructor
|
|
22
22
|
* @private
|
|
23
23
|
* @since 1.34
|
|
24
24
|
* @alias sap.ui.rta.command.Move
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
const Move = FlexCommand.extend("sap.ui.rta.command.Move", {
|
|
27
27
|
metadata: {
|
|
28
28
|
library: "sap.ui.rta",
|
|
29
29
|
properties: {
|
|
@@ -49,8 +49,8 @@ function(
|
|
|
49
49
|
* @override
|
|
50
50
|
*/
|
|
51
51
|
Move.prototype._getChangeSpecificData = function() {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const mSource = this.getSource();
|
|
53
|
+
const mTarget = this.getTarget();
|
|
54
54
|
|
|
55
55
|
// replace elements by their id, unify format and help with serialization
|
|
56
56
|
if (mSource.parent) {
|
|
@@ -61,7 +61,7 @@ function(
|
|
|
61
61
|
mTarget.id = mTarget.parent.getId();
|
|
62
62
|
delete mTarget.parent;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
const mSpecificInfo = {
|
|
65
65
|
changeType: this.getChangeType(),
|
|
66
66
|
content: {
|
|
67
67
|
source: mSource,
|
|
@@ -16,13 +16,13 @@ sap.ui.define([
|
|
|
16
16
|
* @class
|
|
17
17
|
* @extends sap.ui.rta.command.FlexCommand
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.141.0
|
|
20
20
|
* @constructor
|
|
21
21
|
* @private
|
|
22
22
|
* @since 1.34
|
|
23
23
|
* @alias sap.ui.rta.command.Property
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
const Property = FlexCommand.extend("sap.ui.rta.command.Property", {
|
|
26
26
|
metadata: {
|
|
27
27
|
library: "sap.ui.rta",
|
|
28
28
|
properties: {
|
|
@@ -49,7 +49,7 @@ sap.ui.define([
|
|
|
49
49
|
});
|
|
50
50
|
|
|
51
51
|
Property.prototype._getChangeSpecificData = function() {
|
|
52
|
-
|
|
52
|
+
const oElement = this.getElement();
|
|
53
53
|
// general format
|
|
54
54
|
return {
|
|
55
55
|
changeType: this.getChangeType(),
|
|
@@ -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.42
|
|
19
19
|
* @alias sap.ui.rta.command.Remove
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
const Remove = FlexCommand.extend("sap.ui.rta.command.Remove", {
|
|
22
22
|
metadata: {
|
|
23
23
|
library: "sap.ui.rta",
|
|
24
24
|
properties: {
|
|
@@ -33,9 +33,9 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
Remove.prototype._getChangeSpecificData = function() {
|
|
36
|
-
|
|
36
|
+
const oElement = this.getRemovedElement() || this.getElement();
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
const mSpecificInfo = {
|
|
39
39
|
changeType: this.getChangeType(),
|
|
40
40
|
removedElement: {
|
|
41
41
|
id: oElement.getId()
|
|
@@ -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.34
|
|
19
19
|
* @alias sap.ui.rta.command.Rename
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
const Rename = FlexCommand.extend("sap.ui.rta.command.Rename", {
|
|
22
22
|
metadata: {
|
|
23
23
|
library: "sap.ui.rta",
|
|
24
24
|
properties: {
|
|
@@ -38,7 +38,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
38
38
|
});
|
|
39
39
|
|
|
40
40
|
Rename.prototype._getChangeSpecificData = function() {
|
|
41
|
-
|
|
41
|
+
const mSpecificInfo = {
|
|
42
42
|
changeType: this.getChangeType(),
|
|
43
43
|
content: {
|
|
44
44
|
renamedElement: {
|
|
@@ -16,13 +16,13 @@ sap.ui.define([
|
|
|
16
16
|
* @class
|
|
17
17
|
* @extends sap.ui.rta.command.FlexCommand
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.141.0
|
|
20
20
|
* @constructor
|
|
21
21
|
* @private
|
|
22
22
|
* @since 1.101
|
|
23
23
|
* @alias sap.ui.rta.command.Resize
|
|
24
24
|
*/
|
|
25
|
-
|
|
25
|
+
const Resize = FlexCommand.extend("sap.ui.rta.command.Resize", {
|
|
26
26
|
metadata: {
|
|
27
27
|
library: "sap.ui.rta",
|
|
28
28
|
properties: {
|
|
@@ -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.Reveal
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
const Reveal = FlexCommand.extend("sap.ui.rta.command.Reveal", {
|
|
22
22
|
metadata: {
|
|
23
23
|
library: "sap.ui.rta",
|
|
24
24
|
properties: {
|
|
@@ -32,7 +32,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
32
32
|
});
|
|
33
33
|
|
|
34
34
|
Reveal.prototype._getChangeSpecificData = function() {
|
|
35
|
-
|
|
35
|
+
const mSpecificChangeInfo = {
|
|
36
36
|
changeType: this.getChangeType(),
|
|
37
37
|
content: {}
|
|
38
38
|
};
|
|
@@ -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: {
|