@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,7 +1,7 @@
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 ObjectPath from "sap/base/util/ObjectPath";
4
- import DynamicPage from "sap/f/DynamicPage";
4
+ import type DynamicPage from "sap/f/DynamicPage";
5
5
  import CommonUtils from "sap/fe/core/CommonUtils";
6
6
  import EditFlow from "sap/fe/core/controllerextensions/EditFlow";
7
7
  import IntentBasedNavigation from "sap/fe/core/controllerextensions/IntentBasedNavigation";
@@ -13,7 +13,7 @@ import Placeholder from "sap/fe/core/controllerextensions/Placeholder";
13
13
  import Share from "sap/fe/core/controllerextensions/Share";
14
14
  import SideEffects from "sap/fe/core/controllerextensions/SideEffects";
15
15
  import ViewState from "sap/fe/core/controllerextensions/ViewState";
16
- import FilterBar from "sap/fe/core/controls/FilterBar";
16
+ import type FilterBar from "sap/fe/core/controls/FilterBar";
17
17
  import {
18
18
  defineUI5Class,
19
19
  extensible,
@@ -23,6 +23,7 @@ import {
23
23
  usingExtension
24
24
  } from "sap/fe/core/helpers/ClassSupport";
25
25
  import EditState from "sap/fe/core/helpers/EditState";
26
+ import MessageStrip from "sap/fe/core/helpers/MessageStrip";
26
27
  import { InternalModelContext } from "sap/fe/core/helpers/ModelHelper";
27
28
  import CoreLibrary from "sap/fe/core/library";
28
29
  import PageController from "sap/fe/core/PageController";
@@ -31,22 +32,21 @@ import ChartUtils from "sap/fe/macros/chart/ChartUtils";
31
32
  import CommonHelper from "sap/fe/macros/CommonHelper";
32
33
  import DelegateUtil from "sap/fe/macros/DelegateUtil";
33
34
  import FilterUtils from "sap/fe/macros/filter/FilterUtils";
34
- import TableUtils from "sap/fe/macros/table/Utils";
35
+ import MultipleModeControl from "sap/fe/templates/ListReport/controls/MultipleModeControl";
35
36
  import ExtensionAPI from "sap/fe/templates/ListReport/ExtensionAPI";
36
37
  import EditFlowOverrides from "sap/fe/templates/RootContainer/overrides/EditFlow";
37
38
  import TableScroller from "sap/fe/templates/TableScroller";
38
- import IconTabBar from "sap/m/IconTabBar";
39
- import SegmentedButton from "sap/m/SegmentedButton";
40
- import Control from "sap/ui/core/Control";
41
- import Core from "sap/ui/core/Core";
39
+ import type SegmentedButton from "sap/m/SegmentedButton";
40
+ import type Control from "sap/ui/core/Control";
42
41
  import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
43
42
  import { system } from "sap/ui/Device";
44
43
  import ControlPersonalizationWriteAPI from "sap/ui/fl/write/api/ControlPersonalizationWriteAPI";
45
44
  import StateUtil from "sap/ui/mdc/p13n/StateUtil";
46
- import Table from "sap/ui/mdc/Table";
47
- import JSONModel from "sap/ui/model/json/JSONModel";
48
- import ResourceModel from "sap/ui/model/resource/ResourceModel";
45
+ import type Table from "sap/ui/mdc/Table";
46
+ import type JSONModel from "sap/ui/model/json/JSONModel";
47
+ import type ResourceModel from "sap/ui/model/resource/ResourceModel";
49
48
  import hasher from "sap/ui/thirdparty/hasher";
49
+ import type { V4Context } from "types/extension_types";
50
50
  import IntentBasedNavigationOverride from "./overrides/IntentBasedNavigation";
51
51
  import ShareOverrides from "./overrides/Share";
52
52
  import ViewStateOverrides from "./overrides/ViewState";
@@ -114,21 +114,7 @@ class ListReportController extends PageController {
114
114
 
115
115
  onInit() {
116
116
  PageController.prototype.onInit.apply(this);
117
- const aControls = this._getControls();
118
117
  const oInternalModelContext = this.getView().getBindingContext("internal") as InternalModelContext;
119
- if (this._isMultiMode()) {
120
- const oMultiModeTab = this._getMultiModeControl();
121
- oInternalModelContext.setProperty("tabs", {
122
- selected: oMultiModeTab.getSelectedKey() || (oMultiModeTab.getItems()[0] as any).getKey()
123
- });
124
- aControls.forEach((oControl: any) => {
125
- const oUpdateCounts = () => {
126
- this._updateCounts();
127
- };
128
- CommonUtils.addEventToBindingInfo(oControl, "dataRequested", oUpdateCounts);
129
- });
130
- }
131
- //TODO: This is only a temporary approach and will be removed once app state behaviour is finalized.
132
118
 
133
119
  oInternalModelContext.setProperty("hasPendingFilters", true);
134
120
  oInternalModelContext.setProperty("appliedFilters", "");
@@ -154,8 +140,6 @@ class ListReportController extends PageController {
154
140
  // happen after the routeMatch event has been processed (otherwise the router gets broken)
155
141
  this.getAppComponent().getRouterProxy().waitForRouteMatchBeforeNavigation();
156
142
 
157
- this._isMultiMode() && this._updateMultiControlHiddenStatus();
158
-
159
143
  // Configure the initial load settings
160
144
  this._setInitLoad();
161
145
  }
@@ -163,13 +147,17 @@ class ListReportController extends PageController {
163
147
  onExit() {
164
148
  delete this.filterBarConditions;
165
149
  delete this._oListReportControl;
166
- this.extensionAPI && this.extensionAPI.destroy();
150
+ if (this.extensionAPI) {
151
+ this.extensionAPI.destroy();
152
+ }
167
153
  delete this.extensionAPI;
168
154
  }
169
155
 
170
156
  _onAfterBinding() {
171
157
  const aTables = this._getControls("table");
172
158
  if (EditState.isEditStateDirty()) {
159
+ const oMultiModeControl = this._getMultiModeControl();
160
+ oMultiModeControl?.invalidateContent();
173
161
  const oTableBinding = this._getTableBinding();
174
162
  if (oTableBinding) {
175
163
  if (CommonUtils.getAppComponent(this.getView())._isFclEnabled()) {
@@ -179,10 +167,6 @@ class ListReportController extends PageController {
179
167
  if (!this.sUpdateTimer) {
180
168
  this.sUpdateTimer = setTimeout(() => {
181
169
  oTableBinding.refresh();
182
- if (this._isMultiMode()) {
183
- this._setCountsOutDated();
184
- this._updateCounts();
185
- }
186
170
  delete this.sUpdateTimer;
187
171
  }, 0);
188
172
  }
@@ -253,7 +237,7 @@ class ListReportController extends PageController {
253
237
  * or when a tab with custom content is selected.
254
238
  * This method can be overwritten by the controller extension in case of customization.
255
239
  *
256
- * @param {map} mParameters Map containing the filter conditions of the FilterBar, the currentTabID
240
+ * @param mParameters Map containing the filter conditions of the FilterBar, the currentTabID
257
241
  * and the view refresh cause (tabChanged or search).
258
242
  * The map looks like this:
259
243
  * <code><pre>
@@ -273,7 +257,6 @@ class ListReportController extends PageController {
273
257
  * refreshCause: "tabChanged" | "search"
274
258
  * }
275
259
  * </pre></code>
276
- *
277
260
  * @public
278
261
  */
279
262
  @publicExtension()
@@ -307,6 +290,7 @@ class ListReportController extends PageController {
307
290
 
308
291
  /**
309
292
  * This method initiates the update of the enabled state of the DataFieldForAction and the visible state of the DataFieldForIBN buttons.
293
+ *
310
294
  * @param aTables Array of tables in the list report
311
295
  * @private
312
296
  */
@@ -318,7 +302,7 @@ class ListReportController extends PageController {
318
302
  // The same is also performed on Table selectionChange event
319
303
  const oInternalModelContext = oTable.getBindingContext("internal"),
320
304
  oActionOperationAvailableMap = JSON.parse(
321
- CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap")) as any
305
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
322
306
  ),
323
307
  aSelectedContexts = oTable.getSelectedContexts();
324
308
 
@@ -332,7 +316,7 @@ class ListReportController extends PageController {
332
316
  *
333
317
  * @function
334
318
  * @name sap.fe.templates.ListReport.ListReportController.controller#_scrollTablesToRow
335
- * @param {string} sRowPath The path of the table row context to be scrolled to
319
+ * @param sRowPath The path of the table row context to be scrolled to
336
320
  */
337
321
  _scrollTablesToRow(sRowPath: string) {
338
322
  this._getControls("table").forEach(function (oTable: any) {
@@ -349,7 +333,7 @@ class ListReportController extends PageController {
349
333
 
350
334
  _getPageOrFilterBarVariantManagement() {
351
335
  return (
352
- this.getView().byId("fe::PageVariantManagement") || this.getView().byId(this._getFilterBarControlId() + "::VariantManagement")
336
+ this.getView().byId("fe::PageVariantManagement") || this.getView().byId(`${this._getFilterBarControlId()}::VariantManagement`)
353
337
  );
354
338
  }
355
339
 
@@ -397,7 +381,7 @@ class ListReportController extends PageController {
397
381
  }
398
382
 
399
383
  _getMultiModeControl() {
400
- return this.getView().byId("fe::TabMultipleMode") as IconTabBar;
384
+ return this.getView().byId("fe::TabMultipleMode::Control") as MultipleModeControl;
401
385
  }
402
386
 
403
387
  _getTableControlId() {
@@ -406,12 +390,12 @@ class ListReportController extends PageController {
406
390
 
407
391
  _getCurrentControl(): Control {
408
392
  if (!this._oListReportControl) {
409
- const oMultiModeTab = this._getMultiModeControl();
393
+ const oMultiModeTab = this._getMultiModeControl().content;
410
394
  this._oListReportControl = this.getView().byId(
411
395
  oMultiModeTab.getSelectedKey() || (oMultiModeTab.getItems()[0] as any).getKey()
412
396
  ) as Control;
413
397
  }
414
- return this._oListReportControl as Control;
398
+ return this._oListReportControl;
415
399
  }
416
400
 
417
401
  _getTable(): Table | undefined {
@@ -428,23 +412,21 @@ class ListReportController extends PageController {
428
412
 
429
413
  _getTableBinding(sTableId?: any) {
430
414
  const oTableControl = sTableId ? this.getView().byId(sTableId) : this._getTable();
431
- const oBinding = oTableControl && (oTableControl as any)._getRowBinding();
432
-
433
- return oBinding;
415
+ return oTableControl && (oTableControl as any)._getRowBinding();
434
416
  }
435
417
 
436
418
  _getControls(sKey?: any) {
437
419
  if (this._isMultiMode()) {
438
420
  const aControls: any[] = [];
439
- const oTabMultiMode = this._getMultiModeControl();
421
+ const oTabMultiMode = this._getMultiModeControl().content;
440
422
  oTabMultiMode.getItems().forEach((oItem: any) => {
441
423
  const oControl = this.getView().byId(oItem.getKey());
442
- if (sKey) {
443
- if (oItem.getKey().indexOf("fe::" + sKey) > -1) {
444
- oControl && aControls.push(oControl);
424
+ if (oControl && sKey) {
425
+ if (oItem.getKey().indexOf(`fe::${sKey}`) > -1) {
426
+ aControls.push(oControl);
445
427
  }
446
- } else {
447
- oControl && aControls.push(oControl);
428
+ } else if (oControl) {
429
+ aControls.push(oControl);
448
430
  }
449
431
  });
450
432
  return aControls;
@@ -475,7 +457,7 @@ class ListReportController extends PageController {
475
457
  *
476
458
  * @function
477
459
  * @name _isMultiMode
478
- * @returns {boolean} Is Multiple Table mode set?
460
+ * @returns Is Multiple Table mode set?
479
461
  */
480
462
  _isMultiMode() {
481
463
  if (!this._oListReportControl) {
@@ -489,24 +471,13 @@ class ListReportController extends PageController {
489
471
  *
490
472
  * @function
491
473
  * @name _isInitLoadDisabled
492
- * @returns {boolean} Is InitLoad enabled?
474
+ * @returns Is InitLoad enabled?
493
475
  */
494
476
  _isInitLoadEnabled() {
495
477
  const initLoadMode = (this.getView().getViewData() as any).initialLoad;
496
478
  return initLoadMode === InitialLoadMode.Enabled;
497
479
  }
498
480
 
499
- /**
500
- * Method to know if ListReport is configured with Multiple EntitySets.
501
- *
502
- * @function
503
- * @name _isMultiEntitySets
504
- * @returns {boolean} Is Multiple EntitySets configuration?
505
- */
506
- _isMultiEntitySets() {
507
- return this.getView().getContent()[0].data("isMultiEntitySets") === "true";
508
- }
509
-
510
481
  _hasMultiVisualizations() {
511
482
  return this.getView().getContent()[0].data("hasMultiVisualizations") === "true";
512
483
  }
@@ -567,7 +538,7 @@ class ListReportController extends PageController {
567
538
  bookmarkTitle: document.title, //To name the bookmark according to the app title.
568
539
  bookmarkCustomUrl: function () {
569
540
  const sHash = hasher.getHash();
570
- return sHash ? "#" + sHash : window.location.href;
541
+ return sHash ? `#${sHash}` : window.location.href;
571
542
  },
572
543
  /*
573
544
  To be activated once the FLP shows the count - see comment above
@@ -584,75 +555,13 @@ class ListReportController extends PageController {
584
555
  oTemplatePrivateModel.setProperty("/listReport/share", oShareInfo);
585
556
  }
586
557
 
587
- /**
588
- * Hidden tables must be marked as hidden to avoid sending
589
- * requests when FilterBar is changed or LR is initialized
590
- * Best workflow would be to suspend table binding but
591
- * if the user switch quickly between tabs the batch response of previous
592
- * is received when previous tab is already disabled (binding is suspended) and
593
- * generates error.
594
- * A temporary solution (if we find better workflow) is to set a customData and don't trigger
595
- * rebindTable if this customData is set to true.
596
- */
597
- _updateMultiControlHiddenStatus() {
598
- const oDisplayedControl = this._getCurrentControl();
599
- if (this._isMultiMode() && oDisplayedControl) {
600
- const sDisplayControlId = oDisplayedControl.getId();
601
- const aControls = this._getControls();
602
- aControls.forEach(function (oControl: any) {
603
- const sControlId = oControl.getId();
604
- oControl.data("controlHidden", sControlId !== sDisplayControlId);
605
- });
606
- }
607
- }
608
-
609
- /**
610
- * Method to update the local UI model of the page with the fields that are not applicable to the filter bar (this is specific to the multiple table scenario).
611
- *
612
- * @param {sap.ui.model.context} oInternalModelContext The internal model context
613
- * @param {sap.ui.mdc.FilterBar} oFilterBar MDC filter bar
614
- */
615
- _updateMultiTabNotApplicableFields(oInternalModelContext: any, oFilterBar: any) {
616
- const mCache: any = {};
617
- const ignoredFields: any = {},
618
- ignoredFieldsTitle: any = {},
619
- aTables = this._getControls("table"),
620
- aCharts = this._getControls("Chart");
621
- aTables.forEach((oTable: any) => {
622
- const sTableEntityPath = oTable.data("targetCollectionPath"),
623
- sTableEntitySet = sTableEntityPath.slice(1),
624
- sTabId = oTable.getParent().getParent().getKey(),
625
- sTabTitle = oTable.getParent().getParent().getText(),
626
- sCacheKey = sTableEntitySet + (oTable.data("enableAnalytics") === "true" ? "Analytical" : "Regular");
627
- if (!mCache[sCacheKey]) {
628
- mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oTable);
629
- }
630
- ignoredFields[sTabId] = mCache[sCacheKey];
631
- ignoredFieldsTitle[sTabId] = this.formatters.setTabMessageStrip.call(this, mCache[sCacheKey], sTabTitle, "false", {});
632
- });
633
- aCharts.forEach((oChart: any) => {
634
- const sChartEntityPath = oChart.data("targetCollectionPath"),
635
- sChartEntitySet = sChartEntityPath.slice(1),
636
- sTabId = oChart.getParent().getParent().getKey(),
637
- sTabTitle = oChart.getParent().getParent().getText(),
638
- sCacheKey = sChartEntitySet + "Chart";
639
- if (!mCache[sCacheKey]) {
640
- mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
641
- }
642
- ignoredFields[sTabId] = mCache[sCacheKey];
643
- ignoredFieldsTitle[sTabId] = this.formatters.setTabMessageStrip.call(this, mCache[sCacheKey], sTabTitle, "false", {});
644
- });
645
- oInternalModelContext.setProperty("tabs/ignoredFields", ignoredFields);
646
- oInternalModelContext.setProperty("tabs/ignoredFieldsTitle", ignoredFieldsTitle);
647
- }
648
-
649
558
  /**
650
559
  * Method to update the local UI model of the page with the fields that are not applicable to the filter bar (this is specific to the ALP scenario).
651
560
  *
652
- * @param {sap.ui.model.context} oInternalModelContext The internal model context
653
- * @param {sap.ui.mdc.FilterBar} oFilterBar MDC filter bar
561
+ * @param oInternalModelContext The internal model context
562
+ * @param oFilterBar MDC filter bar
654
563
  */
655
- _updateALPNotApplicableFields(oInternalModelContext: any, oFilterBar: any) {
564
+ _updateALPNotApplicableFields(oInternalModelContext: InternalModelContext, oFilterBar: FilterBar) {
656
565
  const mCache: any = {};
657
566
  const ignoredFields: any = {},
658
567
  aTables = this._getControls("table"),
@@ -667,7 +576,7 @@ class ListReportController extends PageController {
667
576
  aCharts.forEach(function (oChart: any) {
668
577
  const sChartEntityPath = oChart.data("targetCollectionPath"),
669
578
  sChartEntitySet = sChartEntityPath.slice(1),
670
- sCacheKey = sChartEntitySet + "Chart";
579
+ sCacheKey = `${sChartEntitySet}Chart`;
671
580
  if (!mCache[sCacheKey]) {
672
581
  mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
673
582
  }
@@ -681,79 +590,15 @@ class ListReportController extends PageController {
681
590
  this._oListReportControl = undefined;
682
591
  this._getCurrentControl();
683
592
  }
684
-
685
- _updateCounts() {
686
- this._updateMultiModeCounts();
687
- }
688
-
689
593
  /**
690
594
  * Method to determine if a tab from the list report is a custom tab.
691
595
  *
692
596
  * @function
693
597
  * @name _isCustomTab
694
- * @returns {boolean} Determines if the tab is a custom tab.
598
+ * @returns Determines if the tab is a custom tab.
695
599
  */
696
600
  _isCustomTab() {
697
- const oMultiModeControl = this._getMultiModeControl();
698
- return oMultiModeControl && oMultiModeControl.getSelectedKey().indexOf("::CustomTab::") > -1;
699
- }
700
-
701
- _setCountsOutDated() {
702
- const oMultiModeControl = this._getMultiModeControl();
703
- if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true") {
704
- const aItems = oMultiModeControl.getItems();
705
- aItems.forEach(function (oItem: any) {
706
- if (oItem.getKey().indexOf("fe::Chart") === -1) {
707
- oItem.data("outdatedCounts", true);
708
- }
709
- });
710
- }
711
- }
712
-
713
- _updateMultiModeCounts() {
714
- let aBindingPromises = [];
715
- const oMultiModeControl = this._getMultiModeControl();
716
- if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true" && !this._isCustomTab()) {
717
- const oDisplayedControl = this._getCurrentControl();
718
- const sDisplayedControlId = oDisplayedControl.getId();
719
- const aCompliantTabs: any[] = [];
720
- const aItems = oMultiModeControl.getItems();
721
- aItems.forEach((oItem: any) => {
722
- const oControl = this.getView().byId(oItem.getKey());
723
- if (
724
- oControl &&
725
- !oControl.isA("sap.ui.mdc.Chart") &&
726
- (oItem.data("outdatedCounts") || oControl.getId() === sDisplayedControlId)
727
- ) {
728
- aCompliantTabs.push({
729
- control: oControl,
730
- item: oItem
731
- });
732
- }
733
- });
734
-
735
- aBindingPromises = aCompliantTabs.map((mTab: any) => {
736
- mTab.item.setCount("...");
737
- const oControl = mTab.control;
738
- const oFilterInfos = TableUtils.getFiltersInfoForSV(oControl, mTab.item.data("selectionVariant")) as any;
739
- return TableUtils.getListBindingForCount(oControl, this.getView().getBindingContext(), {
740
- batchGroupId: oControl.getId() === sDisplayedControlId ? oControl.data("batchGroupId") : "$auto",
741
- additionalFilters: oFilterInfos.filters
742
- });
743
- });
744
-
745
- Promise.all(aBindingPromises)
746
- .then(function (aCounts: any[]) {
747
- for (const k in aCounts) {
748
- const oItem = aCompliantTabs[k].item;
749
- oItem.setCount(TableUtils.getCountFormatted(aCounts[k]));
750
- oItem.data("outdatedCounts", false);
751
- }
752
- })
753
- .catch(function (oError: any) {
754
- Log.error("Error while retrieving the values for the icon tab bar", oError);
755
- });
756
- }
601
+ return this._getMultiModeControl()?.content.getSelectedKey().indexOf("::CustomTab::") > -1;
757
602
  }
758
603
 
759
604
  _isFilterBarHidden() {
@@ -800,46 +645,26 @@ class ListReportController extends PageController {
800
645
 
801
646
  handlers = {
802
647
  onTabMultiModeChange(this: ListReportController, oEvent: any) {
803
- this._updateMultiModeSelectedControl();
804
- this._updateMultiControlHiddenStatus();
805
-
806
- const oFilterBar = this._getFilterBarControl();
807
- const oInternalModelContext = this.getView().getBindingContext("internal") as InternalModelContext;
808
- const oDisplayedControl = this._getCurrentControl() as any;
809
- const oMultiModeControl = this._getMultiModeControl();
810
- const sSelectedKey = oMultiModeControl.getSelectedKey();
811
648
  const sPreviousSelectedKey = oEvent && oEvent.mParameters ? oEvent.mParameters.previousKey : undefined;
812
-
813
- oInternalModelContext.setProperty("tabs/selected", sSelectedKey);
814
- if (oInternalModelContext.getProperty("hasPendingFilters") !== true) {
815
- // No pending filters into FilterBar
816
- if (oFilterBar && this._isCustomTab()) {
817
- const oFilterConditions = oFilterBar.getFilterConditions();
818
- this.onViewNeedsRefresh({
819
- filterConditions: oFilterConditions,
820
- currentTabId: sSelectedKey,
821
- refreshCause: "tabChanged"
822
- });
823
- } else if (
824
- !oDisplayedControl.isA("sap.ui.mdc.Chart") &&
825
- (!oDisplayedControl.getRowBinding() || // first time the tab/table is displayed
826
- oDisplayedControl.data("outdatedRows") === true)
827
- ) {
828
- // Search has been triggered on a different tab {}
829
- oDisplayedControl.rebind();
830
- oDisplayedControl.data("outdatedRows", false);
831
- } else if (
832
- oDisplayedControl.isA("sap.ui.mdc.Chart") &&
833
- (!oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl).getBinding("data") || // first time the tab/chart is displayed
834
- oDisplayedControl.data("outdatedRows") === true)
835
- ) {
836
- const oInnerChart = oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl);
837
- oDisplayedControl.getControlDelegate().rebind(oDisplayedControl, oInnerChart.getBindingInfo("data"));
838
- oDisplayedControl.data("outdatedRows", false);
839
- }
840
- }
649
+ this._updateMultiModeSelectedControl();
841
650
 
842
651
  if (oEvent && oEvent.mParameters && sPreviousSelectedKey !== oEvent.mParameters.selectedKey) {
652
+ const sSelectedKey = oEvent.mParameters.selectedKey;
653
+ const oFilterBar = this._getFilterBarControl();
654
+ const oMultiModeControl = this._getMultiModeControl();
655
+ const oInternalModelContext = this.getView().getBindingContext("internal");
656
+ if (oInternalModelContext) {
657
+ if (oFilterBar && oInternalModelContext.getProperty("hasPendingFilters") !== true) {
658
+ if (this._isCustomTab()) {
659
+ const oFilterConditions = oFilterBar.getFilterConditions();
660
+ this.onViewNeedsRefresh({
661
+ filterConditions: oFilterConditions,
662
+ currentTabId: sSelectedKey,
663
+ refreshCause: "tabChanged"
664
+ });
665
+ }
666
+ }
667
+ }
843
668
  ControlPersonalizationWriteAPI.add({
844
669
  changes: [
845
670
  {
@@ -850,7 +675,7 @@ class ListReportController extends PageController {
850
675
  previousSelectedKey: sPreviousSelectedKey
851
676
  }
852
677
  },
853
- selectorElement: oMultiModeControl
678
+ selectorElement: oMultiModeControl.content
854
679
  }
855
680
  ]
856
681
  });
@@ -865,17 +690,19 @@ class ListReportController extends PageController {
865
690
  this.onPendingFilters();
866
691
  oInternalModelContext.setProperty("appliedFilters", oFilterBar.getAssignedFiltersText().filtersText);
867
692
  if (oEvent.getParameter("conditionsBased")) {
693
+ this._getMultiModeControl()?.setFreezeContent(true);
868
694
  oInternalModelContext.setProperty("hasPendingFilters", true);
869
695
  }
870
696
  }
871
697
  },
872
698
  onVariantSelected(this: ListReportController, oEvent: any) {
873
699
  const oVM = oEvent.getSource();
700
+ const oMultiModeControl = this._getMultiModeControl();
701
+
702
+ oMultiModeControl?.invalidateContent();
703
+ oMultiModeControl?.setFreezeContent(true);
874
704
  // setTimeout cause the variant needs to be applied before judging the auto search or updating the app state
875
705
  setTimeout(() => {
876
- if (this._isMultiMode()) {
877
- (this.handlers as any).onTabMultiModeChange.apply(this, [oEvent]);
878
- }
879
706
  if (this._shouldAutoTriggerSearch(oVM)) {
880
707
  // the app state will be updated via onSearch handler
881
708
  return this._getFilterBarControl().triggerSearch();
@@ -898,23 +725,20 @@ class ListReportController extends PageController {
898
725
  oInternalModelContext.setProperty("hasPendingFilters", false);
899
726
  oInternalModelContext.setProperty("hideDraftInfo", bHideDraft);
900
727
  if (this._isMultiMode()) {
901
- const aControls = this._getControls(),
902
- oMultiModeControl = this._getMultiModeControl();
903
- this._setCountsOutDated();
728
+ const oMultiModeControl = this._getMultiModeControl();
729
+ oMultiModeControl.setCountsOutDated(true);
730
+ oMultiModeControl.setFreezeContent(false);
904
731
  if (!this._isCustomTab()) {
905
- const sDisplayedControlId = this._getCurrentControl().getId();
906
- this._updateMultiTabNotApplicableFields(oInternalModelContext, oFilterBar);
907
- // This should be done outside the search event handler of the filter bar.
908
- // The same logic is required when filter bar is hidden and multiple tables exist on the LR.
909
- // This is currently done in ListReport/overrides/ViewState.js#onAfterStateApplied()
910
- aControls.forEach(function (oControl: any) {
911
- oControl.data("outdatedRows", oControl.getId() !== sDisplayedControlId);
912
- });
732
+ oMultiModeControl.updateMultiTabNotApplicableFields(
733
+ oFilterBar,
734
+ oFilterBar.data("entityType"),
735
+ this.oResourceBundle as ResourceBundle
736
+ );
913
737
  } else {
914
738
  const oFilterConditions = oFilterBar.getFilterConditions();
915
739
  this.onViewNeedsRefresh({
916
740
  filterConditions: oFilterConditions,
917
- currentTabId: oMultiModeControl.getSelectedKey(),
741
+ currentTabId: oMultiModeControl.content.getSelectedKey(),
918
742
  refreshCause: "search"
919
743
  });
920
744
  }
@@ -926,7 +750,7 @@ class ListReportController extends PageController {
926
750
  (oMdcChart.getBindingContext("internal") as InternalModelContext).setProperty("", {});
927
751
 
928
752
  const oPageInternalModelContext = oMdcChart.getBindingContext("pageInternal") as InternalModelContext;
929
- const sTemplateContentView = oPageInternalModelContext.getProperty(oPageInternalModelContext.getPath() + "/alpContentView");
753
+ const sTemplateContentView = oPageInternalModelContext.getProperty(`${oPageInternalModelContext.getPath()}/alpContentView`);
930
754
  if (sTemplateContentView === TemplateContentView.Chart) {
931
755
  this.hasPendingChartChanges = true;
932
756
  }
@@ -954,15 +778,20 @@ class ListReportController extends PageController {
954
778
  /**
955
779
  * Triggers an outbound navigation when a user chooses the chevron.
956
780
  *
957
- * @param {object} oController
958
- * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
959
- * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
960
- * @param {string} sCreatePath Create path when the chevron is created.
961
- * @returns {Promise} Promise which is resolved once the navigation is triggered
781
+ * @param oController
782
+ * @param sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
783
+ * @param oContext The context that contains the data for the target app
784
+ * @param sCreatePath Create path when the chevron is created.
785
+ * @returns Promise which is resolved once the navigation is triggered
962
786
  * @ui5-restricted
963
787
  * @final
964
788
  */
965
- onChevronPressNavigateOutBound(oController: ListReportController, sOutboundTarget: string, oContext: any, sCreatePath: string) {
789
+ onChevronPressNavigateOutBound(
790
+ oController: ListReportController,
791
+ sOutboundTarget: string,
792
+ oContext: V4Context,
793
+ sCreatePath: string
794
+ ) {
966
795
  return oController._intentBasedNavigation.onChevronPressNavigateOutBound(oController, sOutboundTarget, oContext, sCreatePath);
967
796
  },
968
797
  onChartSelectionChanged(this: ListReportController, oEvent: any) {
@@ -976,11 +805,11 @@ class ListReportController extends PageController {
976
805
  // update selections on selection or deselection
977
806
  ChartUtils.setChartFilters(oMdcChart);
978
807
  }
979
- const sTemplateContentView = oInternalModelContext.getProperty(oInternalModelContext.getPath() + "/alpContentView");
808
+ const sTemplateContentView = oInternalModelContext.getProperty(`${oInternalModelContext.getPath()}/alpContentView`);
980
809
  if (sTemplateContentView === TemplateContentView.Chart) {
981
810
  this.hasPendingChartChanges = true;
982
- } else {
983
- oTable && (oTable as any).rebind();
811
+ } else if (oTable) {
812
+ (oTable as any).rebind();
984
813
  this.hasPendingChartChanges = false;
985
814
  }
986
815
  },
@@ -1034,53 +863,36 @@ class ListReportController extends PageController {
1034
863
  },
1035
864
  onStateChange(this: ListReportController) {
1036
865
  this.getExtensionAPI().updateAppState();
866
+ },
867
+ onDynamicPageTitleStateChanged(this: ListReportController, oEvent: any) {
868
+ const filterBar: any = this._getFilterBarControl();
869
+ if (filterBar && filterBar.getSegmentedButton()) {
870
+ if (oEvent.getParameter("isExpanded")) {
871
+ filterBar.getSegmentedButton().setVisible(true);
872
+ } else {
873
+ filterBar.getSegmentedButton().setVisible(false);
874
+ }
875
+ }
1037
876
  }
1038
877
  };
1039
878
  formatters = {
1040
- /**
1041
- * Method to set the message text for the multiple entity sets when fields in the FilterBar need to be ignored.
1042
- *
1043
- * @param this
1044
- * @param {Array} aIgnoredFields Array of ignored fields in the FilterBar for the current tab (multiple entity sets)
1045
- * @param {string} sTabTitle Tab title
1046
- * @param {boolean} bIsChart Flag that indicates whether the control is a chart or not
1047
- * @param {object} oApplySupported ApplySupported for the control
1048
- * @returns {string} Message text
1049
- */
1050
- setTabMessageStrip(this: ListReportController, aIgnoredFields: any[], sTabTitle: string, bIsChart?: any, oApplySupported?: any) {
879
+ setALPControlMessageStrip(this: ListReportController, aIgnoredFields: any[], bIsChart: any, oApplySupported?: any) {
1051
880
  let sText = "";
1052
881
  bIsChart = bIsChart === "true" || bIsChart === true;
1053
882
  const oFilterBar = this._getFilterBarControl();
1054
- if (oFilterBar && Array.isArray(aIgnoredFields) && aIgnoredFields.length > 0 && (sTabTitle || bIsChart)) {
1055
- const sFilterBarEntityPath = oFilterBar.data("entityType"),
1056
- oMetaModel = this.getView().getModel().getMetaModel(),
1057
- oResourceBundle = Core.getLibraryResourceBundle("sap.fe.templates") as ResourceBundle,
1058
- aIgnoredLabels = aIgnoredFields.map(function (sProperty) {
1059
- const oMacroResourceBundle = Core.getLibraryResourceBundle("sap.fe.macros") as ResourceBundle;
1060
- if (sProperty === "$search") {
1061
- return oMacroResourceBundle ? oMacroResourceBundle.getText("M_FILTERBAR_SEARCH") : "";
1062
- }
1063
- if (sProperty === "$editState") {
1064
- return oMacroResourceBundle ? oMacroResourceBundle.getText("M_COMMON_FILTERBAR_EDITING_STATUS") : "";
1065
- }
1066
- const sLabel = oMetaModel.getObject(sFilterBarEntityPath + sProperty + "@com.sap.vocabularies.Common.v1.Label");
1067
- return DelegateUtil.getLocalizedText(sLabel, oFilterBar);
1068
- });
883
+ if (oFilterBar && Array.isArray(aIgnoredFields) && aIgnoredFields.length > 0 && bIsChart) {
884
+ const aIgnoredLabels = MessageStrip.getLabels(
885
+ aIgnoredFields,
886
+ oFilterBar.data("entityType"),
887
+ oFilterBar,
888
+ this.oResourceBundle as ResourceBundle
889
+ );
1069
890
  const bIsSearchIgnored = !oApplySupported.enableSearch;
1070
- if (oResourceBundle) {
1071
- sText = CommonUtils.getMessageStripText(
1072
- this.getView(),
1073
- aIgnoredLabels,
1074
- oFilterBar,
1075
- bIsChart,
1076
- bIsSearchIgnored,
1077
- sTabTitle,
1078
- oResourceBundle,
1079
- DelegateUtil.getLocalizedText
1080
- );
1081
- }
891
+ sText = bIsChart
892
+ ? MessageStrip.getALPText(aIgnoredLabels, oFilterBar, bIsSearchIgnored)
893
+ : MessageStrip.getText(aIgnoredLabels, oFilterBar, "", DelegateUtil.getLocalizedText);
894
+ return sText;
1082
895
  }
1083
- return sText;
1084
896
  }
1085
897
  };
1086
898
  }