@sapui5/sap.ushell_abap 1.151.0 → 1.152.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 +1 -1
- 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 +430 -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 +1 -1
- 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 +119 -125
- package/src/main/js/sap/ushell_abap/adapters/hana/ContainerAdapter.js +27 -33
- 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/integration/fileshares/NavTargetResolutionFileShareSupport.js +3 -1
- package/src/main/js/sap/ushell_abap/library.js +1 -1
- 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 +63 -78
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +12 -15
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configurationUi.js +10 -2
- package/src/main/js/sap/ushell_abap/services/NavigationDataProvider.js +4 -4
- package/src/main/js/sap/ushell_abap/ui5appruntime/AppInfoAdapter.js +19 -18
- package/ui5.yaml +1 -3
|
@@ -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
|
});
|
|
@@ -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
|
};
|
|
@@ -896,19 +882,19 @@ sap.ui.define([
|
|
|
896
882
|
oODataService.setCsrfToken(
|
|
897
883
|
ODataWrapper.csrfTokenValue(oResponse.headers) || oODataService.getCsrfToken() // prefer a new token
|
|
898
884
|
);
|
|
899
|
-
Log.debug(`Received OData response for GET "${sRequestUrl}"`, null,
|
|
900
|
-
"ODataWrapper");
|
|
885
|
+
Log.debug(`Received OData response for GET "${sRequestUrl}"`, null, "ODataWrapper");
|
|
901
886
|
// The sap-message header is a Gateway feature used e.g. by the INTEROP service
|
|
902
887
|
// It returns structured information (as XML). We don't evaluate it, we only log it.
|
|
903
888
|
// Severity is also part of the structure, but we simply assume warning.
|
|
904
889
|
sSapMessage = ODataWrapper.headerValue("sap-message", oResponse.headers);
|
|
905
890
|
if (sSapMessage) {
|
|
906
|
-
Log.warning(`SAP message for GET ${sRequestUrl}`, sSapMessage,
|
|
907
|
-
"ODataWrapper");
|
|
891
|
+
Log.warning(`SAP message for GET ${sRequestUrl}`, sSapMessage, "ODataWrapper");
|
|
908
892
|
}
|
|
909
893
|
if (oDeferred) {
|
|
910
894
|
// put arguments for fnSuccess into cache; clone oData first
|
|
911
|
-
|
|
895
|
+
// Note: native promises settle with a single value, so multiple
|
|
896
|
+
// values are forwarded as a tuple (see the cache-hit consumer below)
|
|
897
|
+
oDeferred.resolve([JSON.parse(JSON.stringify(oData)), oODataService.getCsrfToken()]);
|
|
912
898
|
}
|
|
913
899
|
// Note: drop excess parameters; try/catch
|
|
914
900
|
Utils.callHandler(fnSuccess.bind(null, oData), fnFailure);
|
|
@@ -918,22 +904,23 @@ sap.ui.define([
|
|
|
918
904
|
this.check(fnSuccess, fnFailure);
|
|
919
905
|
|
|
920
906
|
if (bCache) {
|
|
921
|
-
|
|
922
|
-
oDeferred =
|
|
907
|
+
datajs.read.$cache = datajs.read.$cache || new Utils.Map();
|
|
908
|
+
oDeferred = datajs.read.$cache.get(sRequestUrl); // the (native) promise is cached
|
|
923
909
|
if (oDeferred) {
|
|
924
|
-
Log.debug(`Using cached response for GET "${sRequestUrl}"`, null,
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
910
|
+
Log.debug(`Using cached response for GET "${sRequestUrl}"`, null, "ODataWrapper");
|
|
911
|
+
oDeferred
|
|
912
|
+
.then(([oData, sCachedCsrfToken]) => {
|
|
913
|
+
// prefer our own token
|
|
914
|
+
oODataService.setCsrfToken(oODataService.getCsrfToken() || sCachedCsrfToken);
|
|
915
|
+
// clone cached oData before passing to success handler
|
|
916
|
+
// Note: try/catch
|
|
917
|
+
Utils.callHandler(fnSuccess.bind(null, JSON.parse(JSON.stringify(oData))), fnFailure);
|
|
918
|
+
})
|
|
919
|
+
.catch(([sMessage, oError]) => fnFailure(sMessage, oError));
|
|
933
920
|
return;
|
|
934
921
|
}
|
|
935
|
-
oDeferred =
|
|
936
|
-
|
|
922
|
+
oDeferred = Promise.withResolvers();
|
|
923
|
+
datajs.read.$cache.put(sRequestUrl, oDeferred.promise);
|
|
937
924
|
}
|
|
938
925
|
|
|
939
926
|
this.readOrBatch(
|
|
@@ -963,7 +950,7 @@ sap.ui.define([
|
|
|
963
950
|
this.batch = function (oPayload, fnSuccess, fnFailure) {
|
|
964
951
|
const sRequestUrl = this.toRequestUrl("$batch");
|
|
965
952
|
|
|
966
|
-
this.doRequest(sRequestUrl, "POST", oPayload, fnSuccess, fnFailure,
|
|
953
|
+
this.doRequest(sRequestUrl, "POST", oPayload, fnSuccess, fnFailure, datajs.batchHandler);
|
|
967
954
|
};
|
|
968
955
|
|
|
969
956
|
/**
|
|
@@ -1006,10 +993,13 @@ sap.ui.define([
|
|
|
1006
993
|
const iExpected = aMyDeferredQueue.length;
|
|
1007
994
|
|
|
1008
995
|
if (iExpected !== iActual) {
|
|
1009
|
-
that.onError(
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
996
|
+
that.onError(
|
|
997
|
+
"POST",
|
|
998
|
+
this.toRequestUrl("$batch"),
|
|
999
|
+
fnBatchItselfFailed,
|
|
1000
|
+
/* oDeferred */null,
|
|
1001
|
+
{message: `Protocol error! Expected ${iExpected} responses, but received ${iActual}`}
|
|
1002
|
+
);
|
|
1013
1003
|
return;
|
|
1014
1004
|
}
|
|
1015
1005
|
|
|
@@ -1022,11 +1012,11 @@ sap.ui.define([
|
|
|
1022
1012
|
} else if (oResponse.__changeResponses) {
|
|
1023
1013
|
// successful change set
|
|
1024
1014
|
oResponse.__changeResponses.forEach((oChangeResponse, j) => {
|
|
1025
|
-
oDeferred[j].resolve(oChangeResponse.data, oChangeResponse);
|
|
1015
|
+
oDeferred[j].resolve([oChangeResponse.data, oChangeResponse]);
|
|
1026
1016
|
});
|
|
1027
1017
|
} else {
|
|
1028
1018
|
// successful GET request
|
|
1029
|
-
oDeferred.resolve(oResponse.data, oResponse);
|
|
1019
|
+
oDeferred.resolve([oResponse.data, oResponse]);
|
|
1030
1020
|
}
|
|
1031
1021
|
});
|
|
1032
1022
|
|
|
@@ -1040,7 +1030,7 @@ sap.ui.define([
|
|
|
1040
1030
|
}
|
|
1041
1031
|
|
|
1042
1032
|
if (aBatchQueue.length > 0) {
|
|
1043
|
-
Log.debug("[000] submit batch queue: batch", "
|
|
1033
|
+
Log.debug("[000] submit batch queue: batch", "ODataWrapper");
|
|
1044
1034
|
this.batch({ __batchRequests: aBatchQueue }, onBatchSuccess.bind(this), fnBatchItselfFailed);
|
|
1045
1035
|
} else if (fnBatchAccepted) {
|
|
1046
1036
|
// call success handler (if given) directly (async) if batchQueue is empty
|
|
@@ -1065,8 +1055,6 @@ sap.ui.define([
|
|
|
1065
1055
|
*/
|
|
1066
1056
|
this.toString = function (bVerbose) {
|
|
1067
1057
|
const aResult = ['ODataWrapper({sBaseUrl:"', sBaseUrl, '"'];
|
|
1068
|
-
// if (bVerbose) {
|
|
1069
|
-
// }
|
|
1070
1058
|
aResult.push("})");
|
|
1071
1059
|
return aResult.join("");
|
|
1072
1060
|
};
|
|
@@ -1155,9 +1143,7 @@ sap.ui.define([
|
|
|
1155
1143
|
bSupportsChangeSets = oSettings.supportsChangeSets;
|
|
1156
1144
|
|
|
1157
1145
|
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");
|
|
1146
|
+
Log.error("ODataWrapper.oStickySessionConfiguration is not defined!", "the ODataWrapper constructor was called before the static property was defined", "ODataWrapper");
|
|
1161
1147
|
} else if (typeof ODataWrapper.oStickySessionConfiguration[sBaseUrl] === "undefined") {
|
|
1162
1148
|
// Define the sticky session configuration for the base URL managed by
|
|
1163
1149
|
// this ODataWrapper instance.
|
|
@@ -1220,8 +1206,7 @@ sap.ui.define([
|
|
|
1220
1206
|
ODataWrapper["sap-statistics"] = Supportability.isStatisticsEnabled();
|
|
1221
1207
|
} catch {
|
|
1222
1208
|
// Read sap-statistics directly form query parameter in scenarios without UI5
|
|
1223
|
-
ODataWrapper["sap-statistics"] =
|
|
1224
|
-
/sap-statistics=(true|x|X)/.test(sWindowLocationSearch);
|
|
1209
|
+
ODataWrapper["sap-statistics"] = /sap-statistics=(true|x|X)/.test(sWindowLocationSearch);
|
|
1225
1210
|
}
|
|
1226
1211
|
};
|
|
1227
1212
|
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,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.152.0
|
|
13
13
|
*/
|
|
14
14
|
sap.ui.define([
|
|
15
|
+
"sap/ushell/base/promisify",
|
|
15
16
|
"sap/ushell/resources",
|
|
16
|
-
"sap/ushell/utils",
|
|
17
17
|
"sap/ushell/utils/LaunchpadError"
|
|
18
18
|
], (
|
|
19
|
+
promisify,
|
|
19
20
|
ushellResources,
|
|
20
|
-
ushellUtils,
|
|
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,
|
|
@@ -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();
|
package/ui5.yaml
CHANGED
|
@@ -265,7 +265,6 @@ builder:
|
|
|
265
265
|
- sap/ushell/Container.js
|
|
266
266
|
- sap/ushell/ApplicationType/
|
|
267
267
|
- sap/ushell/Fiori20AdapterTest.js
|
|
268
|
-
- sap/ushell/SessionHandler.js
|
|
269
268
|
- sap/ushell/System.js
|
|
270
269
|
- sap/ushell/User.js
|
|
271
270
|
- sap/ushell/adapters/cdm/PagesCommonDataModelAdapter.js
|
|
@@ -330,12 +329,12 @@ builder:
|
|
|
330
329
|
- sap/ushell/services/PersonalizationV2.js
|
|
331
330
|
- sap/ushell/services/PluginManager.js
|
|
332
331
|
- sap/ushell/services/ReferenceResolver.js
|
|
332
|
+
- sap/ushell/services/SessionHandler.js
|
|
333
333
|
- sap/ushell/services/ShellNavigation.js
|
|
334
334
|
- sap/ushell/services/ShellNavigationInternal.js
|
|
335
335
|
- sap/ushell/services/SpaceContent.js
|
|
336
336
|
- sap/ushell/services/SupportTicket.js
|
|
337
337
|
- sap/ushell/services/URLParsing.js
|
|
338
|
-
- sap/ushell/services/URLShortening.js
|
|
339
338
|
- sap/ushell/services/Ui5ComponentLoader.js
|
|
340
339
|
- sap/ushell/services/UserDefaultParameterPersistence.js
|
|
341
340
|
- sap/ushell/services/UserDefaultParameters.js
|
|
@@ -460,7 +459,6 @@ builder:
|
|
|
460
459
|
- sap/ushell/utils/AppType.js
|
|
461
460
|
# Default ushell modules
|
|
462
461
|
- sap/ushell/components/shell/Notifications/NotificationsModule.js
|
|
463
|
-
- sap/ushell/components/shell/ProductSwitch/ProductSwitchModule.js
|
|
464
462
|
resolve: false
|
|
465
463
|
bundleOptions:
|
|
466
464
|
optimize: true
|