@openui5/sap.ui.rta 1.103.0 → 1.105.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 +18 -1
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
- package/THIRDPARTY.txt +36 -3
- 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 +83 -406
- 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 +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +4 -2
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +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 +4 -2
- 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 +3 -3
- 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 +1 -1
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +15 -11
- package/src/sap/ui/rta/messagebundle_ar.properties +23 -9
- package/src/sap/ui/rta/messagebundle_bg.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ca.properties +24 -10
- package/src/sap/ui/rta/messagebundle_cs.properties +23 -9
- package/src/sap/ui/rta/messagebundle_cy.properties +21 -7
- package/src/sap/ui/rta/messagebundle_da.properties +25 -11
- package/src/sap/ui/rta/messagebundle_de.properties +25 -11
- package/src/sap/ui/rta/messagebundle_el.properties +24 -10
- package/src/sap/ui/rta/messagebundle_en.properties +25 -11
- package/src/sap/ui/rta/messagebundle_en_GB.properties +25 -11
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +18 -11
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -2
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +26 -12
- package/src/sap/ui/rta/messagebundle_es.properties +21 -7
- package/src/sap/ui/rta/messagebundle_es_MX.properties +19 -5
- package/src/sap/ui/rta/messagebundle_et.properties +21 -7
- package/src/sap/ui/rta/messagebundle_fi.properties +25 -11
- package/src/sap/ui/rta/messagebundle_fr.properties +22 -8
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +24 -10
- package/src/sap/ui/rta/messagebundle_hi.properties +24 -10
- package/src/sap/ui/rta/messagebundle_hr.properties +23 -9
- package/src/sap/ui/rta/messagebundle_hu.properties +17 -3
- package/src/sap/ui/rta/messagebundle_id.properties +23 -9
- package/src/sap/ui/rta/messagebundle_it.properties +24 -10
- package/src/sap/ui/rta/messagebundle_iw.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ja.properties +24 -10
- package/src/sap/ui/rta/messagebundle_kk.properties +24 -10
- package/src/sap/ui/rta/messagebundle_ko.properties +24 -10
- package/src/sap/ui/rta/messagebundle_lt.properties +23 -9
- package/src/sap/ui/rta/messagebundle_lv.properties +21 -7
- package/src/sap/ui/rta/messagebundle_ms.properties +25 -11
- package/src/sap/ui/rta/messagebundle_nl.properties +25 -11
- package/src/sap/ui/rta/messagebundle_no.properties +24 -10
- package/src/sap/ui/rta/messagebundle_pl.properties +23 -9
- package/src/sap/ui/rta/messagebundle_pt.properties +24 -10
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +23 -9
- package/src/sap/ui/rta/messagebundle_ro.properties +23 -9
- package/src/sap/ui/rta/messagebundle_ru.properties +24 -10
- package/src/sap/ui/rta/messagebundle_sh.properties +25 -11
- package/src/sap/ui/rta/messagebundle_sk.properties +23 -9
- package/src/sap/ui/rta/messagebundle_sl.properties +21 -7
- package/src/sap/ui/rta/messagebundle_sv.properties +25 -11
- package/src/sap/ui/rta/messagebundle_th.properties +27 -13
- package/src/sap/ui/rta/messagebundle_tr.properties +24 -10
- package/src/sap/ui/rta/messagebundle_uk.properties +25 -11
- package/src/sap/ui/rta/messagebundle_vi.properties +24 -10
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +24 -10
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +23 -9
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +2 -2
- package/src/sap/ui/rta/plugin/ControlVariant.js +21 -15
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +1 -1
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +23 -5
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +12 -1
- package/src/sap/ui/rta/plugin/Settings.js +1 -1
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +5 -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 +5 -5
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +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/themes/base/Toolbar.adaptation.less +19 -4
- package/src/sap/ui/rta/toolbar/Adaptation.js +6 -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/translation/Translation.js +1 -1
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +331 -0
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/adaptationStarter.js +14 -8
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +100 -51
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +100 -55
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +41 -106
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/CombineVisualization.js +87 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +4 -4
- package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +2 -2
- package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +6 -4
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +11 -3
|
@@ -15,7 +15,7 @@ sap.ui.define([
|
|
|
15
15
|
* Helper object containing methods for the AdditionalElements plugin
|
|
16
16
|
*
|
|
17
17
|
* @author SAP SE
|
|
18
|
-
* @version 1.
|
|
18
|
+
* @version 1.105.0
|
|
19
19
|
* @private
|
|
20
20
|
* @since 1.94
|
|
21
21
|
* @experimental Since 1.94. This class is experimental and provides only limited functionality. Also the API might be changed in future.
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* Helper object to build the RTA commands resulting from the AdditionalElements Plugin
|
|
26
26
|
*
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.105.0
|
|
29
29
|
* @private
|
|
30
30
|
* @since 1.94
|
|
31
31
|
* @experimental Since 1.94. This class is experimental and provides only limited functionality. Also the API might be changed in future.
|
|
@@ -110,7 +110,7 @@ sap.ui.define([
|
|
|
110
110
|
* @class The AddIFrame allows trigger AddIFrame operations on the overlay.
|
|
111
111
|
* @extends sap.ui.rta.plugin.BaseCreate
|
|
112
112
|
* @author SAP SE
|
|
113
|
-
* @version 1.
|
|
113
|
+
* @version 1.105.0
|
|
114
114
|
* @constructor
|
|
115
115
|
* @private
|
|
116
116
|
* @since 1.75
|
|
@@ -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.105.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
|
/**
|
|
@@ -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
|
|
|
@@ -11,7 +11,8 @@ sap.ui.define([
|
|
|
11
11
|
"sap/ui/rta/toolbar/versioning/Versioning",
|
|
12
12
|
"sap/ui/rta/appVariant/Feature",
|
|
13
13
|
"sap/ui/rta/toolbar/Base",
|
|
14
|
-
"sap/ui/Device"
|
|
14
|
+
"sap/ui/Device",
|
|
15
|
+
"./AdaptationRenderer"
|
|
15
16
|
], function(
|
|
16
17
|
Fragment,
|
|
17
18
|
Version,
|
|
@@ -19,7 +20,8 @@ sap.ui.define([
|
|
|
19
20
|
Versioning,
|
|
20
21
|
AppVariantFeature,
|
|
21
22
|
Base,
|
|
22
|
-
Device
|
|
23
|
+
Device,
|
|
24
|
+
AdaptationRenderer
|
|
23
25
|
) {
|
|
24
26
|
"use strict";
|
|
25
27
|
|
|
@@ -31,7 +33,7 @@ sap.ui.define([
|
|
|
31
33
|
* @extends sap.ui.rta.toolbar.Base
|
|
32
34
|
*
|
|
33
35
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
36
|
+
* @version 1.105.0
|
|
35
37
|
*
|
|
36
38
|
* @constructor
|
|
37
39
|
* @private
|
|
@@ -40,7 +42,7 @@ sap.ui.define([
|
|
|
40
42
|
* @experimental Since 1.48. This class is experimental. API might be changed in future.
|
|
41
43
|
*/
|
|
42
44
|
var Adaptation = Base.extend("sap.ui.rta.toolbar.Adaptation", {
|
|
43
|
-
renderer:
|
|
45
|
+
renderer: AdaptationRenderer,
|
|
44
46
|
animation: true,
|
|
45
47
|
metadata: {
|
|
46
48
|
library: "sap.ui.rta",
|
|
@@ -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.105.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,331 @@
|
|
|
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/base/util/merge",
|
|
9
|
+
"sap/ui/fl/apply/api/FlexRuntimeInfoAPI",
|
|
10
|
+
"sap/ui/fl/write/api/ReloadInfoAPI",
|
|
11
|
+
"sap/ui/fl/write/api/VersionsAPI",
|
|
12
|
+
"sap/ui/fl/Layer",
|
|
13
|
+
"sap/ui/fl/Utils",
|
|
14
|
+
"sap/ui/rta/Utils"
|
|
15
|
+
], function(
|
|
16
|
+
merge,
|
|
17
|
+
FlexRuntimeInfoAPI,
|
|
18
|
+
ReloadInfoAPI,
|
|
19
|
+
VersionsAPI,
|
|
20
|
+
Layer,
|
|
21
|
+
FlUtils,
|
|
22
|
+
Utils
|
|
23
|
+
) {
|
|
24
|
+
"use strict";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Static class to handle all the reload related functionality for UI Adaptation
|
|
28
|
+
*
|
|
29
|
+
* @class
|
|
30
|
+
* @namespace sap.ui.rta.util.ReloadManager
|
|
31
|
+
* @alias sap.ui.rta.util.ReloadManager
|
|
32
|
+
* @since 1.104
|
|
33
|
+
* @version 1.105.0
|
|
34
|
+
* @private
|
|
35
|
+
* @ui5-restricted
|
|
36
|
+
*/
|
|
37
|
+
var ReloadManager = {};
|
|
38
|
+
|
|
39
|
+
var mUShellServices = {};
|
|
40
|
+
var mReloadMethods = {
|
|
41
|
+
NOT_NEEDED: "NO_RELOAD",
|
|
42
|
+
VIA_HASH: "CROSS_APP_NAVIGATION",
|
|
43
|
+
RELOAD_PAGE: "HARD_RELOAD"
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Builds the navigation arguments object required to trigger the navigation
|
|
48
|
+
* using the <code>CrossApplicationNavigation</code> ushell service.
|
|
49
|
+
*
|
|
50
|
+
* @param {object} mParsedHash Parsed URL hash
|
|
51
|
+
* @return {object} Argument map ("oArg" parameter of the "toExternal" function)
|
|
52
|
+
*/
|
|
53
|
+
function buildNavigationArguments(mParsedHash) {
|
|
54
|
+
return {
|
|
55
|
+
target: {
|
|
56
|
+
semanticObject: mParsedHash.semanticObject,
|
|
57
|
+
action: mParsedHash.action,
|
|
58
|
+
context: mParsedHash.contextRaw
|
|
59
|
+
},
|
|
60
|
+
params: mParsedHash.params,
|
|
61
|
+
appSpecificRoute: mParsedHash.appSpecificRoute,
|
|
62
|
+
writeHistory: false
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function getReloadMessageOnStart(oReloadInfo) {
|
|
67
|
+
var sReason;
|
|
68
|
+
var bIsCustomerLayer = oReloadInfo.layer === Layer.CUSTOMER;
|
|
69
|
+
|
|
70
|
+
if (oReloadInfo.hasHigherLayerChanges && oReloadInfo.isDraftAvailable) {
|
|
71
|
+
sReason = bIsCustomerLayer ? "MSG_VIEWS_OR_PERSONALIZATION_AND_DRAFT_EXISTS" : "MSG_HIGHER_LAYER_CHANGES_AND_DRAFT_EXISTS";
|
|
72
|
+
} else if (oReloadInfo.hasHigherLayerChanges && oReloadInfo.allContexts) {
|
|
73
|
+
sReason = "MSG_RESTRICTED_CONTEXT_EXIST_AND_PERSONALIZATION";
|
|
74
|
+
} else if (oReloadInfo.hasHigherLayerChanges) {
|
|
75
|
+
sReason = bIsCustomerLayer ? "MSG_PERSONALIZATION_OR_PUBLIC_VIEWS_EXISTS" : "MSG_HIGHER_LAYER_CHANGES_EXIST";
|
|
76
|
+
} else if (oReloadInfo.isDraftAvailable) {
|
|
77
|
+
sReason = "MSG_DRAFT_EXISTS";
|
|
78
|
+
} else if (oReloadInfo.allContexts) {
|
|
79
|
+
sReason = "MSG_RESTRICTED_CONTEXT_EXIST";
|
|
80
|
+
} // TODO add app descr changes case for start?
|
|
81
|
+
return sReason;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function getReloadMessageOnExit(oReloadInfo) {
|
|
85
|
+
var bIsCustomerLayer = oReloadInfo.layer === Layer.CUSTOMER;
|
|
86
|
+
|
|
87
|
+
if (oReloadInfo.hasHigherLayerChanges) {
|
|
88
|
+
if (!bIsCustomerLayer) {
|
|
89
|
+
return "MSG_RELOAD_WITH_ALL_CHANGES";
|
|
90
|
+
}
|
|
91
|
+
if (oReloadInfo.isDraftAvailable) {
|
|
92
|
+
return "MSG_RELOAD_WITH_VIEWS_PERSONALIZATION_AND_WITHOUT_DRAFT";
|
|
93
|
+
}
|
|
94
|
+
if (oReloadInfo.allContexts) {
|
|
95
|
+
return "MSG_RELOAD_WITH_PERSONALIZATION_AND_RESTRICTED_CONTEXT";
|
|
96
|
+
}
|
|
97
|
+
return "MSG_RELOAD_WITH_PERSONALIZATION_AND_VIEWS";
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (oReloadInfo.initialDraftGotActivated) {
|
|
101
|
+
return "MSG_RELOAD_ACTIVATED_DRAFT";
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (oReloadInfo.isDraftAvailable) {
|
|
105
|
+
return "MSG_RELOAD_WITHOUT_DRAFT";
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (oReloadInfo.changesNeedReload) {
|
|
109
|
+
return "MSG_RELOAD_NEEDED";
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (oReloadInfo.allContexts) {
|
|
113
|
+
return "MSG_RELOAD_WITHOUT_ALL_CONTEXT";
|
|
114
|
+
}
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function handleReloadMessageBoxOnExit(oReloadReasons) {
|
|
119
|
+
var sReason = getReloadMessageOnExit(oReloadReasons);
|
|
120
|
+
|
|
121
|
+
if (sReason) {
|
|
122
|
+
return Utils.showMessageBox("information", sReason, {
|
|
123
|
+
titleKey: "HEADER_RELOAD_NEEDED"
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return Promise.resolve();
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function triggerReloadOnStart(oReloadInfo, bVersioningEnabled, bDeveloperMode) {
|
|
130
|
+
if (mUShellServices.CrossApplicationNavigation && bVersioningEnabled) {
|
|
131
|
+
// clears FlexState and triggers reloading of the flex data without blocking
|
|
132
|
+
if (oReloadInfo.isDraftAvailable) {
|
|
133
|
+
VersionsAPI.loadDraftForApplication({
|
|
134
|
+
control: oReloadInfo.selector,
|
|
135
|
+
layer: oReloadInfo.layer,
|
|
136
|
+
allContexts: oReloadInfo.allContexts
|
|
137
|
+
});
|
|
138
|
+
} else {
|
|
139
|
+
VersionsAPI.loadVersionForApplication({
|
|
140
|
+
control: oReloadInfo.selector,
|
|
141
|
+
layer: oReloadInfo.layer,
|
|
142
|
+
allContexts: oReloadInfo.allContexts
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
var sReason = getReloadMessageOnStart(oReloadInfo);
|
|
147
|
+
// showing messages in visual editor is leading to blocked screen. In this case we should reload without message
|
|
148
|
+
var pMessageBox = bDeveloperMode ? Promise.resolve() : Utils.showMessageBox("information", sReason);
|
|
149
|
+
return pMessageBox.then(function() {
|
|
150
|
+
ReloadManager.enableAutomaticStart(oReloadInfo.layer, oReloadInfo.selector);
|
|
151
|
+
oReloadInfo.onStart = true;
|
|
152
|
+
return ReloadManager.triggerReload(oReloadInfo);
|
|
153
|
+
})
|
|
154
|
+
.then(function() {
|
|
155
|
+
return true;
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function triggerReloadForStandalone(oReloadInfo) {
|
|
160
|
+
oReloadInfo.parameters = document.location.search;
|
|
161
|
+
if (oReloadInfo.onStart) {
|
|
162
|
+
ReloadInfoAPI.handleParametersOnStart(oReloadInfo, "standalone");
|
|
163
|
+
} else {
|
|
164
|
+
ReloadInfoAPI.handleUrlParameters(oReloadInfo, "standalone");
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (document.location.search === oReloadInfo.parameters) {
|
|
168
|
+
ReloadManager.reloadPage();
|
|
169
|
+
} else {
|
|
170
|
+
ReloadManager.setUriParameters(oReloadInfo.parameters);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function triggerReloadForFLP(oReloadInfo) {
|
|
175
|
+
oReloadInfo.URLParsingService = mUShellServices.URLParsing;
|
|
176
|
+
oReloadInfo.parsedHash = FlUtils.getParsedURLHash(mUShellServices.URLParsing);
|
|
177
|
+
oReloadInfo.parameters = oReloadInfo.parsedHash.params;
|
|
178
|
+
var bChanged = oReloadInfo.onStart ? ReloadInfoAPI.handleParametersOnStart(oReloadInfo, "flp") : ReloadInfoAPI.handleUrlParameters(oReloadInfo, "flp");
|
|
179
|
+
|
|
180
|
+
if (bChanged) {
|
|
181
|
+
// if a hard reload is required the crossAppNav still has to be triggered to update the URL
|
|
182
|
+
mUShellServices.CrossApplicationNavigation.toExternal(buildNavigationArguments(oReloadInfo.parsedHash));
|
|
183
|
+
} else {
|
|
184
|
+
mUShellServices.AppLifeCycle.reloadCurrentApp();
|
|
185
|
+
}
|
|
186
|
+
if (oReloadInfo.triggerHardReload) {
|
|
187
|
+
ReloadManager.reloadPage();
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
ReloadManager.setUShellServices = function(mPassedUShellServices) {
|
|
192
|
+
mUShellServices = mPassedUShellServices;
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Enables automatic key user adaptation start.
|
|
197
|
+
*
|
|
198
|
+
* @param {sap.ui.fl.Layer} sLayer - Active layer
|
|
199
|
+
* @param {sap.ui.core.Control} oRootControl - Root control for which key user adaptation was started
|
|
200
|
+
*/
|
|
201
|
+
ReloadManager.enableAutomaticStart = function(sLayer, oRootControl) {
|
|
202
|
+
var sFlexReference = FlexRuntimeInfoAPI.getFlexReference({element: oRootControl});
|
|
203
|
+
var vParameter = sFlexReference || true;
|
|
204
|
+
window.sessionStorage.setItem("sap.ui.rta.restart." + sLayer, vParameter);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* Disable automatic key user adaptation start
|
|
209
|
+
*
|
|
210
|
+
* @param {sap.ui.fl.Layer} sLayer - Active layer
|
|
211
|
+
*/
|
|
212
|
+
ReloadManager.disableAutomaticStart = function(sLayer) {
|
|
213
|
+
window.sessionStorage.removeItem("sap.ui.rta.restart." + sLayer);
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Checks if the flag for an automatic key user adaptation start is set.
|
|
218
|
+
*
|
|
219
|
+
* @param {sap.ui.fl.Layer} sLayer - Active layer
|
|
220
|
+
* @returns {boolean} <code>true</code> if restart is needed
|
|
221
|
+
*/
|
|
222
|
+
ReloadManager.needsAutomaticStart = function(sLayer) {
|
|
223
|
+
return !!window.sessionStorage.getItem("sap.ui.rta.restart." + sLayer);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Triggers the reload of the page. Can either be a soft reload inside the FLP or a hard reload.
|
|
228
|
+
*
|
|
229
|
+
* @param {object} oReloadInfo - Information needed for the reload
|
|
230
|
+
* @param {sap.ui.fl.Layer} oReloadInfo.layer - Current layer
|
|
231
|
+
* @param {boolean} oReloadInfo.hasHigherLayerChanges - Indicates if higher layer changes exist
|
|
232
|
+
* @param {boolean} oReloadInfo.ignoreMaxLayerParameter - Indicates if the max layer parameter should be ignored
|
|
233
|
+
* @param {string|object} oReloadInfo.parameters - The URL parameters to be modified
|
|
234
|
+
* @param {string} oReloadInfo.versionSwitch - Indicates if we are in a version switch scenario
|
|
235
|
+
* @param {string} oReloadInfo.version - Version we want to switch to
|
|
236
|
+
* @param {string} oReloadInfo.removeVersionParameter - Indicates if version parameter should be removed
|
|
237
|
+
* @param {string} oReloadInfo.removeDraft - Indicates if draft parameter should be removed
|
|
238
|
+
*/
|
|
239
|
+
ReloadManager.triggerReload = function(oReloadInfo) {
|
|
240
|
+
if (FlUtils.getUshellContainer()) {
|
|
241
|
+
triggerReloadForFLP(oReloadInfo);
|
|
242
|
+
} else {
|
|
243
|
+
triggerReloadForStandalone(oReloadInfo);
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Reloads the page via the browsers window object.
|
|
249
|
+
*/
|
|
250
|
+
ReloadManager.reloadPage = function() {
|
|
251
|
+
window.location.reload();
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Sets the given parameters as <code>document.location.search</code> which will trigger a browser reload.
|
|
256
|
+
* @param {string} sParameters - URL parameters
|
|
257
|
+
*/
|
|
258
|
+
ReloadManager.setUriParameters = function(sParameters) {
|
|
259
|
+
document.location.search = sParameters;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Checks if there are personalization changes/draft changes and restarts the application without/with them.
|
|
264
|
+
* Warns the user that the application will be restarted without personalization / with draft changes.
|
|
265
|
+
* Checks if it is necessary to load all contexts.
|
|
266
|
+
* @param {object} mProperties - Object with additional information
|
|
267
|
+
* @param {sap.ui.fl.Layer} mProperties.layer - Current layer
|
|
268
|
+
* @param {sap.ui.fl.Selector} mProperties.selector - Root control
|
|
269
|
+
* @param {boolean} mProperties.versioningEnabled - Whether versioning is enabled
|
|
270
|
+
* @param {boolean} mProperties.developerMode - Whether the developer mode is set
|
|
271
|
+
*
|
|
272
|
+
* @return {Promise<boolean>} Resolving to <code>false</code> means that reload is not necessary
|
|
273
|
+
*/
|
|
274
|
+
ReloadManager.handleReloadOnStart = function(mProperties) {
|
|
275
|
+
merge(mProperties, {
|
|
276
|
+
hasHigherLayerChanges: false,
|
|
277
|
+
isDraftAvailable: false,
|
|
278
|
+
ignoreMaxLayerParameter: false,
|
|
279
|
+
includeCtrlVariants: true,
|
|
280
|
+
URLParsingService: mUShellServices.URLParsing
|
|
281
|
+
});
|
|
282
|
+
return ReloadInfoAPI.getReloadReasonsForStart(mProperties).then(function(oReloadInfo) {
|
|
283
|
+
if (oReloadInfo.hasHigherLayerChanges || oReloadInfo.isDraftAvailable || oReloadInfo.allContexts) {
|
|
284
|
+
return triggerReloadOnStart(oReloadInfo, mProperties.versioningEnabled, mProperties.developerMode);
|
|
285
|
+
}
|
|
286
|
+
return undefined;
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* When exiting key user adaptation and personalization changes exist, the user can choose to
|
|
292
|
+
* reload the app with personalization or stay in the app without the personalization.
|
|
293
|
+
* @param {object} mProperties - Object with additional information
|
|
294
|
+
* @param {sap.ui.fl.Layer} mProperties.layer - Current layer
|
|
295
|
+
* @param {sap.ui.fl.Selector} mProperties.selector - Root control
|
|
296
|
+
* @param {boolean} mProperties.versioningEnabled - Whether versioning is enabled
|
|
297
|
+
* @param {boolean} mProperties.isDraftAvailable - Whether a draft is available
|
|
298
|
+
* @param {boolean} mProperties.activeVersion - Number of the active version
|
|
299
|
+
* @param {Promise} mProperties.changesNeedReloadPromise - Resolves to whether any change needs a hard reload
|
|
300
|
+
* @param {boolean} bSkipRestart - Stop key user adaptation without reloading the app in any way
|
|
301
|
+
*
|
|
302
|
+
* @return {Promise<object>} Resolving to an object containing information about whether a reload is needed and how to handle it
|
|
303
|
+
*/
|
|
304
|
+
ReloadManager.checkReloadOnExit = function(mProperties) {
|
|
305
|
+
return mProperties.changesNeedReloadPromise.then(function(bChangesNeedReload) {
|
|
306
|
+
mProperties.changesNeedReload = bChangesNeedReload;
|
|
307
|
+
mProperties.URLParsingService = mUShellServices.URLParsing;
|
|
308
|
+
var oReloadInfo = ReloadInfoAPI.getReloadMethod(mProperties);
|
|
309
|
+
return handleReloadMessageBoxOnExit(oReloadInfo).then(function() {
|
|
310
|
+
oReloadInfo.triggerHardReload = oReloadInfo.reloadMethod === mReloadMethods.RELOAD_PAGE;
|
|
311
|
+
return oReloadInfo;
|
|
312
|
+
});
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Reloads the app inside FLP or standalone by removing max layer / draft parameter;
|
|
318
|
+
*
|
|
319
|
+
* @param {object} oReloadInfo - Information needed for the reload
|
|
320
|
+
* @param {sap.ui.fl.Layer} oReloadInfo.layer - Current layer
|
|
321
|
+
* @param {boolean} oReloadInfo.hasHigherLayerChanges - Indicates if higher layer changes exist
|
|
322
|
+
*/
|
|
323
|
+
ReloadManager.handleUrlParametersOnExit = function(oReloadInfo) {
|
|
324
|
+
if (oReloadInfo.layer !== Layer.USER && oReloadInfo.reloadMethod !== mReloadMethods.NOT_NEEDED) {
|
|
325
|
+
oReloadInfo.removeVersionParameter = true;
|
|
326
|
+
ReloadManager.triggerReload(oReloadInfo);
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
return ReloadManager;
|
|
331
|
+
});
|