@sapui5/sap.suite.ui.generic.template 1.130.2 → 1.131.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 +1 -1
- package/src/sap/suite/ui/generic/template/.library +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/ControllerImplementation.js +5 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_da.properties +2 -2
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_de.properties +2 -2
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/i18n/i18n_ko.properties +2 -2
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/Canvas/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_de.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_es.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hr.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_ko.properties +2 -2
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_sl.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/SmartTable.fragment.xml +6 -3
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ar.properties +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_da.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_es.properties +2 -2
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_ko.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/i18n/i18n_th.properties +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/Sections.fragment.xml +13 -13
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartForm.fragment.xml +5 -5
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/SmartTable.fragment.xml +6 -3
- package/src/sap/suite/ui/generic/template/QuickCreate/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/QuickView/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/designtime/controls/DynamicPage.designtime.js +317 -0
- package/src/sap/suite/ui/generic/template/designtime/controls/SmartTable.designtime.js +121 -32
- package/src/sap/suite/ui/generic/template/designtime/floorplans/AnalyticalListPage.designtime.js +12 -5
- package/src/sap/suite/ui/generic/template/designtime/floorplans/ListReport.designtime.js +11 -4
- package/src/sap/suite/ui/generic/template/designtime/floorplans/ObjectPage.designtime.js +13 -5
- package/src/sap/suite/ui/generic/template/designtime/utils/designtimeHelper.js +53 -81
- package/src/sap/suite/ui/generic/template/designtime/utils/designtimeUtils.js +63 -21
- package/src/sap/suite/ui/generic/template/fragments/SmartFormDataField.fragment.xml +1 -1
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +6 -5
- package/src/sap/suite/ui/generic/template/js/AnnotationHelperStreamSupport.js +21 -8
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +227 -5
- package/src/sap/suite/ui/generic/template/lib/ComponentUtils.js +100 -67
- package/src/sap/suite/ui/generic/template/lib/FlexibleColumnLayoutHandler.js +9 -4
- package/src/sap/suite/ui/generic/template/lib/RetryAfterHandler.js +154 -54
- package/src/sap/suite/ui/generic/template/lib/SideEffectUtil.js +22 -7
- package/src/sap/suite/ui/generic/template/lib/StableIdDefinition.js +4 -1
- package/src/sap/suite/ui/generic/template/lib/TemplateAssembler.js +39 -41
- package/src/sap/suite/ui/generic/template/lib/ViewCreationHelper.js +39 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +20 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +16 -3
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +15 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +16 -3
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +18 -5
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +15 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +15 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +15 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +16 -3
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +15 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +15 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +14 -1
- package/src/sap/suite/ui/generic/template/lib/insights/InsightsFECardProvider.js +11 -2
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +95 -95
- package/src/sap/suite/ui/generic/template/library.js +1 -1
- package/src/sap/suite/ui/generic/template/listTemplates/fragments/DetailSmartTable.fragment.xml +6 -3
- package/src/sap/suite/ui/generic/template/themes/sap_horizon/ObjectPage.less +6 -0
- package/src/sap/suite/ui/generic/template/themes/sap_horizon_dark/ObjectPage.less +6 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/util/merge", "sap/suite/ui/generic/template/genericUtilities/FeLogger",
|
|
2
2
|
"sap/suite/ui/generic/template/designtime/controls/SmartTable.designtime"
|
|
3
|
-
], function (extend, deepExtend, merge, FeLogger,SmartTableDesigntimeHelper) {
|
|
3
|
+
], function (extend, deepExtend, merge, FeLogger, SmartTableDesigntimeHelper) {
|
|
4
4
|
"use strict";
|
|
5
5
|
|
|
6
6
|
/*
|
|
@@ -41,18 +41,18 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
41
41
|
|
|
42
42
|
var mControlInfo = {};
|
|
43
43
|
var aViews = [];
|
|
44
|
-
var oLogger = new FeLogger("designtime.utils.designTimeHelper").getLogger();
|
|
44
|
+
// var oLogger = new FeLogger("designtime.utils.designTimeHelper").getLogger();
|
|
45
45
|
var RTA_MODE_URL_PARAM_KEY = "fiori-tools-rta-mode";
|
|
46
46
|
var oMutationObserver;
|
|
47
47
|
/**
|
|
48
48
|
* get effective designtime for all controls on current active view
|
|
49
49
|
* @return {Promise} promise resolving to a map, with key = control id, value = designtime
|
|
50
50
|
*/
|
|
51
|
-
function loadBaseDesigntime(){
|
|
51
|
+
function loadBaseDesigntime() {
|
|
52
52
|
var aPromises = [];
|
|
53
53
|
|
|
54
|
-
function addToControlInfo(oControl){
|
|
55
|
-
if (mControlInfo[oControl.getId()]){
|
|
54
|
+
function addToControlInfo(oControl) {
|
|
55
|
+
if (mControlInfo[oControl.getId()]) {
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
58
|
|
|
@@ -60,24 +60,24 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
60
60
|
mControlInfo[oControl.getId()] = oControlInfo;
|
|
61
61
|
oControlInfo.designTimePromise = oControl.getMetadata().loadDesignTime(oControl);
|
|
62
62
|
aPromises.push(oControlInfo.designTimePromise);
|
|
63
|
-
oControlInfo.designTimePromise.then(function(oDesignTime){
|
|
63
|
+
oControlInfo.designTimePromise.then(function (oDesignTime) {
|
|
64
64
|
oControlInfo.designTime = oDesignTime;
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function findPreceedingKnownNode(oNode){
|
|
68
|
+
function findPreceedingKnownNode(oNode) {
|
|
69
69
|
// ignore empty node or id. If node is not known and has no parent, we cannot find control it belongs to (can hopefully not be relevant)
|
|
70
70
|
return !oNode || !oNode.id || mControlInfo[oNode.id] ? oNode : oNode.parentNode && findPreceedingKnownNode(oNode.parentNode);
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
// Assumption: Enough to start with template views and find all aggregated objects
|
|
74
74
|
// for later added controls: enough to add listener on those views, react if related Node is a known control, and recheck all aggregated objects of that control
|
|
75
|
-
document.querySelectorAll(".sapUiXMLView").forEach(function(oTopNode){
|
|
75
|
+
document.querySelectorAll(".sapUiXMLView").forEach(function (oTopNode) {
|
|
76
76
|
var oView = sap.ui.getCore().byId(oTopNode.id);
|
|
77
77
|
// defensive programming, as any error here would be caught by UI adaptation and lead to just ignoring designtime provided here - which would open up for any UI adaptation provided from
|
|
78
78
|
// deeper layers
|
|
79
79
|
// first two conditions should actually not occur, but if so, evaluating the third would break
|
|
80
|
-
if (!oView || !(oView instanceof
|
|
80
|
+
if (!oView || !(oView instanceof sap.ui.core.mvc.XMLView) || !(oView.getController() instanceof sap.suite.ui.generic.template.lib.TemplateViewController)) { return; }
|
|
81
81
|
|
|
82
82
|
aViews.push(oView);
|
|
83
83
|
|
|
@@ -115,40 +115,12 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Parses the URL parameters and returns the value of RTA mode URL parameter (fiori-tools-rta-mode)
|
|
118
|
-
* @returns {
|
|
118
|
+
* @returns {string | null} A promise which returns a value of RTA mode
|
|
119
119
|
*/
|
|
120
120
|
function getRtaModeValue() {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
oLogger.error("UShell Container not found");
|
|
125
|
-
fnResolve(false);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
var oUrlParserPromise = UShellContainer.getServiceAsync("URLParsing"),
|
|
129
|
-
oFLPUrlPromise = UShellContainer.getFLPUrlAsync(true);
|
|
130
|
-
|
|
131
|
-
Promise.allSettled([oUrlParserPromise, oFLPUrlPromise]).then(function (aResult){
|
|
132
|
-
var oUrlParser = aResult[0].value,
|
|
133
|
-
sFLPUrl = aResult[1].value;
|
|
134
|
-
|
|
135
|
-
if (!oUrlParser) {
|
|
136
|
-
oLogger.error("Problem while getting URLParsing service", aResult[0].reason);
|
|
137
|
-
fnResolve(false);
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
if (!sFLPUrl) {
|
|
142
|
-
oLogger.error("Problem while getting FLP URL", aResult[1].reason);
|
|
143
|
-
fnResolve(false);
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
var oUrlParams = oUrlParser.parseParameters(sFLPUrl),
|
|
148
|
-
sRtaModeValue = oUrlParams[RTA_MODE_URL_PARAM_KEY] && oUrlParams[RTA_MODE_URL_PARAM_KEY][0];
|
|
149
|
-
fnResolve(sRtaModeValue);
|
|
150
|
-
});
|
|
151
|
-
});
|
|
121
|
+
const oUrlParams = new URLSearchParams(window.location.search);
|
|
122
|
+
const sRtaModeValue = oUrlParams.get(RTA_MODE_URL_PARAM_KEY);
|
|
123
|
+
return sRtaModeValue;
|
|
152
124
|
}
|
|
153
125
|
|
|
154
126
|
/*
|
|
@@ -156,19 +128,19 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
156
128
|
* control itself, the last one is an XMLView (with a controller of type TemplateViewController). "direct" means, no other XMLViews are in between.
|
|
157
129
|
* If control is not relevant (i.e. not part of a view, or part of a different view), returns undefined.
|
|
158
130
|
*/
|
|
159
|
-
function getAncestors(oControl){
|
|
131
|
+
function getAncestors(oControl) {
|
|
160
132
|
var aAncestors = [oControl];
|
|
161
133
|
|
|
162
|
-
while (!(oControl instanceof sap.ui.core.mvc.XMLView)){
|
|
134
|
+
while (!(oControl instanceof sap.ui.core.mvc.XMLView)) {
|
|
163
135
|
oControl = oControl.getParent();
|
|
164
|
-
if (!oControl){
|
|
136
|
+
if (!oControl) {
|
|
165
137
|
// control not in view hierarchy => not relevant
|
|
166
138
|
return;
|
|
167
139
|
}
|
|
168
140
|
aAncestors.push(oControl);
|
|
169
141
|
}
|
|
170
142
|
|
|
171
|
-
if (!(oControl.getController() instanceof sap.suite.ui.generic.template.lib.TemplateViewController)){
|
|
143
|
+
if (!(oControl.getController() instanceof sap.suite.ui.generic.template.lib.TemplateViewController)) {
|
|
172
144
|
// next view up the hierarchy not a template component (could e.g. be an extension) => no need to propagate designtime
|
|
173
145
|
return;
|
|
174
146
|
}
|
|
@@ -179,7 +151,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
179
151
|
/*
|
|
180
152
|
* check, whether oDescendant is contained in the subtree starting with oAncestor (including oAncestor)
|
|
181
153
|
*/
|
|
182
|
-
function isAggregated(oDescendant, oAncestor){
|
|
154
|
+
function isAggregated(oDescendant, oAncestor) {
|
|
183
155
|
// in some cases (e.g. table with no data), oAncestor is not a control (but simply a string) - in that case, it cannot be the one we are searching for
|
|
184
156
|
return oAncestor === oDescendant || (oAncestor.findAggregatedObjects && oAncestor.findAggregatedObjects(true).includes(oDescendant));
|
|
185
157
|
}
|
|
@@ -187,7 +159,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
187
159
|
/*
|
|
188
160
|
* Determine name of aggregation of oAncestor to which (the subtree containing) oDescendant belongs
|
|
189
161
|
*/
|
|
190
|
-
function getAncestorAggregationName(oAncestorInfo, oDescendant){
|
|
162
|
+
function getAncestorAggregationName(oAncestorInfo, oDescendant) {
|
|
191
163
|
/*
|
|
192
164
|
* Metadata propagation can be done directly from any ancestor to any descendant (skipping any levels in between - like we also do directly from view down to the controls). Thus, to build the
|
|
193
165
|
* base designtime (the resulting designtime if we would not interfere), we need to analyze propagation from any layer in between. Propagation is bound to an aggregation, so we need to find the
|
|
@@ -198,7 +170,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
198
170
|
// aggregations not mentioned in designtime are anyway not used for propagation
|
|
199
171
|
var aAllAggregations = Object.keys(mControlInfo[oAncestorInfo.sAncestorId].designTime.aggregations);
|
|
200
172
|
|
|
201
|
-
return aAllAggregations.find(function(sAggregation){
|
|
173
|
+
return aAllAggregations.find(function (sAggregation) {
|
|
202
174
|
// Remark: generic getter getAggregation on control instance is not reliable - but generic getter on metadata (passing control instance) is!
|
|
203
175
|
// howver, generic getter is not available, if aggregation is not declared in metadata => in that case, fall back to getAggregation on control instance
|
|
204
176
|
var oAggregation = oAncestorInfo.oAncestor.getMetadata().getAggregation(sAggregation);
|
|
@@ -212,8 +184,8 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
212
184
|
}
|
|
213
185
|
|
|
214
186
|
|
|
215
|
-
function getBaseDesignTime(oControl){
|
|
216
|
-
if (oControl instanceof sap.ui.core.mvc.XMLView){
|
|
187
|
+
function getBaseDesignTime(oControl) {
|
|
188
|
+
if (oControl instanceof sap.ui.core.mvc.XMLView) {
|
|
217
189
|
/*
|
|
218
190
|
* There's no (relevant) designtime for views:
|
|
219
191
|
* - For a view of a template component, we are defining the designtime directly, so no need to propagate to it (and actually waiting for a base designtime would cause infinite waiting)
|
|
@@ -226,7 +198,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
226
198
|
|
|
227
199
|
var oControlInfo = mControlInfo[oControl.getId()];
|
|
228
200
|
|
|
229
|
-
if (!oControlInfo || (oControlInfo.designTimePromise && !oControlInfo.designTime)){
|
|
201
|
+
if (!oControlInfo || (oControlInfo.designTimePromise && !oControlInfo.designTime)) {
|
|
230
202
|
// either the control is not known at all to us (i.e. not even added to the DOM) or we are still waiting to retrieve its designtime. Assumption: This can only happen, if
|
|
231
203
|
// the control is just added by UI adaptation. In this case, we don't need to interfere - thus we should just return an empty designtime. This can be achieved by
|
|
232
204
|
// returning faulthy here - an empty object in contrast would an empty base designTime, which would be matched with an empty allow list - thus not allowing anything.
|
|
@@ -243,7 +215,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
243
215
|
/* If no ancestors found, control is not relevant for FE, thus we must not change the designtime. This can be achieved by taking empty designtime as base. Don't take empty array instead - this
|
|
244
216
|
* would only ignore everything propagated to the control, but still take designtime defined on control itself as base, thus disallow everything defined directly.
|
|
245
217
|
*/
|
|
246
|
-
if (!aAncestors) {return;}
|
|
218
|
+
if (!aAncestors) { return; }
|
|
247
219
|
|
|
248
220
|
// We need only those ancestors propagting metadata to the aggregation containing the given control.
|
|
249
221
|
// The control itself obviously cannot propagate
|
|
@@ -252,7 +224,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
252
224
|
aAncestors.pop();
|
|
253
225
|
|
|
254
226
|
// build map with information about ancestors - as a 1. step only id is added
|
|
255
|
-
var aAncestorInfo = aAncestors.map(function(oAncestor){
|
|
227
|
+
var aAncestorInfo = aAncestors.map(function (oAncestor) {
|
|
256
228
|
return {
|
|
257
229
|
oAncestor: oAncestor,
|
|
258
230
|
sAncestorId: oAncestor.getId()
|
|
@@ -260,23 +232,23 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
260
232
|
});
|
|
261
233
|
|
|
262
234
|
// only those ancestors can be relevant designtime is provided for, and only if designtime defines aggregations
|
|
263
|
-
aAncestorInfo = aAncestorInfo.filter(function(oAncestorInfo){
|
|
235
|
+
aAncestorInfo = aAncestorInfo.filter(function (oAncestorInfo) {
|
|
264
236
|
return mControlInfo[oAncestorInfo.sAncestorId] && mControlInfo[oAncestorInfo.sAncestorId].designTime && mControlInfo[oAncestorInfo.sAncestorId].designTime.aggregations;
|
|
265
237
|
});
|
|
266
238
|
|
|
267
239
|
// determine corresponding aggregation name
|
|
268
|
-
aAncestorInfo.forEach(function(oAncestorInfo){
|
|
240
|
+
aAncestorInfo.forEach(function (oAncestorInfo) {
|
|
269
241
|
oAncestorInfo.sAggregation = getAncestorAggregationName(oAncestorInfo, oControl);
|
|
270
242
|
});
|
|
271
243
|
|
|
272
244
|
// filter for those ancestors actually propagating metadata to the corresponding aggregation
|
|
273
|
-
oControlInfo.pedigree = aAncestorInfo.filter(function(oAncestorInfo){
|
|
245
|
+
oControlInfo.pedigree = aAncestorInfo.filter(function (oAncestorInfo) {
|
|
274
246
|
return mControlInfo[oAncestorInfo.sAncestorId] && mControlInfo[oAncestorInfo.sAncestorId].designTime.aggregations && mControlInfo[oAncestorInfo.sAncestorId].designTime.aggregations[oAncestorInfo.sAggregation]
|
|
275
|
-
|
|
247
|
+
&& mControlInfo[oAncestorInfo.sAncestorId].designTime.aggregations[oAncestorInfo.sAggregation].propagateMetadata;
|
|
276
248
|
});
|
|
277
249
|
|
|
278
250
|
//
|
|
279
|
-
oBaseDesignTime = oControlInfo.pedigree.reduce(function(oDesignTime, oAncestorInfo){
|
|
251
|
+
oBaseDesignTime = oControlInfo.pedigree.reduce(function (oDesignTime, oAncestorInfo) {
|
|
280
252
|
/* Todo: Theoretically, also indirect propagation coudl be possible, i.e. A could propgate metadata to B, including propagation to C. In general, this seems to be superfluous (A could
|
|
281
253
|
* directly propagate the same to C, as propagation is deep), and not used. If it would be used however, to be on the save side, we should not use the designtime directly defined on the
|
|
282
254
|
* ancestor (i.e. from mControlInfo), but rather the resulting designtime after propagation from above.
|
|
@@ -295,20 +267,20 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
295
267
|
return oBaseDesignTime;
|
|
296
268
|
}
|
|
297
269
|
|
|
298
|
-
function getReducedDesignTime(oControl, oAllow){
|
|
270
|
+
function getReducedDesignTime(oControl, oAllow) {
|
|
299
271
|
var oBaseDesignTime = getBaseDesignTime(oControl);
|
|
300
272
|
/*
|
|
301
273
|
* If no base designTime at all, control is not relevant for FE (part of extension/reuse component (or not added to the view at all)): In this case, we must not reduce any possibilities, thus
|
|
302
274
|
* not returning a desginTime at all (not even for properties)
|
|
303
275
|
*/
|
|
304
|
-
if (!oBaseDesignTime) {return;}
|
|
276
|
+
if (!oBaseDesignTime) { return; }
|
|
305
277
|
|
|
306
278
|
var oResult = Object.create(null);
|
|
307
279
|
|
|
308
|
-
if (oBaseDesignTime.actions && typeof oBaseDesignTime.actions === "object"){ // typeof null is object, but we need to treat it like no object
|
|
280
|
+
if (oBaseDesignTime.actions && typeof oBaseDesignTime.actions === "object") { // typeof null is object, but we need to treat it like no object
|
|
309
281
|
oResult.actions = Object.create(null);
|
|
310
282
|
// if "real" object, we can take over all actions according to our allow list. Setting all others to "not-adaptable" (although this might not be an expected string at this place)
|
|
311
|
-
for (var sAction in oBaseDesignTime.actions){
|
|
283
|
+
for (var sAction in oBaseDesignTime.actions) {
|
|
312
284
|
oResult.actions[sAction] = oAllow && oAllow.actions && oAllow.actions.includes(sAction) ? oBaseDesignTime.actions[sAction] : null;
|
|
313
285
|
}
|
|
314
286
|
} else {
|
|
@@ -321,16 +293,16 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
321
293
|
}
|
|
322
294
|
|
|
323
295
|
oResult.aggregations = Object.create(null);
|
|
324
|
-
for (var sAggregation in oBaseDesignTime.aggregations){
|
|
296
|
+
for (var sAggregation in oBaseDesignTime.aggregations) {
|
|
325
297
|
oResult.aggregations[sAggregation] = {
|
|
326
|
-
|
|
298
|
+
actions: Object.create(null)
|
|
327
299
|
};
|
|
328
|
-
for (var sAction in oBaseDesignTime.aggregations[sAggregation].actions){
|
|
329
|
-
oResult.aggregations[sAggregation].actions[sAction] =
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
300
|
+
for (var sAction in oBaseDesignTime.aggregations[sAggregation].actions) {
|
|
301
|
+
oResult.aggregations[sAggregation].actions[sAction] = oAllow
|
|
302
|
+
&& oAllow.aggregations
|
|
303
|
+
&& oAllow.aggregations[sAggregation]
|
|
304
|
+
&& oAllow.aggregations[sAggregation].actions
|
|
305
|
+
&& oAllow.aggregations[sAggregation].actions.includes(sAction) ? oBaseDesignTime.aggregations[sAggregation].actions[sAction] : null;
|
|
334
306
|
}
|
|
335
307
|
}
|
|
336
308
|
|
|
@@ -339,7 +311,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
339
311
|
* only what is mentioned in original designtime. However, if a property is already ignored from original designtime, we should not override this.
|
|
340
312
|
*/
|
|
341
313
|
oResult.properties = Object.create(null);
|
|
342
|
-
for (var sProperty in oControl.getMetadata().getAllProperties()){
|
|
314
|
+
for (var sProperty in oControl.getMetadata().getAllProperties()) {
|
|
343
315
|
oResult.properties[sProperty] = {
|
|
344
316
|
ignore: !oAllow || !oAllow.properties || !oAllow.properties.includes(sProperty) || (oBaseDesignTime.properties && oBaseDesignTime.properties[sProperty] && oBaseDesignTime.properties[sProperty].ignore)
|
|
345
317
|
};
|
|
@@ -348,8 +320,8 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
348
320
|
return oResult;
|
|
349
321
|
}
|
|
350
322
|
|
|
351
|
-
function getViewDesignTime(mAllow, sFioriToolsRtaMode){
|
|
352
|
-
return loadBaseDesigntime().then(function(){
|
|
323
|
+
function getViewDesignTime(mAllow, sFioriToolsRtaMode) {
|
|
324
|
+
return loadBaseDesigntime().then(function () {
|
|
353
325
|
|
|
354
326
|
// provide propagation function for all controls contained allowing only what we want to allow
|
|
355
327
|
var oDesignTime = {
|
|
@@ -385,7 +357,7 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
385
357
|
// Nevertheless, we need to ensure only allowed properties to be changeable.
|
|
386
358
|
|
|
387
359
|
// There might be several views. Different properties could exist (if inheritance is used) - to be sure, all properties of all views should not be alowed to change
|
|
388
|
-
return aViews.reduce(function(oDesignTime, oView){
|
|
360
|
+
return aViews.reduce(function (oDesignTime, oView) {
|
|
389
361
|
return merge(getReducedDesignTime(oView, mAllow[oView.getMetadata().getElementName()]), oDesignTime);
|
|
390
362
|
}, oDesignTime);
|
|
391
363
|
});
|
|
@@ -393,26 +365,26 @@ sap.ui.define(["sap/base/util/extend", "sap/base/util/deepExtend", "sap/base/uti
|
|
|
393
365
|
|
|
394
366
|
// merge objects concatenating any contained arrays
|
|
395
367
|
// open: if same property is array in one source, but not in the other one - currently resulting property will be "true" (which will probably never be expected)
|
|
396
|
-
function deepMergeWithArray(aSource){
|
|
397
|
-
return aSource.reduce(function(vResult, vSource){
|
|
398
|
-
if (!vSource){
|
|
368
|
+
function deepMergeWithArray(aSource) {
|
|
369
|
+
return aSource.reduce(function (vResult, vSource) {
|
|
370
|
+
if (!vSource) {
|
|
399
371
|
// ignore undefined sources (rather not relevant on top level, but definitely in recursion as not properties need to exist in all source (objects)) => keep current result
|
|
400
372
|
return vResult;
|
|
401
373
|
}
|
|
402
|
-
if (!vResult){
|
|
374
|
+
if (!vResult) {
|
|
403
375
|
// first source undefined => ignore and initialize result with next entry
|
|
404
376
|
return vSource;
|
|
405
377
|
}
|
|
406
|
-
if (Array.isArray(vSource) !== Array.isArray(vResult)){
|
|
378
|
+
if (Array.isArray(vSource) !== Array.isArray(vResult)) {
|
|
407
379
|
// (type of) vResult is deviates from current source => conflict. Currently not expected, skip merging (to be adapted if need arises)
|
|
408
380
|
// returning true to avoid overriding in next iteration
|
|
409
381
|
return true;
|
|
410
382
|
}
|
|
411
383
|
|
|
412
|
-
if (Array.isArray(vResult)){
|
|
384
|
+
if (Array.isArray(vResult)) {
|
|
413
385
|
return vResult.concat(vSource);
|
|
414
386
|
} else {
|
|
415
|
-
for (var sProperty in vSource){
|
|
387
|
+
for (var sProperty in vSource) {
|
|
416
388
|
vResult[sProperty] = deepMergeWithArray([vResult[sProperty], vSource[sProperty]]);
|
|
417
389
|
}
|
|
418
390
|
return vResult;
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
"sap/base/util/ObjectPath",
|
|
10
|
+
"sap/ui/core/Component",
|
|
10
11
|
"sap/suite/ui/generic/template/genericUtilities/testableHelper"
|
|
11
|
-
], function (ObjectPath, testableHelper) {
|
|
12
|
+
], function (ObjectPath, Component, testableHelper) {
|
|
12
13
|
"use strict";
|
|
13
14
|
/**
|
|
14
15
|
* Creates the adaptation dialog content based on the provided settings, property values, and unchanged data.
|
|
@@ -164,12 +165,8 @@ sap.ui.define([
|
|
|
164
165
|
});
|
|
165
166
|
}
|
|
166
167
|
|
|
167
|
-
function
|
|
168
|
-
|
|
169
|
-
while (oComponent && !oComponent.getRootControl) {
|
|
170
|
-
oComponent = oComponent.getParent();
|
|
171
|
-
}
|
|
172
|
-
return oComponent;
|
|
168
|
+
function getOwnerComponentFor(oElement) {
|
|
169
|
+
return Component.getOwnerComponentFor(oElement);
|
|
173
170
|
}
|
|
174
171
|
/**
|
|
175
172
|
* @typedef {Object} PathParameters
|
|
@@ -184,7 +181,7 @@ sap.ui.define([
|
|
|
184
181
|
*
|
|
185
182
|
* @param {Object} mRuntimeSettings - An object containing the current runtime settings.
|
|
186
183
|
* @param {Array<Object>} aManifestSettingsData - An array of objects representing the manifest settings data.
|
|
187
|
-
* @returns {Array<
|
|
184
|
+
* @returns {Array<Settings>} An array of Settings objects, which can then be used to create the adaptation dialog content.
|
|
188
185
|
*
|
|
189
186
|
* @typedef {Object} Settings
|
|
190
187
|
* @property {string} label - The name of the setting.
|
|
@@ -258,7 +255,7 @@ sap.ui.define([
|
|
|
258
255
|
};
|
|
259
256
|
};
|
|
260
257
|
|
|
261
|
-
async function fnOpenAdaptionDialog(items, propertyValues, unchangedData, title, size) {
|
|
258
|
+
async function fnOpenAdaptionDialog(items, propertyValues, unchangedData, title, size, oResourceModel) {
|
|
262
259
|
const list = await fnCreateAdaptionDialogContent(items, propertyValues, unchangedData);
|
|
263
260
|
return new Promise(function (resolve, reject) {
|
|
264
261
|
sap.ui.require([
|
|
@@ -268,38 +265,68 @@ sap.ui.define([
|
|
|
268
265
|
], function (Dialog, Button, MessageStrip) {
|
|
269
266
|
const informationText = new MessageStrip({
|
|
270
267
|
type: "Information",
|
|
271
|
-
|
|
268
|
+
showIcon: true,
|
|
269
|
+
text: "{i18n>RTA_CONFIGURATION_INFO_MESSAGE}"
|
|
272
270
|
});
|
|
271
|
+
informationText.addStyleClass("sapUiSmallMarginBottom");
|
|
273
272
|
const dialog = new Dialog({
|
|
274
273
|
title: title,
|
|
275
274
|
contentWidth: size ? size.width : "550px",
|
|
276
275
|
contentHeight: size ? size.height : "300px",
|
|
277
276
|
content: [informationText, list],
|
|
277
|
+
resizable: true,
|
|
278
278
|
buttons: [
|
|
279
279
|
new Button({
|
|
280
|
-
text: "
|
|
280
|
+
text: "{i18n>RTA_CONFIGURATION_APPLY}",
|
|
281
|
+
type: "Emphasized",
|
|
281
282
|
press: function () {
|
|
282
283
|
dialog.close();
|
|
283
|
-
|
|
284
|
+
resolve(propertyValues);
|
|
284
285
|
}
|
|
285
286
|
}),
|
|
286
287
|
new Button({
|
|
287
|
-
text: "
|
|
288
|
+
text: "{i18n>RTA_CONFIGURATION_CANCEL}",
|
|
288
289
|
press: function () {
|
|
289
290
|
dialog.close();
|
|
290
|
-
|
|
291
|
+
reject();
|
|
291
292
|
}
|
|
292
293
|
})
|
|
293
294
|
]
|
|
294
295
|
});
|
|
296
|
+
dialog.setModel(oResourceModel, 'i18n');
|
|
297
|
+
dialog.addStyleClass("sapUiContentPadding");
|
|
298
|
+
dialog.addStyleClass("sapUiRTABorder");
|
|
295
299
|
dialog.open();
|
|
296
300
|
});
|
|
297
301
|
});
|
|
298
302
|
}
|
|
299
303
|
|
|
304
|
+
/**
|
|
305
|
+
* @typedef {Object} DesigntimeSetting
|
|
306
|
+
* @property {string} id - The ID of the designtime setting.
|
|
307
|
+
* @property {string} name - The name of the designtime setting.
|
|
308
|
+
* @property {string} description - The description of the designtime setting.
|
|
309
|
+
* @property {PropertyValue} value - The default value of the designtime setting.
|
|
310
|
+
* @property {string} type - The type of the designtime setting.
|
|
311
|
+
* @property {Array.<Enum>} [enums] - The array of possible enum values for the designtime setting.
|
|
312
|
+
* @property {(mControlDetails: PathParameters) => string} [getPath] - The path to the designtime setting in the manifest.
|
|
313
|
+
* @property {boolean} [bSupportsGlobalScope] - Indicates if the setting supports global scope. (Default: false)
|
|
314
|
+
* @property {string[]} [restrictedTo] - The array of components for which the setting is restricted.
|
|
315
|
+
* @property {DesigntimeSetting[]} [writeObject] - An array of DesigntimeSetting objects.
|
|
316
|
+
* @property {string} [writeObjectFor] - The value of the setting for which the Object should be constructed.
|
|
317
|
+
* @property {boolean} [skipChange] - Indicates if the change should be skipped.
|
|
318
|
+
|
|
319
|
+
* @typedef {string | boolean | string[] } PropertyValue
|
|
320
|
+
|
|
321
|
+
* @typedef {Object} Enum
|
|
322
|
+
* @property {string} id - The ID of the enum value.
|
|
323
|
+
* @property {string} name - The name of the enum value.
|
|
324
|
+
*/
|
|
325
|
+
|
|
326
|
+
|
|
300
327
|
/**
|
|
301
328
|
* Retrieves the changed property values.
|
|
302
|
-
* @param {
|
|
329
|
+
* @param {DesigntimeSetting[]} designtimeSettings - The array of designtime settings.
|
|
303
330
|
* @param {Object} unchangedData - The unchanged data.
|
|
304
331
|
* @param {Object} propertyValues - The property values.
|
|
305
332
|
* @param {PathParameters} mPathParameters - The path parameters.
|
|
@@ -313,10 +340,25 @@ sap.ui.define([
|
|
|
313
340
|
(typeof unchangedData[setting.id] === "object" && JSON.stringify(unchangedData[setting.id]) !== JSON.stringify(propertyValues[setting.id]))
|
|
314
341
|
) {
|
|
315
342
|
const propertyChangeKey = setting.getPath ? setting.getPath(mPathParameters) : setting.id;
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
343
|
+
const changeObject = {};
|
|
344
|
+
const bIsGlobalChange = !!setting.bSupportsGlobalScope && mPathParameters.sScope === SettingScope.Application;
|
|
345
|
+
if (setting.writeObject?.length && setting.writeObjectFor === propertyValues[setting.id]) {
|
|
346
|
+
setting.writeObject.forEach(function (settingsTogether) {
|
|
347
|
+
changeObject[settingsTogether.getPath ? settingsTogether.getPath(mPathParameters) : settingsTogether.id] =
|
|
348
|
+
propertyValues[settingsTogether.id];
|
|
349
|
+
|
|
350
|
+
});
|
|
351
|
+
propertyChanges[propertyChangeKey] = {
|
|
352
|
+
value: changeObject,
|
|
353
|
+
bIsGlobalChange
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
} else if (!setting.skipChange) {
|
|
357
|
+
propertyChanges[propertyChangeKey] = {
|
|
358
|
+
value: propertyValues[setting.id],
|
|
359
|
+
bIsGlobalChange
|
|
360
|
+
};
|
|
361
|
+
}
|
|
320
362
|
}
|
|
321
363
|
});
|
|
322
364
|
return propertyChanges;
|
|
@@ -348,7 +390,7 @@ sap.ui.define([
|
|
|
348
390
|
}
|
|
349
391
|
|
|
350
392
|
function getLocalId(oElement) {
|
|
351
|
-
const oComponent =
|
|
393
|
+
const oComponent = getOwnerComponentFor(oElement);
|
|
352
394
|
return oComponent.getRootControl().getLocalId(oElement.getId());
|
|
353
395
|
}
|
|
354
396
|
|
|
@@ -385,7 +427,7 @@ sap.ui.define([
|
|
|
385
427
|
openAdaptionDialog: fnOpenAdaptionDialog,
|
|
386
428
|
getSettings,
|
|
387
429
|
extractChanges: fnExtractChanges,
|
|
388
|
-
|
|
430
|
+
getOwnerComponentFor,
|
|
389
431
|
createAdaptionDialogContent: fnCreateAdaptionDialogContent,
|
|
390
432
|
getLocalId,
|
|
391
433
|
SettingScope,
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
visible="{path: 'dataField>', formatter: 'AH.getVisibiltyBasedOnImportanceAndHidden'}"
|
|
36
36
|
binding="{path: 'dataField>Target'}, formatter: 'AH.getNavigationPathWithExpand'}">
|
|
37
37
|
<fe:customData>
|
|
38
|
-
<core:CustomData key="SideEffects" value="{parts: [{path: 'entitySet>'}, {path: 'dataField>'}], formatter: 'AH.getPropsForLinkFields'}"/>
|
|
38
|
+
<core:CustomData key="SideEffects" value="{parts: [{path: 'entitySet>'}, {path: 'dataField>'}, {path: 'contact>fn/Path'}], formatter: 'AH.getPropsForLinkFields'}"/>
|
|
39
39
|
<core:CustomData key="Location" value="Section" />
|
|
40
40
|
<core:CustomData key="contactDetails" value="{= ${path: 'contact>', formatter: 'AH.getCustomDataForContactPopup'}}"/>
|
|
41
41
|
</fe:customData>
|
|
@@ -12,9 +12,10 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
12
12
|
"sap/suite/ui/generic/template/genericUtilities/metadataAnalyser",
|
|
13
13
|
"sap/ui/base/ManagedObject",
|
|
14
14
|
"sap/suite/ui/generic/template/lib/SideEffectUtil",
|
|
15
|
-
"sap/
|
|
15
|
+
"sap/base/util/isEmptyObject",
|
|
16
|
+
"sap/suite/ui/generic/template/js/RuntimeFormatters"// just to make sure that it is loaded
|
|
16
17
|
], function (AnnotationHelperModel, AnnotationHelperModelBasics, SmartField, FeLogger, formatMessage, deepExtend, StableIdHelper, utils, Device,
|
|
17
|
-
SapMLibrary, SapCoreLibrary, metadataAnalyser, ManagedObject, SideEffectUtil) {
|
|
18
|
+
SapMLibrary, SapCoreLibrary, metadataAnalyser, ManagedObject, SideEffectUtil, isEmptyObject) {
|
|
18
19
|
"use strict";
|
|
19
20
|
|
|
20
21
|
// shortcut for sap.ui.core.ValueState
|
|
@@ -384,8 +385,8 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
384
385
|
getCustomDataForContactPopup: function (oContactDetails) {
|
|
385
386
|
return ((JSON.stringify(oContactDetails)).replace(/\}/g, "\\}").replace(/\{/g, "\\{")); //check bindingParser.escape
|
|
386
387
|
},
|
|
387
|
-
getPropsForLinkFields: function(oEntitySet, oTarget) {
|
|
388
|
-
return SideEffectUtil.getPropsForLinkFields(oEntitySet, oTarget);
|
|
388
|
+
getPropsForLinkFields: function(oEntitySet, oTarget, sFieldName) {
|
|
389
|
+
return SideEffectUtil.getPropsForLinkFields(oEntitySet, oTarget, sFieldName);
|
|
389
390
|
},
|
|
390
391
|
checkIsEmailAddress: function (oInterface, sEntityType, oDataField) {
|
|
391
392
|
var oMetaModel = oInterface.getInterface(1).getModel();
|
|
@@ -4263,7 +4264,7 @@ sap.ui.define(["sap/ui/model/odata/AnnotationHelper",
|
|
|
4263
4264
|
"*": false
|
|
4264
4265
|
};
|
|
4265
4266
|
}
|
|
4266
|
-
if (mColumnWidthIncludingColumnHeader) {
|
|
4267
|
+
if (!isEmptyObject(mColumnWidthIncludingColumnHeader)) {
|
|
4267
4268
|
oCustomizeConfig["autoColumnWidth"] = mColumnWidthIncludingColumnHeader;
|
|
4268
4269
|
}
|
|
4269
4270
|
sCustomizeConfig = JSON.stringify(oCustomizeConfig);
|
|
@@ -121,38 +121,51 @@ sap.ui.define([
|
|
|
121
121
|
return sAcceptableMimeType.slice(0, -1);
|
|
122
122
|
},
|
|
123
123
|
|
|
124
|
+
// funtion return the controlling binding path form by annotation/metadata/fieldcontrol path
|
|
125
|
+
getControlPath: function(oEntitySet, oFieldControl) {
|
|
126
|
+
var sAnnotationUpdatablePath = oEntitySet && oEntitySet["Org.OData.Capabilities.V1.UpdateRestrictions"] && (oEntitySet["Org.OData.Capabilities.V1.UpdateRestrictions"]["Updatable"] || oEntitySet["Org.OData.Capabilities.V1.UpdateRestrictions"]["Updatable"].Path);
|
|
127
|
+
var sMetadataUpdatable = oEntitySet && (oEntitySet["sap:updatable"] || oEntitySet["sap:updatable-path"]);
|
|
128
|
+
if (sAnnotationUpdatablePath || sMetadataUpdatable) {
|
|
129
|
+
return '${' + (sAnnotationUpdatablePath || sMetadataUpdatable) + '} !== false';
|
|
130
|
+
} else if (oFieldControl) {
|
|
131
|
+
return '${' + oFieldControl && oFieldControl.Path + '} > "1"';
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
|
|
124
135
|
getDeleteStreamVisibility: function(oInterface, oMediaType, bIsDraftEnabled, oEntitySet){
|
|
125
|
-
var
|
|
136
|
+
var oEntityType = oEntitySet && oInterface.getModel(0).getODataEntityType(oEntitySet.entityType);
|
|
126
137
|
var oFieldControl = oEntityType && oEntityType["com.sap.vocabularies.Common.v1.FieldControl"];
|
|
127
138
|
if (oFieldControl && oFieldControl.EnumMember === "com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly") {
|
|
128
139
|
return false;
|
|
129
140
|
}
|
|
141
|
+
var sPath = oAnnotationHelperStreamSupport.getControlPath(oEntitySet, oFieldControl);
|
|
130
142
|
if (bIsDraftEnabled) {
|
|
131
|
-
return
|
|
143
|
+
return sPath ? '{= ${' + oMediaType + '} !== "" && ${ui>/editable} && ' + sPath + '}' : '{= ${' + oMediaType + '} !== "" && ${ui>/editable}}';
|
|
132
144
|
} else {
|
|
133
|
-
return
|
|
145
|
+
return sPath ? '{= ${' + oMediaType + '} !== "" && !${ui>/editable} && ' + sPath + '}' : '{= ${' + oMediaType + '} !== "" && !${ui>/editable}}';
|
|
134
146
|
}
|
|
135
147
|
},
|
|
136
148
|
|
|
137
149
|
getFileUploaderVisibility: function(oInterface, bIsDraftEnabled, oEntitySet){
|
|
138
|
-
var oEntityType = oEntitySet && oInterface.getModel(1).getODataEntityType(oEntitySet.entityType);
|
|
150
|
+
var sPath, oEntityType = oEntitySet && oInterface.getModel(1).getODataEntityType(oEntitySet.entityType);
|
|
139
151
|
var oFieldControl = oEntityType && oEntityType["com.sap.vocabularies.Common.v1.FieldControl"];
|
|
140
152
|
if (oFieldControl && oFieldControl.EnumMember === "com.sap.vocabularies.Common.v1.FieldControlType/ReadOnly") {
|
|
141
153
|
return false;
|
|
142
154
|
}
|
|
155
|
+
var sPath = oAnnotationHelperStreamSupport.getControlPath(oEntitySet, oFieldControl);
|
|
143
156
|
var bRestrictions = AnnotationHelper.getUpdateRestrictions(oEntitySet);
|
|
144
157
|
if (bIsDraftEnabled) {
|
|
145
|
-
return
|
|
158
|
+
return sPath ? '{= ${ui>/editable} && ' + sPath + '}' : '{= ${ui>/editable}}';
|
|
146
159
|
} else {
|
|
147
160
|
if (typeof bRestrictions === "boolean") {
|
|
148
161
|
if (bRestrictions) {
|
|
149
|
-
return
|
|
162
|
+
return sPath ? '{= !${ui>/editable} && ' + sPath + '}' : '{= !${ui>/editable}}';
|
|
150
163
|
} else {
|
|
151
164
|
return false;
|
|
152
165
|
}
|
|
153
166
|
} else if (typeof bRestrictions === "string") {
|
|
154
|
-
if (
|
|
155
|
-
return '{= !${ui>/editable} &&
|
|
167
|
+
if (typeof sPath === "string") {
|
|
168
|
+
return '{= !${ui>/editable} && ' + sPath + ' && ${' + bRestrictions + '}}';
|
|
156
169
|
}
|
|
157
170
|
return '{= !${ui>/editable} && ${' + bRestrictions + '}}';
|
|
158
171
|
}
|