@sapui5/sap.ushell_abap 1.148.1 → 1.149.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/package.json +1 -1
- package/src/main/js/sap/ushell_abap/.library +2 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +3 -3
- package/src/main/js/sap/ushell_abap/adapters/abap/CommonDataModelAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +4 -2
- package/src/main/js/sap/ushell_abap/adapters/abap/FlpLaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionInternalAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +4 -2
- package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +4 -2
- package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationV2Adapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/UserInfoAdapter.js +3 -1
- package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +1 -1
- package/src/main/js/sap/ushell_abap/bootstrap/BootTask/MarkPerformance.js +25 -0
- package/src/main/js/sap/ushell_abap/bootstrap/BootTask/PrepareDirectAppStart.js +18 -0
- package/src/main/js/sap/ushell_abap/bootstrap/BootTask/RequestGroups.js +36 -2
- package/src/main/js/sap/ushell_abap/bootstrap/BootTask/RequestTargetMappings.js +11 -0
- package/src/main/js/sap/ushell_abap/bootstrap/BootTask.js +32 -14
- package/src/main/js/sap/ushell_abap/bootstrap/DirectAppStart.js +71 -10
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/CreateRenderer.js +21 -2
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/InitXhrLogon.js +59 -19
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/RequestPages.js +56 -5
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad.js +32 -11
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpadModule.js +4 -1
- package/src/main/js/sap/ushell_abap/bootstrap/PageSetsRequestHandler.js +54 -42
- package/src/main/js/sap/ushell_abap/bootstrap/PlatformConfig.js +7 -9
- package/src/main/js/sap/ushell_abap/bootstrap/SAPCompanionConditionSetter.js +33 -28
- package/src/main/js/sap/ushell_abap/bootstrap/StartupRequestHandler.js +34 -23
- package/src/main/js/sap/ushell_abap/bootstrap/ThemeHandler.js +90 -2
- package/src/main/js/sap/ushell_abap/bootstrap/XhrFactory.js +23 -13
- package/src/main/js/sap/ushell_abap/bootstrap/XhrLogonEventHandler.js +33 -10
- package/src/main/js/sap/ushell_abap/bootstrap/XhrLogonLibLoader.js +49 -1
- package/src/main/js/sap/ushell_abap/bootstrap/abap-def-dev.js +1 -0
- package/src/main/js/sap/ushell_abap/bootstrap/abap-def-loader.js +4 -0
- package/src/main/js/sap/ushell_abap/bootstrap/abap-def.js +1 -0
- package/src/main/js/sap/ushell_abap/bootstrap/abapConstants.js +3 -0
- package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.js +2 -0
- package/src/main/js/sap/ushell_abap/components/TCodeNavigation.js +1 -1
- package/src/main/js/sap/ushell_abap/integration/WebSsoBridge.js +57 -0
- package/src/main/js/sap/ushell_abap/library.js +1 -1
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Contracts.js +3 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +4 -16
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +3 -2
- package/ui5.yaml +18 -13
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview This module handles requests to the PageSets OData service, which is used to fetch the data for the classic homepage.
|
|
4
|
+
* @deprecated since 1.136. Deprecated without successor together with the classic homepage.
|
|
5
|
+
*/
|
|
3
6
|
sap.ui.define([
|
|
4
|
-
"sap/
|
|
7
|
+
"sap/base/Log",
|
|
5
8
|
"sap/ui/thirdparty/jquery",
|
|
6
|
-
"sap/ushell_abap/
|
|
7
|
-
"sap/
|
|
9
|
+
"sap/ushell_abap/bootstrap/XhrFactory",
|
|
10
|
+
"sap/ushell_abap/pbServices/ui2/Utils"
|
|
8
11
|
], (
|
|
9
|
-
|
|
12
|
+
Log,
|
|
10
13
|
jQuery,
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
XhrFactory,
|
|
15
|
+
ui2Utils
|
|
13
16
|
) => {
|
|
14
17
|
"use strict";
|
|
15
18
|
|
|
@@ -22,6 +25,15 @@ sap.ui.define([
|
|
|
22
25
|
+ "AssignedPages,DefaultPage";
|
|
23
26
|
const S_PAGE_SETS_FALLBACK_URL_RELATIVE = "PageSets('%2FUI2%2FFiori2LaunchpadHome')";
|
|
24
27
|
|
|
28
|
+
/**
|
|
29
|
+
* @alias sap.ushell_abap.bootstrap.PageSetsRequestHandler
|
|
30
|
+
* @namespace
|
|
31
|
+
* @description This module handles requests to the PageSets OData service, which is used to fetch the data for the classic homepage.
|
|
32
|
+
*
|
|
33
|
+
* @since 1.147.0
|
|
34
|
+
* @private
|
|
35
|
+
* @deprecated since 1.136. Deprecated without successor together with the classic homepage.
|
|
36
|
+
*/
|
|
25
37
|
class PageSetsRequestHandler {
|
|
26
38
|
// Check (only once for this file) if sap-statistics is set in query parameter or local storage
|
|
27
39
|
#bSapStatistics = this.#isSapStatisticsSet();
|
|
@@ -30,18 +42,14 @@ sap.ui.define([
|
|
|
30
42
|
* Determines the URL for the PageSets OData service from the startup service result. If the URL is not set
|
|
31
43
|
* a hard-coded fallback URL is returned and set in the startupResult.
|
|
32
44
|
*
|
|
33
|
-
* @param {object} oStartupCallResult
|
|
34
|
-
* the
|
|
35
|
-
* @param {string}
|
|
36
|
-
* the
|
|
37
|
-
* @param {string}
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @param {string} sFallbackExpand
|
|
42
|
-
* the fallback expand parameter to be used if the service URL is not set
|
|
43
|
-
* @returns {string}
|
|
44
|
-
* the URL for the service, adjusted with the fallback values if necessary
|
|
45
|
+
* @param {object} oStartupCallResult the startup service result object
|
|
46
|
+
* @param {string} sServicePropertyName the name of the service property in the startup result
|
|
47
|
+
* @param {string} sFallbackBaseUrl the fallback base URL to be used if the service URL is not set
|
|
48
|
+
* @param {string} sFallbackRelativeUrl the fallback relative URL to be used if the service URL is not set
|
|
49
|
+
* @param {string} sFallbackExpand the fallback expand parameter to be used if the service URL is not set
|
|
50
|
+
* @returns {string} the URL for the service, adjusted with the fallback values if necessary
|
|
51
|
+
*
|
|
52
|
+
* @private
|
|
45
53
|
*/
|
|
46
54
|
#getAndAdjustServiceURL (oStartupCallResult, sServicePropertyName, sFallbackBaseUrl, sFallbackRelativeUrl, sFallbackExpand) {
|
|
47
55
|
let sServiceUrl;
|
|
@@ -108,14 +116,12 @@ sap.ui.define([
|
|
|
108
116
|
|
|
109
117
|
/**
|
|
110
118
|
* Processes the OData response.
|
|
111
|
-
* @param {jQuery.Deferred} oDeferred
|
|
112
|
-
*
|
|
113
|
-
* @param {
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
* @param {string} sResponse
|
|
118
|
-
* the response message
|
|
119
|
+
* @param {jQuery.Deferred} oDeferred the deferred object updating the cache in OData.read
|
|
120
|
+
* @param {int} iStatus the status code
|
|
121
|
+
* @param {string} sCsrfToken the CSRF token
|
|
122
|
+
* @param {string} sResponse the response message
|
|
123
|
+
*
|
|
124
|
+
* @private
|
|
119
125
|
*/
|
|
120
126
|
#processOData (oDeferred, iStatus, sCsrfToken, sResponse) {
|
|
121
127
|
if (iStatus === 200) {
|
|
@@ -131,10 +137,10 @@ sap.ui.define([
|
|
|
131
137
|
* Determines the URL for the PageSets OData service from the startup service result. If the URL is not set
|
|
132
138
|
* a hard-coded fallback URL is returned and set in the startupResult.
|
|
133
139
|
*
|
|
134
|
-
* @param {object} oStartupCallResult
|
|
135
|
-
* the
|
|
136
|
-
*
|
|
137
|
-
*
|
|
140
|
+
* @param {object} oStartupCallResult the startup service result object
|
|
141
|
+
* @returns {string} the URL for the PageSets OData service
|
|
142
|
+
*
|
|
143
|
+
* @private
|
|
138
144
|
*/
|
|
139
145
|
#getAndAdjustPageSetServiceURL (oStartupCallResult) {
|
|
140
146
|
const sSearch = this.getWindowLocationSearch();
|
|
@@ -156,10 +162,8 @@ sap.ui.define([
|
|
|
156
162
|
/**
|
|
157
163
|
* Creates the Deferred in the OData.read cache to keep the result of the request with the
|
|
158
164
|
* given URL.
|
|
159
|
-
* @param {string} sUrl
|
|
160
|
-
* the
|
|
161
|
-
* @returns {jQuery.Deferred}
|
|
162
|
-
* the deferred object which will be resolved with the response of the request
|
|
165
|
+
* @param {string} sUrl the URL to be requested
|
|
166
|
+
* @returns {jQuery.Deferred} the deferred object which will be resolved with the response of the request
|
|
163
167
|
*
|
|
164
168
|
* @private
|
|
165
169
|
*/
|
|
@@ -177,13 +181,12 @@ sap.ui.define([
|
|
|
177
181
|
|
|
178
182
|
/**
|
|
179
183
|
* Performs an OData GET request using a plain XHR.
|
|
180
|
-
* @param {string} sUrl
|
|
181
|
-
* the
|
|
182
|
-
* @param {object}
|
|
183
|
-
* the
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
* CSRF token and the response message
|
|
184
|
+
* @param {string} sUrl the url to be requested
|
|
185
|
+
* @param {object} oStartupResult the startup result object, containing the base URL and the CSRF token
|
|
186
|
+
* @param {function(number, object, function)} fnCallback callback function to be called when the request finished,
|
|
187
|
+
* taking the status code, the CSRF token and the response message
|
|
188
|
+
*
|
|
189
|
+
* @private
|
|
187
190
|
*/
|
|
188
191
|
#requestOData (sUrl, oStartupResult, fnCallback) {
|
|
189
192
|
const oXhr = XhrFactory.createAndOpen(sUrl, oStartupResult);
|
|
@@ -214,6 +217,7 @@ sap.ui.define([
|
|
|
214
217
|
* Checks if the sap-statistics setting as query parameter or via local storage, as
|
|
215
218
|
* UI5 does it in some cases.
|
|
216
219
|
* @returns {boolean} true if the sap-statistics is set as query parameter or via local storage
|
|
220
|
+
*
|
|
217
221
|
* @private
|
|
218
222
|
*/
|
|
219
223
|
#isSapStatisticsSet () {
|
|
@@ -234,6 +238,14 @@ sap.ui.define([
|
|
|
234
238
|
return !!bSapStatistics; // needed for tests only
|
|
235
239
|
}
|
|
236
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Returns the window.location.search string.
|
|
243
|
+
* Extracted as a method to allow stubbing in tests.
|
|
244
|
+
* @returns {string} The query string portion of the URL
|
|
245
|
+
*
|
|
246
|
+
* @since 1.147.0
|
|
247
|
+
* @private
|
|
248
|
+
*/
|
|
237
249
|
getWindowLocationSearch () {
|
|
238
250
|
return window.location.search;
|
|
239
251
|
}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview This module is responsible for applying ABAP-specific configuration to the ushell config.
|
|
4
|
+
*/
|
|
3
5
|
sap.ui.define([
|
|
4
6
|
"sap/base/Log",
|
|
7
|
+
"sap/base/util/ObjectPath",
|
|
5
8
|
"sap/ushell_abap/bootstrap/BootTask",
|
|
6
9
|
"sap/ushell_abap/bootstrap/ThemeHandler",
|
|
7
10
|
"sap/ushell/base/requireAsync",
|
|
8
|
-
"sap/ushell/bootstrap/Config"
|
|
9
|
-
"sap/base/util/ObjectPath"
|
|
11
|
+
"sap/ushell/bootstrap/Config"
|
|
10
12
|
], (
|
|
11
13
|
Log,
|
|
14
|
+
ObjectPath,
|
|
12
15
|
BootTask,
|
|
13
16
|
ThemeHandler,
|
|
14
17
|
requireAsync,
|
|
15
|
-
BootstrapConfig
|
|
16
|
-
ObjectPath
|
|
18
|
+
BootstrapConfig
|
|
17
19
|
) => {
|
|
18
20
|
"use strict";
|
|
19
21
|
|
|
@@ -102,9 +104,6 @@ sap.ui.define([
|
|
|
102
104
|
#setStartupConfigAsContainerAdapterConfig () {
|
|
103
105
|
const oUshellConfig = BootstrapConfig.get();
|
|
104
106
|
const oStartUpConfig = ObjectPath.get("startupConfig", oUshellConfig);
|
|
105
|
-
if (!oStartUpConfig) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
107
|
|
|
109
108
|
// first store systemProperties if they exist, as they should not be overridden by startupConfig
|
|
110
109
|
const oSystemProperties = ObjectPath.get("services.Container.adapter.config.systemProperties", oUshellConfig);
|
|
@@ -370,7 +369,6 @@ sap.ui.define([
|
|
|
370
369
|
/**
|
|
371
370
|
* Returns the window.location.search string.
|
|
372
371
|
* Extracted as a method to allow stubbing in tests.
|
|
373
|
-
*
|
|
374
372
|
* @returns {string} The query string portion of the URL
|
|
375
373
|
*
|
|
376
374
|
* @since 1.147.0
|
|
@@ -16,22 +16,16 @@ sap.ui.define([
|
|
|
16
16
|
) => {
|
|
17
17
|
"use strict";
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
class Setter {
|
|
20
|
+
#lastTimeoutId = null;
|
|
21
|
+
#counter = 0;
|
|
22
|
+
#timeoutCounter = 120; // 120 * 1000 ms = 2 minutes
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
let counter = 0;
|
|
25
|
-
const oDeferred = new Deferred();
|
|
26
|
-
|
|
27
|
-
// The ushell config is not yet prepared when the module is loaded, therefore set only on "run", not earlier
|
|
28
|
-
if (Setter._ushellConfig === undefined) {
|
|
29
|
-
Setter._ushellConfig = BootstrapConfig.get();
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function fnTryToSetConditions () {
|
|
24
|
+
#tryToSetConditions () {
|
|
33
25
|
if (window.Help4 !== undefined) {
|
|
34
|
-
const
|
|
26
|
+
const oUshellConfig = BootstrapConfig.get();
|
|
27
|
+
|
|
28
|
+
const oSpacesConfig = oUshellConfig.ushell.spaces;
|
|
35
29
|
const oConditions = {};
|
|
36
30
|
|
|
37
31
|
// Classic Homepage is active for the current user
|
|
@@ -39,7 +33,7 @@ sap.ui.define([
|
|
|
39
33
|
// Classic Homepage is possibly active for any user (either because it is enforced for every user or because it can be configured by the users themselves)
|
|
40
34
|
oConditions.FLPClassicHPPossActiveAllUsers = (oSpacesConfig.configurable === false && oSpacesConfig.enabled === false) || oSpacesConfig.configurable === true;
|
|
41
35
|
// Role of the used system client. Possible values: p = Production, t = Test, c = Customizing, d = Demonstration, e = Education, s = SAP reference
|
|
42
|
-
oConditions.FLPClientRole =
|
|
36
|
+
oConditions.FLPClientRole = oUshellConfig.startupConfig.clientRole;
|
|
43
37
|
|
|
44
38
|
window.Help4.API.setConditions(oConditions);
|
|
45
39
|
Log.info(`Conditions transferred to SAP Companion / SAP Help: ${JSON.stringify(oConditions)}`);
|
|
@@ -48,21 +42,32 @@ sap.ui.define([
|
|
|
48
42
|
return false;
|
|
49
43
|
}
|
|
50
44
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
run () {
|
|
46
|
+
const oDeferred = new Deferred();
|
|
47
|
+
|
|
48
|
+
function fnKeepTrying () {
|
|
49
|
+
if (this.#counter < this.#timeoutCounter) {
|
|
50
|
+
this.#counter++;
|
|
51
|
+
if (!this.#tryToSetConditions()) {
|
|
52
|
+
this.#lastTimeoutId = setTimeout(fnKeepTrying.bind(this), 1000);
|
|
53
|
+
} else {
|
|
54
|
+
oDeferred.resolve();
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
56
57
|
} else {
|
|
57
|
-
oDeferred.
|
|
58
|
-
return;
|
|
58
|
+
oDeferred.reject(new Error("Timeout reached while trying to set conditions"));
|
|
59
59
|
}
|
|
60
|
-
} else {
|
|
61
|
-
oDeferred.reject(new Error("Timeout reached while trying to set conditions"));
|
|
62
60
|
}
|
|
61
|
+
|
|
62
|
+
fnKeepTrying.call(this);
|
|
63
|
+
return oDeferred.promise;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
reset () {
|
|
67
|
+
clearTimeout(this.#lastTimeoutId);
|
|
68
|
+
this.#counter = 0;
|
|
63
69
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return Setter;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return new Setter();
|
|
68
73
|
});
|
|
@@ -1,29 +1,39 @@
|
|
|
1
1
|
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview This module is responsible for handling requests to the start-up OData service.
|
|
4
|
+
*/
|
|
2
5
|
sap.ui.define([
|
|
3
|
-
"sap/ushell_abap/bootstrap/XhrFactory",
|
|
4
|
-
"sap/ushell/bootstrap/Config",
|
|
5
6
|
"sap/base/util/ObjectPath",
|
|
7
|
+
"sap/ushell_abap/bootstrap/XhrFactory",
|
|
6
8
|
"sap/ushell_abap/pbServices/ui2/Utils",
|
|
7
|
-
"sap/ushell/base/SAPBusinessClientEnablement"
|
|
9
|
+
"sap/ushell/base/SAPBusinessClientEnablement",
|
|
10
|
+
"sap/ushell/bootstrap/Config"
|
|
8
11
|
], (
|
|
9
|
-
XhrFactory,
|
|
10
|
-
BootstrapConfig,
|
|
11
12
|
ObjectPath,
|
|
13
|
+
XhrFactory,
|
|
12
14
|
ui2Utils,
|
|
13
|
-
SAPBusinessClientEnablement
|
|
15
|
+
SAPBusinessClientEnablement,
|
|
16
|
+
BootstrapConfig
|
|
14
17
|
) => {
|
|
15
18
|
"use strict";
|
|
16
19
|
|
|
20
|
+
/**
|
|
21
|
+
* @alias sap.ushell_abap.bootstrap.StartupRequestHandler
|
|
22
|
+
* @namespace
|
|
23
|
+
* @description This class is responsible for handling requests to the start-up OData service.
|
|
24
|
+
*
|
|
25
|
+
* @since 1.147.0
|
|
26
|
+
* @private
|
|
27
|
+
*/
|
|
17
28
|
class StartupRequestHandler {
|
|
18
29
|
/**
|
|
19
30
|
* Performs the start-up request.
|
|
20
|
-
* @param {string} sQuery
|
|
21
|
-
*
|
|
22
|
-
* @
|
|
23
|
-
* The List of parameters which should be copied to the requested url
|
|
31
|
+
* @param {string} sQuery String which is added to the "/sap/bc/ui2/start_up?"
|
|
32
|
+
* @param {string[]} aParametersFromUrl The List of parameters which should be copied to the requested url
|
|
33
|
+
* @returns {Promise} Result of the GET request should be resolved
|
|
24
34
|
*
|
|
25
|
-
* @
|
|
26
|
-
*
|
|
35
|
+
* @since 1.147.0
|
|
36
|
+
* @private
|
|
27
37
|
*/
|
|
28
38
|
#requestStartup (sQuery, aParametersFromUrl) {
|
|
29
39
|
const oUshellConfig = BootstrapConfig.get();
|
|
@@ -78,12 +88,11 @@ sap.ui.define([
|
|
|
78
88
|
|
|
79
89
|
/**
|
|
80
90
|
* Performs the full start-up request (so=%2A&action=%2A).
|
|
91
|
+
* @param {boolean} bNoOData If Odata is not allowed. If true - return rejected promise.
|
|
92
|
+
* @returns {Promise} Result of the GET request should be resolved
|
|
81
93
|
*
|
|
82
|
-
* @
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @returns {Promise}
|
|
86
|
-
* Result of the GET request should be resolved
|
|
94
|
+
* @since 1.147.0
|
|
95
|
+
* @private
|
|
87
96
|
*/
|
|
88
97
|
async requestFullTM () {
|
|
89
98
|
const oResult = await this.#requestStartup("so=%2A&action=%2A&systemAliasesFormat=object", ["sap-language", "sap-client", "sap-ui2-cache-disable"]);
|
|
@@ -102,13 +111,12 @@ sap.ui.define([
|
|
|
102
111
|
/**
|
|
103
112
|
* Performs an extra request to retrieve a direct Start Request.
|
|
104
113
|
*
|
|
105
|
-
* @param {sap.ushell.services.URLParsing.DecomposedHash} oParsedHash
|
|
106
|
-
*
|
|
107
|
-
* @
|
|
108
|
-
* The parameters which should be copied to the requested url
|
|
114
|
+
* @param {sap.ushell.services.URLParsing.DecomposedHash} oParsedHash The parsed shell hash object. The object must contain semanticObject and action
|
|
115
|
+
* @param {object} oInitialKeys The parameters which should be copied to the requested url
|
|
116
|
+
* @returns {Promise} Result of the GET request should be resolved
|
|
109
117
|
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
118
|
+
* @since 1.147.0
|
|
119
|
+
* @private
|
|
112
120
|
*/
|
|
113
121
|
async requestDirectStart (oParsedHash, oInitialKeys) {
|
|
114
122
|
const sFormFactor = ui2Utils.getFormFactor();
|
|
@@ -131,6 +139,9 @@ sap.ui.define([
|
|
|
131
139
|
* If cacheId not found in config, return empty string
|
|
132
140
|
* @param {object} oContainerAdapterConfig startup config
|
|
133
141
|
* @returns {string} "&sap-cache-id=xxxx" if found, otherwise ""
|
|
142
|
+
*
|
|
143
|
+
* @since 1.147.0
|
|
144
|
+
* @private
|
|
134
145
|
*/
|
|
135
146
|
#getCacheIdAsQueryParameter (oContainerAdapterConfig) {
|
|
136
147
|
const sCacheId = ObjectPath.get("services.targetMappings.cacheId", oContainerAdapterConfig);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview This class is responsible for handling the theme determination during the ABAP bootstrap.
|
|
4
|
+
*/
|
|
3
5
|
sap.ui.define([
|
|
4
6
|
"sap/base/Log",
|
|
5
7
|
"sap/base/util/ObjectPath",
|
|
@@ -13,9 +15,30 @@ sap.ui.define([
|
|
|
13
15
|
) => {
|
|
14
16
|
"use strict";
|
|
15
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {object} BootTheme
|
|
20
|
+
* @property {string} theme The name of the theme
|
|
21
|
+
* @property {string} root The root URL for the theme, if applicable
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @alias sap.ushell_abap.bootstrap.ThemeHandler
|
|
26
|
+
* @namespace
|
|
27
|
+
* @description This class is responsible for handling the theme determination during the ABAP bootstrap.
|
|
28
|
+
*
|
|
29
|
+
* @since 1.147.0
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
16
32
|
class ThemeHandler {
|
|
17
33
|
#sIgnoredUnsafeUrlTheme = null;
|
|
18
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Fetches the startup theme and the related theme roots from the ushell config.
|
|
37
|
+
* @returns {BootTheme} An object containing the theme and theme roots
|
|
38
|
+
*
|
|
39
|
+
* @since 1.147.0
|
|
40
|
+
* @private
|
|
41
|
+
*/
|
|
19
42
|
getUI5ConfigTheme () {
|
|
20
43
|
const oUshellConfig = BootstrapConfig.get();
|
|
21
44
|
let oThemeRoots;
|
|
@@ -42,6 +65,13 @@ sap.ui.define([
|
|
|
42
65
|
};
|
|
43
66
|
}
|
|
44
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Applies the determined theme to the ContainerAdapter config.
|
|
70
|
+
* This reimplements the logic from UI5 Core to determine the theme.
|
|
71
|
+
*
|
|
72
|
+
* @since 1.147.0
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
45
75
|
setBootThemeInUserConfig () {
|
|
46
76
|
const oUshellConfig = BootstrapConfig.get();
|
|
47
77
|
|
|
@@ -73,6 +103,13 @@ sap.ui.define([
|
|
|
73
103
|
ObjectPath.set("services.Container.adapter.config.bootTheme", oBootTheme, oUshellConfig);
|
|
74
104
|
}
|
|
75
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Fetches the theme from the URL parameters, if available and valid.
|
|
108
|
+
* @returns {BootTheme|undefined} An object containing the theme and theme root, or undefined if no valid theme is found in the URL
|
|
109
|
+
*
|
|
110
|
+
* @since 1.147.0
|
|
111
|
+
* @private
|
|
112
|
+
*/
|
|
76
113
|
#getUrlTheme () {
|
|
77
114
|
const sSearch = this.getWindowLocationSearch();
|
|
78
115
|
const oUrlParameters = new URLSearchParams(sSearch);
|
|
@@ -97,6 +134,13 @@ sap.ui.define([
|
|
|
97
134
|
}
|
|
98
135
|
}
|
|
99
136
|
|
|
137
|
+
/**
|
|
138
|
+
* Fetches the theme from the ContainerAdapter config, if available.
|
|
139
|
+
* @returns {BootTheme|undefined} An object containing the theme and theme root, or undefined if no valid theme is found.
|
|
140
|
+
*
|
|
141
|
+
* @since 1.147.0
|
|
142
|
+
* @private
|
|
143
|
+
*/
|
|
100
144
|
#getContainerAdapterTheme () {
|
|
101
145
|
const oUshellConfig = BootstrapConfig.get();
|
|
102
146
|
const oContainerAdapterConfig = ObjectPath.get("services.Container.adapter.config", oUshellConfig);
|
|
@@ -120,6 +164,13 @@ sap.ui.define([
|
|
|
120
164
|
};
|
|
121
165
|
}
|
|
122
166
|
|
|
167
|
+
/**
|
|
168
|
+
* Fetches the theme from the meta tags in the HTML file, if available.
|
|
169
|
+
* @returns {BootTheme|undefined} An object containing the theme and theme root, or undefined if no valid theme is found.
|
|
170
|
+
*
|
|
171
|
+
* @since 1.147.0
|
|
172
|
+
* @private
|
|
173
|
+
*/
|
|
123
174
|
#getHtmlTheme () {
|
|
124
175
|
// set via e.g. data-sap-ui-theme="sap_horizon" as part of UI5 startup in the central
|
|
125
176
|
// Fiori launchpad html file
|
|
@@ -138,6 +189,14 @@ sap.ui.define([
|
|
|
138
189
|
}
|
|
139
190
|
}
|
|
140
191
|
|
|
192
|
+
/**
|
|
193
|
+
* Determines the theme root for a given theme, based on the container adapter config or fallback logic.
|
|
194
|
+
* @param {string} sTheme The name of the theme for which to determine the theme root
|
|
195
|
+
* @returns {string} The theme root for the given theme
|
|
196
|
+
*
|
|
197
|
+
* @since 1.147.0
|
|
198
|
+
* @private
|
|
199
|
+
*/
|
|
141
200
|
#getThemeRoot (sTheme) {
|
|
142
201
|
if (!sTheme) {
|
|
143
202
|
return "";
|
|
@@ -188,6 +247,9 @@ sap.ui.define([
|
|
|
188
247
|
* @returns {boolean}
|
|
189
248
|
* true/false if the allowlist check passed/failed
|
|
190
249
|
* false in case no allowlist was specified, not producible by flp-handler
|
|
250
|
+
*
|
|
251
|
+
* @since 1.147.0
|
|
252
|
+
* @private
|
|
191
253
|
*/
|
|
192
254
|
#isThemeSafe (sTheme) {
|
|
193
255
|
if (!sTheme.includes("@")) {
|
|
@@ -211,8 +273,10 @@ sap.ui.define([
|
|
|
211
273
|
/**
|
|
212
274
|
* Checks if ThemeRoot is part of the allowlist
|
|
213
275
|
* @param {string} sOrigin the origin of the theme root to be validated
|
|
214
|
-
*
|
|
215
276
|
* @returns {boolean} if it is part of the allowlist
|
|
277
|
+
*
|
|
278
|
+
* @since 1.147.0
|
|
279
|
+
* @private
|
|
216
280
|
*/
|
|
217
281
|
#validateThemeOrigin (sOrigin) {
|
|
218
282
|
const aArrayOfAllowedOrigins = this.#getAllowedThemeOrigins();
|
|
@@ -229,6 +293,13 @@ sap.ui.define([
|
|
|
229
293
|
});
|
|
230
294
|
}
|
|
231
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Fetches the allowed theme origins from the meta tags in the HTML file, if available.
|
|
298
|
+
* @returns {string[]} An array of allowed theme origins specified in the meta tags, or an empty array if no valid meta tag is found.
|
|
299
|
+
*
|
|
300
|
+
* @since 1.147.0
|
|
301
|
+
* @private
|
|
302
|
+
*/
|
|
232
303
|
#getAllowedThemeOrigins () {
|
|
233
304
|
const sSelector = "meta[name^='sap-allowed-theme-origins']:not([name=''])";
|
|
234
305
|
const aNodeList = Array.from(document.querySelectorAll(sSelector));
|
|
@@ -253,6 +324,9 @@ sap.ui.define([
|
|
|
253
324
|
/**
|
|
254
325
|
* If the theme is provided in the url and the theme origin is not in "sap-allowed-theme-origins" meta tag,
|
|
255
326
|
* switch to the theme from userParameters because ui5 core does not do such a switch itself.
|
|
327
|
+
*
|
|
328
|
+
* @since 1.147.0
|
|
329
|
+
* @private
|
|
256
330
|
*/
|
|
257
331
|
updateUnsafeBootTheme () {
|
|
258
332
|
if (!this.#sIgnoredUnsafeUrlTheme) {
|
|
@@ -263,10 +337,24 @@ sap.ui.define([
|
|
|
263
337
|
sap.ui.require("sap/ui/core/Theming").setTheme(this.#sIgnoredUnsafeUrlTheme);
|
|
264
338
|
}
|
|
265
339
|
|
|
340
|
+
/**
|
|
341
|
+
* Returns the window.location.search string.
|
|
342
|
+
* Extracted as a method to allow stubbing in tests.
|
|
343
|
+
* @returns {string} The query string portion of the URL
|
|
344
|
+
*
|
|
345
|
+
* @since 1.147.0
|
|
346
|
+
* @private
|
|
347
|
+
*/
|
|
266
348
|
getWindowLocationSearch () {
|
|
267
349
|
return window.location.search;
|
|
268
350
|
}
|
|
269
351
|
|
|
352
|
+
/**
|
|
353
|
+
* Resets the internal state of the ThemeHandler, used for testing purposes.
|
|
354
|
+
*
|
|
355
|
+
* @since 1.147.0
|
|
356
|
+
* @private
|
|
357
|
+
*/
|
|
270
358
|
reset () {
|
|
271
359
|
this.#sIgnoredUnsafeUrlTheme = null;
|
|
272
360
|
}
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview This module provides the XhrFactory class, which is a helper class to create and open XHR objects with common headers for the ABAP bootstrap.
|
|
4
|
+
*/
|
|
2
5
|
sap.ui.define([
|
|
3
6
|
], (
|
|
4
7
|
) => {
|
|
5
8
|
"use strict";
|
|
6
9
|
|
|
10
|
+
/**
|
|
11
|
+
* @alias sap.ushell_abap.bootstrap.XhrFactory
|
|
12
|
+
* @namespace
|
|
13
|
+
* @description Helper class to create and open XHR objects with common headers for the ABAP bootstrap.
|
|
14
|
+
*
|
|
15
|
+
* @since 1.147.0
|
|
16
|
+
* @private
|
|
17
|
+
*/
|
|
7
18
|
class XhrFactory {
|
|
8
19
|
/**
|
|
9
20
|
* Creates and opens a new XMLHttpRequest object.
|
|
10
21
|
*
|
|
11
|
-
* @param {string} sUrl
|
|
12
|
-
* The URL the XHR object should request from.
|
|
22
|
+
* @param {string} sUrl The URL the XHR object should request from.
|
|
13
23
|
* @param {object} oStartupParameters
|
|
14
24
|
* The start_up parameters. This object must
|
|
15
25
|
* contain at least the following fields:
|
|
@@ -19,27 +29,26 @@ sap.ui.define([
|
|
|
19
29
|
* "language": "<language>"
|
|
20
30
|
* }
|
|
21
31
|
* </pre>
|
|
32
|
+
* @param {string} [sHttpMethod] The Http method name with default value "GET".
|
|
33
|
+
* @returns {XMLHttpRequest} The oXHR object.
|
|
22
34
|
*
|
|
23
|
-
* @
|
|
24
|
-
*
|
|
25
|
-
* @returns {object}
|
|
26
|
-
* The oXHR object.
|
|
35
|
+
* @since 1.147.0
|
|
36
|
+
* @private
|
|
27
37
|
*/
|
|
28
38
|
createAndOpen (sUrl, oStartupParameters, sHttpMethod) {
|
|
29
39
|
sHttpMethod = sHttpMethod || "GET";
|
|
30
40
|
const oXhr = new XMLHttpRequest();
|
|
31
41
|
oXhr.open(sHttpMethod, sUrl, /* async=*/true);
|
|
32
42
|
if (oStartupParameters) {
|
|
33
|
-
this.#
|
|
43
|
+
this.#addStandardHeadersToXhr(oXhr, oStartupParameters);
|
|
34
44
|
}
|
|
35
45
|
return oXhr;
|
|
36
46
|
}
|
|
37
47
|
|
|
38
48
|
/**
|
|
39
|
-
* Adds
|
|
40
|
-
*
|
|
41
|
-
* @param {object} oXhr Instance of XMLHttpRequest object
|
|
49
|
+
* Adds standard headers to the given XHR object. This method is ideal to be used whenever the request should be made with certain headers.
|
|
42
50
|
*
|
|
51
|
+
* @param {XMLHttpRequest} oXhr Instance of XMLHttpRequest object
|
|
43
52
|
* @param {object} oStartupResultLikeObject
|
|
44
53
|
* An object that looks like the start_up result. This object must
|
|
45
54
|
* contain at least the following fields:
|
|
@@ -49,11 +58,12 @@ sap.ui.define([
|
|
|
49
58
|
* "language": "<language>"
|
|
50
59
|
* }
|
|
51
60
|
* </pre>
|
|
61
|
+
* @returns {XMLHttpRequest} The input oXHR object amended with headers.
|
|
52
62
|
*
|
|
53
|
-
* @
|
|
54
|
-
*
|
|
63
|
+
* @since 1.147.0
|
|
64
|
+
* @private
|
|
55
65
|
*/
|
|
56
|
-
#
|
|
66
|
+
#addStandardHeadersToXhr (oXhr, oStartupResultLikeObject) {
|
|
57
67
|
oXhr.setRequestHeader("Accept", "application/json");
|
|
58
68
|
if (oStartupResultLikeObject.client) {
|
|
59
69
|
oXhr.setRequestHeader("sap-client", oStartupResultLikeObject.client);
|