@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.
@@ -8,7 +8,7 @@
8
8
  "i18n": "i18n/i18n.properties",
9
9
  "applicationVersion": {
10
10
  "__comment": "applicationVersion oder componentversion??",
11
- "version": "1.120.43"
11
+ "version": "1.120.45"
12
12
  },
13
13
  "title": "{{TITLE}}",
14
14
  "description": "{{DESCRIPTION}}",
@@ -17,9 +17,9 @@ DRAFT_VERSION=Entwurf
17
17
 
18
18
  SAVE=Sichern
19
19
 
20
- SAVE_AND_EDIT=Sichern und Bearbeiten
20
+ SAVE_AND_EDIT=Sichern und bearbeiten
21
21
 
22
- SAVE_AND_NEXT=Sichern und Weiter
22
+ SAVE_AND_NEXT=Sichern und weiter
23
23
 
24
24
  VALIDATE_DRAFT=Validieren
25
25
 
@@ -57,7 +57,7 @@ MSG_SUBTITLE_ROW_HIDDEN_COLUMN_HIDDEN=Baris (Sembunyi)\: {0}, Kolom (Sembunyi)\:
57
57
 
58
58
  CONTACT_INFO=Informasi Kontak
59
59
 
60
- CONTACT_JOB_TITLE=Judul Pekerjaan
60
+ CONTACT_JOB_TITLE=Jabatan Pekerjaan
61
61
 
62
62
  CONTACT_DEPARTMENT=Departemen
63
63
 
@@ -17,7 +17,7 @@ DRAFT_VERSION=Esbo\u00E7o
17
17
 
18
18
  SAVE=Salvar
19
19
 
20
- SAVE_AND_EDIT=Salvar e editar
20
+ SAVE_AND_EDIT=Gravar e editar
21
21
 
22
22
  SAVE_AND_NEXT=Gravar e seguinte
23
23
 
@@ -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 \u0456 \u043F\u0440\u043E\u0434\u043E\u0432\u0436\u0438\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
 
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.120.43"
9
+ "version": "1.120.45"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.120.43"
9
+ "version": "1.120.45"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -6,7 +6,7 @@
6
6
  "type": "component",
7
7
  "i18n": "i18n/i18n.properties",
8
8
  "applicationVersion": {
9
- "version": "1.120.43"
9
+ "version": "1.120.45"
10
10
  },
11
11
  "title": "{{TITLE}}",
12
12
  "description": "{{DESCRIPTION}}",
@@ -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.43
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
- Allows direct edit on the entires on the list, unlike the method 'edit'above, this method first edit the entry with preserveChanges as true
337
- If the response indicates an unsaved change or locked record, a corresponding dialog is shown to proceed or cancel with the edit.
338
- */
339
- function directEdit(oTransactionController, sEntitySet, sBindingPath, oModel, oApplication, oCommonUtils, oViewDependencyHelper, oViewProxy, bOpenInEditMode){
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
- var oPromise = new Promise(function(resolve,reject) {
342
- oModel.createBindingContext(sBindingPath, null, null, function(oBindingContext){
343
- if (oDraftContext.isDraftEnabled(sEntitySet)) {
344
- oTransactionController.editEntity(oBindingContext, true).then(function(oResponse) {
345
- oBindingContext.getModel().invalidateEntry(oBindingContext);
346
- oViewDependencyHelper.setRootPageToDirty();
347
- resolve({
348
- context: oResponse.context
349
- });
350
- }, function(oResponse) {
351
- if (oResponse && oResponse.response && oResponse.response.statusCode === "409") {
352
- //remove transient message associated with rc 409 in order to prevent message pop-up
353
- oApplication.removeTransientMessages();
354
- fnReadDraftAdministrativeData(oModel, sBindingPath, oApplication.getBusyHelper()).then(
355
- function(oResponse) {
356
- if (oResponse.DraftAdministrativeData.InProcessByUser) {
357
- reject({
358
- lockedByUser: oResponse.DraftAdministrativeData.InProcessByUserDescription || oResponse.DraftAdministrativeData.InProcessByUser
359
- });
360
- } else { //unsaved changes
361
- var editConfirmation = function(){
362
- var oUnsavedChangesEditPromise = oTransactionController.editEntity(oBindingContext, false).then(function(oResponse){
363
- oBindingContext.getModel().invalidateEntry(oBindingContext);
364
- oViewDependencyHelper.setRootPageToDirty();
365
- resolve({
366
- context: oResponse.context
367
- });
368
- });
369
- oApplication.getBusyHelper().setBusy(oUnsavedChangesEditPromise, true);
370
- };
371
- var editRejection = reject({
372
- cancelled: true
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
- draftAdminReadResponse: oResponse
390
+ lockedByUser: oResponse.DraftAdministrativeData.InProcessByUserDescription || oResponse.DraftAdministrativeData.InProcessByUser
382
391
  });
383
- });
384
- oApplication.getBusyHelper().setBusy(oPromise, true);
385
- } else {
386
- reject(oResponse);
387
- }
388
- });
389
- } else {
390
- return resolve({
391
- context: oBindingContext
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
- return oPromise;
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
- var oEditPromise = CRUDHelper.directEdit(oServices.oTransactionController, sEntitySet, oBindingContext.sPath, oBindingContext.getModel(), oServices.oApplication, oCommonUtils, oServices.oViewDependencyHelper, oViewProxy, bOpenInEditMode);
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.43
3097
+ * @version 1.120.45
3098
3098
  * @since 1.30.0
3099
3099
  * @alias sap.suite.ui.generic.template.lib.NavigationController
3100
3100
  */
@@ -60,7 +60,7 @@ sap.ui.define([
60
60
  interfaces: [],
61
61
  controls: [],
62
62
  elements: [],
63
- version: "1.120.43",
63
+ version: "1.120.45",
64
64
  extensions: {
65
65
  //Configuration used for rule loading of Support Assistant
66
66
  "sap.ui.support": {