@sapui5/sap.suite.ui.generic.template 1.120.43 → 1.120.45
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/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/controller/IappStateHandler.js +268 -211
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_de.properties +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_id.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_pt.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_uk.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/genericUtilities/controlStateWrapperFactory/SmartVariantManagementWrapper.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/CRUDHelper.js +93 -55
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +4 -1
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +1 -1
- package/src/sap/suite/ui/generic/template/library.js +1 -1
|
@@ -19,7 +19,7 @@ SAVE=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438
|
|
|
19
19
|
|
|
20
20
|
SAVE_AND_EDIT=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0456 \u0440\u0435\u0434\u0430\u0433\u0443\u0432\u0430\u0442\u0438
|
|
21
21
|
|
|
22
|
-
SAVE_AND_NEXT=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \
|
|
22
|
+
SAVE_AND_NEXT=\u0417\u0431\u0435\u0440\u0435\u0433\u0442\u0438 \u0442\u0430 \u0434\u0430\u043B\u0456
|
|
23
23
|
|
|
24
24
|
VALIDATE_DRAFT=\u041F\u0435\u0440\u0435\u0432\u0456\u0440\u0438\u0442\u0438
|
|
25
25
|
|
|
@@ -155,7 +155,7 @@ sap.ui.define([
|
|
|
155
155
|
oPreliminaryState = oState;
|
|
156
156
|
|
|
157
157
|
// Wait for all managed controls to be initialized before applying state
|
|
158
|
-
oAllControlsInitializedPromise.then(function() {
|
|
158
|
+
return oAllControlsInitializedPromise.then(function() {
|
|
159
159
|
bIsApplyingVariant = true;
|
|
160
160
|
if (!oPreliminaryState) {
|
|
161
161
|
// if no state is provided set default variant (not modified)
|
|
@@ -939,7 +939,7 @@ sap.ui.define([
|
|
|
939
939
|
* @extends sap.ui.core.UIComponent
|
|
940
940
|
* @abstract
|
|
941
941
|
* @author SAP SE
|
|
942
|
-
* @version 1.120.
|
|
942
|
+
* @version 1.120.45
|
|
943
943
|
* @name sap.suite.ui.generic.template.lib.AppComponent
|
|
944
944
|
*/
|
|
945
945
|
return UIComponent.extend("sap.suite.ui.generic.template.lib.AppComponent", {
|
|
@@ -333,67 +333,105 @@ sap.ui.define(["sap/ui/model/Context", "sap/suite/ui/generic/template/lib/Messag
|
|
|
333
333
|
}
|
|
334
334
|
|
|
335
335
|
/*
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
336
|
+
* Initiates editing of a list entry directly (without navigating to the object page first).
|
|
337
|
+
* Unlike the 'edit' method above, the first editEntity call uses preserveChanges=true.
|
|
338
|
+
* If the backend responds with a 409 (conflict) the DraftAdministrativeData is read to
|
|
339
|
+
* distinguish between a locked record and a record with unsaved changes by another user.
|
|
340
|
+
* A corresponding dialog is shown to let the user decide how to proceed.
|
|
341
|
+
*
|
|
342
|
+
* @param {object} oTransactionController - transaction controller providing editEntity
|
|
343
|
+
* @param {string} sEntitySet - name of the entity set
|
|
344
|
+
* @param {object} oBindingContext - UI5 Context of the row being edited;
|
|
345
|
+
* the OData model and binding path are derived
|
|
346
|
+
* from it via .getModel() / .getPath()
|
|
347
|
+
* @param {object} oApplication - application proxy (busy helper, component utils, …)
|
|
348
|
+
* @param {string} sAppId - ID of the AppComponent; used as the localStorage cache
|
|
349
|
+
* key for the content-id batch optimisation
|
|
350
|
+
* @param {object} oCommonUtils - common utilities (getText, …)
|
|
351
|
+
* @param {object} oViewDependencyHelper - used to mark the root page as dirty
|
|
352
|
+
* @param {object} oViewProxy - used for navigateUp on cancellation
|
|
353
|
+
* @param {boolean} bOpenInEditMode - whether the page was opened directly in edit mode
|
|
354
|
+
*/
|
|
355
|
+
function directEdit(oTransactionController, sEntitySet, oBindingContext, oApplication, sAppId, oCommonUtils, oViewDependencyHelper, oViewProxy, bOpenInEditMode){
|
|
340
356
|
var oDraftContext = oTransactionController.getDraftController().getDraftContext();
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
});
|
|
374
|
-
var unSavedChangesDialogPromise = fnUnsavedChangesDialog(undefined, oResponse.DraftAdministrativeData,oCommonUtils, oViewProxy, bOpenInEditMode);
|
|
375
|
-
unSavedChangesDialogPromise.then(editConfirmation,editRejection);
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
function(oResponse) {
|
|
379
|
-
// DraftAdminData read failed
|
|
357
|
+
|
|
358
|
+
if (!oDraftContext.isDraftEnabled(sEntitySet)) {
|
|
359
|
+
return Promise.resolve({ context: oBindingContext });
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
var oModel = oBindingContext.getModel();
|
|
363
|
+
// Fetch sRootExpand for the content-id batch optimisation.
|
|
364
|
+
// getRootExpand is intentionally not provided: directEdit is always invoked from
|
|
365
|
+
// the List Report before the Object Page is active, so getRootExpand is not yet
|
|
366
|
+
// available. CacheHelper falls back to the localStorage cache, which is still
|
|
367
|
+
// much faster than fetching expands in a separate backend request.
|
|
368
|
+
var oInfoForContentIdPromise = CacheHelper.getInfoForContentIdPromise(sEntitySet, oModel, sAppId);
|
|
369
|
+
|
|
370
|
+
var oRet = oInfoForContentIdPromise.then(function(oInfoObject) {
|
|
371
|
+
var sRootExpand = oInfoObject.contentIdRequestPossible ? oInfoObject.parametersForContentIdRequest.sRootExpand : null;
|
|
372
|
+
|
|
373
|
+
return new Promise(function(resolve, reject) {
|
|
374
|
+
var oFirstEditPromise = oTransactionController.editEntity(oBindingContext, true, sRootExpand);
|
|
375
|
+
// Track the busy state against the individual network request so the busy
|
|
376
|
+
// indicator remains active for exactly as long as the request is in flight.
|
|
377
|
+
oApplication.getBusyHelper().setBusy(oFirstEditPromise, true);
|
|
378
|
+
oFirstEditPromise.then(function(oResponse) {
|
|
379
|
+
oModel.invalidateEntry(oBindingContext);
|
|
380
|
+
oViewDependencyHelper.setRootPageToDirty();
|
|
381
|
+
resolve({ context: oResponse.context });
|
|
382
|
+
}, function(oResponse) {
|
|
383
|
+
if (oResponse && oResponse.response && oResponse.response.statusCode === "409") {
|
|
384
|
+
//remove transient message associated with rc 409 in order to prevent message pop-up
|
|
385
|
+
oApplication.removeTransientMessages();
|
|
386
|
+
fnReadDraftAdministrativeData(oModel, oBindingContext.getPath(), oApplication.getBusyHelper()).then(
|
|
387
|
+
function(oResponse) {
|
|
388
|
+
if (oResponse.DraftAdministrativeData.InProcessByUser) {
|
|
380
389
|
reject({
|
|
381
|
-
|
|
390
|
+
lockedByUser: oResponse.DraftAdministrativeData.InProcessByUserDescription || oResponse.DraftAdministrativeData.InProcessByUser
|
|
382
391
|
});
|
|
383
|
-
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
+
} else { //unsaved changes
|
|
393
|
+
var editConfirmation = function() {
|
|
394
|
+
// Re-run editEntity without preserveChanges so the
|
|
395
|
+
// unsaved changes of another user are overwritten.
|
|
396
|
+
var oUnsavedChangesEditPromise = oTransactionController.editEntity(oBindingContext, false, sRootExpand).then(function(oResponse) {
|
|
397
|
+
oModel.invalidateEntry(oBindingContext);
|
|
398
|
+
oViewDependencyHelper.setRootPageToDirty();
|
|
399
|
+
resolve({ context: oResponse.context });
|
|
400
|
+
});
|
|
401
|
+
oApplication.getBusyHelper().setBusy(oUnsavedChangesEditPromise, true);
|
|
402
|
+
};
|
|
403
|
+
// editRejection is passed as the rejection handler of Promise.then(),
|
|
404
|
+
// so it must be a function reference; calling reject() inline here
|
|
405
|
+
// would execute it immediately instead of on dialog cancellation.
|
|
406
|
+
var editRejection = function() { reject({ cancelled: true }); };
|
|
407
|
+
var unSavedChangesDialogPromise = fnUnsavedChangesDialog(undefined, oResponse.DraftAdministrativeData, oCommonUtils, oViewProxy, bOpenInEditMode);
|
|
408
|
+
unSavedChangesDialogPromise.then(editConfirmation, editRejection);
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
function(oResponse) {
|
|
412
|
+
// DraftAdminData read failed
|
|
413
|
+
reject({ draftAdminReadResponse: oResponse });
|
|
414
|
+
}
|
|
415
|
+
);
|
|
416
|
+
} else {
|
|
417
|
+
reject(oResponse);
|
|
418
|
+
}
|
|
392
419
|
});
|
|
393
|
-
}
|
|
394
420
|
});
|
|
395
421
|
});
|
|
396
|
-
|
|
422
|
+
|
|
423
|
+
// Ensure the active context is registered in ContextBookkeeping before the edit
|
|
424
|
+
// resolves. This caches the draft sibling path so subsequent navigation can use
|
|
425
|
+
// the cached value without an additional /SiblingEntity request.
|
|
426
|
+
// editingStarted() notifies all listeners (e.g. the message button helper) that
|
|
427
|
+
// the editing phase has begun for this context.
|
|
428
|
+
var bContextRegistered = oApplication.checkContextData(oBindingContext);
|
|
429
|
+
if (!bContextRegistered) {
|
|
430
|
+
oApplication.registerContext(oBindingContext, 1, sEntitySet);
|
|
431
|
+
}
|
|
432
|
+
oApplication.editingStarted(oBindingContext, oRet);
|
|
433
|
+
|
|
434
|
+
return oRet;
|
|
397
435
|
}
|
|
398
436
|
|
|
399
437
|
function deleteEntity(oDraftController, fnExecuteDelete, oApplicationProxy, oContext, bIsActiveEntity, sActionType){
|
|
@@ -1585,7 +1585,10 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
1585
1585
|
var bOpenInEditMode = !!oComponent.getEditFlow && oComponent.getEditFlow() === "direct";
|
|
1586
1586
|
if (bOpenInEditMode){
|
|
1587
1587
|
var sEntitySet = oTable.getEntitySet();
|
|
1588
|
-
|
|
1588
|
+
// oBindingContext is passed directly; the OData model and binding path are resolved inside directEdit.
|
|
1589
|
+
// sAppId is derived here because oController is not accessible inside CRUDHelper.
|
|
1590
|
+
var sAppId = oComponent.getAppComponent().getId();
|
|
1591
|
+
var oEditPromise = CRUDHelper.directEdit(oServices.oTransactionController, sEntitySet, oBindingContext, oServices.oApplication, sAppId, oCommonUtils, oServices.oViewDependencyHelper, oViewProxy, bOpenInEditMode);
|
|
1589
1592
|
oEditPromise.then(function(oResult){
|
|
1590
1593
|
oCommonUtils.navigateFromListItem(oResult.context, bReplace, bOpenInEditMode);
|
|
1591
1594
|
}, function(oError){
|
|
@@ -3094,7 +3094,7 @@ sap.ui.define(["sap/ui/base/Object",
|
|
|
3094
3094
|
* @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
|
|
3095
3095
|
* @public
|
|
3096
3096
|
* @extends sap.ui.base.Object
|
|
3097
|
-
* @version 1.120.
|
|
3097
|
+
* @version 1.120.45
|
|
3098
3098
|
* @since 1.30.0
|
|
3099
3099
|
* @alias sap.suite.ui.generic.template.lib.NavigationController
|
|
3100
3100
|
*/
|