@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
|
@@ -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.106.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
|
+
});
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
3
|
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
+
"sap/base/util/UriParameters",
|
|
7
8
|
"sap/base/Log",
|
|
8
9
|
"sap/ui/core/Control",
|
|
9
10
|
"sap/ui/core/UIComponent",
|
|
@@ -12,8 +13,10 @@ sap.ui.define([
|
|
|
12
13
|
"sap/ui/fl/Layer",
|
|
13
14
|
"sap/ui/fl/Utils",
|
|
14
15
|
"sap/ui/rta/util/showMessageBox",
|
|
15
|
-
"sap/ui/rta/RuntimeAuthoring"
|
|
16
|
+
"sap/ui/rta/RuntimeAuthoring",
|
|
17
|
+
"sap/ui/core/Core"
|
|
16
18
|
], function(
|
|
19
|
+
UriParameters,
|
|
17
20
|
Log,
|
|
18
21
|
Control,
|
|
19
22
|
UIComponent,
|
|
@@ -22,7 +25,8 @@ sap.ui.define([
|
|
|
22
25
|
Layer,
|
|
23
26
|
FlexUtils,
|
|
24
27
|
showMessageBox,
|
|
25
|
-
RuntimeAuthoring
|
|
28
|
+
RuntimeAuthoring,
|
|
29
|
+
Core
|
|
26
30
|
) {
|
|
27
31
|
"use strict";
|
|
28
32
|
|
|
@@ -31,7 +35,8 @@ sap.ui.define([
|
|
|
31
35
|
return FeaturesAPI.isKeyUser()
|
|
32
36
|
.then(function(bIsKeyUser) {
|
|
33
37
|
if (!bIsKeyUser) {
|
|
34
|
-
var
|
|
38
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
39
|
+
var oError = new Error(oRtaResourceBundle.getText("MSG_NO_KEY_USER_RIGHTS_ERROR_MESSAGE"));
|
|
35
40
|
oError.reason = "isKeyUser";
|
|
36
41
|
throw oError;
|
|
37
42
|
}
|
|
@@ -41,13 +46,17 @@ sap.ui.define([
|
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
function checkFlexEnabled(oAppComponent) {
|
|
44
|
-
|
|
45
|
-
var
|
|
49
|
+
// fiori tools is always a developer scenario where the flexEnabled flag should not be evaluated
|
|
50
|
+
var sFioriToolsMode = UriParameters.fromQuery(window.location.search).get("fiori-tools-rta-mode");
|
|
51
|
+
if (!sFioriToolsMode || sFioriToolsMode === "false") {
|
|
52
|
+
var oManifest = oAppComponent.getManifest() || {};
|
|
53
|
+
var vFlexEnabled = oManifest["sap.ui5"] && oManifest["sap.ui5"].flexEnabled;
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
55
|
+
if (vFlexEnabled === false) {
|
|
56
|
+
var oError = Error("This app is not enabled for key user adaptation");
|
|
57
|
+
oError.reason = "flexEnabled";
|
|
58
|
+
throw oError;
|
|
59
|
+
}
|
|
51
60
|
}
|
|
52
61
|
}
|
|
53
62
|
|
|
@@ -116,7 +125,7 @@ sap.ui.define([
|
|
|
116
125
|
PersistenceWriteAPI.getChangesWarning(mPropertyBag)
|
|
117
126
|
.then(function(oWarningMessage) {
|
|
118
127
|
if (oWarningMessage.showWarning) {
|
|
119
|
-
var oRtaResourceBundle =
|
|
128
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
120
129
|
var oMessageProps = oWarningMessage.warningType === "mixedChangesWarning"
|
|
121
130
|
? {
|
|
122
131
|
text: "MSG_ADAPTATION_STARTER_MIXED_CHANGES_WARNING",
|
|
@@ -141,6 +150,12 @@ sap.ui.define([
|
|
|
141
150
|
})
|
|
142
151
|
.catch(function(vError) {
|
|
143
152
|
if (vError !== "Reload triggered") {
|
|
153
|
+
var oRtaResourceBundle = Core.getLibraryResourceBundle("sap.ui.rta");
|
|
154
|
+
showMessageBox(
|
|
155
|
+
oRtaResourceBundle.getText("MSG_GENERIC_ERROR_MESSAGE", vError.message),
|
|
156
|
+
{title: oRtaResourceBundle.getText("MSG_ADAPTATION_COULD_NOT_START")},
|
|
157
|
+
"error"
|
|
158
|
+
);
|
|
144
159
|
Log.error("UI Adaptation could not be started", vError.message);
|
|
145
160
|
}
|
|
146
161
|
throw vError;
|
|
@@ -0,0 +1,50 @@
|
|
|
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/fl/changeHandler/common/ChangeCategories"
|
|
9
|
+
], function(
|
|
10
|
+
FlChangeCategories
|
|
11
|
+
) {
|
|
12
|
+
"use strict";
|
|
13
|
+
|
|
14
|
+
var ChangeCategories = {};
|
|
15
|
+
|
|
16
|
+
ChangeCategories.ALL = "all";
|
|
17
|
+
|
|
18
|
+
// Assignment of commands to change categories
|
|
19
|
+
var COMMANDS = {};
|
|
20
|
+
COMMANDS[FlChangeCategories.ADD] = [
|
|
21
|
+
"createContainer",
|
|
22
|
+
"addDelegateProperty",
|
|
23
|
+
"reveal",
|
|
24
|
+
"addIFrame"
|
|
25
|
+
];
|
|
26
|
+
COMMANDS[FlChangeCategories.MOVE] = ["move"];
|
|
27
|
+
COMMANDS[FlChangeCategories.RENAME] = ["rename"];
|
|
28
|
+
COMMANDS[FlChangeCategories.COMBINESPLIT] = ["combine", "split"];
|
|
29
|
+
COMMANDS[FlChangeCategories.REMOVE] = ["remove"];
|
|
30
|
+
COMMANDS[FlChangeCategories.OTHER] = [];
|
|
31
|
+
|
|
32
|
+
var CATEGORY_ICONS = {};
|
|
33
|
+
CATEGORY_ICONS[ChangeCategories.ALL] = "sap-icon://show";
|
|
34
|
+
CATEGORY_ICONS[FlChangeCategories.ADD] = "sap-icon://add";
|
|
35
|
+
CATEGORY_ICONS[FlChangeCategories.MOVE] = "sap-icon://move";
|
|
36
|
+
CATEGORY_ICONS[FlChangeCategories.RENAME] = "sap-icon://edit";
|
|
37
|
+
CATEGORY_ICONS[FlChangeCategories.COMBINESPLIT] = "sap-icon://combine";
|
|
38
|
+
CATEGORY_ICONS[FlChangeCategories.REMOVE] = "sap-icon://less";
|
|
39
|
+
CATEGORY_ICONS[FlChangeCategories.OTHER] = "sap-icon://key-user-settings";
|
|
40
|
+
|
|
41
|
+
ChangeCategories.getCategories = function() {
|
|
42
|
+
return COMMANDS;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
ChangeCategories.getIconForCategory = function(sCategory) {
|
|
46
|
+
return CATEGORY_ICONS[sCategory];
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
return ChangeCategories;
|
|
50
|
+
});
|