@sapui5/sap.fe.core 1.98.0 → 1.99.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 +3 -2
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +377 -405
- package/src/sap/fe/core/AnnotationHelper.ts +385 -0
- package/src/sap/fe/core/AppComponent.js +3 -2
- package/src/sap/fe/core/AppStateHandler.js +229 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +3 -2
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2073 -2399
- package/src/sap/fe/core/CommonUtils.ts +2078 -0
- package/src/sap/fe/core/ExtensionAPI.js +3 -2
- package/src/sap/fe/core/PageController.js +84 -125
- package/src/sap/fe/core/PageController.ts +101 -0
- package/src/sap/fe/core/RouterProxy.js +986 -823
- package/src/sap/fe/core/RouterProxy.ts +838 -0
- package/src/sap/fe/core/Synchronization.js +51 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -164
- package/src/sap/fe/core/TemplateComponent.ts +166 -0
- package/src/sap/fe/core/TemplateModel.js +97 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1576 -1664
- package/src/sap/fe/core/TransactionHelper.ts +1706 -0
- package/src/sap/fe/core/actions/draft.js +559 -608
- package/src/sap/fe/core/actions/draft.ts +593 -0
- package/src/sap/fe/core/actions/messageHandling.js +545 -514
- package/src/sap/fe/core/actions/messageHandling.ts +532 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1074 -1215
- package/src/sap/fe/core/actions/operations.ts +1162 -0
- package/src/sap/fe/core/actions/sticky.js +102 -105
- package/src/sap/fe/core/actions/sticky.ts +102 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
- package/src/sap/fe/core/controllerextensions/EditFlow.js +54 -211
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +279 -11
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +8 -6
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +47 -45
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +2 -3
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +29 -26
- package/src/sap/fe/core/controllerextensions/MassEdit.js +101 -8
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +17 -8
- package/src/sap/fe/core/controllerextensions/PageReady.js +2 -2
- package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
- package/src/sap/fe/core/controllerextensions/Paginator.js +3 -2
- package/src/sap/fe/core/controllerextensions/Placeholder.js +3 -2
- package/src/sap/fe/core/controllerextensions/Routing.js +9 -4
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
- package/src/sap/fe/core/controllerextensions/Share.js +3 -2
- package/src/sap/fe/core/controllerextensions/SideEffects.js +3 -3
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +18 -18
- package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
- package/src/sap/fe/core/controls/CommandExecution.js +3 -2
- package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -2
- package/src/sap/fe/core/controls/FieldWrapper.js +11 -22
- package/src/sap/fe/core/controls/FilterBar.js +3 -2
- package/src/sap/fe/core/controls/FormElementWrapper.js +3 -2
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +3 -2
- package/src/sap/fe/core/converters/ConverterContext.js +2 -2
- package/src/sap/fe/core/converters/ConverterContext.ts +4 -3
- package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +1 -0
- package/src/sap/fe/core/converters/ManifestWrapper.js +39 -26
- package/src/sap/fe/core/converters/ManifestWrapper.ts +9 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -8
- package/src/sap/fe/core/converters/MetaModelConverter.ts +16 -16
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
- package/src/sap/fe/core/converters/controls/Common/Action.js +2 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +4 -2
- package/src/sap/fe/core/converters/controls/Common/Form.ts +16 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +250 -146
- package/src/sap/fe/core/converters/controls/Common/Table.ts +300 -167
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +115 -56
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +120 -74
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +467 -32
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +483 -54
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +9 -15
- package/src/sap/fe/core/converters/helpers/Aggregation.js +13 -5
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
- package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -2
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
- package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
- package/src/sap/fe/core/formatters/ValueFormatter.ts +7 -6
- package/src/sap/fe/core/fpm/Component.js +3 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.js +2 -2
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +7 -4
- package/src/sap/fe/core/helpers/BindingExpression.js +314 -355
- package/src/sap/fe/core/helpers/BindingExpression.ts +317 -391
- package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
- package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
- package/src/sap/fe/core/helpers/MassEditHelper.js +27 -18
- package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +4 -3
- package/src/sap/fe/core/library.support.js +3 -2
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +1 -1
- package/src/sap/fe/core/messagebundle.properties +23 -10
- package/src/sap/fe/core/messagebundle_ar.properties +9 -0
- package/src/sap/fe/core/messagebundle_bg.properties +9 -0
- package/src/sap/fe/core/messagebundle_ca.properties +9 -0
- package/src/sap/fe/core/messagebundle_cs.properties +10 -1
- package/src/sap/fe/core/messagebundle_cy.properties +9 -0
- package/src/sap/fe/core/messagebundle_da.properties +9 -0
- package/src/sap/fe/core/messagebundle_de.properties +9 -0
- package/src/sap/fe/core/messagebundle_el.properties +9 -0
- package/src/sap/fe/core/messagebundle_en.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_GB.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +9 -0
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +9 -0
- package/src/sap/fe/core/messagebundle_es.properties +9 -0
- package/src/sap/fe/core/messagebundle_es_MX.properties +9 -0
- package/src/sap/fe/core/messagebundle_et.properties +9 -0
- package/src/sap/fe/core/messagebundle_fi.properties +9 -0
- package/src/sap/fe/core/messagebundle_fr.properties +13 -4
- package/src/sap/fe/core/messagebundle_fr_CA.properties +15 -6
- package/src/sap/fe/core/messagebundle_hi.properties +15 -6
- package/src/sap/fe/core/messagebundle_hr.properties +15 -6
- package/src/sap/fe/core/messagebundle_hu.properties +9 -0
- package/src/sap/fe/core/messagebundle_id.properties +10 -1
- package/src/sap/fe/core/messagebundle_it.properties +9 -0
- package/src/sap/fe/core/messagebundle_iw.properties +9 -0
- package/src/sap/fe/core/messagebundle_ja.properties +9 -0
- package/src/sap/fe/core/messagebundle_kk.properties +15 -6
- package/src/sap/fe/core/messagebundle_ko.properties +9 -0
- package/src/sap/fe/core/messagebundle_lt.properties +9 -0
- package/src/sap/fe/core/messagebundle_lv.properties +15 -6
- package/src/sap/fe/core/messagebundle_ms.properties +14 -5
- package/src/sap/fe/core/messagebundle_nl.properties +9 -0
- package/src/sap/fe/core/messagebundle_no.properties +9 -0
- package/src/sap/fe/core/messagebundle_pl.properties +9 -0
- package/src/sap/fe/core/messagebundle_pt.properties +9 -0
- package/src/sap/fe/core/messagebundle_pt_PT.properties +9 -0
- package/src/sap/fe/core/messagebundle_ro.properties +9 -0
- package/src/sap/fe/core/messagebundle_ru.properties +9 -0
- package/src/sap/fe/core/messagebundle_sh.properties +11 -2
- package/src/sap/fe/core/messagebundle_sk.properties +9 -0
- package/src/sap/fe/core/messagebundle_sl.properties +15 -6
- package/src/sap/fe/core/messagebundle_sv.properties +9 -0
- package/src/sap/fe/core/messagebundle_th.properties +9 -0
- package/src/sap/fe/core/messagebundle_tr.properties +9 -0
- package/src/sap/fe/core/messagebundle_uk.properties +9 -0
- package/src/sap/fe/core/messagebundle_vi.properties +9 -0
- package/src/sap/fe/core/messagebundle_zh_CN.properties +9 -0
- package/src/sap/fe/core/messagebundle_zh_TW.properties +15 -6
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -899
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +1 -1
- package/src/sap/fe/core/services/ShellServicesFactory.ts +15 -10
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +35 -81
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +46 -94
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -487
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +138 -72
- package/src/sap/fe/core/templating/FilterHelper.ts +139 -71
- package/src/sap/fe/core/templating/UIFormatters.js +31 -1
- package/src/sap/fe/core/templating/UIFormatters.ts +33 -2
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
SelectionMode,
|
|
30
30
|
TableColumnSettings,
|
|
31
31
|
TableManifestConfiguration,
|
|
32
|
+
TableManifestSettingsConfiguration,
|
|
32
33
|
TemplateType,
|
|
33
34
|
VariantManagementType,
|
|
34
35
|
ViewPathConfiguration,
|
|
@@ -73,7 +74,7 @@ import {
|
|
|
73
74
|
or,
|
|
74
75
|
resolveBindingString
|
|
75
76
|
} from "sap/fe/core/helpers/BindingExpression";
|
|
76
|
-
import {
|
|
77
|
+
import { Entity, bindingContextPathVisitor, UI } from "sap/fe/core/converters/helpers/BindingHelper";
|
|
77
78
|
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
78
79
|
import tableFormatters from "sap/fe/core/formatters/TableFormatter";
|
|
79
80
|
import { MessageType } from "sap/fe/core/formatters/TableFormatterTypes";
|
|
@@ -111,7 +112,11 @@ import {
|
|
|
111
112
|
getStandardActionPaste,
|
|
112
113
|
getStandardActionMassEdit,
|
|
113
114
|
isDraftOrStickySupported,
|
|
114
|
-
getInsertUpdateActionsTemplating
|
|
115
|
+
getInsertUpdateActionsTemplating,
|
|
116
|
+
getCreateVisibility,
|
|
117
|
+
isInDisplayMode,
|
|
118
|
+
getMassEditVisibility,
|
|
119
|
+
getRestrictions
|
|
115
120
|
} from "./table/StandardActions";
|
|
116
121
|
|
|
117
122
|
export type TableAnnotationConfiguration = {
|
|
@@ -132,6 +137,7 @@ export type TableAnnotationConfiguration = {
|
|
|
132
137
|
standardActions: {
|
|
133
138
|
actions: Record<string, StandardActionConfigType>;
|
|
134
139
|
isInsertUpdateTemplated: boolean;
|
|
140
|
+
updatablePropertyPath: string;
|
|
135
141
|
};
|
|
136
142
|
displayMode?: boolean;
|
|
137
143
|
threshold: number;
|
|
@@ -204,6 +210,7 @@ export type TableControlConfiguration = {
|
|
|
204
210
|
showRowCount: boolean;
|
|
205
211
|
enableMassEdit: boolean | undefined;
|
|
206
212
|
enableAutoColumnWidth: boolean;
|
|
213
|
+
dataStateIndicatorFilter: string | undefined;
|
|
207
214
|
};
|
|
208
215
|
|
|
209
216
|
export type TableType = "GridTable" | "ResponsiveTable" | "AnalyticalTable";
|
|
@@ -247,6 +254,7 @@ export type AnnotationTableColumn = BaseTableColumn & {
|
|
|
247
254
|
showDataFieldsLabel?: boolean;
|
|
248
255
|
isKey?: boolean;
|
|
249
256
|
unit?: string;
|
|
257
|
+
unitText?: string;
|
|
250
258
|
exportSettings?: {
|
|
251
259
|
template?: string;
|
|
252
260
|
label?: string;
|
|
@@ -306,7 +314,6 @@ export type TableVisualization = {
|
|
|
306
314
|
aggregates?: Record<string, AggregateData>;
|
|
307
315
|
enableAnalytics?: boolean;
|
|
308
316
|
enableAnalyticsSearch?: boolean;
|
|
309
|
-
enableDataStateFilter: boolean;
|
|
310
317
|
operationAvailableMap: string;
|
|
311
318
|
operationAvailableProperties: string;
|
|
312
319
|
};
|
|
@@ -557,13 +564,17 @@ export function updateLinkedProperties(entityType: EntityType, tableColumns: Tab
|
|
|
557
564
|
tableColumns.forEach(oColumn => {
|
|
558
565
|
const oTableColumn = oColumn as AnnotationTableColumn;
|
|
559
566
|
if (oTableColumn.propertyInfos === undefined && oTableColumn.relativePath) {
|
|
560
|
-
const oProperty = entityType.entityProperties.find(oProp => oProp.name === oTableColumn.relativePath);
|
|
567
|
+
const oProperty = entityType.entityProperties.find((oProp: Property) => oProp.name === oTableColumn.relativePath);
|
|
561
568
|
if (oProperty) {
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
const oUnitColumn = findColumnByPath(
|
|
565
|
-
|
|
569
|
+
const oUnit = getAssociatedCurrencyProperty(oProperty) || getAssociatedUnitProperty(oProperty);
|
|
570
|
+
if (oUnit) {
|
|
571
|
+
const oUnitColumn = findColumnByPath(oUnit.name);
|
|
566
572
|
oTableColumn.unit = oUnitColumn?.name;
|
|
573
|
+
} else {
|
|
574
|
+
const sUnit = oProperty?.annotations?.Measures?.ISOCurrency || oProperty?.annotations?.Measures?.Unit;
|
|
575
|
+
if (sUnit) {
|
|
576
|
+
oTableColumn.unitText = `${sUnit}`;
|
|
577
|
+
}
|
|
567
578
|
}
|
|
568
579
|
|
|
569
580
|
const displayMode = getDisplayMode(oProperty),
|
|
@@ -616,7 +627,6 @@ export function createTableVisualization(
|
|
|
616
627
|
control: tableManifestConfig,
|
|
617
628
|
actions: removeDuplicateActions(getTableActions(lineItemAnnotation, visualizationPath, converterContext, navigationSettings)),
|
|
618
629
|
columns: columns,
|
|
619
|
-
enableDataStateFilter: converterContext.getTemplateType() === "ObjectPage",
|
|
620
630
|
operationAvailableMap: JSON.stringify(operationAvailableMap),
|
|
621
631
|
operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext)
|
|
622
632
|
};
|
|
@@ -642,7 +652,6 @@ export function createDefaultTableVisualization(converterContext: ConverterConte
|
|
|
642
652
|
control: tableManifestConfig,
|
|
643
653
|
actions: [],
|
|
644
654
|
columns: columns,
|
|
645
|
-
enableDataStateFilter: converterContext.getTemplateType() === "ObjectPage",
|
|
646
655
|
operationAvailableMap: JSON.stringify(operationAvailableMap),
|
|
647
656
|
operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext)
|
|
648
657
|
};
|
|
@@ -700,6 +709,22 @@ function getOperationAvailableMap(lineItemAnnotation: LineItem | undefined, conv
|
|
|
700
709
|
return operationAvailableMap;
|
|
701
710
|
}
|
|
702
711
|
|
|
712
|
+
/**
|
|
713
|
+
* Gets updatable propertyPath for the current entityset if valid.
|
|
714
|
+
*
|
|
715
|
+
* @param converterContext The instance of the converter context
|
|
716
|
+
* @returns {string} The updatable property for the rows
|
|
717
|
+
*/
|
|
718
|
+
function getCurrentEntitySetUpdatablePath(converterContext: ConverterContext): string {
|
|
719
|
+
const restrictions = getRestrictions(converterContext);
|
|
720
|
+
const entitySet = converterContext.getEntitySet();
|
|
721
|
+
const updatable = restrictions.isUpdatable;
|
|
722
|
+
const isOnlyDynamicOnCurrentEntity: any = updatable.isOnlyCurrentEntityExpression && !isConstant(updatable.expression);
|
|
723
|
+
const updatablePropertyPath = (entitySet?.annotations.Capabilities?.UpdateRestrictions?.Updatable as any)?.path;
|
|
724
|
+
|
|
725
|
+
return isOnlyDynamicOnCurrentEntity ? (updatablePropertyPath as string) : "";
|
|
726
|
+
}
|
|
727
|
+
|
|
703
728
|
/**
|
|
704
729
|
* Method to retrieve all property paths assigned to the Core.OperationAvailable annotation.
|
|
705
730
|
*
|
|
@@ -922,7 +947,8 @@ export function getSelectionMode(
|
|
|
922
947
|
converterContext: ConverterContext,
|
|
923
948
|
isEntitySet: boolean,
|
|
924
949
|
targetCapabilities: TableCapabilityRestriction,
|
|
925
|
-
|
|
950
|
+
deleteButtonVisibilityExpression?: Expression<boolean>,
|
|
951
|
+
massEditVisibilityExpression: Expression<boolean> = constant(false)
|
|
926
952
|
): string | undefined {
|
|
927
953
|
if (!lineItemAnnotation) {
|
|
928
954
|
return SelectionMode.None;
|
|
@@ -943,12 +969,31 @@ export function getSelectionMode(
|
|
|
943
969
|
isParentDeletable = isPathDeletable(converterContext.getDataModelObjectPath(), undefined);
|
|
944
970
|
parentEntitySetDeletable = isParentDeletable ? compileBinding(isParentDeletable, true) : isParentDeletable;
|
|
945
971
|
}
|
|
946
|
-
|
|
947
|
-
|
|
972
|
+
|
|
973
|
+
const bMassEditEnabled: boolean = !isConstant(massEditVisibilityExpression) || massEditVisibilityExpression.value !== false;
|
|
974
|
+
if (selectionMode && selectionMode === SelectionMode.None && deleteButtonVisibilityExpression) {
|
|
975
|
+
if (converterContext.getTemplateType() === TemplateType.ObjectPage && bMassEditEnabled) {
|
|
976
|
+
// Mass Edit in OP is enabled only in edit mode.
|
|
977
|
+
return compileBinding(
|
|
978
|
+
ifElse(
|
|
979
|
+
and(equal(bindingExpression("/editMode", "ui"), "Editable"), massEditVisibilityExpression),
|
|
980
|
+
constant("Multi"),
|
|
981
|
+
ifElse(deleteButtonVisibilityExpression, constant("Multi"), constant("None"))
|
|
982
|
+
)
|
|
983
|
+
);
|
|
984
|
+
} else if (bMassEditEnabled) {
|
|
985
|
+
return SelectionMode.Multi;
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
return compileBinding(ifElse(deleteButtonVisibilityExpression, constant("Multi"), constant("None")));
|
|
948
989
|
}
|
|
949
990
|
if (!selectionMode || selectionMode === SelectionMode.Auto) {
|
|
950
991
|
selectionMode = SelectionMode.Multi;
|
|
951
992
|
}
|
|
993
|
+
if (bMassEditEnabled) {
|
|
994
|
+
// Override default selection mode when mass edit is visible
|
|
995
|
+
selectionMode = selectionMode === SelectionMode.Single ? SelectionMode.Single : SelectionMode.Multi;
|
|
996
|
+
}
|
|
952
997
|
|
|
953
998
|
if (
|
|
954
999
|
hasBoundActionsAlwaysVisibleInToolBar(lineItemAnnotation, converterContext.getEntityType()) ||
|
|
@@ -965,12 +1010,22 @@ export function getSelectionMode(
|
|
|
965
1010
|
aVisibleBindingExpressions = getVisibleExpForCustomActionsRequiringContext(manifestActions);
|
|
966
1011
|
|
|
967
1012
|
// No action requiring a context:
|
|
968
|
-
if (
|
|
1013
|
+
if (
|
|
1014
|
+
aHiddenBindingExpressions.length === 0 &&
|
|
1015
|
+
aVisibleBindingExpressions.length === 0 &&
|
|
1016
|
+
(deleteButtonVisibilityExpression || bMassEditEnabled)
|
|
1017
|
+
) {
|
|
969
1018
|
if (!isEntitySet) {
|
|
970
|
-
|
|
1019
|
+
// Example: OP case
|
|
1020
|
+
if (targetCapabilities.isDeletable || parentEntitySetDeletable !== "false" || bMassEditEnabled) {
|
|
1021
|
+
// Building expression for delete and mass edit
|
|
1022
|
+
const buttonVisibilityExpression = or(
|
|
1023
|
+
deleteButtonVisibilityExpression || true, // default delete visibility as true
|
|
1024
|
+
massEditVisibilityExpression
|
|
1025
|
+
);
|
|
971
1026
|
return compileBinding(
|
|
972
1027
|
ifElse(
|
|
973
|
-
and(equal(bindingExpression("/editMode", "ui"), "Editable"),
|
|
1028
|
+
and(equal(bindingExpression("/editMode", "ui"), "Editable"), buttonVisibilityExpression),
|
|
974
1029
|
constant(selectionMode),
|
|
975
1030
|
constant(SelectionMode.None)
|
|
976
1031
|
)
|
|
@@ -979,18 +1034,28 @@ export function getSelectionMode(
|
|
|
979
1034
|
return SelectionMode.None;
|
|
980
1035
|
}
|
|
981
1036
|
// EntitySet deletable:
|
|
982
|
-
} else if (
|
|
983
|
-
|
|
1037
|
+
} else if (bMassEditEnabled) {
|
|
1038
|
+
// example: LR scenario
|
|
1039
|
+
return selectionMode;
|
|
1040
|
+
} else if (targetCapabilities.isDeletable && deleteButtonVisibilityExpression) {
|
|
1041
|
+
return compileBinding(ifElse(deleteButtonVisibilityExpression, constant(selectionMode), constant("None")));
|
|
984
1042
|
// EntitySet not deletable:
|
|
985
1043
|
} else {
|
|
986
1044
|
return SelectionMode.None;
|
|
987
1045
|
}
|
|
988
1046
|
// There are actions requiring a context:
|
|
989
1047
|
} else if (!isEntitySet) {
|
|
990
|
-
|
|
1048
|
+
// Example: OP case
|
|
1049
|
+
if (targetCapabilities.isDeletable || parentEntitySetDeletable !== "false" || bMassEditEnabled) {
|
|
1050
|
+
// Use selectionMode in edit mode if delete is enabled or mass edit is visible
|
|
1051
|
+
const editModebuttonVisibilityExpression = ifElse(
|
|
1052
|
+
bMassEditEnabled && !targetCapabilities.isDeletable,
|
|
1053
|
+
massEditVisibilityExpression,
|
|
1054
|
+
constant(true)
|
|
1055
|
+
);
|
|
991
1056
|
return compileBinding(
|
|
992
1057
|
ifElse(
|
|
993
|
-
equal(bindingExpression("/editMode", "ui"), "Editable"),
|
|
1058
|
+
and(equal(bindingExpression("/editMode", "ui"), "Editable"), editModebuttonVisibilityExpression),
|
|
994
1059
|
constant(selectionMode),
|
|
995
1060
|
ifElse(
|
|
996
1061
|
or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions)),
|
|
@@ -1009,13 +1074,14 @@ export function getSelectionMode(
|
|
|
1009
1074
|
);
|
|
1010
1075
|
}
|
|
1011
1076
|
//EntitySet deletable:
|
|
1012
|
-
} else if (targetCapabilities.isDeletable) {
|
|
1013
|
-
|
|
1077
|
+
} else if (targetCapabilities.isDeletable || bMassEditEnabled) {
|
|
1078
|
+
// Example: LR scenario
|
|
1079
|
+
return selectionMode;
|
|
1014
1080
|
//EntitySet not deletable:
|
|
1015
1081
|
} else {
|
|
1016
1082
|
return compileBinding(
|
|
1017
1083
|
ifElse(
|
|
1018
|
-
or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions)),
|
|
1084
|
+
or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions), massEditVisibilityExpression),
|
|
1019
1085
|
constant(selectionMode),
|
|
1020
1086
|
constant(SelectionMode.None)
|
|
1021
1087
|
)
|
|
@@ -1121,14 +1187,25 @@ function getHighlightRowBinding(
|
|
|
1121
1187
|
defaultHighlightRowDefinition = getMessageTypeFromCriticalityType(criticalityAnnotation);
|
|
1122
1188
|
}
|
|
1123
1189
|
}
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1190
|
+
|
|
1191
|
+
const aMissingKeys: any[] = [];
|
|
1192
|
+
targetEntityType?.keys.forEach((key: any) => {
|
|
1193
|
+
if (key.name !== "IsActiveEntity") {
|
|
1194
|
+
aMissingKeys.push(bindingExpression(key.name, undefined));
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
|
|
1198
|
+
return formatResult(
|
|
1199
|
+
[
|
|
1200
|
+
defaultHighlightRowDefinition,
|
|
1201
|
+
bindingExpression(`filteredMessages`, "internal"),
|
|
1202
|
+
isDraftRoot && Entity.HasActive,
|
|
1203
|
+
isDraftRoot && Entity.IsActive,
|
|
1204
|
+
`${isDraftRoot}`,
|
|
1205
|
+
...aMissingKeys
|
|
1206
|
+
],
|
|
1207
|
+
tableFormatters.rowHighlighting,
|
|
1208
|
+
targetEntityType
|
|
1132
1209
|
);
|
|
1133
1210
|
}
|
|
1134
1211
|
|
|
@@ -1445,7 +1522,7 @@ const _isValidColumn = function(dataField: DataFieldAbstractTypes) {
|
|
|
1445
1522
|
export const _getVisibleExpression = function(
|
|
1446
1523
|
dataFieldModelPath: DataModelObjectPath,
|
|
1447
1524
|
formatOptions?: any,
|
|
1448
|
-
returnExpression
|
|
1525
|
+
returnExpression: boolean = false
|
|
1449
1526
|
): BindingExpression<string> {
|
|
1450
1527
|
const targetObject: DataFieldAbstractTypes | DataPointTypeTypes = dataFieldModelPath.targetObject;
|
|
1451
1528
|
let propertyValue;
|
|
@@ -1498,7 +1575,7 @@ export const _getVisibleExpression = function(
|
|
|
1498
1575
|
const _getFieldGroupHiddenExpressions = function(
|
|
1499
1576
|
dataFieldGroup: DataFieldAbstractTypes,
|
|
1500
1577
|
fieldFormatOptions: any
|
|
1501
|
-
): BindingExpression<string> {
|
|
1578
|
+
): BindingExpression<string> | undefined {
|
|
1502
1579
|
const aFieldGroupHiddenExpressions: BindingExpression<string>[] = [];
|
|
1503
1580
|
if (
|
|
1504
1581
|
dataFieldGroup.$Type === UIAnnotationTypes.DataFieldForAnnotation &&
|
|
@@ -1512,6 +1589,8 @@ const _getFieldGroupHiddenExpressions = function(
|
|
|
1512
1589
|
return compileBinding(
|
|
1513
1590
|
ifElse(or(...(aFieldGroupHiddenExpressions as ExpressionOrPrimitive<boolean>[])), constant(true), constant(false))
|
|
1514
1591
|
);
|
|
1592
|
+
} else {
|
|
1593
|
+
return undefined;
|
|
1515
1594
|
}
|
|
1516
1595
|
};
|
|
1517
1596
|
|
|
@@ -1907,7 +1986,8 @@ const getColumnsFromAnnotations = function(
|
|
|
1907
1986
|
}
|
|
1908
1987
|
|
|
1909
1988
|
// TODO: For situation POC - increase width of the column with the situations indicator - works for the situations demo app only!
|
|
1910
|
-
// Might be a good idea to move the complete column width determination to the converter, that would allow us to widen
|
|
1989
|
+
// Might be a good idea to move the complete column width determination to the converter, that would allow us to widen
|
|
1990
|
+
// the columns as needed. This workaround only deals with Date columns.
|
|
1911
1991
|
const { hasDraftIndicator } = getDefaultDraftIndicatorForColumn(name, semanticKeys);
|
|
1912
1992
|
const widthOverride =
|
|
1913
1993
|
(converterContext.getEntityType().annotations as any).FE?.Situations &&
|
|
@@ -2163,9 +2243,10 @@ export function getP13nMode(
|
|
|
2163
2243
|
// No personalization configured in manifest.
|
|
2164
2244
|
aPersonalization.push("Sort");
|
|
2165
2245
|
aPersonalization.push("Column");
|
|
2166
|
-
if (variantManagement === VariantManagementType.Control) {
|
|
2246
|
+
if (variantManagement === VariantManagementType.Control || _isFilterBarHidden(manifestWrapper, converterContext)) {
|
|
2167
2247
|
// Feature parity with V2.
|
|
2168
2248
|
// Enable table filtering by default only in case of Control level variant management.
|
|
2249
|
+
// Or when the LR filter bar is hidden via manifest setting
|
|
2169
2250
|
aPersonalization.push("Filter");
|
|
2170
2251
|
}
|
|
2171
2252
|
if (bAnalyticalTable) {
|
|
@@ -2177,6 +2258,24 @@ export function getP13nMode(
|
|
|
2177
2258
|
return undefined;
|
|
2178
2259
|
}
|
|
2179
2260
|
|
|
2261
|
+
/**
|
|
2262
|
+
* Returns a boolean suggesting if a filter bar is being used on the page.
|
|
2263
|
+
*
|
|
2264
|
+
* Chart has a dependency to filter bar (issue with loading data). Once resolved, the check for chart should be removed here.
|
|
2265
|
+
* Until then, hiding filter bar is now allowed if a chart is being used on LR.
|
|
2266
|
+
*
|
|
2267
|
+
* @param {ManifestWrapper} manifestWrapper Manifest settings getter for the page
|
|
2268
|
+
* @param {ConverterContext} converterContext The instance of the converter context
|
|
2269
|
+
* @returns {boolean} Boolean suggesting if a filter bar is being used on the page.
|
|
2270
|
+
*/
|
|
2271
|
+
function _isFilterBarHidden(manifestWrapper: ManifestWrapper, converterContext: ConverterContext): boolean {
|
|
2272
|
+
return (
|
|
2273
|
+
manifestWrapper.isFilterBarHidden() &&
|
|
2274
|
+
!converterContext.getManifestWrapper().hasMultipleVisualizations() &&
|
|
2275
|
+
converterContext.getTemplateType() !== TemplateType.AnalyticalListPage
|
|
2276
|
+
);
|
|
2277
|
+
}
|
|
2278
|
+
|
|
2180
2279
|
/**
|
|
2181
2280
|
* Returns a JSON string containing the sort conditions for the presentation variant.
|
|
2182
2281
|
*
|
|
@@ -2314,14 +2413,24 @@ export function getTableAnnotationConfiguration(
|
|
|
2314
2413
|
tableManifestConfiguration,
|
|
2315
2414
|
viewConfiguration
|
|
2316
2415
|
);
|
|
2317
|
-
|
|
2416
|
+
|
|
2417
|
+
const deleteButtonVisibilityExpression = getDeleteVisibility(converterContext, standardActionsContext);
|
|
2418
|
+
const createButtonVisibilityExpression = getCreateVisibility(converterContext, standardActionsContext);
|
|
2419
|
+
const massEditButtonVisibilityExpression = getMassEditVisibility(converterContext, standardActionsContext);
|
|
2420
|
+
const isInsertUpdateTemplated = getInsertUpdateActionsTemplating(
|
|
2421
|
+
standardActionsContext,
|
|
2422
|
+
isDraftOrStickySupported(converterContext),
|
|
2423
|
+
compileBinding(createButtonVisibilityExpression) === "false"
|
|
2424
|
+
);
|
|
2425
|
+
|
|
2318
2426
|
const selectionMode = getSelectionMode(
|
|
2319
2427
|
lineItemAnnotation,
|
|
2320
2428
|
visualizationPath,
|
|
2321
2429
|
converterContext,
|
|
2322
2430
|
hasAbsolutePath,
|
|
2323
2431
|
targetCapabilities,
|
|
2324
|
-
|
|
2432
|
+
deleteButtonVisibilityExpression,
|
|
2433
|
+
massEditButtonVisibilityExpression
|
|
2325
2434
|
);
|
|
2326
2435
|
let threshold = navigationPropertyPath ? 10 : 30;
|
|
2327
2436
|
if (presentationVariantAnnotation?.MaxItems) {
|
|
@@ -2331,17 +2440,12 @@ export function getTableAnnotationConfiguration(
|
|
|
2331
2440
|
const creationBehaviour = _getCreationBehaviour(lineItemAnnotation, tableManifestConfiguration, converterContext, navigationSettings);
|
|
2332
2441
|
const variantManagement: VariantManagementType = pageManifestSettings.getVariantManagement();
|
|
2333
2442
|
const isSearchable = isPathSearchable(converterContext.getDataModelObjectPath());
|
|
2334
|
-
const
|
|
2443
|
+
const standardActions = {
|
|
2335
2444
|
create: getStandardActionCreate(converterContext, standardActionsContext),
|
|
2336
2445
|
"delete": getStandardActionDelete(converterContext, standardActionsContext),
|
|
2337
|
-
paste: getStandardActionPaste(converterContext, standardActionsContext),
|
|
2338
|
-
massEdit: getStandardActionMassEdit(converterContext, standardActionsContext
|
|
2446
|
+
paste: getStandardActionPaste(converterContext, standardActionsContext, isInsertUpdateTemplated),
|
|
2447
|
+
massEdit: getStandardActionMassEdit(converterContext, standardActionsContext)
|
|
2339
2448
|
};
|
|
2340
|
-
const isInsertUpdateTemplated = getInsertUpdateActionsTemplating(
|
|
2341
|
-
standardActionsContext,
|
|
2342
|
-
isDraftOrStickySupported(converterContext),
|
|
2343
|
-
tableActions.create.visible === "false"
|
|
2344
|
-
);
|
|
2345
2449
|
|
|
2346
2450
|
return {
|
|
2347
2451
|
id: id,
|
|
@@ -2357,16 +2461,18 @@ export function getTableAnnotationConfiguration(
|
|
|
2357
2461
|
),
|
|
2358
2462
|
p13nMode: p13nMode,
|
|
2359
2463
|
standardActions: {
|
|
2360
|
-
actions:
|
|
2361
|
-
isInsertUpdateTemplated: isInsertUpdateTemplated
|
|
2464
|
+
actions: standardActions,
|
|
2465
|
+
isInsertUpdateTemplated: isInsertUpdateTemplated,
|
|
2466
|
+
updatablePropertyPath: getCurrentEntitySetUpdatablePath(converterContext)
|
|
2362
2467
|
},
|
|
2363
2468
|
displayMode: isInDisplayMode(converterContext, viewConfiguration),
|
|
2364
2469
|
create: creationBehaviour,
|
|
2365
2470
|
selectionMode: selectionMode,
|
|
2366
2471
|
autoBindOnInit:
|
|
2367
|
-
converterContext
|
|
2368
|
-
converterContext.getTemplateType() !== TemplateType.
|
|
2369
|
-
|
|
2472
|
+
_isFilterBarHidden(pageManifestSettings, converterContext) ||
|
|
2473
|
+
(converterContext.getTemplateType() !== TemplateType.ListReport &&
|
|
2474
|
+
converterContext.getTemplateType() !== TemplateType.AnalyticalListPage &&
|
|
2475
|
+
!(viewConfiguration && pageManifestSettings.hasMultipleVisualizations(viewConfiguration))),
|
|
2370
2476
|
variantManagement: variantManagement === "Control" && !p13nMode ? VariantManagementType.None : variantManagement,
|
|
2371
2477
|
threshold: threshold,
|
|
2372
2478
|
sortConditions: getSortConditions(converterContext, presentationVariantAnnotation, columns),
|
|
@@ -2408,19 +2514,6 @@ function _getExportDataType(dataType: string, isComplexProperty: boolean = false
|
|
|
2408
2514
|
return exportDataType;
|
|
2409
2515
|
}
|
|
2410
2516
|
|
|
2411
|
-
function isInDisplayMode(converterContext: ConverterContext, viewConfiguration?: ViewPathConfiguration): boolean {
|
|
2412
|
-
const templateType = converterContext.getTemplateType();
|
|
2413
|
-
if (
|
|
2414
|
-
templateType === TemplateType.ListReport ||
|
|
2415
|
-
templateType === TemplateType.AnalyticalListPage ||
|
|
2416
|
-
(viewConfiguration && converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration))
|
|
2417
|
-
) {
|
|
2418
|
-
return true;
|
|
2419
|
-
}
|
|
2420
|
-
// updatable will be handled at the property level
|
|
2421
|
-
return false;
|
|
2422
|
-
}
|
|
2423
|
-
|
|
2424
2517
|
/**
|
|
2425
2518
|
* Split the visualization path into the navigation property path and annotation.
|
|
2426
2519
|
*
|
|
@@ -2461,126 +2554,166 @@ export function getSelectionVariantConfiguration(
|
|
|
2461
2554
|
return undefined;
|
|
2462
2555
|
}
|
|
2463
2556
|
|
|
2557
|
+
function _getFullScreenBasedOnDevice(
|
|
2558
|
+
tableSettings: TableManifestSettingsConfiguration,
|
|
2559
|
+
converterContext: ConverterContext,
|
|
2560
|
+
isIphone: boolean
|
|
2561
|
+
): boolean {
|
|
2562
|
+
// If enableFullScreen is not set, use as default true on phone and false otherwise
|
|
2563
|
+
let enableFullScreen = tableSettings.enableFullScreen ?? isIphone;
|
|
2564
|
+
// Make sure that enableFullScreen is not set on ListReport for desktop or tablet
|
|
2565
|
+
if (!isIphone && enableFullScreen && converterContext.getTemplateType() === TemplateType.ListReport) {
|
|
2566
|
+
enableFullScreen = false;
|
|
2567
|
+
converterContext.getDiagnostics().addIssue(IssueCategory.Manifest, IssueSeverity.Low, IssueType.FULLSCREENMODE_NOT_ON_LISTREPORT);
|
|
2568
|
+
}
|
|
2569
|
+
return enableFullScreen;
|
|
2570
|
+
}
|
|
2571
|
+
|
|
2572
|
+
function _getMultiSelectMode(
|
|
2573
|
+
tableSettings: TableManifestSettingsConfiguration,
|
|
2574
|
+
tableType: TableType,
|
|
2575
|
+
converterContext: ConverterContext
|
|
2576
|
+
): string | undefined {
|
|
2577
|
+
let multiSelectMode: string | undefined;
|
|
2578
|
+
if (tableType !== "ResponsiveTable") {
|
|
2579
|
+
return undefined;
|
|
2580
|
+
}
|
|
2581
|
+
switch (converterContext.getTemplateType()) {
|
|
2582
|
+
case TemplateType.ListReport:
|
|
2583
|
+
case TemplateType.AnalyticalListPage:
|
|
2584
|
+
multiSelectMode = !tableSettings.selectAll ? "ClearAll" : "Default";
|
|
2585
|
+
break;
|
|
2586
|
+
case TemplateType.ObjectPage:
|
|
2587
|
+
multiSelectMode = tableSettings.selectAll === false ? "ClearAll" : "Default";
|
|
2588
|
+
if (converterContext.getManifestWrapper().useIconTabBar()) {
|
|
2589
|
+
multiSelectMode = !tableSettings.selectAll ? "ClearAll" : "Default";
|
|
2590
|
+
}
|
|
2591
|
+
break;
|
|
2592
|
+
default:
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
return multiSelectMode;
|
|
2596
|
+
}
|
|
2597
|
+
|
|
2598
|
+
function _getTableType(
|
|
2599
|
+
tableSettings: TableManifestSettingsConfiguration,
|
|
2600
|
+
aggregationHelper: AggregationHelper,
|
|
2601
|
+
converterContext: ConverterContext
|
|
2602
|
+
): TableType {
|
|
2603
|
+
let tableType = tableSettings?.type || "ResponsiveTable";
|
|
2604
|
+
if (converterContext.getTemplateType() !== "ObjectPage") {
|
|
2605
|
+
if (tableSettings?.type === "AnalyticalTable" && !aggregationHelper.isAnalyticsSupported()) {
|
|
2606
|
+
tableType = "GridTable";
|
|
2607
|
+
}
|
|
2608
|
+
if (!tableSettings?.type) {
|
|
2609
|
+
if (converterContext.getManifestWrapper().isDesktop() && aggregationHelper.isAnalyticsSupported()) {
|
|
2610
|
+
tableType = "AnalyticalTable";
|
|
2611
|
+
} else {
|
|
2612
|
+
tableType = "ResponsiveTable";
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2616
|
+
return tableType;
|
|
2617
|
+
}
|
|
2618
|
+
function _getFilters(
|
|
2619
|
+
tableSettings: TableManifestSettingsConfiguration,
|
|
2620
|
+
quickFilterPaths: { annotationPath: string }[],
|
|
2621
|
+
quickSelectionVariant: any,
|
|
2622
|
+
path: { annotationPath: string },
|
|
2623
|
+
converterContext: ConverterContext
|
|
2624
|
+
): any {
|
|
2625
|
+
if (quickSelectionVariant) {
|
|
2626
|
+
quickFilterPaths.push({ annotationPath: path.annotationPath });
|
|
2627
|
+
}
|
|
2628
|
+
return {
|
|
2629
|
+
quickFilters: {
|
|
2630
|
+
enabled:
|
|
2631
|
+
converterContext.getTemplateType() === TemplateType.ListReport ? "{= ${pageInternal>hasPendingFilters} !== true}" : true,
|
|
2632
|
+
showCounts: tableSettings?.quickVariantSelection?.showCounts,
|
|
2633
|
+
paths: quickFilterPaths
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
function _getEnableExport(
|
|
2639
|
+
tableSettings: TableManifestSettingsConfiguration,
|
|
2640
|
+
converterContext: ConverterContext,
|
|
2641
|
+
enablePaste: boolean
|
|
2642
|
+
): boolean {
|
|
2643
|
+
return tableSettings.enableExport !== undefined
|
|
2644
|
+
? tableSettings.enableExport
|
|
2645
|
+
: converterContext.getTemplateType() !== "ObjectPage" || enablePaste;
|
|
2646
|
+
}
|
|
2647
|
+
|
|
2648
|
+
function _getFilterConfiguration(
|
|
2649
|
+
tableSettings: TableManifestSettingsConfiguration,
|
|
2650
|
+
lineItemAnnotation: LineItem | undefined,
|
|
2651
|
+
converterContext: ConverterContext
|
|
2652
|
+
): any {
|
|
2653
|
+
if (!lineItemAnnotation) {
|
|
2654
|
+
return {};
|
|
2655
|
+
}
|
|
2656
|
+
const quickFilterPaths: { annotationPath: string }[] = [];
|
|
2657
|
+
const targetEntityType = converterContext.getAnnotationEntityType(lineItemAnnotation);
|
|
2658
|
+
let quickSelectionVariant: any;
|
|
2659
|
+
let filters;
|
|
2660
|
+
tableSettings?.quickVariantSelection?.paths?.forEach((path: { annotationPath: string }) => {
|
|
2661
|
+
quickSelectionVariant = targetEntityType.resolvePath("@" + path.annotationPath);
|
|
2662
|
+
filters = _getFilters(tableSettings, quickFilterPaths, quickSelectionVariant, path, converterContext);
|
|
2663
|
+
});
|
|
2664
|
+
|
|
2665
|
+
let hideTableTitle = false;
|
|
2666
|
+
hideTableTitle = !!tableSettings.quickVariantSelection?.hideTableTitle;
|
|
2667
|
+
return {
|
|
2668
|
+
filters: filters,
|
|
2669
|
+
headerVisible: !(quickSelectionVariant && hideTableTitle)
|
|
2670
|
+
};
|
|
2671
|
+
}
|
|
2672
|
+
|
|
2464
2673
|
export function getTableManifestConfiguration(
|
|
2465
2674
|
lineItemAnnotation: LineItem | undefined,
|
|
2466
2675
|
visualizationPath: string,
|
|
2467
2676
|
converterContext: ConverterContext,
|
|
2468
|
-
checkCondensedLayout
|
|
2677
|
+
checkCondensedLayout = false
|
|
2469
2678
|
): TableControlConfiguration {
|
|
2470
2679
|
const tableManifestSettings: TableManifestConfiguration = converterContext.getManifestControlConfiguration(visualizationPath);
|
|
2471
2680
|
const tableSettings = (tableManifestSettings && tableManifestSettings.tableSettings) || {};
|
|
2472
|
-
|
|
2473
|
-
const quickFilterPaths: { annotationPath: string }[] = [];
|
|
2474
|
-
let enableExport = true;
|
|
2475
|
-
let creationMode = CreationMode.NewPage;
|
|
2476
|
-
let filters;
|
|
2477
|
-
let createAtEnd = true;
|
|
2478
|
-
let disableAddRowButtonForEmptyData = false;
|
|
2479
|
-
let customValidationFunction;
|
|
2480
|
-
let condensedTableLayout = false;
|
|
2481
|
-
let hideTableTitle = false;
|
|
2482
|
-
let tableType: TableType = "ResponsiveTable";
|
|
2483
|
-
let enableFullScreen = false;
|
|
2484
|
-
let selectionLimit = 200;
|
|
2485
|
-
let multiSelectMode;
|
|
2681
|
+
const creationMode = CreationMode.NewPage;
|
|
2486
2682
|
const enableAutoColumnWidth = !converterContext.getManifestWrapper().isPhone();
|
|
2487
2683
|
const enablePaste =
|
|
2488
2684
|
tableSettings.enablePaste !== undefined ? tableSettings.enablePaste : converterContext.getTemplateType() === "ObjectPage"; // Paste is disabled by default excepted for OP
|
|
2685
|
+
const dataStateIndicatorFilter =
|
|
2686
|
+
converterContext.getTemplateType() === TemplateType.ListReport ? "API.dataStateIndicatorFilter" : undefined;
|
|
2489
2687
|
const isCondensedTableLayoutCompliant = checkCondensedLayout && converterContext.getManifestWrapper().isCondensedLayoutCompliant();
|
|
2688
|
+
const oFilterConfiguration = _getFilterConfiguration(tableSettings, lineItemAnnotation, converterContext);
|
|
2689
|
+
const customValidationFunction = tableSettings.creationMode?.customValidationFunction;
|
|
2690
|
+
const condensedTableLayout = tableSettings.condensedTableLayout !== undefined ? tableSettings.condensedTableLayout : false;
|
|
2490
2691
|
const entityType = converterContext.getEntityType();
|
|
2491
2692
|
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
tableSettings?.
|
|
2495
|
-
|
|
2496
|
-
// quickSelectionVariant = converterContext.getEntityTypeAnnotation(path.annotationPath);
|
|
2497
|
-
if (quickSelectionVariant) {
|
|
2498
|
-
quickFilterPaths.push({ annotationPath: path.annotationPath });
|
|
2499
|
-
}
|
|
2500
|
-
filters = {
|
|
2501
|
-
quickFilters: {
|
|
2502
|
-
enabled:
|
|
2503
|
-
converterContext.getTemplateType() === TemplateType.ListReport
|
|
2504
|
-
? "{= ${pageInternal>hasPendingFilters} !== true}"
|
|
2505
|
-
: true,
|
|
2506
|
-
showCounts: tableSettings?.quickVariantSelection?.showCounts,
|
|
2507
|
-
paths: quickFilterPaths
|
|
2508
|
-
}
|
|
2509
|
-
};
|
|
2510
|
-
});
|
|
2511
|
-
creationMode = tableSettings.creationMode?.name || creationMode;
|
|
2512
|
-
createAtEnd = tableSettings.creationMode?.createAtEnd !== undefined ? tableSettings.creationMode?.createAtEnd : true;
|
|
2513
|
-
customValidationFunction = tableSettings.creationMode?.customValidationFunction;
|
|
2514
|
-
// if a custom validation function is provided, disableAddRowButtonForEmptyData should not be considered, i.e. set to false
|
|
2515
|
-
disableAddRowButtonForEmptyData = !customValidationFunction ? !!tableSettings.creationMode?.disableAddRowButtonForEmptyData : false;
|
|
2516
|
-
condensedTableLayout = tableSettings.condensedTableLayout !== undefined ? tableSettings.condensedTableLayout : false;
|
|
2517
|
-
hideTableTitle = !!tableSettings.quickVariantSelection?.hideTableTitle;
|
|
2518
|
-
tableType = tableSettings?.type || "ResponsiveTable";
|
|
2519
|
-
if (converterContext.getTemplateType() !== "ObjectPage") {
|
|
2520
|
-
if (tableSettings?.type === "AnalyticalTable" && !aggregationHelper.isAnalyticsSupported()) {
|
|
2521
|
-
tableType = "GridTable";
|
|
2522
|
-
}
|
|
2523
|
-
if (!tableSettings?.type) {
|
|
2524
|
-
if (converterContext.getManifestWrapper().isDesktop() && aggregationHelper.isAnalyticsSupported()) {
|
|
2525
|
-
tableType = "AnalyticalTable";
|
|
2526
|
-
} else {
|
|
2527
|
-
tableType = "ResponsiveTable";
|
|
2528
|
-
}
|
|
2529
|
-
}
|
|
2530
|
-
}
|
|
2531
|
-
// If enableFullScreen is not set, use as default true on phone and false otherwise
|
|
2532
|
-
enableFullScreen = tableSettings.enableFullScreen ?? converterContext.getManifestWrapper().isPhone();
|
|
2533
|
-
// Make sure that enableFullScreen is not set on ListReport for desktop or tablet
|
|
2534
|
-
if (
|
|
2535
|
-
!converterContext.getManifestWrapper().isPhone() &&
|
|
2536
|
-
enableFullScreen &&
|
|
2537
|
-
converterContext.getTemplateType() === TemplateType.ListReport
|
|
2538
|
-
) {
|
|
2539
|
-
enableFullScreen = false;
|
|
2540
|
-
converterContext
|
|
2541
|
-
.getDiagnostics()
|
|
2542
|
-
.addIssue(IssueCategory.Manifest, IssueSeverity.Low, IssueType.FULLSCREENMODE_NOT_ON_LISTREPORT);
|
|
2543
|
-
}
|
|
2544
|
-
selectionLimit = tableSettings.selectAll === true || tableSettings.selectionLimit === 0 ? 0 : tableSettings.selectionLimit || 200;
|
|
2545
|
-
if (tableType === "ResponsiveTable") {
|
|
2546
|
-
if (
|
|
2547
|
-
converterContext.getTemplateType() === TemplateType.ListReport ||
|
|
2548
|
-
converterContext.getTemplateType() === TemplateType.AnalyticalListPage
|
|
2549
|
-
) {
|
|
2550
|
-
multiSelectMode = !!tableSettings.selectAll ? "Default" : "ClearAll";
|
|
2551
|
-
}
|
|
2552
|
-
if (converterContext.getTemplateType() === TemplateType.ObjectPage) {
|
|
2553
|
-
if (converterContext.getManifestWrapper().useIconTabBar()) {
|
|
2554
|
-
multiSelectMode = !!tableSettings.selectAll ? "Default" : "ClearAll";
|
|
2555
|
-
} else {
|
|
2556
|
-
multiSelectMode = tableSettings.selectAll === false ? "ClearAll" : "Default";
|
|
2557
|
-
}
|
|
2558
|
-
}
|
|
2559
|
-
}
|
|
2560
|
-
enableExport =
|
|
2561
|
-
tableSettings.enableExport !== undefined
|
|
2562
|
-
? tableSettings.enableExport
|
|
2563
|
-
: converterContext.getTemplateType() !== "ObjectPage" || enablePaste;
|
|
2564
|
-
}
|
|
2565
|
-
return {
|
|
2566
|
-
filters: filters,
|
|
2567
|
-
type: tableType,
|
|
2568
|
-
enableFullScreen: enableFullScreen,
|
|
2569
|
-
headerVisible: !(quickSelectionVariant && hideTableTitle),
|
|
2570
|
-
enableExport: enableExport,
|
|
2571
|
-
creationMode: creationMode,
|
|
2572
|
-
createAtEnd: createAtEnd,
|
|
2573
|
-
disableAddRowButtonForEmptyData: disableAddRowButtonForEmptyData,
|
|
2693
|
+
const tableType: TableType = _getTableType(tableSettings, aggregationHelper, converterContext);
|
|
2694
|
+
const oConfiguration = {
|
|
2695
|
+
createAtEnd: tableSettings.creationMode?.createAtEnd !== undefined ? tableSettings.creationMode?.createAtEnd : true,
|
|
2696
|
+
creationMode: tableSettings.creationMode?.name || creationMode,
|
|
2574
2697
|
customValidationFunction: customValidationFunction,
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2698
|
+
dataStateIndicatorFilter: dataStateIndicatorFilter,
|
|
2699
|
+
// if a custom validation function is provided, disableAddRowButtonForEmptyData should not be considered, i.e. set to false
|
|
2700
|
+
disableAddRowButtonForEmptyData: !customValidationFunction ? !!tableSettings.creationMode?.disableAddRowButtonForEmptyData : false,
|
|
2701
|
+
enableAutoColumnWidth: enableAutoColumnWidth,
|
|
2702
|
+
enableExport: _getEnableExport(tableSettings, converterContext, enablePaste),
|
|
2703
|
+
enableFullScreen: _getFullScreenBasedOnDevice(tableSettings, converterContext, converterContext.getManifestWrapper().isPhone()),
|
|
2704
|
+
enableMassEdit: tableSettings?.enableMassEdit,
|
|
2578
2705
|
enablePaste: enablePaste,
|
|
2706
|
+
headerVisible: true,
|
|
2707
|
+
multiSelectMode: _getMultiSelectMode(tableSettings, tableType, converterContext),
|
|
2708
|
+
selectionLimit: tableSettings.selectAll === true || tableSettings.selectionLimit === 0 ? 0 : tableSettings.selectionLimit || 200,
|
|
2709
|
+
|
|
2579
2710
|
showRowCount:
|
|
2580
2711
|
!tableSettings?.quickVariantSelection?.showCounts && !converterContext.getManifestWrapper().getViewConfiguration()?.showCounts,
|
|
2581
|
-
|
|
2582
|
-
|
|
2712
|
+
type: tableType,
|
|
2713
|
+
useCondensedTableLayout: condensedTableLayout && isCondensedTableLayoutCompliant
|
|
2583
2714
|
};
|
|
2715
|
+
|
|
2716
|
+
return { ...oConfiguration, ...oFilterConfiguration };
|
|
2584
2717
|
}
|
|
2585
2718
|
|
|
2586
2719
|
export type configTypeConstraints = {
|
|
@@ -2607,11 +2740,11 @@ export type configType = {
|
|
|
2607
2740
|
|
|
2608
2741
|
export function getTypeConfig(oProperty: Property | DataFieldAbstractTypes, dataType: string | undefined): any {
|
|
2609
2742
|
let oTargetMapping = EDM_TYPE_MAPPING[(oProperty as Property)?.type] || (dataType ? EDM_TYPE_MAPPING[dataType] : undefined);
|
|
2610
|
-
if (!oTargetMapping && (oProperty as Property)
|
|
2743
|
+
if (!oTargetMapping && (oProperty as Property)?.targetType && (oProperty as Property).targetType?._type === "TypeDefinition") {
|
|
2611
2744
|
oTargetMapping = EDM_TYPE_MAPPING[((oProperty as Property).targetType as TypeDefinition).underlyingType];
|
|
2612
2745
|
}
|
|
2613
2746
|
const propertyTypeConfig: configType = {
|
|
2614
|
-
type: oTargetMapping
|
|
2747
|
+
type: oTargetMapping?.type,
|
|
2615
2748
|
constraints: {},
|
|
2616
2749
|
formatOptions: {}
|
|
2617
2750
|
};
|