@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.
- package/package.json +6 -3
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/Component.js +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +3 -3
- package/src/sap/fe/templates/ListComponent.js +1 -1
- package/src/sap/fe/templates/ListReport/Component.js +1 -1
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +1 -1
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +6 -4
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +136 -85
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +7 -3
- package/src/sap/fe/templates/ListReport/overrides/MassEdit.js +95 -0
- package/src/sap/fe/templates/ListReport/overrides/Share.js +37 -22
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +166 -33
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +23 -3
- package/src/sap/fe/templates/ObjectPage/Component.js +31 -18
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +16 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +103 -88
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +235 -174
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +9 -1
- package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +1 -1
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -2
- package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +89 -72
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +10 -6
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +14 -11
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +26 -12
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +2 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +26 -16
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +5 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +24 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +1 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +181 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +111 -8
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +88 -32
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +161 -144
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
- package/src/sap/fe/templates/RootContainer/view/Fcl.view.xml +2 -1
- package/src/sap/fe/templates/RootContainer/view/NavContainer.view.xml +1 -1
- package/src/sap/fe/templates/TableScroller.js +1 -1
- package/src/sap/fe/templates/controls/Chart.fragment.xml +6 -2
- package/src/sap/fe/templates/controls/Table.fragment.xml +2 -0
- package/src/sap/fe/templates/library.js +2 -2
- package/src/sap/fe/templates/messagebundle.properties +25 -2
- package/src/sap/fe/templates/messagebundle_ar.properties +1 -1
- package/src/sap/fe/templates/messagebundle_bg.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ca.properties +1 -1
- package/src/sap/fe/templates/messagebundle_cs.properties +1 -1
- package/src/sap/fe/templates/messagebundle_cy.properties +1 -1
- package/src/sap/fe/templates/messagebundle_da.properties +1 -1
- package/src/sap/fe/templates/messagebundle_de.properties +1 -1
- package/src/sap/fe/templates/messagebundle_el.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_GB.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +2 -2
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +2 -2
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +2 -2
- package/src/sap/fe/templates/messagebundle_es.properties +9 -9
- package/src/sap/fe/templates/messagebundle_es_MX.properties +1 -1
- package/src/sap/fe/templates/messagebundle_et.properties +1 -1
- package/src/sap/fe/templates/messagebundle_fi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_fr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +2 -2
- package/src/sap/fe/templates/messagebundle_hi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_hr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_hu.properties +1 -1
- package/src/sap/fe/templates/messagebundle_id.properties +1 -1
- package/src/sap/fe/templates/messagebundle_it.properties +1 -1
- package/src/sap/fe/templates/messagebundle_iw.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ja.properties +2 -2
- package/src/sap/fe/templates/messagebundle_kk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ko.properties +1 -1
- package/src/sap/fe/templates/messagebundle_lt.properties +1 -1
- package/src/sap/fe/templates/messagebundle_lv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ms.properties +1 -1
- package/src/sap/fe/templates/messagebundle_nl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_no.properties +2 -2
- package/src/sap/fe/templates/messagebundle_pl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_pt.properties +1 -1
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ro.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ru.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sh.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_th.properties +1 -1
- package/src/sap/fe/templates/messagebundle_tr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_uk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_vi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +1 -1
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderImage.fragment.xml +0 -24
- package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
- package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
- package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +0 -25
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
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
|
-
|
|
131
|
+
return new Promise(
|
|
132
|
+
function(resolve, reject) {
|
|
133
|
+
try {
|
|
134
|
+
var oNavContainer = this._getNavContainer();
|
|
96
135
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
136
|
+
if (!this.oMessagePage) {
|
|
137
|
+
this.oMessagePage = new MessagePage({
|
|
138
|
+
showHeader: false,
|
|
139
|
+
icon: "sap-icon://message-error"
|
|
140
|
+
});
|
|
102
141
|
|
|
103
|
-
|
|
104
|
-
|
|
142
|
+
oNavContainer.addPage(this.oMessagePage);
|
|
143
|
+
}
|
|
105
144
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
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-
|
|
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.
|
|
56
|
+
.attachAfterRouteMatched(this._onAfterRouteMatched, this);
|
|
57
57
|
},
|
|
58
58
|
onExit: function() {
|
|
59
59
|
this.getAppComponent()
|
|
60
60
|
.getRoutingService()
|
|
61
|
-
.detachAfterRouteMatched(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
|
-
*
|
|
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#
|
|
141
|
+
* @name sap.fe.templates.RootContainer.controller.BaseController#_onAfterRouteMatched
|
|
139
142
|
* @memberof sap.fe.templates.RootContainer.controller.BaseController
|
|
140
143
|
*/
|
|
141
|
-
|
|
144
|
+
_onAfterRouteMatched: function(oEvent) {
|
|
142
145
|
var that = this;
|
|
143
|
-
if (!that.
|
|
144
|
-
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.
|
|
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
|
-
|
|
154
|
-
|
|
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
|
-
|
|
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#
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
* @
|
|
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
|
-
|
|
231
|
-
{ context:
|
|
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
|
-
|
|
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
|
|
241
|
+
var oBindingViewContext = oModel.createBindingContext(sPath);
|
|
242
|
+
var oPropertyBinding = oModel.bindProperty(sTitlePath, oBindingViewContext);
|
|
243
|
+
|
|
240
244
|
oPropertyBinding.initialize();
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
-
}
|
|
259
|
-
|
|
260
|
-
|
|
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
|
-
|
|
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 {*}
|
|
350
|
+
* @param {*} oView The current view
|
|
351
|
+
* @returns {*} A Promise that is resolved when the menu is filled properly
|
|
295
352
|
*/
|
|
296
|
-
|
|
353
|
+
_computeTitleHierarchy: function(oView) {
|
|
297
354
|
var that = this,
|
|
298
|
-
|
|
299
|
-
oAppComponent = oData.oAppComponent,
|
|
355
|
+
oAppComponent = this.getAppComponent(),
|
|
300
356
|
oContext = oView.getBindingContext(),
|
|
301
357
|
oCurrentPage = oView.getParent(),
|
|
302
358
|
aTitleInformationPromises = [],
|
|
303
|
-
sAppSpecificHash =
|
|
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
|
-
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
aPathParts.
|
|
326
|
-
|
|
327
|
-
aPathParts.forEach(function(sPathPart
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
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
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
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.
|
|
396
|
-
sTitle =
|
|
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
|
})
|
|
@@ -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: \'' + (${
|
|
16
|
-
|
|
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-
|
|
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.
|
|
49
|
+
version: "1.98.0",
|
|
50
50
|
noLibraryCSS: true
|
|
51
51
|
});
|
|
52
52
|
if (!sap.fe.templates.ObjectPage) {
|