@sapui5/sap.fe.templates 1.93.3 → 1.96.2

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 (90) hide show
  1. package/package.json +2 -2
  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 +7 -5
  6. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +181 -197
  7. package/src/sap/fe/templates/ListReport/manifest.json +11 -1
  8. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +1 -1
  9. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +123 -26
  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 +0 -6
  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 +220 -157
  16. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +1 -1
  17. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -0
  18. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +2 -2
  19. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +22 -1
  20. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +16 -14
  21. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +20 -8
  22. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +14 -19
  23. package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +3 -3
  24. package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +1 -1
  25. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderContent.fragment.xml +34 -38
  26. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +8 -2
  27. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +8 -4
  28. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +60 -112
  29. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +62 -70
  30. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +9 -1
  31. package/src/sap/fe/templates/TableScroller.js +61 -0
  32. package/src/sap/fe/templates/controls/Chart.fragment.xml +11 -14
  33. package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +1 -1
  34. package/src/sap/fe/templates/controls/Table.fragment.xml +1 -0
  35. package/src/sap/fe/templates/library.js +1 -1
  36. package/src/sap/fe/templates/messagebundle.properties +1 -1
  37. package/src/sap/fe/templates/messagebundle_ar.properties +9 -5
  38. package/src/sap/fe/templates/messagebundle_bg.properties +8 -4
  39. package/src/sap/fe/templates/messagebundle_ca.properties +8 -4
  40. package/src/sap/fe/templates/messagebundle_cs.properties +7 -3
  41. package/src/sap/fe/templates/messagebundle_cy.properties +8 -4
  42. package/src/sap/fe/templates/messagebundle_da.properties +9 -5
  43. package/src/sap/fe/templates/messagebundle_de.properties +8 -4
  44. package/src/sap/fe/templates/messagebundle_el.properties +8 -4
  45. package/src/sap/fe/templates/messagebundle_en.properties +7 -3
  46. package/src/sap/fe/templates/messagebundle_en_GB.properties +7 -3
  47. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +7 -3
  48. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +7 -3
  49. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +7 -3
  50. package/src/sap/fe/templates/messagebundle_es.properties +8 -4
  51. package/src/sap/fe/templates/messagebundle_es_MX.properties +8 -4
  52. package/src/sap/fe/templates/messagebundle_et.properties +7 -3
  53. package/src/sap/fe/templates/messagebundle_fi.properties +8 -4
  54. package/src/sap/fe/templates/messagebundle_fr.properties +9 -5
  55. package/src/sap/fe/templates/messagebundle_fr_CA.properties +8 -4
  56. package/src/sap/fe/templates/messagebundle_hi.properties +8 -4
  57. package/src/sap/fe/templates/messagebundle_hr.properties +8 -4
  58. package/src/sap/fe/templates/messagebundle_hu.properties +9 -5
  59. package/src/sap/fe/templates/messagebundle_id.properties +10 -6
  60. package/src/sap/fe/templates/messagebundle_it.properties +8 -4
  61. package/src/sap/fe/templates/messagebundle_iw.properties +8 -4
  62. package/src/sap/fe/templates/messagebundle_ja.properties +8 -4
  63. package/src/sap/fe/templates/messagebundle_kk.properties +8 -4
  64. package/src/sap/fe/templates/messagebundle_ko.properties +8 -4
  65. package/src/sap/fe/templates/messagebundle_lt.properties +8 -4
  66. package/src/sap/fe/templates/messagebundle_lv.properties +8 -4
  67. package/src/sap/fe/templates/messagebundle_ms.properties +8 -4
  68. package/src/sap/fe/templates/messagebundle_nl.properties +8 -4
  69. package/src/sap/fe/templates/messagebundle_no.properties +9 -5
  70. package/src/sap/fe/templates/messagebundle_pl.properties +8 -4
  71. package/src/sap/fe/templates/messagebundle_pt.properties +8 -4
  72. package/src/sap/fe/templates/messagebundle_pt_PT.properties +8 -4
  73. package/src/sap/fe/templates/messagebundle_ro.properties +8 -4
  74. package/src/sap/fe/templates/messagebundle_ru.properties +9 -5
  75. package/src/sap/fe/templates/messagebundle_sh.properties +8 -4
  76. package/src/sap/fe/templates/messagebundle_sk.properties +8 -4
  77. package/src/sap/fe/templates/messagebundle_sl.properties +8 -4
  78. package/src/sap/fe/templates/messagebundle_sv.properties +8 -4
  79. package/src/sap/fe/templates/messagebundle_th.properties +9 -5
  80. package/src/sap/fe/templates/messagebundle_tr.properties +7 -3
  81. package/src/sap/fe/templates/messagebundle_uk.properties +7 -3
  82. package/src/sap/fe/templates/messagebundle_vi.properties +8 -4
  83. package/src/sap/fe/templates/messagebundle_zh_CN.properties +9 -5
  84. package/src/sap/fe/templates/messagebundle_zh_TW.properties +8 -4
  85. package/src/sap/fe/templates/ObjectPage/overrides/Routing.js +0 -20
  86. package/src/sap/fe/templates/ObjectPage/view/fragments/TitleAndSubtitle.fragment.xml +0 -24
  87. package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
  88. package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
  89. package/src/sap/fe/templates/controls/Paginator.control.xml +0 -22
  90. 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,29 @@ 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"
42
38
  ],
43
39
  function(
44
40
  PageController,
45
41
  SideEffects,
46
42
  EditFlow,
47
- FieldRuntime,
48
43
  Log,
49
44
  ObjectPath,
50
- SelectionVariant,
51
45
  CommonUtils,
52
46
  StateUtil,
53
47
  TableUtils,
54
- ResourceModel,
55
48
  InternalRouting,
56
49
  Device,
57
50
  IntentBasedNavigation,
@@ -61,20 +54,19 @@ sap.ui.define(
61
54
  ExtensionAPI,
62
55
  FilterUtils,
63
56
  ChartUtils,
64
- VisualFilterUtils,
65
57
  DelegateUtil,
66
58
  OverrideExecution,
67
59
  ViewState,
68
60
  ViewStateOverrides,
69
61
  EditFlowOverrides,
70
62
  EditState,
71
- JSONModel,
72
63
  CoreLibrary,
73
- SemanticDateOperators,
74
64
  Share,
75
65
  ShareOverrides,
76
66
  CommonHelper,
77
- KPIManagement
67
+ KPIManagement,
68
+ TableScroller,
69
+ Placeholder
78
70
  ) {
79
71
  "use strict";
80
72
  var TemplateContentView = CoreLibrary.TemplateContentView,
@@ -123,6 +115,7 @@ sap.ui.define(
123
115
  editFlow: EditFlow.override(EditFlowOverrides),
124
116
  viewState: ViewState.override(ViewStateOverrides),
125
117
  kpiManagement: KPIManagement,
118
+ placeholder: Placeholder,
126
119
 
127
120
  getExtensionAPI: function() {
128
121
  if (!this.extensionAPI) {
@@ -134,26 +127,28 @@ sap.ui.define(
134
127
  onInit: function() {
135
128
  PageController.prototype.onInit.apply(this);
136
129
  var that = this;
137
- var aTables = this._getTables();
130
+ var aControls = this._getControls();
138
131
  var oInternalModelContext = this.getView().getBindingContext("internal");
139
132
  if (that._isMultiMode()) {
140
133
  var oMultiModeTab = that._getMultiModeControl();
141
134
  oInternalModelContext.setProperty("tabs", {
142
135
  selected: oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey()
143
136
  });
144
- aTables.forEach(function(oTable) {
137
+ aControls.forEach(function(oControl) {
145
138
  var oUpdateCounts = function() {
146
139
  that._updateCounts();
147
140
  };
148
- TableUtils.addEventToBindingInfo(oTable, "dataRequested", oUpdateCounts);
141
+ CommonUtils.addEventToBindingInfo(oControl, "dataRequested", oUpdateCounts);
149
142
  });
150
143
  }
151
144
 
152
145
  oInternalModelContext.setProperty("hasPendingFilters", true);
153
146
  oInternalModelContext.setProperty("appliedFilters", "");
147
+ oInternalModelContext.setProperty("hideDraftInfo", false);
154
148
  oInternalModelContext.setProperty("uom", {});
155
149
  oInternalModelContext.setProperty("scalefactor", {});
156
150
  oInternalModelContext.setProperty("scalefactorNumber", {});
151
+ oInternalModelContext.setProperty("currency", {});
157
152
 
158
153
  if (this._hasMultiVisualizations()) {
159
154
  var alpContentView = this._getDefaultPath();
@@ -173,7 +168,7 @@ sap.ui.define(
173
168
  .getRouterProxy()
174
169
  .waitForRouteMatchBeforeNavigation();
175
170
 
176
- this._updateMultiTableHiddenStatus();
171
+ this._isMultiMode() && this._updateMultiControlHiddenStatus();
177
172
 
178
173
  FilterUtils.attachConditionHandling(this._getFilterBarControl());
179
174
  },
@@ -189,7 +184,7 @@ sap.ui.define(
189
184
  },
190
185
 
191
186
  _onAfterBinding: function() {
192
- var aTables = this._getTables();
187
+ var aTables = this._getControls("table");
193
188
  var that = this;
194
189
  if (EditState.isEditStateDirty()) {
195
190
  var oTableBinding = this._getTableBinding();
@@ -222,6 +217,10 @@ sap.ui.define(
222
217
  );
223
218
  },
224
219
 
220
+ onBeforeRendering: function() {
221
+ PageController.prototype.onBeforeRendering.apply(this);
222
+ },
223
+
225
224
  onAfterRendering: function(oEvent) {
226
225
  var that = this;
227
226
  this.getView()
@@ -229,7 +228,7 @@ sap.ui.define(
229
228
  .getResourceBundle()
230
229
  .then(function(response) {
231
230
  that.oResourceBundle = response;
232
- var aTables = that._getTables();
231
+ var aControls = that._getControls();
233
232
  var sEntitySet = that.getView().getViewData().entitySet;
234
233
  var sText = CommonUtils.getTranslatedText(
235
234
  "T_OP_TABLE_AND_CHART_NO_DATA_TEXT",
@@ -237,13 +236,9 @@ sap.ui.define(
237
236
  undefined,
238
237
  sEntitySet
239
238
  );
240
- aTables.forEach(function(oTable) {
241
- oTable.setNoDataText(sText);
239
+ aControls.forEach(function(oControl) {
240
+ oControl.setNoDataText(sText);
242
241
  });
243
- if (that._hasMultiVisualizations()) {
244
- var oChart = that.getChartControl();
245
- oChart.setNoDataText(sText);
246
- }
247
242
  })
248
243
  .catch(function(oError) {
249
244
  Log.error("Error while retrieving the resource bundle", oError);
@@ -264,7 +259,7 @@ sap.ui.define(
264
259
  var oFilterBar = this._getFilterBarControl();
265
260
  if (oFilterBar && !oFilterBar.getShowMessages()) {
266
261
  oFilterBar.setShowMessages(true);
267
- oFilterBar._setFocusOnFirstErroneousField();
262
+ oFilterBar.setFocusOnFirstErroneousField();
268
263
  }
269
264
  },
270
265
 
@@ -310,34 +305,31 @@ sap.ui.define(
310
305
  onPendingFilters: function() {},
311
306
  getCurrentEntitySet: function() {
312
307
  if (!this._sEntitySet) {
313
- var oTable = this._getCurrentTable();
314
- this._sEntitySet = oTable.data("targetCollectionPath").slice(1);
308
+ var oDisplayedControl = (this._isMultiMode() && this._getCurrentControl()) || this._getTable();
309
+ this._sEntitySet = oDisplayedControl.data("targetCollectionPath").slice(1);
315
310
  }
316
311
  return this._sEntitySet;
317
312
  },
318
313
 
319
314
  /**
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
315
+ * This method initiates the update of the enabled state of the DataFieldForAction and the visible state of the DataFieldForIBN buttons.
316
+ * @param aTables Array of tables in the list report
322
317
  * @private
323
318
  */
324
319
  _updateTableActions: function(aTables) {
325
320
  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
- );
321
+ aTables.forEach(function(oTable) {
322
+ aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
323
+ // Update 'enabled' property of DataFieldForAction buttons on table toolbar
324
+ // The same is also performed on Table selectionChange event
325
+ var oInternalModelContext = oTable.getBindingContext("internal"),
326
+ oActionOperationAvailableMap = JSON.parse(
327
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
328
+ ),
329
+ aSelectedContexts = oTable.getSelectedContexts();
330
+
331
+ CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
332
+ });
341
333
  CommonUtils.updateDataFieldForIBNButtonsVisibility(aIBNActions, this.getView());
342
334
  },
343
335
 
@@ -346,36 +338,12 @@ sap.ui.define(
346
338
  *
347
339
  * @function
348
340
  * @name sap.fe.templates.ListReport.ListReportController.controller#_scrollTablesToRow
349
- * @param {string} sRowPath The path of the table row context to be scrolled
341
+ * @param {string} sRowPath The path of the table row context to be scrolled to
350
342
  */
351
343
  _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
- }
344
+ this._getControls("table").forEach(function(oTable) {
345
+ TableScroller.scrollTableToRow(oTable, sRowPath);
346
+ });
379
347
  },
380
348
  _getPageTitleInformation: function() {
381
349
  var that = this;
@@ -400,9 +368,9 @@ sap.ui.define(
400
368
  },
401
369
  _getSegmentedButtonId: function(sControl) {
402
370
  if (sControl === "Chart") {
403
- return this.getChartControl().data("segmentedButtonId");
371
+ return this._getChart().data("segmentedButtonId");
404
372
  } else {
405
- return this._getCurrentTable().data("segmentedButtonId");
373
+ return this._getTable().data("segmentedButtonId");
406
374
  }
407
375
  },
408
376
  _getFilterBarControlId: function() {
@@ -435,39 +403,47 @@ sap.ui.define(
435
403
  .getContent()[0]
436
404
  .data("singleTableId");
437
405
  },
438
- _getCurrentTable: function() {
406
+ _getCurrentControl: function() {
439
407
  if (!this._oListReportControl) {
440
408
  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
- }
409
+ this._oListReportControl = this.getView().byId(oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey());
448
410
  }
449
411
  return this._oListReportControl;
450
412
  },
413
+ _getTable: function() {
414
+ if (this._isMultiMode()) {
415
+ var oControl = this._getCurrentControl();
416
+ return oControl && oControl.isA("sap.ui.mdc.Table") ? oControl : undefined;
417
+ }
418
+ return this.getView().byId(this._getTableControlId());
419
+ },
420
+ _getChart: function() {
421
+ return this.getView().byId(this._getChartControlId());
422
+ },
451
423
  _getTableBinding: function(sTableId) {
452
- var oTableControl = sTableId ? this.getView().byId(sTableId) : this._getCurrentTable(),
424
+ var oTableControl = sTableId ? this.getView().byId(sTableId) : this._getTable(),
453
425
  oBinding = oTableControl && oTableControl._getRowBinding();
454
426
 
455
427
  return oBinding;
456
428
  },
457
- _getTables: function() {
429
+ _getControls: function(sKey) {
458
430
  var that = this;
459
431
  if (this._isMultiMode()) {
460
- var aTables = [];
432
+ var aControls = [];
461
433
  var oTabMultiMode = this._getMultiModeControl();
462
434
  oTabMultiMode.getItems().forEach(function(oItem) {
463
- var oTable = that.getView().byId(oItem.getKey());
464
- if (oTable) {
465
- aTables.push(oTable);
435
+ var oControl = that.getView().byId(oItem.getKey());
436
+ if (sKey) {
437
+ if (oItem.getKey().indexOf("fe::" + sKey) > -1) {
438
+ oControl && aControls.push(oControl);
439
+ }
440
+ } else {
441
+ oControl && aControls.push(oControl);
466
442
  }
467
443
  });
468
- return aTables;
444
+ return aControls;
469
445
  }
470
- return [this._getCurrentTable()];
446
+ return sKey === "Chart" ? [this._getChart()] : [this._getTable()];
471
447
  },
472
448
  _getDefaultPath: function() {
473
449
  var defaultPath = this.getView()
@@ -557,27 +533,28 @@ sap.ui.define(
557
533
  * A temporary solution (if we find better workflow) is to set a customData and don't trigger
558
534
  * rebindTable if this customData is set to true.
559
535
  */
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);
536
+ _updateMultiControlHiddenStatus: function() {
537
+ var oDisplayedControl = this._getCurrentControl();
538
+ if (this._isMultiMode() && oDisplayedControl) {
539
+ var sDisplayControlId = oDisplayedControl.getId();
540
+ var aControls = this._getControls();
541
+ aControls.forEach(function(oControl) {
542
+ var sControlId = oControl.getId();
543
+ oControl.data("controlHidden", sControlId !== sDisplayControlId);
568
544
  });
569
545
  }
570
546
  },
571
547
  /**
572
- * Method to update Page local UI Model with Filter Bar not applicable fields (specific to Multi Tables scenario).
548
+ * 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
549
  *
574
- * @param {sap.ui.model.context} oInternalModelContext Internal Model Context
575
- * @param {sap.ui.mdc.FilterBar} oFilterBar MDC FilterBar
550
+ * @param {sap.ui.model.context} oInternalModelContext The internal model context
551
+ * @param {sap.ui.mdc.FilterBar} oFilterBar MDC filter bar
576
552
  */
577
553
  _updateMultiNotApplicableFields: function(oInternalModelContext, oFilterBar) {
578
554
  var mCache = {};
579
555
  var ignoredFields = {},
580
- aTables = this._getTables();
556
+ aTables = this._getControls("table"),
557
+ aCharts = this._getControls("Chart");
581
558
  aTables.forEach(function(oTable) {
582
559
  var sTableEntityPath = oTable.data("targetCollectionPath"),
583
560
  sTableEntitySet = sTableEntityPath.slice(1),
@@ -587,26 +564,39 @@ sap.ui.define(
587
564
  .getKey(),
588
565
  sCacheKey = sTableEntitySet + (oTable.data("enableAnalytics") === "true" ? "Analytical" : "Regular");
589
566
  if (!mCache[sCacheKey]) {
590
- mCache[sCacheKey] = FilterUtils.getNotApplicableFiltersForTable(oFilterBar, oTable);
567
+ mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oTable);
568
+ }
569
+ ignoredFields[sTabId] = mCache[sCacheKey];
570
+ });
571
+ aCharts.forEach(function(oChart) {
572
+ var sChartEntityPath = oChart.data("targetCollectionPath"),
573
+ sChartEntitySet = sChartEntityPath.slice(1),
574
+ sTabId = oChart
575
+ .getParent()
576
+ .getParent()
577
+ .getKey(),
578
+ sCacheKey = sChartEntitySet + "Chart";
579
+ if (!mCache[sCacheKey]) {
580
+ mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
591
581
  }
592
582
  ignoredFields[sTabId] = mCache[sCacheKey];
593
583
  });
594
584
  oInternalModelContext.setProperty("tabs/ignoredFields", ignoredFields);
595
585
  },
596
- _updateTableControl: function() {
586
+ _updateMultiModeSelectedControl: function() {
597
587
  this._sEntitySet = undefined;
598
588
  this._oListReportControl = undefined;
599
- this._getCurrentTable();
589
+ this._getCurrentControl();
600
590
  },
601
591
  _updateCounts: function() {
602
592
  this._updateMutliModeCounts();
603
593
  },
604
594
  /**
605
- * Method to determine if a tab from the list report is custom.
595
+ * Method to determine if a tab from the list report is a custom tab..
606
596
  *
607
597
  * @function
608
598
  * @name _isCustomTab
609
- * @returns {boolean} Determines if the tab is custom or not.
599
+ * @returns {boolean} Determines if the tab is a custom tab.
610
600
  */
611
601
  _isCustomTab: function() {
612
602
  var oMultiModeControl = this._getMultiModeControl();
@@ -617,15 +607,19 @@ sap.ui.define(
617
607
  var aBindingPromises = [];
618
608
  var oMultiModeControl = this._getMultiModeControl();
619
609
  if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true" && !this._isCustomTab()) {
620
- var oDisplayedTable = this._getCurrentTable();
621
- var sDisplayedTableId = oDisplayedTable.getId();
610
+ var oDisplayedControl = this._getCurrentControl();
611
+ var sDisplayedControlId = oDisplayedControl.getId();
622
612
  var aCompliantTabs = [];
623
613
  var aItems = oMultiModeControl.getItems();
624
614
  aItems.forEach(function(oItem) {
625
- var oTable = that.getView().byId(oItem.getKey());
626
- if (oTable && (oItem.data("outdatedCounts") || oTable.getId() === sDisplayedTableId)) {
615
+ var oControl = that.getView().byId(oItem.getKey());
616
+ if (
617
+ oControl &&
618
+ !oControl.isA("sap.ui.mdc.ChartNew") &&
619
+ (oItem.data("outdatedCounts") || oControl.getId() === sDisplayedControlId)
620
+ ) {
627
621
  aCompliantTabs.push({
628
- table: oTable,
622
+ control: oControl,
629
623
  item: oItem
630
624
  });
631
625
  }
@@ -633,10 +627,10 @@ sap.ui.define(
633
627
 
634
628
  aBindingPromises = aCompliantTabs.map(function(mTab) {
635
629
  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",
630
+ var oControl = mTab.control;
631
+ var oFilterInfos = TableUtils.getFiltersInfoForSV(oControl, mTab.item.data("selectionVariant"));
632
+ return TableUtils.getListBindingForCount(oControl, that.getView().getBindingContext(), {
633
+ batchGroupId: oControl.getId() === sDisplayedControlId ? oControl.data("batchGroupId") : "$auto",
640
634
  additionalFilters: oFilterInfos.filters
641
635
  });
642
636
  });
@@ -678,22 +672,23 @@ sap.ui.define(
678
672
  }
679
673
  },
680
674
  _updateChart: function(oChart) {
681
- if (!oChart.isInnerChartBound() || this.hasPendingTableChanges) {
682
- oChart.getControlDelegate().rebindChart(oChart, oChart.getBindingInfo("data"));
675
+ var oInnerChart = oChart.getControlDelegate()._getChart(oChart);
676
+ if (!(oInnerChart && oInnerChart.isBound("data")) || this.hasPendingTableChanges) {
677
+ oChart.getControlDelegate().rebindChart(oChart, oInnerChart.getBindingInfo("data"));
683
678
  this.hasPendingTableChanges = false;
684
679
  }
685
680
  },
686
681
  handlers: {
687
682
  onTabMultiModeChange: function(oEvent) {
688
- this._updateTableControl();
689
- this._updateMultiTableHiddenStatus();
683
+ this._updateMultiModeSelectedControl();
684
+ this._updateMultiControlHiddenStatus();
690
685
  var oFilterBar = this._getFilterBarControl();
691
686
  var oInternalModelContext = this.getView().getBindingContext("internal");
692
- var oDisplayedTable = this._getCurrentTable();
687
+ var oDisplayedControl = this._getCurrentControl();
693
688
  var oMultiModeControl = this._getMultiModeControl();
694
689
  oInternalModelContext.setProperty("tabs/selected", oMultiModeControl.getSelectedKey());
695
690
  if (oFilterBar && oInternalModelContext.getProperty("hasPendingFilters") !== true) {
696
- // No pending filters into FitlerBar
691
+ // No pending filters into FilterBar
697
692
  if (this._isCustomTab()) {
698
693
  var oFilterConditions = oFilterBar.getFilterConditions();
699
694
  this.onViewNeedsRefresh({
@@ -702,23 +697,37 @@ sap.ui.define(
702
697
  refreshCause: "tabChanged"
703
698
  });
704
699
  } else if (
705
- !oDisplayedTable.getRowBinding() || // first time the tab/table is displayed
706
- oDisplayedTable.data("outdatedRows") === true
700
+ !oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
701
+ (!oDisplayedControl.getRowBinding() || // first time the tab/table is displayed
702
+ oDisplayedControl.data("outdatedRows") === true)
707
703
  ) {
708
704
  // Search has been triggered on a different tab {}
709
- oDisplayedTable.rebindTable();
710
- oDisplayedTable.data("outdatedRows", false);
705
+ oDisplayedControl.rebindTable();
706
+ oDisplayedControl.data("outdatedRows", false);
707
+ } else if (
708
+ oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
709
+ (!oDisplayedControl
710
+ .getControlDelegate()
711
+ ._getChart(oDisplayedControl)
712
+ .getBinding("data") || // first time the tab/chart is displayed
713
+ oDisplayedControl.data("outdatedRows") === true)
714
+ ) {
715
+ var oInnerChart = oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl);
716
+ oDisplayedControl.getControlDelegate().rebindChart(oDisplayedControl, oInnerChart.getBindingInfo("data"));
717
+ oDisplayedControl.data("outdatedRows", false);
711
718
  }
712
719
  }
713
720
  this.getExtensionAPI().updateAppState();
714
721
  },
715
722
  onFiltersChanged: function(oEvent) {
716
- var oFilterBar = oEvent.getSource(),
723
+ var oFilterBar = this._getFilterBarControl(),
717
724
  oInternalModelContext = this.getView().getBindingContext("internal");
718
- // Pending filters into FitlerBar to be used for custom views
725
+ // Pending filters into FilterBar to be used for custom views
719
726
  this.onPendingFilters();
727
+ var bHideDraft = FilterUtils.getEditStateIsHideDraft(oFilterBar.getConditions());
720
728
  oInternalModelContext.setProperty("appliedFilters", oFilterBar.getAssignedFiltersText().filtersText);
721
729
  oInternalModelContext.setProperty("hasPendingFilters", true);
730
+ oInternalModelContext.setProperty("hideDraftInfo", bHideDraft);
722
731
  if (oEvent.getParameter("conditionsBased")) {
723
732
  this.getExtensionAPI().updateAppState();
724
733
  }
@@ -745,24 +754,26 @@ sap.ui.define(
745
754
  },
746
755
  onSearch: function(oEvent) {
747
756
  var that = this;
748
- var oFilterBar = oEvent.getSource();
757
+ var oFilterBar = this._getFilterBarControl();
749
758
  var oInternalModelContext = this.getView().getBindingContext("internal");
750
759
  var oMdcChart = this.getChartControl();
751
760
  oInternalModelContext.setProperty("hasPendingFilters", false);
752
761
  if (this._isMultiMode()) {
753
- var aTables = this._getTables(),
762
+ var aControls = this._getControls(),
754
763
  oMultiModeControl = this._getMultiModeControl();
755
764
  if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true") {
756
765
  var aItems = oMultiModeControl.getItems();
757
766
  aItems.forEach(function(oItem) {
758
- oItem.data("outdatedCounts", true);
767
+ if (!oItem.getKey().indexOf("fe::Chart") > -1) {
768
+ oItem.data("outdatedCounts", true);
769
+ }
759
770
  });
760
771
  }
761
772
  if (!this._isCustomTab()) {
762
- var sDisplayedTableId = this._getCurrentTable().getId();
773
+ var sDisplayedControlId = this._getCurrentControl().getId();
763
774
  this._updateMultiNotApplicableFields(oInternalModelContext, oFilterBar);
764
- aTables.forEach(function(oTable) {
765
- oTable.data("outdatedRows", oTable.getId() !== sDisplayedTableId);
775
+ aControls.forEach(function(oControl) {
776
+ oControl.data("outdatedRows", oControl.getId() !== sDisplayedControlId);
766
777
  });
767
778
  } else {
768
779
  var oFilterConditions = oFilterBar.getFilterConditions();
@@ -801,40 +812,30 @@ sap.ui.define(
801
812
  }
802
813
  },
803
814
  /**
804
- * Triggers an outbound navigation on Chevron Press.
815
+ * Triggers an outbound navigation when a user chooses the chevron.
805
816
  *
806
817
  * @param {object} oController
807
818
  * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
808
819
  * @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?)
820
+ * @param {string} sCreatePath Create path when the chevron is created.
821
+ * @returns {Promise} Promise which is resolved once the navigation is triggered
810
822
  * @ui5-restricted
811
823
  * @final
812
824
  */
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
- }
825
+ onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext, sCreatePath) {
826
+ return oController._intentBasedNavigation.onChevronPressNavigateOutBound(
827
+ oController,
828
+ sOutboundTarget,
829
+ oContext,
830
+ sCreatePath
831
+ );
831
832
  },
832
833
  onChartSelectionChanged: function(oEvent) {
833
- var oMdcChart = oEvent.getSource(),
834
- oTable = this._getCurrentTable(),
835
- oDataContext = oEvent.getParameter("dataContext"),
834
+ var oMdcChart = oEvent.getSource().getContent(),
835
+ oTable = this._getTable(),
836
+ aData = oEvent.getParameter("data"),
836
837
  oInternalModelContext = this.getView().getBindingContext("internal");
837
- if (oDataContext && oDataContext.data) {
838
+ if (aData) {
838
839
  // update action buttons enablement / disablement
839
840
  ChartRuntime.fnUpdateChart(oEvent);
840
841
  // update selections on selection or deselection
@@ -853,8 +854,8 @@ sap.ui.define(
853
854
  var oInternalModelContext = this.getView().getBindingContext("internal");
854
855
  oInternalModelContext.setProperty("alpContentView", sSelectedKey);
855
856
  var oSegmentedButton;
856
- var oChart = this.getChartControl();
857
- var oTable = this._getCurrentTable();
857
+ var oChart = this._getChart();
858
+ var oTable = this._getTable();
858
859
  var oSegmentedButtonDelegate = {
859
860
  onAfterRendering: function() {
860
861
  var aItems = oSegmentedButton.getItems();
@@ -907,36 +908,27 @@ sap.ui.define(
907
908
  )
908
909
  .setVisible(true);
909
910
  }
910
- },
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());
936
- }
937
911
  }
938
912
  },
939
913
  formatters: {
914
+ isDraftIndicatorVisible: function(
915
+ sPropertyPath,
916
+ sSemanticKeyHasDraftIndicator,
917
+ HasDraftEntity,
918
+ IsActiveEntity,
919
+ hideDraftInfo
920
+ ) {
921
+ if (
922
+ IsActiveEntity !== undefined &&
923
+ HasDraftEntity !== undefined &&
924
+ (!IsActiveEntity || HasDraftEntity) &&
925
+ !hideDraftInfo
926
+ ) {
927
+ return sPropertyPath === sSemanticKeyHasDraftIndicator;
928
+ } else {
929
+ return false;
930
+ }
931
+ },
940
932
  /**
941
933
  * Method to set the message text for the multi-EntitySet scenario when fields in the FilterBar need to be ignored.
942
934
  *
@@ -974,14 +966,6 @@ sap.ui.define(
974
966
  }
975
967
  }
976
968
  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
969
  }
986
970
  }
987
971
  });