@sapui5/sap.fe.templates 1.93.3 → 1.96.2
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 +2 -2
- package/src/sap/fe/templates/.library +1 -1
- package/src/sap/fe/templates/AnalyticalListPage/manifest.json +6 -0
- package/src/sap/fe/templates/ListReport/ExtensionAPI.js +31 -3
- package/src/sap/fe/templates/ListReport/ListReport.view.xml +7 -5
- package/src/sap/fe/templates/ListReport/ListReportController.controller.js +181 -197
- package/src/sap/fe/templates/ListReport/manifest.json +11 -1
- package/src/sap/fe/templates/ListReport/overrides/IntentBasedNavigation.js +1 -1
- package/src/sap/fe/templates/ListReport/overrides/ViewState.js +123 -26
- package/src/sap/fe/templates/ListReport/view/fragments/MultipleMode.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/AnnotationHelper.js +35 -99
- package/src/sap/fe/templates/ObjectPage/Component.js +0 -6
- package/src/sap/fe/templates/ObjectPage/ExtensionAPI.js +18 -3
- package/src/sap/fe/templates/ObjectPage/ObjectPage.view.xml +169 -165
- package/src/sap/fe/templates/ObjectPage/ObjectPageController.controller.js +220 -157
- package/src/sap/fe/templates/ObjectPage/controls/SubSectionBlock.js +1 -1
- package/src/sap/fe/templates/ObjectPage/overrides/Paginator.js +13 -0
- package/src/sap/fe/templates/ObjectPage/overrides/Share.js +2 -2
- package/src/sap/fe/templates/ObjectPage/overrides/ViewState.js +22 -1
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.js +16 -14
- package/src/sap/fe/templates/ObjectPage/templating/ObjectPageTemplating.ts +20 -8
- package/src/sap/fe/templates/ObjectPage/view/fragments/Actions.fragment.xml +14 -19
- package/src/sap/fe/templates/ObjectPage/view/fragments/EditableHeaderFacet.fragment.xml +3 -3
- package/src/sap/fe/templates/ObjectPage/view/fragments/FooterContent.fragment.xml +1 -1
- package/src/sap/fe/templates/ObjectPage/view/fragments/HeaderContent.fragment.xml +34 -38
- package/src/sap/fe/templates/ObjectPage/view/fragments/Section.fragment.xml +8 -2
- package/src/sap/fe/templates/ObjectPage/view/fragments/SectionContent.fragment.xml +8 -4
- package/src/sap/fe/templates/RootContainer/controller/Fcl.controller.js +60 -112
- package/src/sap/fe/templates/RootContainer/controller/NavContainer.controller.js +62 -70
- package/src/sap/fe/templates/RootContainer/controller/RootContainerBaseController.js +9 -1
- package/src/sap/fe/templates/TableScroller.js +61 -0
- package/src/sap/fe/templates/controls/Chart.fragment.xml +11 -14
- package/src/sap/fe/templates/controls/OverflowToolbarButtonHover.js +1 -1
- package/src/sap/fe/templates/controls/Table.fragment.xml +1 -0
- package/src/sap/fe/templates/library.js +1 -1
- package/src/sap/fe/templates/messagebundle.properties +1 -1
- package/src/sap/fe/templates/messagebundle_ar.properties +9 -5
- package/src/sap/fe/templates/messagebundle_bg.properties +8 -4
- package/src/sap/fe/templates/messagebundle_ca.properties +8 -4
- package/src/sap/fe/templates/messagebundle_cs.properties +7 -3
- package/src/sap/fe/templates/messagebundle_cy.properties +8 -4
- package/src/sap/fe/templates/messagebundle_da.properties +9 -5
- package/src/sap/fe/templates/messagebundle_de.properties +8 -4
- package/src/sap/fe/templates/messagebundle_el.properties +8 -4
- package/src/sap/fe/templates/messagebundle_en.properties +7 -3
- package/src/sap/fe/templates/messagebundle_en_GB.properties +7 -3
- package/src/sap/fe/templates/messagebundle_en_US_sappsd.properties +7 -3
- package/src/sap/fe/templates/messagebundle_en_US_saprigi.properties +7 -3
- package/src/sap/fe/templates/messagebundle_en_US_saptrc.properties +7 -3
- package/src/sap/fe/templates/messagebundle_es.properties +8 -4
- package/src/sap/fe/templates/messagebundle_es_MX.properties +8 -4
- package/src/sap/fe/templates/messagebundle_et.properties +7 -3
- package/src/sap/fe/templates/messagebundle_fi.properties +8 -4
- package/src/sap/fe/templates/messagebundle_fr.properties +9 -5
- package/src/sap/fe/templates/messagebundle_fr_CA.properties +8 -4
- package/src/sap/fe/templates/messagebundle_hi.properties +8 -4
- package/src/sap/fe/templates/messagebundle_hr.properties +8 -4
- package/src/sap/fe/templates/messagebundle_hu.properties +9 -5
- package/src/sap/fe/templates/messagebundle_id.properties +10 -6
- package/src/sap/fe/templates/messagebundle_it.properties +8 -4
- package/src/sap/fe/templates/messagebundle_iw.properties +8 -4
- package/src/sap/fe/templates/messagebundle_ja.properties +8 -4
- package/src/sap/fe/templates/messagebundle_kk.properties +8 -4
- package/src/sap/fe/templates/messagebundle_ko.properties +8 -4
- package/src/sap/fe/templates/messagebundle_lt.properties +8 -4
- package/src/sap/fe/templates/messagebundle_lv.properties +8 -4
- package/src/sap/fe/templates/messagebundle_ms.properties +8 -4
- package/src/sap/fe/templates/messagebundle_nl.properties +8 -4
- package/src/sap/fe/templates/messagebundle_no.properties +9 -5
- package/src/sap/fe/templates/messagebundle_pl.properties +8 -4
- package/src/sap/fe/templates/messagebundle_pt.properties +8 -4
- package/src/sap/fe/templates/messagebundle_pt_PT.properties +8 -4
- package/src/sap/fe/templates/messagebundle_ro.properties +8 -4
- package/src/sap/fe/templates/messagebundle_ru.properties +9 -5
- package/src/sap/fe/templates/messagebundle_sh.properties +8 -4
- package/src/sap/fe/templates/messagebundle_sk.properties +8 -4
- package/src/sap/fe/templates/messagebundle_sl.properties +8 -4
- package/src/sap/fe/templates/messagebundle_sv.properties +8 -4
- package/src/sap/fe/templates/messagebundle_th.properties +9 -5
- package/src/sap/fe/templates/messagebundle_tr.properties +7 -3
- package/src/sap/fe/templates/messagebundle_uk.properties +7 -3
- package/src/sap/fe/templates/messagebundle_vi.properties +8 -4
- package/src/sap/fe/templates/messagebundle_zh_CN.properties +9 -5
- package/src/sap/fe/templates/messagebundle_zh_TW.properties +8 -4
- package/src/sap/fe/templates/ObjectPage/overrides/Routing.js +0 -20
- package/src/sap/fe/templates/ObjectPage/view/fragments/TitleAndSubtitle.fragment.xml +0 -24
- package/src/sap/fe/templates/RootContainer/view/PlaceholderLR.view.xml +0 -617
- package/src/sap/fe/templates/RootContainer/view/PlaceholderOP.view.xml +0 -588
- package/src/sap/fe/templates/controls/Paginator.control.xml +0 -22
- package/src/sap/fe/templates/controls/Paginator.js +0 -173
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
"handleValidation": true
|
|
26
|
+
"handleValidation": true,
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"minUI5Version": "${sap.ui5.core.version}",
|
|
29
|
+
"libs": {
|
|
30
|
+
"sap.fe.core": {},
|
|
31
|
+
"sap.ui.mdc": {},
|
|
32
|
+
"sap.fe.macros": {},
|
|
33
|
+
"sap.ui.fl": {},
|
|
34
|
+
"sap.fe.navigation": {}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
27
37
|
}
|
|
28
38
|
}
|
|
@@ -30,7 +30,7 @@ sap.ui.define(["sap/fe/core/CommonUtils", "sap/fe/macros/filter/FilterUtils"], f
|
|
|
30
30
|
);
|
|
31
31
|
var oFilterBar = oController._getFilterBarControl();
|
|
32
32
|
var oFilterInfo = FilterUtils.getFilterInfo(oFilterBar, {
|
|
33
|
-
targetControl: oController.
|
|
33
|
+
targetControl: oController._getTable()
|
|
34
34
|
}).filters;
|
|
35
35
|
var oInternalModelContext = oView.getBindingContext("internal");
|
|
36
36
|
var mTabs = oInternalModelContext.getProperty("tabs");
|
|
@@ -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,
|
|
@@ -28,7 +29,7 @@ sap.ui.define(
|
|
|
28
29
|
var oView = this.getView(),
|
|
29
30
|
oController = oView.getController(),
|
|
30
31
|
oFilterBar = oController._getFilterBarControl(),
|
|
31
|
-
aTables = oController.
|
|
32
|
+
aTables = oController._getControls("table");
|
|
32
33
|
|
|
33
34
|
oFilterBar.setSuspendSelection(true);
|
|
34
35
|
aTables.forEach(function(oTable) {
|
|
@@ -43,6 +44,14 @@ sap.ui.define(
|
|
|
43
44
|
oController = oView.getController();
|
|
44
45
|
oController._getFilterBarControl().setSuspendSelection(false);
|
|
45
46
|
},
|
|
47
|
+
adaptBindingRefreshControls: function(aControls) {
|
|
48
|
+
var oView = this.getView(),
|
|
49
|
+
oController = oView.getController(),
|
|
50
|
+
aViewControls = oController._getControls(),
|
|
51
|
+
aControlsToRefresh = CommonUtils.getControlsForRefresh(oView, aViewControls);
|
|
52
|
+
|
|
53
|
+
Array.prototype.push.apply(aControls, aControlsToRefresh);
|
|
54
|
+
},
|
|
46
55
|
adaptStateControls: function(aStateControls) {
|
|
47
56
|
var oView = this.getView(),
|
|
48
57
|
oController = oView.getController(),
|
|
@@ -57,7 +66,7 @@ sap.ui.define(
|
|
|
57
66
|
if (oFilterBarVM) {
|
|
58
67
|
aStateControls.push(oFilterBarVM);
|
|
59
68
|
}
|
|
60
|
-
oController.
|
|
69
|
+
oController._getControls("table").forEach(function(oTable) {
|
|
61
70
|
var oQuickFilter = oTable.getQuickFilter();
|
|
62
71
|
if (oQuickFilter) {
|
|
63
72
|
aStateControls.push(oQuickFilter);
|
|
@@ -113,28 +122,109 @@ sap.ui.define(
|
|
|
113
122
|
},
|
|
114
123
|
applyNavigationParameters: function(oNavigationParameter, aResults) {
|
|
115
124
|
var oView = this.getView(),
|
|
125
|
+
that = this,
|
|
126
|
+
oController = oView.getController(),
|
|
127
|
+
oComponent = oController.getOwnerComponent(),
|
|
128
|
+
oAppComponent = sap.ui.core.Component.getOwnerComponentFor(oComponent),
|
|
129
|
+
oComponentData = oAppComponent.getComponentData(),
|
|
130
|
+
oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
|
|
131
|
+
oVariantPromise = that.handleVariantIdPassedViaURLParams(oStartupParameters),
|
|
132
|
+
bFilterVariantApplied;
|
|
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
|
+
var oRes = that._applySelectionVariant(oView, oNavigationParameter, bFilterVariantApplied).then(function() {
|
|
141
|
+
var oController = oView.getController();
|
|
142
|
+
var oDynamicPage = oView.byId("fe::ListReport");
|
|
143
|
+
var bPreventInitialSearch = false;
|
|
144
|
+
var oFilterBarVM = that._getFilterBarVM(oView);
|
|
145
|
+
var oFilterBarControl = oController._getFilterBarControl();
|
|
146
|
+
if (
|
|
147
|
+
(oNavigationParameter.navigationType !== NavType.initial && 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
|
+
aResults.push(oRes);
|
|
159
|
+
})
|
|
160
|
+
.catch(function() {
|
|
161
|
+
Log.error("Variant ID cannot be applied");
|
|
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 = [],
|
|
116
183
|
that = this;
|
|
117
|
-
var
|
|
118
|
-
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
+
});
|
|
131
200
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
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);
|
|
136
217
|
},
|
|
137
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
|
+
},
|
|
138
228
|
/************************************* private helper *****************************************/
|
|
139
229
|
|
|
140
230
|
_getFilterBarVM: function(oView) {
|
|
@@ -162,7 +252,7 @@ sap.ui.define(
|
|
|
162
252
|
return !oCurrentVariant.executeOnSelect;
|
|
163
253
|
},
|
|
164
254
|
|
|
165
|
-
_applySelectionVariant: function(oView, oNavigationParameter) {
|
|
255
|
+
_applySelectionVariant: function(oView, oNavigationParameter, bFilterVariantApplied) {
|
|
166
256
|
var oSelectionVariant = oNavigationParameter.selectionVariant,
|
|
167
257
|
oSelectionVariantDefaults = oNavigationParameter.selectionVariantDefaults;
|
|
168
258
|
if (!oSelectionVariant) {
|
|
@@ -178,6 +268,9 @@ sap.ui.define(
|
|
|
178
268
|
oVariant,
|
|
179
269
|
bRequiresStandardVariant = oNavigationParameter.requiresStandardVariant;
|
|
180
270
|
|
|
271
|
+
if (bFilterVariantApplied) {
|
|
272
|
+
oConditions = oFilterBar.getConditions();
|
|
273
|
+
}
|
|
181
274
|
CommonUtils.addDefaultDisplayCurrency(aMandatoryFilterFields, oSelectionVariant, oSelectionVariantDefaults);
|
|
182
275
|
CommonUtils.addSelectionVariantToConditions(oSelectionVariant, oConditions, oMetaModel, sContextPath);
|
|
183
276
|
switch (oViewData.variantManagement) {
|
|
@@ -191,13 +284,13 @@ sap.ui.define(
|
|
|
191
284
|
default:
|
|
192
285
|
break;
|
|
193
286
|
}
|
|
194
|
-
return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant);
|
|
287
|
+
return this._activateSelectionVariant(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied);
|
|
195
288
|
},
|
|
196
|
-
_activateSelectionVariant: function(oFilterBar, oConditions, oVariant, bRequiresStandardVariant) {
|
|
289
|
+
_activateSelectionVariant: function(oFilterBar, oConditions, oVariant, bRequiresStandardVariant, bFilterVariantApplied) {
|
|
197
290
|
var that = this,
|
|
198
291
|
oPromise;
|
|
199
292
|
|
|
200
|
-
if (oVariant) {
|
|
293
|
+
if (oVariant && !bFilterVariantApplied) {
|
|
201
294
|
var oVariantKey = bRequiresStandardVariant ? oVariant.getStandardVariantKey() : oVariant.getDefaultVariantKey();
|
|
202
295
|
if (oVariantKey === null) {
|
|
203
296
|
oVariantKey = oVariant.getId();
|
|
@@ -247,6 +340,10 @@ sap.ui.define(
|
|
|
247
340
|
}
|
|
248
341
|
if (oPropertyInfo.hasValueHelp) {
|
|
249
342
|
mFilter[oPropertyInfo.path].forEach(fnAdjustValueHelpCondition);
|
|
343
|
+
} else {
|
|
344
|
+
mFilter[oPropertyInfo.path].forEach(function(oCondition) {
|
|
345
|
+
oCondition.validated = ConditionValidated.NotValidated;
|
|
346
|
+
});
|
|
250
347
|
}
|
|
251
348
|
} else {
|
|
252
349
|
mFilter[oPropertyInfo.path] = [];
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
<template:with path="view>presentation" var="presentationContext">
|
|
20
20
|
<IconTabFilter
|
|
21
21
|
text="{view>title}"
|
|
22
|
-
key="{= ${view>tableControlId} || ${view>customTabId} }"
|
|
22
|
+
key="{= ${view>tableControlId} || ${view>customTabId} || ${view>chartControlId}}"
|
|
23
23
|
customData:selectionVariant="{view>selectionVariantPath}"
|
|
24
24
|
>
|
|
25
25
|
<content>
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
</template:then>
|
|
30
30
|
<template:else>
|
|
31
31
|
<MessageStrip
|
|
32
|
-
text="{= '{parts: [{path: \'internal>tabs/ignoredFields/' + ${view>tableControlId} + '\'}, {path: \'\', value: \'' + ${view>title} + '\' }], formatter: \'.formatters.setTabMessageStrip\'}' }"
|
|
32
|
+
text="{= '{parts: [{path: \'internal>tabs/ignoredFields/' + (${view>tableControlId} || ${view>chartControlId}) + '\'}, {path: \'\', value: \'' + ${view>title} + '\' }], formatter: \'.formatters.setTabMessageStrip\'}' }"
|
|
33
33
|
type="Information"
|
|
34
34
|
showIcon="true"
|
|
35
35
|
showCloseButton="true"
|
|
36
36
|
class="sapUiSmallMargin"
|
|
37
|
-
visible="{= '{= (${internal>tabs/ignoredFields/' +
|
|
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" />
|
|
@@ -69,16 +69,32 @@ sap.ui.define(
|
|
|
69
69
|
},
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
|
-
* Function to
|
|
73
|
-
*
|
|
74
|
-
* @param {
|
|
75
|
-
* @
|
|
72
|
+
* Function to find an action from the array of header actions in the converter context.
|
|
73
|
+
*
|
|
74
|
+
* @param {object[]} aConverterContextHeaderActions Array of 'header' actions on the object page.
|
|
75
|
+
* @param {string} sActionType The action type
|
|
76
|
+
* @returns {object | undefined} The action with the matching action type
|
|
77
|
+
* @private
|
|
76
78
|
*/
|
|
77
|
-
|
|
78
|
-
var
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
_findAction: function(aConverterContextHeaderActions, sActionType) {
|
|
80
|
+
var oAction;
|
|
81
|
+
if (aConverterContextHeaderActions && aConverterContextHeaderActions.length) {
|
|
82
|
+
oAction = aConverterContextHeaderActions.find(function(oHeaderAction) {
|
|
83
|
+
return oHeaderAction.type === sActionType;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return oAction;
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Function to format the 'enabled' property for the Delete button on the object page or subobject page in case of a Command Execution.
|
|
91
|
+
*
|
|
92
|
+
* @param {Array} aConverterContextHeaderActions Array of header actions on the object page
|
|
93
|
+
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
94
|
+
*/
|
|
95
|
+
getDeleteCommandExecutionEnabled: function(aConverterContextHeaderActions) {
|
|
96
|
+
var oDeleteAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Secondary");
|
|
97
|
+
return oDeleteAction ? oDeleteAction.enabled : "true";
|
|
82
98
|
},
|
|
83
99
|
/**
|
|
84
100
|
* Function to format the 'visible' property for the Delete button on the object page or subobject page in case of a Command Execution.
|
|
@@ -87,10 +103,7 @@ sap.ui.define(
|
|
|
87
103
|
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
88
104
|
*/
|
|
89
105
|
getDeleteCommandExecutionVisible: function(aConverterContextHeaderActions) {
|
|
90
|
-
var oDeleteAction =
|
|
91
|
-
return oAction.type === "Secondary";
|
|
92
|
-
});
|
|
93
|
-
|
|
106
|
+
var oDeleteAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Secondary");
|
|
94
107
|
return oDeleteAction ? oDeleteAction.visible : "true";
|
|
95
108
|
},
|
|
96
109
|
/**
|
|
@@ -100,38 +113,18 @@ sap.ui.define(
|
|
|
100
113
|
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
101
114
|
*/
|
|
102
115
|
getEditCommandExecutionVisible: function(aConverterContextHeaderActions) {
|
|
103
|
-
var oEditAction =
|
|
104
|
-
return oAction.type === "Primary";
|
|
105
|
-
});
|
|
106
|
-
|
|
116
|
+
var oEditAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Primary");
|
|
107
117
|
return oEditAction ? oEditAction.visible : "true";
|
|
108
118
|
},
|
|
109
119
|
/**
|
|
110
|
-
* Function to
|
|
120
|
+
* Function to format the 'enabled' property for the Edit button on the object page or subobject page in case of a Command Execution.
|
|
111
121
|
*
|
|
112
|
-
* @param {
|
|
113
|
-
* @returns {string} Returns expression binding or Boolean value
|
|
114
|
-
*/
|
|
115
|
-
fnGetDeleteButtonEnabled: function(oDeletable) {
|
|
116
|
-
if (oDeletable === "false") {
|
|
117
|
-
return false;
|
|
118
|
-
} else if (oDeletable && oDeletable !== "true") {
|
|
119
|
-
return "{= $" + oDeletable + "}";
|
|
120
|
-
} else {
|
|
121
|
-
return true;
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Function to get the enablement for the Delete button in the object page/sub-object page based on current and parent entity-set restrictions.
|
|
127
|
-
*
|
|
128
|
-
* @param {object} [oDeletable] Current Entity Set delete restriction value.
|
|
129
|
-
* @param {object} [bParentDeleteRestrictionEnabled] The parent entity's delete restriction value via navigation restriction.
|
|
130
|
-
* @returns {string} Returns expression binding or boolean value based on oDeletable
|
|
122
|
+
* @param {Array} aConverterContextHeaderActions Array of header actions on the object page
|
|
123
|
+
* @returns {string} Returns expression binding or Boolean value from the converter output
|
|
131
124
|
*/
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
return
|
|
125
|
+
getEditCommandExecutionEnabled: function(aConverterContextHeaderActions) {
|
|
126
|
+
var oEditAction = AnnotationHelper._findAction(aConverterContextHeaderActions, "Primary");
|
|
127
|
+
return oEditAction ? oEditAction.enabled : "true";
|
|
135
128
|
},
|
|
136
129
|
/**
|
|
137
130
|
* Function to get the EditAction from the Entityset based on Draft or sticky based application.
|
|
@@ -307,63 +300,6 @@ sap.ui.define(
|
|
|
307
300
|
? "{fclhelper>/breadCrumbIsVisible}"
|
|
308
301
|
: oViewData.showBreadCrumbs;
|
|
309
302
|
},
|
|
310
|
-
/*
|
|
311
|
-
* Get expression for header action's enable property.
|
|
312
|
-
*
|
|
313
|
-
* @function
|
|
314
|
-
* @param {Object} [operationAvailable] operationAvailable object,
|
|
315
|
-
* @param {object} [oEntitySet] entity set information
|
|
316
|
-
* @param {string} [sOperationAvailableFormatted] formatted value of operational available
|
|
317
|
-
* returns {*} Expression or boolean values true if operationAvailable is not path based
|
|
318
|
-
*/
|
|
319
|
-
getEnabledExpressionForHeaderActions: function(operationAvailable, oEntitySet, sOperationAvailableFormatted) {
|
|
320
|
-
if (operationAvailable === null) {
|
|
321
|
-
var oEditAction =
|
|
322
|
-
(oEntitySet["@com.sap.vocabularies.Common.v1.DraftRoot"] &&
|
|
323
|
-
oEntitySet["@com.sap.vocabularies.Common.v1.DraftRoot"].EditAction) ||
|
|
324
|
-
(oEntitySet["@com.sap.vocabularies.Common.v1.StickySessionSupported"] &&
|
|
325
|
-
oEntitySet["@com.sap.vocabularies.Common.v1.StickySessionSupported"].EditAction);
|
|
326
|
-
if (oEditAction) {
|
|
327
|
-
return "{= ${#" + oEditAction + "} ? true : false }";
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
if (operationAvailable && operationAvailable.$Path) {
|
|
331
|
-
return sOperationAvailableFormatted;
|
|
332
|
-
} else {
|
|
333
|
-
return true;
|
|
334
|
-
}
|
|
335
|
-
},
|
|
336
|
-
|
|
337
|
-
/*
|
|
338
|
-
* Gets the expression for the enablement of the action annotation.
|
|
339
|
-
*
|
|
340
|
-
* @function
|
|
341
|
-
* @param {object} [oBound] The Bound action context
|
|
342
|
-
* @param {object} [oActionContext] The object of the action context
|
|
343
|
-
* @param {object} [oDataField] The object of the data field
|
|
344
|
-
* @param {string} [sFormattedValueOperationalAvailable] The string value of the available operation
|
|
345
|
-
* returns {*} returns {*} both Boolean and expression with the following logic:
|
|
346
|
-
* if none of the conditions is met, the button is enabled
|
|
347
|
-
* if bound is false, then 'true' is returned as a string
|
|
348
|
-
* in all other cases a runtime binding expression is returned
|
|
349
|
-
*/
|
|
350
|
-
getButtonEnabledForAnnotationAction: function(oBound, oActionContext, oDataField, sFormattedValueOperationalAvailable) {
|
|
351
|
-
if (oBound && oBound.$IsBound !== true) {
|
|
352
|
-
return "true";
|
|
353
|
-
}
|
|
354
|
-
if (oActionContext && oActionContext["@Org.OData.Core.V1.OperationAvailable"] === null && oDataField) {
|
|
355
|
-
return "{= !${#" + oDataField.Action + "} ? false : true } }";
|
|
356
|
-
}
|
|
357
|
-
if (
|
|
358
|
-
oActionContext &&
|
|
359
|
-
oActionContext["@Org.OData.Core.V1.OperationAvailable"] &&
|
|
360
|
-
oActionContext["@Org.OData.Core.V1.OperationAvailable"].$Path
|
|
361
|
-
) {
|
|
362
|
-
return "{= $" + sFormattedValueOperationalAvailable + "}";
|
|
363
|
-
}
|
|
364
|
-
return true;
|
|
365
|
-
},
|
|
366
|
-
|
|
367
303
|
getShareButtonVisibility: function(viewData) {
|
|
368
304
|
var sShareButtonVisibilityExp = "!${ui>createMode}";
|
|
369
305
|
if (viewData.fclEnabled) {
|
|
@@ -395,8 +331,8 @@ sap.ui.define(
|
|
|
395
331
|
*/
|
|
396
332
|
getPressExpressionForDelete: function(sEntitySetName) {
|
|
397
333
|
var sDeletableContexts = "${$view>/getBindingContext}",
|
|
398
|
-
sTitle = "${$view>/#fe::ObjectPage/getHeaderTitle/getExpandedHeading/getItems/1/
|
|
399
|
-
sDescription = "${$view>/#fe::ObjectPage/getHeaderTitle/
|
|
334
|
+
sTitle = "${$view>/#fe::ObjectPage/getHeaderTitle/getExpandedHeading/getItems/1/getText}",
|
|
335
|
+
sDescription = "${$view>/#fe::ObjectPage/getHeaderTitle/getExpandedContent/0/getItems/0/getText}";
|
|
400
336
|
var oParams = {
|
|
401
337
|
title: sTitle,
|
|
402
338
|
entitySetName: CommonHelper.addSingleQuotes(sEntitySetName),
|
|
@@ -68,12 +68,6 @@ sap.ui.define(
|
|
|
68
68
|
prepareOnEdit: {
|
|
69
69
|
type: "boolean",
|
|
70
70
|
defaultValue: false
|
|
71
|
-
},
|
|
72
|
-
/**
|
|
73
|
-
* Temporary fix to avoid activating all bindings when a message doesn't have a controlId at first
|
|
74
|
-
*/
|
|
75
|
-
_disableLazyLoadingForMessages: {
|
|
76
|
-
type: "boolean"
|
|
77
71
|
}
|
|
78
72
|
},
|
|
79
73
|
library: "sap.fe.templates",
|
|
@@ -93,12 +93,27 @@ sap.ui.define(["sap/fe/core/ExtensionAPI", "sap/fe/core/CommonUtils", "sap/fe/co
|
|
|
93
93
|
oBindingContext
|
|
94
94
|
);
|
|
95
95
|
},
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Gets the list entries currently selected for the table.
|
|
99
|
+
*
|
|
100
|
+
* @alias sap.fe.templates.ObjectPage.ExtensionAPI#getSelectedContexts
|
|
101
|
+
* @param {string} sTableId The ID identifying the table the selected context is requested for
|
|
102
|
+
* @returns {sap.ui.model.odata.v4.Context[]} Array containing the selected contexts
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
getSelectedContexts: function(sTableId) {
|
|
107
|
+
var oTable = this._view.byId(sTableId);
|
|
108
|
+
return (oTable && oTable.isA("sap.ui.mdc.Table") && oTable.getSelectedContexts()) || [];
|
|
109
|
+
},
|
|
110
|
+
|
|
96
111
|
/**
|
|
97
|
-
* Displays
|
|
112
|
+
* Displays or hides the side content of an object page block.
|
|
98
113
|
*
|
|
99
114
|
* @alias sap.fe.templates.ObjectPage.ExtensionAPI#showSideContent
|
|
100
|
-
* @param {string} sSubSectionKey Key of the
|
|
101
|
-
* @param {boolean} [bShow] Optional
|
|
115
|
+
* @param {string} sSubSectionKey Key of the side content fragment as defined in the manifest.json
|
|
116
|
+
* @param {boolean} [bShow] Optional Boolean flag to show or hide the side content
|
|
102
117
|
*
|
|
103
118
|
* @public
|
|
104
119
|
*/
|