@openui5/sap.ui.rta 1.136.4 → 1.139.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/README.md +1 -1
- package/REUSE.toml +8 -29
- package/THIRDPARTY.txt +72 -90
- package/package.json +7 -7
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +1 -1
- package/src/sap/ui/rta/RuntimeAuthoring.js +90 -127
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +5 -4
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +12 -5
- 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/AnnotationCommand.js +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +1 -1
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +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/ExtendControllerCommand.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +2 -3
- package/src/sap/ui/rta/command/LREPSerializer.js +2 -85
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/ManifestCommand.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/Resize.js +1 -1
- package/src/sap/ui/rta/command/Reveal.js +1 -1
- package/src/sap/ui/rta/command/Settings.js +1 -1
- package/src/sap/ui/rta/command/Split.js +1 -1
- package/src/sap/ui/rta/command/Stack.js +115 -87
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/command/manifest/AddLibrary.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +39 -57
- package/src/sap/ui/rta/messagebundle_ar.properties +7 -31
- package/src/sap/ui/rta/messagebundle_bg.properties +8 -32
- package/src/sap/ui/rta/messagebundle_ca.properties +8 -32
- package/src/sap/ui/rta/messagebundle_cnr.properties +7 -31
- package/src/sap/ui/rta/messagebundle_cs.properties +7 -31
- package/src/sap/ui/rta/messagebundle_cy.properties +8 -32
- package/src/sap/ui/rta/messagebundle_da.properties +8 -32
- package/src/sap/ui/rta/messagebundle_de.properties +6 -30
- package/src/sap/ui/rta/messagebundle_el.properties +8 -32
- package/src/sap/ui/rta/messagebundle_en.properties +8 -32
- package/src/sap/ui/rta/messagebundle_en_GB.properties +8 -32
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +29 -48
- package/src/sap/ui/rta/messagebundle_es.properties +8 -32
- package/src/sap/ui/rta/messagebundle_es_MX.properties +15 -39
- package/src/sap/ui/rta/messagebundle_et.properties +8 -32
- package/src/sap/ui/rta/messagebundle_fi.properties +8 -32
- package/src/sap/ui/rta/messagebundle_fr.properties +9 -33
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +8 -32
- package/src/sap/ui/rta/messagebundle_hi.properties +7 -31
- package/src/sap/ui/rta/messagebundle_hr.properties +8 -32
- package/src/sap/ui/rta/messagebundle_hu.properties +8 -32
- package/src/sap/ui/rta/messagebundle_id.properties +9 -33
- package/src/sap/ui/rta/messagebundle_it.properties +8 -32
- package/src/sap/ui/rta/messagebundle_iw.properties +7 -31
- package/src/sap/ui/rta/messagebundle_ja.properties +8 -32
- package/src/sap/ui/rta/messagebundle_kk.properties +9 -33
- package/src/sap/ui/rta/messagebundle_ko.properties +8 -32
- package/src/sap/ui/rta/messagebundle_lt.properties +8 -32
- package/src/sap/ui/rta/messagebundle_lv.properties +8 -32
- package/src/sap/ui/rta/messagebundle_mk.properties +8 -32
- package/src/sap/ui/rta/messagebundle_ms.properties +8 -32
- package/src/sap/ui/rta/messagebundle_nl.properties +7 -31
- package/src/sap/ui/rta/messagebundle_no.properties +8 -32
- package/src/sap/ui/rta/messagebundle_pl.properties +8 -32
- package/src/sap/ui/rta/messagebundle_pt.properties +8 -32
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +8 -32
- package/src/sap/ui/rta/messagebundle_ro.properties +8 -32
- package/src/sap/ui/rta/messagebundle_ru.properties +8 -32
- package/src/sap/ui/rta/messagebundle_sh.properties +7 -31
- package/src/sap/ui/rta/messagebundle_sk.properties +8 -32
- package/src/sap/ui/rta/messagebundle_sl.properties +8 -32
- package/src/sap/ui/rta/messagebundle_sr.properties +7 -31
- package/src/sap/ui/rta/messagebundle_sv.properties +8 -32
- package/src/sap/ui/rta/messagebundle_th.properties +8 -32
- package/src/sap/ui/rta/messagebundle_tr.properties +8 -32
- package/src/sap/ui/rta/messagebundle_uk.properties +8 -32
- package/src/sap/ui/rta/messagebundle_vi.properties +9 -33
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +8 -32
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +8 -32
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/AddXMLPlugin.js +3 -2
- 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 +57 -35
- 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 +3 -2
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- 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 +14 -7
- 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 +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +11 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- 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.fragment.xml +16 -3
- 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 +3 -3
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +256 -203
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +28 -75
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +72 -17
- package/src/sap/ui/rta/plugin/rename/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/rename/RenameDialog.fragment.xml +2 -2
- package/src/sap/ui/rta/plugin/rename/RenameDialog.js +41 -23
- 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/themes/base/AddIFrame.less +23 -33
- package/src/sap/ui/rta/toolbar/ActionsMenu.fragment.xml +4 -2
- package/src/sap/ui/rta/toolbar/Adaptation.js +16 -3
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +2 -7
- 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/Animation.js +4 -6
- package/src/sap/ui/rta/util/BindingsExtractor.js +44 -53
- package/src/sap/ui/rta/util/PluginManager.js +6 -6
- package/src/sap/ui/rta/util/PopupManager.js +90 -109
- package/src/sap/ui/rta/util/ReloadManager.js +53 -98
- package/src/sap/ui/rta/util/ServiceEventBus.js +3 -4
- package/src/sap/ui/rta/util/ServiceManager.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +59 -80
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +3 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +5 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +2 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +13 -25
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +5 -7
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +9 -9
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +5 -5
- package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +8 -8
- package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +5 -5
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +5 -5
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +2 -2
- package/src/sap/ui/rta/util/guidedTour/GuidedTour.js +22 -5
- package/src/sap/ui/rta/util/guidedTour/TourMarker.fragment.xml +1 -1
- package/src/sap/ui/rta/util/guidedTour/content/GeneralTour.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +11 -19
- package/src/sap/ui/rta/util/showMessageBox.js +15 -15
- package/src/sap/ui/rta/util/validateFlexEnabled.js +35 -34
- package/src/sap/ui/rta/util/validateStableIds.js +22 -31
- package/src/sap/ui/rta/util/validateText.js +7 -7
- package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +34 -9
- package/src/sap/ui/rta/util/whatsNew/WhatsNewOverview.js +2 -6
- package/src/sap/ui/rta/util/whatsNew/WhatsNewOverviewDialog.fragment.xml +1 -0
- package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +4 -4
- package/src/sap/ui/rta/util/whatsNew/whatsNewContent/WhatsNewFeatures.js +8 -22
|
@@ -35,7 +35,7 @@ sap.ui.define([
|
|
|
35
35
|
* @extends sap.ui.rta.command.BaseCommand
|
|
36
36
|
*
|
|
37
37
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
38
|
+
* @version 1.139.0
|
|
39
39
|
*
|
|
40
40
|
* @constructor
|
|
41
41
|
* @private
|
|
@@ -121,8 +121,7 @@ sap.ui.define([
|
|
|
121
121
|
this.setSelector(oSelector);
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
|
|
125
|
-
this._oPreparedChange = oChange;
|
|
124
|
+
this._oPreparedChange = await this._createChange(mFlexSettings, sVariantManagementReference, sCommand);
|
|
126
125
|
return true;
|
|
127
126
|
} catch (oError) {
|
|
128
127
|
Log.error(oError.message || oError.name);
|
|
@@ -5,16 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
"sap/ui/base/ManagedObject",
|
|
8
|
-
"sap/ui/rta/command/FlexCommand",
|
|
9
|
-
"sap/ui/rta/command/ManifestCommand",
|
|
10
8
|
"sap/ui/fl/Utils",
|
|
11
9
|
"sap/ui/dt/ElementUtil",
|
|
12
10
|
"sap/base/Log",
|
|
13
11
|
"sap/ui/fl/write/api/PersistenceWriteAPI"
|
|
14
12
|
], function(
|
|
15
13
|
ManagedObject,
|
|
16
|
-
FlexCommand,
|
|
17
|
-
ManifestCommand,
|
|
18
14
|
FlUtils,
|
|
19
15
|
ElementUtil,
|
|
20
16
|
Log,
|
|
@@ -27,7 +23,7 @@ sap.ui.define([
|
|
|
27
23
|
* @class
|
|
28
24
|
* @extends sap.ui.base.ManagedObject
|
|
29
25
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
26
|
+
* @version 1.139.0
|
|
31
27
|
* @constructor
|
|
32
28
|
* @private
|
|
33
29
|
* @since 1.42
|
|
@@ -61,78 +57,7 @@ sap.ui.define([
|
|
|
61
57
|
LREPSerializer.prototype._lastPromise = Promise.resolve();
|
|
62
58
|
|
|
63
59
|
LREPSerializer.prototype.setCommandStack = function(oCommandStack) {
|
|
64
|
-
if (this.getCommandStack()) {
|
|
65
|
-
this.getCommandStack().removeCommandExecutionHandler(this._fnHandleCommandExecuted);
|
|
66
|
-
}
|
|
67
60
|
this.setProperty("commandStack", oCommandStack);
|
|
68
|
-
oCommandStack.addCommandExecutionHandler(this._fnHandleCommandExecuted);
|
|
69
|
-
};
|
|
70
|
-
LREPSerializer.prototype.init = function() {
|
|
71
|
-
this._fnHandleCommandExecuted = this.handleCommandExecuted.bind(this);
|
|
72
|
-
};
|
|
73
|
-
LREPSerializer.prototype.exit = function() {
|
|
74
|
-
this.getCommandStack().removeCommandExecutionHandler(this._fnHandleCommandExecuted);
|
|
75
|
-
};
|
|
76
|
-
LREPSerializer.prototype._isPersistedChange = function(oPreparedChange) {
|
|
77
|
-
return !!this.getCommandStack()._aPersistedChanges
|
|
78
|
-
&& this.getCommandStack()._aPersistedChanges.indexOf(oPreparedChange.getId()) !== -1;
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
LREPSerializer.prototype.handleCommandExecuted = function(oEvent) {
|
|
82
|
-
return (function(oEvent) {
|
|
83
|
-
const oParams = oEvent;
|
|
84
|
-
this._lastPromise = this._lastPromise.catch(function() {
|
|
85
|
-
// _lastPromise chain must not be interrupted
|
|
86
|
-
}).then(function() {
|
|
87
|
-
const aCommands = this.getCommandStack().getSubCommands(oParams.command);
|
|
88
|
-
let oAppComponent;
|
|
89
|
-
const aFlexObjects = [];
|
|
90
|
-
if (oParams.undo) {
|
|
91
|
-
aCommands.forEach(function(oCommand) {
|
|
92
|
-
// for revertable changes which don't belong to LREP (variantSwitch) or runtime only changes
|
|
93
|
-
if (!(oCommand instanceof FlexCommand || oCommand instanceof ManifestCommand)
|
|
94
|
-
|| oCommand.getRuntimeOnly()) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
const oChange = oCommand.getPreparedChange();
|
|
98
|
-
oAppComponent = oCommand.getAppComponent();
|
|
99
|
-
if (oAppComponent) {
|
|
100
|
-
aFlexObjects.push(oChange);
|
|
101
|
-
}
|
|
102
|
-
});
|
|
103
|
-
if (oAppComponent) {
|
|
104
|
-
return PersistenceWriteAPI.remove({
|
|
105
|
-
flexObjects: aFlexObjects,
|
|
106
|
-
selector: oAppComponent
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
return Promise.resolve();
|
|
110
|
-
}
|
|
111
|
-
const aManifestCreateAndAdd = [];
|
|
112
|
-
aCommands.forEach(function(oCommand) {
|
|
113
|
-
// Runtime only changes should not be added to the persistence
|
|
114
|
-
if (oCommand.getRuntimeOnly()) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
if (oCommand instanceof FlexCommand) {
|
|
118
|
-
oAppComponent = oCommand.getAppComponent();
|
|
119
|
-
if (oAppComponent) {
|
|
120
|
-
const oPreparedChange = oCommand.getPreparedChange();
|
|
121
|
-
if (!this._isPersistedChange(oPreparedChange)) {
|
|
122
|
-
aFlexObjects.push(oCommand.getPreparedChange());
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
} else if (oCommand instanceof ManifestCommand) {
|
|
126
|
-
aManifestCreateAndAdd.push(oCommand.createAndStoreChange());
|
|
127
|
-
}
|
|
128
|
-
}.bind(this));
|
|
129
|
-
if (oAppComponent) {
|
|
130
|
-
PersistenceWriteAPI.add({flexObjects: aFlexObjects, selector: oAppComponent});
|
|
131
|
-
}
|
|
132
|
-
return Promise.all(aManifestCreateAndAdd);
|
|
133
|
-
}.bind(this));
|
|
134
|
-
return this._lastPromise;
|
|
135
|
-
}.bind(this))(oEvent);
|
|
136
61
|
};
|
|
137
62
|
|
|
138
63
|
/**
|
|
@@ -230,19 +155,11 @@ sap.ui.define([
|
|
|
230
155
|
LREPSerializer.prototype.clearCommandStack = function(bRemoveChanges) {
|
|
231
156
|
const oCommandStack = this.getCommandStack();
|
|
232
157
|
|
|
233
|
-
// Detach the event 'commandExecuted' here to stop the communication of LREPSerializer with Flex
|
|
234
|
-
if (!bRemoveChanges) {
|
|
235
|
-
oCommandStack.detachCommandExecuted(this.handleCommandExecuted.bind(this));
|
|
236
|
-
}
|
|
237
158
|
return this._triggerUndoChanges(bRemoveChanges)
|
|
238
159
|
.then(function() {
|
|
239
160
|
oCommandStack.removeAllCommands();
|
|
240
|
-
// Attach the event 'commandExecuted' here to start the communication of LREPSerializer with Flex
|
|
241
|
-
if (!bRemoveChanges) {
|
|
242
|
-
oCommandStack.attachCommandExecuted(this.handleCommandExecuted.bind(this));
|
|
243
|
-
}
|
|
244
161
|
return true;
|
|
245
|
-
}
|
|
162
|
+
});
|
|
246
163
|
};
|
|
247
164
|
|
|
248
165
|
return LREPSerializer;
|
|
@@ -5,22 +5,26 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
"sap/ui/base/ManagedObject",
|
|
8
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
9
|
+
"sap/ui/core/Lib",
|
|
8
10
|
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
9
11
|
"sap/ui/fl/Utils",
|
|
10
|
-
"sap/ui/rta/command/Settings",
|
|
11
12
|
"sap/ui/rta/command/CompositeCommand",
|
|
12
|
-
"sap/ui/
|
|
13
|
-
"sap/ui/rta/
|
|
14
|
-
"sap/ui/
|
|
13
|
+
"sap/ui/rta/command/FlexCommand",
|
|
14
|
+
"sap/ui/rta/command/ManifestCommand",
|
|
15
|
+
"sap/ui/rta/command/Settings",
|
|
16
|
+
"sap/ui/rta/util/showMessageBox"
|
|
15
17
|
], function(
|
|
16
18
|
ManagedObject,
|
|
19
|
+
JsControlTreeModifier,
|
|
20
|
+
Lib,
|
|
17
21
|
PersistenceWriteAPI,
|
|
18
22
|
FlUtils,
|
|
19
|
-
Settings,
|
|
20
23
|
CompositeCommand,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
FlexCommand,
|
|
25
|
+
ManifestCommand,
|
|
26
|
+
Settings,
|
|
27
|
+
showMessageBox
|
|
24
28
|
) {
|
|
25
29
|
"use strict";
|
|
26
30
|
|
|
@@ -88,7 +92,7 @@ sap.ui.define([
|
|
|
88
92
|
* @class
|
|
89
93
|
* @extends sap.ui.base.ManagedObject
|
|
90
94
|
* @author SAP SE
|
|
91
|
-
* @version 1.
|
|
95
|
+
* @version 1.139.0
|
|
92
96
|
* @constructor
|
|
93
97
|
* @private
|
|
94
98
|
* @since 1.34
|
|
@@ -112,7 +116,16 @@ sap.ui.define([
|
|
|
112
116
|
lastCommandExecuted: {
|
|
113
117
|
type: "object",
|
|
114
118
|
defaultValue: Promise.resolve()
|
|
119
|
+
},
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Promise is resolved when last command of the stack is unexecuted
|
|
123
|
+
*/
|
|
124
|
+
lastCommandUnExecuted: {
|
|
125
|
+
type: "object",
|
|
126
|
+
defaultValue: Promise.resolve()
|
|
115
127
|
}
|
|
128
|
+
|
|
116
129
|
},
|
|
117
130
|
aggregations: {
|
|
118
131
|
commands: {
|
|
@@ -122,20 +135,9 @@ sap.ui.define([
|
|
|
122
135
|
},
|
|
123
136
|
events: {
|
|
124
137
|
/**
|
|
125
|
-
* Fired if the Stack changes because of a change execution or if
|
|
126
|
-
* In case of change execution the modified event will be fired after the commandExecuted event.
|
|
138
|
+
* Fired if the Stack changes because of a change execution or if commands get removed.
|
|
127
139
|
*/
|
|
128
|
-
modified: {}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Fired after a successful execution of a command (also includes undo).
|
|
132
|
-
*/
|
|
133
|
-
commandExecuted: {
|
|
134
|
-
parameters: {
|
|
135
|
-
command: {type: "object"},
|
|
136
|
-
undo: {type: "boolean"}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
140
|
+
modified: {}
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
});
|
|
@@ -173,33 +175,11 @@ sap.ui.define([
|
|
|
173
175
|
return Promise.resolve(oStack);
|
|
174
176
|
};
|
|
175
177
|
|
|
176
|
-
/**
|
|
177
|
-
* @param {function} fnHandler Handler are called when commands are executed or undone. They get parameter
|
|
178
|
-
* like the commandExecuted event and the stack will wait for any processing
|
|
179
|
-
* until they are done.
|
|
180
|
-
*/
|
|
181
|
-
Stack.prototype.addCommandExecutionHandler = function(fnHandler) {
|
|
182
|
-
this._aCommandExecutionHandler.push(fnHandler);
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
Stack.prototype.removeCommandExecutionHandler = function(fnHandler) {
|
|
186
|
-
var i = this._aCommandExecutionHandler.indexOf(fnHandler);
|
|
187
|
-
if (i > -1) {
|
|
188
|
-
this._aCommandExecutionHandler.splice(i, 1);
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
|
|
192
178
|
Stack.prototype.init = function() {
|
|
193
179
|
this._aCommandExecutionHandler = [];
|
|
194
180
|
this._toBeExecuted = -1;
|
|
195
181
|
};
|
|
196
182
|
|
|
197
|
-
Stack.prototype._waitForCommandExecutionHandler = function(mParam) {
|
|
198
|
-
return Promise.all(this._aCommandExecutionHandler.map(function(fnHandler) {
|
|
199
|
-
return fnHandler(mParam);
|
|
200
|
-
}));
|
|
201
|
-
};
|
|
202
|
-
|
|
203
183
|
Stack.prototype._getCommandToBeExecuted = function() {
|
|
204
184
|
return this.getCommands()[this._toBeExecuted];
|
|
205
185
|
};
|
|
@@ -256,36 +236,88 @@ sap.ui.define([
|
|
|
256
236
|
return this.getCommands().length === 0;
|
|
257
237
|
};
|
|
258
238
|
|
|
239
|
+
async function addCommandChangesToPersistence(oCommand) {
|
|
240
|
+
let oAppComponent;
|
|
241
|
+
const aSubCommands = this.getSubCommands(oCommand);
|
|
242
|
+
const aManifestPromises = [];
|
|
243
|
+
let aChanges = aSubCommands.map((oSubCommand) => {
|
|
244
|
+
// Filter out runtime only changes
|
|
245
|
+
if (oSubCommand.getRuntimeOnly()) {
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
248
|
+
// Manifest changes are stored separately
|
|
249
|
+
if (oSubCommand instanceof ManifestCommand) {
|
|
250
|
+
aManifestPromises.push(oSubCommand.createAndStoreChange());
|
|
251
|
+
return undefined;
|
|
252
|
+
}
|
|
253
|
+
if (oSubCommand instanceof FlexCommand) {
|
|
254
|
+
oAppComponent = oSubCommand.getAppComponent();
|
|
255
|
+
if (oAppComponent) {
|
|
256
|
+
return oSubCommand.getPreparedChange();
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return undefined;
|
|
260
|
+
}).filter(Boolean);
|
|
261
|
+
await Promise.all(aManifestPromises);
|
|
262
|
+
// Filter out persisted changes
|
|
263
|
+
if (this._aPersistedChanges) {
|
|
264
|
+
aChanges = aChanges.filter((oChange) => this._aPersistedChanges.indexOf(oChange.getId()) === -1);
|
|
265
|
+
}
|
|
266
|
+
if (oAppComponent) {
|
|
267
|
+
PersistenceWriteAPI.add({
|
|
268
|
+
flexObjects: aChanges,
|
|
269
|
+
selector: oAppComponent
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function removeCommandChangesFromPersistence(oCommand) {
|
|
275
|
+
let oAppComponent;
|
|
276
|
+
const aFlexObjects = [];
|
|
277
|
+
const aSubCommands = this.getSubCommands(oCommand);
|
|
278
|
+
aSubCommands.forEach((oSubCommand) => {
|
|
279
|
+
// for revertable changes which don't belong to LREP (variantSwitch) or runtime only changes
|
|
280
|
+
if (!(oSubCommand instanceof FlexCommand || oSubCommand instanceof ManifestCommand)
|
|
281
|
+
|| oSubCommand.getRuntimeOnly()) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const oChange = oSubCommand.getPreparedChange();
|
|
285
|
+
oAppComponent = oSubCommand.getAppComponent();
|
|
286
|
+
if (oAppComponent) {
|
|
287
|
+
aFlexObjects.push(oChange);
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
if (oAppComponent) {
|
|
291
|
+
PersistenceWriteAPI.remove({
|
|
292
|
+
flexObjects: aFlexObjects,
|
|
293
|
+
selector: oAppComponent
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
259
298
|
Stack.prototype.execute = function() {
|
|
260
299
|
this.setLastCommandExecuted(
|
|
261
|
-
this.getLastCommandExecuted().catch(
|
|
300
|
+
this.getLastCommandExecuted().catch(() => {
|
|
262
301
|
// continue also if previous command failed
|
|
263
|
-
}).then(
|
|
302
|
+
}).then(async () => {
|
|
264
303
|
var oCommand = this._getCommandToBeExecuted();
|
|
265
304
|
if (oCommand) {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
};
|
|
270
|
-
return oCommand.execute()
|
|
271
|
-
|
|
272
|
-
.then(this._waitForCommandExecutionHandler.bind(this, mParam))
|
|
273
|
-
|
|
274
|
-
.then(function() {
|
|
305
|
+
try {
|
|
306
|
+
await addCommandChangesToPersistence.call(this, oCommand);
|
|
307
|
+
await oCommand.execute();
|
|
275
308
|
this._toBeExecuted--;
|
|
276
309
|
const aDiscardedChanges = oCommand.getDiscardedChanges?.();
|
|
277
310
|
if (aDiscardedChanges) {
|
|
278
311
|
handleDiscardedChanges.call(this, aDiscardedChanges, false);
|
|
279
312
|
}
|
|
280
|
-
this.fireCommandExecuted(mParam);
|
|
281
313
|
this.fireModified();
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
.catch(function(oError) {
|
|
285
|
-
oError ||= new Error("Executing of the change failed.");
|
|
314
|
+
} catch (oCaughtError) {
|
|
315
|
+
const oError = oCaughtError || new Error("Executing of the change failed.");
|
|
286
316
|
oError.index = this._toBeExecuted;
|
|
287
317
|
oError.command = this.removeCommand(this._toBeExecuted); // remove failing command
|
|
288
318
|
this._toBeExecuted--;
|
|
319
|
+
// Remove Flex Changes for failed command from persistence
|
|
320
|
+
removeCommandChangesFromPersistence.call(this, oError.command);
|
|
289
321
|
var oRtaResourceBundle = Lib.getResourceBundleFor("sap.ui.rta");
|
|
290
322
|
// AddXMLAtExtensionPoint errors explain to the user what they did wrong, so they shouldn't open an incident
|
|
291
323
|
const sErrorMessage = oCommand.isA("sap.ui.rta.command.AddXMLAtExtensionPoint") ?
|
|
@@ -295,41 +327,37 @@ sap.ui.define([
|
|
|
295
327
|
{title: oRtaResourceBundle.getText("HEADER_ERROR")},
|
|
296
328
|
"error"
|
|
297
329
|
);
|
|
298
|
-
|
|
299
|
-
}
|
|
330
|
+
throw oError;
|
|
331
|
+
}
|
|
300
332
|
}
|
|
301
333
|
return undefined;
|
|
302
|
-
}
|
|
334
|
+
})
|
|
303
335
|
);
|
|
304
336
|
return this.getLastCommandExecuted();
|
|
305
337
|
};
|
|
306
338
|
|
|
307
339
|
Stack.prototype._unExecute = function() {
|
|
308
|
-
|
|
309
|
-
this.
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
handleDiscardedChanges.call(this, aDiscardedChanges, true);
|
|
340
|
+
this.setLastCommandUnExecuted(
|
|
341
|
+
this.getLastCommandUnExecuted().catch(() => {
|
|
342
|
+
// continue also if previous undo failed
|
|
343
|
+
}).then(async () => {
|
|
344
|
+
if (this.canUndo()) {
|
|
345
|
+
this._bUndoneCommands = true;
|
|
346
|
+
this._toBeExecuted++;
|
|
347
|
+
var oCommand = this._getCommandToBeExecuted();
|
|
348
|
+
const aDiscardedChanges = oCommand.getDiscardedChanges?.();
|
|
349
|
+
if (oCommand) {
|
|
350
|
+
await oCommand.undo();
|
|
351
|
+
removeCommandChangesFromPersistence.call(this, oCommand);
|
|
352
|
+
if (aDiscardedChanges) {
|
|
353
|
+
handleDiscardedChanges.call(this, aDiscardedChanges, true);
|
|
354
|
+
}
|
|
355
|
+
this.fireModified();
|
|
325
356
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
return Promise.resolve();
|
|
331
|
-
}
|
|
332
|
-
return Promise.resolve();
|
|
357
|
+
}
|
|
358
|
+
})
|
|
359
|
+
);
|
|
360
|
+
return this.getLastCommandUnExecuted();
|
|
333
361
|
};
|
|
334
362
|
|
|
335
363
|
Stack.prototype.canUndo = function() {
|
|
@@ -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.139.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.139.0",
|
|
33
33
|
dependencies: ["sap.ui.core", "sap.m", "sap.ui.fl", "sap.ui.dt"],
|
|
34
34
|
types: [],
|
|
35
35
|
interfaces: [],
|