@sapui5/sap.fe.templates 1.94.0 → 1.96.3
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 +1 -1
- 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 +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/manifest.json +6 -0
- 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 +20 -5
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +3 -2
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +183 -170
- package/src/sap/fe/templates/ListReport/manifest.json +11 -1
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +7 -3
- package/src/sap/fe/templates/ListReport/overrides/Share.js +37 -22
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +124 -27
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +25 -5
- package/src/sap/fe/templates/ObjectPage/Component.js +1 -7
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +1 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +69 -60
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +154 -231
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +1 -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 -0
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +87 -63
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +23 -2
- 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 +3 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderContent.fragment.xml +34 -38
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +9 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +1 -4
- 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 +117 -116
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +63 -71
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +33 -22
- 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 +61 -0
- package/src/sap/fe/templates/controls/Chart.fragment.xml +6 -2
- package/src/sap/fe/templates/controls/Table.fragment.xml +1 -0
- package/src/sap/fe/templates/library.js +2 -2
- package/src/sap/fe/templates/messagebundle.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ar.properties +2 -2
- 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 +2 -2
- 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 +1 -1
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +1 -1
- package/src/sap/fe/templates/messagebundle_es.properties +1 -1
- 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 +1 -1
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/src/sap/fe/templates/messagebundle_tr.properties +1 -1
- 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 +2 -2
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Routing.js +0 -20
- package/src/sap/fe/templates/ObjectPage/view/fragments/TitleAndSubtitle.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
- package/src/sap/fe/templates/controls/Paginator.control.xml +0 -24
- package/src/sap/fe/templates/controls/Paginator.js +0 -173
|
@@ -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
|
sap.ui.define(
|
|
@@ -8,14 +8,11 @@ sap.ui.define(
|
|
|
8
8
|
"sap/fe/core/PageController",
|
|
9
9
|
"sap/fe/core/controllerextensions/SideEffects",
|
|
10
10
|
"sap/fe/core/controllerextensions/EditFlow",
|
|
11
|
-
"sap/fe/macros/field/FieldRuntime",
|
|
12
11
|
"sap/base/Log",
|
|
13
12
|
"sap/base/util/ObjectPath",
|
|
14
|
-
"sap/fe/navigation/SelectionVariant",
|
|
15
13
|
"sap/fe/core/CommonUtils",
|
|
16
14
|
"sap/ui/mdc/p13n/StateUtil",
|
|
17
15
|
"sap/fe/macros/table/Utils",
|
|
18
|
-
"sap/fe/macros/ResourceModel",
|
|
19
16
|
"sap/fe/core/controllerextensions/InternalRouting",
|
|
20
17
|
"sap/ui/Device",
|
|
21
18
|
"sap/fe/core/controllerextensions/IntentBasedNavigation",
|
|
@@ -31,26 +28,23 @@ sap.ui.define(
|
|
|
31
28
|
"./overrides/ViewState",
|
|
32
29
|
"sap/fe/templates/RootContainer/overrides/EditFlow",
|
|
33
30
|
"sap/fe/core/helpers/EditState",
|
|
34
|
-
"sap/ui/model/json/JSONModel",
|
|
35
31
|
"sap/fe/core/library",
|
|
36
|
-
"sap/fe/core/helpers/SemanticDateOperators",
|
|
37
32
|
"sap/fe/core/controllerextensions/Share",
|
|
38
33
|
"./overrides/Share",
|
|
39
34
|
"sap/fe/macros/CommonHelper",
|
|
40
|
-
"sap/fe/core/controllerextensions/KPIManagement"
|
|
35
|
+
"sap/fe/core/controllerextensions/KPIManagement",
|
|
36
|
+
"sap/fe/templates/TableScroller",
|
|
37
|
+
"sap/fe/core/controllerextensions/Placeholder"
|
|
41
38
|
],
|
|
42
39
|
function(
|
|
43
40
|
PageController,
|
|
44
41
|
SideEffects,
|
|
45
42
|
EditFlow,
|
|
46
|
-
FieldRuntime,
|
|
47
43
|
Log,
|
|
48
44
|
ObjectPath,
|
|
49
|
-
SelectionVariant,
|
|
50
45
|
CommonUtils,
|
|
51
46
|
StateUtil,
|
|
52
47
|
TableUtils,
|
|
53
|
-
ResourceModel,
|
|
54
48
|
InternalRouting,
|
|
55
49
|
Device,
|
|
56
50
|
IntentBasedNavigation,
|
|
@@ -66,13 +60,13 @@ sap.ui.define(
|
|
|
66
60
|
ViewStateOverrides,
|
|
67
61
|
EditFlowOverrides,
|
|
68
62
|
EditState,
|
|
69
|
-
JSONModel,
|
|
70
63
|
CoreLibrary,
|
|
71
|
-
SemanticDateOperators,
|
|
72
64
|
Share,
|
|
73
65
|
ShareOverrides,
|
|
74
66
|
CommonHelper,
|
|
75
|
-
KPIManagement
|
|
67
|
+
KPIManagement,
|
|
68
|
+
TableScroller,
|
|
69
|
+
Placeholder
|
|
76
70
|
) {
|
|
77
71
|
"use strict";
|
|
78
72
|
var TemplateContentView = CoreLibrary.TemplateContentView,
|
|
@@ -121,6 +115,7 @@ sap.ui.define(
|
|
|
121
115
|
editFlow: EditFlow.override(EditFlowOverrides),
|
|
122
116
|
viewState: ViewState.override(ViewStateOverrides),
|
|
123
117
|
kpiManagement: KPIManagement,
|
|
118
|
+
placeholder: Placeholder,
|
|
124
119
|
|
|
125
120
|
getExtensionAPI: function() {
|
|
126
121
|
if (!this.extensionAPI) {
|
|
@@ -132,23 +127,24 @@ sap.ui.define(
|
|
|
132
127
|
onInit: function() {
|
|
133
128
|
PageController.prototype.onInit.apply(this);
|
|
134
129
|
var that = this;
|
|
135
|
-
var
|
|
130
|
+
var aControls = this._getControls();
|
|
136
131
|
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
137
132
|
if (that._isMultiMode()) {
|
|
138
133
|
var oMultiModeTab = that._getMultiModeControl();
|
|
139
134
|
oInternalModelContext.setProperty("tabs", {
|
|
140
135
|
selected: oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey()
|
|
141
136
|
});
|
|
142
|
-
|
|
137
|
+
aControls.forEach(function(oControl) {
|
|
143
138
|
var oUpdateCounts = function() {
|
|
144
139
|
that._updateCounts();
|
|
145
140
|
};
|
|
146
|
-
|
|
141
|
+
CommonUtils.addEventToBindingInfo(oControl, "dataRequested", oUpdateCounts);
|
|
147
142
|
});
|
|
148
143
|
}
|
|
149
144
|
|
|
150
145
|
oInternalModelContext.setProperty("hasPendingFilters", true);
|
|
151
146
|
oInternalModelContext.setProperty("appliedFilters", "");
|
|
147
|
+
oInternalModelContext.setProperty("hideDraftInfo", false);
|
|
152
148
|
oInternalModelContext.setProperty("uom", {});
|
|
153
149
|
oInternalModelContext.setProperty("scalefactor", {});
|
|
154
150
|
oInternalModelContext.setProperty("scalefactorNumber", {});
|
|
@@ -172,7 +168,7 @@ sap.ui.define(
|
|
|
172
168
|
.getRouterProxy()
|
|
173
169
|
.waitForRouteMatchBeforeNavigation();
|
|
174
170
|
|
|
175
|
-
this.
|
|
171
|
+
this._isMultiMode() && this._updateMultiControlHiddenStatus();
|
|
176
172
|
|
|
177
173
|
FilterUtils.attachConditionHandling(this._getFilterBarControl());
|
|
178
174
|
},
|
|
@@ -188,7 +184,7 @@ sap.ui.define(
|
|
|
188
184
|
},
|
|
189
185
|
|
|
190
186
|
_onAfterBinding: function() {
|
|
191
|
-
var aTables = this.
|
|
187
|
+
var aTables = this._getControls("table");
|
|
192
188
|
var that = this;
|
|
193
189
|
if (EditState.isEditStateDirty()) {
|
|
194
190
|
var oTableBinding = this._getTableBinding();
|
|
@@ -221,6 +217,10 @@ sap.ui.define(
|
|
|
221
217
|
);
|
|
222
218
|
},
|
|
223
219
|
|
|
220
|
+
onBeforeRendering: function() {
|
|
221
|
+
PageController.prototype.onBeforeRendering.apply(this);
|
|
222
|
+
},
|
|
223
|
+
|
|
224
224
|
onAfterRendering: function(oEvent) {
|
|
225
225
|
var that = this;
|
|
226
226
|
this.getView()
|
|
@@ -228,7 +228,7 @@ sap.ui.define(
|
|
|
228
228
|
.getResourceBundle()
|
|
229
229
|
.then(function(response) {
|
|
230
230
|
that.oResourceBundle = response;
|
|
231
|
-
var
|
|
231
|
+
var aControls = that._getControls();
|
|
232
232
|
var sEntitySet = that.getView().getViewData().entitySet;
|
|
233
233
|
var sText = CommonUtils.getTranslatedText(
|
|
234
234
|
"T_OP_TABLE_AND_CHART_NO_DATA_TEXT",
|
|
@@ -236,34 +236,23 @@ sap.ui.define(
|
|
|
236
236
|
undefined,
|
|
237
237
|
sEntitySet
|
|
238
238
|
);
|
|
239
|
-
|
|
240
|
-
|
|
239
|
+
aControls.forEach(function(oControl) {
|
|
240
|
+
oControl.setNoDataText(sText);
|
|
241
241
|
});
|
|
242
|
-
if (that._hasMultiVisualizations()) {
|
|
243
|
-
var oChart = that.getChartControl();
|
|
244
|
-
oChart.setNoDataText(sText);
|
|
245
|
-
}
|
|
246
242
|
})
|
|
247
243
|
.catch(function(oError) {
|
|
248
244
|
Log.error("Error while retrieving the resource bundle", oError);
|
|
249
245
|
});
|
|
250
246
|
},
|
|
251
247
|
onPageReady: function(mParameters) {
|
|
252
|
-
var oLastFocusedControl = mParameters.lastFocusedControl;
|
|
253
|
-
var oView = this.getView();
|
|
254
|
-
// set the focus to the first action button, or to the first editable input if in editable mode
|
|
255
|
-
if (oLastFocusedControl && oLastFocusedControl.controlId && oLastFocusedControl.focusInfo) {
|
|
256
|
-
var oFocusControl = oView.byId(oLastFocusedControl.controlId);
|
|
257
|
-
if (oFocusControl) {
|
|
258
|
-
oFocusControl.applyFocusInfo(oLastFocusedControl.focusInfo);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
248
|
// Enabling mandatory filter fields message dialog and focusing on them
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
oFilterBar.
|
|
249
|
+
if (mParameters.forceFocus) {
|
|
250
|
+
var oFilterBar = this._getFilterBarControl();
|
|
251
|
+
|
|
252
|
+
if (oFilterBar && !oFilterBar.getShowMessages()) {
|
|
253
|
+
oFilterBar.setShowMessages(true);
|
|
254
|
+
oFilterBar.setFocusOnFirstErroneousField();
|
|
255
|
+
}
|
|
267
256
|
}
|
|
268
257
|
},
|
|
269
258
|
|
|
@@ -309,34 +298,31 @@ sap.ui.define(
|
|
|
309
298
|
onPendingFilters: function() {},
|
|
310
299
|
getCurrentEntitySet: function() {
|
|
311
300
|
if (!this._sEntitySet) {
|
|
312
|
-
var
|
|
313
|
-
this._sEntitySet =
|
|
301
|
+
var oDisplayedControl = (this._isMultiMode() && this._getCurrentControl()) || this._getTable();
|
|
302
|
+
this._sEntitySet = oDisplayedControl.data("targetCollectionPath").slice(1);
|
|
314
303
|
}
|
|
315
304
|
return this._sEntitySet;
|
|
316
305
|
},
|
|
317
306
|
|
|
318
307
|
/**
|
|
319
|
-
* This method initiates update of enabled state of DataFieldForAction and visible state of DataFieldForIBN buttons.
|
|
320
|
-
* @param aTables Array of tables in the
|
|
308
|
+
* This method initiates the update of the enabled state of the DataFieldForAction and the visible state of the DataFieldForIBN buttons.
|
|
309
|
+
* @param aTables Array of tables in the list report
|
|
321
310
|
* @private
|
|
322
311
|
*/
|
|
323
312
|
_updateTableActions: function(aTables) {
|
|
324
313
|
var aIBNActions = [];
|
|
325
|
-
aTables.forEach(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
|
|
338
|
-
}.bind(this)
|
|
339
|
-
);
|
|
314
|
+
aTables.forEach(function(oTable) {
|
|
315
|
+
aIBNActions = CommonUtils.getIBNActions(oTable, aIBNActions);
|
|
316
|
+
// Update 'enabled' property of DataFieldForAction buttons on table toolbar
|
|
317
|
+
// The same is also performed on Table selectionChange event
|
|
318
|
+
var oInternalModelContext = oTable.getBindingContext("internal"),
|
|
319
|
+
oActionOperationAvailableMap = JSON.parse(
|
|
320
|
+
CommonHelper.parseCustomData(DelegateUtil.getCustomData(oTable, "operationAvailableMap"))
|
|
321
|
+
),
|
|
322
|
+
aSelectedContexts = oTable.getSelectedContexts();
|
|
323
|
+
|
|
324
|
+
CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
|
|
325
|
+
});
|
|
340
326
|
CommonUtils.updateDataFieldForIBNButtonsVisibility(aIBNActions, this.getView());
|
|
341
327
|
},
|
|
342
328
|
|
|
@@ -345,36 +331,12 @@ sap.ui.define(
|
|
|
345
331
|
*
|
|
346
332
|
* @function
|
|
347
333
|
* @name sap.fe.templates.ListReport.ListReportController.controller#_scrollTablesToRow
|
|
348
|
-
* @param {string} sRowPath The path of the table row context to be scrolled
|
|
334
|
+
* @param {string} sRowPath The path of the table row context to be scrolled to
|
|
349
335
|
*/
|
|
350
336
|
_scrollTablesToRow: function(sRowPath) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
for (var i = 0; i < aTables.length; i++) {
|
|
355
|
-
oTable = aTables[i];
|
|
356
|
-
oTableRowBinding = oTable.getRowBinding();
|
|
357
|
-
if (oTableRowBinding) {
|
|
358
|
-
var oTableRowBindingContexts;
|
|
359
|
-
switch (oTable.data().tableType) {
|
|
360
|
-
case "GridTable":
|
|
361
|
-
oTableRowBindingContexts = oTableRowBinding.getContexts(0);
|
|
362
|
-
break;
|
|
363
|
-
case "ResponsiveTable":
|
|
364
|
-
oTableRowBindingContexts = oTableRowBinding.getCurrentContexts();
|
|
365
|
-
break;
|
|
366
|
-
default:
|
|
367
|
-
}
|
|
368
|
-
oTableRow = oTableRowBindingContexts.find(function(item) {
|
|
369
|
-
return item && item.getPath().indexOf(sRowPath) !== -1;
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
if (oTableRow) {
|
|
373
|
-
var iPos = oTableRow.iIndex;
|
|
374
|
-
oTable.scrollToIndex(iPos);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
337
|
+
this._getControls("table").forEach(function(oTable) {
|
|
338
|
+
TableScroller.scrollTableToRow(oTable, sRowPath);
|
|
339
|
+
});
|
|
378
340
|
},
|
|
379
341
|
_getPageTitleInformation: function() {
|
|
380
342
|
var that = this;
|
|
@@ -399,9 +361,9 @@ sap.ui.define(
|
|
|
399
361
|
},
|
|
400
362
|
_getSegmentedButtonId: function(sControl) {
|
|
401
363
|
if (sControl === "Chart") {
|
|
402
|
-
return this.
|
|
364
|
+
return this._getChart().data("segmentedButtonId");
|
|
403
365
|
} else {
|
|
404
|
-
return this.
|
|
366
|
+
return this._getTable().data("segmentedButtonId");
|
|
405
367
|
}
|
|
406
368
|
},
|
|
407
369
|
_getFilterBarControlId: function() {
|
|
@@ -434,39 +396,47 @@ sap.ui.define(
|
|
|
434
396
|
.getContent()[0]
|
|
435
397
|
.data("singleTableId");
|
|
436
398
|
},
|
|
437
|
-
|
|
399
|
+
_getCurrentControl: function() {
|
|
438
400
|
if (!this._oListReportControl) {
|
|
439
401
|
var oMultiModeTab = this._getMultiModeControl();
|
|
440
|
-
|
|
441
|
-
this._oListReportControl = this.getView().byId(
|
|
442
|
-
oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey()
|
|
443
|
-
);
|
|
444
|
-
} else {
|
|
445
|
-
this._oListReportControl = this.getView().byId(this._getTableControlId());
|
|
446
|
-
}
|
|
402
|
+
this._oListReportControl = this.getView().byId(oMultiModeTab.getSelectedKey() || oMultiModeTab.getItems()[0].getKey());
|
|
447
403
|
}
|
|
448
404
|
return this._oListReportControl;
|
|
449
405
|
},
|
|
406
|
+
_getTable: function() {
|
|
407
|
+
if (this._isMultiMode()) {
|
|
408
|
+
var oControl = this._getCurrentControl();
|
|
409
|
+
return oControl && oControl.isA("sap.ui.mdc.Table") ? oControl : undefined;
|
|
410
|
+
}
|
|
411
|
+
return this.getView().byId(this._getTableControlId());
|
|
412
|
+
},
|
|
413
|
+
_getChart: function() {
|
|
414
|
+
return this.getView().byId(this._getChartControlId());
|
|
415
|
+
},
|
|
450
416
|
_getTableBinding: function(sTableId) {
|
|
451
|
-
var oTableControl = sTableId ? this.getView().byId(sTableId) : this.
|
|
417
|
+
var oTableControl = sTableId ? this.getView().byId(sTableId) : this._getTable(),
|
|
452
418
|
oBinding = oTableControl && oTableControl._getRowBinding();
|
|
453
419
|
|
|
454
420
|
return oBinding;
|
|
455
421
|
},
|
|
456
|
-
|
|
422
|
+
_getControls: function(sKey) {
|
|
457
423
|
var that = this;
|
|
458
424
|
if (this._isMultiMode()) {
|
|
459
|
-
var
|
|
425
|
+
var aControls = [];
|
|
460
426
|
var oTabMultiMode = this._getMultiModeControl();
|
|
461
427
|
oTabMultiMode.getItems().forEach(function(oItem) {
|
|
462
|
-
var
|
|
463
|
-
if (
|
|
464
|
-
|
|
428
|
+
var oControl = that.getView().byId(oItem.getKey());
|
|
429
|
+
if (sKey) {
|
|
430
|
+
if (oItem.getKey().indexOf("fe::" + sKey) > -1) {
|
|
431
|
+
oControl && aControls.push(oControl);
|
|
432
|
+
}
|
|
433
|
+
} else {
|
|
434
|
+
oControl && aControls.push(oControl);
|
|
465
435
|
}
|
|
466
436
|
});
|
|
467
|
-
return
|
|
437
|
+
return aControls;
|
|
468
438
|
}
|
|
469
|
-
return [this.
|
|
439
|
+
return sKey === "Chart" ? [this._getChart()] : [this._getTable()];
|
|
470
440
|
},
|
|
471
441
|
_getDefaultPath: function() {
|
|
472
442
|
var defaultPath = this.getView()
|
|
@@ -556,27 +526,28 @@ sap.ui.define(
|
|
|
556
526
|
* A temporary solution (if we find better workflow) is to set a customData and don't trigger
|
|
557
527
|
* rebindTable if this customData is set to true.
|
|
558
528
|
*/
|
|
559
|
-
|
|
560
|
-
var
|
|
561
|
-
if (this._isMultiMode() &&
|
|
562
|
-
var
|
|
563
|
-
var
|
|
564
|
-
|
|
565
|
-
var
|
|
566
|
-
|
|
529
|
+
_updateMultiControlHiddenStatus: function() {
|
|
530
|
+
var oDisplayedControl = this._getCurrentControl();
|
|
531
|
+
if (this._isMultiMode() && oDisplayedControl) {
|
|
532
|
+
var sDisplayControlId = oDisplayedControl.getId();
|
|
533
|
+
var aControls = this._getControls();
|
|
534
|
+
aControls.forEach(function(oControl) {
|
|
535
|
+
var sControlId = oControl.getId();
|
|
536
|
+
oControl.data("controlHidden", sControlId !== sDisplayControlId);
|
|
567
537
|
});
|
|
568
538
|
}
|
|
569
539
|
},
|
|
570
540
|
/**
|
|
571
|
-
* Method to update
|
|
541
|
+
* Method to update the local UI model of the page with the fields that are not applicable to the filter bar (this is specific to the multiple table scenario).
|
|
572
542
|
*
|
|
573
|
-
* @param {sap.ui.model.context} oInternalModelContext
|
|
574
|
-
* @param {sap.ui.mdc.FilterBar} oFilterBar MDC
|
|
543
|
+
* @param {sap.ui.model.context} oInternalModelContext The internal model context
|
|
544
|
+
* @param {sap.ui.mdc.FilterBar} oFilterBar MDC filter bar
|
|
575
545
|
*/
|
|
576
546
|
_updateMultiNotApplicableFields: function(oInternalModelContext, oFilterBar) {
|
|
577
547
|
var mCache = {};
|
|
578
548
|
var ignoredFields = {},
|
|
579
|
-
aTables = this.
|
|
549
|
+
aTables = this._getControls("table"),
|
|
550
|
+
aCharts = this._getControls("Chart");
|
|
580
551
|
aTables.forEach(function(oTable) {
|
|
581
552
|
var sTableEntityPath = oTable.data("targetCollectionPath"),
|
|
582
553
|
sTableEntitySet = sTableEntityPath.slice(1),
|
|
@@ -586,26 +557,39 @@ sap.ui.define(
|
|
|
586
557
|
.getKey(),
|
|
587
558
|
sCacheKey = sTableEntitySet + (oTable.data("enableAnalytics") === "true" ? "Analytical" : "Regular");
|
|
588
559
|
if (!mCache[sCacheKey]) {
|
|
589
|
-
mCache[sCacheKey] = FilterUtils.
|
|
560
|
+
mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oTable);
|
|
561
|
+
}
|
|
562
|
+
ignoredFields[sTabId] = mCache[sCacheKey];
|
|
563
|
+
});
|
|
564
|
+
aCharts.forEach(function(oChart) {
|
|
565
|
+
var sChartEntityPath = oChart.data("targetCollectionPath"),
|
|
566
|
+
sChartEntitySet = sChartEntityPath.slice(1),
|
|
567
|
+
sTabId = oChart
|
|
568
|
+
.getParent()
|
|
569
|
+
.getParent()
|
|
570
|
+
.getKey(),
|
|
571
|
+
sCacheKey = sChartEntitySet + "Chart";
|
|
572
|
+
if (!mCache[sCacheKey]) {
|
|
573
|
+
mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
|
|
590
574
|
}
|
|
591
575
|
ignoredFields[sTabId] = mCache[sCacheKey];
|
|
592
576
|
});
|
|
593
577
|
oInternalModelContext.setProperty("tabs/ignoredFields", ignoredFields);
|
|
594
578
|
},
|
|
595
|
-
|
|
579
|
+
_updateMultiModeSelectedControl: function() {
|
|
596
580
|
this._sEntitySet = undefined;
|
|
597
581
|
this._oListReportControl = undefined;
|
|
598
|
-
this.
|
|
582
|
+
this._getCurrentControl();
|
|
599
583
|
},
|
|
600
584
|
_updateCounts: function() {
|
|
601
585
|
this._updateMutliModeCounts();
|
|
602
586
|
},
|
|
603
587
|
/**
|
|
604
|
-
* Method to determine if a tab from the list report is custom
|
|
588
|
+
* Method to determine if a tab from the list report is a custom tab..
|
|
605
589
|
*
|
|
606
590
|
* @function
|
|
607
591
|
* @name _isCustomTab
|
|
608
|
-
* @returns {boolean} Determines if the tab is custom
|
|
592
|
+
* @returns {boolean} Determines if the tab is a custom tab.
|
|
609
593
|
*/
|
|
610
594
|
_isCustomTab: function() {
|
|
611
595
|
var oMultiModeControl = this._getMultiModeControl();
|
|
@@ -616,15 +600,19 @@ sap.ui.define(
|
|
|
616
600
|
var aBindingPromises = [];
|
|
617
601
|
var oMultiModeControl = this._getMultiModeControl();
|
|
618
602
|
if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true" && !this._isCustomTab()) {
|
|
619
|
-
var
|
|
620
|
-
var
|
|
603
|
+
var oDisplayedControl = this._getCurrentControl();
|
|
604
|
+
var sDisplayedControlId = oDisplayedControl.getId();
|
|
621
605
|
var aCompliantTabs = [];
|
|
622
606
|
var aItems = oMultiModeControl.getItems();
|
|
623
607
|
aItems.forEach(function(oItem) {
|
|
624
|
-
var
|
|
625
|
-
if (
|
|
608
|
+
var oControl = that.getView().byId(oItem.getKey());
|
|
609
|
+
if (
|
|
610
|
+
oControl &&
|
|
611
|
+
!oControl.isA("sap.ui.mdc.ChartNew") &&
|
|
612
|
+
(oItem.data("outdatedCounts") || oControl.getId() === sDisplayedControlId)
|
|
613
|
+
) {
|
|
626
614
|
aCompliantTabs.push({
|
|
627
|
-
|
|
615
|
+
control: oControl,
|
|
628
616
|
item: oItem
|
|
629
617
|
});
|
|
630
618
|
}
|
|
@@ -632,10 +620,10 @@ sap.ui.define(
|
|
|
632
620
|
|
|
633
621
|
aBindingPromises = aCompliantTabs.map(function(mTab) {
|
|
634
622
|
mTab.item.setCount("...");
|
|
635
|
-
var
|
|
636
|
-
var oFilterInfos = TableUtils.getFiltersInfoForSV(
|
|
637
|
-
return TableUtils.getListBindingForCount(
|
|
638
|
-
batchGroupId:
|
|
623
|
+
var oControl = mTab.control;
|
|
624
|
+
var oFilterInfos = TableUtils.getFiltersInfoForSV(oControl, mTab.item.data("selectionVariant"));
|
|
625
|
+
return TableUtils.getListBindingForCount(oControl, that.getView().getBindingContext(), {
|
|
626
|
+
batchGroupId: oControl.getId() === sDisplayedControlId ? oControl.data("batchGroupId") : "$auto",
|
|
639
627
|
additionalFilters: oFilterInfos.filters
|
|
640
628
|
});
|
|
641
629
|
});
|
|
@@ -677,18 +665,19 @@ sap.ui.define(
|
|
|
677
665
|
}
|
|
678
666
|
},
|
|
679
667
|
_updateChart: function(oChart) {
|
|
680
|
-
|
|
681
|
-
|
|
668
|
+
var oInnerChart = oChart.getControlDelegate()._getChart(oChart);
|
|
669
|
+
if (!(oInnerChart && oInnerChart.isBound("data")) || this.hasPendingTableChanges) {
|
|
670
|
+
oChart.getControlDelegate().rebindChart(oChart, oInnerChart.getBindingInfo("data"));
|
|
682
671
|
this.hasPendingTableChanges = false;
|
|
683
672
|
}
|
|
684
673
|
},
|
|
685
674
|
handlers: {
|
|
686
675
|
onTabMultiModeChange: function(oEvent) {
|
|
687
|
-
this.
|
|
688
|
-
this.
|
|
676
|
+
this._updateMultiModeSelectedControl();
|
|
677
|
+
this._updateMultiControlHiddenStatus();
|
|
689
678
|
var oFilterBar = this._getFilterBarControl();
|
|
690
679
|
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
691
|
-
var
|
|
680
|
+
var oDisplayedControl = this._getCurrentControl();
|
|
692
681
|
var oMultiModeControl = this._getMultiModeControl();
|
|
693
682
|
oInternalModelContext.setProperty("tabs/selected", oMultiModeControl.getSelectedKey());
|
|
694
683
|
if (oFilterBar && oInternalModelContext.getProperty("hasPendingFilters") !== true) {
|
|
@@ -701,12 +690,24 @@ sap.ui.define(
|
|
|
701
690
|
refreshCause: "tabChanged"
|
|
702
691
|
});
|
|
703
692
|
} else if (
|
|
704
|
-
!
|
|
705
|
-
|
|
693
|
+
!oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
|
|
694
|
+
(!oDisplayedControl.getRowBinding() || // first time the tab/table is displayed
|
|
695
|
+
oDisplayedControl.data("outdatedRows") === true)
|
|
706
696
|
) {
|
|
707
697
|
// Search has been triggered on a different tab {}
|
|
708
|
-
|
|
709
|
-
|
|
698
|
+
oDisplayedControl.rebindTable();
|
|
699
|
+
oDisplayedControl.data("outdatedRows", false);
|
|
700
|
+
} else if (
|
|
701
|
+
oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
|
|
702
|
+
(!oDisplayedControl
|
|
703
|
+
.getControlDelegate()
|
|
704
|
+
._getChart(oDisplayedControl)
|
|
705
|
+
.getBinding("data") || // first time the tab/chart is displayed
|
|
706
|
+
oDisplayedControl.data("outdatedRows") === true)
|
|
707
|
+
) {
|
|
708
|
+
var oInnerChart = oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl);
|
|
709
|
+
oDisplayedControl.getControlDelegate().rebindChart(oDisplayedControl, oInnerChart.getBindingInfo("data"));
|
|
710
|
+
oDisplayedControl.data("outdatedRows", false);
|
|
710
711
|
}
|
|
711
712
|
}
|
|
712
713
|
this.getExtensionAPI().updateAppState();
|
|
@@ -716,8 +717,10 @@ sap.ui.define(
|
|
|
716
717
|
oInternalModelContext = this.getView().getBindingContext("internal");
|
|
717
718
|
// Pending filters into FilterBar to be used for custom views
|
|
718
719
|
this.onPendingFilters();
|
|
720
|
+
var bHideDraft = FilterUtils.getEditStateIsHideDraft(oFilterBar.getConditions());
|
|
719
721
|
oInternalModelContext.setProperty("appliedFilters", oFilterBar.getAssignedFiltersText().filtersText);
|
|
720
722
|
oInternalModelContext.setProperty("hasPendingFilters", true);
|
|
723
|
+
oInternalModelContext.setProperty("hideDraftInfo", bHideDraft);
|
|
721
724
|
if (oEvent.getParameter("conditionsBased")) {
|
|
722
725
|
this.getExtensionAPI().updateAppState();
|
|
723
726
|
}
|
|
@@ -749,19 +752,21 @@ sap.ui.define(
|
|
|
749
752
|
var oMdcChart = this.getChartControl();
|
|
750
753
|
oInternalModelContext.setProperty("hasPendingFilters", false);
|
|
751
754
|
if (this._isMultiMode()) {
|
|
752
|
-
var
|
|
755
|
+
var aControls = this._getControls(),
|
|
753
756
|
oMultiModeControl = this._getMultiModeControl();
|
|
754
757
|
if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true") {
|
|
755
758
|
var aItems = oMultiModeControl.getItems();
|
|
756
759
|
aItems.forEach(function(oItem) {
|
|
757
|
-
oItem.
|
|
760
|
+
if (!oItem.getKey().indexOf("fe::Chart") > -1) {
|
|
761
|
+
oItem.data("outdatedCounts", true);
|
|
762
|
+
}
|
|
758
763
|
});
|
|
759
764
|
}
|
|
760
765
|
if (!this._isCustomTab()) {
|
|
761
|
-
var
|
|
766
|
+
var sDisplayedControlId = this._getCurrentControl().getId();
|
|
762
767
|
this._updateMultiNotApplicableFields(oInternalModelContext, oFilterBar);
|
|
763
|
-
|
|
764
|
-
|
|
768
|
+
aControls.forEach(function(oControl) {
|
|
769
|
+
oControl.data("outdatedRows", oControl.getId() !== sDisplayedControlId);
|
|
765
770
|
});
|
|
766
771
|
} else {
|
|
767
772
|
var oFilterConditions = oFilterBar.getFilterConditions();
|
|
@@ -800,40 +805,30 @@ sap.ui.define(
|
|
|
800
805
|
}
|
|
801
806
|
},
|
|
802
807
|
/**
|
|
803
|
-
* Triggers an outbound navigation
|
|
808
|
+
* Triggers an outbound navigation when a user chooses the chevron.
|
|
804
809
|
*
|
|
805
810
|
* @param {object} oController
|
|
806
811
|
* @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
|
|
807
812
|
* @param {sap.ui.model.odata.v4.Context} oContext The context that contain the data for the target app
|
|
808
|
-
* @
|
|
813
|
+
* @param {string} sCreatePath Create path when the chevron is created.
|
|
814
|
+
* @returns {Promise} Promise which is resolved once the navigation is triggered
|
|
809
815
|
* @ui5-restricted
|
|
810
816
|
* @final
|
|
811
817
|
*/
|
|
812
|
-
onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext) {
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
if (oDisplayOutbound && oDisplayOutbound.semanticObject && oDisplayOutbound.action) {
|
|
820
|
-
oContext = oContext && oContext.isA && oContext.isA("sap.ui.model.odata.v4.Context") ? [oContext] : oContext;
|
|
821
|
-
oController._intentBasedNavigation.navigate(oDisplayOutbound.semanticObject, oDisplayOutbound.action, {
|
|
822
|
-
navigationContexts: oContext
|
|
823
|
-
});
|
|
824
|
-
|
|
825
|
-
//TODO: check why returning a promise is required
|
|
826
|
-
return Promise.resolve();
|
|
827
|
-
} else {
|
|
828
|
-
throw new Error("outbound target " + sOutboundTarget + " not found in cross navigation definition of manifest");
|
|
829
|
-
}
|
|
818
|
+
onChevronPressNavigateOutBound: function(oController, sOutboundTarget, oContext, sCreatePath) {
|
|
819
|
+
return oController._intentBasedNavigation.onChevronPressNavigateOutBound(
|
|
820
|
+
oController,
|
|
821
|
+
sOutboundTarget,
|
|
822
|
+
oContext,
|
|
823
|
+
sCreatePath
|
|
824
|
+
);
|
|
830
825
|
},
|
|
831
826
|
onChartSelectionChanged: function(oEvent) {
|
|
832
|
-
var oMdcChart = oEvent.getSource(),
|
|
833
|
-
oTable = this.
|
|
834
|
-
|
|
827
|
+
var oMdcChart = oEvent.getSource().getContent(),
|
|
828
|
+
oTable = this._getTable(),
|
|
829
|
+
aData = oEvent.getParameter("data"),
|
|
835
830
|
oInternalModelContext = this.getView().getBindingContext("internal");
|
|
836
|
-
if (
|
|
831
|
+
if (aData) {
|
|
837
832
|
// update action buttons enablement / disablement
|
|
838
833
|
ChartRuntime.fnUpdateChart(oEvent);
|
|
839
834
|
// update selections on selection or deselection
|
|
@@ -852,8 +847,8 @@ sap.ui.define(
|
|
|
852
847
|
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
853
848
|
oInternalModelContext.setProperty("alpContentView", sSelectedKey);
|
|
854
849
|
var oSegmentedButton;
|
|
855
|
-
var oChart = this.
|
|
856
|
-
var oTable = this.
|
|
850
|
+
var oChart = this._getChart();
|
|
851
|
+
var oTable = this._getTable();
|
|
857
852
|
var oSegmentedButtonDelegate = {
|
|
858
853
|
onAfterRendering: function() {
|
|
859
854
|
var aItems = oSegmentedButton.getItems();
|
|
@@ -909,6 +904,24 @@ sap.ui.define(
|
|
|
909
904
|
}
|
|
910
905
|
},
|
|
911
906
|
formatters: {
|
|
907
|
+
isDraftIndicatorVisible: function(
|
|
908
|
+
sPropertyPath,
|
|
909
|
+
sSemanticKeyHasDraftIndicator,
|
|
910
|
+
HasDraftEntity,
|
|
911
|
+
IsActiveEntity,
|
|
912
|
+
hideDraftInfo
|
|
913
|
+
) {
|
|
914
|
+
if (
|
|
915
|
+
IsActiveEntity !== undefined &&
|
|
916
|
+
HasDraftEntity !== undefined &&
|
|
917
|
+
(!IsActiveEntity || HasDraftEntity) &&
|
|
918
|
+
!hideDraftInfo
|
|
919
|
+
) {
|
|
920
|
+
return sPropertyPath === sSemanticKeyHasDraftIndicator;
|
|
921
|
+
} else {
|
|
922
|
+
return false;
|
|
923
|
+
}
|
|
924
|
+
},
|
|
912
925
|
/**
|
|
913
926
|
* Method to set the message text for the multi-EntitySet scenario when fields in the FilterBar need to be ignored.
|
|
914
927
|
*
|
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
"handleValidation": true
|
|
26
|
+
"handleValidation": true,
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"minUI5Version": "${sap.ui5.core.version}",
|
|
29
|
+
"libs": {
|
|
30
|
+
"sap.fe.core": {},
|
|
31
|
+
"sap.ui.mdc": {},
|
|
32
|
+
"sap.fe.macros": {},
|
|
33
|
+
"sap.ui.fl": {},
|
|
34
|
+
"sap.fe.navigation": {}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
27
37
|
}
|
|
28
38
|
}
|