@openui5/sap.ui.rta 1.107.0 → 1.108.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 +1 -1
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +1 -1
- package/src/sap/ui/rta/RuntimeAuthoring.js +14 -5
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +1 -1
- package/src/sap/ui/rta/command/AddProperty.js +1 -1
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +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/FlexCommand.js +1 -1
- package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/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/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +49 -27
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +10 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +8 -4
- 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 +20 -10
- package/src/sap/ui/rta/messagebundle_ar.properties +6 -1
- package/src/sap/ui/rta/messagebundle_bg.properties +14 -9
- package/src/sap/ui/rta/messagebundle_ca.properties +6 -1
- package/src/sap/ui/rta/messagebundle_cs.properties +6 -1
- package/src/sap/ui/rta/messagebundle_cy.properties +6 -1
- package/src/sap/ui/rta/messagebundle_da.properties +6 -1
- package/src/sap/ui/rta/messagebundle_de.properties +6 -1
- package/src/sap/ui/rta/messagebundle_el.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_GB.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es_MX.properties +6 -1
- package/src/sap/ui/rta/messagebundle_et.properties +6 -1
- package/src/sap/ui/rta/messagebundle_fi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_fr.properties +6 -1
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -2
- package/src/sap/ui/rta/messagebundle_hi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_hr.properties +6 -1
- package/src/sap/ui/rta/messagebundle_hu.properties +6 -1
- package/src/sap/ui/rta/messagebundle_id.properties +6 -1
- package/src/sap/ui/rta/messagebundle_it.properties +6 -1
- package/src/sap/ui/rta/messagebundle_iw.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ja.properties +6 -1
- package/src/sap/ui/rta/messagebundle_kk.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ko.properties +6 -1
- package/src/sap/ui/rta/messagebundle_lt.properties +6 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ms.properties +6 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +6 -1
- package/src/sap/ui/rta/messagebundle_no.properties +6 -1
- package/src/sap/ui/rta/messagebundle_pl.properties +6 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +6 -1
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ro.properties +6 -1
- package/src/sap/ui/rta/messagebundle_ru.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sk.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sl.properties +6 -1
- package/src/sap/ui/rta/messagebundle_sv.properties +6 -1
- package/src/sap/ui/rta/messagebundle_th.properties +6 -1
- package/src/sap/ui/rta/messagebundle_tr.properties +6 -1
- package/src/sap/ui/rta/messagebundle_uk.properties +6 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +6 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -1
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +75 -29
- package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +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/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +3 -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 +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 +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
- package/src/sap/ui/rta/service/Outline.js +1 -1
- package/src/sap/ui/rta/service/Property.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +1 -1
- package/src/sap/ui/rta/service/SupportTools.js +1 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
- package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +7 -8
- 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 +2 -2
- 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/changeVisualization/ChangeIndicator.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +16 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +21 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +28 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +135 -53
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +39 -0
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +6 -3
package/THIRDPARTY.txt
CHANGED
|
@@ -382,7 +382,7 @@ Contained in: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/D
|
|
|
382
382
|
|
|
383
383
|
Library: sap.ui.integration:
|
|
384
384
|
|
|
385
|
-
Component: UI5 Web Components, version: 1.0
|
|
385
|
+
Component: UI5 Web Components, version: 1.7.0
|
|
386
386
|
Copyright: SAP
|
|
387
387
|
License: Apache-2.0
|
|
388
388
|
License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openui5/sap.ui.rta",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.108.0",
|
|
4
4
|
"description": "OpenUI5 UI Library sap.ui.rta",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"url": "https://github.com/SAP/openui5.git"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@openui5/sap.m": "1.
|
|
18
|
-
"@openui5/sap.ui.core": "1.
|
|
19
|
-
"@openui5/sap.ui.dt": "1.
|
|
20
|
-
"@openui5/sap.ui.fl": "1.
|
|
21
|
-
"@openui5/sap.ui.layout": "1.
|
|
17
|
+
"@openui5/sap.m": "1.108.0",
|
|
18
|
+
"@openui5/sap.ui.core": "1.108.0",
|
|
19
|
+
"@openui5/sap.ui.dt": "1.108.0",
|
|
20
|
+
"@openui5/sap.ui.fl": "1.108.0",
|
|
21
|
+
"@openui5/sap.ui.layout": "1.108.0"
|
|
22
22
|
}
|
|
23
23
|
}
|
package/src/sap/ui/rta/.library
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<copyright>OpenUI5
|
|
7
7
|
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
8
8
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
|
|
9
|
-
<version>1.
|
|
9
|
+
<version>1.108.0</version>
|
|
10
10
|
|
|
11
11
|
<documentation>SAPUI5 library with RTA controls.</documentation>
|
|
12
12
|
|
package/src/sap/ui/rta/Client.js
CHANGED
|
@@ -118,7 +118,7 @@ sap.ui.define([
|
|
|
118
118
|
* @class The runtime authoring allows to adapt the fields of a running application.
|
|
119
119
|
* @extends sap.ui.base.ManagedObject
|
|
120
120
|
* @author SAP SE
|
|
121
|
-
* @version 1.
|
|
121
|
+
* @version 1.108.0
|
|
122
122
|
* @constructor
|
|
123
123
|
* @private
|
|
124
124
|
* @since 1.30
|
|
@@ -970,6 +970,7 @@ sap.ui.define([
|
|
|
970
970
|
* Checks the publish button, draft buttons(activate and delete) and app variant support (i.e. Save As and Overview of App Variants) availability
|
|
971
971
|
* The publish button shall not be available if the system is productive and if a merge error occurred during merging changes into the view on startup
|
|
972
972
|
* The app variant support shall not be available if the system is productive and if the platform is not enabled (See Feature.js) to show the app variant tooling
|
|
973
|
+
* The app variant support shall also not be available if the current app is a home page
|
|
973
974
|
* isProductiveSystem should only return true if it is a test or development system with the provision of custom catalog extensions
|
|
974
975
|
*
|
|
975
976
|
* @param {object} oRootControl - Root control instance
|
|
@@ -981,15 +982,23 @@ sap.ui.define([
|
|
|
981
982
|
return Promise.all([
|
|
982
983
|
FeaturesAPI.isPublishAvailable(),
|
|
983
984
|
RtaAppVariantFeature.isSaveAsAvailable(oRootControl, sLayer, oSerializer),
|
|
984
|
-
FeaturesAPI.isContextBasedAdaptationAvailable(sLayer)
|
|
985
|
+
FeaturesAPI.isContextBasedAdaptationAvailable(sLayer),
|
|
986
|
+
FlexUtils.getUShellService("AppLifeCycle").then(function(oAppLifeCycle) {
|
|
987
|
+
if (oAppLifeCycle) {
|
|
988
|
+
var mRunningApp = oAppLifeCycle.getCurrentApplication();
|
|
989
|
+
return mRunningApp ? mRunningApp.homePage : false;
|
|
990
|
+
}
|
|
991
|
+
return false;
|
|
992
|
+
})
|
|
985
993
|
]).then(function(aRtaFeaturesAvailability) {
|
|
986
994
|
var bIsPublishAvailable = aRtaFeaturesAvailability[0];
|
|
987
995
|
var bIsSaveAsAvailable = aRtaFeaturesAvailability[1];
|
|
988
996
|
var bIsContextBasedAdaptationAvailable = aRtaFeaturesAvailability[2];
|
|
997
|
+
var bIsHomePage = aRtaFeaturesAvailability[3];
|
|
989
998
|
return {
|
|
990
999
|
publishAvailable: bIsPublishAvailable,
|
|
991
|
-
saveAsAvailable: bIsPublishAvailable && bIsSaveAsAvailable,
|
|
992
|
-
contextBasedAdaptationAvailable: bIsContextBasedAdaptationAvailable
|
|
1000
|
+
saveAsAvailable: !bIsHomePage && bIsPublishAvailable && bIsSaveAsAvailable,
|
|
1001
|
+
contextBasedAdaptationAvailable: !bIsHomePage && bIsContextBasedAdaptationAvailable
|
|
993
1002
|
};
|
|
994
1003
|
});
|
|
995
1004
|
}
|
|
@@ -1051,7 +1060,7 @@ sap.ui.define([
|
|
|
1051
1060
|
TranslationAPI.hasTranslationRelevantDirtyChanges({layer: Layer.CUSTOMER, selector: this.getRootControlInstance()});
|
|
1052
1061
|
|
|
1053
1062
|
// TODO: move to the setter to the ChangesState
|
|
1054
|
-
this._oVersionsModel.setDirtyChanges(
|
|
1063
|
+
this._oVersionsModel.setDirtyChanges(PersistenceWriteAPI.hasDirtyChanges({selector: this.getRootControlInstance()}));
|
|
1055
1064
|
this._oToolbarControlsModel.setProperty("/undoEnabled", bCanUndo);
|
|
1056
1065
|
this._oToolbarControlsModel.setProperty("/redoEnabled", bCanRedo);
|
|
1057
1066
|
this._oToolbarControlsModel.setProperty("/publishEnabled", this.bInitialPublishEnabled || bCanUndo);
|
package/src/sap/ui/rta/Utils.js
CHANGED
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
-
"sap/ui/rta/command/BaseCommand"
|
|
7
|
+
"sap/ui/rta/command/BaseCommand",
|
|
8
|
+
"sap/ui/fl/write/api/SmartVariantManagementWriteAPI",
|
|
9
|
+
"sap/ui/rta/library"
|
|
8
10
|
], function(
|
|
9
|
-
BaseCommand
|
|
11
|
+
BaseCommand,
|
|
12
|
+
SmartVariantManagementWriteAPI,
|
|
13
|
+
rtaLibrary
|
|
10
14
|
) {
|
|
11
15
|
"use strict";
|
|
12
16
|
|
|
@@ -16,7 +20,7 @@ sap.ui.define([
|
|
|
16
20
|
* @class
|
|
17
21
|
* @extends sap.ui.rta.command.BaseCommand
|
|
18
22
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
23
|
+
* @version 1.108.0
|
|
20
24
|
* @constructor
|
|
21
25
|
* @private
|
|
22
26
|
* @since 1.102
|
|
@@ -32,51 +36,69 @@ sap.ui.define([
|
|
|
32
36
|
persistencyKey: {
|
|
33
37
|
type: "string"
|
|
34
38
|
},
|
|
35
|
-
oldContent: {
|
|
36
|
-
type: "object"
|
|
37
|
-
},
|
|
38
39
|
newContent: {
|
|
39
40
|
type: "object"
|
|
41
|
+
},
|
|
42
|
+
isModifiedBefore: {
|
|
43
|
+
type: "boolean"
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
47
|
});
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
CompVariantContent.prototype.undo = function() {
|
|
53
|
-
setVariantContent.call(this, this.getOldContent());
|
|
54
|
-
|
|
55
|
-
return Promise.resolve();
|
|
56
|
-
};
|
|
49
|
+
function callFlAPIFunction(sFunctionName, sKey, oValue) {
|
|
50
|
+
var mPropertyBag = Object.assign({}, oValue, this.mInformation, {
|
|
51
|
+
id: sKey,
|
|
52
|
+
control: this.getElement()
|
|
53
|
+
});
|
|
54
|
+
return SmartVariantManagementWriteAPI[sFunctionName](mPropertyBag);
|
|
55
|
+
}
|
|
57
56
|
|
|
58
57
|
// private function of the SmartVariantManagement are approved and documented to be used from here
|
|
59
58
|
function setVariantContent(oContent) {
|
|
60
|
-
var oContentToBeSet = {};
|
|
61
59
|
var oVariantManagementControl = this.getElement();
|
|
60
|
+
var oCurrentVariantContent = oVariantManagementControl._getVariantContent(this.getVariantId());
|
|
61
|
+
var oNewVariantContent = Object.assign({}, oCurrentVariantContent);
|
|
62
62
|
if (oVariantManagementControl.isPageVariant()) {
|
|
63
|
+
var oContentToBeSet = {};
|
|
63
64
|
oContentToBeSet[this.getPersistencyKey()] = oContent;
|
|
64
65
|
oVariantManagementControl._applyVariantByPersistencyKey(this.getPersistencyKey(), oContentToBeSet, "KEY_USER");
|
|
66
|
+
oNewVariantContent[this.getPersistencyKey()] = oContent;
|
|
65
67
|
} else {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
oVariantManagementControl._applyVariant(oVariantManagementControl._getPersoController(), oContent, "KEY_USER");
|
|
69
|
+
oNewVariantContent = oContent;
|
|
68
70
|
}
|
|
71
|
+
return oNewVariantContent;
|
|
69
72
|
}
|
|
70
73
|
|
|
71
|
-
|
|
72
|
-
|
|
74
|
+
CompVariantContent.prototype.prepare = function(mFlexSettings, sVariantManagementReference, sCommand) {
|
|
75
|
+
this.mInformation = {
|
|
76
|
+
layer: mFlexSettings.layer,
|
|
77
|
+
command: sCommand, // used for ChangeVisualization and should end up in the support object in change definition
|
|
78
|
+
generator: rtaLibrary.GENERATOR_NAME // also to be saved in the support section
|
|
79
|
+
};
|
|
80
|
+
return true;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
CompVariantContent.prototype.execute = function() {
|
|
84
|
+
this.setIsModifiedBefore(this.getElement().getModified());
|
|
85
|
+
this.getElement().setModified(true);
|
|
86
|
+
var oNewVariantContent = setVariantContent.call(this, this.getNewContent());
|
|
87
|
+
callFlAPIFunction.call(this, "updateVariantContent", this.getVariantId(), {content: oNewVariantContent});
|
|
88
|
+
return Promise.resolve();
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
CompVariantContent.prototype.undo = function() {
|
|
92
|
+
var oVariant = callFlAPIFunction.call(this, "revert", this.getVariantId(), {});
|
|
93
|
+
this.getElement().setModified(this.getIsModifiedBefore());
|
|
73
94
|
var oVariantManagementControl = this.getElement();
|
|
74
|
-
var oOldContent = oVariantManagementControl._getVariantContent(this.getVariantId());
|
|
75
95
|
if (oVariantManagementControl.isPageVariant()) {
|
|
76
|
-
|
|
96
|
+
setVariantContent.call(this, oVariant.getContent()[this.getPersistencyKey()]);
|
|
97
|
+
} else {
|
|
98
|
+
setVariantContent.call(this, oVariant.getContent());
|
|
77
99
|
}
|
|
78
|
-
return
|
|
79
|
-
}
|
|
100
|
+
return Promise.resolve();
|
|
101
|
+
};
|
|
80
102
|
|
|
81
103
|
return CompVariantContent;
|
|
82
104
|
});
|
|
@@ -20,7 +20,7 @@ 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.108.0
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.87
|
|
@@ -41,6 +41,9 @@ sap.ui.define([
|
|
|
41
41
|
},
|
|
42
42
|
previousDefault: {
|
|
43
43
|
type: "string"
|
|
44
|
+
},
|
|
45
|
+
activateAfterUndo: {
|
|
46
|
+
type: "boolean"
|
|
44
47
|
}
|
|
45
48
|
}
|
|
46
49
|
}
|
|
@@ -127,6 +130,12 @@ sap.ui.define([
|
|
|
127
130
|
variantId: this._oVariant.getVariantId()
|
|
128
131
|
});
|
|
129
132
|
|
|
133
|
+
// when changing a read only variant a new variant has to be created.
|
|
134
|
+
// on undo the changes have to be reverted via the activateVariant call
|
|
135
|
+
if (this.getActivateAfterUndo()) {
|
|
136
|
+
this.getElement().activateVariant(this.getPreviousVariantId());
|
|
137
|
+
}
|
|
138
|
+
|
|
130
139
|
return Promise.resolve();
|
|
131
140
|
};
|
|
132
141
|
|
|
@@ -22,7 +22,7 @@ sap.ui.define([
|
|
|
22
22
|
* @class
|
|
23
23
|
* @extends sap.ui.rta.command.BaseCommand
|
|
24
24
|
* @author SAP SE
|
|
25
|
-
* @version 1.
|
|
25
|
+
* @version 1.108.0
|
|
26
26
|
* @constructor
|
|
27
27
|
* @private
|
|
28
28
|
* @since 1.87
|
|
@@ -43,6 +43,9 @@ sap.ui.define([
|
|
|
43
43
|
},
|
|
44
44
|
onlySave: {
|
|
45
45
|
type: "boolean"
|
|
46
|
+
},
|
|
47
|
+
isModifiedBefore: {
|
|
48
|
+
type: "boolean"
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
}
|
|
@@ -77,16 +80,17 @@ sap.ui.define([
|
|
|
77
80
|
*/
|
|
78
81
|
CompVariantUpdate.prototype.execute = function() {
|
|
79
82
|
if (this.getOnlySave()) {
|
|
83
|
+
this.setIsModifiedBefore(this.getElement().getModified());
|
|
80
84
|
this.getElement().setModified(false);
|
|
81
85
|
var sKey = Object.keys(this.getNewVariantProperties())[0];
|
|
82
|
-
callFlAPIFunction.call(this, "
|
|
86
|
+
callFlAPIFunction.call(this, "saveVariantContent", sKey, this.getNewVariantProperties()[sKey]);
|
|
83
87
|
} else {
|
|
84
88
|
each(this.getNewVariantProperties(), function(sVariantId, oValue) {
|
|
85
89
|
if (oValue.deleted) {
|
|
86
90
|
callFlAPIFunction.call(this, "removeVariant", sVariantId, {});
|
|
87
91
|
this.getElement().removeVariant({variantId: sVariantId});
|
|
88
92
|
} else {
|
|
89
|
-
var oVariant = callFlAPIFunction.call(this, "
|
|
93
|
+
var oVariant = callFlAPIFunction.call(this, "updateVariantMetadata", sVariantId, oValue);
|
|
90
94
|
this.getElement().updateVariant(oVariant);
|
|
91
95
|
}
|
|
92
96
|
}.bind(this));
|
|
@@ -105,9 +109,9 @@ sap.ui.define([
|
|
|
105
109
|
*/
|
|
106
110
|
CompVariantUpdate.prototype.undo = function() {
|
|
107
111
|
if (this.getOnlySave()) {
|
|
108
|
-
this.getElement().setModified(true);
|
|
109
112
|
var sVariantId = Object.keys(this.getNewVariantProperties())[0];
|
|
110
113
|
callFlAPIFunction.call(this, "revert", sVariantId, {});
|
|
114
|
+
this.getElement().setModified(this.getIsModifiedBefore());
|
|
111
115
|
} else {
|
|
112
116
|
each(this.getNewVariantProperties(), function(sVariantId, oValue) {
|
|
113
117
|
var oVariant = callFlAPIFunction.call(this, "revert", sVariantId, {});
|