@sapui5/sap.fe.templates 1.95.0 → 1.96.4
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/ListComponent.js +1 -1
- package/src/sap/fe/templates/ListReport/Component.js +1 -1
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +2 -2
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +2 -1
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +62 -49
- 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 +110 -25
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +23 -3
- 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 +2 -2
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +90 -113
- 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 +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +87 -63
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +7 -3
- 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 +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +1 -0
- 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 +110 -8
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +35 -1
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +29 -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 +1 -1
- package/src/sap/fe/templates/controls/Chart.fragment.xml +6 -2
- 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 +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 +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 +1 -1
- 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 +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 +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 +1 -1
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
- 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/package.json
CHANGED
|
@@ -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
|
// Helper class used to help create content in the chart/item and fill relevant metadata
|
|
@@ -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(["sap/fe/core/ExtensionAPI", "sap/fe/macros/filter/FilterUtils", "sap/fe/macros/chart/ChartUtils"], function(
|
|
6
6
|
ExtensionAPI,
|
|
@@ -59,7 +59,7 @@ sap.ui.define(["sap/fe/core/ExtensionAPI", "sap/fe/macros/filter/FilterUtils", "
|
|
|
59
59
|
*/
|
|
60
60
|
getSelectedContexts: function() {
|
|
61
61
|
var oControl = (this._controller._isMultiMode() && this._controller._getCurrentControl()) || this._controller._getTable();
|
|
62
|
-
if (oControl.isA("sap.ui.mdc.
|
|
62
|
+
if (oControl.isA("sap.ui.mdc.ChartNew")) {
|
|
63
63
|
var aSelectedContexts = [];
|
|
64
64
|
if (oControl && oControl.get_chart()) {
|
|
65
65
|
var aSelectedDataPoints = ChartUtils.getChartSelectedData(oControl.get_chart());
|
|
@@ -157,10 +157,11 @@
|
|
|
157
157
|
<macroInternal:FilterBar
|
|
158
158
|
unittest:id="listReportFilterBarTest"
|
|
159
159
|
id="{converterContext>filterBarId}"
|
|
160
|
+
_applyIdToContent="true"
|
|
160
161
|
contextPath="{entityType>}"
|
|
161
162
|
variantBackreference="{= CORE.getVariantBackReference(${viewData>}, ${converterContext>} )}"
|
|
162
163
|
selectionFields="{filterBarContext>selectionFields}"
|
|
163
|
-
|
|
164
|
+
filterChanged=".handlers.onFiltersChanged"
|
|
164
165
|
filterConditions="{parts:[{path:'converterContext>filterConditions'}, {path:'entitySet>'}], formatter: 'FILTER.getFilterConditions'}"
|
|
165
166
|
search=".handlers.onSearch"
|
|
166
167
|
hideBasicSearch="{filterBarContext>hideBasicSearch}"
|
|
@@ -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(
|
|
@@ -144,6 +144,7 @@ sap.ui.define(
|
|
|
144
144
|
|
|
145
145
|
oInternalModelContext.setProperty("hasPendingFilters", true);
|
|
146
146
|
oInternalModelContext.setProperty("appliedFilters", "");
|
|
147
|
+
oInternalModelContext.setProperty("hideDraftInfo", false);
|
|
147
148
|
oInternalModelContext.setProperty("uom", {});
|
|
148
149
|
oInternalModelContext.setProperty("scalefactor", {});
|
|
149
150
|
oInternalModelContext.setProperty("scalefactorNumber", {});
|
|
@@ -244,21 +245,14 @@ sap.ui.define(
|
|
|
244
245
|
});
|
|
245
246
|
},
|
|
246
247
|
onPageReady: function(mParameters) {
|
|
247
|
-
var oLastFocusedControl = mParameters.lastFocusedControl;
|
|
248
|
-
var oView = this.getView();
|
|
249
|
-
// set the focus to the first action button, or to the first editable input if in editable mode
|
|
250
|
-
if (oLastFocusedControl && oLastFocusedControl.controlId && oLastFocusedControl.focusInfo) {
|
|
251
|
-
var oFocusControl = oView.byId(oLastFocusedControl.controlId);
|
|
252
|
-
if (oFocusControl) {
|
|
253
|
-
oFocusControl.applyFocusInfo(oLastFocusedControl.focusInfo);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
|
|
257
248
|
// Enabling mandatory filter fields message dialog and focusing on them
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
oFilterBar.
|
|
249
|
+
if (mParameters.forceFocus) {
|
|
250
|
+
var oFilterBar = this._getFilterBarControl();
|
|
251
|
+
|
|
252
|
+
if (oFilterBar && !oFilterBar.getShowMessages()) {
|
|
253
|
+
oFilterBar.setShowMessages(true);
|
|
254
|
+
oFilterBar.setFocusOnFirstErroneousField();
|
|
255
|
+
}
|
|
262
256
|
}
|
|
263
257
|
},
|
|
264
258
|
|
|
@@ -317,21 +311,18 @@ sap.ui.define(
|
|
|
317
311
|
*/
|
|
318
312
|
_updateTableActions: function(aTables) {
|
|
319
313
|
var aIBNActions = [];
|
|
320
|
-
aTables.forEach(
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
CommonUtils.setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts);
|
|
333
|
-
}.bind(this)
|
|
334
|
-
);
|
|
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
|
+
});
|
|
335
326
|
CommonUtils.updateDataFieldForIBNButtonsVisibility(aIBNActions, this.getView());
|
|
336
327
|
},
|
|
337
328
|
|
|
@@ -413,6 +404,10 @@ sap.ui.define(
|
|
|
413
404
|
return this._oListReportControl;
|
|
414
405
|
},
|
|
415
406
|
_getTable: function() {
|
|
407
|
+
if (this._isMultiMode()) {
|
|
408
|
+
var oControl = this._getCurrentControl();
|
|
409
|
+
return oControl && oControl.isA("sap.ui.mdc.Table") ? oControl : undefined;
|
|
410
|
+
}
|
|
416
411
|
return this.getView().byId(this._getTableControlId());
|
|
417
412
|
},
|
|
418
413
|
_getChart: function() {
|
|
@@ -569,7 +564,10 @@ sap.ui.define(
|
|
|
569
564
|
aCharts.forEach(function(oChart) {
|
|
570
565
|
var sChartEntityPath = oChart.data("targetCollectionPath"),
|
|
571
566
|
sChartEntitySet = sChartEntityPath.slice(1),
|
|
572
|
-
sTabId = oChart
|
|
567
|
+
sTabId = oChart
|
|
568
|
+
.getParent()
|
|
569
|
+
.getParent()
|
|
570
|
+
.getKey(),
|
|
573
571
|
sCacheKey = sChartEntitySet + "Chart";
|
|
574
572
|
if (!mCache[sCacheKey]) {
|
|
575
573
|
mCache[sCacheKey] = FilterUtils.getNotApplicableFilters(oFilterBar, oChart);
|
|
@@ -610,7 +608,7 @@ sap.ui.define(
|
|
|
610
608
|
var oControl = that.getView().byId(oItem.getKey());
|
|
611
609
|
if (
|
|
612
610
|
oControl &&
|
|
613
|
-
!oControl.isA("sap.ui.mdc.
|
|
611
|
+
!oControl.isA("sap.ui.mdc.ChartNew") &&
|
|
614
612
|
(oItem.data("outdatedCounts") || oControl.getId() === sDisplayedControlId)
|
|
615
613
|
) {
|
|
616
614
|
aCompliantTabs.push({
|
|
@@ -667,8 +665,9 @@ sap.ui.define(
|
|
|
667
665
|
}
|
|
668
666
|
},
|
|
669
667
|
_updateChart: function(oChart) {
|
|
670
|
-
|
|
671
|
-
|
|
668
|
+
var oInnerChart = oChart.getControlDelegate()._getChart(oChart);
|
|
669
|
+
if (!(oInnerChart && oInnerChart.isBound("data")) || this.hasPendingTableChanges) {
|
|
670
|
+
oChart.getControlDelegate().rebindChart(oChart, oInnerChart.getBindingInfo("data"));
|
|
672
671
|
this.hasPendingTableChanges = false;
|
|
673
672
|
}
|
|
674
673
|
},
|
|
@@ -691,7 +690,7 @@ sap.ui.define(
|
|
|
691
690
|
refreshCause: "tabChanged"
|
|
692
691
|
});
|
|
693
692
|
} else if (
|
|
694
|
-
!oDisplayedControl.isA("sap.ui.mdc.
|
|
693
|
+
!oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
|
|
695
694
|
(!oDisplayedControl.getRowBinding() || // first time the tab/table is displayed
|
|
696
695
|
oDisplayedControl.data("outdatedRows") === true)
|
|
697
696
|
) {
|
|
@@ -699,11 +698,15 @@ sap.ui.define(
|
|
|
699
698
|
oDisplayedControl.rebindTable();
|
|
700
699
|
oDisplayedControl.data("outdatedRows", false);
|
|
701
700
|
} else if (
|
|
702
|
-
oDisplayedControl.isA("sap.ui.mdc.
|
|
703
|
-
(!oDisplayedControl
|
|
701
|
+
oDisplayedControl.isA("sap.ui.mdc.ChartNew") &&
|
|
702
|
+
(!oDisplayedControl
|
|
703
|
+
.getControlDelegate()
|
|
704
|
+
._getChart(oDisplayedControl)
|
|
705
|
+
.getBinding("data") || // first time the tab/chart is displayed
|
|
704
706
|
oDisplayedControl.data("outdatedRows") === true)
|
|
705
707
|
) {
|
|
706
|
-
oDisplayedControl.getControlDelegate().
|
|
708
|
+
var oInnerChart = oDisplayedControl.getControlDelegate()._getChart(oDisplayedControl);
|
|
709
|
+
oDisplayedControl.getControlDelegate().rebindChart(oDisplayedControl, oInnerChart.getBindingInfo("data"));
|
|
707
710
|
oDisplayedControl.data("outdatedRows", false);
|
|
708
711
|
}
|
|
709
712
|
}
|
|
@@ -714,8 +717,10 @@ sap.ui.define(
|
|
|
714
717
|
oInternalModelContext = this.getView().getBindingContext("internal");
|
|
715
718
|
// Pending filters into FilterBar to be used for custom views
|
|
716
719
|
this.onPendingFilters();
|
|
720
|
+
var bHideDraft = FilterUtils.getEditStateIsHideDraft(oFilterBar.getConditions());
|
|
717
721
|
oInternalModelContext.setProperty("appliedFilters", oFilterBar.getAssignedFiltersText().filtersText);
|
|
718
722
|
oInternalModelContext.setProperty("hasPendingFilters", true);
|
|
723
|
+
oInternalModelContext.setProperty("hideDraftInfo", bHideDraft);
|
|
719
724
|
if (oEvent.getParameter("conditionsBased")) {
|
|
720
725
|
this.getExtensionAPI().updateAppState();
|
|
721
726
|
}
|
|
@@ -800,13 +805,13 @@ 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
|
-
* @param {string} sCreatePath Create path
|
|
809
|
-
* @returns {Promise} Promise which is resolved once the navigation is triggered
|
|
813
|
+
* @param {string} sCreatePath Create path when the chevron is created.
|
|
814
|
+
* @returns {Promise} Promise which is resolved once the navigation is triggered
|
|
810
815
|
* @ui5-restricted
|
|
811
816
|
* @final
|
|
812
817
|
*/
|
|
@@ -819,11 +824,11 @@ sap.ui.define(
|
|
|
819
824
|
);
|
|
820
825
|
},
|
|
821
826
|
onChartSelectionChanged: function(oEvent) {
|
|
822
|
-
var oMdcChart = oEvent.getSource(),
|
|
827
|
+
var oMdcChart = oEvent.getSource().getContent(),
|
|
823
828
|
oTable = this._getTable(),
|
|
824
|
-
|
|
829
|
+
aData = oEvent.getParameter("data"),
|
|
825
830
|
oInternalModelContext = this.getView().getBindingContext("internal");
|
|
826
|
-
if (
|
|
831
|
+
if (aData) {
|
|
827
832
|
// update action buttons enablement / disablement
|
|
828
833
|
ChartRuntime.fnUpdateChart(oEvent);
|
|
829
834
|
// update selections on selection or deselection
|
|
@@ -899,8 +904,19 @@ sap.ui.define(
|
|
|
899
904
|
}
|
|
900
905
|
},
|
|
901
906
|
formatters: {
|
|
902
|
-
isDraftIndicatorVisible: function(
|
|
903
|
-
|
|
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
|
+
) {
|
|
904
920
|
return sPropertyPath === sSemanticKeyHasDraftIndicator;
|
|
905
921
|
} else {
|
|
906
922
|
return false;
|
|
@@ -943,9 +959,6 @@ sap.ui.define(
|
|
|
943
959
|
}
|
|
944
960
|
}
|
|
945
961
|
return sText;
|
|
946
|
-
},
|
|
947
|
-
compareTitleFromTableAndTab: function(headerVisible, tableTitle, tabTitle) {
|
|
948
|
-
return this.commonFormatters.compareTitleFromTableAndTab(headerVisible, tableTitle, tabTitle, this);
|
|
949
962
|
}
|
|
950
963
|
}
|
|
951
964
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
|
|
5
|
+
sap.ui.define(["sap/fe/core/CommonUtils", "sap/fe/macros/filter/FilterUtils"], function(CommonUtils, FilterUtils) {
|
|
6
6
|
"use strict";
|
|
7
7
|
return {
|
|
8
8
|
adaptNavigationContext: function(oSelectionVariant, oTargetInfo) {
|
|
@@ -28,6 +28,10 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
|
|
|
28
28
|
sRootPath,
|
|
29
29
|
aParameters
|
|
30
30
|
);
|
|
31
|
+
var oFilterBar = oController._getFilterBarControl();
|
|
32
|
+
var oFilterInfo = FilterUtils.getFilterInfo(oFilterBar, {
|
|
33
|
+
targetControl: oController._getTable()
|
|
34
|
+
}).filters;
|
|
31
35
|
var oInternalModelContext = oView.getBindingContext("internal");
|
|
32
36
|
var mTabs = oInternalModelContext.getProperty("tabs");
|
|
33
37
|
// Do we need to exclude Fields (mutli tables mode)?
|
|
@@ -40,7 +44,7 @@ sap.ui.define(["sap/fe/core/CommonUtils"], function(CommonUtils) {
|
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
// TODO: move this also into the intent based navigation controller extension
|
|
43
|
-
CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo);
|
|
47
|
+
CommonUtils.addExternalStateFiltersToSelectionVariant(oSelectionVariant, oFilterBarConditions, oTargetInfo, oFilterInfo);
|
|
44
48
|
delete oTargetInfo.propertiesWithoutConflict;
|
|
45
49
|
}
|
|
46
50
|
},
|
|
@@ -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
|
["sap/fe/core/helpers/SemanticDateOperators", "sap/ui/core/routing/HashChanger", "sap/fe/core/CommonUtils", "sap/base/Log"],
|
|
@@ -52,11 +52,19 @@ sap.ui.define(
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function getShareUrl() {
|
|
55
|
-
var
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
var oUShellContainer = sap.ushell && sap.ushell.Container;
|
|
56
|
+
if (oUShellContainer) {
|
|
57
|
+
return oUShellContainer
|
|
58
|
+
.getFLPUrlAsync(true)
|
|
59
|
+
.then(function(sFLPUrl) {
|
|
60
|
+
return sFLPUrl;
|
|
61
|
+
})
|
|
62
|
+
.catch(function(sError) {
|
|
63
|
+
Log.error("Could not retrieve cFLP URL for the sharing dialog (dialog will not be opened)", sError);
|
|
64
|
+
});
|
|
65
|
+
} else {
|
|
66
|
+
return Promise.resolve(document.URL);
|
|
67
|
+
}
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
function getSaveAsTileServiceUrl(oController) {
|
|
@@ -99,22 +107,29 @@ sap.ui.define(
|
|
|
99
107
|
return {
|
|
100
108
|
adaptShareMetadata: function(oShareMetadata) {
|
|
101
109
|
var that = this;
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
Promise.resolve(getJamUrl())
|
|
111
|
+
.then(function(sJamUrl) {
|
|
112
|
+
var oAppComponent = CommonUtils.getAppComponent(that.base.getView());
|
|
113
|
+
var oMetadata = oAppComponent.getMetadata();
|
|
114
|
+
var oUIManifest = oMetadata.getManifestEntry("sap.ui");
|
|
115
|
+
var sIcon = (oUIManifest && oUIManifest.icons && oUIManifest.icons.icon) || "";
|
|
116
|
+
var oAppManifest = oMetadata.getManifestEntry("sap.app");
|
|
117
|
+
var sTitle = (oAppManifest && oAppManifest.title) || "";
|
|
118
|
+
// TODO: check if there is any semantic date used before adding serviceURL as BLI:FIORITECHP1-18023
|
|
119
|
+
oShareMetadata.tile = {
|
|
120
|
+
icon: sIcon,
|
|
121
|
+
title: sTitle,
|
|
122
|
+
queryUrl: getSaveAsTileServiceUrl(that.base)
|
|
123
|
+
};
|
|
124
|
+
oShareMetadata.title = document.title;
|
|
125
|
+
oShareMetadata.jam.url = sJamUrl;
|
|
126
|
+
})
|
|
127
|
+
.catch(function(error) {
|
|
128
|
+
Log.error(error);
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
return Promise.resolve(getShareUrl()).then(function(sFLPUrl) {
|
|
132
|
+
oShareMetadata.url = sFLPUrl;
|
|
118
133
|
return oShareMetadata;
|
|
119
134
|
});
|
|
120
135
|
}
|
|
@@ -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
|
[
|
|
@@ -10,9 +10,10 @@ sap.ui.define(
|
|
|
10
10
|
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
11
11
|
"sap/ui/mdc/p13n/StateUtil",
|
|
12
12
|
"sap/ui/Device",
|
|
13
|
-
"sap/ui/mdc/enum/ConditionValidated"
|
|
13
|
+
"sap/ui/mdc/enum/ConditionValidated",
|
|
14
|
+
"sap/base/Log"
|
|
14
15
|
],
|
|
15
|
-
function(CoreLibrary, NavLibrary, CommonUtils, ControlVariantApplyAPI, StateUtil, Device, ConditionValidated) {
|
|
16
|
+
function(CoreLibrary, NavLibrary, CommonUtils, ControlVariantApplyAPI, StateUtil, Device, ConditionValidated, Log) {
|
|
16
17
|
"use strict";
|
|
17
18
|
|
|
18
19
|
var NavType = NavLibrary.NavType,
|
|
@@ -121,28 +122,109 @@ sap.ui.define(
|
|
|
121
122
|
},
|
|
122
123
|
applyNavigationParameters: function(oNavigationParameter, aResults) {
|
|
123
124
|
var oView = this.getView(),
|
|
125
|
+
that = this,
|
|
126
|
+
oController = oView.getController(),
|
|
127
|
+
oAppComponent = oController.getAppComponent(oView),
|
|
128
|
+
oComponentData = oAppComponent.getComponentData(),
|
|
129
|
+
oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
|
|
130
|
+
oVariantPromise = that.handleVariantIdPassedViaURLParams(oStartupParameters),
|
|
131
|
+
bFilterVariantApplied;
|
|
132
|
+
aResults.push(
|
|
133
|
+
oVariantPromise
|
|
134
|
+
.then(function(aVariants) {
|
|
135
|
+
if (aVariants && aVariants.length > 0) {
|
|
136
|
+
if (aVariants[0] === true || aVariants[1] === true) {
|
|
137
|
+
bFilterVariantApplied = true;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
return that._applySelectionVariant(oView, oNavigationParameter, bFilterVariantApplied).then(function() {
|
|
141
|
+
var oDynamicPage = oView.byId("fe::ListReport");
|
|
142
|
+
var bPreventInitialSearch = false;
|
|
143
|
+
var oFilterBarVM = that._getFilterBarVM(oView);
|
|
144
|
+
var oFilterBarControl = oController._getFilterBarControl();
|
|
145
|
+
if (
|
|
146
|
+
(oNavigationParameter.navigationType !== NavType.initial &&
|
|
147
|
+
oNavigationParameter.requiresStandardVariant) ||
|
|
148
|
+
(!oFilterBarVM && oView.getViewData().initialLoad === InitialLoadMode.Enabled) ||
|
|
149
|
+
oController._shouldAutoTriggerSearch(oFilterBarVM)
|
|
150
|
+
) {
|
|
151
|
+
oFilterBarControl.triggerSearch();
|
|
152
|
+
} else {
|
|
153
|
+
bPreventInitialSearch = that._preventInitialSearch(oFilterBarVM);
|
|
154
|
+
}
|
|
155
|
+
that._bSearchTriggered = !bPreventInitialSearch;
|
|
156
|
+
oDynamicPage.setHeaderExpanded(Device.system.desktop || bPreventInitialSearch);
|
|
157
|
+
});
|
|
158
|
+
})
|
|
159
|
+
.catch(function() {
|
|
160
|
+
Log.error("Variant ID cannot be applied");
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
handleVariantIdPassedViaURLParams: function(oUrlParams) {
|
|
166
|
+
var aPageVariantId = oUrlParams["sap-ui-fe-variant-id"],
|
|
167
|
+
aFilterBarVariantId = oUrlParams["sap-ui-fe-filterbar-variant-id"],
|
|
168
|
+
aTableVariantId = oUrlParams["sap-ui-fe-table-variant-id"],
|
|
169
|
+
oVariant;
|
|
170
|
+
if (aPageVariantId || aFilterBarVariantId || aTableVariantId) {
|
|
171
|
+
oVariant = {
|
|
172
|
+
sPageVariantId: aPageVariantId && aPageVariantId[0],
|
|
173
|
+
sFilterBarVariantId: aFilterBarVariantId && aFilterBarVariantId[0],
|
|
174
|
+
sTableVariantId: aTableVariantId && aTableVariantId[0]
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
return this._handleControlVariantId(oVariant);
|
|
178
|
+
},
|
|
179
|
+
|
|
180
|
+
_handleControlVariantId: function(oVariantIDs) {
|
|
181
|
+
var oView = this.getView(),
|
|
182
|
+
aPromises = [],
|
|
124
183
|
that = this;
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
184
|
+
var sVariantManagement = oView.getViewData().variantManagement;
|
|
185
|
+
if (oVariantIDs && oVariantIDs.sPageVariantId && sVariantManagement === "Page") {
|
|
186
|
+
var oVM = oView.byId("fe::PageVariantManagement");
|
|
187
|
+
oVM.getVariants().forEach(function(oVariant) {
|
|
188
|
+
if (oVariant.key === oVariantIDs.sPageVariantId) {
|
|
189
|
+
aPromises.push(that._applyControlVariant(oVM, oVariantIDs.sPageVariantId, true));
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
} else if (oVariantIDs && sVariantManagement === "Control") {
|
|
193
|
+
if (oVariantIDs.sFilterBarVariantId) {
|
|
194
|
+
var oVM = oView.byId(oView.getContent()[0].data("filterBarVariantId"));
|
|
195
|
+
oVM.getVariants().forEach(function(oVariant) {
|
|
196
|
+
if (oVariant.key === oVariantIDs.sFilterBarVariantId) {
|
|
197
|
+
aPromises.push(that._applyControlVariant(oVM, oVariantIDs.sFilterBarVariantId, true));
|
|
198
|
+
}
|
|
199
|
+
});
|
|
139
200
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
201
|
+
if (oVariantIDs.sTableVariantId) {
|
|
202
|
+
var oController = oView.getController(),
|
|
203
|
+
aTables = oController._getControls("table");
|
|
204
|
+
aTables.forEach(function(oTable) {
|
|
205
|
+
var oTableVariant = oTable.getVariant();
|
|
206
|
+
if (oTable && oTableVariant) {
|
|
207
|
+
oTableVariant.getVariants().forEach(function(oVariant) {
|
|
208
|
+
if (oVariant.key === oVariantIDs.sTableVariantId) {
|
|
209
|
+
aPromises.push(that._applyControlVariant(oTableVariant, oVariantIDs.sTableVariantId));
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return Promise.all(aPromises);
|
|
144
217
|
},
|
|
145
218
|
|
|
219
|
+
_applyControlVariant: function(oVariant, sVariantID, bFilterVariantApplied) {
|
|
220
|
+
var oVM = ControlVariantApplyAPI.activateVariant({
|
|
221
|
+
element: oVariant,
|
|
222
|
+
variantReference: sVariantID
|
|
223
|
+
});
|
|
224
|
+
return oVM.then(function() {
|
|
225
|
+
return bFilterVariantApplied;
|
|
226
|
+
});
|
|
227
|
+
},
|
|
146
228
|
/************************************* private helper *****************************************/
|
|
147
229
|
|
|
148
230
|
_getFilterBarVM: function(oView) {
|
|
@@ -170,7 +252,7 @@ sap.ui.define(
|
|
|
170
252
|
return !oCurrentVariant.executeOnSelect;
|
|
171
253
|
},
|
|
172
254
|
|
|
173
|
-
_applySelectionVariant: function(oView, oNavigationParameter) {
|
|
255
|
+
_applySelectionVariant: function(oView, oNavigationParameter, bFilterVariantApplied) {
|
|
174
256
|
var oSelectionVariant = oNavigationParameter.selectionVariant,
|
|
175
257
|
oSelectionVariantDefaults = oNavigationParameter.selectionVariantDefaults;
|
|
176
258
|
if (!oSelectionVariant) {
|
|
@@ -186,6 +268,9 @@ sap.ui.define(
|
|
|
186
268
|
oVariant,
|
|
187
269
|
bRequiresStandardVariant = oNavigationParameter.requiresStandardVariant;
|
|
188
270
|
|
|
271
|
+
if (bFilterVariantApplied) {
|
|
272
|
+
oConditions = oFilterBar.getConditions();
|
|
273
|
+
}
|
|
189
274
|
CommonUtils.addDefaultDisplayCurrency(aMandatoryFilterFields, oSelectionVariant, oSelectionVariantDefaults);
|
|
190
275
|
CommonUtils.addSelectionVariantToConditions(oSelectionVariant, oConditions, oMetaModel, sContextPath);
|
|
191
276
|
switch (oViewData.variantManagement) {
|
|
@@ -199,13 +284,13 @@ sap.ui.define(
|
|
|
199
284
|
default:
|
|
200
285
|
break;
|
|
201
286
|
}
|
|
202
|
-
return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant);
|
|
287
|
+
return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied);
|
|
203
288
|
},
|
|
204
|
-
_activateSelectionVariant: function(oFilterBar, oConditions, oVariant, bRequiresStandardVariant) {
|
|
289
|
+
_activateSelectionVariant: function(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied) {
|
|
205
290
|
var that = this,
|
|
206
291
|
oPromise;
|
|
207
292
|
|
|
208
|
-
if (oVariant) {
|
|
293
|
+
if (oVariant && !bFilterVariantApplied) {
|
|
209
294
|
var oVariantKey = bRequiresStandardVariant ? oVariant.getStandardVariantKey() : oVariant.getDefaultVariantKey();
|
|
210
295
|
if (oVariantKey === null) {
|
|
211
296
|
oVariantKey = oVariant.getId();
|
|
@@ -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(
|
|
@@ -359,7 +359,7 @@ sap.ui.define(
|
|
|
359
359
|
entitySetName: CommonHelper.addSingleQuotes(sEntitySetName),
|
|
360
360
|
invocationGrouping: CommonHelper.addSingleQuotes(sInvocationGroup),
|
|
361
361
|
model: "${$source>/}.getModel()",
|
|
362
|
-
label: CommonHelper.addSingleQuotes(oDataField && oDataField.Label),
|
|
362
|
+
label: CommonHelper.addSingleQuotes(oDataField && oDataField.Label, true),
|
|
363
363
|
isNavigable: oHeaderAction && oHeaderAction.isNavigable,
|
|
364
364
|
defaultValuesExtensionFunction:
|
|
365
365
|
oHeaderAction && oHeaderAction.defaultValuesExtensionFunction
|
|
@@ -392,7 +392,7 @@ sap.ui.define(
|
|
|
392
392
|
entitySetName: CommonHelper.addSingleQuotes(sEntitySetName),
|
|
393
393
|
invocationGrouping: CommonHelper.addSingleQuotes(sInvocationGroup),
|
|
394
394
|
model: "${$source>/}.getModel()",
|
|
395
|
-
label: CommonHelper.addSingleQuotes(oDataField && oDataField.Label),
|
|
395
|
+
label: CommonHelper.addSingleQuotes(oDataField && oDataField.Label, true),
|
|
396
396
|
isNavigable: oHeaderAction && oHeaderAction.isNavigable,
|
|
397
397
|
defaultValuesExtensionFunction:
|
|
398
398
|
oHeaderAction && oHeaderAction.defaultValuesExtensionFunction
|
|
@@ -447,6 +447,26 @@ sap.ui.define(
|
|
|
447
447
|
return undefined;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
+
},
|
|
451
|
+
isSubSectionTitleVisible: function(sSubSectionvisible, sSubSectiontitle, sSubSectionshowTitle) {
|
|
452
|
+
if (sSubSectionvisible.indexOf("{=") === 0) {
|
|
453
|
+
// Dynamic expression
|
|
454
|
+
var sExpressionResult = sSubSectionvisible.substring(
|
|
455
|
+
sSubSectionvisible.indexOf("{=") + 2,
|
|
456
|
+
sSubSectionvisible.lastIndexOf("}")
|
|
457
|
+
);
|
|
458
|
+
return (
|
|
459
|
+
"{= (" +
|
|
460
|
+
sExpressionResult +
|
|
461
|
+
") && ('" +
|
|
462
|
+
sSubSectiontitle +
|
|
463
|
+
"' !=='undefined') && (" +
|
|
464
|
+
sSubSectionshowTitle +
|
|
465
|
+
" ? true : false) }"
|
|
466
|
+
);
|
|
467
|
+
} else {
|
|
468
|
+
return sSubSectionvisible && sSubSectiontitle !== "undefined" && (sSubSectionshowTitle ? true : false);
|
|
469
|
+
}
|
|
450
470
|
}
|
|
451
471
|
};
|
|
452
472
|
|