@sapui5/sap.ushell_abap 1.151.1 → 1.153.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 +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/AdapterContainer.js +30 -31
- package/src/main/js/sap/ushell_abap/adapters/abap/AppStateAdapter.js +53 -63
- package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +13 -18
- 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 +31 -41
- package/src/main/js/sap/ushell_abap/adapters/abap/FlpLaunchPageAdapter.js +439 -555
- 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 +1 -1
- package/src/main/js/sap/ushell_abap/adapters/abap/PagePersistenceAdapter.js +4 -4
- 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 +127 -133
- package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +27 -33
- package/src/main/js/sap/ushell_abap/bootstrap/DirectAppStart.js +3 -2
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/CreateRenderer.js +4 -2
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad/RequestPages.js +2 -6
- package/src/main/js/sap/ushell_abap/bootstrap/PageSetsRequestHandler.js +25 -50
- package/src/main/js/sap/ushell_abap/bootstrap/SAPCompanionConditionSetter.js +1 -3
- package/src/main/js/sap/ushell_abap/bootstrap/XhrLogonEventHandler.js +6 -7
- package/src/main/js/sap/ushell_abap/bootstrap/abapConstants.js +19 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/Component.js +90 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.controller.js +109 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/TransactionCode.view.xml +16 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/i18n/i18n.properties +17 -0
- package/src/main/js/sap/ushell_abap/components/settings/TransactionCode/manifest.json +96 -0
- package/src/main/js/sap/ushell_abap/integration/fileshares/NavTargetResolutionFileShareSupport.js +3 -1
- package/src/main/js/sap/ushell_abap/library.js +1 -1
- package/src/main/js/sap/ushell_abap/messagebundle.properties +2 -0
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +69 -43
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +53 -64
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +65 -82
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +12 -15
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +48 -2
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configurationUi.js +10 -2
- package/src/main/js/sap/ushell_abap/services/NavigationDataProvider.js +7 -7
- package/src/main/js/sap/ushell_abap/ui5appruntime/AppInfoAdapter.js +19 -18
- package/src/main/js/sap/ushell_abap/utils/UserPersonalization.js +80 -0
- package/ui5.yaml +2 -4
|
@@ -11,8 +11,7 @@ sap.ui.define([
|
|
|
11
11
|
"sap/ushell_abap/base/Ui2Utils",
|
|
12
12
|
"sap/ushell_abap/pbServices/ui2/ODataService",
|
|
13
13
|
"sap/ushell_abap/base/Ui2Error",
|
|
14
|
-
"sap/base/Log"
|
|
15
|
-
"sap/ui/thirdparty/jquery"
|
|
14
|
+
"sap/base/Log"
|
|
16
15
|
], (
|
|
17
16
|
datajs,
|
|
18
17
|
Localization,
|
|
@@ -20,26 +19,23 @@ sap.ui.define([
|
|
|
20
19
|
Utils,
|
|
21
20
|
ODataService,
|
|
22
21
|
SrvcError,
|
|
23
|
-
Log
|
|
24
|
-
jQuery
|
|
22
|
+
Log
|
|
25
23
|
) => {
|
|
26
24
|
"use strict";
|
|
27
25
|
|
|
28
|
-
/* global OData */
|
|
29
|
-
|
|
30
26
|
function nop () { /* null object pattern */ }
|
|
31
27
|
/**
|
|
32
|
-
* Reject the given
|
|
28
|
+
* Reject the given Deferred object(s) (array or single one) with the
|
|
33
29
|
* given error response.
|
|
34
30
|
*
|
|
35
|
-
* @param {
|
|
31
|
+
* @param {object|object[]} vDeferred
|
|
36
32
|
* deferred or array of deferreds to be rejected
|
|
37
33
|
* @param {object} oResponse
|
|
38
34
|
* parameter of (each) reject call
|
|
39
35
|
*/
|
|
40
36
|
function reject (vDeferred, oResponse) {
|
|
41
37
|
if (Array.isArray(vDeferred)) {
|
|
42
|
-
// a failed change set: reject each single
|
|
38
|
+
// a failed change set: reject each single Deferred in the same way
|
|
43
39
|
vDeferred.forEach((oDeferred) => {
|
|
44
40
|
oDeferred.reject(oResponse);
|
|
45
41
|
});
|
|
@@ -121,7 +117,7 @@ sap.ui.define([
|
|
|
121
117
|
const S_STICKY_SESSION_HEADER = "saplb"; // header to check during sticky session
|
|
122
118
|
let aBatchQueue; // corresponds to data.__batchRequests
|
|
123
119
|
let bChangeSetOpen; // whether a change set is currently open at the end of our batch queue
|
|
124
|
-
let aDeferredQueue; //
|
|
120
|
+
let aDeferredQueue; // Deferreds objects corresponding to each request
|
|
125
121
|
const that = this;
|
|
126
122
|
// eslint-disable-next-line prefer-const
|
|
127
123
|
let sBaseUrl;
|
|
@@ -355,7 +351,7 @@ sap.ui.define([
|
|
|
355
351
|
addGlobalSapHeaders(oHeaders);
|
|
356
352
|
addStickySessionHeader(oHeaders);
|
|
357
353
|
|
|
358
|
-
|
|
354
|
+
datajs.request({
|
|
359
355
|
requestUri: sRequestUrl,
|
|
360
356
|
method: sMethod,
|
|
361
357
|
data: oPayload,
|
|
@@ -363,9 +359,7 @@ sap.ui.define([
|
|
|
363
359
|
},
|
|
364
360
|
(oData, oResponse) => {
|
|
365
361
|
this.detectStickySession((oResponse || {}).headers);
|
|
366
|
-
Log.debug(`Received OData response for ${sMethod} "${sRequestUrl}"`,
|
|
367
|
-
null,
|
|
368
|
-
"ODataWrapper");
|
|
362
|
+
Log.debug(`Received OData response for ${sMethod} "${sRequestUrl}"`, null, "ODataWrapper");
|
|
369
363
|
// Note: drop excess parameters; try/catch
|
|
370
364
|
Utils.callHandler(fnSuccess.bind(null, oData), fnFailure);
|
|
371
365
|
},
|
|
@@ -382,9 +376,7 @@ sap.ui.define([
|
|
|
382
376
|
&& oError.response.statusCode === 403
|
|
383
377
|
&& ODataWrapper.csrfTokenValue(oError.response.headers).toLowerCase() === "required") {
|
|
384
378
|
// refresh CSRF token and repeat original request
|
|
385
|
-
Log.debug(`CSRF token required for ${sMethod} "${sRequestUrl
|
|
386
|
-
}", refreshing it`, JSON.stringify(oError.response),
|
|
387
|
-
"ODataWrapper");
|
|
379
|
+
Log.debug(`CSRF token required for ${sMethod} "${sRequestUrl}", refreshing it`, JSON.stringify(oError.response), "ODataWrapper");
|
|
388
380
|
|
|
389
381
|
oODataService.refreshCsrfToken(
|
|
390
382
|
this.doRequest.bind(that, sRequestUrl, sMethod, oPayload, success, failure, oHandler, /* bIsRepeatedRequest */ true),
|
|
@@ -395,8 +387,7 @@ sap.ui.define([
|
|
|
395
387
|
}
|
|
396
388
|
},
|
|
397
389
|
oHandler);
|
|
398
|
-
Log.debug(`Sent OData request for ${sMethod} "${sRequestUrl}"`, null,
|
|
399
|
-
"ODataWrapper");
|
|
390
|
+
Log.debug(`Sent OData request for ${sMethod} "${sRequestUrl}"`, null, "ODataWrapper");
|
|
400
391
|
};
|
|
401
392
|
|
|
402
393
|
/**
|
|
@@ -414,8 +405,7 @@ sap.ui.define([
|
|
|
414
405
|
this.toRelativeUrl = function (sRequestUrl) {
|
|
415
406
|
const i = sRequestUrl.indexOf(sBaseUrl);
|
|
416
407
|
if (i < 0) {
|
|
417
|
-
throw new SrvcError(`Not relative to base URL "${sBaseUrl}": ${sRequestUrl}`,
|
|
418
|
-
"ODataWrapper");
|
|
408
|
+
throw new SrvcError(`Not relative to base URL "${sBaseUrl}": ${sRequestUrl}`, "ODataWrapper");
|
|
419
409
|
}
|
|
420
410
|
return sRequestUrl.slice(i + sBaseUrl.length);
|
|
421
411
|
};
|
|
@@ -432,8 +422,7 @@ sap.ui.define([
|
|
|
432
422
|
*/
|
|
433
423
|
this.toRequestUrl = function (sRelativeUrl) {
|
|
434
424
|
if (/^\//.test(sRelativeUrl)) {
|
|
435
|
-
throw new SrvcError(`Not a relative URL: ${sRelativeUrl}`,
|
|
436
|
-
"ODataWrapper");
|
|
425
|
+
throw new SrvcError(`Not a relative URL: ${sRelativeUrl}`, "ODataWrapper");
|
|
437
426
|
}
|
|
438
427
|
return sBaseUrl + sRelativeUrl;
|
|
439
428
|
};
|
|
@@ -460,20 +449,22 @@ sap.ui.define([
|
|
|
460
449
|
// if sRelativeUrl is empty, we ask for the service document, which is only used for fetching an XSRF token,
|
|
461
450
|
// so we are not taking already queued requests into account.
|
|
462
451
|
if (aBatchQueue && sRelativeUrl !== "") {
|
|
463
|
-
Log.debug(`Queued OData request for GET "${sRelativeUrl}"`, null,
|
|
464
|
-
"ODataWrapper");
|
|
452
|
+
Log.debug(`Queued OData request for GET "${sRelativeUrl}"`, null, "ODataWrapper");
|
|
465
453
|
aBatchQueue.push({
|
|
466
454
|
method: "GET",
|
|
467
455
|
requestUri: sRelativeUrl,
|
|
468
456
|
headers: oHeaders
|
|
469
457
|
});
|
|
470
|
-
oDeferred =
|
|
458
|
+
oDeferred = Promise.withResolvers();
|
|
459
|
+
oDeferred.promise
|
|
460
|
+
.then(([oData, oResponse]) => fnRawSuccess(oData, oResponse))
|
|
461
|
+
.catch(fnRawFailure);
|
|
471
462
|
aDeferredQueue.push(oDeferred);
|
|
472
463
|
bChangeSetOpen = false;
|
|
473
464
|
return;
|
|
474
465
|
}
|
|
475
466
|
|
|
476
|
-
// add
|
|
467
|
+
// add specific headers for read request
|
|
477
468
|
oHeaders.Accept = "application/json";
|
|
478
469
|
oHeaders["Accept-Language"] = Localization.getLanguage() || "";
|
|
479
470
|
// always fetch a new token with GET requests;
|
|
@@ -481,12 +472,11 @@ sap.ui.define([
|
|
|
481
472
|
// see internal BCP incident 1570753380
|
|
482
473
|
oHeaders["X-CSRF-Token"] = "Fetch";
|
|
483
474
|
|
|
484
|
-
|
|
475
|
+
datajs.read({
|
|
485
476
|
requestUri: sRequestUrl,
|
|
486
477
|
headers: oHeaders
|
|
487
478
|
}, fnRawSuccess, fnRawFailure);
|
|
488
|
-
Log.debug(`Sent OData request for GET "${sRequestUrl}"`, null,
|
|
489
|
-
"ODataWrapper");
|
|
479
|
+
Log.debug(`Sent OData request for GET "${sRequestUrl}"`, null, "ODataWrapper");
|
|
490
480
|
};
|
|
491
481
|
|
|
492
482
|
/**
|
|
@@ -532,14 +522,15 @@ sap.ui.define([
|
|
|
532
522
|
bChangeSetOpen = bSupportsChangeSets;
|
|
533
523
|
}
|
|
534
524
|
aBatchQueue[aBatchQueue.length - 1].__changeRequests.push(oChangeRequest);
|
|
535
|
-
oDeferred =
|
|
536
|
-
|
|
525
|
+
oDeferred = Promise.withResolvers();
|
|
526
|
+
oDeferred.promise
|
|
527
|
+
.then(([oData]) => {
|
|
537
528
|
Log.debug(`Received OData response for ${
|
|
538
529
|
sMethod} "${sRequestUrl}"`, null, "ODataWrapper");
|
|
539
530
|
// Note: drop excess parameters; try/catch
|
|
540
531
|
Utils.callHandler(fnSuccess.bind(null, oData), fnFailure);
|
|
541
532
|
})
|
|
542
|
-
.
|
|
533
|
+
.catch(that.onError.bind(that, sMethod, sRequestUrl, fnFailure, /* oDeferred */null));
|
|
543
534
|
aDeferredQueue[aDeferredQueue.length - 1].push(oDeferred);
|
|
544
535
|
return;
|
|
545
536
|
}
|
|
@@ -628,20 +619,16 @@ sap.ui.define([
|
|
|
628
619
|
*/
|
|
629
620
|
this.check = function (fnSuccess, fnFailure) {
|
|
630
621
|
if (!fnSuccess) {
|
|
631
|
-
throw new SrvcError("Missing success callback",
|
|
632
|
-
"ODataWrapper");
|
|
622
|
+
throw new SrvcError("Missing success callback", "ODataWrapper");
|
|
633
623
|
}
|
|
634
624
|
if (typeof fnSuccess !== "function") {
|
|
635
|
-
throw new SrvcError("Success callback is not a function",
|
|
636
|
-
"ODataWrapper");
|
|
625
|
+
throw new SrvcError("Success callback is not a function", "ODataWrapper");
|
|
637
626
|
}
|
|
638
627
|
if (!fnFailure) {
|
|
639
|
-
throw new SrvcError("Missing error callback",
|
|
640
|
-
"ODataWrapper");
|
|
628
|
+
throw new SrvcError("Missing error callback", "ODataWrapper");
|
|
641
629
|
}
|
|
642
630
|
if (typeof fnFailure !== "function") {
|
|
643
|
-
throw new SrvcError("Error callback is not a function",
|
|
644
|
-
"ODataWrapper");
|
|
631
|
+
throw new SrvcError("Error callback is not a function", "ODataWrapper");
|
|
645
632
|
}
|
|
646
633
|
};
|
|
647
634
|
|
|
@@ -771,9 +758,7 @@ sap.ui.define([
|
|
|
771
758
|
* cannot be parsed or is not returned in the OData error response.<br />
|
|
772
759
|
*
|
|
773
760
|
* <b>NOTE:</b> the second parameter is returned since version 1.28.6.
|
|
774
|
-
* @param {
|
|
775
|
-
* a <code>jQuery.Deferred</code> object that will be rejected with the
|
|
776
|
-
* same arguments fnFailure is called
|
|
761
|
+
* @param {object} [oDeferred] Deferred object from Promise.withResolvers
|
|
777
762
|
* @param {object} oError
|
|
778
763
|
* error object provided by datajs, should contain the response
|
|
779
764
|
*
|
|
@@ -814,8 +799,9 @@ sap.ui.define([
|
|
|
814
799
|
Log.error(sMessage, JSON.stringify(oError.response), "ODataWrapper");
|
|
815
800
|
|
|
816
801
|
if (oDeferred) {
|
|
817
|
-
// reject with
|
|
818
|
-
|
|
802
|
+
// reject with a tuple as native promises settle with a single value;
|
|
803
|
+
// the message is later forwarded to fnFailure (see the cache-hit consumer)
|
|
804
|
+
oDeferred.reject([sMessage, oParsedErrorInformation]);
|
|
819
805
|
}
|
|
820
806
|
fnFailure(sMessage, oParsedErrorInformation);
|
|
821
807
|
};
|
|
@@ -873,9 +859,7 @@ sap.ui.define([
|
|
|
873
859
|
* Defaults to the OData service facade's default error handler
|
|
874
860
|
* ({@link sap.ushell_abap.pbServices.ui2.ODataService#getDefaultErrorHandler})
|
|
875
861
|
* @param {boolean} [bCache=false]
|
|
876
|
-
* whether the response is cached for further calls (since 1.11.0)
|
|
877
|
-
* <code>OData.read.$cache</code>, a <code>Utils.Map</code> from
|
|
878
|
-
* <code>sRequestUrl</code> to a <code>jQuery.Deferred</code> object created on demand;
|
|
862
|
+
* whether the response is cached for further calls (since 1.11.0).
|
|
879
863
|
* without this flag, the cache is neither written nor read!
|
|
880
864
|
*
|
|
881
865
|
* @public
|
|
@@ -896,19 +880,19 @@ sap.ui.define([
|
|
|
896
880
|
oODataService.setCsrfToken(
|
|
897
881
|
ODataWrapper.csrfTokenValue(oResponse.headers) || oODataService.getCsrfToken() // prefer a new token
|
|
898
882
|
);
|
|
899
|
-
Log.debug(`Received OData response for GET "${sRequestUrl}"`, null,
|
|
900
|
-
"ODataWrapper");
|
|
883
|
+
Log.debug(`Received OData response for GET "${sRequestUrl}"`, null, "ODataWrapper");
|
|
901
884
|
// The sap-message header is a Gateway feature used e.g. by the INTEROP service
|
|
902
885
|
// It returns structured information (as XML). We don't evaluate it, we only log it.
|
|
903
886
|
// Severity is also part of the structure, but we simply assume warning.
|
|
904
887
|
sSapMessage = ODataWrapper.headerValue("sap-message", oResponse.headers);
|
|
905
888
|
if (sSapMessage) {
|
|
906
|
-
Log.warning(`SAP message for GET ${sRequestUrl}`, sSapMessage,
|
|
907
|
-
"ODataWrapper");
|
|
889
|
+
Log.warning(`SAP message for GET ${sRequestUrl}`, sSapMessage, "ODataWrapper");
|
|
908
890
|
}
|
|
909
891
|
if (oDeferred) {
|
|
910
892
|
// put arguments for fnSuccess into cache; clone oData first
|
|
911
|
-
|
|
893
|
+
// Note: native promises settle with a single value, so multiple
|
|
894
|
+
// values are forwarded as a tuple (see the cache-hit consumer below)
|
|
895
|
+
oDeferred.resolve([JSON.parse(JSON.stringify(oData)), oODataService.getCsrfToken()]);
|
|
912
896
|
}
|
|
913
897
|
// Note: drop excess parameters; try/catch
|
|
914
898
|
Utils.callHandler(fnSuccess.bind(null, oData), fnFailure);
|
|
@@ -918,22 +902,23 @@ sap.ui.define([
|
|
|
918
902
|
this.check(fnSuccess, fnFailure);
|
|
919
903
|
|
|
920
904
|
if (bCache) {
|
|
921
|
-
|
|
922
|
-
oDeferred =
|
|
905
|
+
datajs.read.$cache = datajs.read.$cache || new Utils.Map();
|
|
906
|
+
oDeferred = datajs.read.$cache.get(sRequestUrl); // the (native) promise is cached
|
|
923
907
|
if (oDeferred) {
|
|
924
|
-
Log.debug(`Using cached response for GET "${sRequestUrl}"`, null,
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
908
|
+
Log.debug(`Using cached response for GET "${sRequestUrl}"`, null, "ODataWrapper");
|
|
909
|
+
oDeferred
|
|
910
|
+
.then(([oData, sCachedCsrfToken]) => {
|
|
911
|
+
// prefer our own token
|
|
912
|
+
oODataService.setCsrfToken(oODataService.getCsrfToken() || sCachedCsrfToken);
|
|
913
|
+
// clone cached oData before passing to success handler
|
|
914
|
+
// Note: try/catch
|
|
915
|
+
Utils.callHandler(fnSuccess.bind(null, JSON.parse(JSON.stringify(oData))), fnFailure);
|
|
916
|
+
})
|
|
917
|
+
.catch(([sMessage, oError]) => fnFailure(sMessage, oError));
|
|
933
918
|
return;
|
|
934
919
|
}
|
|
935
|
-
oDeferred =
|
|
936
|
-
|
|
920
|
+
oDeferred = Promise.withResolvers();
|
|
921
|
+
datajs.read.$cache.put(sRequestUrl, oDeferred.promise);
|
|
937
922
|
}
|
|
938
923
|
|
|
939
924
|
this.readOrBatch(
|
|
@@ -963,7 +948,7 @@ sap.ui.define([
|
|
|
963
948
|
this.batch = function (oPayload, fnSuccess, fnFailure) {
|
|
964
949
|
const sRequestUrl = this.toRequestUrl("$batch");
|
|
965
950
|
|
|
966
|
-
this.doRequest(sRequestUrl, "POST", oPayload, fnSuccess, fnFailure,
|
|
951
|
+
this.doRequest(sRequestUrl, "POST", oPayload, fnSuccess, fnFailure, datajs.batchHandler);
|
|
967
952
|
};
|
|
968
953
|
|
|
969
954
|
/**
|
|
@@ -1006,10 +991,13 @@ sap.ui.define([
|
|
|
1006
991
|
const iExpected = aMyDeferredQueue.length;
|
|
1007
992
|
|
|
1008
993
|
if (iExpected !== iActual) {
|
|
1009
|
-
that.onError(
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
994
|
+
that.onError(
|
|
995
|
+
"POST",
|
|
996
|
+
this.toRequestUrl("$batch"),
|
|
997
|
+
fnBatchItselfFailed,
|
|
998
|
+
/* oDeferred */null,
|
|
999
|
+
{message: `Protocol error! Expected ${iExpected} responses, but received ${iActual}`}
|
|
1000
|
+
);
|
|
1013
1001
|
return;
|
|
1014
1002
|
}
|
|
1015
1003
|
|
|
@@ -1022,11 +1010,11 @@ sap.ui.define([
|
|
|
1022
1010
|
} else if (oResponse.__changeResponses) {
|
|
1023
1011
|
// successful change set
|
|
1024
1012
|
oResponse.__changeResponses.forEach((oChangeResponse, j) => {
|
|
1025
|
-
oDeferred[j].resolve(oChangeResponse.data, oChangeResponse);
|
|
1013
|
+
oDeferred[j].resolve([oChangeResponse.data, oChangeResponse]);
|
|
1026
1014
|
});
|
|
1027
1015
|
} else {
|
|
1028
1016
|
// successful GET request
|
|
1029
|
-
oDeferred.resolve(oResponse.data, oResponse);
|
|
1017
|
+
oDeferred.resolve([oResponse.data, oResponse]);
|
|
1030
1018
|
}
|
|
1031
1019
|
});
|
|
1032
1020
|
|
|
@@ -1040,7 +1028,7 @@ sap.ui.define([
|
|
|
1040
1028
|
}
|
|
1041
1029
|
|
|
1042
1030
|
if (aBatchQueue.length > 0) {
|
|
1043
|
-
Log.debug("[000] submit batch queue: batch", "
|
|
1031
|
+
Log.debug("[000] submit batch queue: batch", "ODataWrapper");
|
|
1044
1032
|
this.batch({ __batchRequests: aBatchQueue }, onBatchSuccess.bind(this), fnBatchItselfFailed);
|
|
1045
1033
|
} else if (fnBatchAccepted) {
|
|
1046
1034
|
// call success handler (if given) directly (async) if batchQueue is empty
|
|
@@ -1065,8 +1053,6 @@ sap.ui.define([
|
|
|
1065
1053
|
*/
|
|
1066
1054
|
this.toString = function (bVerbose) {
|
|
1067
1055
|
const aResult = ['ODataWrapper({sBaseUrl:"', sBaseUrl, '"'];
|
|
1068
|
-
// if (bVerbose) {
|
|
1069
|
-
// }
|
|
1070
1056
|
aResult.push("})");
|
|
1071
1057
|
return aResult.join("");
|
|
1072
1058
|
};
|
|
@@ -1155,9 +1141,7 @@ sap.ui.define([
|
|
|
1155
1141
|
bSupportsChangeSets = oSettings.supportsChangeSets;
|
|
1156
1142
|
|
|
1157
1143
|
if (typeof ODataWrapper.oStickySessionConfiguration === "undefined") {
|
|
1158
|
-
Log.error("ODataWrapper.oStickySessionConfiguration is not defined!",
|
|
1159
|
-
"the ODataWrapper constructor was called before the static property was defined",
|
|
1160
|
-
"ODataWrapper");
|
|
1144
|
+
Log.error("ODataWrapper.oStickySessionConfiguration is not defined!", "the ODataWrapper constructor was called before the static property was defined", "ODataWrapper");
|
|
1161
1145
|
} else if (typeof ODataWrapper.oStickySessionConfiguration[sBaseUrl] === "undefined") {
|
|
1162
1146
|
// Define the sticky session configuration for the base URL managed by
|
|
1163
1147
|
// this ODataWrapper instance.
|
|
@@ -1220,8 +1204,7 @@ sap.ui.define([
|
|
|
1220
1204
|
ODataWrapper["sap-statistics"] = Supportability.isStatisticsEnabled();
|
|
1221
1205
|
} catch {
|
|
1222
1206
|
// Read sap-statistics directly form query parameter in scenarios without UI5
|
|
1223
|
-
ODataWrapper["sap-statistics"] =
|
|
1224
|
-
/sap-statistics=(true|x|X)/.test(sWindowLocationSearch);
|
|
1207
|
+
ODataWrapper["sap-statistics"] = /sap-statistics=(true|x|X)/.test(sWindowLocationSearch);
|
|
1225
1208
|
}
|
|
1226
1209
|
};
|
|
1227
1210
|
ODataWrapper.checkSapStatisticsSetting(window.location.search);
|
|
@@ -11,15 +11,13 @@ sap.ui.define([
|
|
|
11
11
|
"sap/ushell_abap/pbServices/ui2/AllCatalogs",
|
|
12
12
|
"sap/ushell_abap/base/Ui2Utils",
|
|
13
13
|
"sap/ushell_abap/base/Ui2Error",
|
|
14
|
-
"sap/base/Log"
|
|
15
|
-
"sap/ui/thirdparty/jquery"
|
|
14
|
+
"sap/base/Log"
|
|
16
15
|
], (
|
|
17
16
|
Bag,
|
|
18
17
|
AllCatalogs,
|
|
19
18
|
Utils,
|
|
20
19
|
SrvcError,
|
|
21
|
-
Log
|
|
22
|
-
jQuery
|
|
20
|
+
Log
|
|
23
21
|
) => {
|
|
24
22
|
"use strict";
|
|
25
23
|
|
|
@@ -347,28 +345,27 @@ sap.ui.define([
|
|
|
347
345
|
* @param {string} sBagId
|
|
348
346
|
* the bag ID
|
|
349
347
|
*
|
|
350
|
-
* @returns {
|
|
348
|
+
* @returns {Promise<sap.ushell_abap.pbServices.ui2.Bag>} Resolves the loaded bag.
|
|
351
349
|
* @since 1.11.0
|
|
352
350
|
*/
|
|
353
351
|
this.loadBag = function (sBagId) {
|
|
354
|
-
let oDeferred;
|
|
355
|
-
|
|
356
352
|
if (!sBagId) {
|
|
357
353
|
throw new SrvcError("Missing bag ID", "Page");
|
|
358
354
|
}
|
|
359
355
|
|
|
360
356
|
if (mBags.containsKey(sBagId)) {
|
|
361
|
-
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
|
|
357
|
+
return mBags.get(sBagId);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
const pBag = new Promise((resolve) => {
|
|
365
361
|
oFactory.getPageBuildingService().readBag(sId, sBagId, (oRawBag) => {
|
|
366
|
-
|
|
362
|
+
resolve(new Bag(oFactory, oRawBag));
|
|
367
363
|
}, () => {
|
|
368
|
-
|
|
364
|
+
resolve(new Bag(oFactory, { pageId: sId, id: sBagId, $tmp: true }));
|
|
369
365
|
});
|
|
370
|
-
}
|
|
371
|
-
|
|
366
|
+
});
|
|
367
|
+
mBags.put(sBagId, pBag);
|
|
368
|
+
return pBag;
|
|
372
369
|
};
|
|
373
370
|
|
|
374
371
|
/**
|
|
@@ -4,13 +4,15 @@
|
|
|
4
4
|
* @fileOverview The <code>configuration</code> contract.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
+
"sap/base/Log",
|
|
7
8
|
"sap/ushell_abap/pbServices/ui2/Chip",
|
|
8
9
|
"sap/ushell_abap/base/Ui2Error",
|
|
9
|
-
"sap/ushell_abap/
|
|
10
|
+
"sap/ushell_abap/utils/UserPersonalization"
|
|
10
11
|
], (
|
|
12
|
+
Log,
|
|
11
13
|
Chip,
|
|
12
14
|
SrvcError,
|
|
13
|
-
|
|
15
|
+
UserPersonalization
|
|
14
16
|
) => {
|
|
15
17
|
"use strict";
|
|
16
18
|
|
|
@@ -43,6 +45,28 @@ sap.ui.define([
|
|
|
43
45
|
return oChipInstance.getConfigurationParameter(sParameterName);
|
|
44
46
|
};
|
|
45
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Returns the transaction code of the configuration parameter for the CHIP instance.
|
|
50
|
+
* This is a convenience method for the special configuration parameter "display_transaction_code".
|
|
51
|
+
*
|
|
52
|
+
* @name chip.configuration.getTransactionCode
|
|
53
|
+
* @function
|
|
54
|
+
* @since 1.153.0
|
|
55
|
+
* @returns {Promise<string>}
|
|
56
|
+
* the parameter transaction code value
|
|
57
|
+
*/
|
|
58
|
+
this.getTransactionCode = async function () {
|
|
59
|
+
const sTileConfiguration = oChipInstance.getConfigurationParameter("tileConfiguration");
|
|
60
|
+
let sTCode;
|
|
61
|
+
try {
|
|
62
|
+
sTCode = JSON.parse(sTileConfiguration || "{}").display_transaction_code || "";
|
|
63
|
+
} catch (oError) {
|
|
64
|
+
Log.error("Failed to parse tile configuration for transaction code:", oError, "sap.ushell_abap.pbServices.ui2.contracts.configuration");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return UserPersonalization.formatTransactionCode(sTCode);
|
|
68
|
+
};
|
|
69
|
+
|
|
46
70
|
/**
|
|
47
71
|
* Usually the Page Builder does not know about the internals of a CHIP, but there are special
|
|
48
72
|
* CHIPs (e.g. SAP Fiori Launchpad app launcher tiles, also serving as bookmark tiles) the
|
|
@@ -101,6 +125,28 @@ sap.ui.define([
|
|
|
101
125
|
if (fnUpdatedHandler) {
|
|
102
126
|
fnUpdatedHandler(aUpdatedConfigKeys);
|
|
103
127
|
}
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Returns the transaction code of the configuration parameter for the CHIP instance.
|
|
132
|
+
* This is a convenience method for the special configuration parameter "display_transaction_code".
|
|
133
|
+
*
|
|
134
|
+
* @name contract.configuration.getTransactionCode
|
|
135
|
+
* @function
|
|
136
|
+
* @since 1.153.0
|
|
137
|
+
* @returns {Promise<string>}
|
|
138
|
+
* the parameter transaction code value
|
|
139
|
+
*/
|
|
140
|
+
getTransactionCode: async function () {
|
|
141
|
+
const sTileConfiguration = oChipInstance.getConfigurationParameter("tileConfiguration");
|
|
142
|
+
let sTCode;
|
|
143
|
+
try {
|
|
144
|
+
sTCode = JSON.parse(sTileConfiguration || "{}").display_transaction_code || "";
|
|
145
|
+
} catch (oError) {
|
|
146
|
+
Log.error("Failed to parse tile configuration for transaction code:", oError, "sap.ushell_abap.pbServices.ui2.contracts.configuration");
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return UserPersonalization.formatTransactionCode(sTCode);
|
|
104
150
|
}
|
|
105
151
|
};
|
|
106
152
|
});
|
|
@@ -4,9 +4,11 @@
|
|
|
4
4
|
* @fileOverview The <code>configurationUi</code> contract.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
+
"sap/ushell/utils/toDeferred",
|
|
7
8
|
"sap/ushell_abap/pbServices/ui2/Chip",
|
|
8
9
|
"sap/ushell_abap/base/Ui2Error"
|
|
9
10
|
], (
|
|
11
|
+
toDeferred,
|
|
10
12
|
Chip,
|
|
11
13
|
SrvcError
|
|
12
14
|
) => {
|
|
@@ -273,7 +275,7 @@ sap.ui.define([
|
|
|
273
275
|
/**
|
|
274
276
|
* Fires the "save" event on this CHIP instance's configuration UI.
|
|
275
277
|
*
|
|
276
|
-
* @returns {
|
|
278
|
+
* @returns {jQuery.Promise|undefined}
|
|
277
279
|
* a <code>jQuery.Deferred</code> object's promise as returned by the "save" event handler
|
|
278
280
|
*
|
|
279
281
|
* @name contract.configurationUi.fireSave
|
|
@@ -283,7 +285,13 @@ sap.ui.define([
|
|
|
283
285
|
* @see chip.configurationUi.attachSave
|
|
284
286
|
*/
|
|
285
287
|
fireSave: function () {
|
|
286
|
-
|
|
288
|
+
if (!fnSaveHandler) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const vReturnValue = fnSaveHandler();
|
|
292
|
+
if (vReturnValue) {
|
|
293
|
+
return toDeferred(vReturnValue);
|
|
294
|
+
}
|
|
287
295
|
},
|
|
288
296
|
|
|
289
297
|
/**
|
|
@@ -9,15 +9,15 @@
|
|
|
9
9
|
*
|
|
10
10
|
* Configured with the ClientSideTargetResolutionAdapter.
|
|
11
11
|
*
|
|
12
|
-
* @version 1.
|
|
12
|
+
* @version 1.153.0
|
|
13
13
|
*/
|
|
14
14
|
sap.ui.define([
|
|
15
|
-
"sap/
|
|
16
|
-
"sap/ushell/
|
|
15
|
+
"sap/ui/core/Lib",
|
|
16
|
+
"sap/ushell/base/promisify",
|
|
17
17
|
"sap/ushell/utils/LaunchpadError"
|
|
18
18
|
], (
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
Lib,
|
|
20
|
+
promisify,
|
|
21
21
|
LaunchpadError
|
|
22
22
|
) => {
|
|
23
23
|
"use strict";
|
|
@@ -99,7 +99,7 @@ sap.ui.define([
|
|
|
99
99
|
return new Promise((resolve, reject) => {
|
|
100
100
|
const oSystemAliases = (this.oAdapter.getSystemAliases && this.oAdapter.getSystemAliases()) || {};
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
promisify(this.oAdapter.getEnhancedInbounds())
|
|
103
103
|
.then((aInbounds) => {
|
|
104
104
|
resolve({
|
|
105
105
|
systemAliases: oSystemAliases,
|
|
@@ -111,7 +111,7 @@ sap.ui.define([
|
|
|
111
111
|
oError.message,
|
|
112
112
|
{
|
|
113
113
|
component: this.S_COMPONENT_NAME,
|
|
114
|
-
description:
|
|
114
|
+
description: Lib.getResourceBundleFor("sap.ushell").getText("NavigationDataProvider.CannotLoadData"),
|
|
115
115
|
detail: oError
|
|
116
116
|
},
|
|
117
117
|
oError
|
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
sap.ui.define([
|
|
6
6
|
"sap/base/Log",
|
|
7
7
|
"sap/ui/thirdparty/URI",
|
|
8
|
-
"sap/ui/thirdparty/jquery"
|
|
8
|
+
"sap/ui/thirdparty/jquery",
|
|
9
|
+
"sap/ushell/base/promisify"
|
|
9
10
|
], (
|
|
10
11
|
Log,
|
|
11
12
|
URI,
|
|
12
|
-
jQuery
|
|
13
|
+
jQuery,
|
|
14
|
+
promisify
|
|
13
15
|
) => {
|
|
14
16
|
"use strict";
|
|
15
17
|
|
|
@@ -38,30 +40,29 @@ sap.ui.define([
|
|
|
38
40
|
return new Error("Cannot load app info - no app-id provided and URL parameter 'sap-ui-app-id' not set");
|
|
39
41
|
};
|
|
40
42
|
|
|
41
|
-
AppInfoAdapter.prototype._loadAppIndexData = function (sServiceUrl, sAppId) {
|
|
43
|
+
AppInfoAdapter.prototype._loadAppIndexData = async function (sServiceUrl, sAppId) {
|
|
42
44
|
const sUri = new URI(sServiceUrl).query({
|
|
43
45
|
id: sAppId
|
|
44
46
|
}).toString();
|
|
45
47
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
let oResponseData;
|
|
49
|
+
try {
|
|
50
|
+
oResponseData = await promisify(jQuery.ajax({
|
|
48
51
|
type: "GET",
|
|
49
52
|
dataType: "json",
|
|
50
53
|
url: sUri
|
|
51
|
-
})
|
|
52
|
-
|
|
54
|
+
}));
|
|
55
|
+
} catch (oError) {
|
|
56
|
+
oLogger.error(oError.responseText);
|
|
57
|
+
throw new Error(`Failed to load UI5 app index data loaded from ${sUri}: ${oError.responseText}`);
|
|
58
|
+
}
|
|
53
59
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}).fail((oError) => {
|
|
61
|
-
oLogger.error(oError.responseText);
|
|
62
|
-
reject(new Error(`Failed to load UI5 app index data loaded from ${sUri}: ${oError.responseText}`));
|
|
63
|
-
});
|
|
64
|
-
});
|
|
60
|
+
const oAppData = oResponseData[sAppId];
|
|
61
|
+
if (oAppData) {
|
|
62
|
+
return oAppData;
|
|
63
|
+
}
|
|
64
|
+
// TODO: extract error messages from app index response
|
|
65
|
+
throw new Error(`UI5 app index data loaded from ${sUri} does not contain app ${sAppId}`);
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
return new AppInfoAdapter();
|