@sapui5/sap.fe.templates 1.101.0 → 1.103.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.
Files changed (136) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +2 -2
  4. package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.ts +1 -1
  5. package/src/sap/fe/templates/Feedback.js +18 -18
  6. package/src/sap/fe/templates/Feedback.ts +12 -12
  7. package/src/sap/fe/templates/ListReport/ExtensionAPI.js +15 -15
  8. package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +19 -16
  9. package/src/sap/fe/templates/ListReport/ListReport.view.xml +107 -58
  10. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +180 -70
  11. package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +191 -88
  12. package/src/sap/fe/templates/ListReport/ListReportTemplating.js +45 -0
  13. package/src/sap/fe/templates/ListReport/ListReportTemplating.ts +30 -0
  14. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +1 -1
  15. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +2 -2
  16. package/src/sap/fe/templates/ListReport/overrides/Share.js +9 -7
  17. package/src/sap/fe/templates/ListReport/overrides/Share.ts +10 -10
  18. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +13 -6
  19. package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +17 -11
  20. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +1 -1
  21. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +1 -1
  22. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +12 -16
  23. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +17 -20
  24. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +167 -20
  25. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +195 -206
  26. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +187 -229
  27. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +861 -0
  28. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +822 -0
  29. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -3
  30. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +4 -4
  31. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
  32. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +1 -1
  33. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
  34. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +1 -1
  35. package/src/sap/fe/templates/ObjectPage/handler/DraftHandler.js +103 -0
  36. package/src/sap/fe/templates/ObjectPage/handler/DraftHandler.ts +97 -0
  37. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
  38. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +5 -5
  39. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
  40. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.ts +2 -2
  41. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
  42. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.ts +2 -2
  43. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +1 -1
  44. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.ts +1 -1
  45. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +17 -17
  46. package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +19 -30
  47. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +2 -2
  48. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.ts +4 -4
  49. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +15 -11
  50. package/src/sap/fe/templates/ObjectPage/view/fragments/CollaborationDraft.fragment.xml +1 -2
  51. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +25 -17
  52. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +28 -24
  53. package/src/sap/fe/templates/ObjectPage/view/fragments/FormActionButtons.fragment.xml +15 -16
  54. package/src/sap/fe/templates/ObjectPage/view/fragments/FormActions.fragment.xml +1 -5
  55. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPoint.fragment.xml +1 -2
  56. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +1 -3
  57. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +3 -17
  58. package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +16 -17
  59. package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +4 -3
  60. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderAddress.fragment.xml +7 -2
  61. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderContact.fragment.xml +26 -0
  62. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +4 -4
  63. package/src/sap/fe/templates/ObjectPage/view/fragments/RelatedApps.fragment.xml +7 -4
  64. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +74 -6
  65. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +118 -94
  66. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +127 -107
  67. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
  68. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
  69. package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +2 -2
  70. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +102 -57
  71. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +96 -61
  72. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +3 -4
  73. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +4 -5
  74. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +140 -52
  75. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +108 -54
  76. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
  77. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +3 -3
  78. package/src/sap/fe/templates/TableScroller.js +3 -3
  79. package/src/sap/fe/templates/TableScroller.ts +2 -2
  80. package/src/sap/fe/templates/controls/MacroChart.fragment.xml +1 -0
  81. package/src/sap/fe/templates/controls/Table.fragment.xml +4 -4
  82. package/src/sap/fe/templates/library.js +5 -2
  83. package/src/sap/fe/templates/library.ts +3 -0
  84. package/src/sap/fe/templates/messagebundle.properties +6 -18
  85. package/src/sap/fe/templates/messagebundle_ar.properties +10 -6
  86. package/src/sap/fe/templates/messagebundle_bg.properties +6 -2
  87. package/src/sap/fe/templates/messagebundle_ca.properties +10 -6
  88. package/src/sap/fe/templates/messagebundle_cs.properties +6 -2
  89. package/src/sap/fe/templates/messagebundle_cy.properties +10 -6
  90. package/src/sap/fe/templates/messagebundle_da.properties +10 -6
  91. package/src/sap/fe/templates/messagebundle_de.properties +10 -6
  92. package/src/sap/fe/templates/messagebundle_el.properties +10 -6
  93. package/src/sap/fe/templates/messagebundle_en.properties +6 -2
  94. package/src/sap/fe/templates/messagebundle_en_GB.properties +8 -4
  95. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +13 -5
  96. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +7 -3
  97. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +7 -3
  98. package/src/sap/fe/templates/messagebundle_es.properties +6 -2
  99. package/src/sap/fe/templates/messagebundle_es_MX.properties +10 -6
  100. package/src/sap/fe/templates/messagebundle_et.properties +6 -2
  101. package/src/sap/fe/templates/messagebundle_fi.properties +10 -6
  102. package/src/sap/fe/templates/messagebundle_fr.properties +6 -2
  103. package/src/sap/fe/templates/messagebundle_fr_CA.properties +10 -6
  104. package/src/sap/fe/templates/messagebundle_hi.properties +10 -6
  105. package/src/sap/fe/templates/messagebundle_hr.properties +10 -6
  106. package/src/sap/fe/templates/messagebundle_hu.properties +6 -2
  107. package/src/sap/fe/templates/messagebundle_id.properties +6 -2
  108. package/src/sap/fe/templates/messagebundle_it.properties +10 -6
  109. package/src/sap/fe/templates/messagebundle_iw.properties +10 -6
  110. package/src/sap/fe/templates/messagebundle_ja.properties +6 -2
  111. package/src/sap/fe/templates/messagebundle_kk.properties +10 -6
  112. package/src/sap/fe/templates/messagebundle_ko.properties +6 -2
  113. package/src/sap/fe/templates/messagebundle_lt.properties +6 -2
  114. package/src/sap/fe/templates/messagebundle_lv.properties +6 -2
  115. package/src/sap/fe/templates/messagebundle_ms.properties +10 -6
  116. package/src/sap/fe/templates/messagebundle_nl.properties +6 -2
  117. package/src/sap/fe/templates/messagebundle_no.properties +10 -6
  118. package/src/sap/fe/templates/messagebundle_pl.properties +10 -6
  119. package/src/sap/fe/templates/messagebundle_pt.properties +6 -2
  120. package/src/sap/fe/templates/messagebundle_pt_PT.properties +6 -2
  121. package/src/sap/fe/templates/messagebundle_ro.properties +10 -6
  122. package/src/sap/fe/templates/messagebundle_ru.properties +10 -6
  123. package/src/sap/fe/templates/messagebundle_sh.properties +6 -2
  124. package/src/sap/fe/templates/messagebundle_sk.properties +6 -2
  125. package/src/sap/fe/templates/messagebundle_sl.properties +10 -6
  126. package/src/sap/fe/templates/messagebundle_sv.properties +6 -2
  127. package/src/sap/fe/templates/messagebundle_th.properties +10 -6
  128. package/src/sap/fe/templates/messagebundle_tr.properties +6 -2
  129. package/src/sap/fe/templates/messagebundle_uk.properties +6 -2
  130. package/src/sap/fe/templates/messagebundle_vi.properties +10 -6
  131. package/src/sap/fe/templates/messagebundle_zh_CN.properties +10 -6
  132. package/src/sap/fe/templates/messagebundle_zh_TW.properties +10 -6
  133. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +0 -482
  134. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.ts +0 -511
  135. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +0 -120
  136. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +0 -138
@@ -1,11 +1,12 @@
1
- import ResourceBundle from "sap/base/i18n/ResourceBundle";
1
+ import type ResourceBundle from "sap/base/i18n/ResourceBundle";
2
2
  import Log from "sap/base/Log";
3
3
  import merge from "sap/base/util/merge";
4
- import { connect } from "sap/fe/core/actions/collaboration/ActivitySync";
5
- import { openManageDialog, showUserDetails } from "sap/fe/core/actions/collaboration/Manage";
6
- import BusyLocker from "sap/fe/core/BusyLocker";
7
4
  import CommonUtils from "sap/fe/core/CommonUtils";
5
+ import BusyLocker from "sap/fe/core/controllerextensions/BusyLocker";
6
+ import { connect } from "sap/fe/core/controllerextensions/collaboration/ActivitySync";
7
+ import { openManageDialog, showUserDetails } from "sap/fe/core/controllerextensions/collaboration/Manage";
8
8
  import EditFlow from "sap/fe/core/controllerextensions/EditFlow";
9
+ import draft from "sap/fe/core/controllerextensions/editFlow/draft";
9
10
  import IntentBasedNavigation from "sap/fe/core/controllerextensions/IntentBasedNavigation";
10
11
  import InternalEditFlow from "sap/fe/core/controllerextensions/InternalEditFlow";
11
12
  import InternalIntentBasedNavigation from "sap/fe/core/controllerextensions/InternalIntentBasedNavigation";
@@ -18,39 +19,37 @@ import Placeholder from "sap/fe/core/controllerextensions/Placeholder";
18
19
  import Share from "sap/fe/core/controllerextensions/Share";
19
20
  import ViewState from "sap/fe/core/controllerextensions/ViewState";
20
21
  import { defineUI5Class, extensible, finalExtension, publicExtension, usingExtension } from "sap/fe/core/helpers/ClassSupport";
21
- import ModelHelper, { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
22
+ import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
23
+ import ModelHelper from "sap/fe/core/helpers/ModelHelper";
22
24
  import PageController from "sap/fe/core/PageController";
23
25
  import ChartRuntime from "sap/fe/macros/chart/ChartRuntime";
24
26
  import CommonHelper from "sap/fe/macros/CommonHelper";
25
27
  import DelegateUtil from "sap/fe/macros/DelegateUtil";
26
28
  import TableUtils from "sap/fe/macros/table/Utils";
27
29
  import SelectionVariant from "sap/fe/navigation/SelectionVariant";
28
- import { default as ExtensionAPI, default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
29
- import RootContainerBaseController from "sap/fe/templates/RootContainer/controller/RootContainerBaseController";
30
+ import type { default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
31
+ import { default as ExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
32
+ import type RootContainerBaseController from "sap/fe/templates/RootContainer/controller/RootContainerBaseController";
30
33
  import EditFlowOverrides from "sap/fe/templates/RootContainer/overrides/EditFlow";
31
34
  import TableScroller from "sap/fe/templates/TableScroller";
32
35
  import InstanceManager from "sap/m/InstanceManager";
33
36
  import Link from "sap/m/Link";
34
37
  import MessageBox from "sap/m/MessageBox";
35
- import Popover from "sap/m/Popover";
36
- import SelectList from "sap/m/SelectList";
37
- import Event from "sap/ui/base/Event";
38
- import Control from "sap/ui/core/Control";
39
- import Fragment from "sap/ui/core/Fragment";
40
- import Item from "sap/ui/core/Item";
38
+ import type Popover from "sap/m/Popover";
39
+ import Core from "sap/ui/core/Core";
41
40
  import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
42
- import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
43
- import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
41
+ import type Binding from "sap/ui/model/Binding";
44
42
  import JSONModel from "sap/ui/model/json/JSONModel";
45
- import Context from "sap/ui/model/odata/v4/Context";
43
+ import type Context from "sap/ui/model/odata/v4/Context";
46
44
  import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
47
- import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
48
- import ODataModel from "sap/ui/model/odata/v4/ODataModel";
49
- import ResourceModel from "sap/ui/model/resource/ResourceModel";
50
- import ObjectPageDynamicHeaderTitle from "sap/uxap/ObjectPageDynamicHeaderTitle";
51
- import ObjectPageLayout from "sap/uxap/ObjectPageLayout";
52
- import ObjectPageSection from "sap/uxap/ObjectPageSection";
53
- import ObjectPageSubSection from "sap/uxap/ObjectPageSubSection";
45
+ import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
46
+ import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
47
+ import type ResourceModel from "sap/ui/model/resource/ResourceModel";
48
+ import type ObjectPageDynamicHeaderTitle from "sap/uxap/ObjectPageDynamicHeaderTitle";
49
+ import type ObjectPageLayout from "sap/uxap/ObjectPageLayout";
50
+ import type ObjectPageSection from "sap/uxap/ObjectPageSection";
51
+ import type ObjectPageSubSection from "sap/uxap/ObjectPageSubSection";
52
+ import DraftHandler from "./handler/DraftHandler";
54
53
  import IntentBasedNavigationOverride from "./overrides/IntentBasedNavigation";
55
54
  import InternalRoutingOverride from "./overrides/InternalRouting";
56
55
  import MessageHandlerOverride from "./overrides/MessageHandler";
@@ -60,6 +59,7 @@ import ViewStateOverrides from "./overrides/ViewState";
60
59
 
61
60
  @defineUI5Class("sap.fe.templates.ObjectPage.ObjectPageController")
62
61
  class ObjectPageController extends PageController {
62
+ oView!: any;
63
63
  @usingExtension(Placeholder)
64
64
  placeholder!: Placeholder;
65
65
  @usingExtension(EditFlow)
@@ -104,6 +104,7 @@ class ObjectPageController extends PageController {
104
104
  private oResourceBundle?: ResourceBundle;
105
105
  private bSectionNavigated?: boolean;
106
106
  private switchDraftAndActivePopOver?: Popover;
107
+ private currentBinding?: Binding;
107
108
 
108
109
  @publicExtension()
109
110
  @finalExtension()
@@ -146,11 +147,15 @@ class ObjectPageController extends PageController {
146
147
  onExit() {
147
148
  if (this.mCustomSectionExtensionAPIs) {
148
149
  for (const sId of Object.keys(this.mCustomSectionExtensionAPIs)) {
149
- this.mCustomSectionExtensionAPIs[sId] && this.mCustomSectionExtensionAPIs[sId].destroy();
150
+ if (this.mCustomSectionExtensionAPIs[sId]) {
151
+ this.mCustomSectionExtensionAPIs[sId].destroy();
152
+ }
150
153
  }
151
154
  delete this.mCustomSectionExtensionAPIs;
152
155
  }
153
- this.extensionAPI && this.extensionAPI.destroy();
156
+ if (this.extensionAPI) {
157
+ this.extensionAPI.destroy();
158
+ }
154
159
  delete this.extensionAPI;
155
160
 
156
161
  const oMessageButton = this.getView().byId("fe::FooterBar::MessageButton"),
@@ -158,6 +163,11 @@ class ObjectPageController extends PageController {
158
163
  if (oMessagePopover && oMessagePopover.isOpen()) {
159
164
  oMessagePopover.close();
160
165
  }
166
+ //when exiting we set keepAlive context to false
167
+ const oContext = this.getView().getBindingContext() as Context;
168
+ if (oContext && oContext.isKeepAlive()) {
169
+ oContext.setKeepAlive(false);
170
+ }
161
171
  }
162
172
 
163
173
  _getTableBinding(oTable: any) {
@@ -166,6 +176,10 @@ class ObjectPageController extends PageController {
166
176
 
167
177
  onBeforeRendering() {
168
178
  PageController.prototype.onBeforeRendering.apply(this);
179
+ // In the retrieveTextFromValueList scenario we need to ensure in case of reload/refresh that the meta model in the methode retrieveTextFromValueList of the FieldRuntime is available
180
+ if (this.oView.oViewData?.retrieveTextFromValueList && CommonHelper.getMetaModel() === undefined) {
181
+ CommonHelper.setMetaModel(this.getAppComponent().getMetaModel());
182
+ }
169
183
  }
170
184
 
171
185
  onAfterRendering() {
@@ -181,7 +195,7 @@ class ObjectPageController extends PageController {
181
195
  _onBeforeBinding(oContext: any, mParameters: any) {
182
196
  // TODO: we should check how this comes together with the transaction helper, same to the change in the afterBinding
183
197
  const aTables = this._findTables(),
184
- oObjectPage = this._getObjectPageLayoutControl() as ObjectPageLayout,
198
+ oObjectPage = this._getObjectPageLayoutControl(),
185
199
  oInternalModelContext = this.getView().getBindingContext("internal") as InternalModelContext,
186
200
  oInternalModel = this.getView().getModel("internal") as JSONModel,
187
201
  aBatchGroups = oInternalModelContext.getProperty("batchGroups"),
@@ -295,7 +309,13 @@ class ObjectPageController extends PageController {
295
309
  oFirstClickableElement = aActions.find(function (oAction: any) {
296
310
  // Due to the left alignment of the Draft switch and the collaborative draft avatar controls
297
311
  // there is a ToolbarSpacer in the actions aggregation which we need to exclude here!
298
- return !oAction.isA("sap.m.ToolbarSpacer") && oAction.getVisible() && oAction.getEnabled();
312
+ // Due to the ACC report, we also need not to check for the InvisibleText elements
313
+ return (
314
+ !oAction.isA("sap.ui.core.InvisibleText") &&
315
+ !oAction.isA("sap.m.ToolbarSpacer") &&
316
+ oAction.getVisible() &&
317
+ oAction.getEnabled()
318
+ );
299
319
  });
300
320
  }
301
321
  return oFirstClickableElement;
@@ -334,7 +354,7 @@ class ObjectPageController extends PageController {
334
354
  return aFields[0];
335
355
  }
336
356
  } catch (error) {
337
- Log.debug("Error when searching for mandaotry empty field: " + error);
357
+ Log.debug(`Error when searching for mandaotry empty field: ${error}`);
338
358
  }
339
359
  }
340
360
  }
@@ -348,7 +368,7 @@ class ObjectPageController extends PageController {
348
368
  }
349
369
 
350
370
  _updateFocusInEditMode(aSubSections: any) {
351
- const oObjectPage = this._getObjectPageLayoutControl() as ObjectPageLayout;
371
+ const oObjectPage = this._getObjectPageLayoutControl();
352
372
 
353
373
  const oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
354
374
  let oFieldToFocus: any;
@@ -376,21 +396,22 @@ class ObjectPageController extends PageController {
376
396
  // Back nav will keep the same context --> no need to display the dialog
377
397
  history.back();
378
398
  } else {
379
- CommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(
399
+ draft.processDataLossOrDraftDiscardConfirmation(
380
400
  function () {
381
401
  history.back();
382
402
  },
383
403
  Function.prototype,
384
404
  oContext,
385
405
  this,
386
- false
406
+ false,
407
+ draft.NavigationType.BackNavigation
387
408
  );
388
409
  }
389
410
  }
390
411
 
391
412
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
392
413
  _onAfterBinding(oBindingContext: any, mParameters: any) {
393
- const oObjectPage = this._getObjectPageLayoutControl() as ObjectPageLayout;
414
+ const oObjectPage = this._getObjectPageLayoutControl();
394
415
  const aTables = this._findTables();
395
416
 
396
417
  this._sideEffects.clearPropertiesStatus();
@@ -434,7 +455,7 @@ class ObjectPageController extends PageController {
434
455
  // Update 'enabled' property of DataFieldForAction buttons on table toolbar
435
456
  // The same is also performed on Table selectionChange event
436
457
  const oActionOperationAvailableMap = JSON.parse(
437
- CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap")) as any
458
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
438
459
  ),
439
460
  aSelectedContexts = oTable.getSelectedContexts();
440
461
 
@@ -504,7 +525,7 @@ class ObjectPageController extends PageController {
504
525
  };
505
526
 
506
527
  if (!oBinding) {
507
- Log.error("Expected binding missing for table: " + oTable.getId());
528
+ Log.error(`Expected binding missing for table: ${oTable.getId()}`);
508
529
  return;
509
530
  }
510
531
 
@@ -553,7 +574,12 @@ class ObjectPageController extends PageController {
553
574
 
554
575
  //Attach the patch sent and patch completed event to the object page binding so that we can react
555
576
  const oBinding = (oBindingContext.getBinding && oBindingContext.getBinding()) || oBindingContext;
556
- oBinding.attachEvent("patchSent", this.editFlow.handlePatchSent, this);
577
+
578
+ // Attach the event handler only once to the same binding
579
+ if (this.currentBinding !== oBinding) {
580
+ oBinding.attachEvent("patchSent", this.editFlow.handlePatchSent, this);
581
+ this.currentBinding = oBinding;
582
+ }
557
583
 
558
584
  aTables.forEach(function (oTable: any) {
559
585
  // access binding only after table is bound
@@ -574,6 +600,21 @@ class ObjectPageController extends PageController {
574
600
  @publicExtension()
575
601
  @extensible(OverrideExecution.After)
576
602
  onPageReady(mParameters: any) {
603
+ const setFocus = () => {
604
+ // Set the focus to the first action button, or to the first editable input if in editable mode
605
+ const oObjectPage = this._getObjectPageLayoutControl();
606
+ const isInDisplayMode = !oObjectPage.getModel("ui").getProperty("/isEditable");
607
+
608
+ if (isInDisplayMode) {
609
+ const oFirstClickableElement = this._getFirstClickableElement(oObjectPage);
610
+ if (oFirstClickableElement) {
611
+ oFirstClickableElement.focus();
612
+ }
613
+ } else {
614
+ const oSelectedSection: any = Core.byId(oObjectPage.getSelectedSection());
615
+ this._updateFocusInEditMode(oSelectedSection.getSubSections());
616
+ }
617
+ };
577
618
  // Apply app state only after the page is ready with the first section selected
578
619
  const oView = this.getView();
579
620
  const oInternalModelContext = oView.getBindingContext("internal") as InternalModelContext;
@@ -586,39 +627,17 @@ class ObjectPageController extends PageController {
586
627
  oAppComponent.getShellServices().setBackNavigation(() => this._onBackNavigationInDraft(oBindingContext));
587
628
  }
588
629
  }
589
- this.getAppComponent().getAppStateHandler().applyAppState();
590
-
591
- if (mParameters.forceFocus) {
592
- const oObjectPage = this._getObjectPageLayoutControl() as ObjectPageLayout;
593
- // set the focus to the first action button, or to the first editable input if in editable mode
594
- const isInDisplayMode = !oObjectPage.getModel("ui").getProperty("/isEditable");
595
- const aVisibleSections = oObjectPage.getSections().filter(function (oSection) {
596
- return oSection.getVisible() === true;
597
- });
598
- // Select the first visible section
599
- oObjectPage.setSelectedSection(aVisibleSections[0].getId());
600
-
601
- if (isInDisplayMode) {
602
- const oFirstClickableElement = this._getFirstClickableElement(oObjectPage);
603
- if (oFirstClickableElement) {
604
- oFirstClickableElement.focus();
630
+ this.getAppComponent()
631
+ .getAppStateHandler()
632
+ .applyAppState()
633
+ .then(() => {
634
+ if (mParameters.forceFocus) {
635
+ setFocus();
605
636
  }
606
- } else {
607
- let aVisibleSubSections;
608
- if ((oView.getViewData() as any).sectionLayout === "Tabs") {
609
- // In a tabbed layout, only the subsections of the selected section are visible on the screen
610
- aVisibleSubSections = aVisibleSections[0].getSubSections();
611
- } else {
612
- // In a paged layout, all subsections of the visible sections are visible on the screen
613
- aVisibleSubSections = (
614
- aVisibleSections.map(function (oSection: any) {
615
- return oSection.getSubSections();
616
- }) as any
617
- ).flat();
618
- }
619
- this._updateFocusInEditMode(aVisibleSubSections);
620
- }
621
- }
637
+ })
638
+ .catch(function (Error) {
639
+ Log.error("Error while setting the focus", Error);
640
+ });
622
641
 
623
642
  oInternalModelContext.setProperty("errorNavigationSectionFlag", false);
624
643
  this._checkDataPointTitleForExternalNavigation();
@@ -627,9 +646,7 @@ class ObjectPageController extends PageController {
627
646
  /**
628
647
  * Get the status of edit mode for sticky session.
629
648
  *
630
- * @returns {boolean} The status of edit mode for sticky session
631
- *
632
- *
649
+ * @returns The status of edit mode for sticky session
633
650
  */
634
651
  getStickyEditMode() {
635
652
  const oBindingContext = this.getView().getBindingContext && (this.getView().getBindingContext() as Context);
@@ -652,18 +669,16 @@ class ObjectPageController extends PageController {
652
669
  const oObjectPageSubtitle = oObjectPage.getCustomData().find(function (oCustomData: any) {
653
670
  return oCustomData.getKey() === "ObjectPageSubtitle";
654
671
  });
655
- const oTitleInfo = {
672
+ return {
656
673
  title: oObjectPage.data("ObjectPageTitle") || "",
657
674
  subtitle: oObjectPageSubtitle && oObjectPageSubtitle.getValue(),
658
675
  intent: "",
659
676
  icon: ""
660
677
  };
661
-
662
- return oTitleInfo;
663
678
  }
664
679
 
665
680
  _executeHeaderShortcut(sId: any) {
666
- const sButtonId = this.getView().getId() + "--" + sId,
681
+ const sButtonId = `${this.getView().getId()}--${sId}`,
667
682
  oButton = (this._getObjectPageLayoutControl().getHeaderTitle() as ObjectPageDynamicHeaderTitle)
668
683
  .getActions()
669
684
  .find(function (oElement: any) {
@@ -673,7 +688,7 @@ class ObjectPageController extends PageController {
673
688
  }
674
689
 
675
690
  _executeFooterShortcut(sId: any) {
676
- const sButtonId = this.getView().getId() + "--" + sId,
691
+ const sButtonId = `${this.getView().getId()}--${sId}`,
677
692
  oButton = (this._getObjectPageLayoutControl().getFooter() as any).getContent().find(function (oElement: any) {
678
693
  return oElement.getMetadata().getName() === "sap.m.Button" && oElement.getId() === sButtonId;
679
694
  });
@@ -692,12 +707,11 @@ class ObjectPageController extends PageController {
692
707
  if (iSelectedSectionIndex <= iSectionIndexMax - 1) {
693
708
  newSection = aSections[++iSelectedSectionIndex];
694
709
  }
695
- } else {
710
+ } else if (iSelectedSectionIndex !== 0) {
696
711
  // PreviousTab
697
- if (iSelectedSectionIndex !== 0) {
698
- newSection = aSections[--iSelectedSectionIndex];
699
- }
712
+ newSection = aSections[--iSelectedSectionIndex];
700
713
  }
714
+
701
715
  if (newSection) {
702
716
  oObjectPage.setSelectedSection(newSection);
703
717
  newSection.focus();
@@ -784,7 +798,19 @@ class ObjectPageController extends PageController {
784
798
  bExecuteSideEffectsOnError: bExecuteSideEffectsOnError,
785
799
  bindings: aBindings
786
800
  };
787
- return this.editFlow.saveDocument(oContext, mParameters).catch(() => this._showMessagePopover);
801
+ // We need to either reject or resolve a promise here and return it since this save
802
+ // function is not only called when pressing the save button in the footer, but also
803
+ // when the user selects create or save in a dataloss popup.
804
+ // The logic of the dataloss popup needs to detect if the save had errors or not in order
805
+ // to decide if the subsequent action - like a back navigation - has to be executed or not.
806
+ return this.editFlow.saveDocument(oContext, mParameters).catch((...args) => {
807
+ // If the saveDocument in editFlow returns errors we need
808
+ // to show the message popover here and ensure that the
809
+ // dataloss logic does not perform the follow up function
810
+ // like e.g. a back navigation hence we return a promise and reject it
811
+ this._showMessagePopover(...args);
812
+ return Promise.reject(...args);
813
+ });
788
814
  })
789
815
  .finally(function () {
790
816
  if (BusyLocker.isLocked(oModel)) {
@@ -810,72 +836,8 @@ class ObjectPageController extends PageController {
810
836
  return this.editFlow.applyDocument(oContext).catch(() => this._showMessagePopover());
811
837
  }
812
838
 
813
- _showSwitchDraftAndActivePopover(event: Event) {
814
- const view = this.getView(),
815
- source = event.getSource(),
816
- fragmentName = "sap.fe.templates.ObjectPage.view.fragments.SwitchDraftAndActiveObjectPopOver";
817
-
818
- if (this.switchDraftAndActivePopOver) {
819
- this.switchDraftAndActivePopOver.openBy(source, false);
820
- } else {
821
- const localThisModel = new JSONModel({}),
822
- preprocessorSettings = {
823
- bindingContexts: {
824
- "this": localThisModel.createBindingContext("/")
825
- },
826
- models: {
827
- "this": localThisModel
828
- }
829
- };
830
- const popoverFragment = XMLTemplateProcessor.loadTemplate(fragmentName, "fragment");
831
- Promise.resolve(XMLPreprocessor.process(popoverFragment, { name: fragmentName }, preprocessorSettings))
832
- .then((fragment) => {
833
- return Fragment.load({ definition: fragment, controller: this });
834
- })
835
- .then((popover: any) => {
836
- view.addDependent(popover);
837
- popover.setModel(view.getModel("sap.fe.i18n"), "i18n");
838
- popover.setPlacement("Bottom"); // TODO
839
- this.switchDraftAndActivePopOver = popover;
840
- popover.attachAfterOpen(() => {
841
- // While the list entry corresponding to the currently displayed document version is emphasized with a blue
842
- // background, we need to pre-focus the other entry
843
- const context: any = this.getView().getBindingContext(),
844
- isActiveEntity = context.getObject().IsActiveEntity;
845
- const switchDraftAndActiveOptionsList: SelectList = (popover.getContent() as unknown as Control[]).find(
846
- (element) => element.data("listIdentifier") === "switchDraftAndActivePopoverList"
847
- ) as SelectList;
848
- const listItemToFocus: Item = isActiveEntity
849
- ? (switchDraftAndActiveOptionsList.getItems().find((element) => element.getKey() === "switchToDraft") as Item)
850
- : (switchDraftAndActiveOptionsList.getItems().find((element) => element.getKey() === "switchToActive") as Item);
851
- listItemToFocus.focus();
852
- });
853
- popover.openBy(source);
854
- // ensure to remove the reference to the draft popover as it would be destroyed on exit
855
- view.attachEventOnce("beforeExit", () => {
856
- delete this.switchDraftAndActivePopOver;
857
- });
858
- })
859
- .catch(function (Error) {
860
- Log.error("Error while opening the draft switch popup", Error);
861
- });
862
- }
863
- }
864
-
865
- _switchDraftAndActivePopoverListSelect(event: Event) {
866
- const context: any = this.getView().getBindingContext(),
867
- selectedItemKey = event.getParameter("item").getProperty("key"),
868
- isActiveEntity = context.getObject().IsActiveEntity;
869
- // It was decided that we should NOT set the entry in the list corresponding to the currently displayed document version to
870
- // disabled, hence the user can click entries which to not cause an action (clicking "Draft" when you already display the
871
- // draft version of the document)
872
- // Hence we check here which entry in the list was clicked and which document version we currently display and only do
873
- // the switch between draft / active version if it makes sense.
874
- if ((isActiveEntity && selectedItemKey === "switchToDraft") || (!isActiveEntity && selectedItemKey === "switchToActive")) {
875
- this.editFlow.toggleDraftActive(context);
876
- }
877
- ((event.getSource() as Control).getParent() as Popover).close();
878
- }
839
+ _showSwitchDraftAndActivePopover = DraftHandler.showSwitchDraftAndActivePopover;
840
+ _switchDraftAndActivePopoverListSelect = DraftHandler.switchDraftAndActivePopoverListSelect;
879
841
 
880
842
  _updateRelatedApps() {
881
843
  const oObjectPage = this._getObjectPageLayoutControl();
@@ -916,15 +878,13 @@ class ObjectPageController extends PageController {
916
878
  ) {
917
879
  //In case there is only a single table in a section we fit that to the whole page so that the scrollbar comes only on table and not on page
918
880
  aSubsection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
919
- } else {
920
- if (aSubSectionTables && !aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")) {
921
- aSubSectionTables.forEach(function (oTable: { table: any; gridTable: any }) {
922
- if (oTable.gridTable) {
923
- //Resetting the row count to default value in case we have a combination of forms and tables or multiple tables in a subsection
924
- oTable.table.getType().setRowCount(null);
925
- }
926
- });
927
- }
881
+ } else if (aSubSectionTables && !aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")) {
882
+ aSubSectionTables.forEach(function (oTable: { table: any; gridTable: any }) {
883
+ if (oTable.gridTable) {
884
+ //Resetting the row count to default value in case we have a combination of forms and tables or multiple tables in a subsection
885
+ oTable.table.getType().setRowCount(null);
886
+ }
887
+ });
928
888
  }
929
889
  }
930
890
 
@@ -945,7 +905,6 @@ class ObjectPageController extends PageController {
945
905
  return aBlocks;
946
906
  }
947
907
 
948
- //TODO: This is needed for two workarounds - to be removed again
949
908
  _findTables() {
950
909
  const aSubSections = this._getAllSubSections();
951
910
  const aTables: any[] = [];
@@ -970,9 +929,9 @@ class ObjectPageController extends PageController {
970
929
  /**
971
930
  * Chart Context is resolved for 1:n microcharts.
972
931
  *
973
- * @param {sap.ui.model.Context} oChartContext The Context of the MicroChart
974
- * @param {string} sChartPath The collectionPath of the the chart
975
- * @returns {Array} Array of Attributes of the chart Context
932
+ * @param oChartContext The Context of the MicroChart
933
+ * @param sChartPath The collectionPath of the the chart
934
+ * @returns Array of Attributes of the chart Context
976
935
  */
977
936
  _getChartContextData(oChartContext: any, sChartPath: string) {
978
937
  const oContextData = oChartContext.getObject();
@@ -993,7 +952,6 @@ class ObjectPageController extends PageController {
993
952
  * @function
994
953
  * @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_scrollTablesToRow
995
954
  * @param {string} sRowPath 'sPath of the table row'
996
- *
997
955
  */
998
956
 
999
957
  _scrollTablesToRow(sRowPath: string) {
@@ -1010,10 +968,10 @@ class ObjectPageController extends PageController {
1010
968
  *
1011
969
  * @function
1012
970
  * @name _mergeMultipleContexts
1013
- * @param {object} oPageContext Page context
1014
- * @param {object|Array} aLineContext Selected Contexts
1015
- * @param {string} sChartPath Collection name of the chart
1016
- * @returns {object} Selection Variant Object
971
+ * @param oPageContext Page context
972
+ * @param aLineContext Selected Contexts
973
+ * @param sChartPath Collection name of the chart
974
+ * @returns Selection Variant Object
1017
975
  */
1018
976
  _mergeMultipleContexts(oPageContext: Context, aLineContext: any[], sChartPath: string) {
1019
977
  let aAttributes: any[] = [],
@@ -1032,14 +990,14 @@ class ObjectPageController extends PageController {
1032
990
  sPathLine = oContext.getPath();
1033
991
  sMetaPathLine = oMetaModel && oMetaModel.getMetaPath(sPathLine).replace(/^\/*/, "");
1034
992
 
1035
- aLineContext.map((oSingleContext: any) => {
993
+ aLineContext.forEach((oSingleContext: any) => {
1036
994
  if (sChartPath) {
1037
995
  const oChartContextData = this._getChartContextData(oSingleContext, sChartPath);
1038
996
  if (oChartContextData) {
1039
- aAttributes = oChartContextData.map(function (oChartContextData: any) {
997
+ aAttributes = oChartContextData.map(function (oSubChartContextData: any) {
1040
998
  return {
1041
- contextData: oChartContextData,
1042
- entitySet: sMetaPathPage + "/" + sChartPath
999
+ contextData: oSubChartContextData,
1000
+ entitySet: `${sMetaPathPage}/${sChartPath}`
1043
1001
  };
1044
1002
  });
1045
1003
  }
@@ -1087,54 +1045,55 @@ class ObjectPageController extends PageController {
1087
1045
  *
1088
1046
  * @function
1089
1047
  * @param {sap.m.Breadcrumbs} [oSource] parent control
1090
- * @description Used when context of the objectpage changes.
1048
+ * @description Used when context of the object page changes.
1091
1049
  * This event callback is attached to modelContextChange
1092
1050
  * event of the Breadcrumb control to catch context change.
1093
- * Then element binding and hrefs are updated for each Link.
1051
+ * Then element binding and hrefs are updated for each link.
1094
1052
  *
1095
1053
  * @ui5-restricted
1096
1054
  * @experimental
1097
1055
  */
1098
- _setBreadcrumbLinks(oSource: any) {
1099
- const oContext = oSource.getBindingContext();
1100
- const oAppComponent = this.getAppComponent();
1101
- if (oContext) {
1102
- const sNewPath = oContext.getPath(),
1103
- aPathParts = sNewPath.split("/"),
1104
- oMetaModel = oAppComponent.getMetaModel();
1105
- let sPath = "",
1106
- iSkipParameterized = 0;
1107
-
1108
- aPathParts.shift();
1109
- aPathParts.splice(-1, 1);
1110
- aPathParts.forEach(function (sPathPart: any, i: any) {
1111
- sPath += "/" + sPathPart;
1112
- const oRootViewController = oAppComponent.getRootViewController() as RootContainerBaseController;
1113
- const sParameterPath = oMetaModel.getMetaPath(sPath);
1114
- const bResultContext = oMetaModel.getObject(sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext");
1115
- if (bResultContext) {
1116
- // We dont need to create a breadcrumb for Parameter path
1117
- iSkipParameterized = 1;
1118
- return;
1056
+ async _setBreadcrumbLinks(oSource: any) {
1057
+ const oContext = oSource.getBindingContext(),
1058
+ oAppComponent = this.getAppComponent(),
1059
+ aPromises: Promise<void>[] = [],
1060
+ aSkipParameterized: any[] = [],
1061
+ sNewPath = oContext && oContext.getPath(),
1062
+ aPathParts = sNewPath && sNewPath.split("/"),
1063
+ oMetaModel = oAppComponent && oAppComponent.getMetaModel();
1064
+ let sPath = "";
1065
+ aPathParts.shift();
1066
+ aPathParts.splice(-1, 1);
1067
+ aPathParts.forEach(function (sPathPart: any) {
1068
+ sPath += `/${sPathPart}`;
1069
+ const oRootViewController = oAppComponent.getRootViewController() as RootContainerBaseController;
1070
+ const sParameterPath = oMetaModel.getMetaPath(sPath);
1071
+ const bResultContext = oMetaModel.getObject(`${sParameterPath}/@com.sap.vocabularies.Common.v1.ResultContext`);
1072
+ if (bResultContext) {
1073
+ // We dont need to create a breadcrumb for Parameter path
1074
+ aSkipParameterized.push(1);
1075
+ return;
1076
+ } else {
1077
+ aSkipParameterized.push(0);
1078
+ }
1079
+ aPromises.push(oRootViewController.getTitleInfoFromPath(sPath));
1080
+ });
1081
+ try {
1082
+ const titleHierarchyInfos: any[] = await Promise.all(aPromises);
1083
+ let idx, hierarchyPosition, oLink;
1084
+ for (const titleHierarchyInfo of titleHierarchyInfos) {
1085
+ hierarchyPosition = titleHierarchyInfos.indexOf(titleHierarchyInfo);
1086
+ idx = hierarchyPosition - aSkipParameterized[hierarchyPosition];
1087
+ oLink = oSource.getLinks()[idx] ? oSource.getLinks()[idx] : new Link();
1088
+ //sCurrentEntity is a fallback value in case of empty title
1089
+ oLink.setText(titleHierarchyInfo.subtitle || titleHierarchyInfo.title);
1090
+ oLink.setHref(titleHierarchyInfo.intent);
1091
+ if (!oSource.getLinks()[idx]) {
1092
+ oSource.addLink(oLink);
1119
1093
  }
1120
-
1121
- const pWaitForTitleHiearchyInfo = oRootViewController.getTitleInfoFromPath(sPath);
1122
-
1123
- pWaitForTitleHiearchyInfo
1124
- .then(function (oTitleHiearchyInfo: any) {
1125
- const idx = i - iSkipParameterized,
1126
- oLink = oSource.getLinks()[idx] ? oSource.getLinks()[idx] : new Link();
1127
- // sCurrentEntity is a fallback value in case of empty title
1128
- oLink.setText(oTitleHiearchyInfo.subtitle || oTitleHiearchyInfo.title);
1129
- oLink.setHref(oTitleHiearchyInfo.intent);
1130
- if (!oSource.getLinks()[idx]) {
1131
- oSource.addLink(oLink);
1132
- }
1133
- })
1134
- .catch(function (oError: any) {
1135
- Log.error("Error while computing the title hierarchy", oError);
1136
- });
1137
- });
1094
+ }
1095
+ } catch (error: any) {
1096
+ Log.error("Error while setting the breadcrumb links:" + error);
1138
1097
  }
1139
1098
  }
1140
1099
 
@@ -1170,17 +1129,17 @@ class ObjectPageController extends PageController {
1170
1129
  const sLinkId = id;
1171
1130
  // process viable links from getLinks for all datapoints having outbound
1172
1131
  if (aSupportedLinks && aSupportedLinks.length === 1 && aSupportedLinks[0].supported) {
1173
- oInternalModelContext.setProperty("isHeaderDPLinkVisible/" + sLinkId, true);
1132
+ oInternalModelContext.setProperty(`isHeaderDPLinkVisible/${sLinkId}`, true);
1174
1133
  }
1175
1134
  }
1176
1135
 
1177
1136
  /**
1178
- * @param oDataPoints
1137
+ * @param oSubDataPoints
1179
1138
  * @param oPageData
1180
1139
  */
1181
- function fnGetLinks(oDataPoints: any, oPageData: any) {
1182
- for (const sId in oDataPoints) {
1183
- const oDataPoint = oDataPoints[sId];
1140
+ function fnGetLinks(oSubDataPoints: any, oPageData: any) {
1141
+ for (const sId in oSubDataPoints) {
1142
+ const oDataPoint = oSubDataPoints[sId];
1184
1143
  const oParams: any = {};
1185
1144
  const oLink = oView.byId(sId);
1186
1145
  if (!oLink) {
@@ -1293,7 +1252,7 @@ class ObjectPageController extends PageController {
1293
1252
  }
1294
1253
  })
1295
1254
  .catch(function (err: any) {
1296
- Log.error("An error occurs while scrolling to the newly created Item: " + err);
1255
+ Log.error(`An error occurs while scrolling to the newly created Item: ${err}`);
1297
1256
  });
1298
1257
  }
1299
1258
  // fire ModelContextChange on the message button whenever the table context changes
@@ -1305,21 +1264,20 @@ class ObjectPageController extends PageController {
1305
1264
  * Invokes an action - bound/unbound and sets the page dirty.
1306
1265
  *
1307
1266
  * @param oView
1308
- * @param {string} sActionName The name of the action to be called
1309
- * @param {map} [mParameters] Contains the following attributes:
1310
- * @param {sap.ui.model.odata.v4.Context} [mParameters.contexts] Mandatory for a bound action, either one context or an array with contexts for which the action shall be called
1311
- * @param {sap.ui.model.odata.v4.ODataModel} [mParameters.model] Mandatory for an unbound action; an instance of an OData V4 model
1312
- * @returns {Promise}
1267
+ * @param sActionName The name of the action to be called
1268
+ * @param [mParameters] Contains the following attributes:
1269
+ * @param [mParameters.contexts] Mandatory for a bound action, either one context or an array with contexts for which the action shall be called
1270
+ * @param [mParameters.model] Mandatory for an unbound action; an instance of an OData V4 model
1271
+ * @returns The action promise
1313
1272
  * @ui5-restricted
1314
1273
  * @final
1315
1274
  */
1316
1275
  onCallAction(oView: any, sActionName: string, mParameters: any) {
1317
1276
  const oController = oView.getController();
1318
- const that = oController;
1319
1277
  return oController.editFlow
1320
1278
  .invokeAction(sActionName, mParameters)
1321
- .then(that._showMessagePopover.bind(that, undefined))
1322
- .catch(that._showMessagePopover.bind(that));
1279
+ .then(oController._showMessagePopover.bind(oController, undefined))
1280
+ .catch(oController._showMessagePopover.bind(oController));
1323
1281
  },
1324
1282
  onDataPointTitlePressed(oController: any, oSource: any, oManifestOutbound: any, sControlConfig: any, sCollectionPath: any) {
1325
1283
  oManifestOutbound = typeof oManifestOutbound === "string" ? JSON.parse(oManifestOutbound) : oManifestOutbound;
@@ -1336,7 +1294,7 @@ class ObjectPageController extends PageController {
1336
1294
  aNavigationData = aNavigationData.map(function (oNavigationData: any) {
1337
1295
  return {
1338
1296
  data: oNavigationData,
1339
- metaPath: sMetaPath + (sCollectionPath ? "/" + sCollectionPath : "")
1297
+ metaPath: sMetaPath + (sCollectionPath ? `/${sCollectionPath}` : "")
1340
1298
  };
1341
1299
  });
1342
1300
  if (oTargetInfo && oTargetInfo.parameters) {
@@ -1356,11 +1314,11 @@ class ObjectPageController extends PageController {
1356
1314
  /**
1357
1315
  * Triggers an outbound navigation when a user chooses the chevron.
1358
1316
  *
1359
- * @param {object} oController
1360
- * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
1361
- * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
1362
- * @param {string} sCreatePath Create path when the chevron is created.
1363
- * @returns {Promise} Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
1317
+ * @param oController
1318
+ * @param sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
1319
+ * @param oContext The context that contains the data for the target app
1320
+ * @param sCreatePath Create path when the chevron is created.
1321
+ * @returns Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
1364
1322
  * @ui5-restricted
1365
1323
  * @final
1366
1324
  */