@sapui5/sap.fe.templates 1.102.2 → 1.104.1

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 (123) hide show
  1. package/package.json +3 -4
  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 +9 -12
  8. package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +9 -12
  9. package/src/sap/fe/templates/ListReport/ListReport.view.xml +4 -3
  10. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +102 -313
  11. package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +109 -297
  12. package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.js +367 -0
  13. package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.ts +259 -0
  14. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +16 -9
  15. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.ts +17 -11
  16. package/src/sap/fe/templates/ListReport/overrides/Share.js +3 -4
  17. package/src/sap/fe/templates/ListReport/overrides/Share.ts +6 -7
  18. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +22 -31
  19. package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +33 -37
  20. package/src/sap/fe/templates/ListReport/view/fragments/CollectionVisualization.fragment.xml +1 -1
  21. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js +19 -3
  22. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.ts +75 -47
  23. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +12 -16
  24. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +17 -20
  25. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +5 -4
  26. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +270 -244
  27. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +175 -235
  28. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +62 -73
  29. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +75 -90
  30. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.tsx +132 -0
  31. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -3
  32. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +4 -4
  33. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
  34. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.ts +1 -1
  35. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
  36. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.ts +1 -1
  37. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
  38. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.ts +6 -6
  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 +67 -41
  46. package/src/sap/fe/templates/ObjectPage/overrides/Share.ts +44 -56
  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 +3 -10
  50. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +15 -5
  51. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +1 -1
  52. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacet.fragment.xml +1 -14
  53. package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +1 -0
  54. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderAddress.fragment.xml +7 -2
  55. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderContact.fragment.xml +26 -0
  56. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +1 -1
  57. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +4 -1
  58. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +6 -2
  59. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
  60. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
  61. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +25 -28
  62. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.ts +30 -33
  63. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +3 -4
  64. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.ts +4 -5
  65. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +140 -52
  66. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.ts +108 -54
  67. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
  68. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.ts +3 -3
  69. package/src/sap/fe/templates/TableScroller.js +3 -3
  70. package/src/sap/fe/templates/TableScroller.ts +2 -2
  71. package/src/sap/fe/templates/controls/Table.fragment.xml +1 -0
  72. package/src/sap/fe/templates/library.js +7 -3
  73. package/src/sap/fe/templates/library.ts +5 -0
  74. package/src/sap/fe/templates/messagebundle.properties +7 -22
  75. package/src/sap/fe/templates/messagebundle_ar.properties +3 -12
  76. package/src/sap/fe/templates/messagebundle_bg.properties +0 -9
  77. package/src/sap/fe/templates/messagebundle_ca.properties +2 -11
  78. package/src/sap/fe/templates/messagebundle_cs.properties +3 -12
  79. package/src/sap/fe/templates/messagebundle_cy.properties +0 -9
  80. package/src/sap/fe/templates/messagebundle_da.properties +3 -12
  81. package/src/sap/fe/templates/messagebundle_de.properties +2 -11
  82. package/src/sap/fe/templates/messagebundle_el.properties +2 -11
  83. package/src/sap/fe/templates/messagebundle_en.properties +2 -11
  84. package/src/sap/fe/templates/messagebundle_en_GB.properties +2 -11
  85. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +2 -11
  86. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +2 -11
  87. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +1 -5
  88. package/src/sap/fe/templates/messagebundle_es.properties +0 -9
  89. package/src/sap/fe/templates/messagebundle_es_MX.properties +2 -11
  90. package/src/sap/fe/templates/messagebundle_et.properties +0 -9
  91. package/src/sap/fe/templates/messagebundle_fi.properties +2 -11
  92. package/src/sap/fe/templates/messagebundle_fr.properties +3 -12
  93. package/src/sap/fe/templates/messagebundle_fr_CA.properties +2 -11
  94. package/src/sap/fe/templates/messagebundle_hi.properties +2 -11
  95. package/src/sap/fe/templates/messagebundle_hr.properties +2 -11
  96. package/src/sap/fe/templates/messagebundle_hu.properties +2 -11
  97. package/src/sap/fe/templates/messagebundle_id.properties +2 -11
  98. package/src/sap/fe/templates/messagebundle_it.properties +2 -11
  99. package/src/sap/fe/templates/messagebundle_iw.properties +2 -11
  100. package/src/sap/fe/templates/messagebundle_ja.properties +2 -11
  101. package/src/sap/fe/templates/messagebundle_kk.properties +2 -11
  102. package/src/sap/fe/templates/messagebundle_ko.properties +2 -11
  103. package/src/sap/fe/templates/messagebundle_lt.properties +2 -11
  104. package/src/sap/fe/templates/messagebundle_lv.properties +0 -9
  105. package/src/sap/fe/templates/messagebundle_ms.properties +2 -11
  106. package/src/sap/fe/templates/messagebundle_nl.properties +2 -11
  107. package/src/sap/fe/templates/messagebundle_no.properties +0 -9
  108. package/src/sap/fe/templates/messagebundle_pl.properties +0 -9
  109. package/src/sap/fe/templates/messagebundle_pt.properties +3 -12
  110. package/src/sap/fe/templates/messagebundle_pt_PT.properties +2 -11
  111. package/src/sap/fe/templates/messagebundle_ro.properties +0 -9
  112. package/src/sap/fe/templates/messagebundle_ru.properties +2 -11
  113. package/src/sap/fe/templates/messagebundle_sh.properties +2 -11
  114. package/src/sap/fe/templates/messagebundle_sk.properties +2 -11
  115. package/src/sap/fe/templates/messagebundle_sl.properties +2 -11
  116. package/src/sap/fe/templates/messagebundle_sv.properties +2 -11
  117. package/src/sap/fe/templates/messagebundle_th.properties +1 -10
  118. package/src/sap/fe/templates/messagebundle_tr.properties +2 -11
  119. package/src/sap/fe/templates/messagebundle_uk.properties +2 -11
  120. package/src/sap/fe/templates/messagebundle_vi.properties +0 -9
  121. package/src/sap/fe/templates/messagebundle_zh_CN.properties +0 -9
  122. package/src/sap/fe/templates/messagebundle_zh_TW.properties +2 -11
  123. package/src/sap/fe/templates/ObjectPage/view/fragments/SwitchDraftAndActiveObjectPopOver.fragment.xml +0 -27
@@ -1,4 +1,4 @@
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
4
  import CommonUtils from "sap/fe/core/CommonUtils";
@@ -19,41 +19,37 @@ import Placeholder from "sap/fe/core/controllerextensions/Placeholder";
19
19
  import Share from "sap/fe/core/controllerextensions/Share";
20
20
  import ViewState from "sap/fe/core/controllerextensions/ViewState";
21
21
  import { defineUI5Class, extensible, finalExtension, publicExtension, usingExtension } from "sap/fe/core/helpers/ClassSupport";
22
- 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";
23
24
  import PageController from "sap/fe/core/PageController";
24
25
  import ChartRuntime from "sap/fe/macros/chart/ChartRuntime";
25
26
  import CommonHelper from "sap/fe/macros/CommonHelper";
26
27
  import DelegateUtil from "sap/fe/macros/DelegateUtil";
27
28
  import TableUtils from "sap/fe/macros/table/Utils";
28
29
  import SelectionVariant from "sap/fe/navigation/SelectionVariant";
29
- import { default as ExtensionAPI, default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
30
- 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";
31
33
  import EditFlowOverrides from "sap/fe/templates/RootContainer/overrides/EditFlow";
32
34
  import TableScroller from "sap/fe/templates/TableScroller";
33
35
  import InstanceManager from "sap/m/InstanceManager";
34
36
  import Link from "sap/m/Link";
35
37
  import MessageBox from "sap/m/MessageBox";
36
- import Popover from "sap/m/Popover";
37
- import SelectList from "sap/m/SelectList";
38
- import Event from "sap/ui/base/Event";
39
- import Control from "sap/ui/core/Control";
38
+ import type Popover from "sap/m/Popover";
40
39
  import Core from "sap/ui/core/Core";
41
- import Fragment from "sap/ui/core/Fragment";
42
- import Item from "sap/ui/core/Item";
43
40
  import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
44
- import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
45
- import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
46
- import Binding from "sap/ui/model/Binding";
41
+ import type Binding from "sap/ui/model/Binding";
47
42
  import JSONModel from "sap/ui/model/json/JSONModel";
48
- import Context from "sap/ui/model/odata/v4/Context";
43
+ import type Context from "sap/ui/model/odata/v4/Context";
49
44
  import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
50
- import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
51
- import ODataModel from "sap/ui/model/odata/v4/ODataModel";
52
- import ResourceModel from "sap/ui/model/resource/ResourceModel";
53
- import ObjectPageDynamicHeaderTitle from "sap/uxap/ObjectPageDynamicHeaderTitle";
54
- import ObjectPageLayout from "sap/uxap/ObjectPageLayout";
55
- import ObjectPageSection from "sap/uxap/ObjectPageSection";
56
- 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 BreadCrumbs from "sap/uxap/BreadCrumbs";
49
+ import type ObjectPageDynamicHeaderTitle from "sap/uxap/ObjectPageDynamicHeaderTitle";
50
+ import type ObjectPageLayout from "sap/uxap/ObjectPageLayout";
51
+ import type ObjectPageSection from "sap/uxap/ObjectPageSection";
52
+ import type ObjectPageSubSection from "sap/uxap/ObjectPageSubSection";
57
53
  import IntentBasedNavigationOverride from "./overrides/IntentBasedNavigation";
58
54
  import InternalRoutingOverride from "./overrides/InternalRouting";
59
55
  import MessageHandlerOverride from "./overrides/MessageHandler";
@@ -151,11 +147,15 @@ class ObjectPageController extends PageController {
151
147
  onExit() {
152
148
  if (this.mCustomSectionExtensionAPIs) {
153
149
  for (const sId of Object.keys(this.mCustomSectionExtensionAPIs)) {
154
- this.mCustomSectionExtensionAPIs[sId] && this.mCustomSectionExtensionAPIs[sId].destroy();
150
+ if (this.mCustomSectionExtensionAPIs[sId]) {
151
+ this.mCustomSectionExtensionAPIs[sId].destroy();
152
+ }
155
153
  }
156
154
  delete this.mCustomSectionExtensionAPIs;
157
155
  }
158
- this.extensionAPI && this.extensionAPI.destroy();
156
+ if (this.extensionAPI) {
157
+ this.extensionAPI.destroy();
158
+ }
159
159
  delete this.extensionAPI;
160
160
 
161
161
  const oMessageButton = this.getView().byId("fe::FooterBar::MessageButton"),
@@ -177,7 +177,7 @@ class ObjectPageController extends PageController {
177
177
  onBeforeRendering() {
178
178
  PageController.prototype.onBeforeRendering.apply(this);
179
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) {
180
+ if (this.oView.oViewData?.retrieveTextFromValueList && CommonHelper.getMetaModel() === undefined) {
181
181
  CommonHelper.setMetaModel(this.getAppComponent().getMetaModel());
182
182
  }
183
183
  }
@@ -195,7 +195,7 @@ class ObjectPageController extends PageController {
195
195
  _onBeforeBinding(oContext: any, mParameters: any) {
196
196
  // TODO: we should check how this comes together with the transaction helper, same to the change in the afterBinding
197
197
  const aTables = this._findTables(),
198
- oObjectPage = this._getObjectPageLayoutControl() as ObjectPageLayout,
198
+ oObjectPage = this._getObjectPageLayoutControl(),
199
199
  oInternalModelContext = this.getView().getBindingContext("internal") as InternalModelContext,
200
200
  oInternalModel = this.getView().getModel("internal") as JSONModel,
201
201
  aBatchGroups = oInternalModelContext.getProperty("batchGroups"),
@@ -309,7 +309,13 @@ class ObjectPageController extends PageController {
309
309
  oFirstClickableElement = aActions.find(function (oAction: any) {
310
310
  // Due to the left alignment of the Draft switch and the collaborative draft avatar controls
311
311
  // there is a ToolbarSpacer in the actions aggregation which we need to exclude here!
312
- 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
+ );
313
319
  });
314
320
  }
315
321
  return oFirstClickableElement;
@@ -348,7 +354,7 @@ class ObjectPageController extends PageController {
348
354
  return aFields[0];
349
355
  }
350
356
  } catch (error) {
351
- Log.debug("Error when searching for mandaotry empty field: " + error);
357
+ Log.debug(`Error when searching for mandaotry empty field: ${error}`);
352
358
  }
353
359
  }
354
360
  }
@@ -362,7 +368,7 @@ class ObjectPageController extends PageController {
362
368
  }
363
369
 
364
370
  _updateFocusInEditMode(aSubSections: any) {
365
- const oObjectPage = this._getObjectPageLayoutControl() as ObjectPageLayout;
371
+ const oObjectPage = this._getObjectPageLayoutControl();
366
372
 
367
373
  const oMandatoryField = this._getFirstEmptyMandatoryFieldFromSubSection(aSubSections);
368
374
  let oFieldToFocus: any;
@@ -405,7 +411,7 @@ class ObjectPageController extends PageController {
405
411
 
406
412
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
407
413
  _onAfterBinding(oBindingContext: any, mParameters: any) {
408
- const oObjectPage = this._getObjectPageLayoutControl() as ObjectPageLayout;
414
+ const oObjectPage = this._getObjectPageLayoutControl();
409
415
  const aTables = this._findTables();
410
416
 
411
417
  this._sideEffects.clearPropertiesStatus();
@@ -449,7 +455,7 @@ class ObjectPageController extends PageController {
449
455
  // Update 'enabled' property of DataFieldForAction buttons on table toolbar
450
456
  // The same is also performed on Table selectionChange event
451
457
  const oActionOperationAvailableMap = JSON.parse(
452
- CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap")) as any
458
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
453
459
  ),
454
460
  aSelectedContexts = oTable.getSelectedContexts();
455
461
 
@@ -471,40 +477,35 @@ class ObjectPageController extends PageController {
471
477
  * @param oTable
472
478
  * @param oListBinding
473
479
  */
474
- function enableFastCreationRow(oTable: any, oListBinding: any) {
480
+ async function enableFastCreationRow(oTable: any, oListBinding: any) {
475
481
  const oFastCreationRow = oTable.getCreationRow();
476
482
  let oFastCreationListBinding, oFastCreationContext;
477
483
 
478
484
  if (oFastCreationRow) {
479
- oFinalUIState
480
- .then(function () {
481
- if (oFastCreationRow.getModel("ui").getProperty("/isEditable")) {
482
- oFastCreationListBinding = oModel.bindList(oListBinding.getPath(), oListBinding.getContext(), [], [], {
483
- $$updateGroupId: "doNotSubmit",
484
- $$groupId: "doNotSubmit"
485
- });
486
- // Workaround suggested by OData model v4 colleagues
487
- oFastCreationListBinding.refreshInternal = function () {
488
- /* do nothing */
489
- };
490
- /*
491
- oFastCreationListBinding.hasPendingChanges = function() {
492
- return false;
493
- };
494
- */
495
-
496
- oFastCreationContext = oFastCreationListBinding.create();
497
- oFastCreationRow.setBindingContext(oFastCreationContext);
498
-
499
- // this is needed to avoid console error
500
- oFastCreationContext.created().catch(function () {
501
- Log.trace("transient fast creation context deleted");
502
- });
485
+ try {
486
+ await oFinalUIState;
487
+ if (oFastCreationRow.getModel("ui").getProperty("/isEditable")) {
488
+ oFastCreationListBinding = oModel.bindList(oListBinding.getPath(), oListBinding.getContext(), [], [], {
489
+ $$updateGroupId: "doNotSubmit",
490
+ $$groupId: "doNotSubmit"
491
+ });
492
+ // Workaround suggested by OData model v4 colleagues
493
+ oFastCreationListBinding.refreshInternal = function () {
494
+ /* do nothing */
495
+ };
496
+ oFastCreationContext = oFastCreationListBinding.create();
497
+ oFastCreationRow.setBindingContext(oFastCreationContext);
498
+
499
+ // this is needed to avoid console error
500
+ try {
501
+ await oFastCreationContext.created();
502
+ } catch (e) {
503
+ Log.trace("transient fast creation context deleted");
503
504
  }
504
- })
505
- .catch(function (oError: any) {
506
- Log.error("Error while computing the final UI state", oError);
507
- });
505
+ }
506
+ } catch (oError: any) {
507
+ Log.error("Error while computing the final UI state", oError);
508
+ }
508
509
  }
509
510
  }
510
511
 
@@ -519,7 +520,7 @@ class ObjectPageController extends PageController {
519
520
  };
520
521
 
521
522
  if (!oBinding) {
522
- Log.error("Expected binding missing for table: " + oTable.getId());
523
+ Log.error(`Expected binding missing for table: ${oTable.getId()}`);
523
524
  return;
524
525
  }
525
526
 
@@ -640,9 +641,7 @@ class ObjectPageController extends PageController {
640
641
  /**
641
642
  * Get the status of edit mode for sticky session.
642
643
  *
643
- * @returns {boolean} The status of edit mode for sticky session
644
- *
645
- *
644
+ * @returns The status of edit mode for sticky session
646
645
  */
647
646
  getStickyEditMode() {
648
647
  const oBindingContext = this.getView().getBindingContext && (this.getView().getBindingContext() as Context);
@@ -665,18 +664,16 @@ class ObjectPageController extends PageController {
665
664
  const oObjectPageSubtitle = oObjectPage.getCustomData().find(function (oCustomData: any) {
666
665
  return oCustomData.getKey() === "ObjectPageSubtitle";
667
666
  });
668
- const oTitleInfo = {
667
+ return {
669
668
  title: oObjectPage.data("ObjectPageTitle") || "",
670
669
  subtitle: oObjectPageSubtitle && oObjectPageSubtitle.getValue(),
671
670
  intent: "",
672
671
  icon: ""
673
672
  };
674
-
675
- return oTitleInfo;
676
673
  }
677
674
 
678
675
  _executeHeaderShortcut(sId: any) {
679
- const sButtonId = this.getView().getId() + "--" + sId,
676
+ const sButtonId = `${this.getView().getId()}--${sId}`,
680
677
  oButton = (this._getObjectPageLayoutControl().getHeaderTitle() as ObjectPageDynamicHeaderTitle)
681
678
  .getActions()
682
679
  .find(function (oElement: any) {
@@ -686,7 +683,7 @@ class ObjectPageController extends PageController {
686
683
  }
687
684
 
688
685
  _executeFooterShortcut(sId: any) {
689
- const sButtonId = this.getView().getId() + "--" + sId,
686
+ const sButtonId = `${this.getView().getId()}--${sId}`,
690
687
  oButton = (this._getObjectPageLayoutControl().getFooter() as any).getContent().find(function (oElement: any) {
691
688
  return oElement.getMetadata().getName() === "sap.m.Button" && oElement.getId() === sButtonId;
692
689
  });
@@ -705,12 +702,11 @@ class ObjectPageController extends PageController {
705
702
  if (iSelectedSectionIndex <= iSectionIndexMax - 1) {
706
703
  newSection = aSections[++iSelectedSectionIndex];
707
704
  }
708
- } else {
705
+ } else if (iSelectedSectionIndex !== 0) {
709
706
  // PreviousTab
710
- if (iSelectedSectionIndex !== 0) {
711
- newSection = aSections[--iSelectedSectionIndex];
712
- }
707
+ newSection = aSections[--iSelectedSectionIndex];
713
708
  }
709
+
714
710
  if (newSection) {
715
711
  oObjectPage.setSelectedSection(newSection);
716
712
  newSection.focus();
@@ -762,7 +758,7 @@ class ObjectPageController extends PageController {
762
758
  });
763
759
  }
764
760
 
765
- _saveDocument(oContext: any) {
761
+ async _saveDocument(oContext: any) {
766
762
  const oModel = this.getView().getModel("ui"),
767
763
  aWaitCreateDocuments: any[] = [];
768
764
  // indicates if we are creating a new row in the OP
@@ -791,19 +787,33 @@ class ObjectPageController extends PageController {
791
787
  );
792
788
  }
793
789
  });
794
- return Promise.all(aWaitCreateDocuments)
795
- .then((aBindings: any[]) => {
796
- const mParameters = {
797
- bExecuteSideEffectsOnError: bExecuteSideEffectsOnError,
798
- bindings: aBindings
799
- };
800
- return this.editFlow.saveDocument(oContext, mParameters).catch(() => this._showMessagePopover);
801
- })
802
- .finally(function () {
803
- if (BusyLocker.isLocked(oModel)) {
804
- BusyLocker.unlock(oModel);
805
- }
806
- });
790
+
791
+ try {
792
+ const aBindings = await Promise.all(aWaitCreateDocuments);
793
+ const mParameters = {
794
+ bExecuteSideEffectsOnError: bExecuteSideEffectsOnError,
795
+ bindings: aBindings
796
+ };
797
+ // We need to either reject or resolve a promise here and return it since this save
798
+ // function is not only called when pressing the save button in the footer, but also
799
+ // when the user selects create or save in a dataloss popup.
800
+ // The logic of the dataloss popup needs to detect if the save had errors or not in order
801
+ // to decide if the subsequent action - like a back navigation - has to be executed or not.
802
+ try {
803
+ await this.editFlow.saveDocument(oContext, mParameters);
804
+ } catch (error: any) {
805
+ // If the saveDocument in editFlow returns errors we need
806
+ // to show the message popover here and ensure that the
807
+ // dataloss logic does not perform the follow up function
808
+ // like e.g. a back navigation hence we return a promise and reject it
809
+ this._showMessagePopover(error);
810
+ throw error;
811
+ }
812
+ } finally {
813
+ if (BusyLocker.isLocked(oModel)) {
814
+ BusyLocker.unlock(oModel);
815
+ }
816
+ }
807
817
  }
808
818
 
809
819
  _manageCollaboration() {
@@ -823,73 +833,6 @@ class ObjectPageController extends PageController {
823
833
  return this.editFlow.applyDocument(oContext).catch(() => this._showMessagePopover());
824
834
  }
825
835
 
826
- _showSwitchDraftAndActivePopover(event: Event) {
827
- const view = this.getView(),
828
- source = event.getSource(),
829
- fragmentName = "sap.fe.templates.ObjectPage.view.fragments.SwitchDraftAndActiveObjectPopOver";
830
-
831
- if (this.switchDraftAndActivePopOver) {
832
- this.switchDraftAndActivePopOver.openBy(source, false);
833
- } else {
834
- const localThisModel = new JSONModel({}),
835
- preprocessorSettings = {
836
- bindingContexts: {
837
- "this": localThisModel.createBindingContext("/")
838
- },
839
- models: {
840
- "this": localThisModel
841
- }
842
- };
843
- const popoverFragment = XMLTemplateProcessor.loadTemplate(fragmentName, "fragment");
844
- Promise.resolve(XMLPreprocessor.process(popoverFragment, { name: fragmentName }, preprocessorSettings))
845
- .then((fragment) => {
846
- return Fragment.load({ definition: fragment, controller: this });
847
- })
848
- .then((popover: any) => {
849
- view.addDependent(popover);
850
- popover.setModel(view.getModel("sap.fe.i18n"), "i18n");
851
- popover.setPlacement("Bottom");
852
- this.switchDraftAndActivePopOver = popover;
853
- popover.attachAfterOpen(() => {
854
- // While the list entry corresponding to the currently displayed document version is emphasized with a blue
855
- // background, we need to pre-focus the other entry
856
- const context: any = this.getView().getBindingContext(),
857
- isActiveEntity = context.getObject().IsActiveEntity;
858
- const switchDraftAndActiveOptionsList: SelectList = (popover.getContent() as unknown as Control[]).find(
859
- (element) => element.data("listIdentifier") === "switchDraftAndActivePopoverList"
860
- ) as SelectList;
861
- const listItemToFocus: Item = isActiveEntity
862
- ? (switchDraftAndActiveOptionsList.getItems().find((element) => element.getKey() === "switchToDraft") as Item)
863
- : (switchDraftAndActiveOptionsList.getItems().find((element) => element.getKey() === "switchToActive") as Item);
864
- listItemToFocus.focus();
865
- });
866
- popover.openBy(source);
867
- // ensure to remove the reference to the draft popover as it would be destroyed on exit
868
- view.attachEventOnce("beforeExit", () => {
869
- delete this.switchDraftAndActivePopOver;
870
- });
871
- })
872
- .catch(function (Error) {
873
- Log.error("Error while opening the draft switch popup", Error);
874
- });
875
- }
876
- }
877
-
878
- _switchDraftAndActivePopoverListSelect(event: Event) {
879
- const context: any = this.getView().getBindingContext(),
880
- selectedItemKey = event.getParameter("item").getProperty("key"),
881
- isActiveEntity = context.getObject().IsActiveEntity;
882
- // It was decided that we should NOT set the entry in the list corresponding to the currently displayed document version to
883
- // disabled, hence the user can click entries which to not cause an action (clicking "Draft" when you already display the
884
- // draft version of the document)
885
- // Hence we check here which entry in the list was clicked and which document version we currently display and only do
886
- // the switch between draft / active version if it makes sense.
887
- if ((isActiveEntity && selectedItemKey === "switchToDraft") || (!isActiveEntity && selectedItemKey === "switchToActive")) {
888
- this.editFlow.toggleDraftActive(context);
889
- }
890
- ((event.getSource() as Control).getParent() as Popover).close();
891
- }
892
-
893
836
  _updateRelatedApps() {
894
837
  const oObjectPage = this._getObjectPageLayoutControl();
895
838
  if (CommonUtils.resolveStringtoBoolean(oObjectPage.data("showRelatedApps"))) {
@@ -929,15 +872,13 @@ class ObjectPageController extends PageController {
929
872
  ) {
930
873
  //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
931
874
  aSubsection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
932
- } else {
933
- if (aSubSectionTables && !aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")) {
934
- aSubSectionTables.forEach(function (oTable: { table: any; gridTable: any }) {
935
- if (oTable.gridTable) {
936
- //Resetting the row count to default value in case we have a combination of forms and tables or multiple tables in a subsection
937
- oTable.table.getType().setRowCount(null);
938
- }
939
- });
940
- }
875
+ } else if (aSubSectionTables && !aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")) {
876
+ aSubSectionTables.forEach(function (oTable: { table: any; gridTable: any }) {
877
+ if (oTable.gridTable) {
878
+ //Resetting the row count to default value in case we have a combination of forms and tables or multiple tables in a subsection
879
+ oTable.table.getType().setRowCount(null);
880
+ }
881
+ });
941
882
  }
942
883
  }
943
884
 
@@ -982,9 +923,9 @@ class ObjectPageController extends PageController {
982
923
  /**
983
924
  * Chart Context is resolved for 1:n microcharts.
984
925
  *
985
- * @param {sap.ui.model.Context} oChartContext The Context of the MicroChart
986
- * @param {string} sChartPath The collectionPath of the the chart
987
- * @returns {Array} Array of Attributes of the chart Context
926
+ * @param oChartContext The Context of the MicroChart
927
+ * @param sChartPath The collectionPath of the the chart
928
+ * @returns Array of Attributes of the chart Context
988
929
  */
989
930
  _getChartContextData(oChartContext: any, sChartPath: string) {
990
931
  const oContextData = oChartContext.getObject();
@@ -1005,7 +946,6 @@ class ObjectPageController extends PageController {
1005
946
  * @function
1006
947
  * @name sap.fe.templates.ObjectPage.ObjectPageController.controller#_scrollTablesToRow
1007
948
  * @param {string} sRowPath 'sPath of the table row'
1008
- *
1009
949
  */
1010
950
 
1011
951
  _scrollTablesToRow(sRowPath: string) {
@@ -1022,10 +962,10 @@ class ObjectPageController extends PageController {
1022
962
  *
1023
963
  * @function
1024
964
  * @name _mergeMultipleContexts
1025
- * @param {object} oPageContext Page context
1026
- * @param {object|Array} aLineContext Selected Contexts
1027
- * @param {string} sChartPath Collection name of the chart
1028
- * @returns {object} Selection Variant Object
965
+ * @param oPageContext Page context
966
+ * @param aLineContext Selected Contexts
967
+ * @param sChartPath Collection name of the chart
968
+ * @returns Selection Variant Object
1029
969
  */
1030
970
  _mergeMultipleContexts(oPageContext: Context, aLineContext: any[], sChartPath: string) {
1031
971
  let aAttributes: any[] = [],
@@ -1044,14 +984,14 @@ class ObjectPageController extends PageController {
1044
984
  sPathLine = oContext.getPath();
1045
985
  sMetaPathLine = oMetaModel && oMetaModel.getMetaPath(sPathLine).replace(/^\/*/, "");
1046
986
 
1047
- aLineContext.map((oSingleContext: any) => {
987
+ aLineContext.forEach((oSingleContext: any) => {
1048
988
  if (sChartPath) {
1049
989
  const oChartContextData = this._getChartContextData(oSingleContext, sChartPath);
1050
990
  if (oChartContextData) {
1051
- aAttributes = oChartContextData.map(function (oChartContextData: any) {
991
+ aAttributes = oChartContextData.map(function (oSubChartContextData: any) {
1052
992
  return {
1053
- contextData: oChartContextData,
1054
- entitySet: sMetaPathPage + "/" + sChartPath
993
+ contextData: oSubChartContextData,
994
+ entitySet: `${sMetaPathPage}/${sChartPath}`
1055
995
  };
1056
996
  });
1057
997
  }
@@ -1099,54 +1039,55 @@ class ObjectPageController extends PageController {
1099
1039
  *
1100
1040
  * @function
1101
1041
  * @param {sap.m.Breadcrumbs} [oSource] parent control
1102
- * @description Used when context of the objectpage changes.
1042
+ * @description Used when context of the object page changes.
1103
1043
  * This event callback is attached to modelContextChange
1104
1044
  * event of the Breadcrumb control to catch context change.
1105
- * Then element binding and hrefs are updated for each Link.
1045
+ * Then element binding and hrefs are updated for each link.
1106
1046
  *
1107
1047
  * @ui5-restricted
1108
1048
  * @experimental
1109
1049
  */
1110
- _setBreadcrumbLinks(oSource: any) {
1111
- const oContext = oSource.getBindingContext();
1112
- const oAppComponent = this.getAppComponent();
1113
- if (oContext) {
1114
- const sNewPath = oContext.getPath(),
1115
- aPathParts = sNewPath.split("/"),
1116
- oMetaModel = oAppComponent.getMetaModel();
1117
- let sPath = "",
1118
- iSkipParameterized = 0;
1119
-
1120
- aPathParts.shift();
1121
- aPathParts.splice(-1, 1);
1122
- aPathParts.forEach(function (sPathPart: any, i: any) {
1123
- sPath += "/" + sPathPart;
1124
- const oRootViewController = oAppComponent.getRootViewController() as RootContainerBaseController;
1125
- const sParameterPath = oMetaModel.getMetaPath(sPath);
1126
- const bResultContext = oMetaModel.getObject(sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext");
1127
- if (bResultContext) {
1128
- // We dont need to create a breadcrumb for Parameter path
1129
- iSkipParameterized = 1;
1130
- return;
1050
+ async _setBreadcrumbLinks(oSource: BreadCrumbs) {
1051
+ const oContext = oSource.getBindingContext(),
1052
+ oAppComponent = this.getAppComponent(),
1053
+ aPromises: Promise<void>[] = [],
1054
+ aSkipParameterized: any[] = [],
1055
+ sNewPath = oContext?.getPath(),
1056
+ aPathParts = sNewPath?.split("/") ?? [],
1057
+ oMetaModel = oAppComponent && oAppComponent.getMetaModel();
1058
+ let sPath = "";
1059
+ aPathParts.shift();
1060
+ aPathParts.splice(-1, 1);
1061
+ aPathParts.forEach(function (sPathPart: any) {
1062
+ sPath += `/${sPathPart}`;
1063
+ const oRootViewController = oAppComponent.getRootViewController() as RootContainerBaseController;
1064
+ const sParameterPath = oMetaModel.getMetaPath(sPath);
1065
+ const bResultContext = oMetaModel.getObject(`${sParameterPath}/@com.sap.vocabularies.Common.v1.ResultContext`);
1066
+ if (bResultContext) {
1067
+ // We dont need to create a breadcrumb for Parameter path
1068
+ aSkipParameterized.push(1);
1069
+ return;
1070
+ } else {
1071
+ aSkipParameterized.push(0);
1072
+ }
1073
+ aPromises.push(oRootViewController.getTitleInfoFromPath(sPath));
1074
+ });
1075
+ try {
1076
+ const titleHierarchyInfos: any[] = await Promise.all(aPromises);
1077
+ let idx, hierarchyPosition, oLink;
1078
+ for (const titleHierarchyInfo of titleHierarchyInfos) {
1079
+ hierarchyPosition = titleHierarchyInfos.indexOf(titleHierarchyInfo);
1080
+ idx = hierarchyPosition - aSkipParameterized[hierarchyPosition];
1081
+ oLink = oSource.getLinks()[idx] ? oSource.getLinks()[idx] : new Link();
1082
+ //sCurrentEntity is a fallback value in case of empty title
1083
+ oLink.setText(titleHierarchyInfo.subtitle || titleHierarchyInfo.title);
1084
+ oLink.setHref(titleHierarchyInfo.intent);
1085
+ if (!oSource.getLinks()[idx]) {
1086
+ oSource.addLink(oLink);
1131
1087
  }
1132
-
1133
- const pWaitForTitleHiearchyInfo = oRootViewController.getTitleInfoFromPath(sPath);
1134
-
1135
- pWaitForTitleHiearchyInfo
1136
- .then(function (oTitleHiearchyInfo: any) {
1137
- const idx = i - iSkipParameterized,
1138
- oLink = oSource.getLinks()[idx] ? oSource.getLinks()[idx] : new Link();
1139
- // sCurrentEntity is a fallback value in case of empty title
1140
- oLink.setText(oTitleHiearchyInfo.subtitle || oTitleHiearchyInfo.title);
1141
- oLink.setHref(oTitleHiearchyInfo.intent);
1142
- if (!oSource.getLinks()[idx]) {
1143
- oSource.addLink(oLink);
1144
- }
1145
- })
1146
- .catch(function (oError: any) {
1147
- Log.error("Error while computing the title hierarchy", oError);
1148
- });
1149
- });
1088
+ }
1089
+ } catch (error: any) {
1090
+ Log.error("Error while setting the breadcrumb links:" + error);
1150
1091
  }
1151
1092
  }
1152
1093
 
@@ -1182,17 +1123,17 @@ class ObjectPageController extends PageController {
1182
1123
  const sLinkId = id;
1183
1124
  // process viable links from getLinks for all datapoints having outbound
1184
1125
  if (aSupportedLinks && aSupportedLinks.length === 1 && aSupportedLinks[0].supported) {
1185
- oInternalModelContext.setProperty("isHeaderDPLinkVisible/" + sLinkId, true);
1126
+ oInternalModelContext.setProperty(`isHeaderDPLinkVisible/${sLinkId}`, true);
1186
1127
  }
1187
1128
  }
1188
1129
 
1189
1130
  /**
1190
- * @param oDataPoints
1131
+ * @param oSubDataPoints
1191
1132
  * @param oPageData
1192
1133
  */
1193
- function fnGetLinks(oDataPoints: any, oPageData: any) {
1194
- for (const sId in oDataPoints) {
1195
- const oDataPoint = oDataPoints[sId];
1134
+ function fnGetLinks(oSubDataPoints: any, oPageData: any) {
1135
+ for (const sId in oSubDataPoints) {
1136
+ const oDataPoint = oSubDataPoints[sId];
1196
1137
  const oParams: any = {};
1197
1138
  const oLink = oView.byId(sId);
1198
1139
  if (!oLink) {
@@ -1305,7 +1246,7 @@ class ObjectPageController extends PageController {
1305
1246
  }
1306
1247
  })
1307
1248
  .catch(function (err: any) {
1308
- Log.error("An error occurs while scrolling to the newly created Item: " + err);
1249
+ Log.error(`An error occurs while scrolling to the newly created Item: ${err}`);
1309
1250
  });
1310
1251
  }
1311
1252
  // fire ModelContextChange on the message button whenever the table context changes
@@ -1317,21 +1258,20 @@ class ObjectPageController extends PageController {
1317
1258
  * Invokes an action - bound/unbound and sets the page dirty.
1318
1259
  *
1319
1260
  * @param oView
1320
- * @param {string} sActionName The name of the action to be called
1321
- * @param {map} [mParameters] Contains the following attributes:
1322
- * @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
1323
- * @param {sap.ui.model.odata.v4.ODataModel} [mParameters.model] Mandatory for an unbound action; an instance of an OData V4 model
1324
- * @returns {Promise}
1261
+ * @param sActionName The name of the action to be called
1262
+ * @param [mParameters] Contains the following attributes:
1263
+ * @param [mParameters.contexts] Mandatory for a bound action, either one context or an array with contexts for which the action shall be called
1264
+ * @param [mParameters.model] Mandatory for an unbound action; an instance of an OData V4 model
1265
+ * @returns The action promise
1325
1266
  * @ui5-restricted
1326
1267
  * @final
1327
1268
  */
1328
1269
  onCallAction(oView: any, sActionName: string, mParameters: any) {
1329
1270
  const oController = oView.getController();
1330
- const that = oController;
1331
1271
  return oController.editFlow
1332
1272
  .invokeAction(sActionName, mParameters)
1333
- .then(that._showMessagePopover.bind(that, undefined))
1334
- .catch(that._showMessagePopover.bind(that));
1273
+ .then(oController._showMessagePopover.bind(oController, undefined))
1274
+ .catch(oController._showMessagePopover.bind(oController));
1335
1275
  },
1336
1276
  onDataPointTitlePressed(oController: any, oSource: any, oManifestOutbound: any, sControlConfig: any, sCollectionPath: any) {
1337
1277
  oManifestOutbound = typeof oManifestOutbound === "string" ? JSON.parse(oManifestOutbound) : oManifestOutbound;
@@ -1348,7 +1288,7 @@ class ObjectPageController extends PageController {
1348
1288
  aNavigationData = aNavigationData.map(function (oNavigationData: any) {
1349
1289
  return {
1350
1290
  data: oNavigationData,
1351
- metaPath: sMetaPath + (sCollectionPath ? "/" + sCollectionPath : "")
1291
+ metaPath: sMetaPath + (sCollectionPath ? `/${sCollectionPath}` : "")
1352
1292
  };
1353
1293
  });
1354
1294
  if (oTargetInfo && oTargetInfo.parameters) {
@@ -1368,11 +1308,11 @@ class ObjectPageController extends PageController {
1368
1308
  /**
1369
1309
  * Triggers an outbound navigation when a user chooses the chevron.
1370
1310
  *
1371
- * @param {object} oController
1372
- * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
1373
- * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
1374
- * @param {string} sCreatePath Create path when the chevron is created.
1375
- * @returns {Promise} Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
1311
+ * @param oController
1312
+ * @param sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
1313
+ * @param oContext The context that contains the data for the target app
1314
+ * @param sCreatePath Create path when the chevron is created.
1315
+ * @returns Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
1376
1316
  * @ui5-restricted
1377
1317
  * @final
1378
1318
  */