@sapui5/sap.fe.templates 1.95.0 → 1.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -3
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/Component.js +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/chart/FEChartDelegate.js +3 -3
- package/src/sap/fe/templates/ListComponent.js +1 -1
- package/src/sap/fe/templates/ListReport/Component.js +1 -1
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +1 -1
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +6 -4
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +136 -85
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +7 -3
- package/src/sap/fe/templates/ListReport/overrides/MassEdit.js +95 -0
- package/src/sap/fe/templates/ListReport/overrides/Share.js +37 -22
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +166 -33
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +23 -3
- package/src/sap/fe/templates/ObjectPage/Component.js +31 -18
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +16 -1
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +103 -88
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +235 -174
- package/src/sap/fe/templates/ObjectPage/controls/StashableHBox.js +9 -1
- package/src/sap/fe/templates/ObjectPage/controls/StashableVBox.js +1 -1
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +2 -2
- package/src/sap/fe/templates/ObjectPage/designtime/FlexBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableHBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/designtime/StashableVBox.designtime.js +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableHBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/flexibility/StashableVBox.flexibility.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/InternalRouting.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/MessageHandler.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +89 -72
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +10 -6
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +14 -11
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +26 -12
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +2 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderDataPointTitle.fragment.xml +26 -16
- package/src/sap/fe/templates/ObjectPage/view/fragments/ObjectPageHeaderForm.fragment.xml +5 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +24 -5
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +1 -4
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContentLazyLoader.fragment.xml +181 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionMoreFormContent.fragment.xml +1 -0
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +111 -8
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +88 -32
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +161 -144
- package/src/sap/fe/templates/RootContainer/overrides/EditFlow.js +1 -1
- package/src/sap/fe/templates/RootContainer/view/Fcl.view.xml +2 -1
- package/src/sap/fe/templates/RootContainer/view/NavContainer.view.xml +1 -1
- package/src/sap/fe/templates/TableScroller.js +1 -1
- package/src/sap/fe/templates/controls/Chart.fragment.xml +6 -2
- package/src/sap/fe/templates/controls/Table.fragment.xml +2 -0
- package/src/sap/fe/templates/library.js +2 -2
- package/src/sap/fe/templates/messagebundle.properties +25 -2
- package/src/sap/fe/templates/messagebundle_ar.properties +1 -1
- package/src/sap/fe/templates/messagebundle_bg.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ca.properties +1 -1
- package/src/sap/fe/templates/messagebundle_cs.properties +1 -1
- package/src/sap/fe/templates/messagebundle_cy.properties +1 -1
- package/src/sap/fe/templates/messagebundle_da.properties +1 -1
- package/src/sap/fe/templates/messagebundle_de.properties +1 -1
- package/src/sap/fe/templates/messagebundle_el.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_GB.properties +1 -1
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +2 -2
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +2 -2
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +2 -2
- package/src/sap/fe/templates/messagebundle_es.properties +9 -9
- package/src/sap/fe/templates/messagebundle_es_MX.properties +1 -1
- package/src/sap/fe/templates/messagebundle_et.properties +1 -1
- package/src/sap/fe/templates/messagebundle_fi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_fr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +2 -2
- package/src/sap/fe/templates/messagebundle_hi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_hr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_hu.properties +1 -1
- package/src/sap/fe/templates/messagebundle_id.properties +1 -1
- package/src/sap/fe/templates/messagebundle_it.properties +1 -1
- package/src/sap/fe/templates/messagebundle_iw.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ja.properties +2 -2
- package/src/sap/fe/templates/messagebundle_kk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ko.properties +1 -1
- package/src/sap/fe/templates/messagebundle_lt.properties +1 -1
- package/src/sap/fe/templates/messagebundle_lv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ms.properties +1 -1
- package/src/sap/fe/templates/messagebundle_nl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_no.properties +2 -2
- package/src/sap/fe/templates/messagebundle_pl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_pt.properties +1 -1
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ro.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ru.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sh.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sl.properties +1 -1
- package/src/sap/fe/templates/messagebundle_sv.properties +1 -1
- package/src/sap/fe/templates/messagebundle_th.properties +1 -1
- package/src/sap/fe/templates/messagebundle_tr.properties +2 -2
- package/src/sap/fe/templates/messagebundle_uk.properties +1 -1
- package/src/sap/fe/templates/messagebundle_vi.properties +1 -1
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +1 -1
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderImage.fragment.xml +0 -24
- package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
- package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
- package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +0 -25
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAPUI5
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
|
+
*/
|
|
5
|
+
sap.ui.define(["sap/m/MessageBox", "sap/base/Log", "sap/fe/core/helpers/ModelHelper"], function(MessageBox, Log, ModelHelper) {
|
|
6
|
+
"use strict";
|
|
7
|
+
return {
|
|
8
|
+
_filterEditableContexts: function(aContexts) {
|
|
9
|
+
return aContexts.filter(function(oContext) {
|
|
10
|
+
var oData = oContext.getObject(),
|
|
11
|
+
draftAdminData = oData.DraftAdministrativeData;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
oData.IsActiveEntity &&
|
|
15
|
+
(!draftAdminData || (!draftAdminData.InProcessByUserDescription && !draftAdminData.InProcessByUser))
|
|
16
|
+
);
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
_getMessageDetailForNonEditable: function(oResourceBundle) {
|
|
21
|
+
var sHeader = oResourceBundle.getText("T_MASS_EDIT_CONFIRM_MESSAGE_DETAIL_HEADER"),
|
|
22
|
+
sReasonGroup = oResourceBundle.getText("T_MASS_EDIT_CONFIRM_MESSAGE_DETAIL_REASON"),
|
|
23
|
+
sReasonDraft = oResourceBundle.getText("T_MASS_EDIT_CONFIRM_MESSAGE_DETAIL_REASON_DRAFT"),
|
|
24
|
+
sReasonNonEditable = oResourceBundle.getText("T_MASS_EDIT_CONFIRM_MESSAGE_DETAIL_REASON_NON_EDITABLE");
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
"<p><strong>" +
|
|
28
|
+
sHeader +
|
|
29
|
+
"</strong></p>\n" +
|
|
30
|
+
"<p>" +
|
|
31
|
+
sReasonGroup +
|
|
32
|
+
"</p>\n" +
|
|
33
|
+
"<ul>" +
|
|
34
|
+
"<li>" +
|
|
35
|
+
sReasonDraft +
|
|
36
|
+
"</li>" +
|
|
37
|
+
"<li>" +
|
|
38
|
+
sReasonNonEditable +
|
|
39
|
+
"</li>" +
|
|
40
|
+
"</ul>"
|
|
41
|
+
);
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
fetchContextsForEdit: function(oTable) {
|
|
45
|
+
var that = this,
|
|
46
|
+
aSelectedContexts = oTable.getSelectedContexts() || [],
|
|
47
|
+
sPath = oTable.data("targetCollectionPath"),
|
|
48
|
+
oMetaModel = oTable.getModel().getMetaModel(),
|
|
49
|
+
bIsDraft = ModelHelper.isDraftSupported(oMetaModel, sPath),
|
|
50
|
+
aContextsForEdit = bIsDraft ? this._filterEditableContexts(aSelectedContexts) : aSelectedContexts;
|
|
51
|
+
|
|
52
|
+
if (aContextsForEdit.length !== aSelectedContexts.length) {
|
|
53
|
+
return new Promise(function(resolve, reject) {
|
|
54
|
+
that.getView()
|
|
55
|
+
.getModel("sap.fe.i18n")
|
|
56
|
+
.getResourceBundle()
|
|
57
|
+
.then(function(oResourceBundle) {
|
|
58
|
+
var sEditButton = oResourceBundle.getText("T_MASS_EDIT_CONFIRM_BUTTON_TEXT"),
|
|
59
|
+
sCancelButton = oResourceBundle.getText("T_MASS_EDIT_CANCEL_BUTTON_TEXT"),
|
|
60
|
+
iNonEditable = aSelectedContexts.length - aContextsForEdit.length,
|
|
61
|
+
sMessage = oResourceBundle.getText("T_MASS_EDIT_CONFIRM_MESSAGE", [
|
|
62
|
+
iNonEditable,
|
|
63
|
+
aSelectedContexts.length,
|
|
64
|
+
aContextsForEdit.length
|
|
65
|
+
]),
|
|
66
|
+
sMessageDetail = that._getMessageDetailForNonEditable(oResourceBundle);
|
|
67
|
+
|
|
68
|
+
MessageBox.error(sMessage, {
|
|
69
|
+
title: "Error",
|
|
70
|
+
details: sMessageDetail,
|
|
71
|
+
actions: [sEditButton, sCancelButton],
|
|
72
|
+
emphasizedAction: sEditButton,
|
|
73
|
+
contentWidth: "100px",
|
|
74
|
+
onClose: function(sSelection) {
|
|
75
|
+
var aContexts = [];
|
|
76
|
+
if (sSelection === sEditButton) {
|
|
77
|
+
Log.info("Mass Edit: Confirmed to edit ", aContextsForEdit.length, " selections.");
|
|
78
|
+
aContexts = aContextsForEdit;
|
|
79
|
+
} else if (sSelection === sCancelButton) {
|
|
80
|
+
Log.info("Mass Edit: Cancelled.");
|
|
81
|
+
}
|
|
82
|
+
resolve(aContexts);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
})
|
|
86
|
+
.catch(function(error) {
|
|
87
|
+
Log.error(error);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
} else {
|
|
91
|
+
return Promise.resolve(aContextsForEdit);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
});
|
|
@@ -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,18 +1,38 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* SAPUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
sap.ui.define(
|
|
6
6
|
[
|
|
7
7
|
"sap/fe/core/library",
|
|
8
8
|
"sap/fe/navigation/library",
|
|
9
9
|
"sap/fe/core/CommonUtils",
|
|
10
|
+
"sap/fe/core/helpers/KeepAliveHelper",
|
|
10
11
|
"sap/ui/fl/apply/api/ControlVariantApplyAPI",
|
|
11
12
|
"sap/ui/mdc/p13n/StateUtil",
|
|
12
13
|
"sap/ui/Device",
|
|
13
|
-
"sap/ui/mdc/enum/ConditionValidated"
|
|
14
|
+
"sap/ui/mdc/enum/ConditionValidated",
|
|
15
|
+
"sap/fe/macros/DelegateUtil",
|
|
16
|
+
"sap/fe/core/helpers/ModelHelper",
|
|
17
|
+
"sap/fe/macros/filter/FilterUtils",
|
|
18
|
+
"sap/fe/core/templating/PropertyFormatters",
|
|
19
|
+
"sap/base/Log"
|
|
14
20
|
],
|
|
15
|
-
function(
|
|
21
|
+
function(
|
|
22
|
+
CoreLibrary,
|
|
23
|
+
NavLibrary,
|
|
24
|
+
CommonUtils,
|
|
25
|
+
KeepAliveHelper,
|
|
26
|
+
ControlVariantApplyAPI,
|
|
27
|
+
StateUtil,
|
|
28
|
+
Device,
|
|
29
|
+
ConditionValidated,
|
|
30
|
+
DelegateUtil,
|
|
31
|
+
ModelHelper,
|
|
32
|
+
FilterUtils,
|
|
33
|
+
PropertyFormatters,
|
|
34
|
+
Log
|
|
35
|
+
) {
|
|
16
36
|
"use strict";
|
|
17
37
|
|
|
18
38
|
var NavType = NavLibrary.NavType,
|
|
@@ -20,6 +40,9 @@ sap.ui.define(
|
|
|
20
40
|
TemplateContentView = CoreLibrary.TemplateContentView,
|
|
21
41
|
InitialLoadMode = CoreLibrary.InitialLoadMode;
|
|
22
42
|
|
|
43
|
+
var FilterRestrictions = CommonUtils.FilterRestrictions,
|
|
44
|
+
CONDITION_PATH_TO_PROPERTY_PATH_REGEX = /\+|\*/g;
|
|
45
|
+
|
|
23
46
|
return {
|
|
24
47
|
applyInitialStateOnly: function() {
|
|
25
48
|
return true;
|
|
@@ -47,7 +70,7 @@ sap.ui.define(
|
|
|
47
70
|
var oView = this.getView(),
|
|
48
71
|
oController = oView.getController(),
|
|
49
72
|
aViewControls = oController._getControls(),
|
|
50
|
-
aControlsToRefresh =
|
|
73
|
+
aControlsToRefresh = KeepAliveHelper.getControlsForRefresh(oView, aViewControls);
|
|
51
74
|
|
|
52
75
|
Array.prototype.push.apply(aControls, aControlsToRefresh);
|
|
53
76
|
},
|
|
@@ -73,6 +96,7 @@ sap.ui.define(
|
|
|
73
96
|
if (bControlVM) {
|
|
74
97
|
aStateControls.push(oTable.getVariant());
|
|
75
98
|
}
|
|
99
|
+
aStateControls.push(oTable);
|
|
76
100
|
});
|
|
77
101
|
|
|
78
102
|
if (oController._hasMultiVisualizations()) {
|
|
@@ -121,28 +145,112 @@ sap.ui.define(
|
|
|
121
145
|
},
|
|
122
146
|
applyNavigationParameters: function(oNavigationParameter, aResults) {
|
|
123
147
|
var oView = this.getView(),
|
|
148
|
+
that = this,
|
|
149
|
+
oController = oView.getController(),
|
|
150
|
+
oComponent = oController.getOwnerComponent(),
|
|
151
|
+
oAppComponent = sap.ui.core.Component.getOwnerComponentFor(oComponent),
|
|
152
|
+
oComponentData = oAppComponent.getComponentData(),
|
|
153
|
+
oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
|
|
154
|
+
oVariantPromise = that.handleVariantIdPassedViaURLParams(oStartupParameters),
|
|
155
|
+
bFilterVariantApplied;
|
|
156
|
+
oVariantPromise
|
|
157
|
+
.then(function(aVariants) {
|
|
158
|
+
if (aVariants && aVariants.length > 0) {
|
|
159
|
+
if (aVariants[0] === true || aVariants[1] === true) {
|
|
160
|
+
bFilterVariantApplied = true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
var oRes = that._applySelectionVariant(oView, oNavigationParameter, bFilterVariantApplied).then(function() {
|
|
164
|
+
var oController = oView.getController();
|
|
165
|
+
var oDynamicPage = oView.byId("fe::ListReport");
|
|
166
|
+
var bPreventInitialSearch = false;
|
|
167
|
+
var oFilterBarVM = that._getFilterBarVM(oView);
|
|
168
|
+
var oFilterBarControl = oController._getFilterBarControl();
|
|
169
|
+
if (
|
|
170
|
+
(oNavigationParameter.navigationType !== NavType.initial && oNavigationParameter.requiresStandardVariant) ||
|
|
171
|
+
(!oFilterBarVM && oView.getViewData().initialLoad === InitialLoadMode.Enabled) ||
|
|
172
|
+
oController._shouldAutoTriggerSearch(oFilterBarVM)
|
|
173
|
+
) {
|
|
174
|
+
oFilterBarControl.triggerSearch();
|
|
175
|
+
} else {
|
|
176
|
+
bPreventInitialSearch = that._preventInitialSearch(oFilterBarVM);
|
|
177
|
+
}
|
|
178
|
+
that._bSearchTriggered = !bPreventInitialSearch;
|
|
179
|
+
oDynamicPage.setHeaderExpanded(Device.system.desktop || bPreventInitialSearch);
|
|
180
|
+
});
|
|
181
|
+
aResults.push(oRes);
|
|
182
|
+
})
|
|
183
|
+
.catch(function() {
|
|
184
|
+
Log.error("Variant ID cannot be applied");
|
|
185
|
+
});
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
handleVariantIdPassedViaURLParams: function(oUrlParams) {
|
|
189
|
+
var aPageVariantId = oUrlParams["sap-ui-fe-variant-id"],
|
|
190
|
+
aFilterBarVariantId = oUrlParams["sap-ui-fe-filterbar-variant-id"],
|
|
191
|
+
aTableVariantId = oUrlParams["sap-ui-fe-table-variant-id"],
|
|
192
|
+
oVariant;
|
|
193
|
+
if (aPageVariantId || aFilterBarVariantId || aTableVariantId) {
|
|
194
|
+
oVariant = {
|
|
195
|
+
sPageVariantId: aPageVariantId && aPageVariantId[0],
|
|
196
|
+
sFilterBarVariantId: aFilterBarVariantId && aFilterBarVariantId[0],
|
|
197
|
+
sTableVariantId: aTableVariantId && aTableVariantId[0]
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
return this._handleControlVariantId(oVariant);
|
|
201
|
+
},
|
|
202
|
+
|
|
203
|
+
_handleControlVariantId: function(oVariantIDs) {
|
|
204
|
+
var oView = this.getView(),
|
|
205
|
+
aPromises = [],
|
|
124
206
|
that = this;
|
|
125
|
-
var
|
|
126
|
-
|
|
127
|
-
var
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
207
|
+
var sVariantManagement = oView.getViewData().variantManagement;
|
|
208
|
+
if (oVariantIDs && oVariantIDs.sPageVariantId && sVariantManagement === "Page") {
|
|
209
|
+
var oVM = oView.byId("fe::PageVariantManagement");
|
|
210
|
+
oVM.getVariants().forEach(function(oVariant) {
|
|
211
|
+
if (oVariant.key === oVariantIDs.sPageVariantId) {
|
|
212
|
+
aPromises.push(that._applyControlVariant(oVM, oVariantIDs.sPageVariantId, true));
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
} else if (oVariantIDs && sVariantManagement === "Control") {
|
|
216
|
+
if (oVariantIDs.sFilterBarVariantId) {
|
|
217
|
+
var oVM = oView.byId(oView.getContent()[0].data("filterBarVariantId"));
|
|
218
|
+
oVM.getVariants().forEach(function(oVariant) {
|
|
219
|
+
if (oVariant.key === oVariantIDs.sFilterBarVariantId) {
|
|
220
|
+
aPromises.push(that._applyControlVariant(oVM, oVariantIDs.sFilterBarVariantId, true));
|
|
221
|
+
}
|
|
222
|
+
});
|
|
139
223
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
224
|
+
if (oVariantIDs.sTableVariantId) {
|
|
225
|
+
var oController = oView.getController(),
|
|
226
|
+
aTables = oController._getControls("table");
|
|
227
|
+
aTables.forEach(function(oTable) {
|
|
228
|
+
var oTableVariant = oTable.getVariant();
|
|
229
|
+
if (oTable && oTableVariant) {
|
|
230
|
+
oTableVariant.getVariants().forEach(function(oVariant) {
|
|
231
|
+
if (oVariant.key === oVariantIDs.sTableVariantId) {
|
|
232
|
+
aPromises.push(that._applyControlVariant(oTableVariant, oVariantIDs.sTableVariantId));
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
return Promise.all(aPromises);
|
|
144
240
|
},
|
|
145
241
|
|
|
242
|
+
_applyControlVariant: function(oVariant, sVariantID, bFilterVariantApplied) {
|
|
243
|
+
var sVariantReference = this._checkIfVariantIdIsAvailable(oVariant, sVariantID)
|
|
244
|
+
? sVariantID
|
|
245
|
+
: oVariant.getStandardVariantKey();
|
|
246
|
+
var oVM = ControlVariantApplyAPI.activateVariant({
|
|
247
|
+
element: oVariant,
|
|
248
|
+
variantReference: sVariantReference
|
|
249
|
+
});
|
|
250
|
+
return oVM.then(function() {
|
|
251
|
+
return bFilterVariantApplied;
|
|
252
|
+
});
|
|
253
|
+
},
|
|
146
254
|
/************************************* private helper *****************************************/
|
|
147
255
|
|
|
148
256
|
_getFilterBarVM: function(oView) {
|
|
@@ -170,7 +278,7 @@ sap.ui.define(
|
|
|
170
278
|
return !oCurrentVariant.executeOnSelect;
|
|
171
279
|
},
|
|
172
280
|
|
|
173
|
-
_applySelectionVariant: function(oView, oNavigationParameter) {
|
|
281
|
+
_applySelectionVariant: function(oView, oNavigationParameter, bFilterVariantApplied) {
|
|
174
282
|
var oSelectionVariant = oNavigationParameter.selectionVariant,
|
|
175
283
|
oSelectionVariantDefaults = oNavigationParameter.selectionVariantDefaults;
|
|
176
284
|
if (!oSelectionVariant) {
|
|
@@ -186,6 +294,9 @@ sap.ui.define(
|
|
|
186
294
|
oVariant,
|
|
187
295
|
bRequiresStandardVariant = oNavigationParameter.requiresStandardVariant;
|
|
188
296
|
|
|
297
|
+
if (bFilterVariantApplied) {
|
|
298
|
+
oConditions = oFilterBar.getConditions();
|
|
299
|
+
}
|
|
189
300
|
CommonUtils.addDefaultDisplayCurrency(aMandatoryFilterFields, oSelectionVariant, oSelectionVariantDefaults);
|
|
190
301
|
CommonUtils.addSelectionVariantToConditions(oSelectionVariant, oConditions, oMetaModel, sContextPath);
|
|
191
302
|
switch (oViewData.variantManagement) {
|
|
@@ -199,13 +310,13 @@ sap.ui.define(
|
|
|
199
310
|
default:
|
|
200
311
|
break;
|
|
201
312
|
}
|
|
202
|
-
return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant);
|
|
313
|
+
return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied);
|
|
203
314
|
},
|
|
204
|
-
_activateSelectionVariant: function(oFilterBar, oConditions, oVariant, bRequiresStandardVariant) {
|
|
315
|
+
_activateSelectionVariant: function(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied) {
|
|
205
316
|
var that = this,
|
|
206
317
|
oPromise;
|
|
207
318
|
|
|
208
|
-
if (oVariant) {
|
|
319
|
+
if (oVariant && !bFilterVariantApplied) {
|
|
209
320
|
var oVariantKey = bRequiresStandardVariant ? oVariant.getStandardVariantKey() : oVariant.getDefaultVariantKey();
|
|
210
321
|
if (oVariantKey === null) {
|
|
211
322
|
oVariantKey = oVariant.getId();
|
|
@@ -219,10 +330,9 @@ sap.ui.define(
|
|
|
219
330
|
} else {
|
|
220
331
|
oPromise = Promise.resolve(true);
|
|
221
332
|
}
|
|
222
|
-
|
|
223
333
|
return oPromise.then(function(bClearFilterAndReplaceWithAppState) {
|
|
224
334
|
if (bClearFilterAndReplaceWithAppState) {
|
|
225
|
-
return that.
|
|
335
|
+
return that._fnApplyConditions(oFilterBar, oConditions);
|
|
226
336
|
}
|
|
227
337
|
});
|
|
228
338
|
},
|
|
@@ -241,9 +351,35 @@ sap.ui.define(
|
|
|
241
351
|
}
|
|
242
352
|
delete oCondition.isEmpty;
|
|
243
353
|
};
|
|
354
|
+
var fnGetPropertyInfo = function(oFilterControl, sEntityTypePath) {
|
|
355
|
+
var sEntitySetPath = ModelHelper.getEntitySetPath(sEntityTypePath),
|
|
356
|
+
oMetaModel = oFilterControl.getModel().getMetaModel(),
|
|
357
|
+
oFR = CommonUtils.getFilterRestrictionsByPath(sEntitySetPath, oMetaModel),
|
|
358
|
+
aNonFilterableProps = oFR[FilterRestrictions.NON_FILTERABLE_PROPERTIES],
|
|
359
|
+
mFilterFields = FilterUtils.getConvertedFilterFields(oFilterControl, sEntityTypePath),
|
|
360
|
+
aPropertyInfo = [];
|
|
361
|
+
Object.keys(mFilterFields).forEach(function(sFilterFieldKey) {
|
|
362
|
+
var oConvertedProperty = mFilterFields[sFilterFieldKey];
|
|
363
|
+
var sPropertyPath = oConvertedProperty.conditionPath.replace(CONDITION_PATH_TO_PROPERTY_PATH_REGEX, "");
|
|
364
|
+
if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
|
|
365
|
+
var sAnnotationPath = oConvertedProperty.annotationPath;
|
|
366
|
+
var oPropertyContext = oMetaModel.createBindingContext(sAnnotationPath);
|
|
367
|
+
aPropertyInfo.push({
|
|
368
|
+
path: oConvertedProperty.conditionPath,
|
|
369
|
+
hiddenFilter: oConvertedProperty.availability === "Hidden",
|
|
370
|
+
hasValueHelp: !sAnnotationPath
|
|
371
|
+
? false
|
|
372
|
+
: PropertyFormatters.hasValueHelp(oPropertyContext.getObject(), { context: oPropertyContext })
|
|
373
|
+
});
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
return aPropertyInfo;
|
|
378
|
+
};
|
|
244
379
|
return oFilterBar.initialized().then(function() {
|
|
245
|
-
oFilterBar
|
|
246
|
-
|
|
380
|
+
var sEntityTypePath = DelegateUtil.getCustomData(oFilterBar, "entityType");
|
|
381
|
+
var aPropertyInfo = fnGetPropertyInfo(oFilterBar, sEntityTypePath);
|
|
382
|
+
aPropertyInfo
|
|
247
383
|
.filter(function(oPropertyInfo) {
|
|
248
384
|
return oPropertyInfo.path !== "$editState" && oPropertyInfo.path !== "$search";
|
|
249
385
|
})
|
|
@@ -266,9 +402,6 @@ sap.ui.define(
|
|
|
266
402
|
});
|
|
267
403
|
return StateUtil.applyExternalState(oFilterBar, { filter: mFilter, items: aItems });
|
|
268
404
|
});
|
|
269
|
-
},
|
|
270
|
-
_fnClearFilterAndReplaceWithAppState: function(oFilterBar, oConditions) {
|
|
271
|
-
return this._fnApplyConditions(oFilterBar, {}).then(this._fnApplyConditions.bind(this, oFilterBar, oConditions));
|
|
272
405
|
}
|
|
273
406
|
};
|
|
274
407
|
}
|
|
@@ -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
|
|
|
@@ -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
|
[
|
|
@@ -15,6 +15,7 @@ sap.ui.define(
|
|
|
15
15
|
"use strict";
|
|
16
16
|
|
|
17
17
|
var VariantManagement = CoreLibrary.VariantManagement,
|
|
18
|
+
CreationMode = CoreLibrary.CreationMode,
|
|
18
19
|
ObjectPageComponent = TemplateComponent.extend("sap.fe.templates.ObjectPage.Component", {
|
|
19
20
|
metadata: {
|
|
20
21
|
properties: {
|
|
@@ -70,10 +71,10 @@ sap.ui.define(
|
|
|
70
71
|
defaultValue: false
|
|
71
72
|
},
|
|
72
73
|
/**
|
|
73
|
-
*
|
|
74
|
+
* Defines the properties which can be used for inbound Navigation
|
|
74
75
|
*/
|
|
75
|
-
|
|
76
|
-
type: "
|
|
76
|
+
inboundParameters: {
|
|
77
|
+
type: "object"
|
|
77
78
|
}
|
|
78
79
|
},
|
|
79
80
|
library: "sap.fe.templates",
|
|
@@ -86,31 +87,43 @@ sap.ui.define(
|
|
|
86
87
|
|
|
87
88
|
// TODO: this should be ideally be handled by the editflow/routing without the need to have this method in the
|
|
88
89
|
// object page - for now keep it here
|
|
89
|
-
createDeferredContext: function(sPath, bActionCreate) {
|
|
90
|
+
createDeferredContext: function(sPath, oListBinding, bActionCreate) {
|
|
90
91
|
if (!this.DeferredContextCreated) {
|
|
91
92
|
this.DeferredContextCreated = true;
|
|
92
|
-
var
|
|
93
|
-
that = this,
|
|
93
|
+
var that = this,
|
|
94
94
|
oParamters = {
|
|
95
95
|
"$$groupId": "$auto.Heroes",
|
|
96
96
|
"$$updateGroupId": "$auto"
|
|
97
97
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
98
|
+
if (!oListBinding || oListBinding.isRelative() === false) {
|
|
99
|
+
oListBinding = new ODataListBinding(
|
|
100
|
+
this.getModel(),
|
|
101
|
+
sPath.replace("(...)", ""),
|
|
102
|
+
undefined,
|
|
103
|
+
undefined,
|
|
104
|
+
undefined,
|
|
105
|
+
oParamters
|
|
106
|
+
);
|
|
107
|
+
} else {
|
|
108
|
+
oListBinding.mParameters = oParamters;
|
|
109
|
+
}
|
|
110
|
+
var oStartUpParams =
|
|
111
|
+
this.oAppComponent &&
|
|
112
|
+
this.oAppComponent.getComponentData() &&
|
|
113
|
+
this.oAppComponent.getComponentData().startupParameters,
|
|
114
|
+
oInboundParameters = this.getViewData().inboundParameters,
|
|
115
|
+
createParams;
|
|
116
|
+
if (oStartUpParams.preferredMode && oStartUpParams.preferredMode[0].indexOf("create") !== -1) {
|
|
117
|
+
createParams = CommonUtils.getAdditionalParamsForCreate(oStartUpParams, oInboundParameters);
|
|
118
|
+
}
|
|
107
119
|
|
|
108
120
|
// for now wait until the view and the controller is created
|
|
109
121
|
that.getRootControl()
|
|
110
122
|
.getController()
|
|
111
123
|
.editFlow.createDocument(oListBinding, {
|
|
112
|
-
creationMode:
|
|
113
|
-
createAction: bActionCreate
|
|
124
|
+
creationMode: CreationMode.Sync,
|
|
125
|
+
createAction: bActionCreate,
|
|
126
|
+
data: createParams
|
|
114
127
|
})
|
|
115
128
|
.finally(function() {
|
|
116
129
|
that.DeferredContextCreated = false;
|
|
@@ -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/core/CommonUtils", "sap/fe/core/converters/helpers/ID"], function(
|
|
6
6
|
ExtensionAPI,
|
|
@@ -105,6 +105,9 @@ sap.ui.define(["sap/fe/core/ExtensionAPI", "sap/fe/core/CommonUtils", "sap/fe/co
|
|
|
105
105
|
*/
|
|
106
106
|
getSelectedContexts: function(sTableId) {
|
|
107
107
|
var oTable = this._view.byId(sTableId);
|
|
108
|
+
if (oTable && oTable.isA("sap.fe.macros.TableAPI")) {
|
|
109
|
+
oTable = oTable.getContent();
|
|
110
|
+
}
|
|
108
111
|
return (oTable && oTable.isA("sap.ui.mdc.Table") && oTable.getSelectedContexts()) || [];
|
|
109
112
|
},
|
|
110
113
|
|
|
@@ -122,6 +125,18 @@ sap.ui.define(["sap/fe/core/ExtensionAPI", "sap/fe/core/CommonUtils", "sap/fe/co
|
|
|
122
125
|
oBlock = this._view.byId(sBlockID),
|
|
123
126
|
bBlockState = bShow === undefined ? !oBlock.getShowSideContent() : bShow;
|
|
124
127
|
oBlock.setShowSideContent(bBlockState);
|
|
128
|
+
},
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Gets the bound context of the current object page.
|
|
132
|
+
*
|
|
133
|
+
* @alias sap.fe.templates.ObjectPage.ExtensionAPI#getBindingContext
|
|
134
|
+
* @returns {sap.ui.model.odata.v4.Context} Context bound to the object page
|
|
135
|
+
*
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
getBindingContext: function() {
|
|
139
|
+
return this._view.getBindingContext();
|
|
125
140
|
}
|
|
126
141
|
});
|
|
127
142
|
|