@sapui5/sap.ushell_abap 1.139.0 → 1.141.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.
Files changed (55) hide show
  1. package/package.json +2 -2
  2. package/src/main/js/sap/ushell_abap/.library +1 -1
  3. package/src/main/js/sap/ushell_abap/adapters/abap/AdapterContainer.js +19 -13
  4. package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +11 -11
  5. package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +81 -81
  6. package/src/main/js/sap/ushell_abap/adapters/abap/CommonDataModelAdapter.js +1 -1
  7. package/src/main/js/sap/ushell_abap/adapters/abap/ConfigurationDefaultsAdapter.js +1 -2
  8. package/src/main/js/sap/ushell_abap/adapters/abap/ContainerAdapter.js +15 -17
  9. package/src/main/js/sap/ushell_abap/adapters/abap/FlpLaunchPageAdapter.js +230 -167
  10. package/src/main/js/sap/ushell_abap/adapters/abap/LaunchPageAdapter.js +1 -1
  11. package/src/main/js/sap/ushell_abap/adapters/abap/MenuAdapter.js +1 -1
  12. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionAdapter.js +1 -1
  13. package/src/main/js/sap/ushell_abap/adapters/abap/NavTargetResolutionInternalAdapter.js +1 -1
  14. package/src/main/js/sap/ushell_abap/adapters/abap/PageBuildingAdapter.js +10 -12
  15. package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +20 -17
  16. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationAdapter.js +5 -5
  17. package/src/main/js/sap/ushell_abap/adapters/abap/PersonalizationV2Adapter.js +1 -1
  18. package/src/main/js/sap/ushell_abap/adapters/abap/SearchAdapter.js +1 -1
  19. package/src/main/js/sap/ushell_abap/adapters/abap/SupportTicketAdapter.js +2 -2
  20. package/src/main/js/sap/ushell_abap/adapters/abap/Ui5ComponentLoaderAdapter.js +1 -1
  21. package/src/main/js/sap/ushell_abap/adapters/abap/UserInfoAdapter.js +34 -28
  22. package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +1 -1
  23. package/src/main/js/sap/ushell_abap/bootstrap/evo/SAPCompanionConditionSetter.js +5 -5
  24. package/src/main/js/sap/ushell_abap/bootstrap/evo/XhrLogonEventHandler.js +5 -2
  25. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.bootstrap.utils.js +2 -2
  26. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.configure.ushell.js +1 -1
  27. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.pageset.js +54 -31
  28. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.request.startup.js +17 -13
  29. package/src/main/js/sap/ushell_abap/bootstrap/evo/abap.theme.handler.js +2 -1
  30. package/src/main/js/sap/ushell_abap/bootstrap/evo/boottask.js +85 -74
  31. package/src/main/js/sap/ushell_abap/components/TCodeNavigation/MessageCode.js +47 -0
  32. package/src/main/js/sap/ushell_abap/components/TCodeNavigation/TCodeNavigationError.js +59 -0
  33. package/src/main/js/sap/ushell_abap/components/TCodeNavigation.js +163 -0
  34. package/src/main/js/sap/ushell_abap/integration/fileshares/AppRuntimeFileShareSupport.js +4 -4
  35. package/src/main/js/sap/ushell_abap/library.js +8 -1
  36. package/src/main/js/sap/ushell_abap/pbServices/ui2/AllCatalogs.js +2 -2
  37. package/src/main/js/sap/ushell_abap/pbServices/ui2/Bag.js +15 -19
  38. package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +19 -17
  39. package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +14 -23
  40. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipDefinition.js +4 -5
  41. package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipInstance.js +8 -13
  42. package/src/main/js/sap/ushell_abap/pbServices/ui2/Error.js +2 -2
  43. package/src/main/js/sap/ushell_abap/pbServices/ui2/Factory.js +12 -20
  44. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataService.js +9 -12
  45. package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +45 -33
  46. package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +3 -5
  47. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +19 -22
  48. package/src/main/js/sap/ushell_abap/pbServices/ui2/PageSet.js +9 -10
  49. package/src/main/js/sap/ushell_abap/pbServices/ui2/RemoteCatalogService.js +2 -2
  50. package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +19 -69
  51. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/actions.js +3 -4
  52. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +1 -1
  53. package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/visible.js +2 -2
  54. package/src/main/js/sap/ushell_abap/ui5appruntime/AppInfoAdapter.js +2 -2
  55. package/ui5.yaml +33 -1
@@ -4,7 +4,7 @@
4
4
  * @fileOverview The Unified Shell's page building adapter for the ABAP platform.
5
5
  *
6
6
  * @deprecated since 1.100
7
- * @version 1.139.0
7
+ * @version 1.141.0
8
8
  */
9
9
  sap.ui.define([
10
10
  "sap/ushell_abap/adapters/abap/FlpLaunchPageAdapter"
@@ -31,7 +31,7 @@ sap.ui.define([
31
31
  * @since 1.72.0
32
32
  * @private
33
33
  */
34
- const MenuAdapter = function () { };
34
+ function MenuAdapter () { }
35
35
 
36
36
  /**
37
37
  * Returns whether the menu is enabled
@@ -8,7 +8,7 @@
8
8
  * service now calls the ClientSideTargetResolution service in the ABAP
9
9
  * platform.
10
10
  *
11
- * @version 1.139.0
11
+ * @version 1.141.0
12
12
  */
13
13
  sap.ui.define([], () => {
14
14
  "use strict";
@@ -8,7 +8,7 @@
8
8
  * service now calls the ClientSideTargetResolution service in the ABAP
9
9
  * platform.
10
10
  *
11
- * @version 1.139.0
11
+ * @version 1.141.0
12
12
  * @since 1.121
13
13
  */
14
14
  sap.ui.define([], () => {
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @fileOverview The Unified Shell's page building adapter for the ABAP platform.
5
- * @version 1.139.0
5
+ * @version 1.141.0
6
6
  */
7
7
  sap.ui.define([
8
8
  "sap/base/util/ObjectPath",
@@ -67,22 +67,12 @@ sap.ui.define([
67
67
  * @private
68
68
  */
69
69
  return function (oSystem, sParameter, oProperties) {
70
- let oFactory;
71
70
  let sScope = "PERS";
72
71
  let sPageBuilderServiceUrl = "/sap/opu/odata/UI2/PAGE_BUILDER_PERS/"; // 3rd Priority (fallback)
73
72
  const mRemoteCatalogServices = oProperties.config.remoteCatalogServices || {};
74
73
  const sConfigBaseUrl = ObjectPath.get("config.services.pageBuilding.baseUrl", oProperties);
75
74
 
76
75
  // BEWARE: constructor code below!
77
-
78
- /**
79
- * Returns the UI2 page building factory.
80
- * @returns {sap.ushell_abap.pbServices.ui2.Factory} the page building factory
81
- */
82
- this.getFactory = function () {
83
- return oFactory;
84
- };
85
-
86
76
  // constructor code -------------------------------------------------------
87
77
 
88
78
  // accept lower case parameter as in FLPD this is set as query parameter the user alters manually
@@ -102,13 +92,21 @@ sap.ui.define([
102
92
  // Get CacheId for PAGE_BUILDER_PERS when available
103
93
  const sCacheId = ObjectPath.get("sap-ushell-config.services.Container.adapter.config.services.pbFioriHome.cacheId");
104
94
 
105
- oFactory = Factory.createFactory(
95
+ const oFactory = Factory.createFactory(
106
96
  sPageBuilderServiceUrl,
107
97
  undefined,
108
98
  sScope === "PERS",
109
99
  sCacheId
110
100
  );
111
101
 
102
+ /**
103
+ * Returns the UI2 page building factory.
104
+ * @returns {sap.ushell_abap.pbServices.ui2.Factory} the page building factory
105
+ */
106
+ this.getFactory = function () {
107
+ return oFactory;
108
+ };
109
+
112
110
  /**
113
111
  * Remote Catalogs are deprecated
114
112
  * @deprecated since 1.120
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @fileOverview PagePersistenceAdapter for the ABAP platform.
5
- * @version 1.139.0
5
+ * @version 1.141.0
6
6
  */
7
7
  sap.ui.define([
8
8
  "sap/base/i18n/Localization",
@@ -10,16 +10,16 @@ sap.ui.define([
10
10
  "sap/ushell/utils/HttpClient",
11
11
  "sap/ushell/resources",
12
12
  "sap/ushell/utils/chipsUtils",
13
- "sap/ushell/Config",
14
- "sap/ushell/Container"
13
+ "sap/ushell/Container",
14
+ "sap/ushell/utils/LaunchpadError"
15
15
  ], (
16
16
  Localization,
17
17
  ObjectPath,
18
18
  HttpClient,
19
- resources,
19
+ ushellResources,
20
20
  chipsUtils,
21
- Config,
22
- Container
21
+ Container,
22
+ LaunchpadError
23
23
  ) => {
24
24
  "use strict";
25
25
 
@@ -42,9 +42,9 @@ sap.ui.define([
42
42
  * @experimental Since 1.67.0
43
43
  * @private
44
44
  */
45
- const PagePersistenceAdapter = function () {
45
+ function PagePersistenceAdapter () {
46
46
  this.S_COMPONENT_NAME = "sap.ushell_abap.adapters.abap.PagePersistenceAdapter";
47
- };
47
+ }
48
48
 
49
49
  /**
50
50
  * Returns a page
@@ -362,7 +362,7 @@ sap.ui.define([
362
362
  let oConfiguration;
363
363
  try {
364
364
  oConfiguration = JSON.parse(oVisualization.configuration);
365
- } catch (err) {
365
+ } catch {
366
366
  oConfiguration = {};
367
367
  }
368
368
 
@@ -389,19 +389,22 @@ sap.ui.define([
389
389
  };
390
390
 
391
391
  /**
392
- * @param {object} error The error object
392
+ * @param {Error} oError The error object
393
393
  * @returns {Promise<object>} A rejected promise containing the error
394
394
  *
395
395
  * @experimental Since 1.67.0
396
396
  * @private
397
397
  */
398
- PagePersistenceAdapter.prototype._rejectWithError = function (error) {
399
- const oError = {
400
- component: this.S_COMPONENT_NAME,
401
- description: resources.i18n.getText("PagePersistenceAdapter.CannotLoadPage"),
402
- detail: error
403
- };
404
- return Promise.reject(oError);
398
+ PagePersistenceAdapter.prototype._rejectWithError = async function (oError) {
399
+ throw new LaunchpadError(
400
+ oError.message,
401
+ {
402
+ component: this.S_COMPONENT_NAME,
403
+ description: ushellResources.i18n.getText("PagePersistenceAdapter.CannotLoadPage"),
404
+ detail: oError
405
+ },
406
+ oError
407
+ );
405
408
  };
406
409
 
407
410
  return PagePersistenceAdapter;
@@ -7,7 +7,7 @@
7
7
  * Container header properties transported via pseudo-items are mapped to the
8
8
  * respective header properties in setItem/getItem/delItem
9
9
  *
10
- * @version 1.139.0
10
+ * @version 1.141.0
11
11
  */
12
12
  sap.ui.define([
13
13
  "sap/ushell_abap/adapters/abap/AdapterContainer",
@@ -44,7 +44,7 @@ sap.ui.define([
44
44
  * @since 1.11.0
45
45
  * @private
46
46
  */
47
- const PersonalizationAdapter = function (oSystem, sParameters, oConfig) {
47
+ function PersonalizationAdapter (oSystem, sParameters, oConfig) {
48
48
  Log.debug("[000] PersonalizationAdapter: constructor", "PersonalizationAdapter");
49
49
  this._oConfig = oConfig && oConfig.config;
50
50
  const sPersonalizationServiceURL = `${ObjectPath.get("config.services.personalization.baseUrl", oConfig) || "/sap/opu/odata/UI2/INTEROP"}/`;
@@ -54,11 +54,11 @@ sap.ui.define([
54
54
  "sap-client": Container.getLogonSystem().getClient()
55
55
  };
56
56
  this._oWrapper = ODataWrapper.createODataWrapper(oODataWrapperSettings);
57
- function fnDefaultFailure (oMessage) {
58
- throw new SrvcError(oMessage, "sap.ushell_abap.adapters.abap.PersonalizationAdapter");
57
+ function fnDefaultFailure (sErrorMessage) {
58
+ throw new SrvcError(sErrorMessage, "sap.ushell_abap.adapters.abap.PersonalizationAdapter");
59
59
  }
60
60
  ODataService.call(this, this._oWrapper, fnDefaultFailure);
61
- };
61
+ }
62
62
 
63
63
  // historically, the service always called getAdapterContainer and then load
64
64
  // thus an implementation was not required to initialize a fully implemented container on getAdapterContainer
@@ -7,7 +7,7 @@
7
7
  * Container header properties transported via pseudo-items are mapped to the
8
8
  * respective header properties in setItem/getItem/delItem
9
9
  *
10
- * @version 1.139.0
10
+ * @version 1.141.0
11
11
  */
12
12
  sap.ui.define([
13
13
  "./PersonalizationAdapter"
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @fileOverview The Search adapter for the ABAP platform.
5
- * @version 1.139.0
5
+ * @version 1.141.0
6
6
  */
7
7
  sap.ui.define([], () => {
8
8
  "use strict";
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @fileOverview The SupportTicket adapter for the ABAP platform.
5
- * @version 1.139.0
5
+ * @version 1.141.0
6
6
  */
7
7
  sap.ui.define([
8
8
  "sap/base/util/isEmptyObject",
@@ -100,7 +100,7 @@ sap.ui.define([
100
100
  oDataWrapper.create(sRelativeUrl, oSupportTicketData, (response) => {
101
101
  fnResolve(response.messageNumber);
102
102
  }, (sErrorMessage) => {
103
- fnReject(sErrorMessage);
103
+ fnReject(new Error(sErrorMessage));
104
104
  });
105
105
  });
106
106
 
@@ -2,7 +2,7 @@
2
2
  /**
3
3
  * @fileOverview The Unified Shell's Ui5ComponentLoaderAdapter for the ABAP platform
4
4
  *
5
- * @version 1.139.0
5
+ * @version 1.141.0
6
6
  */
7
7
  sap.ui.define([
8
8
  ], () => {
@@ -7,15 +7,17 @@ sap.ui.define([
7
7
  "sap/ui/VersionInfo",
8
8
  "sap/base/Log",
9
9
  "sap/ushell/resources",
10
- "sap/base/i18n/date/CalendarWeekNumbering"
10
+ "sap/base/i18n/date/CalendarWeekNumbering",
11
+ "sap/ushell/utils/LaunchpadError"
11
12
  ], (
12
13
  ODataWrapper,
13
- OData,
14
+ datajs,
14
15
  jQuery,
15
16
  VersionInfo,
16
17
  Log,
17
18
  resources,
18
- CalendarWeekNumbering
19
+ CalendarWeekNumbering,
20
+ LaunchpadError
19
21
  ) => {
20
22
  "use strict";
21
23
 
@@ -97,18 +99,21 @@ sap.ui.define([
97
99
  themeRoot: oThemeList.themeRoot
98
100
  });
99
101
  })
100
- .catch((error) => {
101
- Log.error(error, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
102
+ .catch((oError) => {
103
+ Log.error(oError.message, oError, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
102
104
  // fallback to the previous implementation via /UI2/INTEROP
103
- OData.read({requestUri: "/sap/opu/odata/UI2/INTEROP/Themes"},
105
+ datajs.read({requestUri: "/sap/opu/odata/UI2/INTEROP/Themes"},
104
106
  (oData) => { // success
105
107
  oDeferred.resolve({
106
108
  options: oData?.results || []
107
109
  });
108
110
  },
109
- (oError) => { // fail
110
- Log.error(oError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
111
- oDeferred.reject(oError.message);
111
+ (oDataJsError) => { // fail
112
+ Log.error(oDataJsError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
113
+ const oError = new LaunchpadError(`Failed to fetch data: ${oDataJsError.message}`, {
114
+ dataJsError: oDataJsError
115
+ });
116
+ oDeferred.reject(oError);
112
117
  });
113
118
  });
114
119
 
@@ -150,7 +155,7 @@ sap.ui.define([
150
155
  const sUri = encodeURI("/sap/opu/odata/UI2/INTEROP/UserProfilePropertyValues?$filter=id eq 'PREFERRED_LOGON_LANGUAGE'");
151
156
 
152
157
  // read semantic objects from interop service
153
- OData.read({ requestUri: sUri },
158
+ datajs.read({ requestUri: sUri },
154
159
  // sucess
155
160
  (oData) => {
156
161
  let aResult = [{
@@ -170,9 +175,12 @@ sap.ui.define([
170
175
  oDeferred.resolve(aResult);
171
176
  },
172
177
  // fail
173
- (oError) => {
174
- Log.error(oError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
175
- oDeferred.reject(oError.message);
178
+ (oDataJsError) => {
179
+ Log.error(oDataJsError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
180
+ const oError = new LaunchpadError(`Failed to fetch data: ${oDataJsError.message}`, {
181
+ dataJsError: oDataJsError
182
+ });
183
+ oDeferred.reject(oError);
176
184
  });
177
185
 
178
186
  return oDeferred.promise();
@@ -229,8 +237,8 @@ sap.ui.define([
229
237
  oResult[this] = oData.results;
230
238
  }.bind(sCurrentId),
231
239
  // error
232
- (oError) => {
233
- Log.error(oError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
240
+ (sErrorMessage) => {
241
+ Log.error(sErrorMessage, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
234
242
  }
235
243
  );
236
244
  }
@@ -241,9 +249,9 @@ sap.ui.define([
241
249
  oDeferred.resolve(oResult);
242
250
  },
243
251
  // error
244
- (oError) => {
245
- Log.error(oError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
246
- oDeferred.reject(oError.message);
252
+ (sErrorMessage) => {
253
+ Log.error(sErrorMessage, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
254
+ oDeferred.reject(new Error(sErrorMessage));
247
255
  }
248
256
  );
249
257
 
@@ -251,7 +259,7 @@ sap.ui.define([
251
259
  };
252
260
 
253
261
  this._createWrapper = function (sBaseUrl) {
254
- return ODataWrapper.createODataWrapper(sBaseUrl, false, (sError) => { /* default error handler */ });
262
+ return ODataWrapper.createODataWrapper(sBaseUrl, false, (sErrorMessage) => { /* default error handler */ });
255
263
  };
256
264
 
257
265
  /**
@@ -264,30 +272,28 @@ sap.ui.define([
264
272
  this.updateUserPreferences = function (oUser) {
265
273
  Log.debug("[000] updateUserPreferences", "UserInfoAdapter");
266
274
  const that = this;
267
- let oDeferred;
268
275
  let sRelativeUrl;
269
- let aUserChangedProperties;
270
276
  let iODataRequestsRunning;
271
277
  let oDataObj;
272
- const fnSuccess = function () {
278
+ const oDeferred = new jQuery.Deferred();
279
+ function fnSuccess () {
273
280
  iODataRequestsRunning -= 1;
274
281
  if (iODataRequestsRunning === 0) {
275
282
  oDeferred.resolve();
276
283
  }
277
- };
278
- const fnFailure = function (sErrorMessage, oParsedErrorInformation) {
279
- oDeferred.reject(sErrorMessage, oParsedErrorInformation);
280
- };
284
+ }
285
+ function fnFailure (sErrorMessage, oParsedErrorInformation) {
286
+ oDeferred.reject(new Error(sErrorMessage), oParsedErrorInformation);
287
+ }
281
288
  Log.debug("[000] updateUserPreferences: _createWrapper", "UserInfoAdapter");
282
289
  oDataWrapper = this._createWrapper("/sap/opu/odata/UI2/INTEROP/");
283
- oDeferred = new jQuery.Deferred();
284
290
 
285
291
  // prepare
286
292
  Log.debug("[000] updateUserPreferences: oDataWrapper.openBatchQueue", "UserInfoAdapter");
287
293
  oDataWrapper.openBatchQueue();
288
294
 
289
295
  // put the preferences to update in the OData batch queue
290
- aUserChangedProperties = oUser.getChangedProperties() || [];
296
+ const aUserChangedProperties = oUser.getChangedProperties() || [];
291
297
  Log.debug("[000] updateUserPreferences: getChangedProperties", "UserInfoAdapter");
292
298
  iODataRequestsRunning = aUserChangedProperties.length;
293
299
  aUserChangedProperties.forEach((oUserChangedProperty) => {
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * @fileOverview The Unified Shell's container adapter for the HANA platform.
5
5
  *
6
- * @version 1.139.0
6
+ * @version 1.141.0
7
7
  */
8
8
  sap.ui.define([
9
9
  "sap/ui/thirdparty/jquery",
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  Setter._ushellConfig = window["sap-ushell-config"];
28
28
  }
29
29
 
30
- const fnTryToSetConditions = function () {
30
+ function fnTryToSetConditions () {
31
31
  if (window.Help4 !== undefined) {
32
32
  const oSpacesConfig = Setter._ushellConfig.ushell.spaces;
33
33
  const oConditions = {};
@@ -44,9 +44,9 @@ sap.ui.define([
44
44
  return true;
45
45
  }
46
46
  return false;
47
- };
47
+ }
48
48
 
49
- const fnKeepTrying = function () {
49
+ function fnKeepTrying () {
50
50
  if (counter < Setter._timeoutCounter) {
51
51
  counter++;
52
52
  if (!fnTryToSetConditions()) {
@@ -56,9 +56,9 @@ sap.ui.define([
56
56
  return;
57
57
  }
58
58
  } else {
59
- oDeferred.reject();
59
+ oDeferred.reject(new Error("Timeout reached while trying to set conditions"));
60
60
  }
61
- };
61
+ }
62
62
  fnKeepTrying();
63
63
  return oDeferred.promise;
64
64
  };
@@ -17,6 +17,8 @@ sap.ui.define([
17
17
 
18
18
  /**
19
19
  * Helper class for handling events from XHR logon frame provider
20
+ * @param {Window} [oWindow=window] - the window object to use for reloading the page
21
+ * @param {string} [sXhrLogonMode="reload"] - the XHR logon mode, either "reload" or "logoffAndRedirect"
20
22
  *
21
23
  * @private
22
24
  */
@@ -126,9 +128,8 @@ sap.ui.define([
126
128
  XhrLogonEventHandler.prototype._logoffAndRedirect = function () {
127
129
  const sLocationHref = oAbapUtils.getLocationHref();
128
130
  const sClientId = ObjectPath.get("sap-ushell-config.services.Container.adapter.config.client");
129
- let sUrl;
130
131
 
131
- sUrl = new URI("/sap/public/bc/icf/logoff")
132
+ const sUrl = new URI("/sap/public/bc/icf/logoff")
132
133
  .absoluteTo(sLocationHref)
133
134
  .search(`sap-client=${sClientId}&propagateLogoff=false&redirectURL=${encodeURIComponent(sLocationHref)}`)
134
135
  .toString();
@@ -138,6 +139,8 @@ sap.ui.define([
138
139
  /**
139
140
  * Checks if the page is currently being reloaded by the XHR logon which triggers this by setting query-parameter sap-ushell-reloaded
140
141
  *
142
+ * @returns {boolean} true if the page is reloaded, false otherwise
143
+ *
141
144
  * @private
142
145
  */
143
146
  XhrLogonEventHandler.prototype._isPageReloaded = function () {
@@ -153,7 +153,7 @@ sap.ui.define([
153
153
  */
154
154
  utils.getLocationOrigin = function () {
155
155
  // location.origin might not be supported by all browsers
156
- return `${location.protocol}//${location.host}`;
156
+ return `${window.location.protocol}//${window.location.host}`;
157
157
  };
158
158
 
159
159
  /**
@@ -165,7 +165,7 @@ sap.ui.define([
165
165
  * @private
166
166
  */
167
167
  utils.getLocationHref = function () {
168
- return location.href;
168
+ return window.location.href;
169
169
  };
170
170
 
171
171
  return utils;
@@ -14,7 +14,7 @@
14
14
  * It furthermore calculates if FLP pages get activated and if needed sets up
15
15
  * the configuration environment to run these.
16
16
  *
17
- * @version 1.139.0
17
+ * @version 1.141.0
18
18
  */
19
19
  sap.ui.define([
20
20
  "./abap.constants",
@@ -28,36 +28,22 @@ sap.ui.define([
28
28
  // Check (only once for this file) if sap-statistics is set in query parameter or local storage
29
29
  let bSapStatistics = BootstrapUtils.isSapStatisticsSet();
30
30
 
31
- function requestPageSet (oStartupResult) {
32
- const sPageSetServiceUrl = getAndAdjustPageSetServiceURL(oStartupResult);
33
- const oDeferred = createODataDeferred(sPageSetServiceUrl);// TODO make as Promise.all
34
-
35
- requestOData(sPageSetServiceUrl, oStartupResult, (iStatus, sCsrfToken, sResponse) => {
36
- processOData(oDeferred, iStatus, sCsrfToken, sResponse);
37
- });
38
- }
39
-
40
- /**
41
- * Determines the URL for the PageSets OData service from the startup service result. If the URL is not set
42
- * a hard-coded fallback URL is returned and set in the startupResult.
43
- */
44
- function getAndAdjustPageSetServiceURL (oStartupCallResult) {
45
- const sUI2CacheDisable = oAbapUtils.getUrlParameterValue("sap-ui2-cache-disable");
46
- if (sUI2CacheDisable && oStartupCallResult && oStartupCallResult.services && oStartupCallResult.services.pbFioriHome) {
47
- oStartupCallResult.services.pbFioriHome["sap-ui2-cache-disable"] = sUI2CacheDisable;
48
- }
49
- return getAndAdjustServiceURL(
50
- oStartupCallResult,
51
- "pbFioriHome",
52
- S_PAGE_SETS_FALLBACK_URL_BASE,
53
- S_PAGE_SETS_FALLBACK_URL_RELATIVE,
54
- S_PAGE_SETS_FALLBACK_EXPAND
55
- );
56
- }
57
-
58
31
  /**
59
32
  * Determines the URL for the PageSets OData service from the startup service result. If the URL is not set
60
33
  * a hard-coded fallback URL is returned and set in the startupResult.
34
+ *
35
+ * @param {object} oStartupCallResult
36
+ * the startup service result object
37
+ * @param {string} sServicePropertyName
38
+ * the name of the service property in the startup result
39
+ * @param {string} sFallbackBaseUrl
40
+ * the fallback base URL to be used if the service URL is not set
41
+ * @param {string} sFallbackRelativeUrl
42
+ * the fallback relative URL to be used if the service URL is not set
43
+ * @param {string} sFallbackExpand
44
+ * the fallback expand parameter to be used if the service URL is not set
45
+ * @returns {string}
46
+ * the URL for the service, adjusted with the fallback values if necessary
61
47
  */
62
48
  function getAndAdjustServiceURL (oStartupCallResult, sServicePropertyName, sFallbackBaseUrl, sFallbackRelativeUrl, sFallbackExpand) {
63
49
  let sServiceUrl;
@@ -139,15 +125,40 @@ sap.ui.define([
139
125
  } else {
140
126
  // rejecting the deferred will make the request later (in the ushell adapter) fail, so
141
127
  // the error handling there takes effect
142
- oDeferred.reject(sResponse);
128
+ oDeferred.reject(new Error(`PageSet request failed: ${sResponse}`));
143
129
  }
144
130
  }
145
131
 
132
+ /**
133
+ * Determines the URL for the PageSets OData service from the startup service result. If the URL is not set
134
+ * a hard-coded fallback URL is returned and set in the startupResult.
135
+ *
136
+ * @param {object} oStartupCallResult
137
+ * the startup service result object
138
+ * @returns {string}
139
+ * the URL for the PageSets OData service
140
+ */
141
+ function getAndAdjustPageSetServiceURL (oStartupCallResult) {
142
+ const sUI2CacheDisable = oAbapUtils.getUrlParameterValue("sap-ui2-cache-disable");
143
+ if (sUI2CacheDisable && oStartupCallResult && oStartupCallResult.services && oStartupCallResult.services.pbFioriHome) {
144
+ oStartupCallResult.services.pbFioriHome["sap-ui2-cache-disable"] = sUI2CacheDisable;
145
+ }
146
+ return getAndAdjustServiceURL(
147
+ oStartupCallResult,
148
+ "pbFioriHome",
149
+ S_PAGE_SETS_FALLBACK_URL_BASE,
150
+ S_PAGE_SETS_FALLBACK_URL_RELATIVE,
151
+ S_PAGE_SETS_FALLBACK_EXPAND
152
+ );
153
+ }
154
+
146
155
  /**
147
156
  * Creates the Deferred in the OData.read cache to keep the result of the request with the
148
157
  * given URL.
149
158
  * @param {string} sUrl
159
+ * the URL to be requested
150
160
  * @returns {jQuery.Deferred}
161
+ * the deferred object which will be resolved with the response of the request
151
162
  *
152
163
  * @private
153
164
  */
@@ -165,13 +176,16 @@ sap.ui.define([
165
176
 
166
177
  /**
167
178
  * Performs an OData GET request using a plain XHR.
168
- * @param {function(number, object, function)}
179
+ * @param {string} sUrl
180
+ * the url to be requested
181
+ * @param {object} oStartupResult
182
+ * the startup result object, containing the base URL and the CSRF token
183
+ * @param {function(number, object, function)} fnCallback
169
184
  * callback function to be called when the request finished, taking the status code, the
170
185
  * CSRF token and the response message
171
186
  */
172
187
  function requestOData (sUrl, oStartupResult, fnCallback) {
173
- let oXHR;
174
- oXHR = oAbapUtils.createAndOpenXHR(sUrl, oStartupResult);
188
+ const oXHR = oAbapUtils.createAndOpenXHR(sUrl, oStartupResult);
175
189
  // set sap-statistics header, see
176
190
  // http://help.sap.com/saphelp_nw74/helpdata/de/40/93b81292194d6a926e105c10d5048d/content.htm
177
191
  if (bSapStatistics) {
@@ -186,6 +200,15 @@ sap.ui.define([
186
200
  oXHR.send();
187
201
  }
188
202
 
203
+ function requestPageSet (oStartupResult) {
204
+ const sPageSetServiceUrl = getAndAdjustPageSetServiceURL(oStartupResult);
205
+ const oDeferred = createODataDeferred(sPageSetServiceUrl);// TODO make as Promise.all
206
+
207
+ requestOData(sPageSetServiceUrl, oStartupResult, (iStatus, sCsrfToken, sResponse) => {
208
+ processOData(oDeferred, iStatus, sCsrfToken, sResponse);
209
+ });
210
+ }
211
+
189
212
  oPagesetHandler.requestPageSet = requestPageSet;
190
213
  oPagesetHandler._getAndAdjustServiceURL = getAndAdjustServiceURL; // Only for testing
191
214
  oPagesetHandler._getAndAdjustPageSetServiceURL = getAndAdjustPageSetServiceURL; // Only for testing