@sapui5/sap.fe.templates 1.111.1 → 1.113.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 (130) hide show
  1. package/package.json +1 -1
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/AnalyticalListPage/manifest.json +1 -1
  4. package/src/sap/fe/templates/ListComponent-dbg.js +1 -1
  5. package/src/sap/fe/templates/ListComponent.ts +2 -0
  6. package/src/sap/fe/templates/ListReport/Component-dbg.js +1 -1
  7. package/src/sap/fe/templates/ListReport/Component.ts +2 -0
  8. package/src/sap/fe/templates/ListReport/ExtensionAPI-dbg.js +4 -1
  9. package/src/sap/fe/templates/ListReport/ExtensionAPI.js.map +1 -1
  10. package/src/sap/fe/templates/ListReport/ExtensionAPI.ts +5 -0
  11. package/src/sap/fe/templates/ListReport/LRMessageStrip-dbg.js +1 -1
  12. package/src/sap/fe/templates/ListReport/LRMessageStrip.ts +4 -0
  13. package/src/sap/fe/templates/ListReport/ListReport.view.xml +1 -1
  14. package/src/sap/fe/templates/ListReport/ListReportController-dbg.controller.js +55 -42
  15. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +1 -1
  16. package/src/sap/fe/templates/ListReport/ListReportController.controller.js.map +1 -1
  17. package/src/sap/fe/templates/ListReport/ListReportController.controller.ts +75 -61
  18. package/src/sap/fe/templates/ListReport/controls/MultipleModeControl-dbg.js +33 -9
  19. package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.js +1 -1
  20. package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.js.map +1 -1
  21. package/src/sap/fe/templates/ListReport/controls/MultipleModeControl.ts +39 -9
  22. package/src/sap/fe/templates/ListReport/manifest.json +1 -1
  23. package/src/sap/fe/templates/ListReport/overrides/ViewState-dbg.js +47 -7
  24. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +1 -1
  25. package/src/sap/fe/templates/ListReport/overrides/ViewState.js.map +1 -1
  26. package/src/sap/fe/templates/ListReport/overrides/ViewState.ts +49 -6
  27. package/src/sap/fe/templates/ListReport/view/fragments/MacroChart.fragment.xml +1 -1
  28. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.block-dbg.js +122 -0
  29. package/src/sap/fe/templates/ListReport/view/fragments/{MultipleMode.fragment.js → MultipleMode.block.js} +3 -3
  30. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.block.js.map +1 -0
  31. package/src/sap/fe/templates/ListReport/view/fragments/{MultipleMode.fragment.ts → MultipleMode.block.ts} +14 -15
  32. package/src/sap/fe/templates/ObjectPage/Component-dbg.js +12 -3
  33. package/src/sap/fe/templates/ObjectPage/Component.js +1 -1
  34. package/src/sap/fe/templates/ObjectPage/Component.js.map +1 -1
  35. package/src/sap/fe/templates/ObjectPage/Component.ts +13 -1
  36. package/src/sap/fe/templates/ObjectPage/ExtensionAPI-dbg.js +10 -12
  37. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +1 -1
  38. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js.map +1 -1
  39. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.ts +11 -12
  40. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +3 -2
  41. package/src/sap/fe/templates/ObjectPage/ObjectPageController-dbg.controller.js +144 -121
  42. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +1 -1
  43. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js.map +1 -1
  44. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.ts +190 -143
  45. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating-dbg.js +55 -146
  46. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js +1 -1
  47. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.js.map +1 -1
  48. package/src/sap/fe/templates/ObjectPage/ObjectPageTemplating.ts +71 -185
  49. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.block-dbg.js +145 -0
  50. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.block.js +6 -0
  51. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.block.js.map +1 -0
  52. package/src/sap/fe/templates/ObjectPage/components/{DraftHandlerButton.tsx → DraftHandlerButton.block.tsx} +15 -12
  53. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox-dbg.js +1 -1
  54. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.ts +1 -0
  55. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock-dbg.js +2 -1
  56. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js.map +1 -1
  57. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.ts +5 -0
  58. package/src/sap/fe/templates/ObjectPage/manifest.json +1 -1
  59. package/src/sap/fe/templates/ObjectPage/overrides/Share.js.map +1 -1
  60. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +4 -3
  61. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block-dbg.js +257 -0
  62. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block.js +6 -0
  63. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block.js.map +1 -0
  64. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.block.tsx +280 -0
  65. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +8 -33
  66. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +189 -109
  67. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionEmbeddedComponent.fragment.xml +24 -0
  68. package/src/sap/fe/templates/library-dbg.js +6 -5
  69. package/src/sap/fe/templates/library-preload.js +27 -23
  70. package/src/sap/fe/templates/library-preload.js.map +1 -1
  71. package/src/sap/fe/templates/library.js +1 -1
  72. package/src/sap/fe/templates/library.js.map +1 -1
  73. package/src/sap/fe/templates/library.ts +6 -4
  74. package/src/sap/fe/templates/manifest.json +1 -1
  75. package/src/sap/fe/templates/messagebundle.properties +5 -0
  76. package/src/sap/fe/templates/messagebundle_ar.properties +3 -0
  77. package/src/sap/fe/templates/messagebundle_bg.properties +4 -1
  78. package/src/sap/fe/templates/messagebundle_ca.properties +3 -0
  79. package/src/sap/fe/templates/messagebundle_cs.properties +3 -0
  80. package/src/sap/fe/templates/messagebundle_cy.properties +3 -0
  81. package/src/sap/fe/templates/messagebundle_da.properties +3 -0
  82. package/src/sap/fe/templates/messagebundle_de.properties +3 -0
  83. package/src/sap/fe/templates/messagebundle_el.properties +3 -0
  84. package/src/sap/fe/templates/messagebundle_en.properties +5 -0
  85. package/src/sap/fe/templates/messagebundle_en_GB.properties +3 -0
  86. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +3 -0
  87. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +3 -0
  88. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +3 -0
  89. package/src/sap/fe/templates/messagebundle_es.properties +5 -2
  90. package/src/sap/fe/templates/messagebundle_es_MX.properties +3 -0
  91. package/src/sap/fe/templates/messagebundle_et.properties +5 -2
  92. package/src/sap/fe/templates/messagebundle_fi.properties +3 -0
  93. package/src/sap/fe/templates/messagebundle_fr.properties +3 -0
  94. package/src/sap/fe/templates/messagebundle_fr_CA.properties +3 -0
  95. package/src/sap/fe/templates/messagebundle_hi.properties +3 -0
  96. package/src/sap/fe/templates/messagebundle_hr.properties +3 -0
  97. package/src/sap/fe/templates/messagebundle_hu.properties +3 -0
  98. package/src/sap/fe/templates/messagebundle_id.properties +3 -0
  99. package/src/sap/fe/templates/messagebundle_it.properties +3 -0
  100. package/src/sap/fe/templates/messagebundle_iw.properties +3 -0
  101. package/src/sap/fe/templates/messagebundle_ja.properties +3 -0
  102. package/src/sap/fe/templates/messagebundle_kk.properties +3 -0
  103. package/src/sap/fe/templates/messagebundle_ko.properties +3 -0
  104. package/src/sap/fe/templates/messagebundle_lt.properties +3 -0
  105. package/src/sap/fe/templates/messagebundle_lv.properties +3 -0
  106. package/src/sap/fe/templates/messagebundle_ms.properties +3 -0
  107. package/src/sap/fe/templates/messagebundle_nl.properties +3 -0
  108. package/src/sap/fe/templates/messagebundle_no.properties +3 -0
  109. package/src/sap/fe/templates/messagebundle_pl.properties +3 -0
  110. package/src/sap/fe/templates/messagebundle_pt.properties +3 -0
  111. package/src/sap/fe/templates/messagebundle_pt_PT.properties +3 -0
  112. package/src/sap/fe/templates/messagebundle_ro.properties +5 -2
  113. package/src/sap/fe/templates/messagebundle_ru.properties +3 -0
  114. package/src/sap/fe/templates/messagebundle_sh.properties +5 -2
  115. package/src/sap/fe/templates/messagebundle_sk.properties +3 -0
  116. package/src/sap/fe/templates/messagebundle_sl.properties +3 -0
  117. package/src/sap/fe/templates/messagebundle_sv.properties +3 -0
  118. package/src/sap/fe/templates/messagebundle_th.properties +5 -2
  119. package/src/sap/fe/templates/messagebundle_tr.properties +3 -0
  120. package/src/sap/fe/templates/messagebundle_uk.properties +3 -0
  121. package/src/sap/fe/templates/messagebundle_vi.properties +5 -2
  122. package/src/sap/fe/templates/messagebundle_zh_CN.properties +5 -2
  123. package/src/sap/fe/templates/messagebundle_zh_TW.properties +3 -0
  124. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode-dbg.fragment.js +0 -123
  125. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.js.map +0 -1
  126. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton-dbg.js +0 -147
  127. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.js +0 -6
  128. package/src/sap/fe/templates/ObjectPage/components/DraftHandlerButton.js.map +0 -1
  129. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +0 -125
  130. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +0 -199
@@ -1,4 +1,3 @@
1
- import type ResourceBundle from "sap/base/i18n/ResourceBundle";
2
1
  import Log from "sap/base/Log";
3
2
  import merge from "sap/base/util/merge";
4
3
  import ActionRuntime from "sap/fe/core/ActionRuntime";
@@ -20,11 +19,15 @@ import ViewState from "sap/fe/core/controllerextensions/ViewState";
20
19
  import { defineUI5Class, extensible, finalExtension, publicExtension, usingExtension } from "sap/fe/core/helpers/ClassSupport";
21
20
  import type { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
22
21
  import ModelHelper from "sap/fe/core/helpers/ModelHelper";
22
+ import { getResourceModel } from "sap/fe/core/helpers/ResourceModelHelper";
23
23
  import PageController from "sap/fe/core/PageController";
24
24
  import CommonHelper from "sap/fe/macros/CommonHelper";
25
25
  import DelegateUtil from "sap/fe/macros/DelegateUtil";
26
+ import type TableAPI from "sap/fe/macros/table/TableAPI";
27
+ import TableHelper from "sap/fe/macros/table/TableHelper";
26
28
  import TableUtils from "sap/fe/macros/table/Utils";
27
29
  import SelectionVariant from "sap/fe/navigation/SelectionVariant";
30
+ import type SubSectionBlock from "sap/fe/templates/ObjectPage/controls/SubSectionBlock";
28
31
  import type { default as ObjectPageExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
29
32
  import { default as ExtensionAPI } from "sap/fe/templates/ObjectPage/ExtensionAPI";
30
33
  import TableScroller from "sap/fe/templates/TableScroller";
@@ -36,13 +39,13 @@ import Core from "sap/ui/core/Core";
36
39
  import type Message from "sap/ui/core/message/Message";
37
40
  import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
38
41
  import type View from "sap/ui/core/mvc/View";
42
+ import type Table from "sap/ui/mdc/Table";
39
43
  import type Binding from "sap/ui/model/Binding";
40
44
  import type JSONModel from "sap/ui/model/json/JSONModel";
41
45
  import type Context from "sap/ui/model/odata/v4/Context";
42
46
  import ODataContextBinding from "sap/ui/model/odata/v4/ODataContextBinding";
43
47
  import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
44
48
  import type ODataModel from "sap/ui/model/odata/v4/ODataModel";
45
- import type ResourceModel from "sap/ui/model/resource/ResourceModel";
46
49
  import type BreadCrumbs from "sap/uxap/BreadCrumbs";
47
50
  import type ObjectPageDynamicHeaderTitle from "sap/uxap/ObjectPageDynamicHeaderTitle";
48
51
  import type ObjectPageLayout from "sap/uxap/ObjectPageLayout";
@@ -58,18 +61,25 @@ import ViewStateOverrides from "./overrides/ViewState";
58
61
  @defineUI5Class("sap.fe.templates.ObjectPage.ObjectPageController")
59
62
  class ObjectPageController extends PageController {
60
63
  oView!: any;
64
+
61
65
  @usingExtension(Placeholder)
62
66
  placeholder!: Placeholder;
67
+
63
68
  @usingExtension(Share.override(ShareOverrides))
64
69
  share!: Share;
70
+
65
71
  @usingExtension(InternalRouting.override(InternalRoutingOverride))
66
72
  _routing!: InternalRouting;
73
+
67
74
  @usingExtension(Paginator.override(PaginatorOverride))
68
75
  paginator!: Paginator;
76
+
69
77
  @usingExtension(MessageHandler.override(MessageHandlerOverride))
70
78
  messageHandler!: MessageHandler;
79
+
71
80
  @usingExtension(IntentBasedNavigation.override(IntentBasedNavigationOverride))
72
81
  intentBasedNavigation!: IntentBasedNavigation;
82
+
73
83
  @usingExtension(
74
84
  InternalIntentBasedNavigation.override({
75
85
  getNavigationMode: function (this: InternalIntentBasedNavigation) {
@@ -81,8 +91,10 @@ class ObjectPageController extends PageController {
81
91
  })
82
92
  )
83
93
  _intentBasedNavigation!: InternalIntentBasedNavigation;
94
+
84
95
  @usingExtension(ViewState.override(ViewStateOverrides))
85
96
  viewState!: ViewState;
97
+
86
98
  @usingExtension(
87
99
  PageReady.override({
88
100
  isContextExpected: function () {
@@ -91,14 +103,20 @@ class ObjectPageController extends PageController {
91
103
  })
92
104
  )
93
105
  pageReady!: PageReady;
106
+
94
107
  @usingExtension(MassEdit)
95
108
  massEdit!: MassEdit;
109
+
96
110
  private mCustomSectionExtensionAPIs?: Record<string, ObjectPageExtensionAPI>;
111
+
97
112
  protected extensionAPI?: ObjectPageExtensionAPI;
98
- private oResourceBundle?: ResourceBundle;
113
+
99
114
  private bSectionNavigated?: boolean;
115
+
100
116
  private switchDraftAndActivePopOver?: Popover;
117
+
101
118
  private currentBinding?: Binding;
119
+
102
120
  private messageButton: any;
103
121
 
104
122
  @publicExtension()
@@ -133,7 +151,7 @@ class ObjectPageController extends PageController {
133
151
  });
134
152
  oInternalModelContext?.setProperty("batchGroups", this._getBatchGroupsForView());
135
153
  oInternalModelContext?.setProperty("errorNavigationSectionFlag", false);
136
- if (!(this.getView().getViewData() as any).useNewLazyLoading && (oObjectPage as any).getEnableLazyLoading()) {
154
+ if (oObjectPage.getEnableLazyLoading()) {
137
155
  //Attaching the event to make the subsection context binding active when it is visible.
138
156
  oObjectPage.attachEvent("subSectionEnteredViewPort", this._handleSubSectionEnteredViewPort.bind(this));
139
157
  }
@@ -195,6 +213,59 @@ class ObjectPageController extends PageController {
195
213
  return oTable && oTable.getRowBinding();
196
214
  }
197
215
 
216
+ /**
217
+ * Find the last visible subsection and add the sapUxAPObjectPageSubSectionFitContainer CSS class if it contains only a gridTable.
218
+ *
219
+ * @param subSections The sub sections to look for
220
+ * @private
221
+ */
222
+ private checkSectionsForGridTable(subSections: ObjectPageSubSection[]) {
223
+ const changeClassForTables = (event: Event, lastVisibleSubSection: ObjectPageSubSection) => {
224
+ const blocks = [...lastVisibleSubSection.getBlocks(), ...lastVisibleSubSection.getMoreBlocks()];
225
+ if (
226
+ blocks.length === 1 &&
227
+ this.searchTableInBlock(blocks[0] as SubSectionBlock)
228
+ ?.getType()
229
+ ?.isA("sap.ui.mdc.table.GridTableType")
230
+ ) {
231
+ //In case there is only a single table in a subSection we fit that to the whole page so that the scrollbar comes only on table and not on page
232
+ lastVisibleSubSection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
233
+ lastVisibleSubSection.detachEvent("modelContextChange", changeClassForTables, this);
234
+ }
235
+ };
236
+ for (let subSectionIndex = subSections.length - 1; subSectionIndex >= 0; subSectionIndex--) {
237
+ if (subSections[subSectionIndex].getVisible()) {
238
+ const lastVisibleSubSection = subSections[subSectionIndex];
239
+ // We need to attach this event in order to manage the Object Page Lazy Loading mechanism
240
+ lastVisibleSubSection.attachEvent("modelContextChange", lastVisibleSubSection, changeClassForTables, this);
241
+ break;
242
+ }
243
+ }
244
+ }
245
+
246
+ /**
247
+ * Find a table in blocks of section.
248
+ *
249
+ * @param block One sub section block
250
+ * @returns Table if exists
251
+ */
252
+ private searchTableInBlock(block: SubSectionBlock) {
253
+ const control = block.content;
254
+ let tableAPI: TableAPI | undefined;
255
+ if (block.isA("sap.fe.templates.ObjectPage.controls.SubSectionBlock")) {
256
+ // The table may currently be shown in a full screen dialog, we can then get the reference to the TableAPI
257
+ // control from the custom data of the place holder panel
258
+ if (control.isA("sap.m.Panel") && control.data("FullScreenTablePlaceHolder")) {
259
+ tableAPI = control.data("tableAPIreference");
260
+ } else if (control.isA("sap.fe.macros.table.TableAPI")) {
261
+ tableAPI = control as TableAPI;
262
+ }
263
+ if (tableAPI) {
264
+ return tableAPI.content as Table;
265
+ }
266
+ }
267
+ return undefined;
268
+ }
198
269
  onBeforeRendering() {
199
270
  PageController.prototype.onBeforeRendering.apply(this);
200
271
  // 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
@@ -204,13 +275,17 @@ class ObjectPageController extends PageController {
204
275
  }
205
276
 
206
277
  onAfterRendering() {
207
- ((this.getView().getModel("sap.fe.i18n") as ResourceModel).getResourceBundle() as Promise<ResourceBundle>)
208
- .then((response: any) => {
209
- this.oResourceBundle = response;
210
- })
211
- .catch(function (oError: any) {
212
- Log.error("Error while retrieving the resource bundle", oError);
213
- });
278
+ let subSections: ObjectPageSubSection[];
279
+ if (this._getObjectPageLayoutControl().getUseIconTabBar()) {
280
+ const sections = this._getObjectPageLayoutControl().getSections();
281
+ for (const section of sections) {
282
+ subSections = section.getSubSections();
283
+ this.checkSectionsForGridTable(subSections);
284
+ }
285
+ } else {
286
+ subSections = this._getAllSubSections();
287
+ this.checkSectionsForGridTable(subSections);
288
+ }
214
289
  }
215
290
 
216
291
  _onBeforeBinding(oContext: any, mParameters: any) {
@@ -233,8 +308,8 @@ class ObjectPageController extends PageController {
233
308
  !aBatchGroups.some(opContext.getModel().hasPendingChanges.bind(opContext.getModel()))
234
309
  ) {
235
310
  /* In case there are pending changes for the creation row and no others we need to reset the changes
236
- TODO: this is just a quick solution, this needs to be reworked
237
- */
311
+ TODO: this is just a quick solution, this needs to be reworked
312
+ */
238
313
 
239
314
  opContext.getBinding().resetChanges();
240
315
  }
@@ -281,9 +356,9 @@ class ObjectPageController extends PageController {
281
356
  // if the binding type is not ODataListBinding because of a deeplink navigation or a refresh of the page
282
357
  // we need to create it
283
358
  const sBindingPath = oBinding.getPath();
284
- if (/\([^\)]*\)$/.test(sBindingPath)) {
359
+ if (/\([^)]*\)$/.test(sBindingPath)) {
285
360
  // The current binding path ends with (xxx), so we create the listBinding by removing (xxx)
286
- const sListBindingPath = sBindingPath.replace(/\([^\)]*\)$/, "");
361
+ const sListBindingPath = sBindingPath.replace(/\([^)]*\)$/, "");
287
362
  oBinding = new (ODataListBinding as any)(oBinding.oModel, sListBindingPath);
288
363
  const _setListBindingAsync = () => {
289
364
  if (oBinding.getContexts().length > 0) {
@@ -301,7 +376,8 @@ class ObjectPageController extends PageController {
301
376
  }
302
377
  }
303
378
  }
304
- if (!(this.getView().getViewData() as any).useNewLazyLoading && oObjectPage.getEnableLazyLoading()) {
379
+
380
+ if (oObjectPage.getEnableLazyLoading()) {
305
381
  const aSections = oObjectPage.getSections();
306
382
  const bUseIconTabBar = oObjectPage.getUseIconTabBar();
307
383
  let iSkip = 2;
@@ -339,7 +415,7 @@ class ObjectPageController extends PageController {
339
415
  // Due to the left alignment of the Draft switch and the collaborative draft avatar controls
340
416
  // there is a ToolbarSpacer in the actions aggregation which we need to exclude here!
341
417
  // Due to the ACC report, we also need not to check for the InvisibleText elements
342
- if (oAction.isA("sap.fe.macros.ShareAPI")) {
418
+ if (oAction.isA("sap.fe.macros.share.ShareAPI")) {
343
419
  // since ShareAPI does not have a disable property
344
420
  // hence there is no need to check if it is disbaled or not
345
421
  return oAction.getVisible();
@@ -466,33 +542,36 @@ class ObjectPageController extends PageController {
466
542
 
467
543
  aTables.forEach(function (oTable: any) {
468
544
  const oInternalModelContext = oTable.getBindingContext("internal");
469
- oInternalModelContext.setProperty("creationRowFieldValidity", {});
470
- oInternalModelContext.setProperty("creationRowCustomValidity", {});
471
-
472
- aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
473
- // temporary workaround for BCP: 2080218004
474
- // Need to fix with BLI: FIORITECHP1-15274
475
- // only for edit mode, we clear the table cache
476
- // Workaround starts here!!
477
- const oTableRowBinding = oTable.getRowBinding();
478
- if (oTableRowBinding) {
479
- if (ModelHelper.isStickySessionSupported(oTableRowBinding.getModel().getMetaModel())) {
480
- // apply for both edit and display mode in sticky
481
- oTableRowBinding.removeCachesAndMessages("");
545
+ if (oInternalModelContext) {
546
+ oInternalModelContext.setProperty("creationRowFieldValidity", {});
547
+ oInternalModelContext.setProperty("creationRowCustomValidity", {});
548
+
549
+ aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
550
+
551
+ // temporary workaround for BCP: 2080218004
552
+ // Need to fix with BLI: FIORITECHP1-15274
553
+ // only for edit mode, we clear the table cache
554
+ // Workaround starts here!!
555
+ const oTableRowBinding = oTable.getRowBinding();
556
+ if (oTableRowBinding) {
557
+ if (ModelHelper.isStickySessionSupported(oTableRowBinding.getModel().getMetaModel())) {
558
+ // apply for both edit and display mode in sticky
559
+ oTableRowBinding.removeCachesAndMessages("");
560
+ }
482
561
  }
562
+ // Workaround ends here!!
563
+
564
+ // Update 'enabled' property of DataFieldForAction buttons on table toolbar
565
+ // The same is also performed on Table selectionChange event
566
+ const oActionOperationAvailableMap = JSON.parse(
567
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
568
+ ),
569
+ aSelectedContexts = oTable.getSelectedContexts();
570
+
571
+ ActionRuntime.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts, "table");
572
+ // Clear the selection in the table, need to be fixed and review with BLI: FIORITECHP1-24318
573
+ oTable.clearSelection();
483
574
  }
484
- // Workaround ends here!!
485
-
486
- // Update 'enabled' property of DataFieldForAction buttons on table toolbar
487
- // The same is also performed on Table selectionChange event
488
- const oActionOperationAvailableMap = JSON.parse(
489
- CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
490
- ),
491
- aSelectedContexts = oTable.getSelectedContexts();
492
-
493
- ActionRuntime.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts, "table");
494
- // Clear the selection in the table, need to be fixed and review with BLI: FIORITECHP1-24318
495
- oTable.clearSelection();
496
575
  });
497
576
  CommonUtils.getSemanticTargetsFromPageModel(this, "_pageModel");
498
577
  //Retrieve Object Page header actions from Object Page title control
@@ -504,44 +583,6 @@ class ObjectPageController extends PageController {
504
583
 
505
584
  let oModel: any, oFinalUIState: any;
506
585
 
507
- // TODO: this should be moved into an init event of the MDC tables (not yet existing) and should be part
508
- // of any controller extension
509
- /**
510
- * @param oTable
511
- * @param oListBinding
512
- */
513
- async function enableFastCreationRow(oTable: any, oListBinding: any) {
514
- const oFastCreationRow = oTable.getCreationRow();
515
- let oFastCreationListBinding, oFastCreationContext;
516
-
517
- if (oFastCreationRow) {
518
- try {
519
- await oFinalUIState;
520
- if (oFastCreationRow.getModel("ui").getProperty("/isEditable")) {
521
- oFastCreationListBinding = oModel.bindList(oListBinding.getPath(), oListBinding.getContext(), [], [], {
522
- $$updateGroupId: "doNotSubmit",
523
- $$groupId: "doNotSubmit"
524
- });
525
- // Workaround suggested by OData model v4 colleagues
526
- oFastCreationListBinding.refreshInternal = function () {
527
- /* do nothing */
528
- };
529
- oFastCreationContext = oFastCreationListBinding.create();
530
- oFastCreationRow.setBindingContext(oFastCreationContext);
531
-
532
- // this is needed to avoid console error
533
- try {
534
- await oFastCreationContext.created();
535
- } catch (e) {
536
- Log.trace("transient fast creation context deleted");
537
- }
538
- }
539
- } catch (oError: any) {
540
- Log.error("Error while computing the final UI state", oError);
541
- }
542
- }
543
- }
544
-
545
586
  // this should not be needed at the all
546
587
  /**
547
588
  * @param oTable
@@ -549,7 +590,13 @@ class ObjectPageController extends PageController {
549
590
  const handleTableModifications = (oTable: any) => {
550
591
  const oBinding = this._getTableBinding(oTable),
551
592
  fnHandleTablePatchEvents = function () {
552
- enableFastCreationRow(oTable, oBinding);
593
+ TableHelper.enableFastCreationRow(
594
+ oTable.getCreationRow(),
595
+ oBinding.getPath(),
596
+ oBinding.getContext(),
597
+ oModel,
598
+ oFinalUIState
599
+ );
553
600
  };
554
601
 
555
602
  if (!oBinding) {
@@ -574,7 +621,7 @@ class ObjectPageController extends PageController {
574
621
  oModel = oBindingContext.getModel();
575
622
 
576
623
  // Compute Edit Mode
577
- oFinalUIState = this._editFlow.computeEditMode(oBindingContext);
624
+ oFinalUIState = this.editFlow.computeEditMode(oBindingContext);
578
625
 
579
626
  if (ModelHelper.isCollaborationDraftSupported(oModel.getMetaModel())) {
580
627
  oFinalUIState
@@ -589,17 +636,8 @@ class ObjectPageController extends PageController {
589
636
  Log.error("Error while waiting for the final UI State", oError);
590
637
  });
591
638
  }
592
- // update related apps once Data is received in case of binding cache is not available
593
- // TODO: this is only a temp solution since we need to call _updateRelatedApps method only after data for Object Page is received (if there is no binding)
594
- if (oBindingContext.getBinding().oCache) {
595
- this._updateRelatedApps();
596
- } else {
597
- const fnUpdateRelatedApps = () => {
598
- this._updateRelatedApps();
599
- oBindingContext.getBinding().detachDataReceived(fnUpdateRelatedApps);
600
- };
601
- oBindingContext.getBinding().attachDataReceived(fnUpdateRelatedApps);
602
- }
639
+ // update related apps
640
+ this._updateRelatedApps();
603
641
 
604
642
  //Attach the patch sent and patch completed event to the object page binding so that we can react
605
643
  const oBinding = (oBindingContext.getBinding && oBindingContext.getBinding()) || oBindingContext;
@@ -619,10 +657,8 @@ class ObjectPageController extends PageController {
619
657
  });
620
658
  });
621
659
 
622
- if (!(this.getView().getViewData() as any).useNewLazyLoading) {
623
- // should be called only after binding is ready hence calling it in onAfterBinding
624
- (oObjectPage as any)._triggerVisibleSubSectionsEvents();
625
- }
660
+ // should be called only after binding is ready hence calling it in onAfterBinding
661
+ (oObjectPage as any)._triggerVisibleSubSectionsEvents();
626
662
 
627
663
  //To Compute the Edit Binding of the subObject page using root object page, create a context for draft root and update the edit button in sub OP using the context
628
664
  ActionRuntime.updateEditButtonVisibilityAndEnablement(this.getView());
@@ -848,24 +884,23 @@ class ObjectPageController extends PageController {
848
884
  }
849
885
 
850
886
  async _validateDocument(): Promise<void | any[] | ODataContextBinding> {
887
+ const appComponent = this.getAppComponent();
851
888
  const control = Core.byId(Core.getCurrentFocusedControlId());
852
- const context = control?.getBindingContext() as Context;
889
+ const context = control?.getBindingContext() as Context | undefined;
853
890
  if (context && !context.isTransient()) {
854
- // Wait for the pending changes before starting this validation
855
- await this._editFlow.syncTask();
856
- const appComponent = this.getAppComponent();
857
891
  const sideEffectsService = appComponent.getSideEffectsService();
858
892
  const entityType = sideEffectsService.getEntityTypeFromContext(context);
859
893
  const globalSideEffects = entityType ? sideEffectsService.getGlobalODataEntitySideEffects(entityType) : [];
860
894
  // If there is at least one global SideEffects for the related entity, execute it/them
861
895
  if (globalSideEffects.length) {
896
+ await this.editFlow.syncTask();
862
897
  return Promise.all(globalSideEffects.map((sideEffects) => this._sideEffects.requestSideEffects(sideEffects, context)));
863
- } else {
864
- const draftRootContext = await this.getDraftRootContext();
865
- //Execute the draftValidation if there is no globalSideEffects (ignore ETags in collaboration draft)
866
- if (draftRootContext) {
867
- return draft.executeDraftValidation(draftRootContext, appComponent, isConnected(this.getView()));
868
- }
898
+ }
899
+ const draftRootContext = await this.getDraftRootContext();
900
+ //Execute the draftValidation if there is no globalSideEffects (ignore ETags in collaboration draft)
901
+ if (draftRootContext) {
902
+ await this.editFlow.syncTask();
903
+ return draft.executeDraftValidation(draftRootContext, appComponent, isConnected(this.getView()));
869
904
  }
870
905
  }
871
906
  return undefined;
@@ -948,13 +983,14 @@ class ObjectPageController extends PageController {
948
983
 
949
984
  _updateRelatedApps() {
950
985
  const oObjectPage = this._getObjectPageLayoutControl();
951
- if (CommonUtils.resolveStringtoBoolean(oObjectPage.data("showRelatedApps"))) {
952
- CommonUtils.updateRelatedAppsDetails(oObjectPage);
986
+ const showRelatedApps = oObjectPage.data("showRelatedApps");
987
+ if (showRelatedApps === "true" || showRelatedApps === true) {
988
+ const appComponent = CommonUtils.getAppComponent(this.getView());
989
+ CommonUtils.updateRelatedAppsDetails(oObjectPage, appComponent);
953
990
  }
954
991
  }
955
992
 
956
993
  _findControlInSubSection(aParentElement: any, aSubsection: any, aControls: any, bIsChart?: boolean) {
957
- const aSubSectionTables = [];
958
994
  for (let element = 0; element < aParentElement.length; element++) {
959
995
  let oElement = aParentElement[element].getContent instanceof Function && aParentElement[element].getContent();
960
996
  if (bIsChart) {
@@ -973,6 +1009,11 @@ class ObjectPageController extends PageController {
973
1009
  oElement = oElement[0];
974
1010
  }
975
1011
  }
1012
+ // The table may currently be shown in a full screen dialog, we can then get the reference to the TableAPI
1013
+ // control from the custom data of the place holder panel
1014
+ if (oElement && oElement.isA && oElement.isA("sap.m.Panel") && oElement.data("FullScreenTablePlaceHolder")) {
1015
+ oElement = oElement.data("tableAPIreference");
1016
+ }
976
1017
  if (oElement && oElement.isA && oElement.isA("sap.fe.macros.table.TableAPI")) {
977
1018
  oElement = oElement.getContent instanceof Function && oElement.getContent();
978
1019
  if (oElement && oElement.length > 0) {
@@ -981,12 +1022,7 @@ class ObjectPageController extends PageController {
981
1022
  }
982
1023
  if (oElement && oElement.isA && oElement.isA("sap.ui.mdc.Table")) {
983
1024
  aControls.push(oElement);
984
- aSubSectionTables.push({
985
- table: oElement,
986
- gridTable: oElement.getType().isA("sap.ui.mdc.table.GridTableType")
987
- });
988
1025
  }
989
-
990
1026
  if (oElement && oElement.isA && oElement.isA("sap.fe.macros.chart.ChartAPI")) {
991
1027
  oElement = oElement.getContent instanceof Function && oElement.getContent();
992
1028
  if (oElement && oElement.length > 0) {
@@ -997,15 +1033,6 @@ class ObjectPageController extends PageController {
997
1033
  aControls.push(oElement);
998
1034
  }
999
1035
  }
1000
- if (
1001
- aSubSectionTables.length === 1 &&
1002
- aParentElement.length === 1 &&
1003
- aSubSectionTables[0].gridTable &&
1004
- !aSubsection.hasStyleClass("sapUxAPObjectPageSubSectionFitContainer")
1005
- ) {
1006
- //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
1007
- aSubsection.addStyleClass("sapUxAPObjectPageSubSectionFitContainer");
1008
- }
1009
1036
  }
1010
1037
 
1011
1038
  _getAllSubSections() {
@@ -1144,9 +1171,9 @@ class ObjectPageController extends PageController {
1144
1171
  entitySet: sMetaPathPage
1145
1172
  });
1146
1173
  // Adding Page Context to selection variant
1147
- aPageAttributes = CommonUtils.removeSensitiveData(aPageAttributes, oMetaModel);
1174
+ aPageAttributes = this._intentBasedNavigation.removeSensitiveData(aPageAttributes, sMetaPathPage);
1148
1175
  const oPageLevelSV = CommonUtils.addPageContextToSelectionVariant(new SelectionVariant(), aPageAttributes, this.getView());
1149
- aAttributes = CommonUtils.removeSensitiveData(aAttributes, oMetaModel);
1176
+ aAttributes = this._intentBasedNavigation.removeSensitiveData(aAttributes, sMetaPathPage);
1150
1177
  return {
1151
1178
  selectionVariant: oPageLevelSV,
1152
1179
  attributes: aAttributes
@@ -1384,7 +1411,34 @@ class ObjectPageController extends PageController {
1384
1411
  return false;
1385
1412
  });
1386
1413
 
1387
- const oCurrentActionPromise = this._editFlow.getCurrentActionPromise();
1414
+ // set correct binding context for fast creation row
1415
+ const fastCreationRow = oTable.getCreationRow();
1416
+
1417
+ if (fastCreationRow && !fastCreationRow._oInnerCreationRow?.getBindingContext()) {
1418
+ const tableBinding = this._getTableBinding(oTable);
1419
+
1420
+ if (!tableBinding) {
1421
+ Log.error(`Expected binding missing for table: ${oTable.getId()}`);
1422
+ return;
1423
+ }
1424
+
1425
+ if (tableBinding.getContext()) {
1426
+ const objectPage = this._getObjectPageLayoutControl();
1427
+ const bindingContext = objectPage.getBindingContext() as Context;
1428
+ const model = bindingContext.getModel();
1429
+
1430
+ TableHelper.enableFastCreationRow(
1431
+ fastCreationRow,
1432
+ tableBinding.getPath(),
1433
+ tableBinding.getContext(),
1434
+ model,
1435
+ oTable.getModel("ui").getProperty("/isEditable")
1436
+ );
1437
+ }
1438
+ }
1439
+
1440
+ const oCurrentActionPromise = this.editFlow.getCurrentActionPromise();
1441
+
1388
1442
  if (oCurrentActionPromise) {
1389
1443
  let aTableContexts: any;
1390
1444
  if (oTable.getType().getMetadata().isA("sap.ui.mdc.table.GridTableType")) {
@@ -1427,7 +1481,7 @@ class ObjectPageController extends PageController {
1427
1481
  } else {
1428
1482
  oTable.focusRow(iNewItemp, true);
1429
1483
  }
1430
- this._editFlow.deleteCurrentActionPromise();
1484
+ this.editFlow.deleteCurrentActionPromise();
1431
1485
  }
1432
1486
  })
1433
1487
  .catch(function (err: any) {
@@ -1527,7 +1581,7 @@ class ObjectPageController extends PageController {
1527
1581
  //TODO: Should remove this setTimeOut once Variant Management provides an api to fetch the current variant key on save
1528
1582
  setTimeout(() => {
1529
1583
  this.getExtensionAPI().updateAppState();
1530
- }, 500);
1584
+ }, 2000);
1531
1585
  },
1532
1586
  navigateToSubSection: function (oController: ObjectPageController, vDetailConfig: any) {
1533
1587
  const oDetailConfig = typeof vDetailConfig === "string" ? JSON.parse(vDetailConfig) : vDetailConfig;
@@ -1546,20 +1600,13 @@ class ObjectPageController extends PageController {
1546
1600
  oSection = oSubSection && (oSubSection.getParent() as ObjectPageSection);
1547
1601
  }
1548
1602
  if (!oSection || !oSubSection || !oSection.getVisible() || !oSubSection.getVisible()) {
1549
- ((oController.getView().getModel("sap.fe.i18n") as ResourceModel).getResourceBundle() as Promise<ResourceBundle>)
1550
- .then(function (oResourceBundle) {
1551
- const sTitle = CommonUtils.getTranslatedText(
1552
- "C_ROUTING_NAVIGATION_DISABLED_TITLE",
1553
- oResourceBundle,
1554
- undefined,
1555
- (oController.getView().getViewData() as any).entitySet
1556
- );
1557
- Log.error(sTitle);
1558
- MessageBox.error(sTitle);
1559
- })
1560
- .catch(function (error) {
1561
- Log.error(error);
1562
- });
1603
+ const sTitle = getResourceModel(oController).getText(
1604
+ "C_ROUTING_NAVIGATION_DISABLED_TITLE",
1605
+ undefined,
1606
+ (oController.getView().getViewData() as any).entitySet
1607
+ );
1608
+ Log.error(sTitle);
1609
+ MessageBox.error(sTitle);
1563
1610
  } else {
1564
1611
  oObjectPage.scrollToSection(oSubSection.getId());
1565
1612
  // trigger iapp state change