@openui5/sap.ui.rta 1.133.1 → 1.135.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/.reuse/dep5 +0 -7
- package/THIRDPARTY.txt +2 -23
- 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 +38 -17
- package/src/sap/ui/rta/Utils.js +11 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +26 -26
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +0 -4
- package/src/sap/ui/rta/appVariant/Feature.js +85 -91
- package/src/sap/ui/rta/appVariant/Utils.js +50 -56
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +30 -30
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +2 -2
- package/src/sap/ui/rta/command/AddIFrame.js +1 -1
- package/src/sap/ui/rta/command/AddProperty.js +1 -1
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/command/AnnotationCommand.js +65 -5
- 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 +71 -47
- package/src/sap/ui/rta/command/CompositeCommand.js +12 -12
- 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 +92 -0
- package/src/sap/ui/rta/command/FlexCommand.js +54 -43
- package/src/sap/ui/rta/command/LREPSerializer.js +23 -23
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/ManifestCommand.js +112 -0
- 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 +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/command/{appDescriptor → manifest}/AddLibrary.js +10 -10
- package/src/sap/ui/rta/enablement/elementActionTest.js +1 -7
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +22 -7
- package/src/sap/ui/rta/messagebundle_ar.properties +3 -1
- package/src/sap/ui/rta/messagebundle_bg.properties +4 -2
- package/src/sap/ui/rta/messagebundle_ca.properties +3 -1
- package/src/sap/ui/rta/messagebundle_cnr.properties +4 -2
- package/src/sap/ui/rta/messagebundle_cs.properties +3 -1
- package/src/sap/ui/rta/messagebundle_cy.properties +3 -1
- package/src/sap/ui/rta/messagebundle_da.properties +4 -2
- package/src/sap/ui/rta/messagebundle_de.properties +3 -1
- package/src/sap/ui/rta/messagebundle_el.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en_GB.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -2
- package/src/sap/ui/rta/messagebundle_es.properties +3 -1
- package/src/sap/ui/rta/messagebundle_es_MX.properties +4 -2
- package/src/sap/ui/rta/messagebundle_et.properties +3 -1
- package/src/sap/ui/rta/messagebundle_fi.properties +4 -2
- package/src/sap/ui/rta/messagebundle_fr.properties +12 -10
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -5
- package/src/sap/ui/rta/messagebundle_hi.properties +3 -1
- package/src/sap/ui/rta/messagebundle_hr.properties +34 -32
- package/src/sap/ui/rta/messagebundle_hu.properties +3 -1
- package/src/sap/ui/rta/messagebundle_id.properties +3 -1
- package/src/sap/ui/rta/messagebundle_it.properties +48 -46
- package/src/sap/ui/rta/messagebundle_iw.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ja.properties +3 -1
- package/src/sap/ui/rta/messagebundle_kk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ko.properties +3 -1
- package/src/sap/ui/rta/messagebundle_lt.properties +3 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +3 -1
- package/src/sap/ui/rta/messagebundle_mk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ms.properties +3 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_no.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ro.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ru.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +4 -2
- package/src/sap/ui/rta/messagebundle_sk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sr.properties +4 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +3 -1
- package/src/sap/ui/rta/messagebundle_th.properties +3 -1
- package/src/sap/ui/rta/messagebundle_tr.properties +3 -1
- package/src/sap/ui/rta/messagebundle_uk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +3 -1
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +3 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +3 -1
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +41 -35
- package/src/sap/ui/rta/plugin/AddXMLPlugin.js +168 -0
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +161 -0
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +7 -4
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
- 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 +71 -61
- 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 +1 -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 +38 -51
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +85 -47
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +97 -33
- package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +72 -17
- 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/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +10 -4
- 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/Toolbar.adaptation.less +5 -0
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +21 -3
- package/src/sap/ui/rta/toolbar/Adaptation.js +33 -7
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +4 -3
- 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 +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +5 -7
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- 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 +2 -2
- package/src/sap/ui/rta/util/isReuseComponent.js +44 -0
- package/src/sap/ui/rta/util/validateText.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +12 -7
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +0 -5
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +0 -114
|
@@ -36,19 +36,19 @@ sap.ui.define([
|
|
|
36
36
|
) {
|
|
37
37
|
"use strict";
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
let _sIdRunningApp;
|
|
40
|
+
let _bKeyUser;
|
|
41
|
+
let _sLayer;
|
|
42
|
+
let _oCrossAppNavService;
|
|
43
|
+
let sModulePath;
|
|
44
|
+
let oI18n;
|
|
45
45
|
|
|
46
46
|
return Controller.extend("sap.ui.rta.appVariant.manageApps.webapp.controller.ManageApps", {
|
|
47
47
|
onInit() {
|
|
48
48
|
_sIdRunningApp = this.getOwnerComponent().getIdRunningApp();
|
|
49
49
|
_bKeyUser = this.getOwnerComponent().getIsOverviewForKeyUser();
|
|
50
50
|
_sLayer = this.getOwnerComponent().getLayer();
|
|
51
|
-
|
|
51
|
+
const oUShellContainer = FlUtils.getUshellContainer();
|
|
52
52
|
|
|
53
53
|
if (!oI18n) {
|
|
54
54
|
this._createResourceBundle();
|
|
@@ -79,7 +79,7 @@ sap.ui.define([
|
|
|
79
79
|
}.bind(this))
|
|
80
80
|
.catch(function(oError) {
|
|
81
81
|
AppVariantUtils.closeOverviewDialog();
|
|
82
|
-
|
|
82
|
+
const oErrorInfo = AppVariantUtils.buildErrorInfo("MSG_MANAGE_APPS_FAILED", oError);
|
|
83
83
|
oErrorInfo.overviewDialog = true;
|
|
84
84
|
BusyIndicator.hide();
|
|
85
85
|
return AppVariantUtils.showRelevantDialog(oErrorInfo, false);
|
|
@@ -100,15 +100,15 @@ sap.ui.define([
|
|
|
100
100
|
},
|
|
101
101
|
|
|
102
102
|
_highlightNewCreatedAppVariant(aAppVariantOverviewAttributes) {
|
|
103
|
-
|
|
103
|
+
const oTable = this.byId("Table1");
|
|
104
104
|
if (!oTable) {
|
|
105
105
|
return Promise.resolve();
|
|
106
106
|
}
|
|
107
107
|
oTable.focus();
|
|
108
108
|
|
|
109
|
-
aAppVariantOverviewAttributes.forEach(function(
|
|
110
|
-
if (
|
|
111
|
-
||
|
|
109
|
+
aAppVariantOverviewAttributes.forEach(function(oAppVariantManifest, index) {
|
|
110
|
+
if (oAppVariantManifest.currentStatus === oI18n.getText("MAA_NEW_APP_VARIANT")
|
|
111
|
+
|| oAppVariantManifest.currentStatus === oI18n.getText("MAA_OPERATION_IN_PROGRESS")
|
|
112
112
|
) {
|
|
113
113
|
if (oTable.getItems().length >= index) {
|
|
114
114
|
oTable.getItems()[index].focus();
|
|
@@ -120,11 +120,11 @@ sap.ui.define([
|
|
|
120
120
|
},
|
|
121
121
|
|
|
122
122
|
_arrangeOverviewDataAndBindToModel(aAppVariantOverviewAttributes) {
|
|
123
|
-
|
|
123
|
+
const aAdaptingAppAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
|
|
124
124
|
return oAppVariantProperty.appId === _sIdRunningApp;
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
const oAdaptingAppAttributes = aAdaptingAppAttributes[0];
|
|
128
128
|
if (oAdaptingAppAttributes && oAdaptingAppAttributes.appVarStatus !== "R") {
|
|
129
129
|
oAdaptingAppAttributes.currentStatus = oI18n.getText("MAA_CURRENTLY_ADAPTING");
|
|
130
130
|
}
|
|
@@ -135,11 +135,11 @@ sap.ui.define([
|
|
|
135
135
|
|
|
136
136
|
aAppVariantOverviewAttributes.unshift(oAdaptingAppAttributes);
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
const aReferenceAppAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
|
|
139
139
|
return oAppVariantProperty.isOriginal;
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
-
|
|
142
|
+
const oReferenceAppAttributes = aReferenceAppAttributes[0];
|
|
143
143
|
|
|
144
144
|
aAppVariantOverviewAttributes = aAppVariantOverviewAttributes.filter(function(oAppVariantProperty) {
|
|
145
145
|
return !oAppVariantProperty.isOriginal;
|
|
@@ -149,11 +149,11 @@ sap.ui.define([
|
|
|
149
149
|
|
|
150
150
|
// Bind the app variant overview to JSON model
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
const oModelData = {
|
|
153
153
|
appVariants: aAppVariantOverviewAttributes
|
|
154
154
|
};
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
const oModel = Model.createModel(oModelData);
|
|
157
157
|
this.getView().setModel(oModel);
|
|
158
158
|
|
|
159
159
|
return Promise.resolve(aAppVariantOverviewAttributes);
|
|
@@ -216,8 +216,8 @@ sap.ui.define([
|
|
|
216
216
|
},
|
|
217
217
|
|
|
218
218
|
onMenuAction(oEvent) {
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
let oItem = oEvent.getParameter("item");
|
|
220
|
+
let sItemPath = "";
|
|
221
221
|
|
|
222
222
|
while (oItem instanceof MenuItem) {
|
|
223
223
|
sItemPath = `${oItem.getText()} > ${sItemPath}`;
|
|
@@ -242,11 +242,11 @@ sap.ui.define([
|
|
|
242
242
|
},
|
|
243
243
|
|
|
244
244
|
handleUiAdaptation(oEvent) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
245
|
+
const sSemanticObject = this.getModelProperty("semanticObject", oEvent.getSource().getBindingContext());
|
|
246
|
+
const sAction = this.getModelProperty("action", oEvent.getSource().getBindingContext());
|
|
247
|
+
const oParams = this.getModelProperty("params", oEvent.getSource().getBindingContext());
|
|
248
248
|
|
|
249
|
-
|
|
249
|
+
let oNavigationParams;
|
|
250
250
|
if (sSemanticObject && sAction && oParams) {
|
|
251
251
|
oNavigationParams = {
|
|
252
252
|
target: {
|
|
@@ -271,23 +271,23 @@ sap.ui.define([
|
|
|
271
271
|
},
|
|
272
272
|
|
|
273
273
|
copyId(oEvent) {
|
|
274
|
-
|
|
274
|
+
const sCopiedId = this.getModelProperty("appId", oEvent.getSource().getBindingContext());
|
|
275
275
|
AppVariantUtils.copyId(sCopiedId);
|
|
276
276
|
MessageToast.show(oI18n.getText("MAA_COPY_ID_SUCCESS"));
|
|
277
277
|
},
|
|
278
278
|
|
|
279
279
|
deleteAppVariant(oEvent) {
|
|
280
|
-
|
|
280
|
+
const oInfo = {};
|
|
281
281
|
if (!oI18n) {
|
|
282
282
|
this._createResourceBundle();
|
|
283
283
|
}
|
|
284
|
-
|
|
284
|
+
const sMessage = oI18n.getText("MSG_APP_VARIANT_DELETE_CONFIRMATION");
|
|
285
285
|
oInfo.text = sMessage;
|
|
286
286
|
oInfo.deleteAppVariant = true;
|
|
287
287
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
const sAppVarId = this.getModelProperty("appId", oEvent.getSource().getBindingContext());
|
|
289
|
+
const sCurrentStatus = this.getModelProperty("currentStatus", oEvent.getSource().getBindingContext());
|
|
290
|
+
const bCurrentlyAdapting = sCurrentStatus === oI18n.getText("MAA_CURRENTLY_ADAPTING");
|
|
291
291
|
|
|
292
292
|
return AppVariantUtils.showRelevantDialog(oInfo)
|
|
293
293
|
.then(function() {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
2
|
MAA_DIALOG_ICON=Ic\u00F4ne
|
|
3
3
|
MAA_DIALOG_DESCRIPTION=Description
|
|
4
|
-
MAA_DIALOG_COPY_ID_ACTION=Copier l'
|
|
4
|
+
MAA_DIALOG_COPY_ID_ACTION=Action Copier l'ID
|
|
5
5
|
MAA_DIALOG_ADAPT_UI_ACTION=Adapter l'action d'IU
|
|
6
|
-
MAA_DIALOG_SAVE_AS_ACTION=Enregistrer
|
|
6
|
+
MAA_DIALOG_SAVE_AS_ACTION=Action Enregistrer sous
|
|
7
7
|
MAA_DIALOG_ACTIONS=Actions
|
|
8
8
|
MAA_DIALOG_DELETE_APPVAR=Supprimer la variante d'application
|
|
9
9
|
MAA_DIALOG_ADAPT_UI=Adapter l'IU
|
|
@@ -5,10 +5,18 @@
|
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
7
|
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
8
|
+
"sap/ui/fl/write/api/FeaturesAPI",
|
|
9
|
+
"sap/ui/fl/write/api/LocalResetAPI",
|
|
10
|
+
"sap/ui/fl/write/api/PersistenceWriteAPI",
|
|
11
|
+
"sap/ui/fl/LayerUtils",
|
|
8
12
|
"sap/ui/rta/command/FlexCommand",
|
|
9
13
|
"sap/ui/rta/library"
|
|
10
14
|
], function(
|
|
11
15
|
ChangesWriteAPI,
|
|
16
|
+
FeaturesAPI,
|
|
17
|
+
LocalResetAPI,
|
|
18
|
+
PersistenceWriteAPI,
|
|
19
|
+
LayerUtils,
|
|
12
20
|
FlexCommand,
|
|
13
21
|
rtaLibrary
|
|
14
22
|
) {
|
|
@@ -21,7 +29,7 @@ sap.ui.define([
|
|
|
21
29
|
* @extends sap.ui.rta.command.FlexCommand
|
|
22
30
|
*
|
|
23
31
|
* @author SAP SE
|
|
24
|
-
* @version 1.
|
|
32
|
+
* @version 1.135.0
|
|
25
33
|
*
|
|
26
34
|
* @constructor
|
|
27
35
|
* @private
|
|
@@ -40,6 +48,10 @@ sap.ui.define([
|
|
|
40
48
|
},
|
|
41
49
|
content: {
|
|
42
50
|
type: "any"
|
|
51
|
+
},
|
|
52
|
+
changesToDelete: {
|
|
53
|
+
type: "object[]",
|
|
54
|
+
defaultValue: []
|
|
43
55
|
}
|
|
44
56
|
},
|
|
45
57
|
events: {}
|
|
@@ -47,6 +59,7 @@ sap.ui.define([
|
|
|
47
59
|
});
|
|
48
60
|
|
|
49
61
|
AnnotationCommand.prototype._createChange = function(mFlexSettings, sVariantManagementReference, sCommand) {
|
|
62
|
+
this._aToBeResetChanges = [];
|
|
50
63
|
const mChangeSpecificData = {
|
|
51
64
|
...this._getChangeSpecificData(),
|
|
52
65
|
...mFlexSettings,
|
|
@@ -55,6 +68,36 @@ sap.ui.define([
|
|
|
55
68
|
jsOnly: this.getJsOnly(),
|
|
56
69
|
generator: mFlexSettings.generator || rtaLibrary.GENERATOR_NAME
|
|
57
70
|
};
|
|
71
|
+
|
|
72
|
+
if (this.getChangesToDelete().length) {
|
|
73
|
+
// If available, all changes of the current layer must be deleted via the LocalResetAPI
|
|
74
|
+
// Changes in a lower layer can't be deleted via the LocalResetAPI and must be deleted via the deactivate change
|
|
75
|
+
const aToBeDeactivatedChanges = [];
|
|
76
|
+
if (FeaturesAPI.isLocalResetEnabled()) {
|
|
77
|
+
this.getChangesToDelete().forEach((oFlexObject) => {
|
|
78
|
+
if (LayerUtils.compareAgainstCurrentLayer(oFlexObject.getLayer(), mFlexSettings.layer) === -1) {
|
|
79
|
+
aToBeDeactivatedChanges.push(oFlexObject);
|
|
80
|
+
} else {
|
|
81
|
+
this._aToBeResetChanges.push(oFlexObject);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
} else {
|
|
85
|
+
aToBeDeactivatedChanges.push(...this.getChangesToDelete());
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (aToBeDeactivatedChanges.length) {
|
|
89
|
+
this._oDeactivateChange = ChangesWriteAPI.create({
|
|
90
|
+
changeSpecificData: {
|
|
91
|
+
changeType: "deactivateChanges",
|
|
92
|
+
content: { changeIds: aToBeDeactivatedChanges.map((oFlexObject) => oFlexObject.getId()) },
|
|
93
|
+
generator: mFlexSettings.generator || rtaLibrary.GENERATOR_NAME,
|
|
94
|
+
layer: mFlexSettings.layer
|
|
95
|
+
},
|
|
96
|
+
selector: this.getAppComponent()
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
58
101
|
return ChangesWriteAPI.create({
|
|
59
102
|
changeSpecificData: mChangeSpecificData,
|
|
60
103
|
annotationChange: true,
|
|
@@ -62,12 +105,29 @@ sap.ui.define([
|
|
|
62
105
|
});
|
|
63
106
|
};
|
|
64
107
|
|
|
65
|
-
AnnotationCommand.prototype.execute = function() {
|
|
66
|
-
|
|
108
|
+
AnnotationCommand.prototype.execute = async function() {
|
|
109
|
+
// Annotation changes can only be applied during app start, so execute and undo only have to take care of reset / deactivate changes
|
|
110
|
+
if (this._aToBeResetChanges.length) {
|
|
111
|
+
await LocalResetAPI.resetChanges(this._aToBeResetChanges, this.getAppComponent(), true);
|
|
112
|
+
}
|
|
113
|
+
if (this._oDeactivateChange) {
|
|
114
|
+
PersistenceWriteAPI.add({
|
|
115
|
+
selector: this.getAppComponent(),
|
|
116
|
+
flexObjects: [this._oDeactivateChange]
|
|
117
|
+
});
|
|
118
|
+
}
|
|
67
119
|
};
|
|
68
120
|
|
|
69
|
-
AnnotationCommand.prototype.undo = function() {
|
|
70
|
-
|
|
121
|
+
AnnotationCommand.prototype.undo = async function() {
|
|
122
|
+
if (this._aToBeResetChanges.length) {
|
|
123
|
+
await LocalResetAPI.restoreChanges(this._aToBeResetChanges, this.getAppComponent(), true);
|
|
124
|
+
}
|
|
125
|
+
if (this._oDeactivateChange) {
|
|
126
|
+
PersistenceWriteAPI.remove({
|
|
127
|
+
selector: this.getAppComponent(),
|
|
128
|
+
flexObjects: [this._oDeactivateChange]
|
|
129
|
+
});
|
|
130
|
+
}
|
|
71
131
|
};
|
|
72
132
|
|
|
73
133
|
/**
|
|
@@ -27,19 +27,19 @@ sap.ui.define([
|
|
|
27
27
|
"use strict";
|
|
28
28
|
|
|
29
29
|
function evaluateTemplateBinding(oElementOverlay) {
|
|
30
|
-
|
|
30
|
+
const mBoundControl = ElementUtil.getAggregationInformation(oElementOverlay.getElement());
|
|
31
31
|
if (mBoundControl.elementId) {
|
|
32
32
|
// check for additional binding
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const oBoundControlOverlay = OverlayRegistry.getOverlay(mBoundControl.elementId);
|
|
34
|
+
const oParentElementOverlay = oBoundControlOverlay.getParentElementOverlay();
|
|
35
|
+
const bAdditionalBinding = oParentElementOverlay ?
|
|
36
36
|
!!ElementUtil.getAggregationInformation(oParentElementOverlay.getElement()).templateId : false;
|
|
37
37
|
|
|
38
38
|
if (bAdditionalBinding) {
|
|
39
39
|
throw DtUtil.createError("CommandFactory#evaluateTemplateBinding", "Multiple template bindings are not supported", "sap.ui.rta");
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
const sTemplateId = ElementUtil.extractTemplateId(mBoundControl);
|
|
43
43
|
if (sTemplateId) {
|
|
44
44
|
return {
|
|
45
45
|
templateSelector: mBoundControl.elementId,
|
|
@@ -56,10 +56,10 @@ sap.ui.define([
|
|
|
56
56
|
// For the Move Action the UI control is already moved while the corresponding object in the binding template is in the source position.
|
|
57
57
|
// Therefore we have to overwrite the index of the control in the stack with the source index (iIndex) to determine the needed template object.
|
|
58
58
|
function getTemplateElementId(vElementOrId, iIndex) {
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
const oElement = (typeof vElementOrId === "string") ? Element.getElementById(vElementOrId) : vElementOrId;
|
|
60
|
+
const oElementOverlay = OverlayRegistry.getOverlay(oElement);
|
|
61
61
|
if (oElementOverlay) {
|
|
62
|
-
|
|
62
|
+
const mBoundControl = ElementUtil.getAggregationInformation(oElement);
|
|
63
63
|
if (typeof iIndex === "number") {
|
|
64
64
|
mBoundControl.stack[0].index = iIndex;
|
|
65
65
|
}
|
|
@@ -75,9 +75,9 @@ sap.ui.define([
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
function configureActionCommand(oCommand, vAction) {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
let sChangeType;
|
|
79
|
+
let bJsOnly = false;
|
|
80
|
+
let bVariantIndependent = false;
|
|
81
81
|
|
|
82
82
|
if (typeof vAction === "string") {
|
|
83
83
|
sChangeType = vAction;
|
|
@@ -102,6 +102,20 @@ sap.ui.define([
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
function configureAddXmlCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
105
|
+
let vAction;
|
|
106
|
+
if (oDesignTimeMetadata) {
|
|
107
|
+
vAction = oDesignTimeMetadata.getAction(mSettings.name, oElement);
|
|
108
|
+
}
|
|
109
|
+
// the change type is not configurable via designtime
|
|
110
|
+
// it can also not be disabled with 'not-adaptable' or null
|
|
111
|
+
const oAction = vAction || {};
|
|
112
|
+
Object.assign(oAction, {
|
|
113
|
+
changeType: mSettings.name
|
|
114
|
+
});
|
|
115
|
+
return oAction;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function configureExtendControllerCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
105
119
|
var vAction;
|
|
106
120
|
if (oDesignTimeMetadata) {
|
|
107
121
|
vAction = oDesignTimeMetadata.getAction(mSettings.name, oElement);
|
|
@@ -121,8 +135,8 @@ sap.ui.define([
|
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
function configureCreateContainerCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
124
|
-
|
|
125
|
-
|
|
138
|
+
const oNewAddedElement = mSettings.element || Element.getElementById(mSettings.element.id);
|
|
139
|
+
const oAction = oDesignTimeMetadata.getActionDataFromAggregations("createContainer", oNewAddedElement)[0];
|
|
126
140
|
return oAction;
|
|
127
141
|
}
|
|
128
142
|
|
|
@@ -134,14 +148,14 @@ sap.ui.define([
|
|
|
134
148
|
}
|
|
135
149
|
|
|
136
150
|
function configureMoveCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
137
|
-
|
|
138
|
-
|
|
151
|
+
const oMovedElement = mSettings.movedElements[0].element || Element.getElementById(mSettings.movedElements[0].id);
|
|
152
|
+
const oAction = oDesignTimeMetadata.getAction("move", oMovedElement);
|
|
139
153
|
return oAction;
|
|
140
154
|
}
|
|
141
155
|
|
|
142
156
|
function adjustMoveCommand(mSettings) {
|
|
143
|
-
|
|
144
|
-
|
|
157
|
+
const aTemplateMovedElements = mSettings.movedElements.map(function(oMovedElement) {
|
|
158
|
+
const oMovedElementInTemplate = Element.getElementById(getTemplateElementId(oMovedElement.element, oMovedElement.sourceIndex));
|
|
145
159
|
evaluateResult(oMovedElementInTemplate);
|
|
146
160
|
return oMovedElementInTemplate;
|
|
147
161
|
});
|
|
@@ -161,8 +175,8 @@ sap.ui.define([
|
|
|
161
175
|
}
|
|
162
176
|
|
|
163
177
|
function configureRenameCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
164
|
-
|
|
165
|
-
|
|
178
|
+
const oRenamedElement = mSettings.renamedElement;
|
|
179
|
+
const oAction = oDesignTimeMetadata.getAction("rename", oRenamedElement);
|
|
166
180
|
return oAction;
|
|
167
181
|
}
|
|
168
182
|
|
|
@@ -174,13 +188,13 @@ sap.ui.define([
|
|
|
174
188
|
}
|
|
175
189
|
|
|
176
190
|
function configureRemoveCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
177
|
-
|
|
191
|
+
let oRemovedElement = mSettings.removedElement;
|
|
178
192
|
if (!oRemovedElement) {
|
|
179
193
|
oRemovedElement = oElement;
|
|
180
194
|
} else if (!(oRemovedElement instanceof ManagedObject)) {
|
|
181
195
|
throw new Error("No valid 'removedElement' found");
|
|
182
196
|
}
|
|
183
|
-
|
|
197
|
+
const oAction = oDesignTimeMetadata.getAction("remove", oRemovedElement);
|
|
184
198
|
return oAction;
|
|
185
199
|
}
|
|
186
200
|
|
|
@@ -192,8 +206,8 @@ sap.ui.define([
|
|
|
192
206
|
}
|
|
193
207
|
|
|
194
208
|
function configureCombineCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
195
|
-
|
|
196
|
-
|
|
209
|
+
const oCombineElement = mSettings.source;
|
|
210
|
+
const oAction = oDesignTimeMetadata.getAction("combine", oCombineElement);
|
|
197
211
|
return oAction;
|
|
198
212
|
}
|
|
199
213
|
|
|
@@ -202,7 +216,7 @@ sap.ui.define([
|
|
|
202
216
|
evaluateResult(mSettings.element);
|
|
203
217
|
mSettings.source = Element.getElementById(getTemplateElementId(mSettings.source));
|
|
204
218
|
evaluateResult(mSettings.source);
|
|
205
|
-
|
|
219
|
+
const aTemplateCombineElements = mSettings.combineElements.map(function(oCombineField) {
|
|
206
220
|
oCombineField = Element.getElementById(getTemplateElementId(oCombineField));
|
|
207
221
|
evaluateResult(oCombineField);
|
|
208
222
|
return oCombineField;
|
|
@@ -211,8 +225,8 @@ sap.ui.define([
|
|
|
211
225
|
}
|
|
212
226
|
|
|
213
227
|
function configureSplitCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
214
|
-
|
|
215
|
-
|
|
228
|
+
const oSplitElement = mSettings.source;
|
|
229
|
+
const oAction = oDesignTimeMetadata.getAction("split", oSplitElement);
|
|
216
230
|
return oAction;
|
|
217
231
|
}
|
|
218
232
|
|
|
@@ -226,7 +240,7 @@ sap.ui.define([
|
|
|
226
240
|
}
|
|
227
241
|
|
|
228
242
|
function configureAddDelegatePropertyCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
229
|
-
|
|
243
|
+
const oNewAddedElement = mSettings.element;
|
|
230
244
|
return oDesignTimeMetadata.getAction("add", oNewAddedElement, "delegate");
|
|
231
245
|
}
|
|
232
246
|
|
|
@@ -238,8 +252,8 @@ sap.ui.define([
|
|
|
238
252
|
}
|
|
239
253
|
|
|
240
254
|
function configureRevealCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
241
|
-
|
|
242
|
-
|
|
255
|
+
const oRevealedElement = mSettings.element;
|
|
256
|
+
const oAction = oDesignTimeMetadata.getAction("reveal", oRevealedElement);
|
|
243
257
|
return oAction;
|
|
244
258
|
}
|
|
245
259
|
|
|
@@ -257,9 +271,9 @@ sap.ui.define([
|
|
|
257
271
|
}
|
|
258
272
|
|
|
259
273
|
function configureCustomAddCommand(oElement, mSettings, oDesignTimeMetadata) {
|
|
260
|
-
|
|
274
|
+
const oAddAction = oDesignTimeMetadata.getAction("add", mSettings.element);
|
|
261
275
|
if (oAddAction && oAddAction.custom && typeof oAddAction.custom.getItems === "function") {
|
|
262
|
-
|
|
276
|
+
const oAction = {
|
|
263
277
|
...oAddAction.custom,
|
|
264
278
|
changeOnRelevantContainer: mSettings.changeOnRelevantContainer,
|
|
265
279
|
changeType: mSettings.changeType
|
|
@@ -282,7 +296,7 @@ sap.ui.define([
|
|
|
282
296
|
return "propertyChange";
|
|
283
297
|
}
|
|
284
298
|
|
|
285
|
-
|
|
299
|
+
const mCommands = { // Command names lower camel case
|
|
286
300
|
composite: {
|
|
287
301
|
clazz: "sap/ui/rta/command/CompositeCommand",
|
|
288
302
|
noSelector: true
|
|
@@ -306,6 +320,11 @@ sap.ui.define([
|
|
|
306
320
|
configure: configureAddXmlCommand,
|
|
307
321
|
adjustForBinding: adjustSelectorForCommand
|
|
308
322
|
},
|
|
323
|
+
codeExt: {
|
|
324
|
+
clazz: "sap/ui/rta/command/ExtendControllerCommand",
|
|
325
|
+
configure: configureExtendControllerCommand,
|
|
326
|
+
adjustForBinding: adjustSelectorForCommand
|
|
327
|
+
},
|
|
309
328
|
createContainer: {
|
|
310
329
|
clazz: "sap/ui/rta/command/CreateContainer",
|
|
311
330
|
configure: configureCreateContainerCommand,
|
|
@@ -376,11 +395,16 @@ sap.ui.define([
|
|
|
376
395
|
clazz: "sap/ui/rta/command/Settings"
|
|
377
396
|
},
|
|
378
397
|
addLibrary: {
|
|
379
|
-
clazz: "sap/ui/rta/command/
|
|
398
|
+
clazz: "sap/ui/rta/command/manifest/AddLibrary",
|
|
380
399
|
noSelector: true
|
|
381
400
|
},
|
|
401
|
+
// left for compatibility reasons
|
|
382
402
|
appDescriptor: {
|
|
383
|
-
clazz: "sap/ui/rta/command/
|
|
403
|
+
clazz: "sap/ui/rta/command/ManifestCommand",
|
|
404
|
+
noSelector: true
|
|
405
|
+
},
|
|
406
|
+
manifest: {
|
|
407
|
+
clazz: "sap/ui/rta/command/ManifestCommand",
|
|
384
408
|
noSelector: true
|
|
385
409
|
},
|
|
386
410
|
annotation: {
|
|
@@ -406,24 +430,24 @@ sap.ui.define([
|
|
|
406
430
|
};
|
|
407
431
|
|
|
408
432
|
function getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings, sVariantManagementReference) {
|
|
409
|
-
|
|
433
|
+
let oCommand;
|
|
410
434
|
sCommand = sCommand[0].toLowerCase() + sCommand.slice(1); // first char of command name is lower case
|
|
411
|
-
|
|
412
|
-
|
|
435
|
+
const mCommand = mCommands[sCommand];
|
|
436
|
+
let mAllFlexSettings = mFlexSettings;
|
|
413
437
|
|
|
414
438
|
if (!mCommand) {
|
|
415
439
|
return Promise.reject(DtUtil.createError("CommandFactory#getCommandFor", `Command '${sCommand}' doesn't exist, check typing`, "sap.ui.rta"));
|
|
416
440
|
}
|
|
417
441
|
|
|
418
442
|
return new Promise(function(fnResolve) {
|
|
419
|
-
|
|
443
|
+
const sClassName = mCommand.clazz;
|
|
420
444
|
sap.ui.require([sClassName], function(Command) {
|
|
421
445
|
fnResolve(Command);
|
|
422
446
|
});
|
|
423
447
|
})
|
|
424
448
|
|
|
425
449
|
.then(function(Command) {
|
|
426
|
-
|
|
450
|
+
const bIsUiElement = vElement instanceof ManagedObject;
|
|
427
451
|
|
|
428
452
|
// only sap.ui.rta.command.FlexCommand requires a selector property
|
|
429
453
|
if (!mCommand.noSelector && !bIsUiElement) {
|
|
@@ -436,12 +460,12 @@ sap.ui.define([
|
|
|
436
460
|
name: sCommand
|
|
437
461
|
};
|
|
438
462
|
|
|
439
|
-
|
|
463
|
+
let oAction;
|
|
440
464
|
if (mCommand.configure) {
|
|
441
465
|
oAction = mCommand.configure(vElement, mSettings, oDesignTimeMetadata);
|
|
442
466
|
}
|
|
443
467
|
|
|
444
|
-
|
|
468
|
+
let oElementOverlay;
|
|
445
469
|
if (bIsUiElement) {
|
|
446
470
|
oElementOverlay = OverlayRegistry.getOverlay(vElement);
|
|
447
471
|
}
|
|
@@ -454,7 +478,7 @@ sap.ui.define([
|
|
|
454
478
|
oElementOverlay = OverlayRegistry.getOverlay(vElement);
|
|
455
479
|
}
|
|
456
480
|
|
|
457
|
-
|
|
481
|
+
let mTemplateSettings;
|
|
458
482
|
if (oElementOverlay && vElement.sParentAggregationName) {
|
|
459
483
|
mTemplateSettings = evaluateTemplateBinding(oElementOverlay);
|
|
460
484
|
}
|
|
@@ -468,7 +492,7 @@ sap.ui.define([
|
|
|
468
492
|
|
|
469
493
|
oCommand = new Command(mSettings);
|
|
470
494
|
|
|
471
|
-
|
|
495
|
+
let bSuccessfullyConfigured = true; // configuration is optional
|
|
472
496
|
if (mCommand.configure) {
|
|
473
497
|
bSuccessfullyConfigured = configureActionCommand(oCommand, oAction);
|
|
474
498
|
}
|
|
@@ -493,14 +517,14 @@ sap.ui.define([
|
|
|
493
517
|
* @extends sap.ui.base.ManagedObject
|
|
494
518
|
*
|
|
495
519
|
* @author SAP SE
|
|
496
|
-
* @version 1.
|
|
520
|
+
* @version 1.135.0
|
|
497
521
|
*
|
|
498
522
|
* @constructor
|
|
499
523
|
* @private
|
|
500
524
|
* @since 1.34
|
|
501
525
|
* @alias sap.ui.rta.command.CommandFactory
|
|
502
526
|
*/
|
|
503
|
-
|
|
527
|
+
const CommandFactory = ManagedObject.extend("sap.ui.rta.command.CommandFactory", {
|
|
504
528
|
metadata: {
|
|
505
529
|
library: "sap.ui.rta",
|
|
506
530
|
properties: {
|
|
@@ -562,7 +586,7 @@ sap.ui.define([
|
|
|
562
586
|
};
|
|
563
587
|
|
|
564
588
|
if (mFlexSettings.scenario || mFlexSettings.baseId) {
|
|
565
|
-
|
|
589
|
+
const sLRepRootNamespace = FlexUtils.buildLrepRootNamespace(mFlexSettings.baseId, mFlexSettings.scenario, mFlexSettings.projectId);
|
|
566
590
|
mFlexSettings.rootNamespace = sLRepRootNamespace;
|
|
567
591
|
mFlexSettings.namespace = `${sLRepRootNamespace}changes/`;
|
|
568
592
|
}
|
|
@@ -571,4 +595,4 @@ sap.ui.define([
|
|
|
571
595
|
};
|
|
572
596
|
|
|
573
597
|
return CommandFactory;
|
|
574
|
-
}, /* bExport= */true);
|
|
598
|
+
}, /* bExport= */true);
|