@sapui5/sap.fe.templates 1.95.0 → 1.98.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 (105) hide show
  1. package/package.json +6 -3
  2. package/src/sap/fe/templates/.library +1 -1
  3. package/src/sap/fe/templates/AnalyticalListPage/Component.js +1 -1
  4. package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +3 -3
  5. package/src/sap/fe/templates/ListComponent.js +1 -1
  6. package/src/sap/fe/templates/ListReport/Component.js +1 -1
  7. package/src/sap/fe/templates/ListReport/ExtensionAPI.js +1 -1
  8. package/src/sap/fe/templates/ListReport/ListReport.view.xml +6 -4
  9. package/src/sap/fe/templates/ListReport/ListReportController.controller.js +136 -85
  10. package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +7 -3
  11. package/src/sap/fe/templates/ListReport/overrides/MassEdit.js +95 -0
  12. package/src/sap/fe/templates/ListReport/overrides/Share.js +37 -22
  13. package/src/sap/fe/templates/ListReport/overrides/ViewState.js +166 -33
  14. package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +23 -3
  15. package/src/sap/fe/templates/ObjectPage/Component.js +31 -18
  16. package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +16 -1
  17. package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +103 -88
  18. package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +235 -174
  19. package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +9 -1
  20. package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +1 -1
  21. package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -2
  22. package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +1 -1
  23. package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
  24. package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
  25. package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +1 -1
  26. package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +1 -1
  27. package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
  28. package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
  29. package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
  30. package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -1
  31. package/src/sap/fe/templates/ObjectPage/overrides/Share.js +89 -72
  32. package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +10 -6
  33. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +14 -11
  34. package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +26 -12
  35. package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +2 -2
  36. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +26 -16
  37. package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +5 -5
  38. package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +24 -5
  39. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +1 -4
  40. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +181 -0
  41. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
  42. package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
  43. package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +111 -8
  44. package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +88 -32
  45. package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +161 -144
  46. package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
  47. package/src/sap/fe/templates/RootContainer/view/Fcl.view.xml +2 -1
  48. package/src/sap/fe/templates/RootContainer/view/NavContainer.view.xml +1 -1
  49. package/src/sap/fe/templates/TableScroller.js +1 -1
  50. package/src/sap/fe/templates/controls/Chart.fragment.xml +6 -2
  51. package/src/sap/fe/templates/controls/Table.fragment.xml +2 -0
  52. package/src/sap/fe/templates/library.js +2 -2
  53. package/src/sap/fe/templates/messagebundle.properties +25 -2
  54. package/src/sap/fe/templates/messagebundle_ar.properties +1 -1
  55. package/src/sap/fe/templates/messagebundle_bg.properties +1 -1
  56. package/src/sap/fe/templates/messagebundle_ca.properties +1 -1
  57. package/src/sap/fe/templates/messagebundle_cs.properties +1 -1
  58. package/src/sap/fe/templates/messagebundle_cy.properties +1 -1
  59. package/src/sap/fe/templates/messagebundle_da.properties +1 -1
  60. package/src/sap/fe/templates/messagebundle_de.properties +1 -1
  61. package/src/sap/fe/templates/messagebundle_el.properties +1 -1
  62. package/src/sap/fe/templates/messagebundle_en.properties +1 -1
  63. package/src/sap/fe/templates/messagebundle_en_GB.properties +1 -1
  64. package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +2 -2
  65. package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +2 -2
  66. package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +2 -2
  67. package/src/sap/fe/templates/messagebundle_es.properties +9 -9
  68. package/src/sap/fe/templates/messagebundle_es_MX.properties +1 -1
  69. package/src/sap/fe/templates/messagebundle_et.properties +1 -1
  70. package/src/sap/fe/templates/messagebundle_fi.properties +1 -1
  71. package/src/sap/fe/templates/messagebundle_fr.properties +2 -2
  72. package/src/sap/fe/templates/messagebundle_fr_CA.properties +2 -2
  73. package/src/sap/fe/templates/messagebundle_hi.properties +1 -1
  74. package/src/sap/fe/templates/messagebundle_hr.properties +2 -2
  75. package/src/sap/fe/templates/messagebundle_hu.properties +1 -1
  76. package/src/sap/fe/templates/messagebundle_id.properties +1 -1
  77. package/src/sap/fe/templates/messagebundle_it.properties +1 -1
  78. package/src/sap/fe/templates/messagebundle_iw.properties +1 -1
  79. package/src/sap/fe/templates/messagebundle_ja.properties +2 -2
  80. package/src/sap/fe/templates/messagebundle_kk.properties +1 -1
  81. package/src/sap/fe/templates/messagebundle_ko.properties +1 -1
  82. package/src/sap/fe/templates/messagebundle_lt.properties +1 -1
  83. package/src/sap/fe/templates/messagebundle_lv.properties +1 -1
  84. package/src/sap/fe/templates/messagebundle_ms.properties +1 -1
  85. package/src/sap/fe/templates/messagebundle_nl.properties +1 -1
  86. package/src/sap/fe/templates/messagebundle_no.properties +2 -2
  87. package/src/sap/fe/templates/messagebundle_pl.properties +1 -1
  88. package/src/sap/fe/templates/messagebundle_pt.properties +1 -1
  89. package/src/sap/fe/templates/messagebundle_pt_PT.properties +1 -1
  90. package/src/sap/fe/templates/messagebundle_ro.properties +1 -1
  91. package/src/sap/fe/templates/messagebundle_ru.properties +1 -1
  92. package/src/sap/fe/templates/messagebundle_sh.properties +1 -1
  93. package/src/sap/fe/templates/messagebundle_sk.properties +1 -1
  94. package/src/sap/fe/templates/messagebundle_sl.properties +1 -1
  95. package/src/sap/fe/templates/messagebundle_sv.properties +1 -1
  96. package/src/sap/fe/templates/messagebundle_th.properties +1 -1
  97. package/src/sap/fe/templates/messagebundle_tr.properties +2 -2
  98. package/src/sap/fe/templates/messagebundle_uk.properties +1 -1
  99. package/src/sap/fe/templates/messagebundle_vi.properties +1 -1
  100. package/src/sap/fe/templates/messagebundle_zh_CN.properties +1 -1
  101. package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
  102. package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderImage.fragment.xml +0 -24
  103. package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
  104. package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
  105. package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.fe.templates",
3
- "version": "1.95.0",
3
+ "version": "1.98.0",
4
4
  "description": "SAPUI5 Library sap.fe.templates",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -8,14 +8,17 @@
8
8
  "scripts": {
9
9
  "build": "tsc -v && tsc --project tsconfig-build.json",
10
10
  "prepare-npm-sources": "babel target/npm-sources/src --out-dir target/npm-sources/src --extensions \".ts\" --config-file ../../.babelrc",
11
- "test": "echo 'nothing to do'"
11
+ "test": "jest --runInBand",
12
+ "test-refs": "jest --runInBand --config jest.config-refs.js",
13
+ "test-updateSnapshots": "jest --runInBand -u"
12
14
  },
13
15
  "keywords": [
14
16
  "sapui5",
15
17
  "ui5"
16
18
  ],
17
19
  "devDependencies": {
20
+ "ts-node": "^9.1.1",
18
21
  "@babel/cli": "^7.14.8",
19
- "@ui5/cli": "^2.10.0"
22
+ "@ui5/cli": "^2.14.0"
20
23
  }
21
24
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>SAP UI development toolkit for HTML5 (SAPUI5)
7
7
  (c) Copyright 2009-2021 SAP SE. All rights reserved
8
8
  </copyright>
9
- <version>1.95.0</version>
9
+ <version>1.98.0</version>
10
10
 
11
11
  <documentation>UI5 library: sap.fe.templates</documentation>
12
12
 
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
5
  sap.ui.define(
6
6
  ["sap/fe/templates/ListComponent"],
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
5
  // ---------------------------------------------------------------------------------------
6
6
  // Helper class used to help create content in the chart/item and fill relevant metadata
@@ -18,7 +18,7 @@ sap.ui.define(
18
18
  * data in chart and table must be synchronised. every
19
19
  * time the chart refreshes, the table must be refreshed too.
20
20
  */
21
- ChartDelegate.rebindChart = function(oMDCChart, oBindingInfo) {
21
+ ChartDelegate.rebind = function(oMDCChart, oBindingInfo) {
22
22
  // var oComponent = flUtils.getAppComponentForControl(oMDCChart);
23
23
  // var bIsSearchTriggered = oComponent.getAppStateHandler().getIsSearchTriggered();
24
24
  // workaround in place to prevent chart from loading when go button is present and initial load is false
@@ -26,7 +26,7 @@ sap.ui.define(
26
26
  var oInternalModelContext = oMDCChart.getBindingContext("pageInternal");
27
27
  var sTemplateContentView = oInternalModelContext.getProperty(oInternalModelContext.getPath() + "/alpContentView");
28
28
  if (!sTemplateContentView || sTemplateContentView !== "Table") {
29
- BaseChartDelegate.rebindChart(oMDCChart, oBindingInfo);
29
+ BaseChartDelegate.rebind(oMDCChart, oBindingInfo);
30
30
  }
31
31
  };
32
32
 
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
5
  sap.ui.define(
6
6
  ["sap/fe/core/TemplateComponent", "sap/fe/core/library"],
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
5
  sap.ui.define(
6
6
  ["sap/fe/templates/ListComponent"],
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
5
  sap.ui.define(["sap/fe/core/ExtensionAPI", "sap/fe/macros/filter/FilterUtils", "sap/fe/macros/chart/ChartUtils"], function(
6
6
  ExtensionAPI,
@@ -64,7 +64,7 @@
64
64
  <v:VariantManagement
65
65
  id="{= ID.generate([ ${converterContext>filterBarId}, 'VariantManagement']) }"
66
66
  unittest:id="listReportVMControlTest"
67
- for="{converterContext>filterBarId}"
67
+ for="{converterContext>variantManagement/targetControlIds}"
68
68
  showSetAsDefault="true"
69
69
  select=".handlers.onVariantSelected"
70
70
  save=".handlers.onVariantSaved"
@@ -101,7 +101,7 @@
101
101
  <v:VariantManagement
102
102
  id="{= ID.generate([ ${converterContext>filterBarId}, 'VariantManagement']) }"
103
103
  unittest:id="listReportVMControlTest"
104
- for="{converterContext>filterBarId}"
104
+ for="{converterContext>variantManagement/targetControlIds}"
105
105
  showSetAsDefault="true"
106
106
  select=".handlers.onVariantSelected"
107
107
  save=".handlers.onVariantSaved"
@@ -146,7 +146,7 @@
146
146
  </items>
147
147
  </SegmentedButton>
148
148
  </template:if>
149
- <macro:Share id="fe::Share" shortCutExists="true" visible="{= ${fclhelper>/} ? ${fclhelper>/showShareIcon} : true }" />
149
+ <macro:Share id="fe::Share" visible="{= ${fclhelper>/} ? ${fclhelper>/showShareIcon} : true }" />
150
150
  </f:actions>
151
151
  </f:DynamicPageTitle>
152
152
  </f:title>
@@ -157,10 +157,11 @@
157
157
  <macroInternal:FilterBar
158
158
  unittest:id="listReportFilterBarTest"
159
159
  id="{converterContext>filterBarId}"
160
+ _applyIdToContent="true"
160
161
  contextPath="{entityType>}"
161
162
  variantBackreference="{= CORE.getVariantBackReference(${viewData>}, ${converterContext>} )}"
162
163
  selectionFields="{filterBarContext>selectionFields}"
163
- filtersChanged=".handlers.onFiltersChanged"
164
+ filterChanged=".handlers.onFiltersChanged"
164
165
  filterConditions="{parts:[{path:'converterContext>filterConditions'}, {path:'entitySet>'}], formatter: 'FILTER.getFilterConditions'}"
165
166
  search=".handlers.onSearch"
166
167
  hideBasicSearch="{filterBarContext>hideBasicSearch}"
@@ -171,6 +172,7 @@
171
172
  suspendSelection="true"
172
173
  toggleControlId="{= ${converterContext>/filterLayout} === 'compactvisual' ? ID.generate([ ${converterContext>filterBarId}, 'LayoutToggle']) : undefined }"
173
174
  initialLayout="{= ${converterContext>/filterLayout} === 'compactvisual' ? ${converterContext>/filterInitialLayout} : undefined }"
175
+ stateChanged=".handlers.onStateChanged"
174
176
  />
175
177
  </VBox>
176
178
  </f:DynamicPageHeader>
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
5
 
6
6
  sap.ui.define(
@@ -34,7 +34,10 @@ sap.ui.define(
34
34
  "sap/fe/macros/CommonHelper",
35
35
  "sap/fe/core/controllerextensions/KPIManagement",
36
36
  "sap/fe/templates/TableScroller",
37
- "sap/fe/core/controllerextensions/Placeholder"
37
+ "sap/fe/core/controllerextensions/Placeholder",
38
+ "sap/ui/fl/write/api/ControlPersonalizationWriteAPI",
39
+ "sap/fe/core/controllerextensions/MassEdit",
40
+ "./overrides/MassEdit"
38
41
  ],
39
42
  function(
40
43
  PageController,
@@ -66,7 +69,10 @@ sap.ui.define(
66
69
  CommonHelper,
67
70
  KPIManagement,
68
71
  TableScroller,
69
- Placeholder
72
+ Placeholder,
73
+ ControlPersonalizationWriteAPI,
74
+ MassEdit,
75
+ MassEditOverrides
70
76
  ) {
71
77
  "use strict";
72
78
  var TemplateContentView = CoreLibrary.TemplateContentView,
@@ -116,6 +122,7 @@ sap.ui.define(
116
122
  viewState: ViewState.override(ViewStateOverrides),
117
123
  kpiManagement: KPIManagement,
118
124
  placeholder: Placeholder,
125
+ massEdit: MassEdit.override(MassEditOverrides),
119
126
 
120
127
  getExtensionAPI: function() {
121
128
  if (!this.extensionAPI) {
@@ -141,9 +148,11 @@ sap.ui.define(
141
148
  CommonUtils.addEventToBindingInfo(oControl, "dataRequested", oUpdateCounts);
142
149
  });
143
150
  }
151
+ //TODO: This is only a temporary approach and will be removed once app state behaviour is finalized.
144
152
 
145
153
  oInternalModelContext.setProperty("hasPendingFilters", true);
146
154
  oInternalModelContext.setProperty("appliedFilters", "");
155
+ oInternalModelContext.setProperty("hideDraftInfo", false);
147
156
  oInternalModelContext.setProperty("uom", {});
148
157
  oInternalModelContext.setProperty("scalefactor", {});
149
158
  oInternalModelContext.setProperty("scalefactorNumber", {});
@@ -168,12 +177,8 @@ sap.ui.define(
168
177
  .waitForRouteMatchBeforeNavigation();
169
178
 
170
179
  this._isMultiMode() && this._updateMultiControlHiddenStatus();
171
-
172
- FilterUtils.attachConditionHandling(this._getFilterBarControl());
173
180
  },
174
181
  onExit: function() {
175
- FilterUtils.detachConditionHandling(this._getFilterBarControl());
176
-
177
182
  delete this._sEntitySet;
178
183
  delete this.filterBarConditions;
179
184
  delete this._oListReportControl;
@@ -191,6 +196,10 @@ sap.ui.define(
191
196
  if (!this.sUpdateTimer) {
192
197
  this.sUpdateTimer = setTimeout(function() {
193
198
  oTableBinding.refresh();
199
+ if (that._isMultiMode()) {
200
+ that._setCountsOutDated();
201
+ that._updateCounts();
202
+ }
194
203
  delete that.sUpdateTimer;
195
204
  }, 0);
196
205
  }
@@ -244,22 +253,20 @@ sap.ui.define(
244
253
  });
245
254
  },
246
255
  onPageReady: function(mParameters) {
247
- var oLastFocusedControl = mParameters.lastFocusedControl;
248
- var oView = this.getView();
249
- // set the focus to the first action button, or to the first editable input if in editable mode
250
- if (oLastFocusedControl && oLastFocusedControl.controlId && oLastFocusedControl.focusInfo) {
251
- var oFocusControl = oView.byId(oLastFocusedControl.controlId);
252
- if (oFocusControl) {
253
- oFocusControl.applyFocusInfo(oLastFocusedControl.focusInfo);
256
+ // Enabling mandatory filter fields message dialog and focusing on them
257
+ if (mParameters.forceFocus) {
258
+ var oFilterBar = this._getFilterBarControl();
259
+
260
+ if (oFilterBar && !oFilterBar.getShowMessages()) {
261
+ oFilterBar.setShowMessages(true);
262
+ oFilterBar.setFocusOnFirstErroneousField();
254
263
  }
255
264
  }
256
265
 
257
- // Enabling mandatory filter fields message dialog and focusing on them
258
- var oFilterBar = this._getFilterBarControl();
259
- if (oFilterBar && !oFilterBar.getShowMessages()) {
260
- oFilterBar.setShowMessages(true);
261
- oFilterBar.setFocusOnFirstErroneousField();
262
- }
266
+ // Remove the handler on back navigation that displays Draft confirmation
267
+ this.getAppComponent()
268
+ .getShellServices()
269
+ .setBackNavigation(undefined);
263
270
  },
264
271
 
265
272
  /**
@@ -317,21 +324,18 @@ sap.ui.define(
317
324
  */
318
325
  _updateTableActions: function(aTables) {
319
326
  var aIBNActions = [];
320
- aTables.forEach(
321
- function(oTable) {
322
- aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
323
- TableUtils.getSemanticTargetsFromTable(this, oTable);
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
- }.bind(this)
334
- );
327
+ aTables.forEach(function(oTable) {
328
+ aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
329
+ // Update 'enabled' property of DataFieldForAction buttons on table toolbar
330
+ // The same is also performed on Table selectionChange event
331
+ var oInternalModelContext = oTable.getBindingContext("internal"),
332
+ oActionOperationAvailableMap = JSON.parse(
333
+ CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
334
+ ),
335
+ aSelectedContexts = oTable.getSelectedContexts();
336
+
337
+ CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
338
+ });
335
339
  CommonUtils.updateDataFieldForIBNButtonsVisibility(aIBNActions, this.getView());
336
340
  },
337
341
 
@@ -348,19 +352,14 @@ sap.ui.define(
348
352
  });
349
353
  },
350
354
  _getPageTitleInformation: function() {
351
- var that = this;
352
- return new Promise(function(resolve, reject) {
353
- var oTitleInfo = { title: "", subtitle: "", intent: "", icon: "" };
354
- oTitleInfo.title = that
355
- .getView()
356
- .getContent()[0]
357
- .data().ListReportTitle;
358
- oTitleInfo.subtitle = that
359
- .getView()
360
- .getContent()[0]
361
- .data().ListReportSubtitle;
362
- resolve(oTitleInfo);
363
- });
355
+ var oTitleInfo = { title: "", subtitle: "", intent: "", icon: "" };
356
+ oTitleInfo.title = this.getView()
357
+ .getContent()[0]
358
+ .data().ListReportTitle;
359
+ oTitleInfo.subtitle = this.getView()
360
+ .getContent()[0]
361
+ .data().ListReportSubtitle;
362
+ return oTitleInfo;
364
363
  },
365
364
  _getFilterBarControl: function() {
366
365
  return this.getView().byId(this._getFilterBarControlId());
@@ -413,6 +412,10 @@ sap.ui.define(
413
412
  return this._oListReportControl;
414
413
  },
415
414
  _getTable: function() {
415
+ if (this._isMultiMode()) {
416
+ var oControl = this._getCurrentControl();
417
+ return oControl && oControl.isA("sap.ui.mdc.Table") ? oControl : undefined;
418
+ }
416
419
  return this.getView().byId(this._getTableControlId());
417
420
  },
418
421
  _getChart: function() {
@@ -569,7 +572,10 @@ sap.ui.define(
569
572
  aCharts.forEach(function(oChart) {
570
573
  var sChartEntityPath = oChart.data("targetCollectionPath"),
571
574
  sChartEntitySet = sChartEntityPath.slice(1),
572
- sTabId = oChart.getParent().getKey(),
575
+ sTabId = oChart
576
+ .getParent()
577
+ .getParent()
578
+ .getKey(),
573
579
  sCacheKey = sChartEntitySet + "Chart";
574
580
  if (!mCache[sCacheKey]) {
575
581
  mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
@@ -584,10 +590,10 @@ sap.ui.define(
584
590
  this._getCurrentControl();
585
591
  },
586
592
  _updateCounts: function() {
587
- this._updateMutliModeCounts();
593
+ this._updateMultiModeCounts();
588
594
  },
589
595
  /**
590
- * Method to determine if a tab from the list report is a custom tab..
596
+ * Method to determine if a tab from the list report is a custom tab.
591
597
  *
592
598
  * @function
593
599
  * @name _isCustomTab
@@ -597,7 +603,18 @@ sap.ui.define(
597
603
  var oMultiModeControl = this._getMultiModeControl();
598
604
  return oMultiModeControl && oMultiModeControl.getSelectedKey().indexOf("::CustomTab::") > -1;
599
605
  },
600
- _updateMutliModeCounts: function() {
606
+ _setCountsOutDated: function() {
607
+ var oMultiModeControl = this._getMultiModeControl();
608
+ if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true") {
609
+ var aItems = oMultiModeControl.getItems();
610
+ aItems.forEach(function(oItem) {
611
+ if (!oItem.getKey().indexOf("fe::Chart") > -1) {
612
+ oItem.data("outdatedCounts", true);
613
+ }
614
+ });
615
+ }
616
+ },
617
+ _updateMultiModeCounts: function() {
601
618
  var that = this;
602
619
  var aBindingPromises = [];
603
620
  var oMultiModeControl = this._getMultiModeControl();
@@ -662,13 +679,14 @@ sap.ui.define(
662
679
  },
663
680
  _updateTable: function(oTable) {
664
681
  if (!oTable.isTableBound() || this.hasPendingChartChanges) {
665
- oTable.rebindTable();
682
+ oTable.rebind();
666
683
  this.hasPendingChartChanges = false;
667
684
  }
668
685
  },
669
686
  _updateChart: function(oChart) {
670
- if (!oChart.isInnerChartBound() || this.hasPendingTableChanges) {
671
- oChart.getControlDelegate().rebindChart(oChart, oChart.getBindingInfo("data"));
687
+ var oInnerChart = oChart.getControlDelegate()._getChart(oChart);
688
+ if (!(oInnerChart && oInnerChart.isBound("data")) || this.hasPendingTableChanges) {
689
+ oChart.getControlDelegate().rebind(oChart, oInnerChart.getBindingInfo("data"));
672
690
  this.hasPendingTableChanges = false;
673
691
  }
674
692
  },
@@ -676,18 +694,22 @@ sap.ui.define(
676
694
  onTabMultiModeChange: function(oEvent) {
677
695
  this._updateMultiModeSelectedControl();
678
696
  this._updateMultiControlHiddenStatus();
697
+
679
698
  var oFilterBar = this._getFilterBarControl();
680
699
  var oInternalModelContext = this.getView().getBindingContext("internal");
681
700
  var oDisplayedControl = this._getCurrentControl();
682
701
  var oMultiModeControl = this._getMultiModeControl();
683
- oInternalModelContext.setProperty("tabs/selected", oMultiModeControl.getSelectedKey());
702
+ var sSelectedKey = oMultiModeControl.getSelectedKey();
703
+ var sPreviousSelectedKey = oEvent && oEvent.mParameters ? oEvent.mParameters.previousKey : undefined;
704
+
705
+ oInternalModelContext.setProperty("tabs/selected", sSelectedKey);
684
706
  if (oFilterBar && oInternalModelContext.getProperty("hasPendingFilters") !== true) {
685
707
  // No pending filters into FilterBar
686
708
  if (this._isCustomTab()) {
687
709
  var oFilterConditions = oFilterBar.getFilterConditions();
688
710
  this.onViewNeedsRefresh({
689
711
  filterConditions: oFilterConditions,
690
- currentTabId: oMultiModeControl.getSelectedKey(),
712
+ currentTabId: sSelectedKey,
691
713
  refreshCause: "tabChanged"
692
714
  });
693
715
  } else if (
@@ -696,17 +718,38 @@ sap.ui.define(
696
718
  oDisplayedControl.data("outdatedRows") === true)
697
719
  ) {
698
720
  // Search has been triggered on a different tab {}
699
- oDisplayedControl.rebindTable();
721
+ oDisplayedControl.rebind();
700
722
  oDisplayedControl.data("outdatedRows", false);
701
723
  } else if (
702
724
  oDisplayedControl.isA("sap.ui.mdc.Chart") &&
703
- (!oDisplayedControl.getBinding("data") || // first time the tab/chart is displayed
725
+ (!oDisplayedControl
726
+ .getControlDelegate()
727
+ ._getChart(oDisplayedControl)
728
+ .getBinding("data") || // first time the tab/chart is displayed
704
729
  oDisplayedControl.data("outdatedRows") === true)
705
730
  ) {
706
- oDisplayedControl.getControlDelegate().rebindChart(oDisplayedControl, oDisplayedControl.getBindingInfo("data"));
731
+ var oInnerChart = oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl);
732
+ oDisplayedControl.getControlDelegate().rebind(oDisplayedControl, oInnerChart.getBindingInfo("data"));
707
733
  oDisplayedControl.data("outdatedRows", false);
708
734
  }
709
735
  }
736
+
737
+ if (oEvent && oEvent.mParameters && sPreviousSelectedKey != oEvent.mParameters.selectedKey) {
738
+ ControlPersonalizationWriteAPI.add({
739
+ changes: [
740
+ {
741
+ changeSpecificData: {
742
+ changeType: "selectIconTabBarFilter",
743
+ content: {
744
+ selectedKey: sSelectedKey,
745
+ previousSelectedKey: sPreviousSelectedKey
746
+ }
747
+ },
748
+ selectorElement: oMultiModeControl
749
+ }
750
+ ]
751
+ });
752
+ }
710
753
  this.getExtensionAPI().updateAppState();
711
754
  },
712
755
  onFiltersChanged: function(oEvent) {
@@ -715,9 +758,8 @@ sap.ui.define(
715
758
  // Pending filters into FilterBar to be used for custom views
716
759
  this.onPendingFilters();
717
760
  oInternalModelContext.setProperty("appliedFilters", oFilterBar.getAssignedFiltersText().filtersText);
718
- oInternalModelContext.setProperty("hasPendingFilters", true);
719
761
  if (oEvent.getParameter("conditionsBased")) {
720
- this.getExtensionAPI().updateAppState();
762
+ oInternalModelContext.setProperty("hasPendingFilters", true);
721
763
  }
722
764
  },
723
765
  onVariantSelected: function(oEvent) {
@@ -725,6 +767,9 @@ sap.ui.define(
725
767
  oVM = oEvent.getSource();
726
768
  // setTimeout cause the variant needs to be applied before judging the auto search or updating the app state
727
769
  setTimeout(function() {
770
+ if (that._isMultiMode()) {
771
+ that.handlers.onTabMultiModeChange.apply(that);
772
+ }
728
773
  if (that._shouldAutoTriggerSearch(oVM)) {
729
774
  // the app state will be updated via onSearch handler
730
775
  return that._getFilterBarControl().triggerSearch();
@@ -745,18 +790,13 @@ sap.ui.define(
745
790
  var oFilterBar = this._getFilterBarControl();
746
791
  var oInternalModelContext = this.getView().getBindingContext("internal");
747
792
  var oMdcChart = this.getChartControl();
793
+ var bHideDraft = FilterUtils.getEditStateIsHideDraft(oFilterBar.getConditions());
748
794
  oInternalModelContext.setProperty("hasPendingFilters", false);
795
+ oInternalModelContext.setProperty("hideDraftInfo", bHideDraft);
749
796
  if (this._isMultiMode()) {
750
797
  var aControls = this._getControls(),
751
798
  oMultiModeControl = this._getMultiModeControl();
752
- if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true") {
753
- var aItems = oMultiModeControl.getItems();
754
- aItems.forEach(function(oItem) {
755
- if (!oItem.getKey().indexOf("fe::Chart") > -1) {
756
- oItem.data("outdatedCounts", true);
757
- }
758
- });
759
- }
799
+ this._setCountsOutDated();
760
800
  if (!this._isCustomTab()) {
761
801
  var sDisplayedControlId = this._getCurrentControl().getId();
762
802
  this._updateMultiNotApplicableFields(oInternalModelContext, oFilterBar);
@@ -800,13 +840,13 @@ sap.ui.define(
800
840
  }
801
841
  },
802
842
  /**
803
- * Triggers an outbound navigation on Chevron Press.
843
+ * Triggers an outbound navigation when a user chooses the chevron.
804
844
  *
805
845
  * @param {object} oController
806
846
  * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
807
- * @param {sap.ui.model.odata.v4.Context} oContext The context that contain the data for the target app
808
- * @param {string} sCreatePath Create path in case of chevron create.
809
- * @returns {Promise} Promise which is resolved once the navigation is triggered (??? maybe only once finished?)
847
+ * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
848
+ * @param {string} sCreatePath Create path when the chevron is created.
849
+ * @returns {Promise} Promise which is resolved once the navigation is triggered
810
850
  * @ui5-restricted
811
851
  * @final
812
852
  */
@@ -819,11 +859,11 @@ sap.ui.define(
819
859
  );
820
860
  },
821
861
  onChartSelectionChanged: function(oEvent) {
822
- var oMdcChart = oEvent.getSource(),
862
+ var oMdcChart = oEvent.getSource().getContent(),
823
863
  oTable = this._getTable(),
824
- oDataContext = oEvent.getParameter("dataContext"),
864
+ aData = oEvent.getParameter("data"),
825
865
  oInternalModelContext = this.getView().getBindingContext("internal");
826
- if (oDataContext && oDataContext.data) {
866
+ if (aData) {
827
867
  // update action buttons enablement / disablement
828
868
  ChartRuntime.fnUpdateChart(oEvent);
829
869
  // update selections on selection or deselection
@@ -833,7 +873,7 @@ sap.ui.define(
833
873
  if (sTemplateContentView === TemplateContentView.Chart) {
834
874
  this.hasPendingChartChanges = true;
835
875
  } else {
836
- oTable && oTable.rebindTable();
876
+ oTable && oTable.rebind();
837
877
  this.hasPendingChartChanges = false;
838
878
  }
839
879
  },
@@ -896,20 +936,34 @@ sap.ui.define(
896
936
  )
897
937
  .setVisible(true);
898
938
  }
939
+ },
940
+ onStateChanged: function(oEvent) {
941
+ this.getExtensionAPI().updateAppState();
899
942
  }
900
943
  },
901
944
  formatters: {
902
- isDraftIndicatorVisible: function(sPropertyPath, sSemanticKeyHasDraftIndicator, HasDraftEntity, IsActiveEntity) {
903
- if (IsActiveEntity !== undefined && HasDraftEntity !== undefined && (!IsActiveEntity || HasDraftEntity)) {
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
+ ) {
904
958
  return sPropertyPath === sSemanticKeyHasDraftIndicator;
905
959
  } else {
906
960
  return false;
907
961
  }
908
962
  },
909
963
  /**
910
- * 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.
911
965
  *
912
- * @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)
913
967
  * @param {string} sTabTitle Tab title
914
968
  * @returns {string} Message text
915
969
  */
@@ -943,9 +997,6 @@ sap.ui.define(
943
997
  }
944
998
  }
945
999
  return sText;
946
- },
947
- compareTitleFromTableAndTab: function(headerVisible, tableTitle, tabTitle) {
948
- return this.commonFormatters.compareTitleFromTableAndTab(headerVisible, tableTitle, tabTitle, this);
949
1000
  }
950
1001
  }
951
1002
  });
@@ -1,8 +1,8 @@
1
1
  /*!
2
2
  * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
3
+ * (c) Copyright 2009-2022 SAP SE. All rights reserved.
4
4
  */
5
- sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
5
+ sap.ui.define(["sap/fe/core/CommonUtils", "sap/fe/macros/filter/FilterUtils"], function(CommonUtils, FilterUtils) {
6
6
  "use strict";
7
7
  return {
8
8
  adaptNavigationContext: function(oSelectionVariant, oTargetInfo) {
@@ -28,6 +28,10 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
28
28
  sRootPath,
29
29
  aParameters
30
30
  );
31
+ var oFilterBar = oController._getFilterBarControl();
32
+ var oFilterInfo = FilterUtils.getFilterInfo(oFilterBar, {
33
+ targetControl: oController._getTable()
34
+ }).filters;
31
35
  var oInternalModelContext = oView.getBindingContext("internal");
32
36
  var mTabs = oInternalModelContext.getProperty("tabs");
33
37
  // Do we need to exclude Fields (mutli tables mode)?
@@ -40,7 +44,7 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
40
44
  }
41
45
  }
42
46
  // TODO: move this also into the intent based navigation controller extension
43
- CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo);
47
+ CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo, oFilterInfo);
44
48
  delete oTargetInfo.propertiesWithoutConflict;
45
49
  }
46
50
  },