@openui5/sap.ui.rta 1.108.2 → 1.110.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 +16 -16
- package/THIRDPARTY.txt +2 -2
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +2 -2
- package/src/sap/ui/rta/Client.js +2 -2
- package/src/sap/ui/rta/RuntimeAuthoring.js +240 -191
- package/src/sap/ui/rta/Utils.js +40 -19
- package/src/sap/ui/rta/api/startAdaptation.js +1 -1
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantOverviewDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +1 -1
- package/src/sap/ui/rta/appVariant/Feature.js +2 -8
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +1 -1
- package/src/sap/ui/rta/appVariant/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/Component.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/index.js +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/model/models.js +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +2 -2
- package/src/sap/ui/rta/command/AddProperty.js +2 -2
- package/src/sap/ui/rta/command/AddXML.js +3 -3
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -3
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +3 -3
- package/src/sap/ui/rta/command/BaseCommand.js +2 -2
- package/src/sap/ui/rta/command/BindProperty.js +2 -2
- package/src/sap/ui/rta/command/Combine.js +2 -2
- package/src/sap/ui/rta/command/CommandFactory.js +2 -2
- package/src/sap/ui/rta/command/CompositeCommand.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +5 -3
- package/src/sap/ui/rta/command/ControlVariantSave.js +2 -2
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +15 -15
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +11 -4
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +42 -10
- package/src/sap/ui/rta/command/CreateContainer.js +2 -2
- package/src/sap/ui/rta/command/CustomAdd.js +2 -2
- package/src/sap/ui/rta/command/FlexCommand.js +18 -16
- package/src/sap/ui/rta/command/LREPSerializer.js +27 -17
- package/src/sap/ui/rta/command/LocalReset.js +2 -2
- package/src/sap/ui/rta/command/Move.js +2 -2
- package/src/sap/ui/rta/command/Property.js +2 -2
- package/src/sap/ui/rta/command/Remove.js +2 -2
- package/src/sap/ui/rta/command/Rename.js +2 -2
- package/src/sap/ui/rta/command/Resize.js +2 -2
- package/src/sap/ui/rta/command/Reveal.js +2 -2
- package/src/sap/ui/rta/command/Settings.js +2 -2
- package/src/sap/ui/rta/command/Split.js +2 -2
- package/src/sap/ui/rta/command/Stack.js +11 -3
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +2 -3
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +2 -2
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +28 -6
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +2 -2
- package/src/sap/ui/rta/enablement/TestDelegate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +28 -19
- package/src/sap/ui/rta/library.js +3 -3
- package/src/sap/ui/rta/messagebundle.properties +65 -17
- package/src/sap/ui/rta/messagebundle_ar.properties +32 -8
- package/src/sap/ui/rta/messagebundle_bg.properties +32 -8
- package/src/sap/ui/rta/messagebundle_ca.properties +32 -8
- package/src/sap/ui/rta/messagebundle_cs.properties +32 -8
- package/src/sap/ui/rta/messagebundle_cy.properties +31 -7
- package/src/sap/ui/rta/messagebundle_da.properties +31 -7
- package/src/sap/ui/rta/messagebundle_de.properties +31 -7
- package/src/sap/ui/rta/messagebundle_el.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en_GB.properties +32 -8
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +31 -7
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +31 -7
- package/src/sap/ui/rta/messagebundle_es.properties +31 -7
- package/src/sap/ui/rta/messagebundle_es_MX.properties +31 -7
- package/src/sap/ui/rta/messagebundle_et.properties +31 -7
- package/src/sap/ui/rta/messagebundle_fi.properties +31 -7
- package/src/sap/ui/rta/messagebundle_fr.properties +31 -7
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +32 -8
- package/src/sap/ui/rta/messagebundle_hi.properties +32 -8
- package/src/sap/ui/rta/messagebundle_hr.properties +32 -8
- package/src/sap/ui/rta/messagebundle_hu.properties +31 -7
- package/src/sap/ui/rta/messagebundle_id.properties +32 -8
- package/src/sap/ui/rta/messagebundle_it.properties +32 -8
- package/src/sap/ui/rta/messagebundle_iw.properties +31 -7
- package/src/sap/ui/rta/messagebundle_ja.properties +32 -8
- package/src/sap/ui/rta/messagebundle_kk.properties +31 -7
- package/src/sap/ui/rta/messagebundle_ko.properties +31 -7
- package/src/sap/ui/rta/messagebundle_lt.properties +31 -7
- package/src/sap/ui/rta/messagebundle_lv.properties +32 -8
- package/src/sap/ui/rta/messagebundle_ms.properties +32 -8
- package/src/sap/ui/rta/messagebundle_nl.properties +31 -7
- package/src/sap/ui/rta/messagebundle_no.properties +32 -8
- package/src/sap/ui/rta/messagebundle_pl.properties +32 -8
- package/src/sap/ui/rta/messagebundle_pt.properties +32 -8
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +31 -7
- package/src/sap/ui/rta/messagebundle_ro.properties +32 -8
- package/src/sap/ui/rta/messagebundle_ru.properties +32 -8
- package/src/sap/ui/rta/messagebundle_sh.properties +31 -7
- package/src/sap/ui/rta/messagebundle_sk.properties +31 -7
- package/src/sap/ui/rta/messagebundle_sl.properties +31 -7
- package/src/sap/ui/rta/messagebundle_sv.properties +32 -8
- package/src/sap/ui/rta/messagebundle_th.properties +33 -9
- package/src/sap/ui/rta/messagebundle_tr.properties +31 -7
- package/src/sap/ui/rta/messagebundle_uk.properties +31 -7
- package/src/sap/ui/rta/messagebundle_vi.properties +32 -8
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +32 -8
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +32 -8
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +2 -2
- package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
- package/src/sap/ui/rta/plugin/Combine.js +2 -2
- package/src/sap/ui/rta/plugin/CompVariant.js +107 -29
- package/src/sap/ui/rta/plugin/ControlVariant.js +118 -50
- package/src/sap/ui/rta/plugin/CreateContainer.js +2 -2
- package/src/sap/ui/rta/plugin/CutPaste.js +2 -2
- package/src/sap/ui/rta/plugin/DragDrop.js +4 -4
- package/src/sap/ui/rta/plugin/EasyAdd.js +30 -21
- package/src/sap/ui/rta/plugin/EasyRemove.js +13 -11
- package/src/sap/ui/rta/plugin/LocalReset.js +6 -4
- package/src/sap/ui/rta/plugin/Plugin.js +50 -13
- package/src/sap/ui/rta/plugin/RTAElementMover.js +2 -2
- package/src/sap/ui/rta/plugin/Remove.js +2 -2
- package/src/sap/ui/rta/plugin/Rename.js +2 -2
- package/src/sap/ui/rta/plugin/RenameHandler.js +29 -19
- package/src/sap/ui/rta/plugin/Resize.js +2 -2
- package/src/sap/ui/rta/plugin/Selection.js +7 -14
- package/src/sap/ui/rta/plugin/Settings.js +2 -2
- package/src/sap/ui/rta/plugin/Split.js +2 -2
- package/src/sap/ui/rta/plugin/Stretch.js +17 -16
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +28 -7
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.fragment.xml +1 -0
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +2 -2
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +5 -5
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +2 -2
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +7 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +4 -4
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +2 -2
- package/src/sap/ui/rta/service/ControllerExtension.js +3 -3
- package/src/sap/ui/rta/service/Outline.js +2 -2
- package/src/sap/ui/rta/service/Property.js +2 -2
- package/src/sap/ui/rta/service/Receiver.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +2 -2
- package/src/sap/ui/rta/service/SupportTools.js +2 -2
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +26 -9
- package/src/sap/ui/rta/themes/base/library.source.less +1 -1
- package/src/sap/ui/rta/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/rta/toolbar/ActionsMenu.fragment.xml +82 -0
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +35 -90
- package/src/sap/ui/rta/toolbar/Adaptation.js +83 -27
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +4 -4
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +11 -10
- package/src/sap/ui/rta/toolbar/FioriLike.js +2 -2
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +2 -2
- package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
- package/src/sap/ui/rta/toolbar/Standalone.js +2 -2
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +263 -0
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +149 -0
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +185 -0
- package/src/sap/ui/rta/toolbar/contextBased/{SaveAsContextBasedAdaptationDialog.fragment.xml → SaveAsAdaptationDialog.fragment.xml} +19 -15
- package/src/sap/ui/rta/toolbar/translation/Translation.js +2 -2
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +4 -4
- package/src/sap/ui/rta/util/Animation.js +5 -9
- package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +2 -2
- package/src/sap/ui/rta/util/PopupManager.js +2 -2
- package/src/sap/ui/rta/util/ReloadManager.js +2 -2
- package/src/sap/ui/rta/util/ServiceEventBus.js +2 -2
- package/src/sap/ui/rta/util/StylesLoader.js +1 -1
- package/src/sap/ui/rta/util/UrlParser.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +4 -3
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +11 -10
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +1 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +28 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeStates.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +110 -72
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/MoveVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/RenameVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +1 -1
- package/src/sap/ui/rta/util/showMessageBox.js +1 -1
- package/src/sap/ui/rta/util/validateFlexEnabled.js +1 -1
- package/src/sap/ui/rta/util/validateStableIds.js +1 -1
- 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
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation.js +0 -124
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
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",
|
|
8
7
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
9
|
-
"sap/ui/fl/
|
|
8
|
+
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
9
|
+
"sap/ui/fl/Utils",
|
|
10
|
+
"sap/ui/rta/command/BaseCommand"
|
|
10
11
|
], function(
|
|
11
|
-
BaseCommand,
|
|
12
12
|
JsControlTreeModifier,
|
|
13
|
-
|
|
13
|
+
ControlVariantApplyAPI,
|
|
14
|
+
flUtils,
|
|
15
|
+
BaseCommand
|
|
14
16
|
) {
|
|
15
17
|
"use strict";
|
|
16
18
|
|
|
@@ -20,7 +22,7 @@ sap.ui.define([
|
|
|
20
22
|
* @class
|
|
21
23
|
* @extends sap.ui.rta.command.BaseCommand
|
|
22
24
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
25
|
+
* @version 1.110.0
|
|
24
26
|
* @constructor
|
|
25
27
|
* @private
|
|
26
28
|
* @since 1.50
|
|
@@ -35,6 +37,9 @@ sap.ui.define([
|
|
|
35
37
|
},
|
|
36
38
|
sourceVariantReference: {
|
|
37
39
|
type: "string"
|
|
40
|
+
},
|
|
41
|
+
discardVariantContent: {
|
|
42
|
+
type: "boolean"
|
|
38
43
|
}
|
|
39
44
|
},
|
|
40
45
|
associations: {},
|
|
@@ -42,7 +47,15 @@ sap.ui.define([
|
|
|
42
47
|
}
|
|
43
48
|
});
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
function discardVariantContent(sVReference) {
|
|
51
|
+
return this.oModel.eraseDirtyChangesOnVariant(this.sVariantManagementReference, sVReference)
|
|
52
|
+
.then(function(aDirtyChanges) {
|
|
53
|
+
this._aSourceVariantDirtyChanges = aDirtyChanges;
|
|
54
|
+
this.oModel.checkUpdate(true);
|
|
55
|
+
}.bind(this));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
ControlVariantSwitch.prototype._getAppComponent = function() {
|
|
46
59
|
var oElement = this.getElement();
|
|
47
60
|
return oElement ? flUtils.getAppComponentForControl(oElement) : this.getSelector().appComponent;
|
|
48
61
|
};
|
|
@@ -50,6 +63,7 @@ sap.ui.define([
|
|
|
50
63
|
|
|
51
64
|
/**
|
|
52
65
|
* Template Method to implement execute logic, with ensure precondition Element is available.
|
|
66
|
+
*
|
|
53
67
|
* @public
|
|
54
68
|
* @returns {Promise} Returns resolve after execution
|
|
55
69
|
*/
|
|
@@ -58,9 +72,17 @@ sap.ui.define([
|
|
|
58
72
|
var oAppComponent = this._getAppComponent();
|
|
59
73
|
var sNewVariantReference = this.getTargetVariantReference();
|
|
60
74
|
|
|
61
|
-
this.oModel = oAppComponent.getModel(
|
|
75
|
+
this.oModel = oAppComponent.getModel(ControlVariantApplyAPI.getVariantModelName());
|
|
62
76
|
this.sVariantManagementReference = JsControlTreeModifier.getSelector(oElement, oAppComponent).id;
|
|
63
|
-
|
|
77
|
+
|
|
78
|
+
return Promise.resolve()
|
|
79
|
+
.then(function() {
|
|
80
|
+
if (this.getDiscardVariantContent()) {
|
|
81
|
+
return discardVariantContent.call(this, this.getSourceVariantReference());
|
|
82
|
+
}
|
|
83
|
+
return undefined;
|
|
84
|
+
}.bind(this))
|
|
85
|
+
.then(this._updateModelVariant.bind(this, sNewVariantReference, oAppComponent));
|
|
64
86
|
};
|
|
65
87
|
|
|
66
88
|
/**
|
|
@@ -71,10 +93,20 @@ sap.ui.define([
|
|
|
71
93
|
ControlVariantSwitch.prototype.undo = function() {
|
|
72
94
|
var sOldVariantReference = this.getSourceVariantReference();
|
|
73
95
|
var oAppComponent = this._getAppComponent();
|
|
96
|
+
|
|
97
|
+
if (this.getDiscardVariantContent()) {
|
|
98
|
+
return this.oModel.addAndApplyChangesOnVariant(this._aSourceVariantDirtyChanges)
|
|
99
|
+
.then(function() {
|
|
100
|
+
this._aSourceVariantDirtyChanges = null;
|
|
101
|
+
this.oModel.checkUpdate(true);
|
|
102
|
+
return this._updateModelVariant(sOldVariantReference, oAppComponent);
|
|
103
|
+
}.bind(this));
|
|
104
|
+
}
|
|
105
|
+
|
|
74
106
|
return this._updateModelVariant(sOldVariantReference, oAppComponent);
|
|
75
107
|
};
|
|
76
108
|
|
|
77
|
-
ControlVariantSwitch.prototype._updateModelVariant = function
|
|
109
|
+
ControlVariantSwitch.prototype._updateModelVariant = function(sVariantReference, oAppComponent) {
|
|
78
110
|
if (this.getTargetVariantReference() !== this.getSourceVariantReference()) {
|
|
79
111
|
return this.oModel.updateCurrentVariant({
|
|
80
112
|
variantManagementReference: this.sVariantManagementReference,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
@@ -12,7 +12,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
12
12
|
* @class
|
|
13
13
|
* @extends sap.ui.rta.command.FlexCommand
|
|
14
14
|
* @author SAP SE
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.110.0
|
|
16
16
|
* @constructor
|
|
17
17
|
* @private
|
|
18
18
|
* @since 1.34
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
@@ -12,7 +12,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
12
12
|
* @class
|
|
13
13
|
* @extends sap.ui.rta.command.FlexCommand
|
|
14
14
|
* @author SAP SE
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.110.0
|
|
16
16
|
* @constructor
|
|
17
17
|
* @private
|
|
18
18
|
* @since 1.62
|
|
@@ -1,26 +1,28 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
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",
|
|
8
|
-
"sap/ui/rta/library",
|
|
9
|
-
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
10
|
-
"sap/ui/fl/Utils",
|
|
11
|
-
"sap/base/Log",
|
|
12
7
|
"sap/base/util/merge",
|
|
8
|
+
"sap/base/util/values",
|
|
9
|
+
"sap/base/Log",
|
|
10
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
11
|
+
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
13
12
|
"sap/ui/fl/write/api/ChangesWriteAPI",
|
|
14
|
-
"sap/
|
|
13
|
+
"sap/ui/fl/Utils",
|
|
14
|
+
"sap/ui/rta/command/BaseCommand",
|
|
15
|
+
"sap/ui/rta/library"
|
|
15
16
|
], function(
|
|
16
|
-
BaseCommand,
|
|
17
|
-
rtaLibrary,
|
|
18
|
-
JsControlTreeModifier,
|
|
19
|
-
FlUtils,
|
|
20
|
-
Log,
|
|
21
17
|
merge,
|
|
18
|
+
objectValues,
|
|
19
|
+
Log,
|
|
20
|
+
JsControlTreeModifier,
|
|
21
|
+
ControlVariantApplyAPI,
|
|
22
22
|
ChangesWriteAPI,
|
|
23
|
-
|
|
23
|
+
FlUtils,
|
|
24
|
+
BaseCommand,
|
|
25
|
+
rtaLibrary
|
|
24
26
|
) {
|
|
25
27
|
"use strict";
|
|
26
28
|
|
|
@@ -31,7 +33,7 @@ sap.ui.define([
|
|
|
31
33
|
* @extends sap.ui.rta.command.BaseCommand
|
|
32
34
|
*
|
|
33
35
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
36
|
+
* @version 1.110.0
|
|
35
37
|
*
|
|
36
38
|
* @constructor
|
|
37
39
|
* @private
|
|
@@ -195,7 +197,7 @@ sap.ui.define([
|
|
|
195
197
|
mChangeSpecificData = merge({}, mChangeSpecificData, mFlexSettings);
|
|
196
198
|
}
|
|
197
199
|
mChangeSpecificData.jsOnly = this.getJsOnly();
|
|
198
|
-
var oModel = this.getAppComponent().getModel(
|
|
200
|
+
var oModel = this.getAppComponent().getModel(ControlVariantApplyAPI.getVariantModelName());
|
|
199
201
|
var sVariantReference;
|
|
200
202
|
if (oModel && sVariantManagementReference) {
|
|
201
203
|
sVariantReference = oModel.getCurrentVariantReference(sVariantManagementReference);
|
|
@@ -237,7 +239,7 @@ sap.ui.define([
|
|
|
237
239
|
|
|
238
240
|
/**
|
|
239
241
|
* @private
|
|
240
|
-
* @param {sap.ui.fl.
|
|
242
|
+
* @param {sap.ui.fl.apply._internal.flexObjects.UIChange|Object} vChange Change object or map containing the change object
|
|
241
243
|
* @returns {Promise} Returns an empty promise
|
|
242
244
|
*/
|
|
243
245
|
FlexCommand.prototype._applyChange = function(vChange) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -8,7 +8,6 @@ sap.ui.define([
|
|
|
8
8
|
"sap/ui/rta/command/FlexCommand",
|
|
9
9
|
"sap/ui/rta/command/AppDescriptorCommand",
|
|
10
10
|
"sap/ui/fl/Utils",
|
|
11
|
-
"sap/ui/fl/Change",
|
|
12
11
|
"sap/ui/dt/ElementUtil",
|
|
13
12
|
"sap/base/Log",
|
|
14
13
|
"sap/ui/fl/write/api/PersistenceWriteAPI"
|
|
@@ -17,7 +16,6 @@ sap.ui.define([
|
|
|
17
16
|
FlexCommand,
|
|
18
17
|
AppDescriptorCommand,
|
|
19
18
|
FlUtils,
|
|
20
|
-
Change,
|
|
21
19
|
ElementUtil,
|
|
22
20
|
Log,
|
|
23
21
|
PersistenceWriteAPI
|
|
@@ -29,7 +27,7 @@ sap.ui.define([
|
|
|
29
27
|
* @class
|
|
30
28
|
* @extends sap.ui.base.ManagedObject
|
|
31
29
|
* @author SAP SE
|
|
32
|
-
* @version 1.
|
|
30
|
+
* @version 1.110.0
|
|
33
31
|
* @constructor
|
|
34
32
|
* @private
|
|
35
33
|
* @since 1.42
|
|
@@ -114,9 +112,6 @@ sap.ui.define([
|
|
|
114
112
|
var oAppComponent = oCommand.getAppComponent();
|
|
115
113
|
if (oAppComponent) {
|
|
116
114
|
var oPreparedChange = oCommand.getPreparedChange();
|
|
117
|
-
if (oPreparedChange.getState() === Change.states.DELETED) {
|
|
118
|
-
oPreparedChange.setState(Change.states.NEW);
|
|
119
|
-
}
|
|
120
115
|
if (!this._isPersistedChange(oPreparedChange)) {
|
|
121
116
|
PersistenceWriteAPI.add({change: oCommand.getPreparedChange(), selector: oAppComponent});
|
|
122
117
|
}
|
|
@@ -182,23 +177,33 @@ sap.ui.define([
|
|
|
182
177
|
}.bind(this))
|
|
183
178
|
.then(function() {
|
|
184
179
|
Log.info("UI adaptation successfully transfered changes to layered repository");
|
|
180
|
+
this.getCommandStack().setSaved(true);
|
|
185
181
|
this.getCommandStack().removeAllCommands();
|
|
186
182
|
}.bind(this));
|
|
187
183
|
|
|
188
184
|
return this._lastPromise;
|
|
189
185
|
};
|
|
190
186
|
|
|
191
|
-
LREPSerializer.prototype._triggerUndoChanges = function() {
|
|
187
|
+
LREPSerializer.prototype._triggerUndoChanges = function(bRemoveChanges) {
|
|
192
188
|
var oCommandStack = this.getCommandStack();
|
|
193
189
|
var aPromises = [];
|
|
194
190
|
|
|
195
191
|
var aCommands = oCommandStack.getAllExecutedCommands();
|
|
196
|
-
aCommands.forEach(function(oCommand) {
|
|
197
|
-
aPromises.push(oCommand.undo.bind(oCommand));
|
|
198
|
-
});
|
|
199
192
|
|
|
200
|
-
|
|
201
|
-
|
|
193
|
+
if (bRemoveChanges) {
|
|
194
|
+
// Calling "undo" from the stack, the serializer is also informed of the
|
|
195
|
+
// command execution and clears the dirty changes from the persistence
|
|
196
|
+
aCommands.forEach(function() {
|
|
197
|
+
// Undo on the stack already starts from the last command
|
|
198
|
+
aPromises.push(oCommandStack.undo.bind(oCommandStack));
|
|
199
|
+
});
|
|
200
|
+
} else {
|
|
201
|
+
aCommands.forEach(function(oCommand) {
|
|
202
|
+
aPromises.push(oCommand.undo.bind(oCommand));
|
|
203
|
+
});
|
|
204
|
+
// The last command has to be undone first, therefore reversing is required
|
|
205
|
+
aPromises = aPromises.reverse();
|
|
206
|
+
}
|
|
202
207
|
|
|
203
208
|
return FlUtils.execPromiseQueueSequentially(aPromises, false, true);
|
|
204
209
|
};
|
|
@@ -208,18 +213,23 @@ sap.ui.define([
|
|
|
208
213
|
* At this point command stack is not aware if the changes have been already booked for the new app variant.
|
|
209
214
|
* Therefore if there shall be some UI changes present in command stack, we undo all the changes till the beginning.
|
|
210
215
|
* In the last when user presses 'Save and Exit', there will be no change registered for the current app.
|
|
216
|
+
* @param {boolean} bRemoveChanges if LREPSerializer should clear the dirty changes in the persistence
|
|
211
217
|
* @returns {Promise} returns a promise with true or false
|
|
212
218
|
*/
|
|
213
|
-
LREPSerializer.prototype.clearCommandStack = function() {
|
|
219
|
+
LREPSerializer.prototype.clearCommandStack = function(bRemoveChanges) {
|
|
214
220
|
var oCommandStack = this.getCommandStack();
|
|
215
221
|
|
|
216
222
|
// Detach the event 'commandExecuted' here to stop the communication of LREPSerializer with Flex
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
if (!bRemoveChanges) {
|
|
224
|
+
oCommandStack.detachCommandExecuted(this.handleCommandExecuted.bind(this));
|
|
225
|
+
}
|
|
226
|
+
return this._triggerUndoChanges(bRemoveChanges)
|
|
219
227
|
.then(function() {
|
|
220
228
|
oCommandStack.removeAllCommands();
|
|
221
229
|
// Attach the event 'commandExecuted' here to start the communication of LREPSerializer with Flex
|
|
222
|
-
|
|
230
|
+
if (!bRemoveChanges) {
|
|
231
|
+
oCommandStack.attachCommandExecuted(this.handleCommandExecuted.bind(this));
|
|
232
|
+
}
|
|
223
233
|
return true;
|
|
224
234
|
}.bind(this));
|
|
225
235
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -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.110.0
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.90
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -17,7 +17,7 @@ function(
|
|
|
17
17
|
* @class
|
|
18
18
|
* @extends sap.ui.rta.command.FlexCommand
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.110.0
|
|
21
21
|
* @constructor
|
|
22
22
|
* @private
|
|
23
23
|
* @since 1.34
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @class
|
|
17
17
|
* @extends sap.ui.rta.command.FlexCommand
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.110.0
|
|
20
20
|
* @constructor
|
|
21
21
|
* @private
|
|
22
22
|
* @since 1.34
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
@@ -12,7 +12,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
12
12
|
* @class
|
|
13
13
|
* @extends sap.ui.rta.command.FlexCommand
|
|
14
14
|
* @author SAP SE
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.110.0
|
|
16
16
|
* @constructor
|
|
17
17
|
* @private
|
|
18
18
|
* @since 1.42
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
@@ -12,7 +12,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
12
12
|
* @class
|
|
13
13
|
* @extends sap.ui.rta.command.FlexCommand
|
|
14
14
|
* @author SAP SE
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.110.0
|
|
16
16
|
* @constructor
|
|
17
17
|
* @private
|
|
18
18
|
* @since 1.34
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -16,7 +16,7 @@ sap.ui.define([
|
|
|
16
16
|
* @class
|
|
17
17
|
* @extends sap.ui.rta.command.FlexCommand
|
|
18
18
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
19
|
+
* @version 1.110.0
|
|
20
20
|
* @constructor
|
|
21
21
|
* @private
|
|
22
22
|
* @since 1.101
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
@@ -12,7 +12,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
12
12
|
* @class
|
|
13
13
|
* @extends sap.ui.rta.command.FlexCommand
|
|
14
14
|
* @author SAP SE
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.110.0
|
|
16
16
|
* @constructor
|
|
17
17
|
* @private
|
|
18
18
|
* @since 1.44
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
@@ -12,7 +12,7 @@ sap.ui.define(["sap/ui/rta/command/FlexCommand"], function(FlexCommand) {
|
|
|
12
12
|
* @class
|
|
13
13
|
* @extends sap.ui.rta.command.FlexCommand
|
|
14
14
|
* @author SAP SE
|
|
15
|
-
* @version 1.
|
|
15
|
+
* @version 1.110.0
|
|
16
16
|
* @constructor
|
|
17
17
|
* @private
|
|
18
18
|
* @since 1.44
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -14,7 +14,7 @@ sap.ui.define([
|
|
|
14
14
|
* @class
|
|
15
15
|
* @extends sap.ui.rta.command.FlexCommand
|
|
16
16
|
* @author SAP SE
|
|
17
|
-
* @version 1.
|
|
17
|
+
* @version 1.110.0
|
|
18
18
|
* @constructor
|
|
19
19
|
* @private
|
|
20
20
|
* @since 1.46
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -59,7 +59,7 @@ sap.ui.define([
|
|
|
59
59
|
* @class
|
|
60
60
|
* @extends sap.ui.base.ManagedObject
|
|
61
61
|
* @author SAP SE
|
|
62
|
-
* @version 1.
|
|
62
|
+
* @version 1.110.0
|
|
63
63
|
* @constructor
|
|
64
64
|
* @private
|
|
65
65
|
* @since 1.34
|
|
@@ -70,7 +70,15 @@ sap.ui.define([
|
|
|
70
70
|
var Stack = ManagedObject.extend("sap.ui.rta.command.Stack", {
|
|
71
71
|
metadata: {
|
|
72
72
|
library: "sap.ui.rta",
|
|
73
|
-
properties: {
|
|
73
|
+
properties: {
|
|
74
|
+
/**
|
|
75
|
+
* If the stack was saved at least once
|
|
76
|
+
*/
|
|
77
|
+
saved: {
|
|
78
|
+
type: "boolean",
|
|
79
|
+
defaultValue: false
|
|
80
|
+
}
|
|
81
|
+
},
|
|
74
82
|
aggregations: {
|
|
75
83
|
commands: {
|
|
76
84
|
type: "sap.ui.rta.command.BaseCommand",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* @extends sap.ui.rta.command.AppDescriptorCommand
|
|
18
18
|
*
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.110.0
|
|
21
21
|
*
|
|
22
22
|
* @constructor
|
|
23
23
|
* @private
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -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.110.0
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.102
|
|
@@ -81,7 +81,6 @@ sap.ui.define([
|
|
|
81
81
|
};
|
|
82
82
|
|
|
83
83
|
CompVariantContent.prototype.execute = function() {
|
|
84
|
-
this.setIsModifiedBefore(this.getElement().getModified());
|
|
85
84
|
this.getElement().setModified(true);
|
|
86
85
|
var oNewVariantContent = setVariantContent.call(this, this.getNewContent());
|
|
87
86
|
callFlAPIFunction.call(this, "updateVariantContent", this.getVariantId(), {content: oNewVariantContent});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -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.110.0
|
|
24
24
|
* @constructor
|
|
25
25
|
* @private
|
|
26
26
|
* @since 1.87
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
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"
|
|
8
9
|
], function(
|
|
9
|
-
BaseCommand
|
|
10
|
+
BaseCommand,
|
|
11
|
+
SmartVariantManagementWriteAPI
|
|
10
12
|
) {
|
|
11
13
|
"use strict";
|
|
12
14
|
|
|
@@ -16,7 +18,7 @@ sap.ui.define([
|
|
|
16
18
|
* @class
|
|
17
19
|
* @extends sap.ui.rta.command.BaseCommand
|
|
18
20
|
* @author SAP SE
|
|
19
|
-
* @version 1.
|
|
21
|
+
* @version 1.110.0
|
|
20
22
|
* @constructor
|
|
21
23
|
* @private
|
|
22
24
|
* @since 1.87
|
|
@@ -31,18 +33,29 @@ sap.ui.define([
|
|
|
31
33
|
},
|
|
32
34
|
targetVariantId: {
|
|
33
35
|
type: "string"
|
|
36
|
+
},
|
|
37
|
+
discardVariantContent: {
|
|
38
|
+
type: "boolean"
|
|
34
39
|
}
|
|
35
40
|
}
|
|
36
41
|
}
|
|
37
42
|
});
|
|
38
43
|
|
|
39
44
|
/**
|
|
40
|
-
* Triggers the
|
|
45
|
+
* Triggers the switch of a variant. If the switch was done from
|
|
46
|
+
* a variant with changes, the user can decide to discard them on switch.
|
|
41
47
|
* @public
|
|
42
|
-
* @returns {Promise}
|
|
48
|
+
* @returns {Promise} Resolves after execution
|
|
43
49
|
*/
|
|
44
50
|
CompVariantSwitch.prototype.execute = function() {
|
|
45
51
|
this.getElement().activateVariant(this.getTargetVariantId());
|
|
52
|
+
if (this.getDiscardVariantContent()) {
|
|
53
|
+
this.getElement().setModified(false);
|
|
54
|
+
SmartVariantManagementWriteAPI.discardVariantContent({
|
|
55
|
+
control: this.getElement(),
|
|
56
|
+
id: this.getSourceVariantId()
|
|
57
|
+
});
|
|
58
|
+
}
|
|
46
59
|
return Promise.resolve();
|
|
47
60
|
};
|
|
48
61
|
|
|
@@ -52,7 +65,16 @@ sap.ui.define([
|
|
|
52
65
|
* @returns {Promise} Resolves after undo
|
|
53
66
|
*/
|
|
54
67
|
CompVariantSwitch.prototype.undo = function() {
|
|
68
|
+
if (this.getDiscardVariantContent()) {
|
|
69
|
+
SmartVariantManagementWriteAPI.revert({
|
|
70
|
+
control: this.getElement(),
|
|
71
|
+
id: this.getSourceVariantId()
|
|
72
|
+
});
|
|
73
|
+
}
|
|
55
74
|
this.getElement().activateVariant(this.getSourceVariantId());
|
|
75
|
+
if (this.getDiscardVariantContent()) {
|
|
76
|
+
this.getElement().setModified(true);
|
|
77
|
+
}
|
|
56
78
|
return Promise.resolve();
|
|
57
79
|
};
|
|
58
80
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -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.110.0
|
|
26
26
|
* @constructor
|
|
27
27
|
* @private
|
|
28
28
|
* @since 1.87
|