@openui5/sap.ui.rta 1.108.1 → 1.109.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 +17 -49
- 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 +2 -2
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +2 -2
- 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 +4 -2
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +14 -14
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +10 -3
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +41 -9
- 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 +17 -15
- package/src/sap/ui/rta/command/LREPSerializer.js +1 -6
- 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 +1 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +27 -5
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +27 -18
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +6 -4
- package/src/sap/ui/rta/messagebundle_ar.properties +4 -1
- package/src/sap/ui/rta/messagebundle_bg.properties +4 -1
- package/src/sap/ui/rta/messagebundle_ca.properties +3 -0
- package/src/sap/ui/rta/messagebundle_cs.properties +4 -1
- package/src/sap/ui/rta/messagebundle_cy.properties +3 -0
- package/src/sap/ui/rta/messagebundle_da.properties +3 -0
- package/src/sap/ui/rta/messagebundle_de.properties +3 -0
- package/src/sap/ui/rta/messagebundle_el.properties +3 -0
- package/src/sap/ui/rta/messagebundle_en.properties +4 -1
- package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -1
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +3 -2
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +3 -2
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +3 -0
- package/src/sap/ui/rta/messagebundle_es.properties +3 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +3 -0
- package/src/sap/ui/rta/messagebundle_et.properties +3 -0
- package/src/sap/ui/rta/messagebundle_fi.properties +3 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +3 -0
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +4 -1
- package/src/sap/ui/rta/messagebundle_hi.properties +4 -1
- package/src/sap/ui/rta/messagebundle_hr.properties +4 -1
- package/src/sap/ui/rta/messagebundle_hu.properties +3 -0
- package/src/sap/ui/rta/messagebundle_id.properties +4 -1
- package/src/sap/ui/rta/messagebundle_it.properties +4 -1
- package/src/sap/ui/rta/messagebundle_iw.properties +3 -0
- package/src/sap/ui/rta/messagebundle_ja.properties +4 -1
- package/src/sap/ui/rta/messagebundle_kk.properties +3 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +3 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +3 -0
- package/src/sap/ui/rta/messagebundle_lv.properties +4 -1
- package/src/sap/ui/rta/messagebundle_ms.properties +4 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +3 -0
- package/src/sap/ui/rta/messagebundle_no.properties +4 -1
- package/src/sap/ui/rta/messagebundle_pl.properties +4 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +4 -1
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +3 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +4 -1
- package/src/sap/ui/rta/messagebundle_ru.properties +4 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +3 -0
- package/src/sap/ui/rta/messagebundle_sk.properties +3 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +4 -1
- package/src/sap/ui/rta/messagebundle_sv.properties +4 -1
- package/src/sap/ui/rta/messagebundle_th.properties +4 -1
- package/src/sap/ui/rta/messagebundle_tr.properties +3 -0
- package/src/sap/ui/rta/messagebundle_uk.properties +3 -0
- package/src/sap/ui/rta/messagebundle_vi.properties +4 -1
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +4 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +4 -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 +103 -23
- package/src/sap/ui/rta/plugin/ControlVariant.js +117 -49
- 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 +5 -3
- 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 +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 +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 +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/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +2 -2
- 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 +26 -9
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +0 -11
- package/src/sap/ui/rta/toolbar/Adaptation.js +1 -3
- 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 +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 +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 +2 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +10 -9
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +1 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +2 -2
- package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +0 -76
- package/src/sap/ui/rta/appContexts/Component.js +0 -31
- package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +0 -323
- package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +0 -22
- package/src/sap/ui/rta/appContexts/i18n/i18n.properties +0 -47
- package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +0 -23
- package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +0 -23
- package/src/sap/ui/rta/appContexts/index.html +0 -25
- package/src/sap/ui/rta/appContexts/manifest.json +0 -52
- package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +0 -76
- package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +0 -103
- package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +0 -76
|
@@ -23,6 +23,9 @@ CTX_VARIANT_SET_TITLE=\u8A2D\u5B9A\u6A19\u984C
|
|
|
23
23
|
CTX_VARIANT_MANAGE=\u7BA1\u7406\u6AA2\u8996
|
|
24
24
|
BTN_CREATE_NEW_VIEW=\u5132\u5B58\u70BA\u65B0\u6AA2\u8996
|
|
25
25
|
MSG_CHANGE_READONLY_VARIANT=\u7531\u65BC\u6B64\u6AA2\u8996\u5DF2\u53D7\u4FDD\u8B77\uFF0C\u56E0\u6B64\u60A8\u7121\u6CD5\u7DE8\u8F2F\u3002\u82E5\u8981\u66F4\u6539\u8A72\u6AA2\u8996\uFF0C\u8ACB\u5C07\u5176\u5132\u5B58\u70BA\u65B0\u6AA2\u8996\u3002
|
|
26
|
+
BTN_MODIFIED_VARIANT_SAVE=Save Changes
|
|
27
|
+
BTN_MODIFIED_VARIANT_DISCARD=Discard Changes
|
|
28
|
+
MSG_CHANGE_MODIFIED_VARIANT=You have unsaved changes on this view. Would you like to save or discard them?
|
|
26
29
|
CTX_ADDXML_AT_EXTENSIONPOINT=\u65BC\u5EF6\u4F38\u9EDE\u65B0\u589E\u7247\u6BB5
|
|
27
30
|
BTN_FREP_OK=\u78BA\u5B9A
|
|
28
31
|
BTN_FREP_REMOVE=\u79FB\u9664
|
|
@@ -240,7 +243,7 @@ BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_MOVE=\u986F\u793A\u4F86\u6E90
|
|
|
240
243
|
BTN_CHANGEVISUALIZATION_SHOW_DEPENDENT_CONTAINER_SPLIT=\u986F\u793A\u5176\u4ED6\u90E8\u4EFD
|
|
241
244
|
BUT_CHANGEVISUALIZATION_LEARNMORE=[\u6DF1\u5165\u77AD\u89E3]
|
|
242
245
|
|
|
243
|
-
MSG_ADAPTATION_STARTER_MIXED_CHANGES_WARNING=\u6B64\u61C9\u7528\u7A0B\u5F0F\u7684\u4F7F\u7528\u8005\u4ECB\u9762\u66F4\u6539\u5167\u5BB9\u5DF2\
|
|
246
|
+
MSG_ADAPTATION_STARTER_MIXED_CHANGES_WARNING=\u6B64\u61C9\u7528\u7A0B\u5F0F\u7684\u4F7F\u7528\u8005\u4ECB\u9762\u66F4\u6539\u5167\u5BB9\u5DF2\u5728\u5176\u4ED6\u7CFB\u7D71\u4E2D\u57F7\u884C\u3002\u82E5\u8981\u907F\u514D\u885D\u7A81\uFF0C\u5F37\u70C8\u5EFA\u8B70\u53EA\u5728\u4E00\u500B\u7CFB\u7D71\u4E2D\u9032\u884C\u4F7F\u7528\u8005\u4ECB\u9762\u66F4\u6539\uFF0C\u7136\u5F8C\u518D\u5C07\u9019\u4E9B\u66F4\u6539\u5167\u5BB9\u50B3\u8F38\u81F3\u5176\u4ED6\u7CFB\u7D71\u3002\u8ACB\u67E5\u770B [Adapting the UI] (https\://help.sap.com/docs/search?q\=Adapting%20the%20UI)\u3002
|
|
244
247
|
TIT_ADAPTATION_STARTER_MIXED_CHANGES_TITLE=\u8B66\u544A - \u56B4\u91CD\u885D\u7A81\u7684\u98A8\u96AA
|
|
245
248
|
MSG_ADAPTATION_STARTER_NO_CHANGES_IN_P_WARNING=\u60A8\u6B63\u5728\u6B63\u5F0F\u904B\u4F5C\u7CFB\u7D71\u4E2D\u555F\u52D5\u4F7F\u7528\u8005\u4ECB\u9762\u8ABF\u6574\u3002\u82E5\u60A8\u5177\u5099\u958B\u767C\u6216\u6E2C\u8A66\u7CFB\u7D71\uFF0C\u5247\u5EFA\u8B70\u60A8\u5728\u9019\u4E9B\u7CFB\u7D71\u4E2D\u9032\u884C\u66F4\u6539\uFF0C\u4E26\u4E14\u4F7F\u7528\u50B3\u8F38\u6A5F\u5236\u767C\u4F48\u9019\u4E9B\u66F4\u6539\u5167\u5BB9\u3002
|
|
246
249
|
TIT_ADAPTATION_STARTER_NO_CHANGES_IN_P_TITLE=\u8B66\u544A - \u60A8\u5373\u5C07\u5728\u6B63\u5F0F\u904B\u4F5C\u7CFB\u7D71\u4E2D\u9032\u884C\u66F4\u6539
|
|
@@ -27,7 +27,6 @@ sap.ui.define([
|
|
|
27
27
|
) {
|
|
28
28
|
"use strict";
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
var CompVariant = Plugin.extend("sap.ui.rta.plugin.CompVariant", /** @lends sap.ui.rta.plugin.CompVariant.prototype */ {
|
|
32
31
|
metadata: {
|
|
33
32
|
library: "sap.ui.rta",
|
|
@@ -40,12 +39,34 @@ sap.ui.define([
|
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
|
|
43
|
-
function createCommandAndFireEvent(oOverlay,
|
|
42
|
+
function createCommandAndFireEvent(oOverlay, aCommandNames, mProperties, oElement) {
|
|
44
43
|
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
45
44
|
var oTargetElement = oElement || oOverlay.getElement();
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
return Promise.resolve()
|
|
46
|
+
.then(function() {
|
|
47
|
+
if (aCommandNames.length === 1) {
|
|
48
|
+
return this.getCommandFactory().getCommandFor(oTargetElement, aCommandNames[0], mProperties, oDesignTimeMetadata);
|
|
49
|
+
}
|
|
50
|
+
var oCompositeCommand;
|
|
51
|
+
return this.getCommandFactory().getCommandFor(oTargetElement, "composite")
|
|
52
|
+
.then(function(_oCompositeCommand) {
|
|
53
|
+
oCompositeCommand = _oCompositeCommand;
|
|
54
|
+
var aCommandPromises = [];
|
|
55
|
+
aCommandNames.forEach(function(sCommandName) {
|
|
56
|
+
aCommandPromises.push(this.getCommandFactory().getCommandFor(
|
|
57
|
+
oTargetElement,
|
|
58
|
+
sCommandName,
|
|
59
|
+
mProperties[sCommandName],
|
|
60
|
+
oDesignTimeMetadata
|
|
61
|
+
));
|
|
62
|
+
}.bind(this));
|
|
63
|
+
return Promise.all(aCommandPromises)
|
|
64
|
+
.then(function(aCommands) {
|
|
65
|
+
aCommands.forEach(oCompositeCommand.addCommand.bind(oCompositeCommand));
|
|
66
|
+
return oCompositeCommand;
|
|
67
|
+
});
|
|
68
|
+
}.bind(this));
|
|
69
|
+
}.bind(this))
|
|
49
70
|
.then(function(oCommand) {
|
|
50
71
|
this.fireElementModified({
|
|
51
72
|
command: oCommand
|
|
@@ -53,7 +74,7 @@ sap.ui.define([
|
|
|
53
74
|
}.bind(this))
|
|
54
75
|
|
|
55
76
|
.catch(function(oMessage) {
|
|
56
|
-
throw DtUtil.createError(
|
|
77
|
+
throw DtUtil.createError(aCommandNames[0], oMessage, "sap.ui.rta.plugin.CompVariant");
|
|
57
78
|
});
|
|
58
79
|
}
|
|
59
80
|
|
|
@@ -89,7 +110,7 @@ sap.ui.define([
|
|
|
89
110
|
mPropertyBag.newVariantProperties[sVariantId] = {
|
|
90
111
|
name: sText
|
|
91
112
|
};
|
|
92
|
-
createCommandAndFireEvent.call(this, oOverlay, "compVariantUpdate", mPropertyBag);
|
|
113
|
+
createCommandAndFireEvent.call(this, oOverlay, ["compVariantUpdate"], mPropertyBag);
|
|
93
114
|
};
|
|
94
115
|
|
|
95
116
|
// ------ configure ------
|
|
@@ -103,7 +124,7 @@ sap.ui.define([
|
|
|
103
124
|
};
|
|
104
125
|
oVariantManagementControl.openManageViewsDialogForKeyUser(mPropertyBag, function(oData) {
|
|
105
126
|
if (!isEmptyObject(oData)) {
|
|
106
|
-
createCommandAndFireEvent.call(this, aOverlays[0], "compVariantUpdate", {
|
|
127
|
+
createCommandAndFireEvent.call(this, aOverlays[0], ["compVariantUpdate"], {
|
|
107
128
|
newVariantProperties: _omit(oData, ["default"]),
|
|
108
129
|
newDefaultVariantId: oData.default,
|
|
109
130
|
oldDefaultVariantId: oVariantManagementControl.getDefaultVariantId()
|
|
@@ -113,23 +134,71 @@ sap.ui.define([
|
|
|
113
134
|
}
|
|
114
135
|
|
|
115
136
|
// ------ switch ------
|
|
137
|
+
function onDirtySwitchWarningClose(oVariantManagementOverlay, sTargetVariantId, sAction) {
|
|
138
|
+
if (sAction === MessageBox.Action.CANCEL) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
var oLibraryBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
143
|
+
var oVariantManagementControl = oVariantManagementOverlay.getElement();
|
|
144
|
+
var mProperties;
|
|
145
|
+
|
|
146
|
+
if (sAction === oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE")) {
|
|
147
|
+
// Create composite command for compVariantUpdate + compVariantSwitch
|
|
148
|
+
getCompVariantUpdateProperties(oVariantManagementControl)
|
|
149
|
+
.then(function(oCompVariantUpdateProperties) {
|
|
150
|
+
mProperties = {
|
|
151
|
+
compVariantSwitch: {
|
|
152
|
+
targetVariantId: sTargetVariantId,
|
|
153
|
+
sourceVariantId: oVariantManagementControl.getPresentVariantId()
|
|
154
|
+
},
|
|
155
|
+
compVariantUpdate: oCompVariantUpdateProperties
|
|
156
|
+
};
|
|
157
|
+
createCommandAndFireEvent.call(this, oVariantManagementOverlay, ["compVariantUpdate", "compVariantSwitch"], mProperties);
|
|
158
|
+
}.bind(this));
|
|
159
|
+
}
|
|
160
|
+
if (sAction === oLibraryBundle.getText("BTN_MODIFIED_VARIANT_DISCARD")) {
|
|
161
|
+
createCommandAndFireEvent.call(this, oVariantManagementOverlay, ["compVariantSwitch"], {
|
|
162
|
+
targetVariantId: sTargetVariantId,
|
|
163
|
+
sourceVariantId: oVariantManagementControl.getPresentVariantId(),
|
|
164
|
+
discardVariantContent: true
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
116
169
|
function isSwitchEnabled(aOverlays) {
|
|
117
170
|
return getAllVariants(aOverlays[0]).length > 1;
|
|
118
171
|
}
|
|
119
172
|
|
|
120
173
|
function switchVariant(aOverlays, mPropertyBag) {
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
174
|
+
var oVariantManagementOverlay = aOverlays[0];
|
|
175
|
+
var oVariantManagementControl = oVariantManagementOverlay.getElement();
|
|
176
|
+
|
|
177
|
+
// If the variant was modified, user must choose whether to save changes before switching
|
|
178
|
+
if (oVariantManagementControl.getModified()) {
|
|
179
|
+
var oLibraryBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
180
|
+
var sTargetVariantId = mPropertyBag.eventItem.getParameters().item.getProperty("key");
|
|
181
|
+
MessageBox.warning(oLibraryBundle.getText("MSG_CHANGE_MODIFIED_VARIANT"), {
|
|
182
|
+
onClose: onDirtySwitchWarningClose.bind(this, oVariantManagementOverlay, sTargetVariantId),
|
|
183
|
+
actions: [
|
|
184
|
+
oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
185
|
+
oLibraryBundle.getText("BTN_MODIFIED_VARIANT_DISCARD"),
|
|
186
|
+
MessageBox.Action.CANCEL
|
|
187
|
+
],
|
|
188
|
+
emphasizedAction: oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
189
|
+
styleClass: Utils.getRtaStyleClassName()
|
|
190
|
+
});
|
|
191
|
+
} else {
|
|
192
|
+
createCommandAndFireEvent.call(this, oVariantManagementOverlay, ["compVariantSwitch"], {
|
|
193
|
+
targetVariantId: mPropertyBag.eventItem.getParameters().item.getProperty("key"),
|
|
194
|
+
sourceVariantId: oVariantManagementControl.getPresentVariantId()
|
|
195
|
+
});
|
|
196
|
+
}
|
|
127
197
|
}
|
|
128
198
|
|
|
129
199
|
// ------ save ------
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
oVariantManagementControl.getPresentVariantContent().then(function(oContent) {
|
|
200
|
+
function getCompVariantUpdateProperties(oVariantManagementControl) {
|
|
201
|
+
return oVariantManagementControl.getPresentVariantContent().then(function(oContent) {
|
|
133
202
|
var oPropertyBag = {
|
|
134
203
|
onlySave: true,
|
|
135
204
|
newVariantProperties: {}
|
|
@@ -137,7 +206,15 @@ sap.ui.define([
|
|
|
137
206
|
oPropertyBag.newVariantProperties[oVariantManagementControl.getPresentVariantId()] = {
|
|
138
207
|
content: oContent
|
|
139
208
|
};
|
|
140
|
-
|
|
209
|
+
return oPropertyBag;
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
function saveVariant(aOverlays) {
|
|
214
|
+
var oVariantManagementControl = aOverlays[0].getElement();
|
|
215
|
+
getCompVariantUpdateProperties(oVariantManagementControl)
|
|
216
|
+
.then(function(oPropertyBag) {
|
|
217
|
+
createCommandAndFireEvent.call(this, aOverlays[0], ["compVariantUpdate"], oPropertyBag);
|
|
141
218
|
}.bind(this));
|
|
142
219
|
}
|
|
143
220
|
|
|
@@ -153,7 +230,7 @@ sap.ui.define([
|
|
|
153
230
|
return new Promise(function(resolve) {
|
|
154
231
|
oVariantManagementControl.openSaveAsDialogForKeyUser(Utils.getRtaStyleClassName(), function(oReturn) {
|
|
155
232
|
if (oReturn) {
|
|
156
|
-
createCommandAndFireEvent.call(this, aOverlays[0], "compVariantSaveAs", {
|
|
233
|
+
createCommandAndFireEvent.call(this, aOverlays[0], ["compVariantSaveAs"], {
|
|
157
234
|
newVariantProperties: {
|
|
158
235
|
"default": oReturn.default,
|
|
159
236
|
executeOnSelection: oReturn.executeOnSelection,
|
|
@@ -194,11 +271,13 @@ sap.ui.define([
|
|
|
194
271
|
var oElementOverlay = aOverlays[0];
|
|
195
272
|
var oControl = oElementOverlay.getElementInstance();
|
|
196
273
|
var oAction = this.getAction(oElementOverlay);
|
|
274
|
+
var oVariantManagementControl = oControl.getVariantManagement();
|
|
275
|
+
// the modified flag might be changed before the dialog is closed, so it has to be saved here already
|
|
276
|
+
var bIsModified = oVariantManagementControl.getModified();
|
|
197
277
|
|
|
198
278
|
return oAction.handler(oControl, {styleClass: Utils.getRtaStyleClassName()}).then(function(aChangeContentData) {
|
|
199
279
|
if (aChangeContentData && aChangeContentData.length) {
|
|
200
280
|
var sPersistencyKey = aChangeContentData[0].changeSpecificData.content.persistencyKey;
|
|
201
|
-
var oVariantManagementControl = oControl.getVariantManagement();
|
|
202
281
|
var aVariants = oVariantManagementControl.getAllVariants();
|
|
203
282
|
var oCurrentVariant = aVariants.find(function(oVariant) {
|
|
204
283
|
return oVariant.getVariantId() === oVariantManagementControl.getPresentVariantId();
|
|
@@ -207,11 +286,12 @@ sap.ui.define([
|
|
|
207
286
|
// a variant that can't be overwritten must never get dirty,
|
|
208
287
|
// instead the user needs to save the changes to a new variant
|
|
209
288
|
if (oCurrentVariant.isEditEnabled(this.getCommandFactory().getFlexSettings().layer)) {
|
|
210
|
-
createCommandAndFireEvent.call(this, oElementOverlay, "compVariantContent", {
|
|
289
|
+
createCommandAndFireEvent.call(this, oElementOverlay, ["compVariantContent"], {
|
|
211
290
|
variantId: aChangeContentData[0].changeSpecificData.content.key,
|
|
212
291
|
newContent: aChangeContentData[0].changeSpecificData.content.content,
|
|
213
|
-
persistencyKey: sPersistencyKey
|
|
214
|
-
|
|
292
|
+
persistencyKey: sPersistencyKey,
|
|
293
|
+
isModifiedBefore: bIsModified
|
|
294
|
+
}, oVariantManagementControl);
|
|
215
295
|
} else {
|
|
216
296
|
MessageBox.warning(oLibraryBundle.getText("MSG_CHANGE_READONLY_VARIANT"), {
|
|
217
297
|
onClose: onWarningClose.bind(this, oVariantManagementControl, oCurrentVariant.getVariantId()),
|
|
@@ -14,10 +14,12 @@ sap.ui.define([
|
|
|
14
14
|
"sap/ui/dt/Util",
|
|
15
15
|
"sap/ui/fl/Utils",
|
|
16
16
|
"sap/ui/fl/Layer",
|
|
17
|
+
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
17
18
|
"sap/ui/fl/variants/VariantManagement",
|
|
18
19
|
"sap/ui/fl/write/api/ContextSharingAPI",
|
|
19
20
|
"sap/ui/base/ManagedObject",
|
|
20
|
-
"sap/base/Log"
|
|
21
|
+
"sap/base/Log",
|
|
22
|
+
"sap/m/MessageBox"
|
|
21
23
|
], function(
|
|
22
24
|
Plugin,
|
|
23
25
|
RenameHandler,
|
|
@@ -28,10 +30,12 @@ sap.ui.define([
|
|
|
28
30
|
DtUtil,
|
|
29
31
|
flUtils,
|
|
30
32
|
Layer,
|
|
33
|
+
ControlVariantApplyAPI,
|
|
31
34
|
VariantManagement,
|
|
32
35
|
ContextSharingAPI,
|
|
33
36
|
ManagedObject,
|
|
34
|
-
Log
|
|
37
|
+
Log,
|
|
38
|
+
MessageBox
|
|
35
39
|
) {
|
|
36
40
|
"use strict";
|
|
37
41
|
|
|
@@ -43,7 +47,7 @@ sap.ui.define([
|
|
|
43
47
|
* @class The ControlVariant allows propagation of variantManagement key
|
|
44
48
|
* @extends sap.ui.rta.plugin.Plugin
|
|
45
49
|
* @author SAP SE
|
|
46
|
-
* @version 1.
|
|
50
|
+
* @version 1.109.0
|
|
47
51
|
* @constructor
|
|
48
52
|
* @private
|
|
49
53
|
* @since 1.50
|
|
@@ -75,6 +79,28 @@ sap.ui.define([
|
|
|
75
79
|
}
|
|
76
80
|
});
|
|
77
81
|
|
|
82
|
+
function getCommandForSave(oOverlay) {
|
|
83
|
+
var oElement = oOverlay.getElement();
|
|
84
|
+
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
85
|
+
var oModel = this._getVariantModel(oElement);
|
|
86
|
+
var sVariantManagementReference = oOverlay.getVariantManagement();
|
|
87
|
+
|
|
88
|
+
return this.getCommandFactory().getCommandFor(oElement, "save", {
|
|
89
|
+
model: oModel
|
|
90
|
+
}, oDesignTimeMetadata, sVariantManagementReference);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function getCommandForSwitch(oOverlay, sNewVariantReference, sCurrentVariantReference, bDiscardVariantContent) {
|
|
94
|
+
var oElement = oOverlay.getElement();
|
|
95
|
+
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
96
|
+
|
|
97
|
+
return this.getCommandFactory().getCommandFor(oElement, "switch", {
|
|
98
|
+
targetVariantReference: sNewVariantReference,
|
|
99
|
+
sourceVariantReference: sCurrentVariantReference,
|
|
100
|
+
discardVariantContent: bDiscardVariantContent
|
|
101
|
+
}, oDesignTimeMetadata);
|
|
102
|
+
}
|
|
103
|
+
|
|
78
104
|
/**
|
|
79
105
|
* Registers an overlay.
|
|
80
106
|
*
|
|
@@ -123,7 +149,7 @@ sap.ui.define([
|
|
|
123
149
|
}
|
|
124
150
|
};
|
|
125
151
|
|
|
126
|
-
ControlVariant.prototype._isPersonalizationMode = function
|
|
152
|
+
ControlVariant.prototype._isPersonalizationMode = function() {
|
|
127
153
|
return this.getCommandFactory().getFlexSettings().layer === Layer.USER;
|
|
128
154
|
};
|
|
129
155
|
|
|
@@ -180,7 +206,7 @@ sap.ui.define([
|
|
|
180
206
|
|
|
181
207
|
ControlVariant.prototype._getVariantModel = function(oElement) {
|
|
182
208
|
var oAppComponent = flUtils.getAppComponentForControl(oElement);
|
|
183
|
-
return oAppComponent ? oAppComponent.getModel(
|
|
209
|
+
return oAppComponent ? oAppComponent.getModel(ControlVariantApplyAPI.getVariantModelName()) : undefined;
|
|
184
210
|
};
|
|
185
211
|
|
|
186
212
|
/**
|
|
@@ -195,7 +221,7 @@ sap.ui.define([
|
|
|
195
221
|
return this._isVariantManagementControl(oOverlay) && this.hasStableId(oOverlay);
|
|
196
222
|
};
|
|
197
223
|
|
|
198
|
-
ControlVariant.prototype._isVariantManagementControl = function
|
|
224
|
+
ControlVariant.prototype._isVariantManagementControl = function(oOverlay) {
|
|
199
225
|
var oElement = oOverlay.getElement();
|
|
200
226
|
var vAssociationElement = oElement.getAssociation("for");
|
|
201
227
|
return !!(vAssociationElement && oElement instanceof VariantManagement);
|
|
@@ -207,7 +233,7 @@ sap.ui.define([
|
|
|
207
233
|
* @return {boolean} <code>true</code> if available
|
|
208
234
|
* @public
|
|
209
235
|
*/
|
|
210
|
-
ControlVariant.prototype.isVariantSwitchAvailable = function
|
|
236
|
+
ControlVariant.prototype.isVariantSwitchAvailable = function(oElementOverlay) {
|
|
211
237
|
return this._isVariantManagementControl(oElementOverlay);
|
|
212
238
|
};
|
|
213
239
|
|
|
@@ -217,7 +243,7 @@ sap.ui.define([
|
|
|
217
243
|
* @return {boolean} <code>true</code> if enabled
|
|
218
244
|
* @public
|
|
219
245
|
*/
|
|
220
|
-
ControlVariant.prototype.isVariantSwitchEnabled = function
|
|
246
|
+
ControlVariant.prototype.isVariantSwitchEnabled = function(aElementOverlays) {
|
|
221
247
|
var oElementOverlay = aElementOverlays[0];
|
|
222
248
|
var aVariants = [];
|
|
223
249
|
if (this._isVariantManagementControl(oElementOverlay)) {
|
|
@@ -244,7 +270,7 @@ sap.ui.define([
|
|
|
244
270
|
/**
|
|
245
271
|
* @override
|
|
246
272
|
*/
|
|
247
|
-
ControlVariant.prototype.setDesignTime = function
|
|
273
|
+
ControlVariant.prototype.setDesignTime = function(oDesignTime) {
|
|
248
274
|
RenameHandler._setDesignTime.call(this, oDesignTime);
|
|
249
275
|
};
|
|
250
276
|
|
|
@@ -255,7 +281,7 @@ sap.ui.define([
|
|
|
255
281
|
* @return {boolean} <code>true</code> if available
|
|
256
282
|
* @public
|
|
257
283
|
*/
|
|
258
|
-
ControlVariant.prototype.isRenameAvailable = function
|
|
284
|
+
ControlVariant.prototype.isRenameAvailable = function(oElementOverlay) {
|
|
259
285
|
return this._isVariantManagementControl(oElementOverlay);
|
|
260
286
|
};
|
|
261
287
|
|
|
@@ -265,7 +291,7 @@ sap.ui.define([
|
|
|
265
291
|
* @return {boolean} <code>true</code> if available
|
|
266
292
|
* @public
|
|
267
293
|
*/
|
|
268
|
-
ControlVariant.prototype.isRenameEnabled = function
|
|
294
|
+
ControlVariant.prototype.isRenameEnabled = function(aElementOverlays) {
|
|
269
295
|
return this._isVariantManagementControl(aElementOverlays[0]);
|
|
270
296
|
};
|
|
271
297
|
|
|
@@ -275,7 +301,7 @@ sap.ui.define([
|
|
|
275
301
|
* @return {boolean} <code>true</code> if available
|
|
276
302
|
* @public
|
|
277
303
|
*/
|
|
278
|
-
ControlVariant.prototype.isVariantSaveAvailable = function
|
|
304
|
+
ControlVariant.prototype.isVariantSaveAvailable = function(oElementOverlay) {
|
|
279
305
|
return this._isVariantManagementControl(oElementOverlay);
|
|
280
306
|
};
|
|
281
307
|
|
|
@@ -285,7 +311,7 @@ sap.ui.define([
|
|
|
285
311
|
* @return {boolean} <code>true</code> if available
|
|
286
312
|
* @public
|
|
287
313
|
*/
|
|
288
|
-
ControlVariant.prototype.isVariantSaveEnabled = function
|
|
314
|
+
ControlVariant.prototype.isVariantSaveEnabled = function(aElementOverlays) {
|
|
289
315
|
var oOverlay = aElementOverlays[0];
|
|
290
316
|
var oElement = oOverlay.getElement();
|
|
291
317
|
var oModel = this._getVariantModel(oElement);
|
|
@@ -299,7 +325,7 @@ sap.ui.define([
|
|
|
299
325
|
* @return {boolean} <code>true</code> if available
|
|
300
326
|
* @public
|
|
301
327
|
*/
|
|
302
|
-
ControlVariant.prototype.isVariantSaveAsAvailable = function
|
|
328
|
+
ControlVariant.prototype.isVariantSaveAsAvailable = function(oElementOverlay) {
|
|
303
329
|
return this._isVariantManagementControl(oElementOverlay);
|
|
304
330
|
};
|
|
305
331
|
|
|
@@ -309,7 +335,7 @@ sap.ui.define([
|
|
|
309
335
|
* @return {boolean} <code>true</code> if available
|
|
310
336
|
* @public
|
|
311
337
|
*/
|
|
312
|
-
ControlVariant.prototype.isVariantSaveAsEnabled = function
|
|
338
|
+
ControlVariant.prototype.isVariantSaveAsEnabled = function(aElementOverlays) {
|
|
313
339
|
return this._isVariantManagementControl(aElementOverlays[0]);
|
|
314
340
|
};
|
|
315
341
|
|
|
@@ -319,7 +345,7 @@ sap.ui.define([
|
|
|
319
345
|
* @return {boolean} <code>true</code> if available
|
|
320
346
|
* @public
|
|
321
347
|
*/
|
|
322
|
-
ControlVariant.prototype.isVariantConfigureAvailable = function
|
|
348
|
+
ControlVariant.prototype.isVariantConfigureAvailable = function(oElementOverlay) {
|
|
323
349
|
return this._isVariantManagementControl(oElementOverlay);
|
|
324
350
|
};
|
|
325
351
|
|
|
@@ -329,7 +355,7 @@ sap.ui.define([
|
|
|
329
355
|
* @return {boolean} <code>true</code> if available
|
|
330
356
|
* @public
|
|
331
357
|
*/
|
|
332
|
-
ControlVariant.prototype.isVariantConfigureEnabled = function
|
|
358
|
+
ControlVariant.prototype.isVariantConfigureEnabled = function(aElementOverlays) {
|
|
333
359
|
return this._isVariantManagementControl(aElementOverlays[0]);
|
|
334
360
|
};
|
|
335
361
|
|
|
@@ -342,23 +368,72 @@ sap.ui.define([
|
|
|
342
368
|
* @public
|
|
343
369
|
*/
|
|
344
370
|
ControlVariant.prototype.switchVariant = function(oTargetOverlay, sNewVariantReference, sCurrentVariantReference) {
|
|
345
|
-
var oDesignTimeMetadata = oTargetOverlay.getDesignTimeMetadata();
|
|
346
371
|
var oTargetElement = oTargetOverlay.getElement();
|
|
372
|
+
var oLibraryBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
|
|
347
373
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
374
|
+
function onDirtySwitchWarningClose(sAction) {
|
|
375
|
+
if (sAction === MessageBox.Action.CANCEL) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
352
378
|
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
379
|
+
if (sAction === oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE")) {
|
|
380
|
+
var oCompositeCommand;
|
|
381
|
+
this.getCommandFactory().getCommandFor(oTargetElement, "composite")
|
|
382
|
+
.then(function(_oCompositeCommand) {
|
|
383
|
+
oCompositeCommand = _oCompositeCommand;
|
|
384
|
+
return getCommandForSave.call(this, oTargetOverlay);
|
|
385
|
+
}.bind(this))
|
|
386
|
+
.then(function(oSaveCommand) {
|
|
387
|
+
oCompositeCommand.addCommand(oSaveCommand);
|
|
388
|
+
return getCommandForSwitch.call(this, oTargetOverlay, sNewVariantReference, sCurrentVariantReference);
|
|
389
|
+
}.bind(this))
|
|
390
|
+
.then(function(oSwitchCommand) {
|
|
391
|
+
oCompositeCommand.addCommand(oSwitchCommand);
|
|
392
|
+
this.fireElementModified({
|
|
393
|
+
command: oCompositeCommand
|
|
394
|
+
});
|
|
395
|
+
}.bind(this));
|
|
396
|
+
}
|
|
358
397
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
398
|
+
if (sAction === oLibraryBundle.getText("BTN_MODIFIED_VARIANT_DISCARD")) {
|
|
399
|
+
getCommandForSwitch.call(
|
|
400
|
+
this,
|
|
401
|
+
oTargetOverlay,
|
|
402
|
+
sNewVariantReference,
|
|
403
|
+
sCurrentVariantReference,
|
|
404
|
+
true // discard variant content
|
|
405
|
+
)
|
|
406
|
+
.then(function(oSwitchCommand) {
|
|
407
|
+
this.fireElementModified({
|
|
408
|
+
command: oSwitchCommand
|
|
409
|
+
});
|
|
410
|
+
}.bind(this));
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (oTargetElement.getModified()) {
|
|
415
|
+
MessageBox.warning(oLibraryBundle.getText("MSG_CHANGE_MODIFIED_VARIANT"), {
|
|
416
|
+
onClose: onDirtySwitchWarningClose.bind(this),
|
|
417
|
+
actions: [
|
|
418
|
+
oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
419
|
+
oLibraryBundle.getText("BTN_MODIFIED_VARIANT_DISCARD"),
|
|
420
|
+
MessageBox.Action.CANCEL
|
|
421
|
+
],
|
|
422
|
+
emphasizedAction: oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
423
|
+
styleClass: Utils.getRtaStyleClassName()
|
|
424
|
+
});
|
|
425
|
+
} else {
|
|
426
|
+
getCommandForSwitch.call(this, oTargetOverlay, sNewVariantReference, sCurrentVariantReference)
|
|
427
|
+
.then(function(oSwitchCommand) {
|
|
428
|
+
this.fireElementModified({
|
|
429
|
+
command: oSwitchCommand
|
|
430
|
+
});
|
|
431
|
+
}.bind(this))
|
|
432
|
+
|
|
433
|
+
.catch(function(oMessage) {
|
|
434
|
+
throw DtUtil.createError("ControlVariant#switchVariant", oMessage, "sap.ui.rta");
|
|
435
|
+
});
|
|
436
|
+
}
|
|
362
437
|
};
|
|
363
438
|
|
|
364
439
|
/**
|
|
@@ -366,7 +441,7 @@ sap.ui.define([
|
|
|
366
441
|
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
367
442
|
* @public
|
|
368
443
|
*/
|
|
369
|
-
ControlVariant.prototype.renameVariant = function
|
|
444
|
+
ControlVariant.prototype.renameVariant = function(aElementOverlays) {
|
|
370
445
|
this.startEdit(aElementOverlays[0]);
|
|
371
446
|
};
|
|
372
447
|
|
|
@@ -379,20 +454,13 @@ sap.ui.define([
|
|
|
379
454
|
});
|
|
380
455
|
};
|
|
381
456
|
|
|
382
|
-
ControlVariant.prototype.stopEdit = function
|
|
457
|
+
ControlVariant.prototype.stopEdit = function(bRestoreFocus) {
|
|
383
458
|
RenameHandler._stopEdit.call(this, bRestoreFocus, "plugin.ControlVariant.stopEdit");
|
|
384
459
|
};
|
|
385
460
|
|
|
386
|
-
ControlVariant.prototype.createSaveCommand = function
|
|
461
|
+
ControlVariant.prototype.createSaveCommand = function(aElementOverlays) {
|
|
387
462
|
var oOverlay = aElementOverlays[0];
|
|
388
|
-
|
|
389
|
-
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
390
|
-
var oModel = this._getVariantModel(oElement);
|
|
391
|
-
var sVariantManagementReference = oOverlay.getVariantManagement();
|
|
392
|
-
|
|
393
|
-
return this.getCommandFactory().getCommandFor(oElement, "save", {
|
|
394
|
-
model: oModel
|
|
395
|
-
}, oDesignTimeMetadata, sVariantManagementReference)
|
|
463
|
+
return getCommandForSave.call(this, oOverlay)
|
|
396
464
|
.then(function(oSaveCommand) {
|
|
397
465
|
this.fireElementModified({
|
|
398
466
|
command: oSaveCommand
|
|
@@ -400,7 +468,7 @@ sap.ui.define([
|
|
|
400
468
|
}.bind(this));
|
|
401
469
|
};
|
|
402
470
|
|
|
403
|
-
ControlVariant.prototype.createSaveAsCommand = function
|
|
471
|
+
ControlVariant.prototype.createSaveAsCommand = function(aElementOverlays) {
|
|
404
472
|
var oOverlay = aElementOverlays[0];
|
|
405
473
|
var oElement = oOverlay.getElement();
|
|
406
474
|
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
@@ -450,7 +518,7 @@ sap.ui.define([
|
|
|
450
518
|
* @returns {object} setTitle command
|
|
451
519
|
* @private
|
|
452
520
|
*/
|
|
453
|
-
ControlVariant.prototype._createSetTitleCommand = function
|
|
521
|
+
ControlVariant.prototype._createSetTitleCommand = function(mPropertyBag) {
|
|
454
522
|
this._$oEditableControlDomRef.text(mPropertyBag.text);
|
|
455
523
|
|
|
456
524
|
return this.getCommandFactory().getCommandFor(mPropertyBag.element, "setTitle", {
|
|
@@ -468,15 +536,15 @@ sap.ui.define([
|
|
|
468
536
|
* @param {string} sValueStateText value state text that needs to be set
|
|
469
537
|
* @private
|
|
470
538
|
*/
|
|
471
|
-
ControlVariant.prototype._prepareOverlayForValueState = function
|
|
539
|
+
ControlVariant.prototype._prepareOverlayForValueState = function(oOverlay, sValueStateText) {
|
|
472
540
|
//Prepare VariantManagement control overlay for valueStateMessage
|
|
473
|
-
oOverlay.getValueState = function
|
|
541
|
+
oOverlay.getValueState = function() {
|
|
474
542
|
return "Error";
|
|
475
543
|
};
|
|
476
|
-
oOverlay.getValueStateText = function
|
|
544
|
+
oOverlay.getValueStateText = function() {
|
|
477
545
|
return sValueStateText;
|
|
478
546
|
};
|
|
479
|
-
oOverlay.getDomRefForValueStateMessage = function
|
|
547
|
+
oOverlay.getDomRefForValueStateMessage = function() {
|
|
480
548
|
return this.$();
|
|
481
549
|
};
|
|
482
550
|
};
|
|
@@ -487,7 +555,7 @@ sap.ui.define([
|
|
|
487
555
|
* @returns {Promise} Resolving when the dialog is closed and the command is created
|
|
488
556
|
* @public
|
|
489
557
|
*/
|
|
490
|
-
ControlVariant.prototype.configureVariants = function
|
|
558
|
+
ControlVariant.prototype.configureVariants = function(aElementOverlays) {
|
|
491
559
|
var oElementOverlay = aElementOverlays[0];
|
|
492
560
|
var oVariantManagementControl = oElementOverlay.getElement();
|
|
493
561
|
var sVariantManagementReference = oElementOverlay.getVariantManagement();
|
|
@@ -536,7 +604,7 @@ sap.ui.define([
|
|
|
536
604
|
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
537
605
|
* @return {object[]} - array containing the items with required data
|
|
538
606
|
*/
|
|
539
|
-
ControlVariant.prototype.getMenuItems = function
|
|
607
|
+
ControlVariant.prototype.getMenuItems = function(aElementOverlays) {
|
|
540
608
|
var oElementOverlay = aElementOverlays[0];
|
|
541
609
|
var aMenuItems = [];
|
|
542
610
|
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @class The CreateContainer allows trigger CreateContainer operations on the overlay
|
|
26
26
|
* @extends sap.ui.rta.plugin.BaseCreate
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.109.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.34
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @class The EasyAdd Plugin adds an Icon to an Overlay, which allows to trigger add operations directly
|
|
26
26
|
* @extends sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.109.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.48
|
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
* @class The EasyRemove Plugin adds an Icon to an Overlay, which allows to trigger remove operations directly
|
|
24
24
|
* @extends sap.ui.rta.plugin.Remove
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.109.0
|
|
27
27
|
* @constructor
|
|
28
28
|
* @private
|
|
29
29
|
* @since 1.48
|