@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
@@ -11,6 +11,13 @@ sap.ui.define([
11
11
  ) => {
12
12
  "use strict";
13
13
 
14
+ /**
15
+ * @namespace sap.ushell_abap.components
16
+ * @since 1.121.0
17
+ * @private
18
+ * @ui5-restricted
19
+ */
20
+
14
21
  /**
15
22
  * SAP library: sap.ushell_abap
16
23
  * provides base functions for Fiori launchpad running on SAP NetWeaver ABAP
@@ -23,7 +30,7 @@ sap.ui.define([
23
30
  const ushellAbapLib = Library.init({
24
31
  name: "sap.ushell_abap",
25
32
  apiVersion: 2,
26
- version: "1.139.0",
33
+ version: "1.141.0",
27
34
  dependencies: ["sap.ui.core", "sap.m"],
28
35
  noLibraryCSS: true,
29
36
  extensions: {
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @class
39
39
  * @since 1.7.0
40
40
  */
41
- const AllCatalogs = function (oFactory, sPageId) {
41
+ function AllCatalogs (oFactory, sPageId) {
42
42
  let aCatalogs = [];
43
43
  let bIsStub = true;
44
44
  const that = this;
@@ -180,7 +180,7 @@ sap.ui.define([
180
180
  throw new SrvcError("Missing page ID", "AllCatalogs");
181
181
  }
182
182
  Log.debug(`Created: ${this}`, null, "AllCatalogs");
183
- };
183
+ }
184
184
 
185
185
  return AllCatalogs;
186
186
  });
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * @class
40
40
  * @since 1.3.0
41
41
  */
42
- const Bag = function (oFactory, oAlterEgo, oParentBag, fnChangeListener) {
42
+ function Bag (oFactory, oAlterEgo, oParentBag, fnChangeListener) {
43
43
  let oPropertiesByName;
44
44
  let bResetting = false;
45
45
  let bSaving = false;
@@ -121,8 +121,6 @@ sap.ui.define([
121
121
  * @private
122
122
  */
123
123
  function getNames (aNames, bTranslatable) {
124
- let oNameSet;
125
-
126
124
  if (aNames.length === 0) { // no parent names --> no duplicates expected, run faster code
127
125
  oPropertiesByName.keys().forEach((sKey) => {
128
126
  if (bTranslatable === (oPropertiesByName.get(sKey).translatable === "X")) {
@@ -133,7 +131,7 @@ sap.ui.define([
133
131
  }
134
132
 
135
133
  // parent names present --> expect duplicates and avoid them with slower code
136
- oNameSet = new Utils.Map();
134
+ const oNameSet = new Utils.Map();
137
135
  aNames.forEach((sKey) => {
138
136
  oNameSet.put(sKey);
139
137
  });
@@ -372,18 +370,18 @@ sap.ui.define([
372
370
  *
373
371
  * @param {function} fnSuccess
374
372
  * no-args success handler
375
- * @param {function(string, object=)} [fnError]
373
+ * @param {function(string, object=)} [fnFailure]
376
374
  * error handler taking an error message and, since version 1.28.6, an
377
375
  * optional object containing the complete error information as delivered
378
376
  * by the ODataService. See fnFailure parameter of {@link sap.ushell_abap.pbServices.ui2.ODataWrapper#onError}
379
377
  * for more details.
380
- * If fnError is not given, the default error handler from the factory's
378
+ * If fnFailure is not given, the default error handler from the factory's
381
379
  * page building service is called.
382
380
  * @throws Error when called while {@link #save()} or a previous <code>reset()</code> is
383
381
  * running.
384
382
  * @since 1.3.0
385
383
  */
386
- this.reset = function (fnSuccess, fnError) {
384
+ this.reset = function (fnSuccess, fnFailure) {
387
385
  const oParent = getParentMock();
388
386
  const oPbs = oFactory.getPageBuildingService();
389
387
 
@@ -406,11 +404,11 @@ sap.ui.define([
406
404
  errorIfSaveRunning();
407
405
  errorIfResetRunning();
408
406
  bResetting = true;
409
- fnError = fnError || oPbs.getDefaultErrorHandler();
407
+ fnFailure = fnFailure || oPbs.getDefaultErrorHandler();
410
408
 
411
409
  if (oAlterEgo.$tmp) {
412
410
  // if bag is not yet persisted do not call delete and read
413
- Utils.callHandler(onReadSuccess.bind(null, oAlterEgo), fnError, true);
411
+ Utils.callHandler(onReadSuccess.bind(null, oAlterEgo), fnFailure, true);
414
412
  return;
415
413
  }
416
414
 
@@ -427,7 +425,7 @@ sap.ui.define([
427
425
  bResetting = false;
428
426
 
429
427
  // NOTE: call error handler with any arguments passed in this wrapper
430
- fnError.apply(null, arguments);
428
+ fnFailure.apply(null, arguments);
431
429
  });
432
430
  };
433
431
 
@@ -462,9 +460,7 @@ sap.ui.define([
462
460
  * @since 1.17.1
463
461
  */
464
462
  this.resetProperty = function (sPropertyName) {
465
- let oProperty;
466
-
467
- oProperty = oPropertiesByName.get(sPropertyName);
463
+ const oProperty = oPropertiesByName.get(sPropertyName);
468
464
  if (oProperty) {
469
465
  oProperty.$currentValue = undefined; // undefined value is marker to delete property on save
470
466
  if (!Object.prototype.hasOwnProperty.call(oProperty, "value")) { // no persisted value
@@ -487,9 +483,9 @@ sap.ui.define([
487
483
  *
488
484
  * @param {function} fnSuccess
489
485
  * no-args success handler. Errors thrown in this function will be reported to the page
490
- * building service's default error handler (not to <code>fnError</code> since the signature
486
+ * building service's default error handler (not to <code>fnFailure</code> since the signature
491
487
  * does not fit)
492
- * @param {function(Object<string, string>, Object<string, object>)} fnError
488
+ * @param {function(Object<string, string>, Object<string, object>)} fnFailure
493
489
  * error handler taking two maps, each mapping individual property names
494
490
  * to error message and complete error information respectively. Since
495
491
  * version 1.28.6, the second parameter is always returned,
@@ -502,7 +498,7 @@ sap.ui.define([
502
498
  * running.
503
499
  * @since 1.3.0
504
500
  */
505
- this.save = function (fnSuccess, fnError) {
501
+ this.save = function (fnSuccess, fnFailure) {
506
502
  let iNumberOfRequests = 0;
507
503
  const oResetPropertyNames = new Utils.Map(); // used as a "hash set"
508
504
  const mMessagesByName = {};
@@ -513,7 +509,7 @@ sap.ui.define([
513
509
  if (typeof fnSuccess !== "function") {
514
510
  throw new SrvcError("Missing success handler", "sap.ushell_abap.pbServices.ui2.Bag");
515
511
  }
516
- if (typeof fnError !== "function") {
512
+ if (typeof fnFailure !== "function") {
517
513
  throw new SrvcError("Missing error handler", "sap.ushell_abap.pbServices.ui2.Bag");
518
514
  }
519
515
  errorIfSaveRunning();
@@ -581,7 +577,7 @@ sap.ui.define([
581
577
  fnChangeListener(that);
582
578
  }
583
579
  if (Object.keys(mMessagesByName).length > 0) {
584
- fnError(mMessagesByName, mErrorResponseByName);
580
+ fnFailure(mMessagesByName, mErrorResponseByName);
585
581
  } else {
586
582
  oAlterEgo.$tmp = false;
587
583
  fnSuccess(); // Note: try/catch done by submitBatchQueue()!
@@ -708,7 +704,7 @@ sap.ui.define([
708
704
 
709
705
  fillPropertyMap(oAlterEgo);
710
706
  Log.debug(`Created: ${this}`, null, "sap.ushell_abap.pbServices.ui2.Bag");
711
- };
707
+ }
712
708
 
713
709
  return Bag;
714
710
  });
@@ -49,7 +49,7 @@ sap.ui.define([
49
49
  * @since 1.2.0
50
50
  * @private
51
51
  */
52
- const Catalog = function (oFactory, vCatalogData) {
52
+ function Catalog (oFactory, vCatalogData) {
53
53
  let oAlterEgo; // catalog's representation with all relations removed
54
54
  let oCatalogPage;
55
55
  let aChips = [];
@@ -123,7 +123,7 @@ sap.ui.define([
123
123
 
124
124
  /**
125
125
  * Gets this catalog's remote base URL.
126
- * @returns {string}
126
+ * @returns {string} url to the remote catalog service
127
127
  * @private
128
128
  */
129
129
  this.getRemoteBaseUrl = function () {
@@ -135,7 +135,7 @@ sap.ui.define([
135
135
  /**
136
136
  * Gets the remote catalog service.
137
137
  *
138
- * @returns {sap.ushell_abap.pbServices.ui2.RemoteCatalogService}
138
+ * @returns {sap.ushell_abap.pbServices.ui2.RemoteCatalogService} remote catalog service
139
139
  * @private
140
140
  */
141
141
  this.getRemoteCatalogService = function () {
@@ -186,7 +186,7 @@ sap.ui.define([
186
186
  * If the catalog is a remote catalog, an attempt to load its chips is made.
187
187
  * In this case, if the loading fails, the catalog is fully initialized ( with an empty chips collection ) and
188
188
  * returned as 2nd argument of the reject handler (note that it is no longer a stub!)
189
- * @param {boolean} bRefresh
189
+ * @param {boolean} bRefresh boolean indicating whether the catalog should be refreshed
190
190
  * @param {function} fnSuccess
191
191
  * no-args success handler
192
192
  * @param {function(string, object=)} [fnFailure]
@@ -262,8 +262,8 @@ sap.ui.define([
262
262
  oAlterEgo = oResult;
263
263
  try {
264
264
  sRemoteBaseUrl = that.getRemoteBaseUrl();
265
- } catch (e) {
266
- couldNotLoadRemoteChips(e.toString());
265
+ } catch (oError) {
266
+ couldNotLoadRemoteChips(oError.toString());
267
267
  return;
268
268
  }
269
269
  that.getRemoteCatalogService().readChips(sRemoteBaseUrl, oAlterEgo.remoteId, undefined,
@@ -387,13 +387,18 @@ sap.ui.define([
387
387
  this.clone = function (sNewDomainId, sNewTitle, fnSuccess, fnFailure) {
388
388
  let oCatalogData;
389
389
  /**
390
- * keeps calls to failure handler consistent with failure handler calls
391
- * in sap.ushell_abap.pbServices.ui2.Factory#createNewCatalog
392
- */
393
- const fnFailureWrapper = function (sErrorMessage, oMaybeErrorInformation) {
390
+ * keeps calls to failure handler consistent with failure handler calls
391
+ * in sap.ushell_abap.pbServices.ui2.Factory#createNewCatalog
392
+ *
393
+ * @param {string} sErrorMessage the error message
394
+ * @param {Error|object|undefined} oMaybeErrorInformation an optional object containing the complete error information as
395
+ *
396
+ * @returns {function} failure handler
397
+ */
398
+ function fnFailureWrapper (sErrorMessage, oMaybeErrorInformation) {
394
399
  return fnFailure(sErrorMessage, undefined,
395
400
  oMaybeErrorInformation);
396
- };
401
+ }
397
402
 
398
403
  if (oAlterEgo && oAlterEgo.type === "REMOTE") {
399
404
  oCatalogData = this.getCatalogData();
@@ -435,13 +440,12 @@ sap.ui.define([
435
440
  */
436
441
  this.getCatalogData = function () {
437
442
  /* jslint nomen:true */
438
- let oCatalogData;
439
443
 
440
444
  if (!oAlterEgo) {
441
445
  return undefined; // only ID is known!
442
446
  }
443
447
 
444
- oCatalogData = JSON.parse(JSON.stringify(oAlterEgo));
448
+ const oCatalogData = JSON.parse(JSON.stringify(oAlterEgo));
445
449
  delete oCatalogData.__metadata;
446
450
  return oCatalogData;
447
451
  };
@@ -890,14 +894,12 @@ sap.ui.define([
890
894
  * @see #getCatalogData
891
895
  */
892
896
  this.update = function (oCatalogData, fnSuccess, fnFailure) {
893
- let oNewAlterEgo;
894
-
895
897
  checkAlterEgo();
896
898
  if (Object.hasOwnProperty.call(oCatalogData, "__metadata")) {
897
899
  // ODataWrapper#update() relies on __metadata!
898
900
  throw new SrvcError("Unsupported __metadata update", "Catalog");
899
901
  }
900
- oNewAlterEgo = JSON.parse(JSON.stringify(oAlterEgo));
902
+ const oNewAlterEgo = JSON.parse(JSON.stringify(oAlterEgo));
901
903
  Object.keys(oCatalogData).forEach((sName) => {
902
904
  oNewAlterEgo[sName] = oCatalogData[sName];
903
905
  });
@@ -932,7 +934,7 @@ sap.ui.define([
932
934
  throw new SrvcError("Missing ID", "Catalog");
933
935
  }
934
936
  Log.debug(`Created: ${this}`, null, "Catalog");
935
- };
937
+ }
936
938
 
937
939
  return Catalog;
938
940
  });
@@ -65,7 +65,7 @@ sap.ui.define([
65
65
  * @class
66
66
  * @since 1.2.0
67
67
  */
68
- const Chip = function (oAlterEgo, oFactory) {
68
+ function Chip (oAlterEgo, oFactory) {
69
69
  const that = this;
70
70
  let oBags;
71
71
  /**
@@ -307,10 +307,9 @@ sap.ui.define([
307
307
  let oContract;
308
308
  let fnInitializer;
309
309
  let sName;
310
- let mRequestedContracts;
311
310
 
312
311
  checkStub();
313
- mRequestedContracts = oDefinition.contracts;
312
+ const mRequestedContracts = oDefinition.contracts;
314
313
  if (mRequestedContracts) {
315
314
  for (sName in mRequestedContracts) {
316
315
  if (Object.prototype.hasOwnProperty.call(mRequestedContracts, sName)) {
@@ -530,17 +529,13 @@ sap.ui.define([
530
529
  * @see #isStub()
531
530
  */
532
531
  this.getImplementationAsSapui5 = function (oApi) {
533
- let oData;
534
- let oImplementation;
535
- let sBaseChipId;
536
-
537
532
  Log.error("Deprecated API call of 'Chip.getImplementationAsSapui5'. Please use 'getImplementationAsSapui5Async' instead",
538
533
  null,
539
534
  "sap.ushell_abap.pbServices.ui2.Chip"
540
535
  );
541
536
 
542
537
  checkStub();
543
- oData = {
538
+ const oData = {
544
539
  /**
545
540
  * @namespace
546
541
  * The namespace for the instance specific CHIP API, which allows you to
@@ -548,10 +543,10 @@ sap.ui.define([
548
543
  */
549
544
  chip: oApi
550
545
  };
551
- oImplementation = oDefinition.implementation.sapui5;
546
+ const oImplementation = oDefinition.implementation.sapui5;
552
547
 
553
548
  // In case the chip is used in FLP wave 2 or later context we load it from the standard path
554
- sBaseChipId = this.getBaseChipId();
549
+ const sBaseChipId = this.getBaseChipId();
555
550
  if ((sBaseChipId !== "X-SAP-UI2-CHIP:/UI2/STATIC_APPLAUNCHER") && (sBaseChipId !== "X-SAP-UI2-CHIP:/UI2/DYNAMIC_APPLAUNCHER")) {
556
551
  if (oImplementation.$VirtualNamespace) {
557
552
  oImplementation.$absolutePath = this.toAbsoluteUrl(oImplementation.basePath);
@@ -611,12 +606,8 @@ sap.ui.define([
611
606
  *
612
607
  * @see #isStub()
613
608
  */
614
- this.getImplementationAsSapui5Async = function (oApi) {
615
- try {
616
- checkStub();
617
- } catch (oError) {
618
- return Promise.reject(oError);
619
- }
609
+ this.getImplementationAsSapui5Async = async function (oApi) {
610
+ checkStub();
620
611
 
621
612
  return new Promise((resolve, reject) => {
622
613
  sap.ui.require([
@@ -748,8 +739,8 @@ sap.ui.define([
748
739
  }:${oChipInstance.getId()}`;
749
740
 
750
741
  /**
751
- * @param {string} sActualId
752
- * @returns {boolean}
742
+ * @param {string} sActualId the actual CHIP ID to compare with the expected one
743
+ * @returns {boolean} the result of the comparison
753
744
  * @private
754
745
  */
755
746
  function matchesExpectation (sActualId) {
@@ -1002,9 +993,9 @@ sap.ui.define([
1002
993
  * Updates the given parameter map from the given JSON string. All parameters that actually were
1003
994
  * defined in the CHIP definition XML are accepted. All others will raise a warning to the log.
1004
995
  *
1005
- * @param {object<string,string>} mParameters
996
+ * @param {Object<string,string>} mParameters
1006
997
  * the parameter map to fill
1007
- * @param {object<string,string>|string} vConfigurationUpdates
998
+ * @param {Object<string,string>|string} vConfigurationUpdates
1008
999
  * the configuration updates as parameter map or as JSON string
1009
1000
  * <p>If one parameter value is <code>undefined</code> (which can only happen by supplying a
1010
1001
  * map) then this property is removed from <code>mParameters</code>.
@@ -1021,10 +1012,10 @@ sap.ui.define([
1021
1012
  if (typeof vConfigurationUpdates === "string") {
1022
1013
  try {
1023
1014
  mConfigurationUpdates = JSON.parse(vConfigurationUpdates);
1024
- } catch (e) {
1015
+ } catch (oError) {
1025
1016
  // configuration as a whole is incorrect and will be ignored
1026
1017
  // Note: toString(true) will also output configuration, thus it is no secret
1027
- Log.warning(`${this}: ignoring invalid configuration "${vConfigurationUpdates}"`, null, "Chip");
1018
+ Log.warning(`${this}: ignoring invalid configuration "${vConfigurationUpdates}"`, oError, "Chip");
1028
1019
  return;
1029
1020
  }
1030
1021
  } else {
@@ -1123,7 +1114,7 @@ sap.ui.define([
1123
1114
  }
1124
1115
  initBags(oAlterEgo.ChipBags && oAlterEgo.ChipBags.results);
1125
1116
  Log.debug(`Created: ${this}`, null, "Chip");
1126
- };
1117
+ }
1127
1118
 
1128
1119
  // "public" methods (static) ------------------------------------------------
1129
1120
 
@@ -43,7 +43,6 @@ sap.ui.define([
43
43
  */
44
44
  function getAttribute (oDomElement, sName) {
45
45
  let oAttribute;
46
- let aAttributes;
47
46
  let i;
48
47
  let n;
49
48
  if (typeof oDomElement.getAttributeNS === "function") {
@@ -51,7 +50,7 @@ sap.ui.define([
51
50
  }
52
51
  // ugly workaround for IE's XMLHttpRequest which doesn't know getAttributeNS, but knows the
53
52
  // attribute's namespace
54
- aAttributes = oDomElement.attributes;
53
+ const aAttributes = oDomElement.attributes;
55
54
  for (i = 0, n = aAttributes.length; i < n; i += 1) {
56
55
  oAttribute = aAttributes[i];
57
56
  if (!oAttribute.namespaceURI && getLocalName(oAttribute) === sName) {
@@ -83,7 +82,7 @@ sap.ui.define([
83
82
  * this used for calling the handlers from <code>mChildHandlers</code>
84
83
  * @param {object} oDomNode
85
84
  * the DOM node
86
- * @param {object<string,function(object)>} mChildHandlers
85
+ * @param {Object<string,function(object)>} mChildHandlers
87
86
  * maps the child name to a handler function. The handler function's parameter is the DOM node.
88
87
  */
89
88
  function visit (oThat, oDomNode, mChildHandlers) {
@@ -117,7 +116,7 @@ sap.ui.define([
117
116
  * @see sap.ushell_abap.pbServices.ui2.Chip
118
117
  * @since 1.2.0
119
118
  */
120
- const ChipDefinition = function (oXml) {
119
+ function ChipDefinition (oXml) {
121
120
  const that = this;
122
121
 
123
122
  if (oXml instanceof ChipDefinition) {
@@ -211,7 +210,7 @@ sap.ui.define([
211
210
 
212
211
  // paranoid mode to avoid memory leaks
213
212
  oXml = null;
214
- };
213
+ }
215
214
 
216
215
  return ChipDefinition;
217
216
  });
@@ -46,7 +46,7 @@ sap.ui.define([
46
46
  * @see sap.ushell_abap.pbServices.ui2.PageBuildingService
47
47
  * @since 1.2.0
48
48
  */
49
- const ChipInstance = function (oFactory, oAlterEgo, oChip, oPage) {
49
+ function ChipInstance (oFactory, oAlterEgo, oChip, oPage) {
50
50
  let oApi;
51
51
  let oBags;
52
52
  let oConfiguration;
@@ -485,12 +485,8 @@ sap.ui.define([
485
485
  *
486
486
  * @see #isStub()
487
487
  */
488
- this.getImplementationAsSapui5Async = function () {
489
- try {
490
- checkStub();
491
- } catch (oError) {
492
- return Promise.reject(oError);
493
- }
488
+ this.getImplementationAsSapui5Async = async function () {
489
+ checkStub();
494
490
 
495
491
  return oChip.getImplementationAsSapui5Async(oApi);
496
492
  };
@@ -697,10 +693,9 @@ sap.ui.define([
697
693
  */
698
694
  this.load = function (fnSuccess, fnFailure) {
699
695
  // TODO disallow multiple calls?
700
- let fnLoad;
701
696
 
702
697
  fnFailure = fnFailure || oFactory.getPageBuildingService().getDefaultErrorHandler();
703
- fnLoad = initialize.bind(null, fnSuccess, fnFailure);
698
+ const fnLoad = initialize.bind(null, fnSuccess, fnFailure);
704
699
 
705
700
  if (oChip.isStub()) {
706
701
  oChip.load(fnLoad, fnFailure);
@@ -760,8 +755,8 @@ sap.ui.define([
760
755
  try {
761
756
  fnRefreshHandler(); // Note: "this" is undefined
762
757
  return true;
763
- } catch (ex) {
764
- Log.error(`${that}: call to refresh handler failed: ${ex.message || ex.toString()}`, null, "ChipInstance");
758
+ } catch (oError) {
759
+ Log.error(`${that.getId()}: call to refresh handler failed:`, oError, "ChipInstance");
765
760
  return false;
766
761
  }
767
762
  }
@@ -929,7 +924,7 @@ sap.ui.define([
929
924
  * <code>a</code> back to "foo", but our user will never see this again, because the system
930
925
  * persisted both <code>a</code> and <code>b</code> in PERS.
931
926
  *
932
- * @param {object<string,string>} mConfigurationUpdates
927
+ * @param {Object<string,string>} mConfigurationUpdates
933
928
  * The configuration updates. The values must be strings. You can however set a value to
934
929
  * <code>undefined</code>. This removes it from the list of updated property and effectively
935
930
  * resets it to the default value.
@@ -995,7 +990,7 @@ sap.ui.define([
995
990
 
996
991
  delete oAlterEgo.Chip;
997
992
  Log.debug(`Created: ${this}`, null, "ChipInstance");
998
- };
993
+ }
999
994
 
1000
995
  /**
1001
996
  * Clones and loads the new CHIP instance.
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @class
26
26
  * @since 1.2.0
27
27
  */
28
- const SrvcError = function (sMessage, sComponent, bLogError) {
28
+ function SrvcError (sMessage, sComponent, bLogError) {
29
29
  // see also redundant declaration in utils.js which has to be in sync
30
30
  const oError = new Error(sMessage); // reuse Error constructor to benefit from it (e.g. stack)
31
31
 
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  }
39
39
 
40
40
  return oError;
41
- };
41
+ }
42
42
 
43
43
  return SrvcError;
44
44
  });
@@ -56,14 +56,18 @@ sap.ui.define([
56
56
  * @class
57
57
  * @since 1.2.0
58
58
  */
59
- const Factory = function (oPbs) {
59
+ function Factory (oPbs) {
60
60
  const mChips = {}; // cache for CHIPs
61
61
  const mCatalogs = {}; // cache for catalogs
62
62
  const mChipDefinitions = {}; // cache for CHIP definitions
63
- let oRemoteCatalogServicesByBaseUrl; // mapping from base URL to remote catalog service
64
63
  const that = this;
65
64
 
66
- // BEWARE: constructor code below!
65
+ // constructor code -------------------------------------------------------
66
+ const oRemoteCatalogServicesByBaseUrl = new Utils.Map();
67
+ if (!oPbs) {
68
+ throw new SrvcError("Missing page building service", "Factory");
69
+ }
70
+ Log.debug(`Created: ${this}`, null, "Factory");
67
71
 
68
72
  // "private" methods ---------------------------------------------------------
69
73
 
@@ -373,9 +377,6 @@ sap.ui.define([
373
377
  * @since 1.2.0
374
378
  */
375
379
  this.createChipInstance = function (oRawChipInstance, fnSuccess, fnFailure, oPage) {
376
- let oChip;
377
- let oChipInstance;
378
-
379
380
  // ensure at least a "null object" CHIP that knows its IDs
380
381
  oRawChipInstance.Chip = oRawChipInstance.Chip || { $proxy: true };
381
382
  oRawChipInstance.Chip.id = oRawChipInstance.Chip.id || oRawChipInstance.chipId;
@@ -387,8 +388,8 @@ sap.ui.define([
387
388
  this.createCatalog(oRawChipInstance.RemoteCatalog);
388
389
  }
389
390
 
390
- oChip = this.createChip(oRawChipInstance.Chip);
391
- oChipInstance = new ChipInstance(this, oRawChipInstance, oChip, oPage);
391
+ const oChip = this.createChip(oRawChipInstance.Chip);
392
+ const oChipInstance = new ChipInstance(this, oRawChipInstance, oChip, oPage);
392
393
  if (fnSuccess) {
393
394
  oChipInstance.load(fnSuccess.bind(null, oChipInstance), fnFailure);
394
395
  }
@@ -499,8 +500,7 @@ sap.ui.define([
499
500
  * @since 1.2.0
500
501
  */
501
502
  this.createPage = function (sPageId, fnSuccess, fnFailure, bPartially) {
502
- let oPage;
503
- oPage = new Page(this, sPageId);
503
+ const oPage = new Page(this, sPageId);
504
504
  if (fnSuccess) {
505
505
  oPage.load(fnSuccess.bind(null, oPage), fnFailure, bPartially);
506
506
  }
@@ -529,8 +529,7 @@ sap.ui.define([
529
529
  * @since 1.11.0
530
530
  */
531
531
  this.createPageSet = function (sPageSetId, fnSuccess, fnFailure) {
532
- let oPageSet;
533
- oPageSet = new PageSet(this, sPageSetId);
532
+ const oPageSet = new PageSet(this, sPageSetId);
534
533
  if (fnSuccess) {
535
534
  oPageSet.load(fnSuccess.bind(null, oPageSet), fnFailure);
536
535
  }
@@ -601,14 +600,7 @@ sap.ui.define([
601
600
  aResult.push("})");
602
601
  return aResult.join("");
603
602
  };
604
-
605
- // constructor code -------------------------------------------------------
606
- oRemoteCatalogServicesByBaseUrl = new Utils.Map();
607
- if (!oPbs) {
608
- throw new SrvcError("Missing page building service", "Factory");
609
- }
610
- Log.debug(`Created: ${this}`, null, "Factory");
611
- };
603
+ }
612
604
 
613
605
  // public factory function ***************************************************
614
606
 
@@ -34,8 +34,12 @@ sap.ui.define([
34
34
  * @public
35
35
  * @since 1.19.0
36
36
  */
37
- const ODataService = function (oODataWrapper, fnDefaultFailure) {
38
- let sBaseUrl;
37
+ function ODataService (oODataWrapper, fnDefaultFailure) {
38
+ if (!oODataWrapper) {
39
+ throw new SrvcError("Missing OData wrapper", "ODataService");
40
+ }
41
+
42
+ const sBaseUrl = oODataWrapper.getBaseUrl();
39
43
 
40
44
  // BEWARE: constructor code below!
41
45
 
@@ -104,15 +108,13 @@ sap.ui.define([
104
108
  * @see sap.ushell_abap.pbServices.ui2.ODataWrapper#read
105
109
  */
106
110
  this.refreshCsrfToken = function (fnSuccess, fnFailure) {
107
- let oTokenData;
108
-
109
111
  if (typeof fnSuccess !== "function") {
110
112
  throw new SrvcError("Success callback is not a function",
111
113
  "ODataService");
112
114
  }
113
115
  fnFailure = fnFailure || fnDefaultFailure;
114
116
 
115
- oTokenData = mCsrfTokens.get(sBaseUrl);
117
+ const oTokenData = mCsrfTokens.get(sBaseUrl);
116
118
 
117
119
  if (!oTokenData.fetchingInProgress) {
118
120
  // fetch token
@@ -169,13 +171,12 @@ sap.ui.define([
169
171
  * @see #refreshCsrfToken
170
172
  */
171
173
  this.setCsrfToken = function (sNewCsrfToken) {
172
- let oTokenData;
173
174
  // sNewCsrfToken must be a string OR undefined
174
175
  if (sNewCsrfToken && typeof sNewCsrfToken !== "string") {
175
176
  throw new SrvcError(`Invalid CSRF token: ${sNewCsrfToken}`,
176
177
  "ODataService");
177
178
  }
178
- oTokenData = mCsrfTokens.get(sBaseUrl);
179
+ const oTokenData = mCsrfTokens.get(sBaseUrl);
179
180
  oTokenData.token = sNewCsrfToken;
180
181
  };
181
182
 
@@ -223,11 +224,7 @@ sap.ui.define([
223
224
  };
224
225
 
225
226
  // constructor code -------------------------------------------------------
226
- if (!oODataWrapper) {
227
- throw new SrvcError("Missing OData wrapper", "ODataService");
228
- }
229
227
 
230
- sBaseUrl = oODataWrapper.getBaseUrl();
231
228
  if (!mCsrfTokens.get(sBaseUrl)) {
232
229
  mCsrfTokens.put(sBaseUrl, {
233
230
  // token: undefined,
@@ -238,7 +235,7 @@ sap.ui.define([
238
235
  }
239
236
 
240
237
  this.setDefaultErrorHandler(fnDefaultFailure);
241
- };
238
+ }
242
239
 
243
240
  /**
244
241
  * for test purposes only