@sapui5/sap.fe.templates 1.93.3 → 1.97.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 (95) hide show
  1. package/package.json +7 -4
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/AnalyticalListPage/manifest.json +6 -0
  4. package/src/sap/fe/templates/ListReport/ExtensionAPI.js +31 -3
  5. package/src/sap/fe/templates/ListReport/ListReport.view.xml +9 -7
  6. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +244 -229
  7. package/src/sap/fe/templates/ListReport/manifest.json +11 -1
  8. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +2 -6
  9. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +151 -28
  10. package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.xml +3 -3
  11. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +35 -99
  12. package/src/sap/fe/templates/ObjectPage/Component.js +15 -4
  13. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +18 -3
  14. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +169 -165
  15. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +262 -170
  16. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +8 -0
  17. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +1 -1
  18. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -0
  19. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +2 -2
  20. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +42 -1
  21. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +16 -14
  22. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +20 -8
  23. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +14 -19
  24. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +3 -3
  25. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +1 -1
  26. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderContent.fragment.xml +34 -38
  27. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +26 -16
  28. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +5 -5
  29. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +8 -2
  30. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +8 -4
  31. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +117 -115
  32. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +113 -99
  33. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +32 -21
  34. package/src/sap/fe/templates/RootContainer/view/Fcl.view.xml +2 -1
  35. package/src/sap/fe/templates/RootContainer/view/NavContainer.view.xml +1 -1
  36. package/src/sap/fe/templates/TableScroller.js +61 -0
  37. package/src/sap/fe/templates/controls/Chart.fragment.xml +11 -14
  38. package/src/sap/fe/templates/controls/Table.fragment.xml +3 -0
  39. package/src/sap/fe/templates/library.js +1 -1
  40. package/src/sap/fe/templates/messagebundle.properties +1 -1
  41. package/src/sap/fe/templates/messagebundle_ar.properties +9 -5
  42. package/src/sap/fe/templates/messagebundle_bg.properties +8 -4
  43. package/src/sap/fe/templates/messagebundle_ca.properties +8 -4
  44. package/src/sap/fe/templates/messagebundle_cs.properties +7 -3
  45. package/src/sap/fe/templates/messagebundle_cy.properties +8 -4
  46. package/src/sap/fe/templates/messagebundle_da.properties +9 -5
  47. package/src/sap/fe/templates/messagebundle_de.properties +8 -4
  48. package/src/sap/fe/templates/messagebundle_el.properties +8 -4
  49. package/src/sap/fe/templates/messagebundle_en.properties +7 -3
  50. package/src/sap/fe/templates/messagebundle_en_GB.properties +7 -3
  51. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +7 -3
  52. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +7 -3
  53. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +7 -3
  54. package/src/sap/fe/templates/messagebundle_es.properties +8 -4
  55. package/src/sap/fe/templates/messagebundle_es_MX.properties +8 -4
  56. package/src/sap/fe/templates/messagebundle_et.properties +7 -3
  57. package/src/sap/fe/templates/messagebundle_fi.properties +8 -4
  58. package/src/sap/fe/templates/messagebundle_fr.properties +9 -5
  59. package/src/sap/fe/templates/messagebundle_fr_CA.properties +8 -4
  60. package/src/sap/fe/templates/messagebundle_hi.properties +8 -4
  61. package/src/sap/fe/templates/messagebundle_hr.properties +8 -4
  62. package/src/sap/fe/templates/messagebundle_hu.properties +9 -5
  63. package/src/sap/fe/templates/messagebundle_id.properties +10 -6
  64. package/src/sap/fe/templates/messagebundle_it.properties +8 -4
  65. package/src/sap/fe/templates/messagebundle_iw.properties +8 -4
  66. package/src/sap/fe/templates/messagebundle_ja.properties +8 -4
  67. package/src/sap/fe/templates/messagebundle_kk.properties +8 -4
  68. package/src/sap/fe/templates/messagebundle_ko.properties +8 -4
  69. package/src/sap/fe/templates/messagebundle_lt.properties +8 -4
  70. package/src/sap/fe/templates/messagebundle_lv.properties +8 -4
  71. package/src/sap/fe/templates/messagebundle_ms.properties +8 -4
  72. package/src/sap/fe/templates/messagebundle_nl.properties +8 -4
  73. package/src/sap/fe/templates/messagebundle_no.properties +9 -5
  74. package/src/sap/fe/templates/messagebundle_pl.properties +8 -4
  75. package/src/sap/fe/templates/messagebundle_pt.properties +8 -4
  76. package/src/sap/fe/templates/messagebundle_pt_PT.properties +8 -4
  77. package/src/sap/fe/templates/messagebundle_ro.properties +8 -4
  78. package/src/sap/fe/templates/messagebundle_ru.properties +9 -5
  79. package/src/sap/fe/templates/messagebundle_sh.properties +8 -4
  80. package/src/sap/fe/templates/messagebundle_sk.properties +8 -4
  81. package/src/sap/fe/templates/messagebundle_sl.properties +8 -4
  82. package/src/sap/fe/templates/messagebundle_sv.properties +8 -4
  83. package/src/sap/fe/templates/messagebundle_th.properties +9 -5
  84. package/src/sap/fe/templates/messagebundle_tr.properties +7 -3
  85. package/src/sap/fe/templates/messagebundle_uk.properties +7 -3
  86. package/src/sap/fe/templates/messagebundle_vi.properties +8 -4
  87. package/src/sap/fe/templates/messagebundle_zh_CN.properties +9 -5
  88. package/src/sap/fe/templates/messagebundle_zh_TW.properties +8 -4
  89. package/src/sap/fe/templates/ObjectPage/overrides/Routing.js +0 -20
  90. package/src/sap/fe/templates/ObjectPage/view/fragments/TitleAndSubtitle.fragment.xml +0 -24
  91. package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
  92. package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
  93. package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +0 -25
  94. package/src/sap/fe/templates/controls/Paginator.control.xml +0 -22
  95. package/src/sap/fe/templates/controls/Paginator.js +0 -173
@@ -8,14 +8,11 @@ sap.ui.define(
8
8
  "sap/fe/core/PageController",
9
9
  "sap/fe/core/controllerextensions/SideEffects",
10
10
  "sap/fe/core/controllerextensions/EditFlow",
11
- "sap/fe/macros/field/FieldRuntime",
12
11
  "sap/base/Log",
13
12
  "sap/base/util/ObjectPath",
14
- "sap/fe/navigation/SelectionVariant",
15
13
  "sap/fe/core/CommonUtils",
16
14
  "sap/ui/mdc/p13n/StateUtil",
17
15
  "sap/fe/macros/table/Utils",
18
- "sap/fe/macros/ResourceModel",
19
16
  "sap/fe/core/controllerextensions/InternalRouting",
20
17
  "sap/ui/Device",
21
18
  "sap/fe/core/controllerextensions/IntentBasedNavigation",
@@ -25,33 +22,30 @@ sap.ui.define(
25
22
  "sap/fe/templates/ListReport/ExtensionAPI",
26
23
  "sap/fe/macros/filter/FilterUtils",
27
24
  "sap/fe/macros/chart/ChartUtils",
28
- "sap/fe/macros/visualfilters/VisualFilterUtils",
29
25
  "sap/fe/macros/DelegateUtil",
30
26
  "sap/ui/core/mvc/OverrideExecution",
31
27
  "sap/fe/core/controllerextensions/ViewState",
32
28
  "./overrides/ViewState",
33
29
  "sap/fe/templates/RootContainer/overrides/EditFlow",
34
30
  "sap/fe/core/helpers/EditState",
35
- "sap/ui/model/json/JSONModel",
36
31
  "sap/fe/core/library",
37
- "sap/fe/core/helpers/SemanticDateOperators",
38
32
  "sap/fe/core/controllerextensions/Share",
39
33
  "./overrides/Share",
40
34
  "sap/fe/macros/CommonHelper",
41
- "sap/fe/core/controllerextensions/KPIManagement"
35
+ "sap/fe/core/controllerextensions/KPIManagement",
36
+ "sap/fe/templates/TableScroller",
37
+ "sap/fe/core/controllerextensions/Placeholder",
38
+ "sap/ui/fl/write/api/ControlPersonalizationWriteAPI"
42
39
  ],
43
40
  function(
44
41
  PageController,
45
42
  SideEffects,
46
43
  EditFlow,
47
- FieldRuntime,
48
44
  Log,
49
45
  ObjectPath,
50
- SelectionVariant,
51
46
  CommonUtils,
52
47
  StateUtil,
53
48
  TableUtils,
54
- ResourceModel,
55
49
  InternalRouting,
56
50
  Device,
57
51
  IntentBasedNavigation,
@@ -61,20 +55,20 @@ sap.ui.define(
61
55
  ExtensionAPI,
62
56
  FilterUtils,
63
57
  ChartUtils,
64
- VisualFilterUtils,
65
58
  DelegateUtil,
66
59
  OverrideExecution,
67
60
  ViewState,
68
61
  ViewStateOverrides,
69
62
  EditFlowOverrides,
70
63
  EditState,
71
- JSONModel,
72
64
  CoreLibrary,
73
- SemanticDateOperators,
74
65
  Share,
75
66
  ShareOverrides,
76
67
  CommonHelper,
77
- KPIManagement
68
+ KPIManagement,
69
+ TableScroller,
70
+ Placeholder,
71
+ ControlPersonalizationWriteAPI
78
72
  ) {
79
73
  "use strict";
80
74
  var TemplateContentView = CoreLibrary.TemplateContentView,
@@ -123,6 +117,7 @@ sap.ui.define(
123
117
  editFlow: EditFlow.override(EditFlowOverrides),
124
118
  viewState: ViewState.override(ViewStateOverrides),
125
119
  kpiManagement: KPIManagement,
120
+ placeholder: Placeholder,
126
121
 
127
122
  getExtensionAPI: function() {
128
123
  if (!this.extensionAPI) {
@@ -134,26 +129,34 @@ sap.ui.define(
134
129
  onInit: function() {
135
130
  PageController.prototype.onInit.apply(this);
136
131
  var that = this;
137
- var aTables = this._getTables();
132
+ var aControls = this._getControls();
138
133
  var oInternalModelContext = this.getView().getBindingContext("internal");
139
134
  if (that._isMultiMode()) {
140
135
  var oMultiModeTab = that._getMultiModeControl();
141
136
  oInternalModelContext.setProperty("tabs", {
142
137
  selected: oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey()
143
138
  });
144
- aTables.forEach(function(oTable) {
139
+ aControls.forEach(function(oControl) {
145
140
  var oUpdateCounts = function() {
146
141
  that._updateCounts();
147
142
  };
148
- TableUtils.addEventToBindingInfo(oTable, "dataRequested", oUpdateCounts);
143
+ CommonUtils.addEventToBindingInfo(oControl, "dataRequested", oUpdateCounts);
149
144
  });
150
145
  }
146
+ //TODO: This is only a temporary approach and will be removed once app state behaviour is finalized.
151
147
 
148
+ var oUrlParser = sap.ushell && sap.ushell.Container.getService("URLParsing");
149
+ var oUrlParams = oUrlParser && oUrlParser.parseParameters(window.location.search);
150
+ if (oUrlParams && oUrlParams["sap-fe-test-appState"]) {
151
+ this.bTestAppState = true;
152
+ }
152
153
  oInternalModelContext.setProperty("hasPendingFilters", true);
153
154
  oInternalModelContext.setProperty("appliedFilters", "");
155
+ oInternalModelContext.setProperty("hideDraftInfo", false);
154
156
  oInternalModelContext.setProperty("uom", {});
155
157
  oInternalModelContext.setProperty("scalefactor", {});
156
158
  oInternalModelContext.setProperty("scalefactorNumber", {});
159
+ oInternalModelContext.setProperty("currency", {});
157
160
 
158
161
  if (this._hasMultiVisualizations()) {
159
162
  var alpContentView = this._getDefaultPath();
@@ -173,7 +176,7 @@ sap.ui.define(
173
176
  .getRouterProxy()
174
177
  .waitForRouteMatchBeforeNavigation();
175
178
 
176
- this._updateMultiTableHiddenStatus();
179
+ this._isMultiMode() && this._updateMultiControlHiddenStatus();
177
180
 
178
181
  FilterUtils.attachConditionHandling(this._getFilterBarControl());
179
182
  },
@@ -189,7 +192,7 @@ sap.ui.define(
189
192
  },
190
193
 
191
194
  _onAfterBinding: function() {
192
- var aTables = this._getTables();
195
+ var aTables = this._getControls("table");
193
196
  var that = this;
194
197
  if (EditState.isEditStateDirty()) {
195
198
  var oTableBinding = this._getTableBinding();
@@ -222,6 +225,10 @@ sap.ui.define(
222
225
  );
223
226
  },
224
227
 
228
+ onBeforeRendering: function() {
229
+ PageController.prototype.onBeforeRendering.apply(this);
230
+ },
231
+
225
232
  onAfterRendering: function(oEvent) {
226
233
  var that = this;
227
234
  this.getView()
@@ -229,7 +236,7 @@ sap.ui.define(
229
236
  .getResourceBundle()
230
237
  .then(function(response) {
231
238
  that.oResourceBundle = response;
232
- var aTables = that._getTables();
239
+ var aControls = that._getControls();
233
240
  var sEntitySet = that.getView().getViewData().entitySet;
234
241
  var sText = CommonUtils.getTranslatedText(
235
242
  "T_OP_TABLE_AND_CHART_NO_DATA_TEXT",
@@ -237,34 +244,23 @@ sap.ui.define(
237
244
  undefined,
238
245
  sEntitySet
239
246
  );
240
- aTables.forEach(function(oTable) {
241
- oTable.setNoDataText(sText);
247
+ aControls.forEach(function(oControl) {
248
+ oControl.setNoDataText(sText);
242
249
  });
243
- if (that._hasMultiVisualizations()) {
244
- var oChart = that.getChartControl();
245
- oChart.setNoDataText(sText);
246
- }
247
250
  })
248
251
  .catch(function(oError) {
249
252
  Log.error("Error while retrieving the resource bundle", oError);
250
253
  });
251
254
  },
252
255
  onPageReady: function(mParameters) {
253
- var oLastFocusedControl = mParameters.lastFocusedControl;
254
- var oView = this.getView();
255
- // set the focus to the first action button, or to the first editable input if in editable mode
256
- if (oLastFocusedControl && oLastFocusedControl.controlId && oLastFocusedControl.focusInfo) {
257
- var oFocusControl = oView.byId(oLastFocusedControl.controlId);
258
- if (oFocusControl) {
259
- oFocusControl.applyFocusInfo(oLastFocusedControl.focusInfo);
260
- }
261
- }
262
-
263
256
  // Enabling mandatory filter fields message dialog and focusing on them
264
- var oFilterBar = this._getFilterBarControl();
265
- if (oFilterBar && !oFilterBar.getShowMessages()) {
266
- oFilterBar.setShowMessages(true);
267
- oFilterBar._setFocusOnFirstErroneousField();
257
+ if (mParameters.forceFocus) {
258
+ var oFilterBar = this._getFilterBarControl();
259
+
260
+ if (oFilterBar && !oFilterBar.getShowMessages()) {
261
+ oFilterBar.setShowMessages(true);
262
+ oFilterBar.setFocusOnFirstErroneousField();
263
+ }
268
264
  }
269
265
  },
270
266
 
@@ -310,34 +306,31 @@ sap.ui.define(
310
306
  onPendingFilters: function() {},
311
307
  getCurrentEntitySet: function() {
312
308
  if (!this._sEntitySet) {
313
- var oTable = this._getCurrentTable();
314
- this._sEntitySet = oTable.data("targetCollectionPath").slice(1);
309
+ var oDisplayedControl = (this._isMultiMode() && this._getCurrentControl()) || this._getTable();
310
+ this._sEntitySet = oDisplayedControl.data("targetCollectionPath").slice(1);
315
311
  }
316
312
  return this._sEntitySet;
317
313
  },
318
314
 
319
315
  /**
320
- * This method initiates update of enabled state of DataFieldForAction and visible state of DataFieldForIBN buttons.
321
- * @param aTables Array of tables in the List report
316
+ * This method initiates the update of the enabled state of the DataFieldForAction and the visible state of the DataFieldForIBN buttons.
317
+ * @param aTables Array of tables in the list report
322
318
  * @private
323
319
  */
324
320
  _updateTableActions: function(aTables) {
325
321
  var aIBNActions = [];
326
- aTables.forEach(
327
- function(oTable) {
328
- aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
329
- TableUtils.getSemanticTargetsFromTable(this, oTable);
330
- // Update 'enabled' property of DataFieldForAction buttons on table toolbar
331
- // The same is also performed on Table selectionChange event
332
- var oInternalModelContext = oTable.getBindingContext("internal"),
333
- oActionOperationAvailableMap = JSON.parse(
334
- CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
335
- ),
336
- aSelectedContexts = oTable.getSelectedContexts();
337
-
338
- CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
339
- }.bind(this)
340
- );
322
+ aTables.forEach(function(oTable) {
323
+ aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
324
+ // Update 'enabled' property of DataFieldForAction buttons on table toolbar
325
+ // The same is also performed on Table selectionChange event
326
+ var oInternalModelContext = oTable.getBindingContext("internal"),
327
+ oActionOperationAvailableMap = JSON.parse(
328
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
329
+ ),
330
+ aSelectedContexts = oTable.getSelectedContexts();
331
+
332
+ CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
333
+ });
341
334
  CommonUtils.updateDataFieldForIBNButtonsVisibility(aIBNActions, this.getView());
342
335
  },
343
336
 
@@ -346,36 +339,12 @@ sap.ui.define(
346
339
  *
347
340
  * @function
348
341
  * @name sap.fe.templates.ListReport.ListReportController.controller#_scrollTablesToRow
349
- * @param {string} sRowPath The path of the table row context to be scrolled
342
+ * @param {string} sRowPath The path of the table row context to be scrolled to
350
343
  */
351
344
  _scrollTablesToRow: function(sRowPath) {
352
- var aTables, oTable, oTableRow, oTableRowBinding;
353
- if (this._getTables && this._getTables().length > 0) {
354
- aTables = this._getTables();
355
- for (var i = 0; i < aTables.length; i++) {
356
- oTable = aTables[i];
357
- oTableRowBinding = oTable.getRowBinding();
358
- if (oTableRowBinding) {
359
- var oTableRowBindingContexts;
360
- switch (oTable.data().tableType) {
361
- case "GridTable":
362
- oTableRowBindingContexts = oTableRowBinding.getContexts(0);
363
- break;
364
- case "ResponsiveTable":
365
- oTableRowBindingContexts = oTableRowBinding.getCurrentContexts();
366
- break;
367
- default:
368
- }
369
- oTableRow = oTableRowBindingContexts.find(function(item) {
370
- return item && item.getPath().indexOf(sRowPath) !== -1;
371
- });
372
- }
373
- if (oTableRow) {
374
- var iPos = oTableRow.iIndex;
375
- oTable.scrollToIndex(iPos);
376
- }
377
- }
378
- }
345
+ this._getControls("table").forEach(function(oTable) {
346
+ TableScroller.scrollTableToRow(oTable, sRowPath);
347
+ });
379
348
  },
380
349
  _getPageTitleInformation: function() {
381
350
  var that = this;
@@ -400,9 +369,9 @@ sap.ui.define(
400
369
  },
401
370
  _getSegmentedButtonId: function(sControl) {
402
371
  if (sControl === "Chart") {
403
- return this.getChartControl().data("segmentedButtonId");
372
+ return this._getChart().data("segmentedButtonId");
404
373
  } else {
405
- return this._getCurrentTable().data("segmentedButtonId");
374
+ return this._getTable().data("segmentedButtonId");
406
375
  }
407
376
  },
408
377
  _getFilterBarControlId: function() {
@@ -435,39 +404,47 @@ sap.ui.define(
435
404
  .getContent()[0]
436
405
  .data("singleTableId");
437
406
  },
438
- _getCurrentTable: function() {
407
+ _getCurrentControl: function() {
439
408
  if (!this._oListReportControl) {
440
409
  var oMultiModeTab = this._getMultiModeControl();
441
- if (oMultiModeTab) {
442
- this._oListReportControl = this.getView().byId(
443
- oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey()
444
- );
445
- } else {
446
- this._oListReportControl = this.getView().byId(this._getTableControlId());
447
- }
410
+ this._oListReportControl = this.getView().byId(oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey());
448
411
  }
449
412
  return this._oListReportControl;
450
413
  },
414
+ _getTable: function() {
415
+ if (this._isMultiMode()) {
416
+ var oControl = this._getCurrentControl();
417
+ return oControl && oControl.isA("sap.ui.mdc.Table") ? oControl : undefined;
418
+ }
419
+ return this.getView().byId(this._getTableControlId());
420
+ },
421
+ _getChart: function() {
422
+ return this.getView().byId(this._getChartControlId());
423
+ },
451
424
  _getTableBinding: function(sTableId) {
452
- var oTableControl = sTableId ? this.getView().byId(sTableId) : this._getCurrentTable(),
425
+ var oTableControl = sTableId ? this.getView().byId(sTableId) : this._getTable(),
453
426
  oBinding = oTableControl && oTableControl._getRowBinding();
454
427
 
455
428
  return oBinding;
456
429
  },
457
- _getTables: function() {
430
+ _getControls: function(sKey) {
458
431
  var that = this;
459
432
  if (this._isMultiMode()) {
460
- var aTables = [];
433
+ var aControls = [];
461
434
  var oTabMultiMode = this._getMultiModeControl();
462
435
  oTabMultiMode.getItems().forEach(function(oItem) {
463
- var oTable = that.getView().byId(oItem.getKey());
464
- if (oTable) {
465
- aTables.push(oTable);
436
+ var oControl = that.getView().byId(oItem.getKey());
437
+ if (sKey) {
438
+ if (oItem.getKey().indexOf("fe::" + sKey) > -1) {
439
+ oControl && aControls.push(oControl);
440
+ }
441
+ } else {
442
+ oControl && aControls.push(oControl);
466
443
  }
467
444
  });
468
- return aTables;
445
+ return aControls;
469
446
  }
470
- return [this._getCurrentTable()];
447
+ return sKey === "Chart" ? [this._getChart()] : [this._getTable()];
471
448
  },
472
449
  _getDefaultPath: function() {
473
450
  var defaultPath = this.getView()
@@ -557,27 +534,28 @@ sap.ui.define(
557
534
  * A temporary solution (if we find better workflow) is to set a customData and don't trigger
558
535
  * rebindTable if this customData is set to true.
559
536
  */
560
- _updateMultiTableHiddenStatus: function() {
561
- var oDisplayedTable = this._getCurrentTable();
562
- if (this._isMultiMode() && oDisplayedTable) {
563
- var sDisplayTableId = oDisplayedTable.getId();
564
- var aTables = this._getTables();
565
- aTables.forEach(function(oTable) {
566
- var sTableId = oTable.getId();
567
- oTable.data("tableHidden", sTableId !== sDisplayTableId);
537
+ _updateMultiControlHiddenStatus: function() {
538
+ var oDisplayedControl = this._getCurrentControl();
539
+ if (this._isMultiMode() && oDisplayedControl) {
540
+ var sDisplayControlId = oDisplayedControl.getId();
541
+ var aControls = this._getControls();
542
+ aControls.forEach(function(oControl) {
543
+ var sControlId = oControl.getId();
544
+ oControl.data("controlHidden", sControlId !== sDisplayControlId);
568
545
  });
569
546
  }
570
547
  },
571
548
  /**
572
- * Method to update Page local UI Model with Filter Bar not applicable fields (specific to Multi Tables scenario).
549
+ * 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).
573
550
  *
574
- * @param {sap.ui.model.context} oInternalModelContext Internal Model Context
575
- * @param {sap.ui.mdc.FilterBar} oFilterBar MDC FilterBar
551
+ * @param {sap.ui.model.context} oInternalModelContext The internal model context
552
+ * @param {sap.ui.mdc.FilterBar} oFilterBar MDC filter bar
576
553
  */
577
554
  _updateMultiNotApplicableFields: function(oInternalModelContext, oFilterBar) {
578
555
  var mCache = {};
579
556
  var ignoredFields = {},
580
- aTables = this._getTables();
557
+ aTables = this._getControls("table"),
558
+ aCharts = this._getControls("Chart");
581
559
  aTables.forEach(function(oTable) {
582
560
  var sTableEntityPath = oTable.data("targetCollectionPath"),
583
561
  sTableEntitySet = sTableEntityPath.slice(1),
@@ -587,45 +565,62 @@ sap.ui.define(
587
565
  .getKey(),
588
566
  sCacheKey = sTableEntitySet + (oTable.data("enableAnalytics") === "true" ? "Analytical" : "Regular");
589
567
  if (!mCache[sCacheKey]) {
590
- mCache[sCacheKey] = FilterUtils.getNotApplicableFiltersForTable(oFilterBar, oTable);
568
+ mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oTable);
569
+ }
570
+ ignoredFields[sTabId] = mCache[sCacheKey];
571
+ });
572
+ aCharts.forEach(function(oChart) {
573
+ var sChartEntityPath = oChart.data("targetCollectionPath"),
574
+ sChartEntitySet = sChartEntityPath.slice(1),
575
+ sTabId = oChart
576
+ .getParent()
577
+ .getParent()
578
+ .getKey(),
579
+ sCacheKey = sChartEntitySet + "Chart";
580
+ if (!mCache[sCacheKey]) {
581
+ mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
591
582
  }
592
583
  ignoredFields[sTabId] = mCache[sCacheKey];
593
584
  });
594
585
  oInternalModelContext.setProperty("tabs/ignoredFields", ignoredFields);
595
586
  },
596
- _updateTableControl: function() {
587
+ _updateMultiModeSelectedControl: function() {
597
588
  this._sEntitySet = undefined;
598
589
  this._oListReportControl = undefined;
599
- this._getCurrentTable();
590
+ this._getCurrentControl();
600
591
  },
601
592
  _updateCounts: function() {
602
- this._updateMutliModeCounts();
593
+ this._updateMultiModeCounts();
603
594
  },
604
595
  /**
605
- * Method to determine if a tab from the list report is custom.
596
+ * Method to determine if a tab from the list report is a custom tab.
606
597
  *
607
598
  * @function
608
599
  * @name _isCustomTab
609
- * @returns {boolean} Determines if the tab is custom or not.
600
+ * @returns {boolean} Determines if the tab is a custom tab.
610
601
  */
611
602
  _isCustomTab: function() {
612
603
  var oMultiModeControl = this._getMultiModeControl();
613
604
  return oMultiModeControl && oMultiModeControl.getSelectedKey().indexOf("::CustomTab::") > -1;
614
605
  },
615
- _updateMutliModeCounts: function() {
606
+ _updateMultiModeCounts: function() {
616
607
  var that = this;
617
608
  var aBindingPromises = [];
618
609
  var oMultiModeControl = this._getMultiModeControl();
619
610
  if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true" && !this._isCustomTab()) {
620
- var oDisplayedTable = this._getCurrentTable();
621
- var sDisplayedTableId = oDisplayedTable.getId();
611
+ var oDisplayedControl = this._getCurrentControl();
612
+ var sDisplayedControlId = oDisplayedControl.getId();
622
613
  var aCompliantTabs = [];
623
614
  var aItems = oMultiModeControl.getItems();
624
615
  aItems.forEach(function(oItem) {
625
- var oTable = that.getView().byId(oItem.getKey());
626
- if (oTable && (oItem.data("outdatedCounts") || oTable.getId() === sDisplayedTableId)) {
616
+ var oControl = that.getView().byId(oItem.getKey());
617
+ if (
618
+ oControl &&
619
+ !oControl.isA("sap.ui.mdc.ChartNew") &&
620
+ (oItem.data("outdatedCounts") || oControl.getId() === sDisplayedControlId)
621
+ ) {
627
622
  aCompliantTabs.push({
628
- table: oTable,
623
+ control: oControl,
629
624
  item: oItem
630
625
  });
631
626
  }
@@ -633,10 +628,10 @@ sap.ui.define(
633
628
 
634
629
  aBindingPromises = aCompliantTabs.map(function(mTab) {
635
630
  mTab.item.setCount("...");
636
- var oTable = mTab.table;
637
- var oFilterInfos = TableUtils.getFiltersInfoForSV(oTable, mTab.item.data("selectionVariant"));
638
- return TableUtils.getListBindingForCount(oTable, that.getView().getBindingContext(), {
639
- batchGroupId: oTable.getId() === sDisplayedTableId ? oTable.data("batchGroupId") : "$auto",
631
+ var oControl = mTab.control;
632
+ var oFilterInfos = TableUtils.getFiltersInfoForSV(oControl, mTab.item.data("selectionVariant"));
633
+ return TableUtils.getListBindingForCount(oControl, that.getView().getBindingContext(), {
634
+ batchGroupId: oControl.getId() === sDisplayedControlId ? oControl.data("batchGroupId") : "$auto",
640
635
  additionalFilters: oFilterInfos.filters
641
636
  });
642
637
  });
@@ -678,44 +673,79 @@ sap.ui.define(
678
673
  }
679
674
  },
680
675
  _updateChart: function(oChart) {
681
- if (!oChart.isInnerChartBound() || this.hasPendingTableChanges) {
682
- oChart.getControlDelegate().rebindChart(oChart, oChart.getBindingInfo("data"));
676
+ var oInnerChart = oChart.getControlDelegate()._getChart(oChart);
677
+ if (!(oInnerChart && oInnerChart.isBound("data")) || this.hasPendingTableChanges) {
678
+ oChart.getControlDelegate().rebindChart(oChart, oInnerChart.getBindingInfo("data"));
683
679
  this.hasPendingTableChanges = false;
684
680
  }
685
681
  },
686
682
  handlers: {
687
683
  onTabMultiModeChange: function(oEvent) {
688
- this._updateTableControl();
689
- this._updateMultiTableHiddenStatus();
690
- var oFilterBar = this._getFilterBarControl();
691
- var oInternalModelContext = this.getView().getBindingContext("internal");
692
- var oDisplayedTable = this._getCurrentTable();
693
- var oMultiModeControl = this._getMultiModeControl();
694
- oInternalModelContext.setProperty("tabs/selected", oMultiModeControl.getSelectedKey());
695
- if (oFilterBar && oInternalModelContext.getProperty("hasPendingFilters") !== true) {
696
- // No pending filters into FitlerBar
697
- if (this._isCustomTab()) {
698
- var oFilterConditions = oFilterBar.getFilterConditions();
699
- this.onViewNeedsRefresh({
700
- filterConditions: oFilterConditions,
701
- currentTabId: oMultiModeControl.getSelectedKey(),
702
- refreshCause: "tabChanged"
703
- });
704
- } else if (
705
- !oDisplayedTable.getRowBinding() || // first time the tab/table is displayed
706
- oDisplayedTable.data("outdatedRows") === true
707
- ) {
708
- // Search has been triggered on a different tab {}
709
- oDisplayedTable.rebindTable();
710
- oDisplayedTable.data("outdatedRows", false);
684
+ if (oEvent && oEvent.mParameters && oEvent.mParameters.previousKey != oEvent.mParameters.selectedKey) {
685
+ this._updateMultiModeSelectedControl();
686
+ this._updateMultiControlHiddenStatus();
687
+ var oFilterBar = this._getFilterBarControl();
688
+ var oInternalModelContext = this.getView().getBindingContext("internal");
689
+ var oDisplayedControl = this._getCurrentControl();
690
+ var oMultiModeControl = this._getMultiModeControl();
691
+ var sSelectedKey = oMultiModeControl.getSelectedKey();
692
+
693
+ oInternalModelContext.setProperty("tabs/selected", sSelectedKey);
694
+ if (oFilterBar && oInternalModelContext.getProperty("hasPendingFilters") !== true) {
695
+ // No pending filters into FilterBar
696
+ if (this._isCustomTab()) {
697
+ var oFilterConditions = oFilterBar.getFilterConditions();
698
+ this.onViewNeedsRefresh({
699
+ filterConditions: oFilterConditions,
700
+ currentTabId: sSelectedKey,
701
+ refreshCause: "tabChanged"
702
+ });
703
+ } else if (
704
+ !oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
705
+ (!oDisplayedControl.getRowBinding() || // first time the tab/table is displayed
706
+ oDisplayedControl.data("outdatedRows") === true)
707
+ ) {
708
+ // Search has been triggered on a different tab {}
709
+ oDisplayedControl.rebindTable();
710
+ oDisplayedControl.data("outdatedRows", false);
711
+ } else if (
712
+ oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
713
+ (!oDisplayedControl
714
+ .getControlDelegate()
715
+ ._getChart(oDisplayedControl)
716
+ .getBinding("data") || // first time the tab/chart is displayed
717
+ oDisplayedControl.data("outdatedRows") === true)
718
+ ) {
719
+ var oInnerChart = oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl);
720
+ oDisplayedControl.getControlDelegate().rebindChart(oDisplayedControl, oInnerChart.getBindingInfo("data"));
721
+ oDisplayedControl.data("outdatedRows", false);
722
+ }
711
723
  }
724
+ /* Need to disable it because of IconTabBar regression : BCP 2170302705
725
+ var sPreviousSelectedKey = oEvent && oEvent.mParameters ? oEvent.mParameters.previousKey : undefined;
726
+
727
+ ControlPersonalizationWriteAPI.add({
728
+ changes: [
729
+ {
730
+ changeSpecificData: {
731
+ changeType: "selectIconTabBarFilter",
732
+ content: {
733
+ selectedKey: sSelectedKey,
734
+ previousSelectedKey: sPreviousSelectedKey
735
+ }
736
+ },
737
+ selectorElement: oMultiModeControl
738
+ }
739
+ ]
740
+ });
741
+ */
742
+ this.getExtensionAPI().updateAppState();
712
743
  }
713
- this.getExtensionAPI().updateAppState();
714
744
  },
715
745
  onFiltersChanged: function(oEvent) {
716
- var oFilterBar = oEvent.getSource(),
746
+ var oFilterBar = this._getFilterBarControl(),
717
747
  oInternalModelContext = this.getView().getBindingContext("internal");
718
- // Pending filters into FitlerBar to be used for custom views
748
+ // Pending filters into FilterBar to be used for custom views
719
749
  this.onPendingFilters();
720
750
  oInternalModelContext.setProperty("appliedFilters", oFilterBar.getAssignedFiltersText().filtersText);
721
751
  oInternalModelContext.setProperty("hasPendingFilters", true);
@@ -728,6 +758,9 @@ sap.ui.define(
728
758
  oVM = oEvent.getSource();
729
759
  // setTimeout cause the variant needs to be applied before judging the auto search or updating the app state
730
760
  setTimeout(function() {
761
+ if (that._isMultiMode()) {
762
+ that.handlers.onTabMultiModeChange.apply(that);
763
+ }
731
764
  if (that._shouldAutoTriggerSearch(oVM)) {
732
765
  // the app state will be updated via onSearch handler
733
766
  return that._getFilterBarControl().triggerSearch();
@@ -745,24 +778,28 @@ sap.ui.define(
745
778
  },
746
779
  onSearch: function(oEvent) {
747
780
  var that = this;
748
- var oFilterBar = oEvent.getSource();
781
+ var oFilterBar = this._getFilterBarControl();
749
782
  var oInternalModelContext = this.getView().getBindingContext("internal");
750
783
  var oMdcChart = this.getChartControl();
784
+ var bHideDraft = FilterUtils.getEditStateIsHideDraft(oFilterBar.getConditions());
751
785
  oInternalModelContext.setProperty("hasPendingFilters", false);
786
+ oInternalModelContext.setProperty("hideDraftInfo", bHideDraft);
752
787
  if (this._isMultiMode()) {
753
- var aTables = this._getTables(),
788
+ var aControls = this._getControls(),
754
789
  oMultiModeControl = this._getMultiModeControl();
755
790
  if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true") {
756
791
  var aItems = oMultiModeControl.getItems();
757
792
  aItems.forEach(function(oItem) {
758
- oItem.data("outdatedCounts", true);
793
+ if (!oItem.getKey().indexOf("fe::Chart") > -1) {
794
+ oItem.data("outdatedCounts", true);
795
+ }
759
796
  });
760
797
  }
761
798
  if (!this._isCustomTab()) {
762
- var sDisplayedTableId = this._getCurrentTable().getId();
799
+ var sDisplayedControlId = this._getCurrentControl().getId();
763
800
  this._updateMultiNotApplicableFields(oInternalModelContext, oFilterBar);
764
- aTables.forEach(function(oTable) {
765
- oTable.data("outdatedRows", oTable.getId() !== sDisplayedTableId);
801
+ aControls.forEach(function(oControl) {
802
+ oControl.data("outdatedRows", oControl.getId() !== sDisplayedControlId);
766
803
  });
767
804
  } else {
768
805
  var oFilterConditions = oFilterBar.getFilterConditions();
@@ -801,40 +838,30 @@ sap.ui.define(
801
838
  }
802
839
  },
803
840
  /**
804
- * Triggers an outbound navigation on Chevron Press.
841
+ * Triggers an outbound navigation when a user chooses the chevron.
805
842
  *
806
843
  * @param {object} oController
807
844
  * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
808
- * @param {sap.ui.model.odata.v4.Context} oContext The context that contain the data for the target app
809
- * @returns {Promise} Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
845
+ * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
846
+ * @param {string} sCreatePath Create path when the chevron is created.
847
+ * @returns {Promise} Promise which is resolved once the navigation is triggered
810
848
  * @ui5-restricted
811
849
  * @final
812
850
  */
813
- onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext) {
814
- // TODO: remove this to directly use the intent based navigation controller in the macro.
815
- var oOutbounds = oController
816
- .getAppComponent()
817
- .getRoutingService()
818
- .getOutbounds(),
819
- oDisplayOutbound = oOutbounds[sOutboundTarget];
820
- if (oDisplayOutbound && oDisplayOutbound.semanticObject && oDisplayOutbound.action) {
821
- oContext = oContext && oContext.isA && oContext.isA("sap.ui.model.odata.v4.Context") ? [oContext] : oContext;
822
- oController._intentBasedNavigation.navigate(oDisplayOutbound.semanticObject, oDisplayOutbound.action, {
823
- navigationContexts: oContext
824
- });
825
-
826
- //TODO: check why returning a promise is required
827
- return Promise.resolve();
828
- } else {
829
- throw new Error("outbound target " + sOutboundTarget + " not found in cross navigation definition of manifest");
830
- }
851
+ onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext, sCreatePath) {
852
+ return oController._intentBasedNavigation.onChevronPressNavigateOutBound(
853
+ oController,
854
+ sOutboundTarget,
855
+ oContext,
856
+ sCreatePath
857
+ );
831
858
  },
832
859
  onChartSelectionChanged: function(oEvent) {
833
- var oMdcChart = oEvent.getSource(),
834
- oTable = this._getCurrentTable(),
835
- oDataContext = oEvent.getParameter("dataContext"),
860
+ var oMdcChart = oEvent.getSource().getContent(),
861
+ oTable = this._getTable(),
862
+ aData = oEvent.getParameter("data"),
836
863
  oInternalModelContext = this.getView().getBindingContext("internal");
837
- if (oDataContext && oDataContext.data) {
864
+ if (aData) {
838
865
  // update action buttons enablement / disablement
839
866
  ChartRuntime.fnUpdateChart(oEvent);
840
867
  // update selections on selection or deselection
@@ -853,8 +880,8 @@ sap.ui.define(
853
880
  var oInternalModelContext = this.getView().getBindingContext("internal");
854
881
  oInternalModelContext.setProperty("alpContentView", sSelectedKey);
855
882
  var oSegmentedButton;
856
- var oChart = this.getChartControl();
857
- var oTable = this._getCurrentTable();
883
+ var oChart = this._getChart();
884
+ var oTable = this._getTable();
858
885
  var oSegmentedButtonDelegate = {
859
886
  onAfterRendering: function() {
860
887
  var aItems = oSegmentedButton.getItems();
@@ -908,39 +935,35 @@ sap.ui.define(
908
935
  .setVisible(true);
909
936
  }
910
937
  },
911
- onVisualFilterDataReceived: function(oEvent) {
912
- var oVisualFilterBar = this._getFilterBarControl();
913
- var oVisualFilter = VisualFilterUtils.getVisualFilterControl(oVisualFilterBar, oEvent.getSource());
914
- var oInternalModelContext = this.getView().getBindingContext("internal");
915
- var sId = oVisualFilter.getId().split("fe::VisualFilter");
916
- var sChartId = "fe::VisualFilter" + sId[1];
917
- var oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.macros");
918
- var vUOM = oVisualFilter.data("uom");
919
- VisualFilterUtils.updateChartScaleFactorTitle(oVisualFilter, this.getView());
920
- if (oEvent.getParameter("error")) {
921
- var s18n = oResourceBundle.getText("M_VISUAL_FILTERS_ERROR_DATA_TEXT");
922
- VisualFilterUtils.applyOverLay(s18n, sChartId, this.getView());
923
- } else if (oEvent.getParameter("data")) {
924
- var oData = oEvent.getSource().getCurrentContexts();
925
- if (oData && oData.length === 0) {
926
- VisualFilterUtils.setNoDataMessage(sChartId, oResourceBundle, this.getView());
927
- } else {
928
- oInternalModelContext.setProperty(sChartId, {});
929
- }
930
- VisualFilterUtils.setMultiUOMMessage(oData, oVisualFilter, sChartId, oResourceBundle, this.getView());
931
- }
932
- if (vUOM && ((vUOM["ISOCurrency"] && vUOM["ISOCurrency"].$Path) || (vUOM["Unit"] && vUOM["Unit"].$Path))) {
933
- var oContexts = oEvent.getSource().getContexts();
934
- var oContextData = oContexts && oContexts[0].getObject();
935
- VisualFilterUtils.applyUOMToTitle(oVisualFilter, oContextData, this.getView());
938
+ onTableStateChanged: function(oEvent) {
939
+ if (this.bTestAppState) {
940
+ this.getExtensionAPI().updateAppState();
936
941
  }
937
942
  }
938
943
  },
939
944
  formatters: {
945
+ isDraftIndicatorVisible: function(
946
+ sPropertyPath,
947
+ sSemanticKeyHasDraftIndicator,
948
+ HasDraftEntity,
949
+ IsActiveEntity,
950
+ hideDraftInfo
951
+ ) {
952
+ if (
953
+ IsActiveEntity !== undefined &&
954
+ HasDraftEntity !== undefined &&
955
+ (!IsActiveEntity || HasDraftEntity) &&
956
+ !hideDraftInfo
957
+ ) {
958
+ return sPropertyPath === sSemanticKeyHasDraftIndicator;
959
+ } else {
960
+ return false;
961
+ }
962
+ },
940
963
  /**
941
- * Method to set the message text for the multi-EntitySet scenario when fields in the FilterBar need to be ignored.
964
+ * Method to set the message text for the multiple entity sets when fields in the FilterBar need to be ignored.
942
965
  *
943
- * @param {Array} aIgnoredFields Array of ignored fields in the FilterBar for the current tab (multi EntitySet scenario)
966
+ * @param {Array} aIgnoredFields Array of ignored fields in the FilterBar for the current tab (multiple entity sets)
944
967
  * @param {string} sTabTitle Tab title
945
968
  * @returns {string} Message text
946
969
  */
@@ -974,14 +997,6 @@ sap.ui.define(
974
997
  }
975
998
  }
976
999
  return sText;
977
- },
978
- scaleVisualFilterValue: function(oValue, scaleFactor) {
979
- if (scaleFactor) {
980
- var nScaledValue = VisualFilterUtils.getFormattedNumber(oValue, scaleFactor);
981
- return nScaledValue;
982
- } else {
983
- return oValue;
984
- }
985
1000
  }
986
1001
  }
987
1002
  });