@sapui5/sap.fe.templates 1.97.0 → 1.99.1
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 +7 -5
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/Component.js +3 -2
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +5 -4
- package/src/sap/fe/templates/ListComponent.js +3 -2
- package/src/sap/fe/templates/ListReport/Component.js +11 -2
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +12 -6
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +13 -7
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +193 -125
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +18 -13
- package/src/sap/fe/templates/ListReport/overrides/Share.js +46 -29
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +131 -86
- package/src/sap/fe/templates/ListReport/view/fragments/CollectionVisualization.fragment.xml +8 -0
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +25 -4
- package/src/sap/fe/templates/ObjectPage/Component.js +20 -17
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +18 -2
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +72 -94
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +118 -140
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +3 -2
- package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +3 -2
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +3 -2
- package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +3 -2
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +3 -2
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +3 -2
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +3 -2
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +3 -2
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +3 -2
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +3 -2
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +15 -2
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +50 -45
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +3 -22
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +1 -1
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +2 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +5 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/Heading.fragment.xml +33 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingAvatar.fragment.xml +17 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeadingTitle.fragment.xml +18 -0
- 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 +4 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +4 -3
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +3 -2
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +3 -2
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +136 -125
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +3 -2
- package/src/sap/fe/templates/TableScroller.js +3 -2
- package/src/sap/fe/templates/controls/Table.fragment.xml +1 -1
- package/src/sap/fe/templates/library.js +4 -3
- package/src/sap/fe/templates/messagebundle.properties +15 -8
- package/src/sap/fe/templates/messagebundle_ar.properties +24 -6
- package/src/sap/fe/templates/messagebundle_bg.properties +24 -6
- package/src/sap/fe/templates/messagebundle_ca.properties +24 -6
- package/src/sap/fe/templates/messagebundle_cs.properties +24 -6
- package/src/sap/fe/templates/messagebundle_cy.properties +24 -6
- package/src/sap/fe/templates/messagebundle_da.properties +24 -6
- package/src/sap/fe/templates/messagebundle_de.properties +24 -6
- package/src/sap/fe/templates/messagebundle_el.properties +25 -7
- package/src/sap/fe/templates/messagebundle_en.properties +24 -6
- package/src/sap/fe/templates/messagebundle_en_GB.properties +24 -6
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +25 -7
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +25 -7
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +25 -7
- package/src/sap/fe/templates/messagebundle_es.properties +32 -14
- package/src/sap/fe/templates/messagebundle_es_MX.properties +24 -6
- package/src/sap/fe/templates/messagebundle_et.properties +24 -6
- package/src/sap/fe/templates/messagebundle_fi.properties +24 -6
- package/src/sap/fe/templates/messagebundle_fr.properties +25 -7
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +24 -6
- package/src/sap/fe/templates/messagebundle_hi.properties +24 -6
- package/src/sap/fe/templates/messagebundle_hr.properties +25 -7
- package/src/sap/fe/templates/messagebundle_hu.properties +24 -6
- package/src/sap/fe/templates/messagebundle_id.properties +26 -8
- package/src/sap/fe/templates/messagebundle_it.properties +24 -6
- package/src/sap/fe/templates/messagebundle_iw.properties +24 -6
- package/src/sap/fe/templates/messagebundle_ja.properties +25 -7
- package/src/sap/fe/templates/messagebundle_kk.properties +24 -6
- package/src/sap/fe/templates/messagebundle_ko.properties +24 -6
- package/src/sap/fe/templates/messagebundle_lt.properties +24 -6
- package/src/sap/fe/templates/messagebundle_lv.properties +24 -6
- package/src/sap/fe/templates/messagebundle_ms.properties +24 -6
- package/src/sap/fe/templates/messagebundle_nl.properties +24 -6
- package/src/sap/fe/templates/messagebundle_no.properties +24 -6
- package/src/sap/fe/templates/messagebundle_pl.properties +24 -6
- package/src/sap/fe/templates/messagebundle_pt.properties +27 -9
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +25 -7
- package/src/sap/fe/templates/messagebundle_ro.properties +24 -6
- package/src/sap/fe/templates/messagebundle_ru.properties +24 -6
- package/src/sap/fe/templates/messagebundle_sh.properties +24 -6
- package/src/sap/fe/templates/messagebundle_sk.properties +24 -6
- package/src/sap/fe/templates/messagebundle_sl.properties +24 -6
- package/src/sap/fe/templates/messagebundle_sv.properties +25 -7
- package/src/sap/fe/templates/messagebundle_th.properties +24 -6
- package/src/sap/fe/templates/messagebundle_tr.properties +25 -7
- package/src/sap/fe/templates/messagebundle_uk.properties +25 -7
- package/src/sap/fe/templates/messagebundle_vi.properties +24 -6
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +24 -6
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +24 -6
- package/ui5.yaml +0 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderImage.fragment.xml +0 -24
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
|
|
6
7
|
sap.ui.define(
|
|
@@ -35,7 +36,8 @@ sap.ui.define(
|
|
|
35
36
|
"sap/fe/core/controllerextensions/KPIManagement",
|
|
36
37
|
"sap/fe/templates/TableScroller",
|
|
37
38
|
"sap/fe/core/controllerextensions/Placeholder",
|
|
38
|
-
"sap/ui/fl/write/api/ControlPersonalizationWriteAPI"
|
|
39
|
+
"sap/ui/fl/write/api/ControlPersonalizationWriteAPI",
|
|
40
|
+
"sap/fe/core/controllerextensions/MassEdit"
|
|
39
41
|
],
|
|
40
42
|
function(
|
|
41
43
|
PageController,
|
|
@@ -68,7 +70,8 @@ sap.ui.define(
|
|
|
68
70
|
KPIManagement,
|
|
69
71
|
TableScroller,
|
|
70
72
|
Placeholder,
|
|
71
|
-
ControlPersonalizationWriteAPI
|
|
73
|
+
ControlPersonalizationWriteAPI,
|
|
74
|
+
MassEdit
|
|
72
75
|
) {
|
|
73
76
|
"use strict";
|
|
74
77
|
var TemplateContentView = CoreLibrary.TemplateContentView,
|
|
@@ -118,6 +121,7 @@ sap.ui.define(
|
|
|
118
121
|
viewState: ViewState.override(ViewStateOverrides),
|
|
119
122
|
kpiManagement: KPIManagement,
|
|
120
123
|
placeholder: Placeholder,
|
|
124
|
+
massEdit: MassEdit,
|
|
121
125
|
|
|
122
126
|
getExtensionAPI: function() {
|
|
123
127
|
if (!this.extensionAPI) {
|
|
@@ -145,11 +149,6 @@ sap.ui.define(
|
|
|
145
149
|
}
|
|
146
150
|
//TODO: This is only a temporary approach and will be removed once app state behaviour is finalized.
|
|
147
151
|
|
|
148
|
-
var oUrlParser = sap.ushell && sap.ushell.Container.getService("URLParsing");
|
|
149
|
-
var oUrlParams = oUrlParser && oUrlParser.parseParameters(window.location.search);
|
|
150
|
-
if (oUrlParams && oUrlParams["sap-fe-test-appState"]) {
|
|
151
|
-
this.bTestAppState = true;
|
|
152
|
-
}
|
|
153
152
|
oInternalModelContext.setProperty("hasPendingFilters", true);
|
|
154
153
|
oInternalModelContext.setProperty("appliedFilters", "");
|
|
155
154
|
oInternalModelContext.setProperty("hideDraftInfo", false);
|
|
@@ -177,12 +176,8 @@ sap.ui.define(
|
|
|
177
176
|
.waitForRouteMatchBeforeNavigation();
|
|
178
177
|
|
|
179
178
|
this._isMultiMode() && this._updateMultiControlHiddenStatus();
|
|
180
|
-
|
|
181
|
-
FilterUtils.attachConditionHandling(this._getFilterBarControl());
|
|
182
179
|
},
|
|
183
180
|
onExit: function() {
|
|
184
|
-
FilterUtils.detachConditionHandling(this._getFilterBarControl());
|
|
185
|
-
|
|
186
181
|
delete this._sEntitySet;
|
|
187
182
|
delete this.filterBarConditions;
|
|
188
183
|
delete this._oListReportControl;
|
|
@@ -200,6 +195,10 @@ sap.ui.define(
|
|
|
200
195
|
if (!this.sUpdateTimer) {
|
|
201
196
|
this.sUpdateTimer = setTimeout(function() {
|
|
202
197
|
oTableBinding.refresh();
|
|
198
|
+
if (that._isMultiMode()) {
|
|
199
|
+
that._setCountsOutDated();
|
|
200
|
+
that._updateCounts();
|
|
201
|
+
}
|
|
203
202
|
delete that.sUpdateTimer;
|
|
204
203
|
}, 0);
|
|
205
204
|
}
|
|
@@ -262,6 +261,11 @@ sap.ui.define(
|
|
|
262
261
|
oFilterBar.setFocusOnFirstErroneousField();
|
|
263
262
|
}
|
|
264
263
|
}
|
|
264
|
+
|
|
265
|
+
// Remove the handler on back navigation that displays Draft confirmation
|
|
266
|
+
this.getAppComponent()
|
|
267
|
+
.getShellServices()
|
|
268
|
+
.setBackNavigation(undefined);
|
|
265
269
|
},
|
|
266
270
|
|
|
267
271
|
/**
|
|
@@ -347,19 +351,14 @@ sap.ui.define(
|
|
|
347
351
|
});
|
|
348
352
|
},
|
|
349
353
|
_getPageTitleInformation: function() {
|
|
350
|
-
var
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
.getView()
|
|
359
|
-
.getContent()[0]
|
|
360
|
-
.data().ListReportSubtitle;
|
|
361
|
-
resolve(oTitleInfo);
|
|
362
|
-
});
|
|
354
|
+
var oTitleInfo = { title: "", subtitle: "", intent: "", icon: "" };
|
|
355
|
+
oTitleInfo.title = this.getView()
|
|
356
|
+
.getContent()[0]
|
|
357
|
+
.data().ListReportTitle;
|
|
358
|
+
oTitleInfo.subtitle = this.getView()
|
|
359
|
+
.getContent()[0]
|
|
360
|
+
.data().ListReportSubtitle;
|
|
361
|
+
return oTitleInfo;
|
|
363
362
|
},
|
|
364
363
|
_getFilterBarControl: function() {
|
|
365
364
|
return this.getView().byId(this._getFilterBarControlId());
|
|
@@ -443,8 +442,13 @@ sap.ui.define(
|
|
|
443
442
|
}
|
|
444
443
|
});
|
|
445
444
|
return aControls;
|
|
445
|
+
} else if (sKey === "Chart") {
|
|
446
|
+
var oChart = this._getChart();
|
|
447
|
+
return oChart ? [oChart] : [];
|
|
448
|
+
} else {
|
|
449
|
+
var oTable = this._getTable();
|
|
450
|
+
return oTable ? [oTable] : [];
|
|
446
451
|
}
|
|
447
|
-
return sKey === "Chart" ? [this._getChart()] : [this._getTable()];
|
|
448
452
|
},
|
|
449
453
|
_getDefaultPath: function() {
|
|
450
454
|
var defaultPath = this.getView()
|
|
@@ -529,7 +533,7 @@ sap.ui.define(
|
|
|
529
533
|
* requests when FilterBar is changed or LR is initialized
|
|
530
534
|
* Best workflow would be to suspend table binding but
|
|
531
535
|
* if the user switch quickly between tabs the batch response of previous
|
|
532
|
-
* is
|
|
536
|
+
* is received when previous tab is already disabled (binding is suspended) and
|
|
533
537
|
* generates error.
|
|
534
538
|
* A temporary solution (if we find better workflow) is to set a customData and don't trigger
|
|
535
539
|
* rebindTable if this customData is set to true.
|
|
@@ -551,7 +555,7 @@ sap.ui.define(
|
|
|
551
555
|
* @param {sap.ui.model.context} oInternalModelContext The internal model context
|
|
552
556
|
* @param {sap.ui.mdc.FilterBar} oFilterBar MDC filter bar
|
|
553
557
|
*/
|
|
554
|
-
|
|
558
|
+
_updateMultiTabNotApplicableFields: function(oInternalModelContext, oFilterBar) {
|
|
555
559
|
var mCache = {};
|
|
556
560
|
var ignoredFields = {},
|
|
557
561
|
aTables = this._getControls("table"),
|
|
@@ -584,6 +588,35 @@ sap.ui.define(
|
|
|
584
588
|
});
|
|
585
589
|
oInternalModelContext.setProperty("tabs/ignoredFields", ignoredFields);
|
|
586
590
|
},
|
|
591
|
+
/**
|
|
592
|
+
* 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 ALP scenario).
|
|
593
|
+
*
|
|
594
|
+
* @param {sap.ui.model.context} oInternalModelContext The internal model context
|
|
595
|
+
* @param {sap.ui.mdc.FilterBar} oFilterBar MDC filter bar
|
|
596
|
+
*/
|
|
597
|
+
_updateALPNotApplicableFields: function(oInternalModelContext, oFilterBar) {
|
|
598
|
+
var mCache = {};
|
|
599
|
+
var ignoredFields = {},
|
|
600
|
+
aTables = this._getControls("table"),
|
|
601
|
+
aCharts = this._getControls("Chart");
|
|
602
|
+
|
|
603
|
+
if (!aTables.length || !aCharts.length) {
|
|
604
|
+
// If there's not a table and a chart, we're not in the ALP case
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
// For the moment, there's nothing for tables...
|
|
609
|
+
aCharts.forEach(function(oChart) {
|
|
610
|
+
var sChartEntityPath = oChart.data("targetCollectionPath"),
|
|
611
|
+
sChartEntitySet = sChartEntityPath.slice(1),
|
|
612
|
+
sCacheKey = sChartEntitySet + "Chart";
|
|
613
|
+
if (!mCache[sCacheKey]) {
|
|
614
|
+
mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
|
|
615
|
+
}
|
|
616
|
+
ignoredFields[sCacheKey] = mCache[sCacheKey];
|
|
617
|
+
});
|
|
618
|
+
oInternalModelContext.setProperty("controls/ignoredFields", ignoredFields);
|
|
619
|
+
},
|
|
587
620
|
_updateMultiModeSelectedControl: function() {
|
|
588
621
|
this._sEntitySet = undefined;
|
|
589
622
|
this._oListReportControl = undefined;
|
|
@@ -603,6 +636,17 @@ sap.ui.define(
|
|
|
603
636
|
var oMultiModeControl = this._getMultiModeControl();
|
|
604
637
|
return oMultiModeControl && oMultiModeControl.getSelectedKey().indexOf("::CustomTab::") > -1;
|
|
605
638
|
},
|
|
639
|
+
_setCountsOutDated: function() {
|
|
640
|
+
var oMultiModeControl = this._getMultiModeControl();
|
|
641
|
+
if (oMultiModeControl && oMultiModeControl.data("showCounts") === "true") {
|
|
642
|
+
var aItems = oMultiModeControl.getItems();
|
|
643
|
+
aItems.forEach(function(oItem) {
|
|
644
|
+
if (!oItem.getKey().indexOf("fe::Chart") > -1) {
|
|
645
|
+
oItem.data("outdatedCounts", true);
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
},
|
|
606
650
|
_updateMultiModeCounts: function() {
|
|
607
651
|
var that = this;
|
|
608
652
|
var aBindingPromises = [];
|
|
@@ -616,7 +660,7 @@ sap.ui.define(
|
|
|
616
660
|
var oControl = that.getView().byId(oItem.getKey());
|
|
617
661
|
if (
|
|
618
662
|
oControl &&
|
|
619
|
-
!oControl.isA("sap.ui.mdc.
|
|
663
|
+
!oControl.isA("sap.ui.mdc.Chart") &&
|
|
620
664
|
(oItem.data("outdatedCounts") || oControl.getId() === sDisplayedControlId)
|
|
621
665
|
) {
|
|
622
666
|
aCompliantTabs.push({
|
|
@@ -649,17 +693,22 @@ sap.ui.define(
|
|
|
649
693
|
});
|
|
650
694
|
}
|
|
651
695
|
},
|
|
696
|
+
_isFilterBarHidden: function() {
|
|
697
|
+
return this.getView().getViewData().hideFilterBar;
|
|
698
|
+
},
|
|
652
699
|
_shouldAutoTriggerSearch: function(oVM) {
|
|
653
700
|
if (
|
|
654
701
|
this.getView().getViewData().initialLoad === InitialLoadMode.Auto &&
|
|
655
702
|
(!oVM || oVM.getStandardVariantKey() === oVM.getCurrentVariantKey())
|
|
656
703
|
) {
|
|
657
|
-
var oFilterBar = this._getFilterBarControl()
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
704
|
+
var oFilterBar = this._getFilterBarControl();
|
|
705
|
+
if (oFilterBar) {
|
|
706
|
+
var oConditions = oFilterBar.getConditions();
|
|
707
|
+
for (var sKey in oConditions) {
|
|
708
|
+
// ignore filters starting with $ (e.g. $search, $editState)
|
|
709
|
+
if (!sKey.startsWith("$") && Array.isArray(oConditions[sKey]) && oConditions[sKey].length) {
|
|
710
|
+
return true;
|
|
711
|
+
}
|
|
663
712
|
}
|
|
664
713
|
}
|
|
665
714
|
}
|
|
@@ -668,62 +717,62 @@ sap.ui.define(
|
|
|
668
717
|
},
|
|
669
718
|
_updateTable: function(oTable) {
|
|
670
719
|
if (!oTable.isTableBound() || this.hasPendingChartChanges) {
|
|
671
|
-
oTable.
|
|
720
|
+
oTable.rebind();
|
|
672
721
|
this.hasPendingChartChanges = false;
|
|
673
722
|
}
|
|
674
723
|
},
|
|
675
724
|
_updateChart: function(oChart) {
|
|
676
725
|
var oInnerChart = oChart.getControlDelegate()._getChart(oChart);
|
|
677
726
|
if (!(oInnerChart && oInnerChart.isBound("data")) || this.hasPendingTableChanges) {
|
|
678
|
-
oChart.getControlDelegate().
|
|
727
|
+
oChart.getControlDelegate().rebind(oChart, oInnerChart.getBindingInfo("data"));
|
|
679
728
|
this.hasPendingTableChanges = false;
|
|
680
729
|
}
|
|
681
730
|
},
|
|
682
731
|
handlers: {
|
|
683
732
|
onTabMultiModeChange: function(oEvent) {
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
733
|
+
this._updateMultiModeSelectedControl();
|
|
734
|
+
this._updateMultiControlHiddenStatus();
|
|
735
|
+
|
|
736
|
+
var oFilterBar = this._getFilterBarControl();
|
|
737
|
+
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
738
|
+
var oDisplayedControl = this._getCurrentControl();
|
|
739
|
+
var oMultiModeControl = this._getMultiModeControl();
|
|
740
|
+
var sSelectedKey = oMultiModeControl.getSelectedKey();
|
|
741
|
+
var sPreviousSelectedKey = oEvent && oEvent.mParameters ? oEvent.mParameters.previousKey : undefined;
|
|
742
|
+
|
|
743
|
+
oInternalModelContext.setProperty("tabs/selected", sSelectedKey);
|
|
744
|
+
if (oInternalModelContext.getProperty("hasPendingFilters") !== true) {
|
|
745
|
+
// No pending filters into FilterBar
|
|
746
|
+
if (oFilterBar && this._isCustomTab()) {
|
|
747
|
+
var oFilterConditions = oFilterBar.getFilterConditions();
|
|
748
|
+
this.onViewNeedsRefresh({
|
|
749
|
+
filterConditions: oFilterConditions,
|
|
750
|
+
currentTabId: sSelectedKey,
|
|
751
|
+
refreshCause: "tabChanged"
|
|
752
|
+
});
|
|
753
|
+
} else if (
|
|
754
|
+
!oDisplayedControl.isA("sap.ui.mdc.Chart") &&
|
|
755
|
+
(!oDisplayedControl.getRowBinding() || // first time the tab/table is displayed
|
|
756
|
+
oDisplayedControl.data("outdatedRows") === true)
|
|
757
|
+
) {
|
|
758
|
+
// Search has been triggered on a different tab {}
|
|
759
|
+
oDisplayedControl.rebind();
|
|
760
|
+
oDisplayedControl.data("outdatedRows", false);
|
|
761
|
+
} else if (
|
|
762
|
+
oDisplayedControl.isA("sap.ui.mdc.Chart") &&
|
|
763
|
+
(!oDisplayedControl
|
|
764
|
+
.getControlDelegate()
|
|
765
|
+
._getChart(oDisplayedControl)
|
|
766
|
+
.getBinding("data") || // first time the tab/chart is displayed
|
|
767
|
+
oDisplayedControl.data("outdatedRows") === true)
|
|
768
|
+
) {
|
|
769
|
+
var oInnerChart = oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl);
|
|
770
|
+
oDisplayedControl.getControlDelegate().rebind(oDisplayedControl, oInnerChart.getBindingInfo("data"));
|
|
771
|
+
oDisplayedControl.data("outdatedRows", false);
|
|
723
772
|
}
|
|
724
|
-
|
|
725
|
-
var sPreviousSelectedKey = oEvent && oEvent.mParameters ? oEvent.mParameters.previousKey : undefined;
|
|
773
|
+
}
|
|
726
774
|
|
|
775
|
+
if (oEvent && oEvent.mParameters && sPreviousSelectedKey !== oEvent.mParameters.selectedKey) {
|
|
727
776
|
ControlPersonalizationWriteAPI.add({
|
|
728
777
|
changes: [
|
|
729
778
|
{
|
|
@@ -738,19 +787,19 @@ sap.ui.define(
|
|
|
738
787
|
}
|
|
739
788
|
]
|
|
740
789
|
});
|
|
741
|
-
*/
|
|
742
|
-
this.getExtensionAPI().updateAppState();
|
|
743
790
|
}
|
|
791
|
+
this.getExtensionAPI().updateAppState();
|
|
744
792
|
},
|
|
745
793
|
onFiltersChanged: function(oEvent) {
|
|
746
|
-
var oFilterBar = this._getFilterBarControl()
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
794
|
+
var oFilterBar = this._getFilterBarControl();
|
|
795
|
+
if (oFilterBar) {
|
|
796
|
+
var oInternalModelContext = this.getView().getBindingContext("internal");
|
|
797
|
+
// Pending filters into FilterBar to be used for custom views
|
|
798
|
+
this.onPendingFilters();
|
|
799
|
+
oInternalModelContext.setProperty("appliedFilters", oFilterBar.getAssignedFiltersText().filtersText);
|
|
800
|
+
if (oEvent.getParameter("conditionsBased")) {
|
|
801
|
+
oInternalModelContext.setProperty("hasPendingFilters", true);
|
|
802
|
+
}
|
|
754
803
|
}
|
|
755
804
|
},
|
|
756
805
|
onVariantSelected: function(oEvent) {
|
|
@@ -787,17 +836,13 @@ sap.ui.define(
|
|
|
787
836
|
if (this._isMultiMode()) {
|
|
788
837
|
var aControls = this._getControls(),
|
|
789
838
|
oMultiModeControl = this._getMultiModeControl();
|
|
790
|
-
|
|
791
|
-
var aItems = oMultiModeControl.getItems();
|
|
792
|
-
aItems.forEach(function(oItem) {
|
|
793
|
-
if (!oItem.getKey().indexOf("fe::Chart") > -1) {
|
|
794
|
-
oItem.data("outdatedCounts", true);
|
|
795
|
-
}
|
|
796
|
-
});
|
|
797
|
-
}
|
|
839
|
+
this._setCountsOutDated();
|
|
798
840
|
if (!this._isCustomTab()) {
|
|
799
841
|
var sDisplayedControlId = this._getCurrentControl().getId();
|
|
800
|
-
this.
|
|
842
|
+
this._updateMultiTabNotApplicableFields(oInternalModelContext, oFilterBar);
|
|
843
|
+
// This should be done outside the search event handler of the filter bar.
|
|
844
|
+
// The same logic is required when filter bar is hidden and multiple tables exist on the LR.
|
|
845
|
+
// This is currently done in ListReport/overrides/ViewState.js#onAfterStateApplied()
|
|
801
846
|
aControls.forEach(function(oControl) {
|
|
802
847
|
oControl.data("outdatedRows", oControl.getId() !== sDisplayedControlId);
|
|
803
848
|
});
|
|
@@ -809,6 +854,8 @@ sap.ui.define(
|
|
|
809
854
|
refreshCause: "search"
|
|
810
855
|
});
|
|
811
856
|
}
|
|
857
|
+
} else {
|
|
858
|
+
this._updateALPNotApplicableFields(oInternalModelContext, oFilterBar);
|
|
812
859
|
}
|
|
813
860
|
if (oMdcChart) {
|
|
814
861
|
// disable bound actions TODO: this clears everything for the chart?
|
|
@@ -836,6 +883,11 @@ sap.ui.define(
|
|
|
836
883
|
if (this.getView().getViewData().liveMode === false) {
|
|
837
884
|
this.getExtensionAPI().updateAppState();
|
|
838
885
|
}
|
|
886
|
+
|
|
887
|
+
if (Device.system.phone) {
|
|
888
|
+
var oDynamicPage = this.getView().byId("fe::ListReport");
|
|
889
|
+
oDynamicPage.setHeaderExpanded(false);
|
|
890
|
+
}
|
|
839
891
|
},
|
|
840
892
|
/**
|
|
841
893
|
* Triggers an outbound navigation when a user chooses the chevron.
|
|
@@ -871,7 +923,7 @@ sap.ui.define(
|
|
|
871
923
|
if (sTemplateContentView === TemplateContentView.Chart) {
|
|
872
924
|
this.hasPendingChartChanges = true;
|
|
873
925
|
} else {
|
|
874
|
-
oTable && oTable.
|
|
926
|
+
oTable && oTable.rebind();
|
|
875
927
|
this.hasPendingChartChanges = false;
|
|
876
928
|
}
|
|
877
929
|
},
|
|
@@ -935,31 +987,11 @@ sap.ui.define(
|
|
|
935
987
|
.setVisible(true);
|
|
936
988
|
}
|
|
937
989
|
},
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
this.getExtensionAPI().updateAppState();
|
|
941
|
-
}
|
|
990
|
+
onStateChanged: function(oEvent) {
|
|
991
|
+
this.getExtensionAPI().updateAppState();
|
|
942
992
|
}
|
|
943
993
|
},
|
|
944
994
|
formatters: {
|
|
945
|
-
isDraftIndicatorVisible: function(
|
|
946
|
-
sPropertyPath,
|
|
947
|
-
sSemanticKeyHasDraftIndicator,
|
|
948
|
-
HasDraftEntity,
|
|
949
|
-
IsActiveEntity,
|
|
950
|
-
hideDraftInfo
|
|
951
|
-
) {
|
|
952
|
-
if (
|
|
953
|
-
IsActiveEntity !== undefined &&
|
|
954
|
-
HasDraftEntity !== undefined &&
|
|
955
|
-
(!IsActiveEntity || HasDraftEntity) &&
|
|
956
|
-
!hideDraftInfo
|
|
957
|
-
) {
|
|
958
|
-
return sPropertyPath === sSemanticKeyHasDraftIndicator;
|
|
959
|
-
} else {
|
|
960
|
-
return false;
|
|
961
|
-
}
|
|
962
|
-
},
|
|
963
995
|
/**
|
|
964
996
|
* Method to set the message text for the multiple entity sets when fields in the FilterBar need to be ignored.
|
|
965
997
|
*
|
|
@@ -968,10 +1000,10 @@ sap.ui.define(
|
|
|
968
1000
|
* @returns {string} Message text
|
|
969
1001
|
*/
|
|
970
1002
|
setTabMessageStrip: function(aIgnoredFields, sTabTitle) {
|
|
971
|
-
var sText = ""
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1003
|
+
var sText = "",
|
|
1004
|
+
oFilterBar = this._getFilterBarControl();
|
|
1005
|
+
if (oFilterBar && Array.isArray(aIgnoredFields) && aIgnoredFields.length > 0 && sTabTitle) {
|
|
1006
|
+
var sFilterBarEntityPath = oFilterBar.data("entityType"),
|
|
975
1007
|
oMetaModel = this.getView()
|
|
976
1008
|
.getModel()
|
|
977
1009
|
.getMetaModel(),
|
|
@@ -997,6 +1029,42 @@ sap.ui.define(
|
|
|
997
1029
|
}
|
|
998
1030
|
}
|
|
999
1031
|
return sText;
|
|
1032
|
+
},
|
|
1033
|
+
/**
|
|
1034
|
+
* Formatter for the message text for the chart when fields in the FilterBar need to be ignored.
|
|
1035
|
+
*
|
|
1036
|
+
* @param {Array} aIgnoredFields Array of ignored fields in the FilterBar for the current tab (multiple entity sets)
|
|
1037
|
+
* @returns {string} Message text
|
|
1038
|
+
*/
|
|
1039
|
+
setChartMessageStrip: function(aIgnoredFields) {
|
|
1040
|
+
var sText = "";
|
|
1041
|
+
if (Array.isArray(aIgnoredFields) && aIgnoredFields.length > 0) {
|
|
1042
|
+
var oFilterBar = this._getFilterBarControl(),
|
|
1043
|
+
sFilterBarEntityPath = oFilterBar.data("entityType"),
|
|
1044
|
+
oMetaModel = this.getView()
|
|
1045
|
+
.getModel()
|
|
1046
|
+
.getMetaModel(),
|
|
1047
|
+
oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.templates"),
|
|
1048
|
+
aIgnoredLabels = aIgnoredFields.map(function(sProperty) {
|
|
1049
|
+
if (sProperty === "$search") {
|
|
1050
|
+
var oMacroResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.macros");
|
|
1051
|
+
return oMacroResourceBundle ? oMacroResourceBundle.getText("M_FILTERBAR_SEARCH") : "";
|
|
1052
|
+
}
|
|
1053
|
+
var sLabel = oMetaModel.getObject(
|
|
1054
|
+
sFilterBarEntityPath + sProperty + "@com.sap.vocabularies.Common.v1.Label"
|
|
1055
|
+
);
|
|
1056
|
+
return DelegateUtil.getLocalizedText(sLabel, oFilterBar);
|
|
1057
|
+
});
|
|
1058
|
+
if (oResourceBundle) {
|
|
1059
|
+
var sResource =
|
|
1060
|
+
"C_LR_MULTIVIZ_CHART_" +
|
|
1061
|
+
(aIgnoredLabels.length === 1 ? "SINGLE" : "MULTI") +
|
|
1062
|
+
"_IGNORED_FILTER_" +
|
|
1063
|
+
(Device.system.desktop ? "LARGE" : "SMALL");
|
|
1064
|
+
sText = oResourceBundle.getText(sResource, [aIgnoredLabels.join(", ")]);
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
return sText;
|
|
1000
1068
|
}
|
|
1001
1069
|
}
|
|
1002
1070
|
});
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
|
-
sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
|
|
6
|
+
sap.ui.define(["sap/fe/core/CommonUtils", "sap/fe/macros/filter/FilterUtils"], function(CommonUtils, FilterUtils) {
|
|
6
7
|
"use strict";
|
|
7
8
|
return {
|
|
8
9
|
adaptNavigationContext: function(oSelectionVariant, oTargetInfo) {
|
|
10
|
+
var oView = this.getView(),
|
|
11
|
+
oController = oView.getController(),
|
|
12
|
+
oFilterBar = oController._getFilterBarControl();
|
|
9
13
|
// Adding filter bar values to the navigation does not make sense if no context has been selected.
|
|
10
|
-
// Hence only consider filter bar values when
|
|
11
|
-
if (!oSelectionVariant.isEmpty()) {
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
var oFilterBarConditions = Object.assign({}, this.base.getView().getController().filterBarConditions);
|
|
17
|
-
var aParameters = [];
|
|
14
|
+
// Hence only consider filter bar values when SelectionVariant is not empty
|
|
15
|
+
if (oFilterBar && !oSelectionVariant.isEmpty()) {
|
|
16
|
+
var oViewData = oView.getViewData(),
|
|
17
|
+
sRootPath = oViewData.fullContextPath + oViewData.entitySet,
|
|
18
|
+
oFilterBarConditions = Object.assign({}, this.base.getView().getController().filterBarConditions),
|
|
19
|
+
aParameters = [];
|
|
18
20
|
|
|
19
21
|
if (oViewData.contextPath) {
|
|
20
22
|
var oMetaModel = oView.getModel().getMetaModel(),
|
|
@@ -28,8 +30,11 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
|
|
|
28
30
|
sRootPath,
|
|
29
31
|
aParameters
|
|
30
32
|
);
|
|
33
|
+
var oFilterInfo = FilterUtils.getFilterInfo(oFilterBar, {
|
|
34
|
+
targetControl: oController._getTable()
|
|
35
|
+
}).filters;
|
|
31
36
|
var oInternalModelContext = oView.getBindingContext("internal");
|
|
32
|
-
var mTabs = oInternalModelContext.getProperty("tabs");
|
|
37
|
+
var mTabs = oInternalModelContext && oInternalModelContext.getProperty("tabs");
|
|
33
38
|
// Do we need to exclude Fields (mutli tables mode)?
|
|
34
39
|
if (mTabs) {
|
|
35
40
|
var aIgnoredFieldsForTab = mTabs.ignoredFields[mTabs.selected];
|
|
@@ -40,7 +45,7 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
|
|
|
40
45
|
}
|
|
41
46
|
}
|
|
42
47
|
// TODO: move this also into the intent based navigation controller extension
|
|
43
|
-
CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo);
|
|
48
|
+
CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo, oFilterInfo);
|
|
44
49
|
delete oTargetInfo.propertiesWithoutConflict;
|
|
45
50
|
}
|
|
46
51
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* SAPUI5
|
|
3
|
-
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
(c) Copyright 2009-2021 SAP SE. All rights reserved
|
|
4
|
+
|
|
4
5
|
*/
|
|
5
6
|
sap.ui.define(
|
|
6
7
|
["sap/fe/core/helpers/SemanticDateOperators", "sap/ui/core/routing/HashChanger", "sap/fe/core/CommonUtils", "sap/base/Log"],
|
|
@@ -52,11 +53,19 @@ sap.ui.define(
|
|
|
52
53
|
}
|
|
53
54
|
|
|
54
55
|
function getShareUrl() {
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
var oUShellContainer = sap.ushell && sap.ushell.Container;
|
|
57
|
+
if (oUShellContainer) {
|
|
58
|
+
return oUShellContainer
|
|
59
|
+
.getFLPUrlAsync(true)
|
|
60
|
+
.then(function(sFLPUrl) {
|
|
61
|
+
return sFLPUrl;
|
|
62
|
+
})
|
|
63
|
+
.catch(function(sError) {
|
|
64
|
+
Log.error("Could not retrieve cFLP URL for the sharing dialog (dialog will not be opened)", sError);
|
|
65
|
+
});
|
|
66
|
+
} else {
|
|
67
|
+
return Promise.resolve(document.URL);
|
|
68
|
+
}
|
|
60
69
|
}
|
|
61
70
|
|
|
62
71
|
function getSaveAsTileServiceUrl(oController) {
|
|
@@ -66,13 +75,14 @@ sap.ui.define(
|
|
|
66
75
|
.getContent()[0]
|
|
67
76
|
.data("filterBarId")
|
|
68
77
|
);
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
if (oFilterBar) {
|
|
79
|
+
var oConditions = oFilterBar.getFilterConditions();
|
|
80
|
+
var bSaveAsTileServiceUrlAllowed = SemanticDateOperators.hasSemanticDateOperations(oConditions);
|
|
81
|
+
if (bSaveAsTileServiceUrlAllowed) {
|
|
82
|
+
return getCountUrl(oController);
|
|
83
|
+
}
|
|
75
84
|
}
|
|
85
|
+
return "";
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
function getJamUrl() {
|
|
@@ -99,22 +109,29 @@ sap.ui.define(
|
|
|
99
109
|
return {
|
|
100
110
|
adaptShareMetadata: function(oShareMetadata) {
|
|
101
111
|
var that = this;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
Promise.resolve(getJamUrl())
|
|
113
|
+
.then(function(sJamUrl) {
|
|
114
|
+
var oAppComponent = CommonUtils.getAppComponent(that.base.getView());
|
|
115
|
+
var oMetadata = oAppComponent.getMetadata();
|
|
116
|
+
var oUIManifest = oMetadata.getManifestEntry("sap.ui");
|
|
117
|
+
var sIcon = (oUIManifest && oUIManifest.icons && oUIManifest.icons.icon) || "";
|
|
118
|
+
var oAppManifest = oMetadata.getManifestEntry("sap.app");
|
|
119
|
+
var sTitle = (oAppManifest && oAppManifest.title) || "";
|
|
120
|
+
// TODO: check if there is any semantic date used before adding serviceURL as BLI:FIORITECHP1-18023
|
|
121
|
+
oShareMetadata.tile = {
|
|
122
|
+
icon: sIcon,
|
|
123
|
+
title: sTitle,
|
|
124
|
+
queryUrl: getSaveAsTileServiceUrl(that.base)
|
|
125
|
+
};
|
|
126
|
+
oShareMetadata.title = document.title;
|
|
127
|
+
oShareMetadata.jam.url = sJamUrl;
|
|
128
|
+
})
|
|
129
|
+
.catch(function(error) {
|
|
130
|
+
Log.error(error);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
return Promise.resolve(getShareUrl()).then(function(sFLPUrl) {
|
|
134
|
+
oShareMetadata.url = sFLPUrl;
|
|
118
135
|
return oShareMetadata;
|
|
119
136
|
});
|
|
120
137
|
}
|