@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
@@ -1,18 +1,20 @@
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
  [
7
7
  "sap/ui/model/json/JSONModel",
8
8
  "./RootContainerBaseController",
9
9
  "sap/fe/core/CommonUtils",
10
+ "sap/fe/core/helpers/KeepAliveHelper",
10
11
  "sap/fe/core/controllerextensions/ViewState",
11
12
  "sap/m/Link",
12
13
  "sap/m/MessagePage",
13
- "sap/m/MessageBox"
14
+ "sap/m/MessageBox",
15
+ "sap/base/Log"
14
16
  ],
15
- function(JSONModel, BaseController, CommonUtils, ViewState, Link, MessagePage, MessageBox) {
17
+ function(JSONModel, BaseController, CommonUtils, KeepAliveHelper, ViewState, Link, MessagePage, MessageBox, Log) {
16
18
  "use strict";
17
19
 
18
20
  /**
@@ -39,9 +41,43 @@ sap.ui.define(
39
41
  var oView = this.getView(),
40
42
  oController = oView.getController();
41
43
  aStateControls.push(oController._getCurrentPage(oView));
44
+ },
45
+ onRestore: function() {
46
+ var oView = this.getView(),
47
+ oNavContainer = oView.byId("appContent");
48
+ var oInternalModel = oNavContainer.getModel("internal");
49
+ var oPages = oInternalModel.getProperty("/pages");
50
+
51
+ for (var sComponentId in oPages) {
52
+ oInternalModel.setProperty("/pages/" + sComponentId + "/restoreStatus", "pending");
53
+ }
54
+ },
55
+ onSuspend: function() {
56
+ var oView = this.getView(),
57
+ oNavContainer = oView.byId("appContent");
58
+ var aPages = oNavContainer.getPages();
59
+ aPages.forEach(function(oPage) {
60
+ var oTargetView = CommonUtils.getTargetView(oPage);
61
+
62
+ var oController = oTargetView && oTargetView.getController();
63
+ if (oController && oController.viewState && oController.viewState.onSuspend) {
64
+ return oController.viewState.onSuspend();
65
+ }
66
+ });
42
67
  }
43
68
  }),
44
69
 
70
+ onContainerReady: function() {
71
+ // Restore views if neccessary.
72
+ var oView = this.getView(),
73
+ oPagePromise = this._getCurrentPage(oView);
74
+
75
+ return oPagePromise.then(function(oCurrentPage) {
76
+ var oTargetView = CommonUtils.getTargetView(oCurrentPage);
77
+ return KeepAliveHelper.restoreView(oTargetView);
78
+ });
79
+ },
80
+
45
81
  _getCurrentPage: function(oView) {
46
82
  return new Promise(function(resolve) {
47
83
  var oNavContainer = oView.byId("appContent");
@@ -92,40 +128,60 @@ sap.ui.define(
92
128
  _scrollTablesToLastNavigatedItems: function() {},
93
129
 
94
130
  displayMessagePage: function(sErrorMessage, mParameters) {
95
- var oNavContainer = this._getNavContainer();
131
+ return new Promise(
132
+ function(resolve, reject) {
133
+ try {
134
+ var oNavContainer = this._getNavContainer();
96
135
 
97
- if (!this.oMessagePage) {
98
- this.oMessagePage = new MessagePage({
99
- showHeader: false,
100
- icon: "sap-icon://message-error"
101
- });
136
+ if (!this.oMessagePage) {
137
+ this.oMessagePage = new MessagePage({
138
+ showHeader: false,
139
+ icon: "sap-icon://message-error"
140
+ });
102
141
 
103
- oNavContainer.addPage(this.oMessagePage);
104
- }
142
+ oNavContainer.addPage(this.oMessagePage);
143
+ }
105
144
 
106
- this.oMessagePage.setText(sErrorMessage);
107
-
108
- if (mParameters.technicalMessage) {
109
- this.oMessagePage.setCustomDescription(
110
- new Link({
111
- text: mParameters.description || mParameters.technicalMessage,
112
- press: function() {
113
- MessageBox.show(mParameters.technicalMessage, {
114
- icon: MessageBox.Icon.ERROR,
115
- title: mParameters.title,
116
- actions: [MessageBox.Action.OK],
117
- defaultAction: MessageBox.Action.OK,
118
- details: mParameters.technicalDetails || "",
119
- contentWidth: "60%"
120
- });
145
+ this.oMessagePage.setText(sErrorMessage);
146
+
147
+ if (mParameters.technicalMessage) {
148
+ this.oMessagePage.setCustomDescription(
149
+ new Link({
150
+ text: mParameters.description || mParameters.technicalMessage,
151
+ press: function() {
152
+ MessageBox.show(mParameters.technicalMessage, {
153
+ icon: MessageBox.Icon.ERROR,
154
+ title: mParameters.title,
155
+ actions: [MessageBox.Action.OK],
156
+ defaultAction: MessageBox.Action.OK,
157
+ details: mParameters.technicalDetails || "",
158
+ contentWidth: "60%"
159
+ });
160
+ }
161
+ })
162
+ );
163
+ } else {
164
+ this.oMessagePage.setDescription(mParameters.description || "");
121
165
  }
122
- })
123
- );
124
- } else {
125
- this.oMessagePage.setDescription(mParameters.description || "");
126
- }
127
166
 
128
- oNavContainer.to(this.oMessagePage.getId());
167
+ if (mParameters.handleShellBack) {
168
+ var oErrorOriginPage = oNavContainer.getCurrentPage(),
169
+ oAppComponent = CommonUtils.getAppComponent(oNavContainer.getCurrentPage());
170
+ oAppComponent.getShellServices().setBackNavigation(function() {
171
+ oNavContainer.to(oErrorOriginPage.getId());
172
+ oAppComponent.getShellServices().setBackNavigation();
173
+ });
174
+ }
175
+ oNavContainer.attachAfterNavigate(function() {
176
+ resolve(true);
177
+ });
178
+ oNavContainer.to(this.oMessagePage.getId());
179
+ } catch (e) {
180
+ reject(false);
181
+ Log.info(e);
182
+ }
183
+ }.bind(this)
184
+ );
129
185
  }
130
186
  });
131
187
  },
@@ -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
  [
@@ -53,12 +53,12 @@ sap.ui.define(
53
53
  this.oPlaceholder.attachRouteMatchers();
54
54
  this.getAppComponent()
55
55
  .getRoutingService()
56
- .attachAfterRouteMatched(this.shellTitleHandler, this);
56
+ .attachAfterRouteMatched(this._onAfterRouteMatched, this);
57
57
  },
58
58
  onExit: function() {
59
59
  this.getAppComponent()
60
60
  .getRoutingService()
61
- .detachAfterRouteMatched(this.shellTitleHandler, this);
61
+ .detachAfterRouteMatched(this._onAfterRouteMatched, this);
62
62
  this.oRouter = null;
63
63
 
64
64
  SizeHelper.exit();
@@ -132,42 +132,48 @@ sap.ui.define(
132
132
  },
133
133
 
134
134
  /**
135
- * This function is updating the shell title after each navigation.
135
+ * Callback when the navigation is done.
136
+ * - update the shell title.
137
+ * - update table scroll.
138
+ * - call onPageReady on the rightMostView.
136
139
  *
137
140
  * @param oEvent
138
- * @name sap.fe.templates.RootContainer.controller.BaseController#shellTitleHandler
141
+ * @name sap.fe.templates.RootContainer.controller.BaseController#_onAfterRouteMatched
139
142
  * @memberof sap.fe.templates.RootContainer.controller.BaseController
140
143
  */
141
- shellTitleHandler: function(oEvent) {
144
+ _onAfterRouteMatched: function(oEvent) {
142
145
  var that = this;
143
- if (!that.oShellTitlePromise) {
144
- that.oShellTitlePromise = that
146
+ if (!that._oRouteMatchedPromise) {
147
+ that._oRouteMatchedPromise = that
145
148
  .waitForRightMostViewReady(oEvent)
146
149
  .then(function(oView) {
150
+ // The autoFocus is initially disabled on the navContainer or the FCL, so that the focus stays on the Shell menu
151
+ // even if the app takes a long time to launch
152
+ // The first time the view is displayed, we need to enable the autofocus so that it's managed properly during navigation
153
+ var oRootControl = that.getView().getContent()[0];
154
+ if (oRootControl && oRootControl.getAutoFocus && !oRootControl.getAutoFocus()) {
155
+ oRootControl.setProperty("autoFocus", true, true); // Do not mark the container as invalid, otherwise it's re-rendered
156
+ }
157
+
147
158
  var oAppComponent = that.getAppComponent();
148
- var oData = { oView: oView, oAppComponent: oAppComponent };
149
159
  that._scrollTablesToLastNavigatedItems();
150
160
  if (oAppComponent.getEnvironmentCapabilities().getCapabilities().UShell) {
151
- that.computeTitleHierarchy(oData);
161
+ that._computeTitleHierarchy(oView);
162
+ }
163
+ var bForceFocus = oAppComponent.getRouterProxy().isFocusForced();
164
+ oAppComponent.getRouterProxy().setFocusForced(false); // reset
165
+ if (oView.getController() && oView.getController().onPageReady && oView.getParent().onPageReady) {
166
+ oView.getParent().onPageReady({ forceFocus: bForceFocus });
152
167
  }
153
- var oLastFocusedControl = oAppComponent.getRouterProxy().getFocusControlForCurrentHash();
154
- if (oView.getController() && oView.getController().onPageReady) {
155
- if (oLastFocusedControl) {
156
- oView.getParent().onPageReady({ lastFocusedControl: oLastFocusedControl });
157
- } else {
158
- var currentFocusedControlId = sap.ui.getCore().getCurrentFocusedControlId();
159
- var oCurrentFocusedControl = {
160
- controlId: currentFocusedControlId,
161
- focusInfo: { id: currentFocusedControlId }
162
- };
163
- oView.getParent().onPageReady({ lastFocusedControl: oCurrentFocusedControl });
164
- }
168
+ if (that.onContainerReady) {
169
+ that.onContainerReady();
165
170
  }
166
- that.oShellTitlePromise = null;
167
171
  })
168
172
  .catch(function(oError) {
169
173
  Log.error("An error occurs while computing the title hierarchy and calling focus method", oError);
170
- that.oShellTitlePromise = null;
174
+ })
175
+ .finally(function() {
176
+ that._oRouteMatchedPromise = null;
171
177
  });
172
178
  }
173
179
  },
@@ -175,12 +181,12 @@ sap.ui.define(
175
181
  /**
176
182
  * This function returns the TitleHierarchy cache ( or initializes it if undefined).
177
183
  *
178
- * @name sap.fe.templates.RootContainer.controller.BaseController#getTitleHierarchyCache
184
+ * @name sap.fe.templates.RootContainer.controller.BaseController#_getTitleHierarchyCache
179
185
  * @memberof sap.fe.templates.RootContainer.controller.BaseController
180
186
  *
181
187
  * @returns {object} The TitleHierarchy cache
182
188
  */
183
- getTitleHierarchyCache: function() {
189
+ _getTitleHierarchyCache: function() {
184
190
  if (!this.oTitleHierarchyCache) {
185
191
  this.oTitleHierarchyCache = {};
186
192
  }
@@ -212,53 +218,86 @@ sap.ui.define(
212
218
  },
213
219
 
214
220
  /**
215
- * This function is updating the cache to store Title Information
216
- *
217
- * @name sap.fe.templates.RootContainer.controller.BaseController#addNewEntryINCacheTitle
218
- * @memberof sap.fe.templates.RootContainer.controller.BaseController
219
- * @param {*} sPath path of the context to retrieve title information from MetaModel
220
- * @param {*} oAppComponent reference to the oAppComponent
221
+ * Fetches the value of the HeaderInfo title for a given path.
221
222
  *
222
- * @returns {promise} oTitleinformation returned as promise
223
+ * @param {string} sPath The path to the entity
224
+ * @returns {Promise} A promise containing the value of the title, or an empty string if no HeaderInfo title annotation is available
223
225
  */
226
+ _fetchTitleValue: function(sPath) {
227
+ var oAppComponent = this.getAppComponent(),
228
+ oModel = this.getView().getModel(),
229
+ oMetaModel = oAppComponent.getMetaModel(),
230
+ sMetaPath = oMetaModel.getMetaPath(sPath);
224
231
 
225
- addNewEntryInCacheTitle: function(sPath, oAppComponent) {
226
- var oTitleModel = this.getView().getModel();
227
- var that = this;
228
- var sEntityPath = sPath.replace(/ *\([^)]*\) */g, "");
229
232
  var sTitleExpression = AnnotationHelper.format(
230
- oAppComponent.getMetaModel().getProperty(sEntityPath + "/@com.sap.vocabularies.UI.v1.HeaderInfo/Title/Value"),
231
- { context: oAppComponent.getMetaModel().createBindingContext("/") }
233
+ oMetaModel.getProperty(sMetaPath + "/@com.sap.vocabularies.UI.v1.HeaderInfo/Title/Value"),
234
+ { context: oMetaModel.createBindingContext("/") }
232
235
  );
233
236
  var oTitleExpression = BindingParser.complexParser(sTitleExpression);
234
- var sTypeName = oAppComponent.getMetaModel().getProperty(sEntityPath + "/@com.sap.vocabularies.UI.v1.HeaderInfo/TypeName");
235
- var oBindingViewContext = oTitleModel.createBindingContext(sPath);
237
+
236
238
  if (oTitleExpression) {
237
239
  var sTitlePath = oTitleExpression.parts ? oTitleExpression.parts[0].path : oTitleExpression.path;
238
240
  var fnTitleFormatter = oTitleExpression.formatter;
239
- var oPropertyBinding = oTitleModel.bindProperty(sTitlePath, oBindingViewContext);
241
+ var oBindingViewContext = oModel.createBindingContext(sPath);
242
+ var oPropertyBinding = oModel.bindProperty(sTitlePath, oBindingViewContext);
243
+
240
244
  oPropertyBinding.initialize();
241
- }
242
- return new Promise(function(resolve, reject) {
243
- var sAppSpecificHash = HashChanger.getInstance().hrefForAppSpecificHash
244
- ? HashChanger.getInstance().hrefForAppSpecificHash("")
245
- : "";
246
- var sIntent = sAppSpecificHash + sPath.slice(1);
247
- var oTitleHierarchyCache = that.getTitleHierarchyCache();
248
- var fnChange = function(oEvent) {
249
- var sTargetValue = fnTitleFormatter
250
- ? fnTitleFormatter(oEvent.getSource().getValue())
251
- : oEvent.getSource().getValue();
252
- oTitleHierarchyCache[sPath] = that._computeTitleInfo(sTypeName, sTargetValue, sIntent);
253
- resolve(oTitleHierarchyCache[sPath]);
254
- oPropertyBinding.detachChange(fnChange);
255
- };
256
- if (oPropertyBinding) {
245
+
246
+ return new Promise(function(resolve) {
247
+ var fnChange = function(oEvent) {
248
+ var sTargetValue = fnTitleFormatter
249
+ ? fnTitleFormatter(oEvent.getSource().getValue())
250
+ : oEvent.getSource().getValue();
251
+
252
+ oPropertyBinding.detachChange(fnChange);
253
+ resolve(sTargetValue);
254
+ };
255
+
257
256
  oPropertyBinding.attachChange(fnChange);
258
- } else {
259
- oTitleHierarchyCache[sPath] = that._computeTitleInfo(sTypeName, "", sIntent);
260
- resolve(oTitleHierarchyCache[sPath]);
261
- }
257
+ });
258
+ } else {
259
+ return Promise.resolve("");
260
+ }
261
+ },
262
+
263
+ _getAppSpecificHash: function() {
264
+ return HashChanger.getInstance().hrefForAppSpecificHash ? HashChanger.getInstance().hrefForAppSpecificHash("") : "";
265
+ },
266
+
267
+ _getHash: function() {
268
+ return HashChanger.getInstance().getHash();
269
+ },
270
+
271
+ /**
272
+ * This function returns titleInformation from a path.
273
+ * It updates the cache to store Title Information if necessary
274
+ *
275
+ * @name sap.fe.templates.RootContainer.controller.BaseController#getTitleInfoFromPath
276
+ * @memberof sap.fe.templates.RootContainer.controller.BaseController
277
+ * @param {*} sPath path of the context to retrieve title information from MetaModel
278
+ *
279
+ * @returns {promise} oTitleinformation returned as promise
280
+ */
281
+
282
+ getTitleInfoFromPath: function(sPath) {
283
+ var oTitleHierarchyCache = this._getTitleHierarchyCache();
284
+
285
+ if (oTitleHierarchyCache[sPath]) {
286
+ // The title info is already stored in the cache
287
+ return Promise.resolve(oTitleHierarchyCache[sPath]);
288
+ }
289
+
290
+ var oMetaModel = this.getAppComponent().getMetaModel();
291
+ var that = this;
292
+ var sEntityPath = oMetaModel.getMetaPath(sPath);
293
+ var sTypeName = oMetaModel.getProperty(sEntityPath + "/@com.sap.vocabularies.UI.v1.HeaderInfo/TypeName");
294
+ var sAppSpecificHash = this._getAppSpecificHash();
295
+ var sIntent = sAppSpecificHash + sPath.slice(1);
296
+
297
+ return this._fetchTitleValue(sPath).then(function(sTitle) {
298
+ var oTitleInfo = that._computeTitleInfo(sTypeName, sTitle, sIntent);
299
+ oTitleHierarchyCache[sPath] = oTitleInfo;
300
+ return oTitleInfo;
262
301
  });
263
302
  },
264
303
  /**
@@ -274,7 +313,7 @@ sap.ui.define(
274
313
  * @param {*} aHierarchy Shell title hierarchy
275
314
  * @returns {*} Copy of shell title hierarchy containing all elements as strings
276
315
  */
277
- ensureHierarchyElementsAreStrings: function(aHierarchy) {
316
+ _ensureHierarchyElementsAreStrings: function(aHierarchy) {
278
317
  var aHierarchyShell = [];
279
318
  for (var level in aHierarchy) {
280
319
  var oHierarchy = aHierarchy[level];
@@ -287,113 +326,91 @@ sap.ui.define(
287
326
  return aHierarchyShell;
288
327
  },
289
328
 
329
+ _getTargetTypeFromHash: function(sHash) {
330
+ var oAppComponent = this.getAppComponent();
331
+ var sTargetType = "";
332
+
333
+ var aRoutes = oAppComponent.getManifestEntry("/sap.ui5/routing/routes");
334
+ for (var j = 0; j < aRoutes.length; j++) {
335
+ var oRoute = oAppComponent.getRouter().getRoute(aRoutes[j].name);
336
+ if (oRoute.match(sHash)) {
337
+ var sTarget = Array.isArray(aRoutes[j].target) ? aRoutes[j].target[0] : aRoutes[j].target;
338
+ sTargetType = oAppComponent.getRouter().getTarget(sTarget)._oOptions.name;
339
+ break;
340
+ }
341
+ }
342
+
343
+ return sTargetType;
344
+ },
345
+
290
346
  /**
291
347
  * This function is updating the shell title after each navigation.
292
348
  *
293
349
  * @memberof sap.fe.templates.RootContainer.controller.BaseController
294
- * @param {*} oData Object containing reference to view and to oAppComponent
350
+ * @param {*} oView The current view
351
+ * @returns {*} A Promise that is resolved when the menu is filled properly
295
352
  */
296
- computeTitleHierarchy: function(oData) {
353
+ _computeTitleHierarchy: function(oView) {
297
354
  var that = this,
298
- oView = oData.oView,
299
- oAppComponent = oData.oAppComponent,
355
+ oAppComponent = this.getAppComponent(),
300
356
  oContext = oView.getBindingContext(),
301
357
  oCurrentPage = oView.getParent(),
302
358
  aTitleInformationPromises = [],
303
- sAppSpecificHash = HashChanger.getInstance().hrefForAppSpecificHash
304
- ? HashChanger.getInstance().hrefForAppSpecificHash("")
305
- : "",
359
+ sAppSpecificHash = this._getAppSpecificHash(),
306
360
  sAppTitle = oAppComponent.getMetadata().getManifestEntry("sap.app").title || "",
307
361
  sAppSubTitle = oAppComponent.getMetadata().getManifestEntry("sap.app").appSubTitle || "",
308
- sAppRootPath = sAppSpecificHash,
309
- oPageTitleInformationPromise,
362
+ oPageTitleInformation,
310
363
  sNewPath;
311
364
 
312
- if (this.bIsComputingTitleHierachy === true) {
313
- Log.warning("computeTitleHierarchy already running ... this call is canceled");
314
- return;
315
- }
316
- this.bIsComputingTitleHierachy = true;
317
-
318
365
  if (oCurrentPage && oCurrentPage._getPageTitleInformation) {
319
366
  if (oContext) {
367
+ // If the first page of the application is a LR, use the title and subtitle from the manifest
368
+ if (this._getTargetTypeFromHash("") === "sap.fe.templates.ListReport") {
369
+ aTitleInformationPromises.push(
370
+ Promise.resolve(that._computeTitleInfo(sAppTitle, sAppSubTitle, sAppSpecificHash))
371
+ );
372
+ }
373
+
374
+ // Then manage other pages
320
375
  sNewPath = oContext.getPath();
321
376
  var aPathParts = sNewPath.split("/"),
322
- sTargetType,
323
- sPath = "",
324
- iNbPathParts = aPathParts.length;
325
- aPathParts.splice(-1, 1);
326
-
327
- aPathParts.forEach(function(sPathPart, i) {
328
- if (i === 0) {
329
- var aRoutes = oAppComponent.getManifestEntry("/sap.ui5/routing/routes"),
330
- aTargets = oAppComponent.getManifestEntry("/sap.ui5/routing/targets");
331
- var fnTargetTypeEval = function(sTarget) {
332
- if (typeof aRoutes[this.index].target === "string") {
333
- return sTarget === aRoutes[this.index].target;
334
- } else if (typeof aRoutes[this.index].target === "object") {
335
- for (var k = 0; k < aRoutes[this.index].target.length; k++) {
336
- return sTarget === aRoutes[this.index].target[k];
337
- }
338
- }
339
- };
340
- for (var j = 0; j < aRoutes.length; j++) {
341
- var oRoute = oAppComponent.getRouter().getRoute(aRoutes[j].name);
342
- if (oRoute.match(aPathParts[i])) {
343
- var sTarget = Object.keys(aTargets).find(fnTargetTypeEval, { index: j });
344
- sTargetType = oAppComponent.getRouter().getTarget(sTarget)._oOptions.name;
345
- break;
346
- }
347
- }
348
- if (sTargetType === "sap.fe.templates.ListReport") {
349
- aTitleInformationPromises.push(
350
- Promise.resolve(that._computeTitleInfo(sAppTitle, sAppSubTitle, sAppRootPath))
351
- );
352
- }
353
- } else if (i < iNbPathParts) {
354
- sPath += "/" + sPathPart;
355
- var oMetaModel = oAppComponent.getMetaModel(),
356
- sParameterPath = oMetaModel.getMetaPath(sPath),
357
- bIsParameterized = oMetaModel.getProperty(
358
- sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext"
359
- );
360
- if (bIsParameterized) {
361
- return;
362
- }
363
- if (!that.getTitleHierarchyCache()[sPath]) {
364
- aTitleInformationPromises.push(that.addNewEntryInCacheTitle(sPath, oAppComponent));
365
- } else {
366
- aTitleInformationPromises.push(Promise.resolve(that.getTitleHierarchyCache()[sPath]));
367
- }
377
+ sPath = "";
378
+
379
+ aPathParts.shift(); // Remove the first segment (empty string) as it has been managed above
380
+ aPathParts.pop(); // Remove the last segment as it corresponds to the current page and shouldn't appear in the menu
381
+
382
+ aPathParts.forEach(function(sPathPart) {
383
+ sPath += "/" + sPathPart;
384
+ var oMetaModel = oAppComponent.getMetaModel(),
385
+ sParameterPath = oMetaModel.getMetaPath(sPath),
386
+ bIsParameterized = oMetaModel.getObject(sParameterPath + "/@com.sap.vocabularies.Common.v1.ResultContext");
387
+ if (!bIsParameterized) {
388
+ aTitleInformationPromises.push(that.getTitleInfoFromPath(sPath));
368
389
  }
369
390
  });
370
391
  }
371
- oPageTitleInformationPromise = oCurrentPage._getPageTitleInformation().then(function(oPageTitleInformation) {
372
- var sPageHash = HashChanger.getInstance().getHash();
373
- var aParts = sPageHash.split("/");
374
- if (aParts[aParts.length - 1].indexOf("?") === -1) {
375
- sPageHash += "?restoreHistory=true";
376
- } else {
377
- sPageHash += "&restoreHistory=true";
378
- }
379
392
 
380
- oPageTitleInformation.intent = sAppSpecificHash + sPageHash;
381
- if (oContext) {
382
- that.getTitleHierarchyCache()[sNewPath] = oPageTitleInformation;
383
- } else {
384
- that.getTitleHierarchyCache()[sAppRootPath] = oPageTitleInformation;
385
- }
386
- return oPageTitleInformation;
387
- });
388
- aTitleInformationPromises.push(oPageTitleInformationPromise);
393
+ // Current page
394
+ oPageTitleInformation = oCurrentPage._getPageTitleInformation();
395
+ oPageTitleInformation = that._computeTitleInfo(
396
+ oPageTitleInformation.title,
397
+ oPageTitleInformation.subtitle,
398
+ sAppSpecificHash + this._getHash()
399
+ );
400
+
401
+ if (oContext) {
402
+ that._getTitleHierarchyCache()[sNewPath] = oPageTitleInformation;
403
+ } else {
404
+ that._getTitleHierarchyCache()[sAppSpecificHash] = oPageTitleInformation;
405
+ }
389
406
  } else {
390
407
  aTitleInformationPromises.push(Promise.reject("Title information missing in HeaderInfo"));
391
408
  }
392
- Promise.all(aTitleInformationPromises)
409
+ return Promise.all(aTitleInformationPromises)
393
410
  .then(function(aTitleInfoHierarchy) {
394
411
  // workaround for shell which is expecting all elements being of type string
395
- var aTitleInfoHierarchyShell = that.ensureHierarchyElementsAreStrings(aTitleInfoHierarchy),
396
- sTitle = aTitleInfoHierarchyShell.pop().title;
412
+ var aTitleInfoHierarchyShell = that._ensureHierarchyElementsAreStrings(aTitleInfoHierarchy),
413
+ sTitle = oPageTitleInformation.title;
397
414
  oAppComponent.getShellServices().setHierarchy(aTitleInfoHierarchyShell.reverse());
398
415
  oAppComponent.getShellServices().setTitle(sTitle);
399
416
  })
@@ -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([], function() {
6
6
  "use strict";
@@ -8,8 +8,9 @@
8
8
  <FlexibleColumnLayout
9
9
  id="appContent"
10
10
  backgroundDesign="Transparent"
11
- layout="{fcl>/layout}"
12
11
  stateChange="onStateChanged"
13
12
  afterEndColumnNavigate="onStateChanged"
13
+ restoreFocusOnBackNavigation="true"
14
+ autoFocus="false"
14
15
  />
15
16
  </mvc:View>
@@ -5,5 +5,5 @@
5
5
  height="100%"
6
6
  controllerName="sap.fe.templates.RootContainer.controller.NavContainer"
7
7
  >
8
- <NavContainer id="appContent" />
8
+ <NavContainer id="appContent" autoFocus="false" />
9
9
  </mvc:View>
@@ -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
  [],
@@ -3,17 +3,21 @@
3
3
  xmlns="sap.m"
4
4
  xmlns:macro="sap.fe.macros.internal"
5
5
  xmlns:core="sap.ui.core"
6
+ template:require="{
7
+ HELPER: 'sap/fe/macros/chart/ChartHelper'
8
+ }"
6
9
  >
7
10
 
8
11
  <macro:Chart
9
12
  id="{visualizationDefinition>id}"
13
+ _applyIdToContent="true"
10
14
  contextPath="{visualizationDefinition>collection}"
11
15
  metaPath="{presentationContext>annotationPath}"
12
16
  chartDefinition="{visualizationDefinition>}"
13
17
  selectionMode="Multiple"
14
18
  personalization="{visualizationDefinition>personalization}"
15
- chartDelegate="{= '{name: \'sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate\', payload: { contextPath: \'' + (${viewData>contextPath} ? ${viewData>contextPath} : ('\/' + ${visualizationDefinition>entityName})) + '\' } }' }"
16
- dataPointsSelected=".handlers.onChartSelectionChanged"
19
+ chartDelegate="{= '{name: \'sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate\', payload: { contextPath: \'' + HELPER.getCollectionName(${visualizationDefinition>collection}) + '\', parameters:{$$groupId:\'$auto.Workers\'}, selectionMode: \'Multiple\' } }' }"
20
+ selectionChange=".handlers.onChartSelectionChanged"
17
21
  noDataText="{= ${converterContext>template} === 'ObjectPage' ? undefined : ${sap.fe.i18n>T_OP_TABLE_AND_CHART_NO_DATA_TEXT} }"
18
22
  >
19
23
  </macro:Chart>
@@ -19,6 +19,8 @@
19
19
  onSegmentedButtonPressed="{= ${converterContext>hasMultiVisualizations} ? '.handlers.onSegmentedButtonPressed' : undefined }"
20
20
  visible="{= ${converterContext>hasMultiVisualizations} ? '{= ${pageInternal>alpContentView} !== \'Chart\'}' : 'true' }"
21
21
  tabTitle="{view>title}"
22
+ fieldMode='{= ${converterContext>templateType} === "ListReport" ? "nowrapper" : ""}'
23
+ stateChanged='{= ${converterContext>template} !== "ObjectPage" ? ".handlers.onStateChanged" : undefined}'
22
24
  >
23
25
  </macro:Table>
24
26
  </core:FragmentDefinition>
@@ -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
  * Initialization Code and shared classes of library sap.fe.templates
@@ -46,7 +46,7 @@ sap.ui.define(
46
46
  interfaces: [],
47
47
  controls: [],
48
48
  elements: [],
49
- version: "1.95.0",
49
+ version: "1.98.0",
50
50
  noLibraryCSS: true
51
51
  });
52
52
  if (!sap.fe.templates.ObjectPage) {