@sapui5/sap.fe.templates 1.97.0 → 1.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -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 +18 -3
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +12 -6
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +33 -26
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +206 -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/ListReport/view/fragments/MultipleMode.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +75 -13
- package/src/sap/fe/templates/ObjectPage/Component.js +21 -29
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +18 -2
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +76 -94
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +166 -155
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +10 -3
- 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 +6 -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/CollaborationDraft.fragment.xml +36 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.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/HeaderFacet.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderFacetCustomContainer.fragment.xml +1 -0
- 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 +6 -3
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +6 -3
- 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 +9 -6
- package/src/sap/fe/templates/messagebundle_bg.properties +9 -6
- package/src/sap/fe/templates/messagebundle_ca.properties +9 -6
- package/src/sap/fe/templates/messagebundle_cs.properties +9 -6
- package/src/sap/fe/templates/messagebundle_cy.properties +9 -6
- package/src/sap/fe/templates/messagebundle_da.properties +9 -6
- package/src/sap/fe/templates/messagebundle_de.properties +9 -6
- package/src/sap/fe/templates/messagebundle_el.properties +10 -7
- package/src/sap/fe/templates/messagebundle_en.properties +9 -6
- package/src/sap/fe/templates/messagebundle_en_GB.properties +9 -6
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +10 -7
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +10 -7
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +10 -7
- package/src/sap/fe/templates/messagebundle_es.properties +17 -14
- package/src/sap/fe/templates/messagebundle_es_MX.properties +9 -6
- package/src/sap/fe/templates/messagebundle_et.properties +9 -6
- package/src/sap/fe/templates/messagebundle_fi.properties +9 -6
- package/src/sap/fe/templates/messagebundle_fr.properties +10 -7
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +9 -6
- package/src/sap/fe/templates/messagebundle_hi.properties +9 -6
- package/src/sap/fe/templates/messagebundle_hr.properties +10 -7
- package/src/sap/fe/templates/messagebundle_hu.properties +9 -6
- package/src/sap/fe/templates/messagebundle_id.properties +11 -8
- package/src/sap/fe/templates/messagebundle_it.properties +9 -6
- package/src/sap/fe/templates/messagebundle_iw.properties +9 -6
- package/src/sap/fe/templates/messagebundle_ja.properties +10 -7
- package/src/sap/fe/templates/messagebundle_kk.properties +9 -6
- package/src/sap/fe/templates/messagebundle_ko.properties +9 -6
- package/src/sap/fe/templates/messagebundle_lt.properties +9 -6
- package/src/sap/fe/templates/messagebundle_lv.properties +9 -6
- package/src/sap/fe/templates/messagebundle_ms.properties +9 -6
- package/src/sap/fe/templates/messagebundle_nl.properties +9 -6
- package/src/sap/fe/templates/messagebundle_no.properties +9 -6
- package/src/sap/fe/templates/messagebundle_pl.properties +9 -6
- package/src/sap/fe/templates/messagebundle_pt.properties +12 -9
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +10 -7
- package/src/sap/fe/templates/messagebundle_ro.properties +9 -6
- package/src/sap/fe/templates/messagebundle_ru.properties +9 -6
- package/src/sap/fe/templates/messagebundle_sh.properties +9 -6
- package/src/sap/fe/templates/messagebundle_sk.properties +9 -6
- package/src/sap/fe/templates/messagebundle_sl.properties +9 -6
- package/src/sap/fe/templates/messagebundle_sv.properties +10 -7
- package/src/sap/fe/templates/messagebundle_th.properties +9 -6
- package/src/sap/fe/templates/messagebundle_tr.properties +10 -7
- package/src/sap/fe/templates/messagebundle_uk.properties +10 -7
- package/src/sap/fe/templates/messagebundle_vi.properties +9 -6
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +9 -6
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +9 -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
|
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
|
}
|
|
@@ -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
|
[
|
|
@@ -12,9 +13,27 @@ sap.ui.define(
|
|
|
12
13
|
"sap/ui/mdc/p13n/StateUtil",
|
|
13
14
|
"sap/ui/Device",
|
|
14
15
|
"sap/ui/mdc/enum/ConditionValidated",
|
|
16
|
+
"sap/fe/macros/DelegateUtil",
|
|
17
|
+
"sap/fe/core/helpers/ModelHelper",
|
|
18
|
+
"sap/fe/macros/filter/FilterUtils",
|
|
19
|
+
"sap/fe/core/templating/PropertyFormatters",
|
|
15
20
|
"sap/base/Log"
|
|
16
21
|
],
|
|
17
|
-
function(
|
|
22
|
+
function(
|
|
23
|
+
CoreLibrary,
|
|
24
|
+
NavLibrary,
|
|
25
|
+
CommonUtils,
|
|
26
|
+
KeepAliveHelper,
|
|
27
|
+
ControlVariantApplyAPI,
|
|
28
|
+
StateUtil,
|
|
29
|
+
Device,
|
|
30
|
+
ConditionValidated,
|
|
31
|
+
DelegateUtil,
|
|
32
|
+
ModelHelper,
|
|
33
|
+
FilterUtils,
|
|
34
|
+
PropertyFormatters,
|
|
35
|
+
Log
|
|
36
|
+
) {
|
|
18
37
|
"use strict";
|
|
19
38
|
|
|
20
39
|
var NavType = NavLibrary.NavType,
|
|
@@ -22,6 +41,9 @@ sap.ui.define(
|
|
|
22
41
|
TemplateContentView = CoreLibrary.TemplateContentView,
|
|
23
42
|
InitialLoadMode = CoreLibrary.InitialLoadMode;
|
|
24
43
|
|
|
44
|
+
var FilterRestrictions = CommonUtils.FilterRestrictions,
|
|
45
|
+
CONDITION_PATH_TO_PROPERTY_PATH_REGEX = /\+|\*/g;
|
|
46
|
+
|
|
25
47
|
return {
|
|
26
48
|
applyInitialStateOnly: function() {
|
|
27
49
|
return true;
|
|
@@ -31,19 +53,33 @@ sap.ui.define(
|
|
|
31
53
|
oController = oView.getController(),
|
|
32
54
|
oFilterBar = oController._getFilterBarControl(),
|
|
33
55
|
aTables = oController._getControls("table");
|
|
34
|
-
|
|
35
|
-
|
|
56
|
+
if (oFilterBar) {
|
|
57
|
+
oFilterBar.setSuspendSelection(true);
|
|
58
|
+
aPromises.push(oFilterBar.initialized());
|
|
59
|
+
}
|
|
36
60
|
aTables.forEach(function(oTable) {
|
|
37
61
|
aPromises.push(oTable.initialized());
|
|
38
62
|
});
|
|
39
|
-
aPromises.push(oFilterBar.initialized());
|
|
40
63
|
|
|
41
64
|
delete this._bSearchTriggered;
|
|
42
65
|
},
|
|
43
66
|
onAfterStateApplied: function() {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
67
|
+
var oController = this.getView().getController();
|
|
68
|
+
var oFilterBar = oController._getFilterBarControl();
|
|
69
|
+
if (oFilterBar) {
|
|
70
|
+
oFilterBar.setSuspendSelection(false);
|
|
71
|
+
} else if (oController._isFilterBarHidden()) {
|
|
72
|
+
var oInternalModelContext = oController.getView().getBindingContext("internal"),
|
|
73
|
+
aControls = oController._getControls();
|
|
74
|
+
oInternalModelContext.setProperty("hasPendingFilters", false);
|
|
75
|
+
if (oController._isMultiMode()) {
|
|
76
|
+
oController._setCountsOutDated();
|
|
77
|
+
var sDisplayedControlId = oController._getCurrentControl().getId();
|
|
78
|
+
aControls.forEach(function(oControl) {
|
|
79
|
+
oControl.data("outdatedRows", oControl.getId() !== sDisplayedControlId);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
47
83
|
},
|
|
48
84
|
adaptBindingRefreshControls: function(aControls) {
|
|
49
85
|
var oView = this.getView(),
|
|
@@ -57,17 +93,15 @@ sap.ui.define(
|
|
|
57
93
|
var oView = this.getView(),
|
|
58
94
|
oController = oView.getController(),
|
|
59
95
|
oViewData = oView.getViewData(),
|
|
60
|
-
bControlVM = oViewData.variantManagement === VariantManagement.Control
|
|
61
|
-
that = this;
|
|
62
|
-
|
|
63
|
-
if (oController._isMultiMode()) {
|
|
64
|
-
aStateControls.push(oController._getMultiModeControl());
|
|
65
|
-
}
|
|
96
|
+
bControlVM = oViewData.variantManagement === VariantManagement.Control;
|
|
66
97
|
|
|
67
98
|
var oFilterBarVM = this._getFilterBarVM(oView);
|
|
68
99
|
if (oFilterBarVM) {
|
|
69
100
|
aStateControls.push(oFilterBarVM);
|
|
70
101
|
}
|
|
102
|
+
if (oController._isMultiMode()) {
|
|
103
|
+
aStateControls.push(oController._getMultiModeControl());
|
|
104
|
+
}
|
|
71
105
|
oController._getControls("table").forEach(function(oTable) {
|
|
72
106
|
var oQuickFilter = oTable.getQuickFilter();
|
|
73
107
|
if (oQuickFilter) {
|
|
@@ -76,33 +110,18 @@ sap.ui.define(
|
|
|
76
110
|
if (bControlVM) {
|
|
77
111
|
aStateControls.push(oTable.getVariant());
|
|
78
112
|
}
|
|
79
|
-
|
|
80
|
-
aStateControls.push(oTable);
|
|
81
|
-
}
|
|
113
|
+
aStateControls.push(oTable);
|
|
82
114
|
});
|
|
83
115
|
|
|
84
116
|
if (oController._hasMultiVisualizations()) {
|
|
85
117
|
aStateControls.push(oController._getSegmentedButton(TemplateContentView.Chart));
|
|
86
118
|
aStateControls.push(oController._getSegmentedButton(TemplateContentView.Table));
|
|
87
119
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
adaptControlStateHandler: function(oControl, aControlHandler) {
|
|
92
|
-
if (oControl.isA("sap.ui.fl.variants.VariantManagement")) {
|
|
93
|
-
aControlHandler.push({
|
|
94
|
-
retrieve: function(oVM) {
|
|
95
|
-
return {
|
|
96
|
-
"variantId": oVM.getCurrentVariantKey()
|
|
97
|
-
};
|
|
98
|
-
},
|
|
99
|
-
apply: function(oVM, oControlState) {
|
|
100
|
-
if (oControlState && oControlState.variantId !== undefined) {
|
|
101
|
-
oVM.setModified(true);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
});
|
|
120
|
+
var oFilterBar = oController._getFilterBarControl();
|
|
121
|
+
if (oFilterBar) {
|
|
122
|
+
aStateControls.push(oFilterBar);
|
|
105
123
|
}
|
|
124
|
+
aStateControls.push(oView.byId("fe::ListReport"));
|
|
106
125
|
},
|
|
107
126
|
retrieveAdditionalStates: function(mAdditionalStates) {
|
|
108
127
|
var oView = this.getView(),
|
|
@@ -124,10 +143,13 @@ sap.ui.define(
|
|
|
124
143
|
|
|
125
144
|
if (oAdditionalStates) {
|
|
126
145
|
// explicit check for boolean values - 'undefined' should not alter the triggered search property
|
|
127
|
-
if (oAdditionalStates.dataLoaded === false) {
|
|
146
|
+
if (oAdditionalStates.dataLoaded === false && oFilterBar) {
|
|
147
|
+
// without this, the data is loaded on navigating back
|
|
128
148
|
oFilterBar._bSearchTriggered = false;
|
|
129
149
|
} else if (oAdditionalStates.dataLoaded === true) {
|
|
130
|
-
|
|
150
|
+
if (oFilterBar) {
|
|
151
|
+
oFilterBar.triggerSearch();
|
|
152
|
+
}
|
|
131
153
|
this._bSearchTriggered = true;
|
|
132
154
|
}
|
|
133
155
|
if (oController._hasMultiVisualizations()) {
|
|
@@ -145,42 +167,44 @@ sap.ui.define(
|
|
|
145
167
|
var oView = this.getView(),
|
|
146
168
|
that = this,
|
|
147
169
|
oController = oView.getController(),
|
|
148
|
-
|
|
149
|
-
oAppComponent = sap.ui.core.Component.getOwnerComponentFor(oComponent),
|
|
170
|
+
oAppComponent = oController.getAppComponent(oView),
|
|
150
171
|
oComponentData = oAppComponent.getComponentData(),
|
|
151
172
|
oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
|
|
152
173
|
oVariantPromise = that.handleVariantIdPassedViaURLParams(oStartupParameters),
|
|
153
174
|
bFilterVariantApplied;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
if (aVariants
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
var oRes = that._applySelectionVariant(oView, oNavigationParameter, bFilterVariantApplied).then(function() {
|
|
162
|
-
var oController = oView.getController();
|
|
163
|
-
var oDynamicPage = oView.byId("fe::ListReport");
|
|
164
|
-
var bPreventInitialSearch = false;
|
|
165
|
-
var oFilterBarVM = that._getFilterBarVM(oView);
|
|
166
|
-
var oFilterBarControl = oController._getFilterBarControl();
|
|
167
|
-
if (
|
|
168
|
-
(oNavigationParameter.navigationType !== NavType.initial && oNavigationParameter.requiresStandardVariant) ||
|
|
169
|
-
(!oFilterBarVM && oView.getViewData().initialLoad === InitialLoadMode.Enabled) ||
|
|
170
|
-
oController._shouldAutoTriggerSearch(oFilterBarVM)
|
|
171
|
-
) {
|
|
172
|
-
oFilterBarControl.triggerSearch();
|
|
173
|
-
} else {
|
|
174
|
-
bPreventInitialSearch = that._preventInitialSearch(oFilterBarVM);
|
|
175
|
+
aResults.push(
|
|
176
|
+
oVariantPromise
|
|
177
|
+
.then(function(aVariants) {
|
|
178
|
+
if (aVariants && aVariants.length > 0) {
|
|
179
|
+
if (aVariants[0] === true || aVariants[1] === true) {
|
|
180
|
+
bFilterVariantApplied = true;
|
|
181
|
+
}
|
|
175
182
|
}
|
|
176
|
-
that.
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
return that._applySelectionVariant(oView, oNavigationParameter, bFilterVariantApplied).then(function() {
|
|
184
|
+
var oDynamicPage = oView.byId("fe::ListReport");
|
|
185
|
+
var bPreventInitialSearch = false;
|
|
186
|
+
var oFilterBarVM = that._getFilterBarVM(oView);
|
|
187
|
+
var oFilterBarControl = oController._getFilterBarControl();
|
|
188
|
+
if (oFilterBarControl) {
|
|
189
|
+
if (
|
|
190
|
+
(oNavigationParameter.navigationType !== NavType.initial &&
|
|
191
|
+
oNavigationParameter.requiresStandardVariant) ||
|
|
192
|
+
(!oFilterBarVM && oView.getViewData().initialLoad === InitialLoadMode.Enabled) ||
|
|
193
|
+
oController._shouldAutoTriggerSearch(oFilterBarVM)
|
|
194
|
+
) {
|
|
195
|
+
oFilterBarControl.triggerSearch();
|
|
196
|
+
} else {
|
|
197
|
+
bPreventInitialSearch = that._preventInitialSearch(oFilterBarVM);
|
|
198
|
+
}
|
|
199
|
+
that._bSearchTriggered = !bPreventInitialSearch;
|
|
200
|
+
oDynamicPage.setHeaderExpanded(Device.system.desktop || bPreventInitialSearch);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
})
|
|
204
|
+
.catch(function() {
|
|
205
|
+
Log.error("Variant ID cannot be applied");
|
|
206
|
+
})
|
|
207
|
+
);
|
|
184
208
|
},
|
|
185
209
|
|
|
186
210
|
handleVariantIdPassedViaURLParams: function(oUrlParams) {
|
|
@@ -213,11 +237,13 @@ sap.ui.define(
|
|
|
213
237
|
} else if (oVariantIDs && sVariantManagement === "Control") {
|
|
214
238
|
if (oVariantIDs.sFilterBarVariantId) {
|
|
215
239
|
var oVM = oView.byId(oView.getContent()[0].data("filterBarVariantId"));
|
|
216
|
-
oVM
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
240
|
+
if (oVM) {
|
|
241
|
+
oVM.getVariants().forEach(function(oVariant) {
|
|
242
|
+
if (oVariant.key === oVariantIDs.sFilterBarVariantId) {
|
|
243
|
+
aPromises.push(that._applyControlVariant(oVM, oVariantIDs.sFilterBarVariantId, true));
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
221
247
|
}
|
|
222
248
|
if (oVariantIDs.sTableVariantId) {
|
|
223
249
|
var oController = oView.getController(),
|
|
@@ -277,17 +303,16 @@ sap.ui.define(
|
|
|
277
303
|
},
|
|
278
304
|
|
|
279
305
|
_applySelectionVariant: function(oView, oNavigationParameter, bFilterVariantApplied) {
|
|
280
|
-
var
|
|
306
|
+
var oFilterBar = oView.getController()._getFilterBarControl(),
|
|
307
|
+
oSelectionVariant = oNavigationParameter.selectionVariant,
|
|
281
308
|
oSelectionVariantDefaults = oNavigationParameter.selectionVariantDefaults;
|
|
282
|
-
if (!oSelectionVariant) {
|
|
309
|
+
if (!oFilterBar || !oSelectionVariant) {
|
|
283
310
|
return Promise.resolve();
|
|
284
311
|
}
|
|
285
|
-
|
|
286
312
|
var oConditions = {},
|
|
287
313
|
oMetaModel = oView.getModel().getMetaModel(),
|
|
288
314
|
oViewData = oView.getViewData(),
|
|
289
315
|
sContextPath = oViewData.contextPath || "/" + oViewData.entitySet,
|
|
290
|
-
oFilterBar = oView.byId(oView.getContent()[0].data("filterBarId")),
|
|
291
316
|
aMandatoryFilterFields = CommonUtils.getMandatoryFilterFields(oMetaModel, sContextPath),
|
|
292
317
|
oVariant,
|
|
293
318
|
bRequiresStandardVariant = oNavigationParameter.requiresStandardVariant;
|
|
@@ -330,10 +355,7 @@ sap.ui.define(
|
|
|
330
355
|
}
|
|
331
356
|
return oPromise.then(function(bClearFilterAndReplaceWithAppState) {
|
|
332
357
|
if (bClearFilterAndReplaceWithAppState) {
|
|
333
|
-
|
|
334
|
-
return that._fnApplyConditions(oFilterBar, oConditions);
|
|
335
|
-
}
|
|
336
|
-
return that._fnClearFilterAndReplaceWithAppState(oFilterBar, oConditions);
|
|
358
|
+
return that._fnApplyConditions(oFilterBar, oConditions);
|
|
337
359
|
}
|
|
338
360
|
});
|
|
339
361
|
},
|
|
@@ -352,9 +374,35 @@ sap.ui.define(
|
|
|
352
374
|
}
|
|
353
375
|
delete oCondition.isEmpty;
|
|
354
376
|
};
|
|
377
|
+
var fnGetPropertyInfo = function(oFilterControl, sEntityTypePath) {
|
|
378
|
+
var sEntitySetPath = ModelHelper.getEntitySetPath(sEntityTypePath),
|
|
379
|
+
oMetaModel = oFilterControl.getModel().getMetaModel(),
|
|
380
|
+
oFR = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oMetaModel),
|
|
381
|
+
aNonFilterableProps = oFR[FilterRestrictions.NON_FILTERABLE_PROPERTIES],
|
|
382
|
+
mFilterFields = FilterUtils.getConvertedFilterFields(oFilterControl, sEntityTypePath),
|
|
383
|
+
aPropertyInfo = [];
|
|
384
|
+
Object.keys(mFilterFields).forEach(function(sFilterFieldKey) {
|
|
385
|
+
var oConvertedProperty = mFilterFields[sFilterFieldKey];
|
|
386
|
+
var sPropertyPath = oConvertedProperty.conditionPath.replace(CONDITION_PATH_TO_PROPERTY_PATH_REGEX, "");
|
|
387
|
+
if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
|
|
388
|
+
var sAnnotationPath = oConvertedProperty.annotationPath;
|
|
389
|
+
var oPropertyContext = oMetaModel.createBindingContext(sAnnotationPath);
|
|
390
|
+
aPropertyInfo.push({
|
|
391
|
+
path: oConvertedProperty.conditionPath,
|
|
392
|
+
hiddenFilter: oConvertedProperty.availability === "Hidden",
|
|
393
|
+
hasValueHelp: !sAnnotationPath
|
|
394
|
+
? false
|
|
395
|
+
: PropertyFormatters.hasValueHelp(oPropertyContext.getObject(), { context: oPropertyContext })
|
|
396
|
+
});
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
return aPropertyInfo;
|
|
401
|
+
};
|
|
355
402
|
return oFilterBar.initialized().then(function() {
|
|
356
|
-
oFilterBar
|
|
357
|
-
|
|
403
|
+
var sEntityTypePath = DelegateUtil.getCustomData(oFilterBar, "entityType");
|
|
404
|
+
var aPropertyInfo = fnGetPropertyInfo(oFilterBar, sEntityTypePath);
|
|
405
|
+
aPropertyInfo
|
|
358
406
|
.filter(function(oPropertyInfo) {
|
|
359
407
|
return oPropertyInfo.path !== "$editState" && oPropertyInfo.path !== "$search";
|
|
360
408
|
})
|
|
@@ -377,9 +425,6 @@ sap.ui.define(
|
|
|
377
425
|
});
|
|
378
426
|
return StateUtil.applyExternalState(oFilterBar, { filter: mFilter, items: aItems });
|
|
379
427
|
});
|
|
380
|
-
},
|
|
381
|
-
_fnClearFilterAndReplaceWithAppState: function(oFilterBar, oConditions) {
|
|
382
|
-
return this._fnApplyConditions(oFilterBar, {}).then(this._fnApplyConditions.bind(this, oFilterBar, oConditions));
|
|
383
428
|
}
|
|
384
429
|
};
|
|
385
430
|
}
|
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
<template:repeat list="{converterContext>views}" var="view">
|
|
11
11
|
<template:with path="view>primaryVisualization" var="presentationContext">
|
|
12
12
|
<template:repeat list="{presentationContext>visualizations}" var="visualizationDefinition">
|
|
13
|
+
<m:MessageStrip
|
|
14
|
+
text="{= '{path:\'internal>controls/ignoredFields' + (${visualizationDefinition>collection}) + (${visualizationDefinition>type}) + '\', formatter: \'.formatters.setChartMessageStrip\'}'}"
|
|
15
|
+
type="Information"
|
|
16
|
+
showIcon="true"
|
|
17
|
+
showCloseButton="true"
|
|
18
|
+
class="sapUiSmallMargin"
|
|
19
|
+
visible="{= '{= (${internal>controls/ignoredFields' + (${visualizationDefinition>collection}) + (${visualizationDefinition>type}) + '} || []).length>0 && ${pageInternal>alpContentView} !== \'Table\'}' }"
|
|
20
|
+
/>
|
|
13
21
|
<core:Fragment fragmentName="sap.fe.templates.controls.{visualizationDefinition>type}" type="XML" />
|
|
14
22
|
</template:repeat>
|
|
15
23
|
</template:with>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<IconTabBar
|
|
9
9
|
expandable="false"
|
|
10
10
|
headerMode="Inline"
|
|
11
|
-
id="
|
|
11
|
+
id="{converterContext>iconTabBarId}"
|
|
12
12
|
select=".handlers.onTabMultiModeChange"
|
|
13
13
|
stretchContentHeight="true"
|
|
14
14
|
customData:showCounts="{converterContext>showTabCounts}"
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
</template:then>
|
|
30
30
|
<template:else>
|
|
31
31
|
<MessageStrip
|
|
32
|
-
text="{= '{
|
|
32
|
+
text="{= '{= (${internal>tabs/ignoredFieldsTitle/' + (${view>tableControlId} || ${view>chartControlId}) + '} ) }' }"
|
|
33
33
|
type="Information"
|
|
34
34
|
showIcon="true"
|
|
35
35
|
showCloseButton="true"
|
|
36
36
|
class="sapUiSmallMargin"
|
|
37
|
-
visible="{= '{= (${internal>tabs/ignoredFields/' +(${view>tableControlId} || ${view>chartControlId}) + '} || []).length>0 }' }"
|
|
37
|
+
visible="{= '{= (${internal>tabs/ignoredFields/' + (${view>tableControlId} || ${view>chartControlId}) + '} || []).length>0 }' }"
|
|
38
38
|
>
|
|
39
39
|
</MessageStrip>
|
|
40
40
|
<core:Fragment fragmentName="sap.fe.templates.ListReport.view.fragments.CollectionVisualization" type="XML" />
|
|
@@ -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(
|
|
@@ -48,7 +49,7 @@ sap.ui.define(
|
|
|
48
49
|
*/
|
|
49
50
|
getSwitchToActiveVisibility: function(oAnnotations) {
|
|
50
51
|
if (this.checkDraftState(oAnnotations)) {
|
|
51
|
-
return "{= (${ui>/editMode} === 'Editable') && !${ui>createMode} && %{DraftAdministrativeData/DraftIsCreatedByMe} }";
|
|
52
|
+
return "{= (%{DraftAdministrativeData/DraftIsCreatedByMe}) ? ( (${ui>/editMode} === 'Editable') && !${ui>createMode} && %{DraftAdministrativeData/DraftIsCreatedByMe} ) : false }";
|
|
52
53
|
} else {
|
|
53
54
|
return false;
|
|
54
55
|
}
|
|
@@ -62,7 +63,7 @@ sap.ui.define(
|
|
|
62
63
|
*/
|
|
63
64
|
getSwitchToDraftVisibility: function(oAnnotations) {
|
|
64
65
|
if (this.checkDraftState(oAnnotations)) {
|
|
65
|
-
return "{= !(${ui>/editMode} === 'Editable') && !${ui>createMode} &&
|
|
66
|
+
return "{= (%{DraftAdministrativeData/DraftIsCreatedByMe}) ? ( !(${ui>/editMode} === 'Editable') && !${ui>createMode} && ${HasDraftEntity} && %{DraftAdministrativeData/DraftIsCreatedByMe} ) : false }";
|
|
66
67
|
} else {
|
|
67
68
|
return false;
|
|
68
69
|
}
|
|
@@ -163,22 +164,22 @@ sap.ui.define(
|
|
|
163
164
|
bReadOnly = bReadOnly || oFieldControl == "com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly";
|
|
164
165
|
}
|
|
165
166
|
if (bReadOnly) {
|
|
166
|
-
return false;
|
|
167
|
-
} else {
|
|
168
167
|
return true;
|
|
168
|
+
} else {
|
|
169
|
+
return false;
|
|
169
170
|
}
|
|
170
171
|
},
|
|
171
|
-
|
|
172
|
+
readOnlyExpressionFromDynamicAnnotations: function(oFieldControl) {
|
|
172
173
|
var sIsFieldControlPathReadOnly;
|
|
173
174
|
if (oFieldControl) {
|
|
174
175
|
if (ManagedObject.bindingParser(oFieldControl)) {
|
|
175
|
-
sIsFieldControlPathReadOnly = "
|
|
176
|
+
sIsFieldControlPathReadOnly = "%" + oFieldControl + " === 1 ";
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
179
|
if (sIsFieldControlPathReadOnly) {
|
|
179
180
|
return "{= " + sIsFieldControlPathReadOnly + "? false : true }";
|
|
180
181
|
} else {
|
|
181
|
-
return
|
|
182
|
+
return;
|
|
182
183
|
}
|
|
183
184
|
},
|
|
184
185
|
/*
|
|
@@ -311,16 +312,57 @@ sap.ui.define(
|
|
|
311
312
|
/*
|
|
312
313
|
* Get visiblity for editable header facet.
|
|
313
314
|
*
|
|
315
|
+
* If either the title or description field from the header annotations are editable, then the
|
|
316
|
+
* editable header facet is visible.
|
|
317
|
+
*
|
|
314
318
|
* @function
|
|
315
319
|
* @param {object} [oAnnotations] Annotations object for given entity set
|
|
316
320
|
* @param {object} [oFieldControl] field control
|
|
317
321
|
* returns {*} binding expression or boolean value resolved form funcitons isReadOnlyFromStaticAnnotations and isReadOnlyFromDynamicAnnotations
|
|
318
322
|
*/
|
|
319
|
-
getVisiblityOfHeaderFacet: function(
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
+
getVisiblityOfHeaderFacet: function(
|
|
324
|
+
oTitleAnnotations,
|
|
325
|
+
oDescriptionAnnotations,
|
|
326
|
+
oFieldTitleFieldControl,
|
|
327
|
+
oFieldDescriptionFieldControl
|
|
328
|
+
) {
|
|
329
|
+
// Check Annotations for Title Field
|
|
330
|
+
var bIsTitleReadOnly = AnnotationHelper.isReadOnlyFromStaticAnnotations(oTitleAnnotations, oFieldTitleFieldControl);
|
|
331
|
+
var titleExpression = AnnotationHelper.readOnlyExpressionFromDynamicAnnotations(oFieldTitleFieldControl);
|
|
332
|
+
// There is no expression and the title is not ready only, this is sufficient for an editable header
|
|
333
|
+
if (!bIsTitleReadOnly && !titleExpression) {
|
|
334
|
+
return true;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Check Annotations for Description Field
|
|
338
|
+
var bIsDescriptionReadOnly = AnnotationHelper.isReadOnlyFromStaticAnnotations(
|
|
339
|
+
oDescriptionAnnotations,
|
|
340
|
+
oFieldDescriptionFieldControl
|
|
323
341
|
);
|
|
342
|
+
var descriptionExpression = AnnotationHelper.readOnlyExpressionFromDynamicAnnotations(oFieldDescriptionFieldControl);
|
|
343
|
+
// There is no expression and the description is not ready only, this is sufficient for an editable header
|
|
344
|
+
if (!bIsDescriptionReadOnly && !descriptionExpression) {
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
// Both title and description are not editable and there are no dynamic annotations
|
|
349
|
+
if (bIsTitleReadOnly && bIsDescriptionReadOnly && !titleExpression && !descriptionExpression) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Now combine expressions
|
|
354
|
+
if (titleExpression && !descriptionExpression) {
|
|
355
|
+
return titleExpression;
|
|
356
|
+
} else if (!titleExpression && descriptionExpression) {
|
|
357
|
+
return descriptionExpression;
|
|
358
|
+
} else {
|
|
359
|
+
return AnnotationHelper.combineTitleAndDescriptionExpression(oFieldTitleFieldControl, oFieldDescriptionFieldControl);
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
combineTitleAndDescriptionExpression: function(oTitleFieldControl, oDescriptionFieldControl) {
|
|
363
|
+
// If both header and title field are based on dynmaic field control, the editable header
|
|
364
|
+
// is visible if at least one of these is not ready only
|
|
365
|
+
return "{= %" + oTitleFieldControl + " === 1 ? ( %" + oDescriptionFieldControl + " === 1 ? false : true ) : true }";
|
|
324
366
|
},
|
|
325
367
|
/*
|
|
326
368
|
* Get Expression of press event of delete button.
|
|
@@ -447,6 +489,26 @@ sap.ui.define(
|
|
|
447
489
|
return undefined;
|
|
448
490
|
}
|
|
449
491
|
}
|
|
492
|
+
},
|
|
493
|
+
isSubSectionTitleVisible: function(sSubSectionvisible, sSubSectiontitle, sSubSectionshowTitle) {
|
|
494
|
+
if (sSubSectionvisible.indexOf("{=") === 0) {
|
|
495
|
+
// Dynamic expression
|
|
496
|
+
var sExpressionResult = sSubSectionvisible.substring(
|
|
497
|
+
sSubSectionvisible.indexOf("{=") + 2,
|
|
498
|
+
sSubSectionvisible.lastIndexOf("}")
|
|
499
|
+
);
|
|
500
|
+
return (
|
|
501
|
+
"{= (" +
|
|
502
|
+
sExpressionResult +
|
|
503
|
+
") && ('" +
|
|
504
|
+
sSubSectiontitle +
|
|
505
|
+
"' !=='undefined') && (" +
|
|
506
|
+
sSubSectionshowTitle +
|
|
507
|
+
" ? true : false) }"
|
|
508
|
+
);
|
|
509
|
+
} else {
|
|
510
|
+
return sSubSectionvisible && sSubSectiontitle !== "undefined" && (sSubSectionshowTitle ? "true" : "false");
|
|
511
|
+
}
|
|
450
512
|
}
|
|
451
513
|
};
|
|
452
514
|
|