@openui5/sap.ui.rta 1.115.1 → 1.117.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/.eslintrc.json +33 -2
- package/.reuse/dep5 +0 -5
- package/THIRDPARTY.txt +1 -7
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +60 -59
- package/src/sap/ui/rta/RuntimeAuthoring.js +256 -254
- package/src/sap/ui/rta/Utils.js +42 -42
- package/src/sap/ui/rta/api/startAdaptation.js +2 -2
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +3 -3
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +27 -27
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +100 -103
- package/src/sap/ui/rta/appVariant/Feature.js +75 -77
- package/src/sap/ui/rta/appVariant/S4HanaCloudBackend.js +6 -7
- package/src/sap/ui/rta/appVariant/Utils.js +17 -17
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +36 -36
- package/src/sap/ui/rta/command/AddIFrame.js +7 -7
- package/src/sap/ui/rta/command/AddProperty.js +7 -7
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +7 -7
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +18 -18
- package/src/sap/ui/rta/command/BaseCommand.js +1 -2
- 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 +11 -11
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +28 -3
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +26 -24
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +7 -7
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +11 -11
- package/src/sap/ui/rta/command/CreateContainer.js +2 -2
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +30 -30
- package/src/sap/ui/rta/command/LREPSerializer.js +20 -10
- 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 +4 -4
- 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 +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/TestDelegate.js +92 -92
- package/src/sap/ui/rta/enablement/elementActionTest.js +230 -112
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +11 -1
- package/src/sap/ui/rta/messagebundle_ar.properties +5 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ca.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cs.properties +5 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +5 -0
- package/src/sap/ui/rta/messagebundle_da.properties +5 -0
- package/src/sap/ui/rta/messagebundle_de.properties +6 -1
- package/src/sap/ui/rta/messagebundle_el.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es.properties +5 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -0
- package/src/sap/ui/rta/messagebundle_et.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_hu.properties +5 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -0
- package/src/sap/ui/rta/messagebundle_it.properties +5 -0
- package/src/sap/ui/rta/messagebundle_iw.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ja.properties +5 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_lv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -0
- package/src/sap/ui/rta/messagebundle_nl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_no.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt.properties +5 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +5 -0
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +5 -0
- package/src/sap/ui/rta/messagebundle_sv.properties +5 -0
- package/src/sap/ui/rta/messagebundle_th.properties +5 -0
- package/src/sap/ui/rta/messagebundle_tr.properties +5 -0
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -0
- package/src/sap/ui/rta/messagebundle_vi.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -0
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +5 -0
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +44 -44
- package/src/sap/ui/rta/plugin/BaseCreate.js +29 -29
- package/src/sap/ui/rta/plugin/Combine.js +9 -9
- package/src/sap/ui/rta/plugin/ControlVariant.js +21 -21
- package/src/sap/ui/rta/plugin/CreateContainer.js +6 -6
- package/src/sap/ui/rta/plugin/CutPaste.js +46 -46
- package/src/sap/ui/rta/plugin/DragDrop.js +2 -2
- package/src/sap/ui/rta/plugin/EasyAdd.js +4 -4
- package/src/sap/ui/rta/plugin/EasyRemove.js +5 -5
- package/src/sap/ui/rta/plugin/LocalReset.js +25 -25
- package/src/sap/ui/rta/plugin/Plugin.js +20 -20
- package/src/sap/ui/rta/plugin/RTAElementMover.js +42 -42
- package/src/sap/ui/rta/plugin/Remove.js +11 -11
- package/src/sap/ui/rta/plugin/Rename.js +7 -7
- package/src/sap/ui/rta/plugin/RenameHandler.js +17 -17
- package/src/sap/ui/rta/plugin/Resize.js +62 -62
- package/src/sap/ui/rta/plugin/Selection.js +14 -14
- package/src/sap/ui/rta/plugin/Settings.js +20 -20
- package/src/sap/ui/rta/plugin/Split.js +7 -7
- package/src/sap/ui/rta/plugin/Stretch.js +4 -4
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +94 -87
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +18 -18
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +98 -99
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +144 -144
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +67 -67
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +38 -39
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +1 -0
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +29 -29
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +5 -5
- package/src/sap/ui/rta/plugin/iframe/urlCleaner.js +1 -1
- package/src/sap/ui/rta/service/Action.js +36 -37
- package/src/sap/ui/rta/service/ControllerExtension.js +4 -4
- package/src/sap/ui/rta/service/Outline.js +59 -59
- package/src/sap/ui/rta/service/Property.js +125 -125
- package/src/sap/ui/rta/service/Receiver.js +78 -77
- package/src/sap/ui/rta/service/Selection.js +6 -6
- package/src/sap/ui/rta/service/SupportTools.js +188 -37
- package/src/sap/ui/rta/service/index.js +1 -1
- package/src/sap/ui/rta/themes/base/FlexSupportExtension.less +14 -0
- package/src/sap/ui/rta/themes/base/library.source.less +2 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +81 -26
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +1 -1
- package/src/sap/ui/rta/toolbar/Base.js +17 -15
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +1 -2
- package/src/sap/ui/rta/toolbar/Fiori.js +8 -8
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +4 -4
- package/src/sap/ui/rta/toolbar/Personalization.js +2 -2
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptations.js +13 -6
- package/src/sap/ui/rta/toolbar/contextBased/ManageAdaptationsDialog.fragment.xml +2 -8
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +2 -3
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptationDialog.fragment.xml +0 -2
- package/src/sap/ui/rta/toolbar/translation/Translation.js +41 -41
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +9 -9
- package/src/sap/ui/rta/util/Animation.js +5 -5
- package/src/sap/ui/rta/util/BindingsExtractor.js +33 -33
- package/src/sap/ui/rta/util/PluginManager.js +25 -25
- package/src/sap/ui/rta/util/PopupManager.js +27 -27
- package/src/sap/ui/rta/util/ReloadManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +3 -4
- package/src/sap/ui/rta/util/StylesLoader.js +9 -9
- package/src/sap/ui/rta/util/UrlParser.js +19 -19
- package/src/sap/ui/rta/util/adaptationStarter.js +34 -31
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +23 -19
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +61 -61
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +76 -63
- package/src/sap/ui/rta/util/changeVisualization/commands/CombineVisualization.js +6 -6
- package/src/sap/ui/rta/util/changeVisualization/commands/CreateContainerVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/hasStableId.js +2 -2
- package/src/sap/ui/rta/util/showMessageBox.js +4 -5
- package/src/sap/ui/rta/util/validateFlexEnabled.js +5 -5
- package/src/sap/ui/rta/util/validateStableIds.js +8 -8
- package/ui5.yaml +1 -1
|
@@ -7,10 +7,12 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/core/Core",
|
|
9
9
|
"sap/ui/core/util/reflection/JsControlTreeModifier",
|
|
10
|
+
"sap/ui/dt/OverlayRegistry",
|
|
10
11
|
"sap/ui/fl/write/api/ChangesWriteAPI"
|
|
11
12
|
], function(
|
|
12
13
|
Core,
|
|
13
14
|
JsControlTreeModifier,
|
|
15
|
+
OverlayRegistry,
|
|
14
16
|
ChangesWriteAPI
|
|
15
17
|
) {
|
|
16
18
|
"use strict";
|
|
@@ -27,11 +29,13 @@ sap.ui.define([
|
|
|
27
29
|
* @author SAP SE
|
|
28
30
|
* @experimental Since 1.106
|
|
29
31
|
* @since 1.106
|
|
30
|
-
* @version 1.
|
|
32
|
+
* @version 1.117.0
|
|
31
33
|
* @private
|
|
32
34
|
* @ui5-restricted
|
|
33
35
|
*/
|
|
34
36
|
|
|
37
|
+
var sHighlightClass = "sapUiFlexibilitySupportExtension_Selected";
|
|
38
|
+
|
|
35
39
|
function getPluginChangeHandler(oPlugin, oElementOverlay, oRta) {
|
|
36
40
|
var oAction = oPlugin.getAction(oElementOverlay);
|
|
37
41
|
if (oAction && oAction.changeType) {
|
|
@@ -44,12 +48,12 @@ sap.ui.define([
|
|
|
44
48
|
modifier: JsControlTreeModifier,
|
|
45
49
|
layer: oRta.getLayer()
|
|
46
50
|
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
.then(function(oChangeHandler) {
|
|
52
|
+
return oChangeHandler;
|
|
53
|
+
})
|
|
54
|
+
.catch(function() {
|
|
55
|
+
return;
|
|
56
|
+
});
|
|
53
57
|
}
|
|
54
58
|
return Promise.resolve(undefined);
|
|
55
59
|
}
|
|
@@ -75,51 +79,162 @@ sap.ui.define([
|
|
|
75
79
|
});
|
|
76
80
|
}
|
|
77
81
|
|
|
82
|
+
/*
|
|
83
|
+
* Removes the highlighting of a non-selectable overlay
|
|
84
|
+
*/
|
|
85
|
+
function removeSelectionHighlight() {
|
|
86
|
+
var aHighlightedDom = document.getElementsByClassName(sHighlightClass);
|
|
87
|
+
if (aHighlightedDom.length > 0) {
|
|
88
|
+
aHighlightedDom[0].classList.remove(sHighlightClass);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
78
92
|
/*
|
|
79
93
|
* Returns information about an overlay, namely:
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
94
|
+
* For every plugin that is part of the "editableByPlugins"
|
|
95
|
+
* aggregation, we return the plugin name and the result for
|
|
96
|
+
* isAvailable(). If the change handler can be determined, we
|
|
97
|
+
* return this information, which enables a button allowing the
|
|
98
|
+
* key user to print the change handler to the console.
|
|
85
99
|
*
|
|
86
|
-
* @method sap.ui.rta.service.SupportTools.getOverlayInfo
|
|
87
100
|
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
88
101
|
* @param {object} mPayload - Property Bag
|
|
89
102
|
* @param {string} mPayload.overlayId
|
|
90
103
|
*/
|
|
91
104
|
function getOverlayInfo(oRta, mPayload) {
|
|
92
105
|
var oOverlay = Core.byId(mPayload.overlayId);
|
|
106
|
+
if (!oOverlay) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
93
109
|
var oElement = oOverlay.getElement();
|
|
94
110
|
|
|
111
|
+
// remove previous selection highlighting on clicking in the app
|
|
112
|
+
if (oOverlay.getSelectable()) {
|
|
113
|
+
removeSelectionHighlight();
|
|
114
|
+
}
|
|
115
|
+
|
|
95
116
|
return Promise.all(oOverlay.getEditableByPlugins().map(function(sPluginName) {
|
|
96
117
|
var oInstance = getPluginByName(oRta, sPluginName);
|
|
97
118
|
var bIsSibling = isPluginForSibling(sPluginName);
|
|
98
119
|
|
|
99
120
|
return getPluginChangeHandler(oInstance, oOverlay, oRta)
|
|
100
|
-
|
|
101
|
-
return {
|
|
102
|
-
name: sPluginName,
|
|
103
|
-
isAvailable: oInstance.isAvailable([oOverlay], bIsSibling),
|
|
104
|
-
hasChangeHandler: !!oChangeHandler
|
|
105
|
-
};
|
|
106
|
-
});
|
|
107
|
-
}))
|
|
108
|
-
.then(function(aPlugins) {
|
|
121
|
+
.then(function(oChangeHandler) {
|
|
109
122
|
return {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
plugins: aPlugins
|
|
123
|
+
name: sPluginName,
|
|
124
|
+
isAvailable: oInstance.isAvailable([oOverlay], bIsSibling),
|
|
125
|
+
hasChangeHandler: !!oChangeHandler
|
|
114
126
|
};
|
|
115
127
|
});
|
|
128
|
+
}))
|
|
129
|
+
.then(function(aPlugins) {
|
|
130
|
+
return {
|
|
131
|
+
elementId: oElement.getId(),
|
|
132
|
+
elementControlType: oElement.getMetadata().getName(),
|
|
133
|
+
overlayId: oOverlay.getId(),
|
|
134
|
+
plugins: aPlugins
|
|
135
|
+
};
|
|
136
|
+
});
|
|
116
137
|
}
|
|
117
138
|
|
|
139
|
+
/*
|
|
140
|
+
* Prints the change handler to the console
|
|
141
|
+
*
|
|
142
|
+
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
143
|
+
* @param {object} mPayload - Property Bag
|
|
144
|
+
* @param {string} mPayload.overlayId
|
|
145
|
+
* @param {string} mPayload.pluginName
|
|
146
|
+
*/
|
|
118
147
|
function printChangeHandler(oRta, mPayload) {
|
|
119
148
|
var oOverlay = Core.byId(mPayload.overlayId);
|
|
120
149
|
var oPlugin = getPluginByName(oRta, mPayload.pluginName);
|
|
121
150
|
getPluginChangeHandler(oPlugin, oOverlay, oRta)
|
|
122
|
-
|
|
151
|
+
.then(console.log); // eslint-disable-line no-console
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/*
|
|
155
|
+
* Closes the ContextMenu of the UI-Adaptation (if open)
|
|
156
|
+
* This method is called when user selects a non-selectable
|
|
157
|
+
* Overlay in Flex Support web extension (Overlay section)
|
|
158
|
+
*
|
|
159
|
+
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
160
|
+
*/
|
|
161
|
+
function closeContextMenu(oRta) {
|
|
162
|
+
if (document.getElementsByClassName("sapUiDtContextMenu").length > 0) {
|
|
163
|
+
var oContextMenu = oRta.getPlugins().contextMenu;
|
|
164
|
+
oContextMenu.oContextMenuControl.close();
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/*
|
|
169
|
+
* Changes the focus/selection in UI-Adaptation
|
|
170
|
+
* This method is called when user selects an entry in
|
|
171
|
+
* the overlay table of the Flex Support web extension (Overlay Info Section)
|
|
172
|
+
*
|
|
173
|
+
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
174
|
+
* @param {object} mPayload - Property Bag
|
|
175
|
+
* @param {string} mPayload.overlayId - ID of the Overlay
|
|
176
|
+
*/
|
|
177
|
+
function changeOverlaySelection(oRta, mPayload) {
|
|
178
|
+
// set new focus and enforce collecting overlay info data
|
|
179
|
+
var oOverlay = Core.byId(mPayload.overlayId);
|
|
180
|
+
oOverlay.focus();
|
|
181
|
+
window.postMessage({
|
|
182
|
+
type: "getOverlayInfo",
|
|
183
|
+
id: "ui5FlexibilitySupport.submodules.overlayInfo",
|
|
184
|
+
content: {
|
|
185
|
+
overlayId: oOverlay.getId()
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
// remove previous selection highlighting
|
|
190
|
+
removeSelectionHighlight();
|
|
191
|
+
// close the contextmenu in UI-Adaptation
|
|
192
|
+
closeContextMenu(oRta);
|
|
193
|
+
|
|
194
|
+
// set new selection (selectable overlays)
|
|
195
|
+
if (oOverlay.getSelectable()) {
|
|
196
|
+
oOverlay.setSelected(true);
|
|
197
|
+
} else {
|
|
198
|
+
// remove current selection(s)
|
|
199
|
+
var aSelection = oRta.getSelection();
|
|
200
|
+
aSelection.forEach(function(oSelectedOverlay) {
|
|
201
|
+
oSelectedOverlay.setSelected(false);
|
|
202
|
+
});
|
|
203
|
+
// highlight unselectable overlay
|
|
204
|
+
if (oOverlay.getDomRef()) {
|
|
205
|
+
oOverlay.getDomRef().classList.add("sapUiFlexibilitySupportExtension_Selected");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/*
|
|
211
|
+
* Collects all relevant data for the overlay table in
|
|
212
|
+
* Flex Support web extension (Overlay section)
|
|
213
|
+
* This method is called during initialization of the
|
|
214
|
+
* Overlay section and on pressing the "Reload" button
|
|
215
|
+
*/
|
|
216
|
+
function collectOverlayTableData() {
|
|
217
|
+
// create an array with all relevant overlays (no aggregation overlays)
|
|
218
|
+
var aAllOverlays = OverlayRegistry.getOverlays();
|
|
219
|
+
var aRelevantOverlayList = [];
|
|
220
|
+
aAllOverlays.forEach(function(oOverlay) {
|
|
221
|
+
if (!oOverlay.isA("sap.ui.dt.AggregationOverlay")) {
|
|
222
|
+
var sParentId = oOverlay.getParentElementOverlay()?.getId();
|
|
223
|
+
var aChildren = oOverlay.getChildren().map(function(oChild) {
|
|
224
|
+
return oChild.getId();
|
|
225
|
+
});
|
|
226
|
+
aRelevantOverlayList.push({
|
|
227
|
+
id: oOverlay.getId(),
|
|
228
|
+
parentId: sParentId,
|
|
229
|
+
elementId: oOverlay.getElement().getId(),
|
|
230
|
+
visible: oOverlay.getSelectable() && oOverlay.isVisible(),
|
|
231
|
+
idNum: parseInt(oOverlay.getId().replace("__overlay", "")),
|
|
232
|
+
children: aChildren,
|
|
233
|
+
hasParent: sParentId !== undefined
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
return aRelevantOverlayList;
|
|
123
238
|
}
|
|
124
239
|
|
|
125
240
|
function printDesignTimeMetadata(oRta, mPayload) {
|
|
@@ -141,9 +256,44 @@ sap.ui.define([
|
|
|
141
256
|
printDesignTimeMetadata: {
|
|
142
257
|
handler: printDesignTimeMetadata,
|
|
143
258
|
id: "ui5FlexibilitySupport.submodules.overlayInfo"
|
|
259
|
+
},
|
|
260
|
+
changeOverlaySelection: {
|
|
261
|
+
handler: changeOverlaySelection,
|
|
262
|
+
id: "ui5FlexibilitySupport.submodules.overlayInfo"
|
|
263
|
+
},
|
|
264
|
+
collectOverlayTableData: {
|
|
265
|
+
handler: collectOverlayTableData,
|
|
266
|
+
returnMessageType: "overlayInfoTableData",
|
|
267
|
+
id: "ui5FlexibilitySupport.submodules.overlayInfo"
|
|
144
268
|
}
|
|
145
269
|
};
|
|
146
270
|
|
|
271
|
+
/*
|
|
272
|
+
* Handler method for the Rta event "stop"
|
|
273
|
+
* sends a corresponding message to the
|
|
274
|
+
* Flex Support web extension (Overlay section)
|
|
275
|
+
*/
|
|
276
|
+
function onRtaStop() {
|
|
277
|
+
window.postMessage({
|
|
278
|
+
type: "rtaStopped",
|
|
279
|
+
id: "ui5FlexibilitySupport.submodules.overlayInfo",
|
|
280
|
+
content: {}
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/*
|
|
285
|
+
* Sends a message to the Flex Support
|
|
286
|
+
* web extension (Overlay section) that
|
|
287
|
+
* UI Adaption has started
|
|
288
|
+
*/
|
|
289
|
+
function onRtaStart() {
|
|
290
|
+
window.postMessage({
|
|
291
|
+
type: "rtaStarted",
|
|
292
|
+
id: "ui5FlexibilitySupport.submodules.overlayInfo",
|
|
293
|
+
content: {}
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
|
|
147
297
|
/*
|
|
148
298
|
* Event handler for the messages sent by the support extension.
|
|
149
299
|
*
|
|
@@ -155,7 +305,6 @@ sap.ui.define([
|
|
|
155
305
|
* - printDesignTimeMetadata (the calculated designtime metadata of the overlay is to be printed to the console)
|
|
156
306
|
* - content: type-specific information, e.g. for getOverlayInfo, an 'overlayId' is provided
|
|
157
307
|
*
|
|
158
|
-
* @method sap.ui.rta.service.SupportTools.onMessageReceived
|
|
159
308
|
* @param {sap.ui.rta.RuntimeAuthoring} oRta - Instance of the RuntimeAuthoring class
|
|
160
309
|
* @param {object} oEvent - Event thrown by the browser on received message
|
|
161
310
|
*/
|
|
@@ -174,21 +323,23 @@ sap.ui.define([
|
|
|
174
323
|
|
|
175
324
|
if (mHandler) {
|
|
176
325
|
Promise.resolve(mHandler.handler(oRta, oEvent.data.content))
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
326
|
+
.then(function(oResult) {
|
|
327
|
+
if (mHandler.returnMessageType) {
|
|
328
|
+
oEvent.source.postMessage({
|
|
329
|
+
id: mHandler.id,
|
|
330
|
+
type: mHandler.returnMessageType,
|
|
331
|
+
content: oResult
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
});
|
|
186
335
|
}
|
|
187
336
|
}
|
|
188
337
|
|
|
189
338
|
return function(oRta) {
|
|
190
339
|
var fnOnMessageReceivedBound = onMessageReceived.bind(null, oRta);
|
|
191
340
|
window.addEventListener("message", fnOnMessageReceivedBound);
|
|
341
|
+
oRta.attachEventOnce("stop", onRtaStop);
|
|
342
|
+
onRtaStart();
|
|
192
343
|
|
|
193
344
|
return {
|
|
194
345
|
destroy: function() {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/******************************************************************
|
|
2
|
+
Style used by flex support chrome extension - base Theme
|
|
3
|
+
*******************************************************************/
|
|
4
|
+
.sapUiFlexibilitySupportExtension_Selected {
|
|
5
|
+
box-shadow: @sapUiUx3ToolPopupShadow;
|
|
6
|
+
&:after {
|
|
7
|
+
content: " ";
|
|
8
|
+
background: @sapUiMessageSuccessBorderColor;
|
|
9
|
+
opacity: 0.40;
|
|
10
|
+
border-radius: @sapUiButtonBorderCornerRadius;
|
|
11
|
+
outline: 0.125rem solid @sapUiSelected; //1px
|
|
12
|
+
outline-offset: -0.125rem; //1px
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"./AdaptationRenderer",
|
|
9
9
|
"sap/base/Log",
|
|
10
|
-
"sap/m/MessageBox",
|
|
11
10
|
"sap/ui/core/BusyIndicator",
|
|
12
11
|
"sap/ui/core/Fragment",
|
|
13
12
|
"sap/ui/core/Popup",
|
|
@@ -15,18 +14,17 @@ sap.ui.define([
|
|
|
15
14
|
"sap/ui/fl/write/api/ContextBasedAdaptationsAPI",
|
|
16
15
|
"sap/ui/fl/write/api/Version",
|
|
17
16
|
"sap/ui/model/json/JSONModel",
|
|
18
|
-
"sap/ui/model/resource/ResourceModel",
|
|
19
17
|
"sap/ui/rta/appVariant/Feature",
|
|
20
18
|
"sap/ui/rta/toolbar/Base",
|
|
21
19
|
"sap/ui/rta/toolbar/contextBased/ManageAdaptations",
|
|
22
20
|
"sap/ui/rta/toolbar/contextBased/SaveAsAdaptation",
|
|
23
21
|
"sap/ui/rta/toolbar/translation/Translation",
|
|
24
22
|
"sap/ui/rta/toolbar/versioning/Versioning",
|
|
25
|
-
"sap/ui/rta/Utils"
|
|
23
|
+
"sap/ui/rta/Utils",
|
|
24
|
+
"sap/m/MessageBox"
|
|
26
25
|
], function(
|
|
27
26
|
AdaptationRenderer,
|
|
28
27
|
Log,
|
|
29
|
-
MessageBox,
|
|
30
28
|
BusyIndicator,
|
|
31
29
|
Fragment,
|
|
32
30
|
Popup,
|
|
@@ -34,14 +32,14 @@ sap.ui.define([
|
|
|
34
32
|
ContextBasedAdaptationsAPI,
|
|
35
33
|
Version,
|
|
36
34
|
JSONModel,
|
|
37
|
-
ResourceModel,
|
|
38
35
|
AppVariantFeature,
|
|
39
36
|
Base,
|
|
40
37
|
ManageAdaptations,
|
|
41
38
|
SaveAsAdaptation,
|
|
42
39
|
Translation,
|
|
43
40
|
Versioning,
|
|
44
|
-
Utils
|
|
41
|
+
Utils,
|
|
42
|
+
MessageBox
|
|
45
43
|
) {
|
|
46
44
|
"use strict";
|
|
47
45
|
|
|
@@ -53,7 +51,7 @@ sap.ui.define([
|
|
|
53
51
|
* @extends sap.ui.rta.toolbar.Base
|
|
54
52
|
*
|
|
55
53
|
* @author SAP SE
|
|
56
|
-
* @version 1.
|
|
54
|
+
* @version 1.117.0
|
|
57
55
|
*
|
|
58
56
|
* @constructor
|
|
59
57
|
* @private
|
|
@@ -108,7 +106,7 @@ sap.ui.define([
|
|
|
108
106
|
|
|
109
107
|
Adaptation.prototype._calculateWindowWidth = function(aEntries) {
|
|
110
108
|
var iSectionWidth = aEntries[0].intersectionRect.width;
|
|
111
|
-
return (iSectionWidth * 2) + this._iSwitcherToolbarWidth + 80/*toolbar padding*/;
|
|
109
|
+
return (iSectionWidth * 2) + this._iSwitcherToolbarWidth + 80/* toolbar padding */;
|
|
112
110
|
};
|
|
113
111
|
|
|
114
112
|
Adaptation.prototype.onFragmentLoaded = function() {
|
|
@@ -132,7 +130,7 @@ sap.ui.define([
|
|
|
132
130
|
}
|
|
133
131
|
};
|
|
134
132
|
|
|
135
|
-
Adaptation.prototype._onResize = function
|
|
133
|
+
Adaptation.prototype._onResize = function() {
|
|
136
134
|
if (this._iOnResizeAnimationFrame) {
|
|
137
135
|
window.cancelAnimationFrame(this._iOnResizeAnimationFrame);
|
|
138
136
|
}
|
|
@@ -209,9 +207,9 @@ sap.ui.define([
|
|
|
209
207
|
|
|
210
208
|
Adaptation.prototype.show = function() {
|
|
211
209
|
return Base.prototype.show.call(this, this.initialAdjustToolbarSectionWidths.bind(this))
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
.then(function() {
|
|
211
|
+
this._observeIntersections();
|
|
212
|
+
}.bind(this));
|
|
215
213
|
};
|
|
216
214
|
|
|
217
215
|
function setButtonProperties(sButtonName, sIcon, sTextKey, sToolTipKey) {
|
|
@@ -223,15 +221,15 @@ sap.ui.define([
|
|
|
223
221
|
oButton.setIcon(sIcon || "");
|
|
224
222
|
}
|
|
225
223
|
|
|
226
|
-
Adaptation.prototype.formatPublishVersionVisibility = function
|
|
224
|
+
Adaptation.prototype.formatPublishVersionVisibility = function(bPublishVisible, bVersioningEnabled, sDisplayedVersion, sModeSwitcher) {
|
|
227
225
|
return this.getExtension("versioning", Versioning).formatPublishVersionVisibility(bPublishVisible, bVersioningEnabled, sDisplayedVersion, sModeSwitcher);
|
|
228
226
|
};
|
|
229
227
|
|
|
230
|
-
Adaptation.prototype.formatDiscardDraftVisible = function
|
|
228
|
+
Adaptation.prototype.formatDiscardDraftVisible = function(sDisplayedVersion, bVersioningEnabled, sModeSwitcher) {
|
|
231
229
|
return this.getExtension("versioning", Versioning).formatDiscardDraftVisible(sDisplayedVersion, bVersioningEnabled, sModeSwitcher);
|
|
232
230
|
};
|
|
233
231
|
|
|
234
|
-
Adaptation.prototype.formatVersionButtonText = function
|
|
232
|
+
Adaptation.prototype.formatVersionButtonText = function(aVersions, sDisplayedVersion) {
|
|
235
233
|
return this.getExtension("versioning", Versioning).formatVersionButtonText(aVersions, sDisplayedVersion);
|
|
236
234
|
};
|
|
237
235
|
|
|
@@ -239,7 +237,7 @@ sap.ui.define([
|
|
|
239
237
|
return this.getExtension("versioning", Versioning).showVersionHistory(oEvent);
|
|
240
238
|
};
|
|
241
239
|
|
|
242
|
-
Adaptation.prototype._openVersionTitleDialog = function
|
|
240
|
+
Adaptation.prototype._openVersionTitleDialog = function(sDisplayedVersion) {
|
|
243
241
|
return this.getExtension("versioning", Versioning).openActivateVersionDialog(sDisplayedVersion);
|
|
244
242
|
};
|
|
245
243
|
|
|
@@ -287,7 +285,7 @@ sap.ui.define([
|
|
|
287
285
|
this.adjustToolbarSectionWidths();
|
|
288
286
|
};
|
|
289
287
|
|
|
290
|
-
Adaptation.prototype._switchToTexts = function
|
|
288
|
+
Adaptation.prototype._switchToTexts = function() {
|
|
291
289
|
this._showButtonText("adaptationSwitcherButton", "BTN_ADAPTATION");
|
|
292
290
|
this._showButtonText("navigationSwitcherButton", "BTN_NAVIGATION");
|
|
293
291
|
this._showButtonText("visualizationSwitcherButton", "BTN_VISUALIZATION");
|
|
@@ -301,7 +299,7 @@ sap.ui.define([
|
|
|
301
299
|
*
|
|
302
300
|
* @returns {Promise<sap.ui.core.Control[]>} Returns the controls in a structure described above.
|
|
303
301
|
*/
|
|
304
|
-
Adaptation.prototype.buildControls = function
|
|
302
|
+
Adaptation.prototype.buildControls = function() {
|
|
305
303
|
return Fragment.load({
|
|
306
304
|
name: "sap.ui.rta.toolbar.Adaptation",
|
|
307
305
|
id: this.getId() + "_fragment",
|
|
@@ -351,10 +349,67 @@ sap.ui.define([
|
|
|
351
349
|
AppVariantFeature.onSaveAs(true, true, this.getRtaInformation().flexSettings.layer, null);
|
|
352
350
|
}
|
|
353
351
|
|
|
354
|
-
function
|
|
355
|
-
|
|
352
|
+
function confirmMigration(oRtaInformation) {
|
|
353
|
+
var bDirty = oRtaInformation.commandStack.canSave();
|
|
354
|
+
|
|
355
|
+
return Utils.showMessageBox("confirm", (bDirty) ? "DAC_DIALOG_MIGRATION_DIRTY_DESCRIPTION" : "DAC_DIALOG_MIGRATION_DESCRIPTION", {
|
|
356
|
+
titleKey: "DAC_DIALOG_MIGRATION_HEADER",
|
|
357
|
+
actionKeys: ["DAC_DIALOG_MIGRATION_HEADER"],
|
|
358
|
+
showCancel: true
|
|
359
|
+
})
|
|
360
|
+
.then(function(sAction) {
|
|
361
|
+
if (sAction !== MessageBox.Action.CANCEL) {
|
|
362
|
+
if (bDirty) {
|
|
363
|
+
return new Promise(function(resolve) {
|
|
364
|
+
this.fireEvent("save", {callback: resolve});
|
|
365
|
+
}.bind(this))
|
|
366
|
+
.then(function() {
|
|
367
|
+
return performMigration.call(this, oRtaInformation);
|
|
368
|
+
}.bind(this));
|
|
369
|
+
}
|
|
370
|
+
return performMigration.call(this, oRtaInformation);
|
|
371
|
+
}
|
|
372
|
+
}.bind(this));
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
function performMigration(oRtaInformation) {
|
|
376
|
+
BusyIndicator.show();
|
|
377
|
+
return ContextBasedAdaptationsAPI.migrate({
|
|
378
|
+
control: oRtaInformation.rootControl,
|
|
379
|
+
layer: oRtaInformation.flexSettings.layer
|
|
380
|
+
})
|
|
381
|
+
.finally(function() {
|
|
382
|
+
BusyIndicator.hide();
|
|
383
|
+
})
|
|
384
|
+
.then(Utils.showMessageBox.bind(undefined, "information", "DAC_DIALOG_MIGRATION_SUCCESSFULL_DESCRIPTION", {
|
|
385
|
+
titleKey: "DAC_DIALOG_MIGRATION_HEADER"
|
|
386
|
+
}))
|
|
356
387
|
.then(function() {
|
|
357
|
-
|
|
388
|
+
return new Promise(function(resolve) {
|
|
389
|
+
this.fireEvent("switchAdaptation", {adaptationId: "DEFAULT", callback: resolve});
|
|
390
|
+
}.bind(this));
|
|
391
|
+
}.bind(this))
|
|
392
|
+
.catch(function(oError) {
|
|
393
|
+
Log.error(oError.stack || oError);
|
|
394
|
+
var sMessage = "DAC_DIALOG_MIGRATION_ERROR_DESCRIPTION";
|
|
395
|
+
var oOptions = {
|
|
396
|
+
titleKey: "DAC_DIALOG_MIGRATION_HEADER",
|
|
397
|
+
details: oError.userMessage || oError
|
|
398
|
+
};
|
|
399
|
+
Utils.showMessageBox("error", sMessage, oOptions);
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
function onSaveAsAdaptation() {
|
|
404
|
+
var oRtaInformation = this.getRtaInformation();
|
|
405
|
+
Utils.checkDraftOverwrite(this.getModel("versions")).then(function() {
|
|
406
|
+
return ContextBasedAdaptationsAPI.canMigrate({ control: oRtaInformation.rootControl, layer: oRtaInformation.flexSettings.layer });
|
|
407
|
+
}).then(function(bCanMigrate) {
|
|
408
|
+
if (bCanMigrate) {
|
|
409
|
+
confirmMigration.call(this, oRtaInformation);
|
|
410
|
+
} else {
|
|
411
|
+
this.getExtension("contextBasedSaveAs", SaveAsAdaptation).openAddAdaptationDialog(oRtaInformation.flexSettings.layer);
|
|
412
|
+
}
|
|
358
413
|
}.bind(this))
|
|
359
414
|
.catch(handleError);
|
|
360
415
|
}
|
|
@@ -362,7 +417,7 @@ sap.ui.define([
|
|
|
362
417
|
function onEditAdaptation() {
|
|
363
418
|
Utils.checkDraftOverwrite(this.getModel("versions"))
|
|
364
419
|
.then(function() {
|
|
365
|
-
this.getExtension("contextBasedSaveAs", SaveAsAdaptation).openAddAdaptationDialog(this.getRtaInformation().flexSettings.layer, true /*bIsEditMode*/);
|
|
420
|
+
this.getExtension("contextBasedSaveAs", SaveAsAdaptation).openAddAdaptationDialog(this.getRtaInformation().flexSettings.layer, true /* bIsEditMode */);
|
|
366
421
|
}.bind(this))
|
|
367
422
|
.catch(handleError);
|
|
368
423
|
}
|
|
@@ -393,7 +448,7 @@ sap.ui.define([
|
|
|
393
448
|
function formatAdaptationsMenuText(iCount, sTitle) {
|
|
394
449
|
if (iCount > 0) {
|
|
395
450
|
if (sTitle === "") {
|
|
396
|
-
|
|
451
|
+
return this.getTextResources().getText("TXT_DEFAULT_APP");
|
|
397
452
|
}
|
|
398
453
|
return this.getTextResources().getText("BTN_ADAPTING_FOR", sTitle);
|
|
399
454
|
}
|
|
@@ -440,7 +495,7 @@ sap.ui.define([
|
|
|
440
495
|
var sURLPart2 = "SV_4MANxRymEIl9K06";
|
|
441
496
|
var sURL = sURLPart1 + sURLPart2;
|
|
442
497
|
var oUrlParams = new URLSearchParams();
|
|
443
|
-
oUrlParams.set("version",
|
|
498
|
+
oUrlParams.set("version", Core.getConfiguration().getVersion().toString());
|
|
444
499
|
oUrlParams.set("feature", (sConnector === "KeyUserConnector" ? "BTP" : "ABAP"));
|
|
445
500
|
|
|
446
501
|
var oFeedbackDialogModel = new JSONModel({
|
|
@@ -450,7 +505,7 @@ sap.ui.define([
|
|
|
450
505
|
return Fragment.load({
|
|
451
506
|
name: "sap.ui.rta.toolbar.FeedbackDialog",
|
|
452
507
|
controller: this
|
|
453
|
-
}).then(function
|
|
508
|
+
}).then(function(oFeedbackDialog) {
|
|
454
509
|
this._oFeedbackDialog = oFeedbackDialog;
|
|
455
510
|
this._oFeedbackDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
456
511
|
this._oFeedbackDialog.setModel(oFeedbackDialogModel, "feedbackModel");
|
|
@@ -459,7 +514,7 @@ sap.ui.define([
|
|
|
459
514
|
this._oFeedbackDialog.destroy();
|
|
460
515
|
}.bind(this));
|
|
461
516
|
this._oFeedbackDialog.open();
|
|
462
|
-
}.bind(this)).catch(function
|
|
517
|
+
}.bind(this)).catch(function(oError) {
|
|
463
518
|
Log.error("Error loading fragment sap.ui.rta.toolbar.FeedbackDialog: ", oError);
|
|
464
519
|
});
|
|
465
520
|
};
|
|
@@ -15,7 +15,7 @@ sap.ui.define([
|
|
|
15
15
|
|
|
16
16
|
AdaptationRenderer.apiVersion = 1; // @todo-semantic-rendering out of order .class() call before openStart
|
|
17
17
|
|
|
18
|
-
AdaptationRenderer.render = function
|
|
18
|
+
AdaptationRenderer.render = function(oRM, oControl) {
|
|
19
19
|
oRM.class("sapUiRtaToolbarAdaptation");
|
|
20
20
|
|
|
21
21
|
BaseRenderer.render(oRM, oControl);
|