@openui5/sap.ui.rta 1.103.1 → 1.106.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 +35 -15
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
- package/THIRDPARTY.txt +64 -21
- 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 +107 -418
- package/src/sap/ui/rta/Utils.js +2 -2
- package/src/sap/ui/rta/api/startAdaptation.js +2 -2
- package/src/sap/ui/rta/api/startKeyUserAdaptation.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +6 -22
- package/src/sap/ui/rta/appVariant/Feature.js +4 -12
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
- 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 +8 -3
- 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 +7 -5
- 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 +5 -3
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +5 -4
- 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 +5 -3
- package/src/sap/ui/rta/command/LREPSerializer.js +11 -8
- 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 +17 -7
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +6 -4
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +6 -4
- package/src/sap/ui/rta/enablement/elementActionTest.js +89 -15
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +46 -11
- package/src/sap/ui/rta/messagebundle_ar.properties +24 -8
- package/src/sap/ui/rta/messagebundle_bg.properties +25 -9
- package/src/sap/ui/rta/messagebundle_ca.properties +25 -9
- package/src/sap/ui/rta/messagebundle_cs.properties +24 -8
- package/src/sap/ui/rta/messagebundle_cy.properties +22 -6
- package/src/sap/ui/rta/messagebundle_da.properties +26 -10
- package/src/sap/ui/rta/messagebundle_de.properties +27 -11
- package/src/sap/ui/rta/messagebundle_el.properties +25 -9
- package/src/sap/ui/rta/messagebundle_en.properties +26 -10
- package/src/sap/ui/rta/messagebundle_en_GB.properties +26 -10
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +30 -11
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +18 -1
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +27 -11
- package/src/sap/ui/rta/messagebundle_es.properties +22 -6
- package/src/sap/ui/rta/messagebundle_es_MX.properties +20 -4
- package/src/sap/ui/rta/messagebundle_et.properties +22 -6
- package/src/sap/ui/rta/messagebundle_fi.properties +26 -10
- package/src/sap/ui/rta/messagebundle_fr.properties +23 -7
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +25 -9
- package/src/sap/ui/rta/messagebundle_hi.properties +25 -9
- package/src/sap/ui/rta/messagebundle_hr.properties +25 -9
- package/src/sap/ui/rta/messagebundle_hu.properties +18 -2
- package/src/sap/ui/rta/messagebundle_id.properties +24 -8
- package/src/sap/ui/rta/messagebundle_it.properties +25 -9
- package/src/sap/ui/rta/messagebundle_iw.properties +25 -9
- package/src/sap/ui/rta/messagebundle_ja.properties +25 -9
- package/src/sap/ui/rta/messagebundle_kk.properties +25 -9
- package/src/sap/ui/rta/messagebundle_ko.properties +25 -9
- package/src/sap/ui/rta/messagebundle_lt.properties +24 -8
- package/src/sap/ui/rta/messagebundle_lv.properties +22 -6
- package/src/sap/ui/rta/messagebundle_ms.properties +26 -10
- package/src/sap/ui/rta/messagebundle_nl.properties +26 -10
- package/src/sap/ui/rta/messagebundle_no.properties +25 -9
- package/src/sap/ui/rta/messagebundle_pl.properties +24 -8
- package/src/sap/ui/rta/messagebundle_pt.properties +25 -9
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +24 -8
- package/src/sap/ui/rta/messagebundle_ro.properties +24 -8
- package/src/sap/ui/rta/messagebundle_ru.properties +25 -9
- package/src/sap/ui/rta/messagebundle_sh.properties +26 -10
- package/src/sap/ui/rta/messagebundle_sk.properties +24 -8
- package/src/sap/ui/rta/messagebundle_sl.properties +22 -6
- package/src/sap/ui/rta/messagebundle_sv.properties +26 -10
- package/src/sap/ui/rta/messagebundle_th.properties +28 -12
- package/src/sap/ui/rta/messagebundle_tr.properties +25 -9
- package/src/sap/ui/rta/messagebundle_uk.properties +26 -10
- package/src/sap/ui/rta/messagebundle_vi.properties +25 -9
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +25 -9
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +24 -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 +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +10 -8
- package/src/sap/ui/rta/plugin/ControlVariant.js +21 -15
- package/src/sap/ui/rta/plugin/CreateContainer.js +9 -4
- 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 +3 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +3 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
- 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 +3 -3
- package/src/sap/ui/rta/plugin/RenameHandler.js +23 -5
- package/src/sap/ui/rta/plugin/Resize.js +3 -3
- package/src/sap/ui/rta/plugin/Selection.js +12 -1
- 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 +7 -3
- 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/AdditionalElementsAnalyzer.js +14 -11
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -9
- 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 +3 -3
- 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 +8 -9
- 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 +189 -0
- package/src/sap/ui/rta/service/index.js +7 -6
- package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +19 -4
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +11 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +13 -4
- package/src/sap/ui/rta/toolbar/Base.js +8 -4
- 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 +132 -0
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptationDialog.fragment.xml +79 -0
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -5
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +89 -42
- 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 +331 -0
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +27 -12
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +50 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +115 -63
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +2 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +143 -79
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +86 -180
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +87 -0
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/MoveVisualization.js +6 -4
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/RenameVisualization.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/SplitVisualization.js +6 -4
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +37 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +0 -27
|
@@ -31,7 +31,7 @@ sap.ui.define([
|
|
|
31
31
|
* @author SAP SE
|
|
32
32
|
* @experimental Since 1.58
|
|
33
33
|
* @since 1.58
|
|
34
|
-
* @version 1.
|
|
34
|
+
* @version 1.106.0
|
|
35
35
|
* @private
|
|
36
36
|
* @ui5-restricted
|
|
37
37
|
*/
|
|
@@ -96,20 +96,19 @@ sap.ui.define([
|
|
|
96
96
|
sModuleName += "/changes/";
|
|
97
97
|
sModuleName += sCodeRef.replace(/\.js/g, "");
|
|
98
98
|
var oChangeSpecificData = {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
-
selector: {
|
|
103
|
-
controllerName: sControllerName
|
|
104
|
-
},
|
|
99
|
+
codeRef: sCodeRef,
|
|
100
|
+
controllerName: sControllerName,
|
|
105
101
|
changeType: "codeExt",
|
|
102
|
+
layer: oFlexSettings.layer,
|
|
106
103
|
namespace: oFlexSettings.namespace,
|
|
107
|
-
|
|
104
|
+
reference: sReference,
|
|
105
|
+
moduleName: sModuleName,
|
|
106
|
+
generator: "rta.service.ControllerExtension"
|
|
108
107
|
};
|
|
109
108
|
|
|
110
109
|
var oPreparedChange = ChangesWriteAPI.create({changeSpecificData: oChangeSpecificData, selector: oAppComponent});
|
|
111
110
|
PersistenceWriteAPI.add({change: oPreparedChange, selector: oAppComponent});
|
|
112
|
-
return oPreparedChange.
|
|
111
|
+
return oPreparedChange.convertToFileContent();
|
|
113
112
|
},
|
|
114
113
|
|
|
115
114
|
/**
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/core/Core",
|
|
9
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
10
|
+
"sap/ui/fl/write/api/ChangesWriteAPI"
|
|
11
|
+
], function(
|
|
12
|
+
Core,
|
|
13
|
+
JsControlTreeModifier,
|
|
14
|
+
ChangesWriteAPI
|
|
15
|
+
) {
|
|
16
|
+
"use strict";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Service to register message event listeners for the communication with the
|
|
20
|
+
* Flex Support web extension.
|
|
21
|
+
*
|
|
22
|
+
* This is implemented as a service and not as part of the injected script because
|
|
23
|
+
* there is no easy way to retrieve the RuntimeAuthoring instance otherwise.
|
|
24
|
+
*
|
|
25
|
+
* @namespace
|
|
26
|
+
* @name sap.ui.rta.service.SupportTools
|
|
27
|
+
* @author SAP SE
|
|
28
|
+
* @experimental Since 1.106
|
|
29
|
+
* @since 1.106
|
|
30
|
+
* @version 1.106.0
|
|
31
|
+
* @private
|
|
32
|
+
* @ui5-restricted
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
function getPluginChangeHandler(oPlugin, oElementOverlay, oRta) {
|
|
36
|
+
var oAction = oPlugin.getAction(oElementOverlay);
|
|
37
|
+
if (oAction && oAction.changeType) {
|
|
38
|
+
var oElement = oAction.changeOnRelevantContainer
|
|
39
|
+
? oElementOverlay.getRelevantContainer()
|
|
40
|
+
: oElementOverlay.getElement();
|
|
41
|
+
return ChangesWriteAPI.getChangeHandler({
|
|
42
|
+
changeType: oAction.changeType,
|
|
43
|
+
element: oElement,
|
|
44
|
+
modifier: JsControlTreeModifier,
|
|
45
|
+
layer: oRta.getLayer()
|
|
46
|
+
})
|
|
47
|
+
.then(function(oChangeHandler) {
|
|
48
|
+
return oChangeHandler;
|
|
49
|
+
})
|
|
50
|
+
.catch(function() {
|
|
51
|
+
return;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return Promise.resolve(undefined);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function isPluginForSibling(sPluginName) {
|
|
58
|
+
if (sPluginName.endsWith(".asSibling")) {
|
|
59
|
+
return true;
|
|
60
|
+
}
|
|
61
|
+
if (sPluginName.endsWith(".asChild")) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function getPluginByName(oRta, sPluginName) {
|
|
68
|
+
var bIsSibling = isPluginForSibling(sPluginName);
|
|
69
|
+
var oAllPlugins = oRta.getPlugins();
|
|
70
|
+
return Object.values(oAllPlugins).find(function(oPlugin) {
|
|
71
|
+
var sName = oPlugin._retrievePluginName
|
|
72
|
+
? oPlugin._retrievePluginName(bIsSibling)
|
|
73
|
+
: oPlugin.getMetadata().getName();
|
|
74
|
+
return sName === sPluginName;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* Returns information about an overlay, namely:
|
|
80
|
+
* For every plugin that is part of the "editableByPlugins"
|
|
81
|
+
* aggregation, we return the plugin name and the result for
|
|
82
|
+
* isAvailable(). If the change handler can be determined, we
|
|
83
|
+
* return this information, which enables a button allowing the
|
|
84
|
+
* key user to print the change handler to the console.
|
|
85
|
+
*
|
|
86
|
+
* @method sap.ui.rta.service.SupportTools.getOverlayInfo
|
|
87
|
+
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
88
|
+
* @param {object} mPayload - Property Bag
|
|
89
|
+
* @param {string} mPayload.overlayId
|
|
90
|
+
*/
|
|
91
|
+
function getOverlayInfo(oRta, mPayload) {
|
|
92
|
+
var oOverlay = Core.byId(mPayload.overlayId);
|
|
93
|
+
var oElement = oOverlay.getElement();
|
|
94
|
+
|
|
95
|
+
return Promise.all(oOverlay.getEditableByPlugins().map(function(sPluginName) {
|
|
96
|
+
var oInstance = getPluginByName(oRta, sPluginName);
|
|
97
|
+
var bIsSibling = isPluginForSibling(sPluginName);
|
|
98
|
+
|
|
99
|
+
return getPluginChangeHandler(oInstance, oOverlay, oRta)
|
|
100
|
+
.then(function(oChangeHandler) {
|
|
101
|
+
return {
|
|
102
|
+
name: sPluginName,
|
|
103
|
+
isAvailable: oInstance.isAvailable([oOverlay], bIsSibling),
|
|
104
|
+
hasChangeHandler: !!oChangeHandler
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}))
|
|
108
|
+
.then(function(aPlugins) {
|
|
109
|
+
return {
|
|
110
|
+
elementId: oElement.getId(),
|
|
111
|
+
elementControlType: oElement.getMetadata().getName(),
|
|
112
|
+
overlayId: oOverlay.getId(),
|
|
113
|
+
plugins: aPlugins
|
|
114
|
+
};
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function printChangeHandler(oRta, mPayload) {
|
|
119
|
+
var oOverlay = Core.byId(mPayload.overlayId);
|
|
120
|
+
var oPlugin = getPluginByName(oRta, mPayload.pluginName);
|
|
121
|
+
getPluginChangeHandler(oPlugin, oOverlay, oRta)
|
|
122
|
+
.then(console.log); // eslint-disable-line no-console
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// List of supported handlers
|
|
126
|
+
var mHandlers = {
|
|
127
|
+
getOverlayInfo: {
|
|
128
|
+
handler: getOverlayInfo,
|
|
129
|
+
returnMessageType: "overlayInfo",
|
|
130
|
+
id: "ui5FlexibilitySupport.submodules.overlayInfo"
|
|
131
|
+
},
|
|
132
|
+
printChangeHandler: {
|
|
133
|
+
handler: printChangeHandler,
|
|
134
|
+
id: "ui5FlexibilitySupport.submodules.overlayInfo"
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/*
|
|
139
|
+
* Event handler for the messages sent by the support extension.
|
|
140
|
+
*
|
|
141
|
+
* Messages are contained in oEvent.data - the following properties
|
|
142
|
+
* are sent:
|
|
143
|
+
* - type: specifies, what action should be taken. Possible values:
|
|
144
|
+
* - getOverlayInfo (request information about an overlay)
|
|
145
|
+
* - printChangeHandler (a specified change handler object is to be printed to the console)
|
|
146
|
+
* - content: type-specific information, e.g. for getOverlayInfo, an 'overlayId' is provided
|
|
147
|
+
*
|
|
148
|
+
* @method sap.ui.rta.service.SupportTools.onMessageReceived
|
|
149
|
+
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
150
|
+
* @param {object} oEvent - Event thrown by the browser on received message
|
|
151
|
+
*/
|
|
152
|
+
function onMessageReceived(oRta, oEvent) {
|
|
153
|
+
if (oEvent.source !== window) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
var aHandler = Object.entries(mHandlers).find(function(aEntry) {
|
|
158
|
+
return (
|
|
159
|
+
aEntry[0] === oEvent.data.type
|
|
160
|
+
&& aEntry[1].id === oEvent.data.id
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
var mHandler = aHandler && aHandler[1];
|
|
164
|
+
|
|
165
|
+
if (mHandler) {
|
|
166
|
+
Promise.resolve(mHandler.handler(oRta, oEvent.data.content))
|
|
167
|
+
.then(function(oResult) {
|
|
168
|
+
if (mHandler.returnMessageType) {
|
|
169
|
+
oEvent.source.postMessage({
|
|
170
|
+
id: mHandler.id,
|
|
171
|
+
type: mHandler.returnMessageType,
|
|
172
|
+
content: oResult
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return function(oRta) {
|
|
180
|
+
var fnOnMessageReceivedBound = onMessageReceived.bind(null, oRta);
|
|
181
|
+
window.addEventListener("message", fnOnMessageReceivedBound);
|
|
182
|
+
|
|
183
|
+
return {
|
|
184
|
+
destroy: function() {
|
|
185
|
+
window.removeEventListener("message", fnOnMessageReceivedBound);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
});
|
|
@@ -8,11 +8,12 @@ sap.ui.define(function () {
|
|
|
8
8
|
"use strict";
|
|
9
9
|
|
|
10
10
|
return Object.freeze({
|
|
11
|
-
selection:
|
|
12
|
-
receiver:
|
|
13
|
-
controllerExtension:
|
|
14
|
-
outline:
|
|
15
|
-
action:
|
|
16
|
-
property:
|
|
11
|
+
selection: "sap.ui.rta.service.Selection",
|
|
12
|
+
receiver: "sap.ui.rta.service.Receiver",
|
|
13
|
+
controllerExtension: "sap.ui.rta.service.ControllerExtension",
|
|
14
|
+
outline: "sap.ui.rta.service.Outline",
|
|
15
|
+
action: "sap.ui.rta.service.Action",
|
|
16
|
+
property: "sap.ui.rta.service.Property",
|
|
17
|
+
supportTools: "sap.ui.rta.service.SupportTools"
|
|
17
18
|
});
|
|
18
19
|
});
|
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
@_sap_ui_rta_Toolbar_Adaptation_BtnFocusBorder: @sapUiTextInverted; //#fff
|
|
7
7
|
@_sap_ui_rta_Toolbar_Adaptation_BtnHoverBG: @sapUiSegmentedButtonHoverBackground; //#ec8b46
|
|
8
8
|
@_sap_ui_rta_Toolbar_Adaptation_BorderColor: @sapUiLightBorder; //#808080
|
|
9
|
-
@_sap_ui_rta_Toolbar_Adaptation_DraftVersionColor: @
|
|
10
|
-
@_sap_ui_rta_Toolbar_Adaptation_ActiveVersionColor: @
|
|
9
|
+
@_sap_ui_rta_Toolbar_Adaptation_DraftVersionColor: lighten(@sapUiActive, 20%); //#f5c5a3
|
|
10
|
+
@_sap_ui_rta_Toolbar_Adaptation_ActiveVersionColor: lighten(@sapUiContentHelpColor, 66%); //#b7ffb7
|
|
11
11
|
@_sap_ui_rta_Toolbar_Adaptation_BoxShadow_DarkColor: @sapUiDarkShadowTint; // #000
|
|
12
12
|
@_sap_ui_rta_Toolbar_Adaptation_BoxShadow_LightColor: @sapUiLightShadowTint; // #fff
|
|
13
13
|
@_sap_ui_rta_Toolbar_Adaptation_BtnHoverText: @sapUiTextInverted; //#fff
|
|
14
14
|
@_sap_ui_rta_Toolbar_Adaptation_SegBBtnHoverTextColor: @sapUiTextInverted; //#fff
|
|
15
15
|
@_sap_ui_rta_Toolbar_Adaptation_FocusOutlineCol: @sapUiTextInverted; //#fff
|
|
16
|
+
@_sap_ui_rta_Toolbar_Adaptation_VersionHistoryHover: darken(@_sap_ui_rta_Toolbar_Adaptation_BaseColor, 5%);
|
|
16
17
|
|
|
17
18
|
.sapUiRtaMode {
|
|
18
19
|
|
|
@@ -192,6 +193,9 @@
|
|
|
192
193
|
|
|
193
194
|
.sapUiRtaVersionsList {
|
|
194
195
|
border-bottom: 0.05rem solid @_sap_ui_rta_Toolbar_Adaptation_TextColor;
|
|
196
|
+
ul > li:first-child.sapMLIBFocusable:focus {
|
|
197
|
+
outline: none;
|
|
198
|
+
}
|
|
195
199
|
}
|
|
196
200
|
|
|
197
201
|
.sapMLIBHighlightSuccess ~ .sapMLIBContent .sapMFeedListItemTextString {
|
|
@@ -200,17 +204,19 @@
|
|
|
200
204
|
|
|
201
205
|
.sapMLIBHighlightSuccess ~ .sapMLIBContent .sapMFeedListItemInfoText,
|
|
202
206
|
.sapMLIBHighlightSuccess ~ .sapMLIBContent .sapMFeedListItemTimestampText {
|
|
203
|
-
color:
|
|
207
|
+
color: @_sap_ui_rta_Toolbar_Adaptation_ActiveVersionColor;
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
.sapMFeedListItemTextString {
|
|
207
211
|
color: @_sap_ui_rta_Toolbar_Adaptation_TextColor;
|
|
212
|
+
cursor: pointer;
|
|
208
213
|
}
|
|
209
214
|
|
|
210
215
|
.sapMFeedListItemFooter,
|
|
211
216
|
.sapMFeedListItemTimestampText,
|
|
212
217
|
.sapMFeedListItemInfoText {
|
|
213
|
-
color:
|
|
218
|
+
color: @_sap_ui_rta_Toolbar_Adaptation_TextColor;
|
|
219
|
+
cursor: pointer;
|
|
214
220
|
}
|
|
215
221
|
|
|
216
222
|
.sapMPopoverArr:after,
|
|
@@ -220,6 +226,15 @@
|
|
|
220
226
|
background-color: @_sap_ui_rta_Toolbar_Adaptation_BaseColor;
|
|
221
227
|
border: 0;
|
|
222
228
|
}
|
|
229
|
+
|
|
230
|
+
.sapMLIBFocusable:focus {
|
|
231
|
+
outline: 0.0625rem dotted @_sap_ui_rta_Toolbar_Adaptation_TextColor;
|
|
232
|
+
outline-offset: calc(-0.0625rem - 0.0625rem);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.sapMLIBHoverable:hover {
|
|
236
|
+
background: @_sap_ui_rta_Toolbar_Adaptation_VersionHistoryHover;
|
|
237
|
+
}
|
|
223
238
|
}
|
|
224
239
|
}
|
|
225
240
|
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
<Button
|
|
120
120
|
id="sapUiRta_toggleChangeVisualizationMenuButton"
|
|
121
121
|
visible="{= ${controls>/modeSwitcher} === 'visualization'}"
|
|
122
|
-
text="{visualizationModel>/
|
|
122
|
+
text="{visualizationModel>/changeCategoryText}"
|
|
123
123
|
type="Transparent"
|
|
124
124
|
icon="sap-icon://slim-arrow-down"
|
|
125
125
|
iconFirst="false"
|
|
@@ -204,6 +204,16 @@
|
|
|
204
204
|
<OverflowToolbarLayoutData priority="Low" />
|
|
205
205
|
</layoutData>
|
|
206
206
|
</MenuButton>
|
|
207
|
+
<toolbar:OverflowToolbarButton
|
|
208
|
+
id="sapUiRta_saveAsContextBasedAdaptation"
|
|
209
|
+
visible="{= (${controls>/contextBasedAdaptationVisible} && ${controls>/modeSwitcher} === 'adaptation')}"
|
|
210
|
+
press=".saveAsContextBasedAdaptation"
|
|
211
|
+
type="Transparent"
|
|
212
|
+
text="{i18n>BTN_SAVE_AS}" >
|
|
213
|
+
<toolbar:layoutData>
|
|
214
|
+
<OverflowToolbarLayoutData priority="Low" />
|
|
215
|
+
</toolbar:layoutData>
|
|
216
|
+
</toolbar:OverflowToolbarButton>
|
|
207
217
|
<toolbar:OverflowToolbarButton
|
|
208
218
|
id="sapUiRta_saveAs"
|
|
209
219
|
visible="{= (${controls>/saveAsVisible} && ${controls>/modeSwitcher} === 'adaptation')}"
|
|
@@ -7,19 +7,23 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/core/Fragment",
|
|
9
9
|
"sap/ui/fl/write/api/Version",
|
|
10
|
+
"sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptation",
|
|
10
11
|
"sap/ui/rta/toolbar/translation/Translation",
|
|
11
12
|
"sap/ui/rta/toolbar/versioning/Versioning",
|
|
12
13
|
"sap/ui/rta/appVariant/Feature",
|
|
13
14
|
"sap/ui/rta/toolbar/Base",
|
|
14
|
-
"sap/ui/Device"
|
|
15
|
+
"sap/ui/Device",
|
|
16
|
+
"./AdaptationRenderer"
|
|
15
17
|
], function(
|
|
16
18
|
Fragment,
|
|
17
19
|
Version,
|
|
20
|
+
SaveAsContextBasedAdaptation,
|
|
18
21
|
Translation,
|
|
19
22
|
Versioning,
|
|
20
23
|
AppVariantFeature,
|
|
21
24
|
Base,
|
|
22
|
-
Device
|
|
25
|
+
Device,
|
|
26
|
+
AdaptationRenderer
|
|
23
27
|
) {
|
|
24
28
|
"use strict";
|
|
25
29
|
|
|
@@ -31,7 +35,7 @@ sap.ui.define([
|
|
|
31
35
|
* @extends sap.ui.rta.toolbar.Base
|
|
32
36
|
*
|
|
33
37
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
38
|
+
* @version 1.106.0
|
|
35
39
|
*
|
|
36
40
|
* @constructor
|
|
37
41
|
* @private
|
|
@@ -40,7 +44,7 @@ sap.ui.define([
|
|
|
40
44
|
* @experimental Since 1.48. This class is experimental. API might be changed in future.
|
|
41
45
|
*/
|
|
42
46
|
var Adaptation = Base.extend("sap.ui.rta.toolbar.Adaptation", {
|
|
43
|
-
renderer:
|
|
47
|
+
renderer: AdaptationRenderer,
|
|
44
48
|
animation: true,
|
|
45
49
|
metadata: {
|
|
46
50
|
library: "sap.ui.rta",
|
|
@@ -205,6 +209,7 @@ sap.ui.define([
|
|
|
205
209
|
manageApps: onManageAppsPressed.bind(this),
|
|
206
210
|
appVariantOverview: onOverviewPressed.bind(this),
|
|
207
211
|
saveAs: onSaveAsPressed.bind(this),
|
|
212
|
+
saveAsContextBasedAdaptation: onSaveAsContextBasedAdaptation.bind(this),
|
|
208
213
|
formatSaveAsEnabled: formatSaveAsEnabled,
|
|
209
214
|
restore: this.eventHandler.bind(this, "Restore"),
|
|
210
215
|
publish: this.eventHandler.bind(this, "Transport"),
|
|
@@ -237,6 +242,10 @@ sap.ui.define([
|
|
|
237
242
|
AppVariantFeature.onSaveAs(true, true, this.getRtaInformation().flexSettings.layer, null);
|
|
238
243
|
}
|
|
239
244
|
|
|
245
|
+
function onSaveAsContextBasedAdaptation() {
|
|
246
|
+
this.getExtension("adaptation", SaveAsContextBasedAdaptation).openAddAdaptationDialog(this.getRtaInformation().flexSettings.layer);
|
|
247
|
+
}
|
|
248
|
+
|
|
240
249
|
function onOverviewPressed(oEvent) {
|
|
241
250
|
var oItem = oEvent.getParameter("item");
|
|
242
251
|
var bTriggeredForKeyUser = oItem.getId().endsWith("keyUser");
|
|
@@ -8,12 +8,14 @@ sap.ui.define([
|
|
|
8
8
|
"sap/m/HBox",
|
|
9
9
|
"sap/ui/dt/util/ZIndexManager",
|
|
10
10
|
"sap/ui/model/resource/ResourceModel",
|
|
11
|
-
"sap/ui/rta/util/Animation"
|
|
11
|
+
"sap/ui/rta/util/Animation",
|
|
12
|
+
"./BaseRenderer"
|
|
12
13
|
], function(
|
|
13
14
|
HBox,
|
|
14
15
|
ZIndexManager,
|
|
15
16
|
ResourceModel,
|
|
16
|
-
Animation
|
|
17
|
+
Animation,
|
|
18
|
+
BaseRenderer
|
|
17
19
|
) {
|
|
18
20
|
"use strict";
|
|
19
21
|
|
|
@@ -25,7 +27,7 @@ sap.ui.define([
|
|
|
25
27
|
* @extends sap.m.HBox
|
|
26
28
|
*
|
|
27
29
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
30
|
+
* @version 1.106.0
|
|
29
31
|
*
|
|
30
32
|
* @constructor
|
|
31
33
|
* @private
|
|
@@ -85,7 +87,9 @@ sap.ui.define([
|
|
|
85
87
|
* added/removed during show/hide calls.
|
|
86
88
|
* @type {boolean}
|
|
87
89
|
*/
|
|
88
|
-
animation: false
|
|
90
|
+
animation: false,
|
|
91
|
+
|
|
92
|
+
renderer: BaseRenderer
|
|
89
93
|
});
|
|
90
94
|
|
|
91
95
|
/**
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/base/ManagedObject",
|
|
9
|
+
"sap/ui/core/Fragment",
|
|
10
|
+
"sap/ui/fl/Layer",
|
|
11
|
+
"sap/ui/fl/write/api/ContextSharingAPI",
|
|
12
|
+
"sap/ui/rta/Utils",
|
|
13
|
+
"sap/ui/model/Binding"
|
|
14
|
+
], function (
|
|
15
|
+
ManagedObject,
|
|
16
|
+
Fragment,
|
|
17
|
+
Layer,
|
|
18
|
+
ContextSharingAPI,
|
|
19
|
+
Utils,
|
|
20
|
+
Binding
|
|
21
|
+
) {
|
|
22
|
+
"use strict";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Controller for the <code>sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation</code> controls.
|
|
26
|
+
* Contains implementation of context-based-adaptation functionality.
|
|
27
|
+
*
|
|
28
|
+
* @class
|
|
29
|
+
*
|
|
30
|
+
* @author SAP SE
|
|
31
|
+
* @version 1.106.0
|
|
32
|
+
*
|
|
33
|
+
* @constructor
|
|
34
|
+
* @private
|
|
35
|
+
* @since 1.106
|
|
36
|
+
* @alias sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation
|
|
37
|
+
*/
|
|
38
|
+
var SaveAsContextBasedAdaptation = ManagedObject.extend("sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation", {
|
|
39
|
+
metadata: {
|
|
40
|
+
properties: {
|
|
41
|
+
toolbar: {
|
|
42
|
+
type: "any" // "sap.ui.rta.toolbar.Base"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
constructor: function () {
|
|
47
|
+
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
48
|
+
this.oTextResources = this.getToolbar().getTextResources();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
SaveAsContextBasedAdaptation.prototype.openAddAdaptationDialog = function (sLayer) {
|
|
53
|
+
if (!this._oAddAdaptationDialogPromise) {
|
|
54
|
+
this._oAddAdaptationDialogPromise = Fragment.load({
|
|
55
|
+
name: "sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptationDialog",
|
|
56
|
+
id: this.getToolbar().getId() + "_fragment--sapUiRta_addAdaptationDialog",
|
|
57
|
+
controller: {
|
|
58
|
+
onAdaptationTitleChange: function (oEvent) {
|
|
59
|
+
this.sAdaptationTitle = oEvent.getParameter("value");
|
|
60
|
+
_validateAddAdaptationInput.call(this);
|
|
61
|
+
}.bind(this),
|
|
62
|
+
// TODO: implementation of save as context based adaptation
|
|
63
|
+
onSaveAsContextBasedAdaptation: function () {
|
|
64
|
+
},
|
|
65
|
+
onCancelContextBasedAdaptationDialog: function () {
|
|
66
|
+
_clearContexts.call(this);
|
|
67
|
+
this._oAddAdaptationDialog.close();
|
|
68
|
+
}.bind(this)
|
|
69
|
+
}
|
|
70
|
+
}).then(function (oDialog) {
|
|
71
|
+
this._oAddAdaptationDialog = oDialog;
|
|
72
|
+
oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
73
|
+
this.getToolbar().addDependent(this._oAddAdaptationDialog);
|
|
74
|
+
createContextSharingComponent.call(this, sLayer);
|
|
75
|
+
}.bind(this));
|
|
76
|
+
} else {
|
|
77
|
+
this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-title-input").setValue("");
|
|
78
|
+
}
|
|
79
|
+
return this._oAddAdaptationDialogPromise.then(function () {
|
|
80
|
+
return this._oAddAdaptationDialog.open();
|
|
81
|
+
}.bind(this));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
function createContextSharingComponent(sLayer) {
|
|
85
|
+
var mPropertyBag = { layer: sLayer || Layer.CUSTOMER, isAppContext: true };
|
|
86
|
+
return ContextSharingAPI.createComponent(mPropertyBag).then(function (oContextSharingComponent) {
|
|
87
|
+
this._oContextComponent = oContextSharingComponent;
|
|
88
|
+
this._oContextComponentInstance = oContextSharingComponent.getComponentInstance();
|
|
89
|
+
this._oContextComponentInstance.setSelectedContexts({ role: [] });
|
|
90
|
+
this._oAddAdaptationDialog.addContent(this._oContextComponent);
|
|
91
|
+
var oSelectedContextsModel = this._oContextComponentInstance.getSelectedContextsModel();
|
|
92
|
+
this.oSelectedContextsBinding = new Binding(oSelectedContextsModel, "/", oSelectedContextsModel.getContext("/"));
|
|
93
|
+
this.oSelectedContextsBinding.attachChange(onSelectedContextsChange.bind(this));
|
|
94
|
+
}.bind(this));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function onSelectedContextsChange() {
|
|
98
|
+
this.aSelectedRoles = this._oContextComponentInstance.getSelectedContexts().role;
|
|
99
|
+
_validateAddAdaptationInput.call(this);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function _validateAddAdaptationInput() {
|
|
103
|
+
if (getAdaptationTitle.call(this).length > 0 && getSelectedContexts.call(this).length > 0) {
|
|
104
|
+
_enableSaveAsButton.call(this, true);
|
|
105
|
+
} else {
|
|
106
|
+
_enableSaveAsButton.call(this, false);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function getAdaptationTitle() {
|
|
111
|
+
return this.sAdaptationTitle || "";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function getSelectedContexts() {
|
|
115
|
+
return this.aSelectedRoles || [];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function _enableSaveAsButton(bEnable) {
|
|
119
|
+
this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-saveButton").setEnabled(bEnable);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function _clearContexts() {
|
|
123
|
+
if (this._oContextComponentInstance) {
|
|
124
|
+
if (this._oContextComponent.isDestroyed()) {
|
|
125
|
+
return createContextSharingComponent.call(this);
|
|
126
|
+
}
|
|
127
|
+
this._oContextComponentInstance.setSelectedContexts({ role: [] });
|
|
128
|
+
this._oAddAdaptationDialog.addContent(this._oContextComponent);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return SaveAsContextBasedAdaptation;
|
|
132
|
+
});
|