@sapui5/sap.ushell_abap 1.150.1 → 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 +5 -5
- package/src/main/js/sap/ushell_abap/adapters/abap/ClientSideTargetResolutionAdapter.js +19 -24
- 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 +434 -559
- 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 +2 -2
- 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 +4 -4
- 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/base/Ui2Error.js +46 -0
- package/src/main/js/sap/ushell_abap/base/Ui2Utils.js +710 -0
- package/src/main/js/sap/ushell_abap/bootstrap/LoadLaunchpad.js +6 -0
- package/src/main/js/sap/ushell_abap/bootstrap/PageSetsRequestHandler.js +26 -51
- package/src/main/js/sap/ushell_abap/bootstrap/SAPCompanionConditionSetter.js +1 -3
- package/src/main/js/sap/ushell_abap/bootstrap/StartupRequestHandler.js +6 -6
- package/src/main/js/sap/ushell_abap/bootstrap/abapConstants.js +1 -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/pbServices/ui2/AllCatalogs.js +1 -1
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Bag.js +2 -2
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Catalog.js +71 -45
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Chip.js +55 -66
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipDefinition.js +1 -1
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ChipInstance.js +4 -4
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Error.js +5 -37
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Factory.js +3 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataService.js +2 -2
- package/src/main/js/sap/ushell_abap/pbServices/ui2/ODataWrapper.js +66 -81
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Page.js +14 -17
- package/src/main/js/sap/ushell_abap/pbServices/ui2/PageBuildingService.js +2 -2
- package/src/main/js/sap/ushell_abap/pbServices/ui2/PageSet.js +2 -2
- package/src/main/js/sap/ushell_abap/pbServices/ui2/Utils.js +5 -703
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/actions.js +1 -1
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/bag.js +3 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configuration.js +3 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/configurationUi.js +11 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/search.js +3 -3
- package/src/main/js/sap/ushell_abap/pbServices/ui2/contracts/visible.js +1 -1
- package/src/main/js/sap/ushell_abap/services/NavigationDataProvider.js +126 -0
- package/src/main/js/sap/ushell_abap/ui5appruntime/AppInfoAdapter.js +19 -18
- package/ui5.yaml +7 -6
|
@@ -7,13 +7,13 @@
|
|
|
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.
|
|
10
|
+
* @version 1.152.0
|
|
11
11
|
*/
|
|
12
12
|
sap.ui.define([
|
|
13
13
|
"sap/ushell_abap/adapters/abap/AdapterContainer",
|
|
14
14
|
"sap/ushell_abap/pbServices/ui2/ODataWrapper",
|
|
15
15
|
"sap/ushell_abap/pbServices/ui2/ODataService",
|
|
16
|
-
"sap/ushell_abap/
|
|
16
|
+
"sap/ushell_abap/base/Ui2Error",
|
|
17
17
|
"sap/base/util/ObjectPath",
|
|
18
18
|
"sap/base/Log",
|
|
19
19
|
"sap/ushell/Container"
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileOverview The SupportTicket adapter for the ABAP platform.
|
|
5
|
-
* @version 1.
|
|
5
|
+
* @version 1.152.0
|
|
6
6
|
*/
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/base/util/isEmptyObject",
|
|
9
9
|
"sap/base/util/ObjectPath",
|
|
10
|
-
"sap/ushell/utils",
|
|
10
|
+
"sap/ushell/utils/LogError",
|
|
11
11
|
"sap/ushell_abap/pbServices/ui2/ODataWrapper",
|
|
12
12
|
"sap/ushell_abap/pbServices/ui2/ODataService",
|
|
13
13
|
"sap/ushell/Container"
|
|
14
14
|
], (
|
|
15
15
|
isEmptyObject,
|
|
16
16
|
ObjectPath,
|
|
17
|
-
|
|
17
|
+
LogError,
|
|
18
18
|
ODataWrapper,
|
|
19
19
|
ODataService,
|
|
20
20
|
Container
|
|
@@ -62,7 +62,7 @@ sap.ui.define([
|
|
|
62
62
|
|
|
63
63
|
// text is mandatory for ABAP backend OData service
|
|
64
64
|
if (!oSupportTicketData.text) {
|
|
65
|
-
throw new
|
|
65
|
+
throw new LogError("Support Ticket data does not contain text member");
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
sUrl = ObjectPath.get("clientContext.navigationData.applicationInformation.url", oSupportTicketData);
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
2
|
|
|
3
3
|
sap.ui.define([
|
|
4
|
-
"sap/
|
|
4
|
+
"sap/base/i18n/date/CalendarWeekNumbering",
|
|
5
|
+
"sap/base/Log",
|
|
5
6
|
"sap/ui/thirdparty/datajs",
|
|
6
|
-
"sap/ui/thirdparty/jquery",
|
|
7
7
|
"sap/ui/VersionInfo",
|
|
8
|
-
"sap/base/Log",
|
|
9
|
-
"sap/ushell/resources",
|
|
10
|
-
"sap/base/i18n/date/CalendarWeekNumbering",
|
|
11
8
|
"sap/ushell/Config",
|
|
12
|
-
"sap/ushell/
|
|
9
|
+
"sap/ushell/resources",
|
|
10
|
+
"sap/ushell/utils/LaunchpadError",
|
|
11
|
+
"sap/ushell_abap/pbServices/ui2/ODataWrapper"
|
|
13
12
|
], (
|
|
14
|
-
|
|
13
|
+
CalendarWeekNumbering,
|
|
14
|
+
Log,
|
|
15
15
|
datajs,
|
|
16
|
-
jQuery,
|
|
17
16
|
VersionInfo,
|
|
18
|
-
Log,
|
|
19
|
-
resources,
|
|
20
|
-
CalendarWeekNumbering,
|
|
21
17
|
Config,
|
|
22
|
-
|
|
18
|
+
resources,
|
|
19
|
+
LaunchpadError,
|
|
20
|
+
ODataWrapper
|
|
23
21
|
) => {
|
|
24
22
|
"use strict";
|
|
25
23
|
|
|
@@ -81,45 +79,42 @@ sap.ui.define([
|
|
|
81
79
|
return {
|
|
82
80
|
themes: aThemes,
|
|
83
81
|
sets: aThemeSets,
|
|
84
|
-
themeRoot: sThemeRoot //
|
|
82
|
+
themeRoot: sThemeRoot // needed for calculate avatar urls
|
|
85
83
|
};
|
|
86
84
|
};
|
|
87
85
|
|
|
88
86
|
/**
|
|
89
87
|
* Returns the list of themes available for the user.
|
|
90
88
|
*
|
|
91
|
-
* @returns {
|
|
89
|
+
* @returns {Promise} Resolves the theme list.
|
|
92
90
|
*/
|
|
93
|
-
this.getThemeList = function () {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Log.error(oError.message, oError, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
|
|
106
|
-
// fallback to the previous implementation via /UI2/INTEROP
|
|
91
|
+
this.getThemeList = async function () {
|
|
92
|
+
try {
|
|
93
|
+
const oThemeList = await this._getThemeList();
|
|
94
|
+
return {
|
|
95
|
+
options: oThemeList.themes, // rename for compatibility with previous implementation
|
|
96
|
+
sets: oThemeList.sets,
|
|
97
|
+
themeRoot: oThemeList.themeRoot
|
|
98
|
+
};
|
|
99
|
+
} catch (oError) {
|
|
100
|
+
Log.error(oError.message, oError, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
|
|
101
|
+
// fallback to the previous implementation via /UI2/INTEROP
|
|
102
|
+
return new Promise((resolve, reject) => {
|
|
107
103
|
datajs.read({requestUri: "/sap/opu/odata/UI2/INTEROP/Themes"},
|
|
108
104
|
(oData) => { // success
|
|
109
|
-
|
|
105
|
+
resolve({
|
|
110
106
|
options: oData?.results || []
|
|
111
107
|
});
|
|
112
108
|
},
|
|
113
109
|
(oDataJsError) => { // fail
|
|
114
110
|
Log.error(oDataJsError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
|
|
115
|
-
const
|
|
111
|
+
const oFallbackError = new LaunchpadError(`Failed to fetch data: ${oDataJsError.message}`, {
|
|
116
112
|
dataJsError: oDataJsError
|
|
117
113
|
});
|
|
118
|
-
|
|
114
|
+
reject(oFallbackError);
|
|
119
115
|
});
|
|
120
116
|
});
|
|
121
|
-
|
|
122
|
-
return oDeferred.promise();
|
|
117
|
+
}
|
|
123
118
|
};
|
|
124
119
|
|
|
125
120
|
/**
|
|
@@ -150,42 +145,41 @@ sap.ui.define([
|
|
|
150
145
|
/**
|
|
151
146
|
* Returns the list of available language for the user.
|
|
152
147
|
*
|
|
153
|
-
* @returns {
|
|
148
|
+
* @returns {Promise} Resolves the list of languages.
|
|
154
149
|
*/
|
|
155
150
|
this.getLanguageList = function () {
|
|
156
|
-
const oDeferred = new jQuery.Deferred();
|
|
157
151
|
const sUri = encodeURI("/sap/opu/odata/UI2/INTEROP/UserProfilePropertyValues?$filter=id eq 'PREFERRED_LOGON_LANGUAGE'");
|
|
158
152
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
153
|
+
return new Promise((resolve, reject) => {
|
|
154
|
+
// read semantic objects from interop service
|
|
155
|
+
datajs.read({ requestUri: sUri },
|
|
156
|
+
// success
|
|
157
|
+
(oData) => {
|
|
158
|
+
let aResult = [{
|
|
159
|
+
text: resources.i18n.getText("userSettings.browserLanguage"),
|
|
160
|
+
key: DEFAULT_LANGUAGE_KEY
|
|
161
|
+
}];
|
|
162
|
+
const aLanguageListFromServer = oData.results.map((oLanguage) => {
|
|
163
|
+
return {
|
|
164
|
+
text: oLanguage.description,
|
|
165
|
+
key: oLanguage.value
|
|
166
|
+
};
|
|
167
|
+
}).sort((oLanguage1, oLanguage2) => {
|
|
168
|
+
return oLanguage1.text.localeCompare(oLanguage2.text);
|
|
169
|
+
});
|
|
175
170
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
171
|
+
aResult = aResult.concat(aLanguageListFromServer);
|
|
172
|
+
resolve(aResult);
|
|
173
|
+
},
|
|
174
|
+
// fail
|
|
175
|
+
(oDataJsError) => {
|
|
176
|
+
Log.error(oDataJsError.message, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
|
|
177
|
+
const oError = new LaunchpadError(`Failed to fetch data: ${oDataJsError.message}`, {
|
|
178
|
+
dataJsError: oDataJsError
|
|
179
|
+
});
|
|
180
|
+
reject(oError);
|
|
184
181
|
});
|
|
185
|
-
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
return oDeferred.promise();
|
|
182
|
+
});
|
|
189
183
|
};
|
|
190
184
|
|
|
191
185
|
/**
|
|
@@ -197,7 +191,7 @@ sap.ui.define([
|
|
|
197
191
|
* This is also the indicator that this user profile property cannot be changed via
|
|
198
192
|
* a call to <code>updateUserPreferences</code>.
|
|
199
193
|
*
|
|
200
|
-
* @returns {
|
|
194
|
+
* @returns {Promise} Resolves an object with the received results, .e.g.:
|
|
201
195
|
* <pre>
|
|
202
196
|
* {
|
|
203
197
|
* "NUMBER_FORMAT": [
|
|
@@ -214,7 +208,6 @@ sap.ui.define([
|
|
|
214
208
|
* @private
|
|
215
209
|
*/
|
|
216
210
|
this.getUserProfilePropertyValueLists = function () {
|
|
217
|
-
const oDeferred = new jQuery.Deferred();
|
|
218
211
|
let sUri;
|
|
219
212
|
const oResult = {};
|
|
220
213
|
const aUserProfilePropertyIds = [
|
|
@@ -226,6 +219,7 @@ sap.ui.define([
|
|
|
226
219
|
];
|
|
227
220
|
|
|
228
221
|
const oODataWrapper = this._createWrapper("/sap/opu/odata/UI2/INTEROP/");
|
|
222
|
+
|
|
229
223
|
oODataWrapper.openBatchQueue();
|
|
230
224
|
let sCurrentId;
|
|
231
225
|
|
|
@@ -245,19 +239,19 @@ sap.ui.define([
|
|
|
245
239
|
);
|
|
246
240
|
}
|
|
247
241
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
242
|
+
return new Promise((resolve, reject) => {
|
|
243
|
+
oODataWrapper.submitBatchQueue(
|
|
244
|
+
// success
|
|
245
|
+
() => {
|
|
246
|
+
resolve(oResult);
|
|
247
|
+
},
|
|
248
|
+
// error
|
|
249
|
+
(sErrorMessage) => {
|
|
250
|
+
Log.error(sErrorMessage, null, "sap.ushell_abap.adapters.abap.UserInfoAdapter");
|
|
251
|
+
reject(new Error(sErrorMessage));
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
});
|
|
261
255
|
};
|
|
262
256
|
|
|
263
257
|
this._createWrapper = function (sBaseUrl) {
|
|
@@ -269,24 +263,14 @@ sap.ui.define([
|
|
|
269
263
|
*
|
|
270
264
|
* @param {object} oUser User object
|
|
271
265
|
*
|
|
272
|
-
* @returns {
|
|
266
|
+
* @returns {Promise} Resolves once the preferences were updated.
|
|
273
267
|
*/
|
|
274
268
|
this.updateUserPreferences = function (oUser) {
|
|
275
269
|
Log.debug("[000] updateUserPreferences", "UserInfoAdapter");
|
|
276
|
-
const that = this;
|
|
277
270
|
let sRelativeUrl;
|
|
278
271
|
let iODataRequestsRunning;
|
|
279
272
|
let oDataObj;
|
|
280
|
-
|
|
281
|
-
function fnSuccess () {
|
|
282
|
-
iODataRequestsRunning -= 1;
|
|
283
|
-
if (iODataRequestsRunning === 0) {
|
|
284
|
-
oDeferred.resolve();
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
function fnFailure (sErrorMessage, oParsedErrorInformation) {
|
|
288
|
-
oDeferred.reject(new Error(sErrorMessage), oParsedErrorInformation);
|
|
289
|
-
}
|
|
273
|
+
|
|
290
274
|
Log.debug("[000] updateUserPreferences: _createWrapper", "UserInfoAdapter");
|
|
291
275
|
oDataWrapper = this._createWrapper("/sap/opu/odata/UI2/INTEROP/");
|
|
292
276
|
|
|
@@ -294,44 +278,54 @@ sap.ui.define([
|
|
|
294
278
|
Log.debug("[000] updateUserPreferences: oDataWrapper.openBatchQueue", "UserInfoAdapter");
|
|
295
279
|
oDataWrapper.openBatchQueue();
|
|
296
280
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
let newValue = oUserChangedProperty.newValue;
|
|
304
|
-
if (name.toUpperCase() === "LANGUAGE") {
|
|
305
|
-
name = "PREFERRED_LOGON_LANGUAGE";
|
|
306
|
-
newValue = newValue === DEFAULT_LANGUAGE_KEY ? undefined : newValue;
|
|
281
|
+
return new Promise((resolve, reject) => {
|
|
282
|
+
function fnSuccess () {
|
|
283
|
+
iODataRequestsRunning -= 1;
|
|
284
|
+
if (iODataRequestsRunning === 0) {
|
|
285
|
+
resolve();
|
|
286
|
+
}
|
|
307
287
|
}
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
"shellType='FLP')"
|
|
311
|
-
].join(",")}`;
|
|
312
|
-
|
|
313
|
-
// the preference to update
|
|
314
|
-
oDataObj = {
|
|
315
|
-
id: name,
|
|
316
|
-
shellType: "FLP",
|
|
317
|
-
value: newValue
|
|
318
|
-
};
|
|
319
|
-
// check for the datatype of the value & process oDataObj
|
|
320
|
-
that._updateODataObjectBasedOnDatatype(newValue, oDataObj);
|
|
321
|
-
Log.debug("[000] updateUserPreferences: oDataWrapper: put", "UserInfoAdapter");
|
|
322
|
-
oDataWrapper.put(sRelativeUrl, oDataObj, fnSuccess, fnFailure);
|
|
323
|
-
});
|
|
324
|
-
Log.debug("[000] updateUserPreferences: submitBatchQueue", "UserInfoAdapter");
|
|
325
|
-
// submit
|
|
326
|
-
oDataWrapper.submitBatchQueue(() => {
|
|
327
|
-
// request accepted but does not mean that the single requests
|
|
328
|
-
// have been successfully resolved - see above
|
|
329
|
-
if (iODataRequestsRunning === 0) {
|
|
330
|
-
oDeferred.resolve();
|
|
288
|
+
function fnFailure (sErrorMessage) {
|
|
289
|
+
reject(new Error(sErrorMessage));
|
|
331
290
|
}
|
|
332
|
-
}, fnFailure);
|
|
333
291
|
|
|
334
|
-
|
|
292
|
+
// put the preferences to update in the OData batch queue
|
|
293
|
+
const aUserChangedProperties = oUser.getChangedProperties() || [];
|
|
294
|
+
Log.debug("[000] updateUserPreferences: getChangedProperties", "UserInfoAdapter");
|
|
295
|
+
iODataRequestsRunning = aUserChangedProperties.length;
|
|
296
|
+
aUserChangedProperties.forEach((oUserChangedProperty) => {
|
|
297
|
+
let name = oUserChangedProperty.name;
|
|
298
|
+
let newValue = oUserChangedProperty.newValue;
|
|
299
|
+
if (name.toUpperCase() === "LANGUAGE") {
|
|
300
|
+
name = "PREFERRED_LOGON_LANGUAGE";
|
|
301
|
+
newValue = newValue === DEFAULT_LANGUAGE_KEY ? undefined : newValue;
|
|
302
|
+
}
|
|
303
|
+
sRelativeUrl = `UserProfileProperties(${[
|
|
304
|
+
`id='${name}'`,
|
|
305
|
+
"shellType='FLP')"
|
|
306
|
+
].join(",")}`;
|
|
307
|
+
|
|
308
|
+
// the preference to update
|
|
309
|
+
oDataObj = {
|
|
310
|
+
id: name,
|
|
311
|
+
shellType: "FLP",
|
|
312
|
+
value: newValue
|
|
313
|
+
};
|
|
314
|
+
// check for the datatype of the value & process oDataObj
|
|
315
|
+
this._updateODataObjectBasedOnDatatype(newValue, oDataObj);
|
|
316
|
+
Log.debug("[000] updateUserPreferences: oDataWrapper: put", "UserInfoAdapter");
|
|
317
|
+
oDataWrapper.put(sRelativeUrl, oDataObj, fnSuccess, fnFailure);
|
|
318
|
+
});
|
|
319
|
+
Log.debug("[000] updateUserPreferences: submitBatchQueue", "UserInfoAdapter");
|
|
320
|
+
// submit
|
|
321
|
+
oDataWrapper.submitBatchQueue(() => {
|
|
322
|
+
// request accepted but does not mean that the single requests
|
|
323
|
+
// have been successfully resolved - see above
|
|
324
|
+
if (iODataRequestsRunning === 0) {
|
|
325
|
+
resolve();
|
|
326
|
+
}
|
|
327
|
+
}, fnFailure);
|
|
328
|
+
});
|
|
335
329
|
};
|
|
336
330
|
};
|
|
337
331
|
});
|
|
@@ -3,14 +3,16 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileOverview The Unified Shell's container adapter for the HANA platform.
|
|
5
5
|
*
|
|
6
|
-
* @version 1.
|
|
6
|
+
* @version 1.152.0
|
|
7
7
|
*/
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"sap/ui/thirdparty/jquery",
|
|
10
|
-
"sap/base/Log"
|
|
10
|
+
"sap/base/Log",
|
|
11
|
+
"sap/ushell/base/promisify"
|
|
11
12
|
], (
|
|
12
13
|
jQuery,
|
|
13
|
-
Log
|
|
14
|
+
Log,
|
|
15
|
+
promisify
|
|
14
16
|
) => {
|
|
15
17
|
"use strict";
|
|
16
18
|
|
|
@@ -72,45 +74,37 @@ sap.ui.define([
|
|
|
72
74
|
/**
|
|
73
75
|
* Logs out the current user from this adapter's systems backend system.
|
|
74
76
|
*
|
|
75
|
-
* @returns {
|
|
77
|
+
* @returns {Promise} Resolved when logout is finished, even when it failed
|
|
76
78
|
* @since 1.11.0
|
|
77
79
|
*/
|
|
78
|
-
this.logout = function () {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
jQuery.ajax({
|
|
80
|
+
this.logout = async function () {
|
|
81
|
+
try {
|
|
82
|
+
const [, , oXhr] = await promisify(jQuery.ajax({
|
|
83
|
+
type: "HEAD",
|
|
84
|
+
url: oSystem.adjustUrl("/sap/hana/xs/formLogin/token.xsjs"),
|
|
85
|
+
headers: {
|
|
86
|
+
"X-CSRF-Token": "Fetch"
|
|
87
|
+
}
|
|
88
|
+
}), /* bWrapDeferredResult */ true);
|
|
89
|
+
try {
|
|
90
|
+
await promisify(jQuery.ajax({
|
|
89
91
|
type: "POST",
|
|
90
92
|
url: oSystem.adjustUrl("/sap/hana/xs/formLogin/logout.xscfunc"),
|
|
91
93
|
headers: {
|
|
92
94
|
"X-CSRF-Token": oXhr.getResponseHeader("X-CSRF-Token")
|
|
93
|
-
},
|
|
94
|
-
success: function () {
|
|
95
|
-
Log.info(`HANA system logged out: ${oSystem.getAlias()}`,
|
|
96
|
-
null, "sap.ushell_abap.adapters.hana.ContainerAdapter");
|
|
97
|
-
oDeferred.resolve();
|
|
98
|
-
},
|
|
99
|
-
error: function () {
|
|
100
|
-
Log.error(`Logging out HANA system failed: ${
|
|
101
|
-
oSystem.getAlias()}`, null,
|
|
102
|
-
"sap.ushell_abap.adapters.hana.ContainerAdapter");
|
|
103
|
-
oDeferred.resolve();
|
|
104
95
|
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
error: function () {
|
|
108
|
-
Log.error(`Fetching X-CSRF-Token failed: ${oSystem.getAlias()}`,
|
|
96
|
+
}));
|
|
97
|
+
Log.info(`HANA system logged out: ${oSystem.getAlias()}`,
|
|
109
98
|
null, "sap.ushell_abap.adapters.hana.ContainerAdapter");
|
|
110
|
-
|
|
99
|
+
} catch {
|
|
100
|
+
Log.error(`Logging out HANA system failed: ${
|
|
101
|
+
oSystem.getAlias()}`, null,
|
|
102
|
+
"sap.ushell_abap.adapters.hana.ContainerAdapter");
|
|
111
103
|
}
|
|
112
|
-
}
|
|
113
|
-
|
|
104
|
+
} catch {
|
|
105
|
+
Log.error(`Fetching X-CSRF-Token failed: ${oSystem.getAlias()}`,
|
|
106
|
+
null, "sap.ushell_abap.adapters.hana.ContainerAdapter");
|
|
107
|
+
}
|
|
114
108
|
};
|
|
115
109
|
};
|
|
116
110
|
}, true /* bExport */);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) 2009-2026 SAP SE, All Rights Reserved
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileOverview An error object which logs the error message immediately.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
// sap.ushell_abap.base is a bootstrap dependency!
|
|
9
|
+
// Be careful when adding new dependencies
|
|
10
|
+
"sap/base/Log"
|
|
11
|
+
], (
|
|
12
|
+
Log
|
|
13
|
+
) => {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Creates an <code>Error</code> object and logs the error message immediately.
|
|
18
|
+
*
|
|
19
|
+
* @param {string} sMessage
|
|
20
|
+
* the error message
|
|
21
|
+
* @param {string} [sComponent]
|
|
22
|
+
* the error component to log
|
|
23
|
+
* @param {boolean} [bLogError=true]
|
|
24
|
+
* defines if the error is logged directly in the constructor; In case the error is going to be catched,
|
|
25
|
+
* the logging may be misleading
|
|
26
|
+
*
|
|
27
|
+
* @class
|
|
28
|
+
* @since 1.2.0
|
|
29
|
+
*/
|
|
30
|
+
function SrvcError (sMessage, sComponent, bLogError) {
|
|
31
|
+
// see also redundant declaration in utils.js which has to be in sync
|
|
32
|
+
const oError = new Error(sMessage); // reuse Error constructor to benefit from it (e.g. stack)
|
|
33
|
+
|
|
34
|
+
// by default the error should be logged (as always in this project)
|
|
35
|
+
bLogError = bLogError === undefined ? true : bLogError;
|
|
36
|
+
|
|
37
|
+
oError.name = "Error";
|
|
38
|
+
if (bLogError === true) {
|
|
39
|
+
Log.error(sMessage, null, sComponent);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return oError;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return SrvcError;
|
|
46
|
+
});
|