@sapui5/sap.suite.ui.generic.template 1.129.0 → 1.130.1
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 +4 -3
- package/src/sap/suite/ui/generic/template/.library +5 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/Component.js +1 -1
- package/src/sap/suite/ui/generic/template/AnalyticalListPage/controller/VisualFilterDialogController.js +1 -1
- 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/Component.js +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/controller/ControllerImplementation.js +22 -11
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_bg.properties +3 -3
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_hu.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/i18n/i18n_th.properties +1 -1
- package/src/sap/suite/ui/generic/template/ListReport/manifest.json +5 -2
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/DefaultVariant.fragment.xml +7 -8
- package/src/sap/suite/ui/generic/template/ListReport/view/fragments/MultipleViewsSingleTableMode.fragment.xml +4 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/Component.js +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/manifest.json +1 -1
- package/src/sap/suite/ui/generic/template/ObjectPage/templateSpecificPreparationHelper.js +90 -42
- package/src/sap/suite/ui/generic/template/ObjectPage/view/fragments/MultipleViewsSingleTableMode.fragment.xml +3 -0
- 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/SmartTable.designtime.js +379 -0
- package/src/sap/suite/ui/generic/template/designtime/{AnalyticalListPage.designtime.js → floorplans/AnalyticalListPage.designtime.js} +3 -3
- package/src/sap/suite/ui/generic/template/designtime/{ListReport.designtime.js → floorplans/ListReport.designtime.js} +3 -3
- package/src/sap/suite/ui/generic/template/designtime/{ObjectPage.designtime.js → floorplans/ObjectPage.designtime.js} +4 -5
- package/src/sap/suite/ui/generic/template/designtime/utils/designtimeHelper.js +119 -96
- package/src/sap/suite/ui/generic/template/designtime/utils/designtimeUtils.js +395 -0
- package/src/sap/suite/ui/generic/template/fragments/EasyFilter.fragment.xml +12 -17
- package/src/sap/suite/ui/generic/template/fragments/MessagePage.controller.js +16 -0
- package/src/sap/suite/ui/generic/template/fragments/MessagePopover.fragment.xml +16 -2
- package/src/sap/suite/ui/generic/template/fragments/SmartFormDataField.fragment.xml +2 -0
- package/src/sap/suite/ui/generic/template/genericUtilities/Link.js +9 -2
- package/src/sap/suite/ui/generic/template/js/AnnotationHelper.js +8 -4
- package/src/sap/suite/ui/generic/template/lib/AppComponent.js +10 -3
- package/src/sap/suite/ui/generic/template/lib/CommonEventHandlers.js +0 -42
- package/src/sap/suite/ui/generic/template/lib/CommonUtils.js +6 -1
- package/src/sap/suite/ui/generic/template/lib/MessageButtonHelper.js +11 -7
- package/src/sap/suite/ui/generic/template/lib/RetryAfterHandler.js +249 -0
- package/src/sap/suite/ui/generic/template/lib/ShareUtils.js +1 -1
- package/src/sap/suite/ui/generic/template/lib/SideEffectUtil.js +64 -3
- package/src/sap/suite/ui/generic/template/lib/StableIdDefinition.js +7 -0
- package/src/sap/suite/ui/generic/template/lib/ai/EasyFilterBarHandler.js +210 -74
- package/src/sap/suite/ui/generic/template/lib/ai/ErrorExplanationHelper.js +47 -0
- package/src/sap/suite/ui/generic/template/lib/ai/FioriAIHandler.js +10 -3
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n.properties +31 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ar.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_bg.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ca.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cnr.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cs.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_cy.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_da.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_de.properties +3 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_el.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_GB.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_en_US_saprigi.properties +1 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es.properties +4 -2
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_es_MX.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_et.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fi.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_fr_CA.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hi.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hr.properties +3 -1
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_hu.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_id.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_it.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_iw.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ja.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_kk.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ko.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lt.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_lv.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_mk.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ms.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_nl.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_no.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pl.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_pt_PT.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ro.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_ru.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sh.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sk.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sl.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sr.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_sv.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_th.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_tr.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_uk.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_vi.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_CN.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/i18n/i18n_zh_TW.properties +2 -0
- package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +5 -3
- package/src/sap/suite/ui/generic/template/library.js +3 -1
- package/src/sap/suite/ui/generic/template/listTemplates/fragments/MultipleViewsSingleTableMode.fragment.xml +6 -2
- package/src/sap/suite/ui/generic/template/manifestMerger/ChangePageConfiguration.js +28 -23
- package/src/sap/suite/ui/generic/template/manifestMerger/MergerUtil.js +6 -6
- package/src/sap/suite/ui/generic/template/themes/base/base.less +0 -4
- package/ui5.yaml +1 -0
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
|
+
|
|
4
|
+
(c) Copyright 2009-2015 SAP SE. All rights reserved
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/base/util/deepClone",
|
|
9
|
+
"sap/base/util/merge",
|
|
10
|
+
"sap/suite/ui/generic/template/designtime/utils/designtimeUtils",
|
|
11
|
+
"sap/suite/ui/generic/template/genericUtilities/testableHelper"
|
|
12
|
+
],
|
|
13
|
+
function (deepClone, merge, designtimeUtils, testableHelper) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
const sObjectPageComponentName = "sap.suite.ui.generic.template.ObjectPage";
|
|
17
|
+
const { SettingScope } = designtimeUtils;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @typedef {Object} DesigntimeSetting
|
|
21
|
+
* @property {string} id - The ID of the designtime setting.
|
|
22
|
+
* @property {string} name - The name of the designtime setting.
|
|
23
|
+
* @property {string} description - The description of the designtime setting.
|
|
24
|
+
* @property {PropertyValue} value - The default value of the designtime setting.
|
|
25
|
+
* @property {string} type - The type of the designtime setting.
|
|
26
|
+
* @property {Array.<Enum>=} enums - The array of possible enum values for the designtime setting.
|
|
27
|
+
* @property {(mSmartTableDetails: SmartTableInfo) => string=} getPath - The path to the designtime setting in the manifest.
|
|
28
|
+
* @property {boolean=} bSupportsGlobalScope - Indicates if the setting supports global scope. (Default: false)
|
|
29
|
+
* @property {string[]=} restrictedTo - The array of components for which the setting is restricted.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @typedef {Object} ChangeParameters - Descriptor change parameters.
|
|
34
|
+
* @property {string=} sScope - The scope of the manifest setting.
|
|
35
|
+
* @property {string=} sChangeType - Desciptor change type.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @typedef {Object} SmartTableInfo
|
|
40
|
+
* @property {string} sParentComponentName - The name of the parent component.
|
|
41
|
+
* @property {string} sSectionKey - The ID of the facet.
|
|
42
|
+
* @property {string|null} sSelectedVariantKey - The selected tab key.
|
|
43
|
+
* @extends ChangeParameters
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @typedef {ChangeParameters & SmartTableInfo} SmartTableChangeParams
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @typedef {string | boolean | string[] } PropertyValue
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @typedef {Object} Enum
|
|
56
|
+
* @property {string} id - The ID of the enum value.
|
|
57
|
+
* @property {string} name - The name of the enum value.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
function getSelectedTabKey(oSmartTable) {
|
|
61
|
+
// traverse the parent until the control is IconTabBar
|
|
62
|
+
const sSmartTableLocalId = designtimeUtils.getLocalId(oSmartTable);
|
|
63
|
+
return sSmartTableLocalId.split("-")[1];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves the variant info for the selected tab.
|
|
68
|
+
*
|
|
69
|
+
* @param {*} oComponent - The component.
|
|
70
|
+
* @param {string} sSelectedTabKey - The selected tab key.
|
|
71
|
+
* @returns {[string, *]} - The variant info for the selected tab.
|
|
72
|
+
*/
|
|
73
|
+
function getVariantInfo(oComponent, sSelectedTabKey) {
|
|
74
|
+
const oQuickVariantSelectionX = oComponent.getQuickVariantSelectionX();
|
|
75
|
+
const oVariants = oQuickVariantSelectionX?.variants || {};
|
|
76
|
+
const aVariantInfo = Object.entries(oVariants).find(([_, oVariant]) => oVariant.key === sSelectedTabKey);
|
|
77
|
+
if (!aVariantInfo?.length) {
|
|
78
|
+
throw new Error("Error while retrieving the variant info for the selected tab");
|
|
79
|
+
}
|
|
80
|
+
return aVariantInfo;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function getManifestTableSettings(oSmartTable) {
|
|
84
|
+
const oComponent = designtimeUtils.getComponent(oSmartTable);
|
|
85
|
+
const oAppComponent = oComponent.getAppComponent();
|
|
86
|
+
const oSupportedGlobalTableSettings = designtimeUtils.getSupportedGlobalManifestSettings(oAppComponent)?.["tableSettings"] || {};
|
|
87
|
+
|
|
88
|
+
let oEffectiveTableSettings;
|
|
89
|
+
if (oComponent.getMetadata().getComponentName() === sObjectPageComponentName) {
|
|
90
|
+
const oSections = oComponent.getSections();
|
|
91
|
+
const sSectionKey = getSectionKey(oSmartTable);
|
|
92
|
+
const oSectionTableSettings = oSections?.[sSectionKey]?.tableSettings || {};
|
|
93
|
+
oEffectiveTableSettings = merge(oSupportedGlobalTableSettings, oSectionTableSettings);
|
|
94
|
+
} else {
|
|
95
|
+
const oComponentTableSettings = oComponent.getTableSettings() || {};
|
|
96
|
+
let oSelectedVariantTableSettings = {};
|
|
97
|
+
if (oComponent.getQuickVariantSelectionX?.()) {
|
|
98
|
+
const sSelectedTabKey = getSelectedTabKey(oSmartTable);
|
|
99
|
+
const aVariantInfo = getVariantInfo(oComponent, sSelectedTabKey);
|
|
100
|
+
const [, oVariant] = aVariantInfo;
|
|
101
|
+
oSelectedVariantTableSettings = oVariant.tableSettings || {};
|
|
102
|
+
}
|
|
103
|
+
oEffectiveTableSettings = merge(oSupportedGlobalTableSettings, oComponentTableSettings, oSelectedVariantTableSettings);
|
|
104
|
+
}
|
|
105
|
+
return oEffectiveTableSettings;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function getSectionKey(oSmartTable) {
|
|
109
|
+
const sSmartTableId = designtimeUtils.getLocalId(oSmartTable.getId());
|
|
110
|
+
// ID must not be of the inner table
|
|
111
|
+
return sSmartTableId.split("::Table")[0];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Retrieves the adaptation properties for the SmartTable.
|
|
116
|
+
*
|
|
117
|
+
* Property values are retrieved from the manifest.
|
|
118
|
+
*
|
|
119
|
+
* @param {DesigntimeSetting[]} aDesigntimeSettings - The array of designtime settings.
|
|
120
|
+
* @param {object} oTableSettings - The table settings from the manifest.
|
|
121
|
+
* @returns {Object} - The adaptation properties for the SmartTable.
|
|
122
|
+
*/
|
|
123
|
+
function getRuntimeAdapationProperties(aDesigntimeSettings, oTableSettings) {
|
|
124
|
+
const mPropertyValues = {};
|
|
125
|
+
// Handle the multiple ways of defining the table type?
|
|
126
|
+
aDesigntimeSettings.forEach(oSetting => {
|
|
127
|
+
const sProperty = oSetting.id;
|
|
128
|
+
switch (sProperty) {
|
|
129
|
+
case "type":
|
|
130
|
+
mPropertyValues[sProperty] = oTableSettings.type || oSetting.value;
|
|
131
|
+
break;
|
|
132
|
+
case "multiSelect":
|
|
133
|
+
mPropertyValues[sProperty] = oTableSettings.multiSelect || oSetting.value;
|
|
134
|
+
break;
|
|
135
|
+
case "createMode":
|
|
136
|
+
mPropertyValues[sProperty] = oTableSettings.createMode || oSetting.value;
|
|
137
|
+
break;
|
|
138
|
+
case "selectAll":
|
|
139
|
+
mPropertyValues[sProperty] = oTableSettings.selectAll || oSetting.value;
|
|
140
|
+
break;
|
|
141
|
+
default:
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
return mPropertyValues;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async function fnOpenTableConfigurationDialog(oSmartTable, mPropertyBag) {
|
|
149
|
+
const oComponent = designtimeUtils.getComponent(oSmartTable);
|
|
150
|
+
const sComponentName = oComponent.getMetadata().getComponentName();
|
|
151
|
+
// Get the allowed designtime settings for the SmartTable
|
|
152
|
+
const aAllowedDesigntimeSettings = getAllowedDesigntimeSettings(oSmartTable);
|
|
153
|
+
|
|
154
|
+
// Get the table settings from the manifest
|
|
155
|
+
const oTableSettings = getManifestTableSettings(oSmartTable);
|
|
156
|
+
|
|
157
|
+
// Get the current values of the properties
|
|
158
|
+
const mRuntimeAdaptationPropertyValues = getRuntimeAdapationProperties(aAllowedDesigntimeSettings, oTableSettings);
|
|
159
|
+
// Save the unchanged data to compare later
|
|
160
|
+
const mUnchangedData = deepClone(mRuntimeAdaptationPropertyValues);
|
|
161
|
+
// Get the settings of the dialog from the designtime settings using which the dialog will be created
|
|
162
|
+
const aItems = designtimeUtils.getSettings(mRuntimeAdaptationPropertyValues, aAllowedDesigntimeSettings);
|
|
163
|
+
// Add the scope of the changes
|
|
164
|
+
const oScopeControlData = {
|
|
165
|
+
type: "string",
|
|
166
|
+
"enum": [
|
|
167
|
+
{ id: SettingScope.Page, name: SettingScope.Page }
|
|
168
|
+
],
|
|
169
|
+
value: SettingScope.Page,
|
|
170
|
+
id: "scope",
|
|
171
|
+
disabled: false
|
|
172
|
+
};
|
|
173
|
+
const aChangeScopeOption = [
|
|
174
|
+
{
|
|
175
|
+
label: "Scope of the changes",
|
|
176
|
+
tooltip: "Scope of the changes",
|
|
177
|
+
control: [
|
|
178
|
+
oScopeControlData
|
|
179
|
+
]
|
|
180
|
+
}
|
|
181
|
+
];
|
|
182
|
+
|
|
183
|
+
// if the component has quickVariantSelectionX then add the control scope
|
|
184
|
+
const bHasQuickVariantSelectionX = oComponent.getQuickVariantSelectionX?.();
|
|
185
|
+
if (bHasQuickVariantSelectionX) {
|
|
186
|
+
oScopeControlData.enum.push({ id: SettingScope.Control, name: SettingScope.Control });
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// if the allowed designtime settings contain a setting that supports global scope
|
|
190
|
+
// then add the global scope option
|
|
191
|
+
const bSupportsGlobalScope = aAllowedDesigntimeSettings.some(oSetting => oSetting.bSupportsGlobalScope);
|
|
192
|
+
if (bSupportsGlobalScope) {
|
|
193
|
+
oScopeControlData.enum.push({ id: SettingScope.Application, name: SettingScope.Application });
|
|
194
|
+
}
|
|
195
|
+
// disable the scope control if there is only one option
|
|
196
|
+
oScopeControlData.disabled = oScopeControlData.enum.length <= 1;
|
|
197
|
+
|
|
198
|
+
const mPropertyValuesEntered = await designtimeUtils.openAdaptionDialog([...aChangeScopeOption, ...aItems], mRuntimeAdaptationPropertyValues, mUnchangedData, "Change Table Configuration", { width: "650px", height: "800px" });
|
|
199
|
+
|
|
200
|
+
const sSelectedTabKey = getSelectedTabKey(oSmartTable);
|
|
201
|
+
const sSelectedVariantKey = sSelectedTabKey ? getVariantInfo(oComponent, sSelectedTabKey)[0] : null;
|
|
202
|
+
|
|
203
|
+
// if the scope is not set, set it to the default is "Page Scope"
|
|
204
|
+
mPropertyValuesEntered["scope"] = mPropertyValuesEntered["scope"] || SettingScope.Page;
|
|
205
|
+
mUnchangedData["scope"] = mUnchangedData["scope"] || SettingScope.Page;
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @type {SmartTableChangeParams}
|
|
209
|
+
*/
|
|
210
|
+
const mPathParameters = {
|
|
211
|
+
sChangeType: designtimeUtils.ChangeType.ChangePageConfiguration,
|
|
212
|
+
sParentComponentName: sComponentName,
|
|
213
|
+
// used in case of ObjectPage only
|
|
214
|
+
sSectionKey: sComponentName === sObjectPageComponentName ? getSectionKey(oSmartTable) : null,
|
|
215
|
+
// used in case of multiple views only
|
|
216
|
+
sSelectedVariantKey,
|
|
217
|
+
sScope: mPropertyValuesEntered["scope"]
|
|
218
|
+
};
|
|
219
|
+
return designtimeUtils.extractChanges(mPropertyValuesEntered, mUnchangedData, aAllowedDesigntimeSettings, oComponent, mPathParameters);
|
|
220
|
+
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Retrieves the path to the setting in the `tableSettings` section of the manifest.
|
|
225
|
+
*
|
|
226
|
+
* @param {string} sSettingId - The ID of the setting.
|
|
227
|
+
* @param {boolean} bSupportsGlobalScope - Indicates if the setting supports global scope.
|
|
228
|
+
* @returns {(mSmartTableInfo: SmartTableInfo) => string} - The path to the setting in the manifest.
|
|
229
|
+
*
|
|
230
|
+
* @example
|
|
231
|
+
* // Example manifest structure
|
|
232
|
+
* {
|
|
233
|
+
* "component": {
|
|
234
|
+
* "settings": {
|
|
235
|
+
* "sections": {
|
|
236
|
+
* "section1": {
|
|
237
|
+
* "tableSettings": {
|
|
238
|
+
* "type": "ResponsiveTable"
|
|
239
|
+
* }
|
|
240
|
+
* }
|
|
241
|
+
* }
|
|
242
|
+
* }
|
|
243
|
+
* }
|
|
244
|
+
* }
|
|
245
|
+
*/
|
|
246
|
+
|
|
247
|
+
let getPathForTableSettings = function getPathForTableSettings(sSettingId, bSupportsGlobalScope = false) {
|
|
248
|
+
/**
|
|
249
|
+
* @param {SmartTableChangeParams} mSmartTableInfo - The SmartTable details.
|
|
250
|
+
* @returns {string} - The path to the setting in the manifest.
|
|
251
|
+
*/
|
|
252
|
+
return function (mSmartTableInfo) {
|
|
253
|
+
if (mSmartTableInfo.sParentComponentName === sObjectPageComponentName) {
|
|
254
|
+
return `component/settings/sections/${mSmartTableInfo.sSectionKey}/tableSettings/${sSettingId}`;
|
|
255
|
+
} else {
|
|
256
|
+
// Path defaults to page scope
|
|
257
|
+
let path = `component/settings/tableSettings/${sSettingId}`;
|
|
258
|
+
if (mSmartTableInfo.sScope === SettingScope.Application && bSupportsGlobalScope) {
|
|
259
|
+
path = `settings/tableSettings/${sSettingId}`;
|
|
260
|
+
}
|
|
261
|
+
if (mSmartTableInfo.sScope === SettingScope.Control && mSmartTableInfo.sSelectedVariantKey) {
|
|
262
|
+
path = `component/settings/quickVariantSelectionX/variants/${mSmartTableInfo.sSelectedVariantKey}/tableSettings/${sSettingId}`;
|
|
263
|
+
}
|
|
264
|
+
return path;
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Retrieves the designtime settings for the SmartTable.
|
|
271
|
+
* @param {object} oSmartTable - The SmartTable object.
|
|
272
|
+
* @returns {DesigntimeSetting[]} - The designtime settings for the SmartTable.
|
|
273
|
+
*/
|
|
274
|
+
let getAllowedDesigntimeSettings = function getAllowedDesigntimeSettings(oSmartTable) {
|
|
275
|
+
/**
|
|
276
|
+
* @type {DesigntimeSetting}
|
|
277
|
+
*/
|
|
278
|
+
const tableType = {
|
|
279
|
+
id: "type",
|
|
280
|
+
name: "Table Type",
|
|
281
|
+
description: "Define which table type should be used",
|
|
282
|
+
value: "ResponsiveTable",
|
|
283
|
+
type: "string",
|
|
284
|
+
getPath: getPathForTableSettings("type"),
|
|
285
|
+
enums: [
|
|
286
|
+
{ id: "ResponsiveTable", name: "Responsive Table" },
|
|
287
|
+
{ id: "GridTable", name: "Grid Table" },
|
|
288
|
+
{ id: "TreeTable", name: "Tree Table" },
|
|
289
|
+
{ id: "AnalyticalTable", name: "Analytical Table" }
|
|
290
|
+
],
|
|
291
|
+
bSupportsGlobalScope: false
|
|
292
|
+
};
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* @type {DesigntimeSetting}
|
|
296
|
+
*/
|
|
297
|
+
const multiSelect = {
|
|
298
|
+
id: "multiSelect",
|
|
299
|
+
name: "Multi Select",
|
|
300
|
+
description: "Define if the table should support multi selection",
|
|
301
|
+
value: false,
|
|
302
|
+
type: "boolean",
|
|
303
|
+
getPath: getPathForTableSettings("multiSelect"),
|
|
304
|
+
bSupportsGlobalScope: false
|
|
305
|
+
};
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* @type {DesigntimeSetting}
|
|
309
|
+
*/
|
|
310
|
+
const selectAll = {
|
|
311
|
+
id: "selectAll",
|
|
312
|
+
name: "Select All",
|
|
313
|
+
description: "Define if the table should support select all",
|
|
314
|
+
value: false,
|
|
315
|
+
type: "boolean",
|
|
316
|
+
getPath: getPathForTableSettings("selectAll"),
|
|
317
|
+
bSupportsGlobalScope: false
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* @type {DesigntimeSetting}
|
|
323
|
+
*/
|
|
324
|
+
const createMode = {
|
|
325
|
+
id: "createMode",
|
|
326
|
+
name: "Create Mode",
|
|
327
|
+
description: "Define the create mode",
|
|
328
|
+
value: "creationRows",
|
|
329
|
+
type: "string",
|
|
330
|
+
getPath: getPathForTableSettings("createMode", true),
|
|
331
|
+
enums: [
|
|
332
|
+
{ id: "creationRows", name: "creationRows" },
|
|
333
|
+
{ id: "NewPage", name: "NewPage" },
|
|
334
|
+
{ id: "Inline", name: "Inline" }
|
|
335
|
+
],
|
|
336
|
+
bSupportsGlobalScope: true,
|
|
337
|
+
restrictedTo: [sObjectPageComponentName]
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
const designtimeSettings = [
|
|
341
|
+
tableType,
|
|
342
|
+
multiSelect,
|
|
343
|
+
selectAll,
|
|
344
|
+
createMode
|
|
345
|
+
];
|
|
346
|
+
return designtimeSettings.filter(oSetting => {
|
|
347
|
+
const sComponentName = designtimeUtils.getComponent(oSmartTable).getMetadata().getComponentName();
|
|
348
|
+
return !oSetting.restrictedTo || oSetting.restrictedTo.includes(sComponentName);
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
// Expose the functions for QUnit tests
|
|
353
|
+
getAllowedDesigntimeSettings = testableHelper.testableStatic(getAllowedDesigntimeSettings, "getAllowedDesigntimeSettings");
|
|
354
|
+
getPathForTableSettings = testableHelper.testableStatic(getPathForTableSettings, "getPathForTableSettings");
|
|
355
|
+
testableHelper.testableStatic(getRuntimeAdapationProperties, "getRuntimeAdapationProperties");
|
|
356
|
+
testableHelper.testableStatic(getManifestTableSettings, "getManifestTableSettings");
|
|
357
|
+
testableHelper.testableStatic(getSelectedTabKey, "getSelectedTabKey");
|
|
358
|
+
testableHelper.testableStatic(getVariantInfo, "getVariantInfo");
|
|
359
|
+
testableHelper.testableStatic(fnOpenTableConfigurationDialog, "fnOpenTableConfigurationDialog");
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
const oHelper = {
|
|
363
|
+
getDesigntime: function (oSmartTable) {
|
|
364
|
+
return {
|
|
365
|
+
actions: {
|
|
366
|
+
settings: {
|
|
367
|
+
fe: {
|
|
368
|
+
name: "Configuration",
|
|
369
|
+
icon: "sap-icon://developer-settings",
|
|
370
|
+
handler: fnOpenTableConfigurationDialog
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
return oHelper;
|
|
378
|
+
}
|
|
379
|
+
);
|
|
@@ -119,9 +119,9 @@ sap.ui.define(["sap/suite/ui/generic/template/designtime/utils/designtimeHelper"
|
|
|
119
119
|
// - property changes are possible only in designtime adaptation
|
|
120
120
|
// - for any other changes (using change handlers), we anyway need to be prepared for the change if it is allowed in one mode, so it shouldn't matter if it's also possible in the other mode
|
|
121
121
|
return designtimeHelper.getRtaModeValue()
|
|
122
|
-
.then(function (
|
|
123
|
-
var mAllow =
|
|
124
|
-
return designtimeHelper.getViewDesignTime(mAllow);
|
|
122
|
+
.then(function (sRtaModeValue) {
|
|
123
|
+
var mAllow = sRtaModeValue === designtimeHelper.FioriToolsRtaMode.True ? mAllowVariantManagement : designtimeHelper.getMergedAllowList([mAllowLevel0, mGreyLevel0, mAllowKeyUser]);
|
|
124
|
+
return designtimeHelper.getViewDesignTime(mAllow, sRtaModeValue);
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
|
|
@@ -181,9 +181,9 @@ sap.ui.define(["sap/suite/ui/generic/template/designtime/utils/designtimeHelper"
|
|
|
181
181
|
// - property changes are possible only in designtime adaptation
|
|
182
182
|
// - for any other changes (using change handlers), we anyway need to be prepared for the change if it is allowed in one mode, so it shouldn't matter if it's also possible in the other mode
|
|
183
183
|
return designtimeHelper.getRtaModeValue()
|
|
184
|
-
.then(function (
|
|
185
|
-
var mAllow =
|
|
186
|
-
return designtimeHelper.getViewDesignTime(mAllow);
|
|
184
|
+
.then(function (sRtaModeValue) {
|
|
185
|
+
var mAllow = sRtaModeValue === designtimeHelper.FioriToolsRtaMode.True ? mAllowVariantManagement : designtimeHelper.getMergedAllowList([mAllowLevel0, mGreyLevel0, mAllowKeyUser]);
|
|
186
|
+
return designtimeHelper.getViewDesignTime(mAllow, sRtaModeValue);
|
|
187
187
|
});
|
|
188
188
|
});
|
|
189
189
|
|
|
@@ -266,9 +266,8 @@ sap.ui.define(["sap/suite/ui/generic/template/designtime/utils/designtimeHelper"
|
|
|
266
266
|
// - property changes are possible only in designtime adaptation
|
|
267
267
|
// - for any other changes (using change handlers), we anyway need to be prepared for the change if it is allowed in one mode, so it shouldn't matter if it's also possible in the other mode
|
|
268
268
|
return designtimeHelper.getRtaModeValue()
|
|
269
|
-
.then(function (
|
|
270
|
-
var mAllow =
|
|
271
|
-
return designtimeHelper.getViewDesignTime(mAllow);
|
|
269
|
+
.then(function (sRtaModeValue) {
|
|
270
|
+
var mAllow = sRtaModeValue === designtimeHelper.FioriToolsRtaMode.True ? mAllowVariantManagement : designtimeHelper.getMergedAllowList([mAllowLevel0, mGreyLevel0, mAllowKeyUser]);
|
|
271
|
+
return designtimeHelper.getViewDesignTime(mAllow, sRtaModeValue);
|
|
272
272
|
});
|
|
273
|
-
});
|
|
274
|
-
|
|
273
|
+
});
|