@sapui5/sap.fe.core 1.100.0 → 1.102.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 +4 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AppComponent.js +23 -30
- package/src/sap/fe/core/AppComponent.ts +35 -40
- package/src/sap/fe/core/AppStateHandler.js +8 -8
- package/src/sap/fe/core/AppStateHandler.ts +11 -11
- package/src/sap/fe/core/BaseController.js +9 -9
- package/src/sap/fe/core/BaseController.ts +3 -4
- package/src/sap/fe/core/CommonUtils.js +122 -101
- package/src/sap/fe/core/CommonUtils.ts +239 -193
- package/src/sap/fe/core/ExtensionAPI.js +12 -13
- package/src/sap/fe/core/ExtensionAPI.ts +21 -31
- package/src/sap/fe/core/PageController.js +19 -13
- package/src/sap/fe/core/PageController.ts +40 -34
- package/src/sap/fe/core/TemplateComponent.js +198 -123
- package/src/sap/fe/core/TemplateComponent.ts +109 -121
- package/src/sap/fe/core/TemplateModel.js +7 -9
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
- package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +935 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +837 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
- package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
- package/src/sap/fe/core/{BusyLocker.js → controllerextensions/BusyLocker.js} +1 -1
- package/src/sap/fe/core/{BusyLocker.ts → controllerextensions/BusyLocker.ts} +7 -7
- package/src/sap/fe/core/controllerextensions/EditFlow.js +660 -288
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +513 -331
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +11 -11
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +6 -7
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +43 -25
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +132 -103
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +16 -16
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +64 -55
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +166 -99
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +187 -149
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +14 -14
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +12 -11
- package/src/sap/fe/core/controllerextensions/MassEdit.js +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +22 -22
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +14 -26
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +20 -30
- package/src/sap/fe/core/controllerextensions/PageReady.js +25 -23
- package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -47
- package/src/sap/fe/core/controllerextensions/Paginator.js +24 -15
- package/src/sap/fe/core/controllerextensions/Paginator.ts +35 -20
- package/src/sap/fe/core/controllerextensions/Placeholder.js +10 -10
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
- package/src/sap/fe/core/controllerextensions/Routing.js +11 -11
- package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
- package/src/sap/fe/core/controllerextensions/Share.js +34 -16
- package/src/sap/fe/core/controllerextensions/Share.ts +50 -32
- package/src/sap/fe/core/controllerextensions/SideEffects.js +15 -15
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +64 -65
- package/src/sap/fe/core/controllerextensions/ViewState.js +27 -31
- package/src/sap/fe/core/controllerextensions/ViewState.ts +103 -102
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +105 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +98 -0
- package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +360 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/ActivitySync.ts +90 -132
- package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/CollaborationCommon.ts +18 -8
- package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/Manage.ts +35 -33
- package/src/sap/fe/core/controllerextensions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/{actions → controllerextensions}/collaboration/UserDetails.fragment.xml +5 -7
- package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +1584 -0
- package/src/sap/fe/core/{TransactionHelper.ts → controllerextensions/editFlow/TransactionHelper.ts} +190 -159
- package/src/sap/fe/core/controllerextensions/editFlow/draft.js +780 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/draft.ts +329 -76
- package/src/sap/fe/core/controllerextensions/editFlow/operations.js +1149 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/operations.ts +169 -97
- package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +190 -0
- package/src/sap/fe/core/{actions → controllerextensions/editFlow}/sticky.ts +76 -12
- package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +592 -0
- package/src/sap/fe/core/{actions → controllerextensions/messageHandler}/messageHandling.ts +83 -60
- package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +940 -0
- package/src/sap/fe/core/{RouterProxy.ts → controllerextensions/routing/RouterProxy.ts} +52 -36
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +21 -18
- package/src/sap/fe/core/controls/Any.js +28 -0
- package/src/sap/fe/core/controls/Any.ts +30 -0
- package/src/sap/fe/core/controls/CommandExecution.js +50 -16
- package/src/sap/fe/core/controls/CommandExecution.ts +31 -22
- package/src/sap/fe/core/controls/ConditionalWrapper.js +136 -65
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +49 -58
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +371 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +282 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +74 -36
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +23 -32
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +52 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +127 -67
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +127 -67
- package/src/sap/fe/core/controls/FieldWrapper.js +171 -87
- package/src/sap/fe/core/controls/FieldWrapper.ts +69 -80
- package/src/sap/fe/core/controls/FileWrapper.js +360 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +202 -0
- package/src/sap/fe/core/controls/FilterBar.js +154 -119
- package/src/sap/fe/core/controls/FilterBar.ts +128 -123
- package/src/sap/fe/core/controls/FormElementWrapper.js +102 -37
- package/src/sap/fe/core/controls/FormElementWrapper.ts +43 -35
- package/src/sap/fe/core/controls/MassEditSelect.js +33 -0
- package/src/sap/fe/core/controls/MassEditSelect.ts +45 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +111 -89
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +86 -82
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -193
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +211 -204
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +152 -116
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +105 -105
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +2 -2
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +23 -28
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +41 -81
- package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +107 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +550 -35
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +604 -35
- package/src/sap/fe/core/converters/ManifestSettings.js +3 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +9 -2
- package/src/sap/fe/core/converters/MetaModelConverter.js +11 -40
- package/src/sap/fe/core/converters/MetaModelConverter.ts +56 -84
- package/src/sap/fe/core/converters/annotations/DataField.js +20 -5
- package/src/sap/fe/core/converters/annotations/DataField.ts +27 -6
- package/src/sap/fe/core/converters/controls/Common/Action.js +14 -21
- package/src/sap/fe/core/converters/controls/Common/Action.ts +23 -28
- package/src/sap/fe/core/converters/controls/Common/Chart.js +17 -10
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +20 -14
- package/src/sap/fe/core/converters/controls/Common/Form.js +16 -18
- package/src/sap/fe/core/converters/controls/Common/Form.ts +20 -20
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -3
- package/src/sap/fe/core/converters/controls/Common/Table.js +389 -173
- package/src/sap/fe/core/converters/controls/Common/Table.ts +440 -244
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +26 -16
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +27 -19
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +78 -47
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +146 -107
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
- package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +30 -25
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +39 -34
- package/src/sap/fe/core/converters/helpers/Aggregation.js +10 -2
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +18 -13
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +3 -2
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +6 -5
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
- package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +27 -24
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +49 -40
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +33 -22
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +77 -62
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +28 -28
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +38 -45
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +3 -3
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +8 -6
- package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +74 -13
- package/src/sap/fe/core/formatters/TableFormatter.ts +71 -16
- package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
- package/src/sap/fe/core/formatters/ValueFormatter.ts +4 -7
- package/src/sap/fe/core/fpm/Component.js +46 -17
- package/src/sap/fe/core/fpm/Component.ts +11 -16
- package/src/sap/fe/core/helpers/AppStartupHelper.js +4 -4
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +3 -3
- package/src/sap/fe/core/helpers/BindingExpression.js +10 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +37 -35
- package/src/sap/fe/core/helpers/ClassSupport.js +273 -256
- package/src/sap/fe/core/helpers/ClassSupport.ts +315 -237
- package/src/sap/fe/core/helpers/FPMHelper.js +3 -2
- package/src/sap/fe/core/helpers/FPMHelper.ts +9 -8
- package/src/sap/fe/core/helpers/MassEditHelper.js +522 -147
- package/src/sap/fe/core/helpers/MassEditHelper.ts +563 -236
- package/src/sap/fe/core/helpers/ModelHelper.js +29 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +39 -26
- package/src/sap/fe/core/helpers/PasteHelper.js +4 -4
- package/src/sap/fe/core/helpers/PasteHelper.ts +4 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +3 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +3 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +1 -1
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +1 -1
- package/src/sap/fe/core/helpers/StableIdHelper.js +5 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +8 -8
- package/src/sap/fe/core/{Synchronization.js → helpers/Synchronization.js} +1 -1
- package/src/sap/fe/core/{Synchronization.ts → helpers/Synchronization.ts} +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
- package/src/sap/fe/core/jsx-runtime/jsx.ts +22 -8
- package/src/sap/fe/core/library.js +13 -5
- package/src/sap/fe/core/library.ts +26 -17
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +1 -1
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +0 -3
- package/src/sap/fe/core/messagebundle.properties +135 -180
- package/src/sap/fe/core/messagebundle_ar.properties +31 -64
- package/src/sap/fe/core/messagebundle_bg.properties +31 -64
- package/src/sap/fe/core/messagebundle_ca.properties +31 -64
- package/src/sap/fe/core/messagebundle_cs.properties +31 -64
- package/src/sap/fe/core/messagebundle_cy.properties +32 -65
- package/src/sap/fe/core/messagebundle_da.properties +31 -64
- package/src/sap/fe/core/messagebundle_de.properties +29 -62
- package/src/sap/fe/core/messagebundle_el.properties +32 -65
- package/src/sap/fe/core/messagebundle_en.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -62
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +41 -74
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +32 -65
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +20 -6
- package/src/sap/fe/core/messagebundle_es.properties +31 -64
- package/src/sap/fe/core/messagebundle_es_MX.properties +31 -64
- package/src/sap/fe/core/messagebundle_et.properties +31 -64
- package/src/sap/fe/core/messagebundle_fi.properties +29 -62
- package/src/sap/fe/core/messagebundle_fr.properties +36 -69
- package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -66
- package/src/sap/fe/core/messagebundle_hi.properties +29 -62
- package/src/sap/fe/core/messagebundle_hr.properties +32 -65
- package/src/sap/fe/core/messagebundle_hu.properties +30 -63
- package/src/sap/fe/core/messagebundle_id.properties +32 -65
- package/src/sap/fe/core/messagebundle_it.properties +31 -64
- package/src/sap/fe/core/messagebundle_iw.properties +31 -64
- package/src/sap/fe/core/messagebundle_ja.properties +29 -62
- package/src/sap/fe/core/messagebundle_kk.properties +31 -64
- package/src/sap/fe/core/messagebundle_ko.properties +31 -64
- package/src/sap/fe/core/messagebundle_lt.properties +31 -64
- package/src/sap/fe/core/messagebundle_lv.properties +32 -65
- package/src/sap/fe/core/messagebundle_ms.properties +31 -64
- package/src/sap/fe/core/messagebundle_nl.properties +31 -64
- package/src/sap/fe/core/messagebundle_no.properties +31 -64
- package/src/sap/fe/core/messagebundle_pl.properties +34 -67
- package/src/sap/fe/core/messagebundle_pt.properties +32 -65
- package/src/sap/fe/core/messagebundle_pt_PT.properties +31 -64
- package/src/sap/fe/core/messagebundle_ro.properties +33 -66
- package/src/sap/fe/core/messagebundle_ru.properties +33 -66
- package/src/sap/fe/core/messagebundle_sh.properties +31 -64
- package/src/sap/fe/core/messagebundle_sk.properties +31 -64
- package/src/sap/fe/core/messagebundle_sl.properties +29 -62
- package/src/sap/fe/core/messagebundle_sv.properties +30 -63
- package/src/sap/fe/core/messagebundle_th.properties +31 -64
- package/src/sap/fe/core/messagebundle_tr.properties +31 -64
- package/src/sap/fe/core/messagebundle_uk.properties +32 -65
- package/src/sap/fe/core/messagebundle_vi.properties +31 -64
- package/src/sap/fe/core/messagebundle_zh_CN.properties +32 -65
- package/src/sap/fe/core/messagebundle_zh_TW.properties +34 -67
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +4 -4
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +5 -5
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +1 -2
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +11 -8
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +15 -13
- package/src/sap/fe/core/services/NavigationServiceFactory.js +5 -5
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +9 -5
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +4 -4
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/RoutingServiceFactory.js +105 -66
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +59 -49
- package/src/sap/fe/core/services/ShellServicesFactory.js +104 -29
- package/src/sap/fe/core/services/ShellServicesFactory.ts +64 -30
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +4 -4
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +11 -10
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +38 -51
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +6 -3
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +0 -3
- package/src/sap/fe/core/templating/DataModelPathHelper.js +2 -9
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +32 -38
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +27 -6
- package/src/sap/fe/core/templating/EntitySetHelper.js +1 -9
- package/src/sap/fe/core/templating/EntitySetHelper.ts +11 -13
- package/src/sap/fe/core/templating/FilterHelper.js +4 -4
- package/src/sap/fe/core/templating/FilterHelper.ts +6 -5
- package/src/sap/fe/core/templating/PropertyHelper.js +70 -33
- package/src/sap/fe/core/templating/PropertyHelper.ts +49 -27
- package/src/sap/fe/core/templating/UIFormatters.js +133 -22
- package/src/sap/fe/core/templating/UIFormatters.ts +144 -50
- package/src/sap/fe/core/type/DateTimeWithTimezone.js +47 -0
- package/src/sap/fe/core/type/DateTimeWithTimezone.ts +23 -0
- package/src/sap/fe/core/type/Email.js +26 -8
- package/src/sap/fe/core/type/Email.ts +8 -7
- package/src/sap/fe/core/AnnotationHelper.js +0 -312
- package/src/sap/fe/core/AnnotationHelper.ts +0 -315
- package/src/sap/fe/core/RouterProxy.js +0 -926
- package/src/sap/fe/core/TransactionHelper.js +0 -1562
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +0 -392
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +0 -136
- package/src/sap/fe/core/actions/collaboration/Manage.js +0 -262
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +0 -103
- package/src/sap/fe/core/actions/draft.js +0 -523
- package/src/sap/fe/core/actions/messageHandling.js +0 -567
- package/src/sap/fe/core/actions/nonDraft.js +0 -20
- package/src/sap/fe/core/actions/nonDraft.ts +0 -12
- package/src/sap/fe/core/actions/operations.js +0 -1096
- package/src/sap/fe/core/actions/sticky.js +0 -130
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -78
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +0 -65
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +0 -77
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +0 -58
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EntityType, Property, TypeDefinition } from "@sap-ux/annotation-converter";
|
|
1
2
|
import {
|
|
2
3
|
CriticalityType,
|
|
3
4
|
DataField,
|
|
@@ -9,45 +10,18 @@ import {
|
|
|
9
10
|
DataPoint,
|
|
10
11
|
DataPointTypeTypes,
|
|
11
12
|
EnumValue,
|
|
13
|
+
FieldGroupType,
|
|
12
14
|
LineItem,
|
|
13
15
|
PathAnnotationExpression,
|
|
14
16
|
PresentationVariantTypeTypes,
|
|
15
17
|
PropertyPath,
|
|
16
18
|
SelectionVariantType,
|
|
17
19
|
SelectOptionType,
|
|
18
|
-
UIAnnotationTypes
|
|
19
|
-
FieldGroupType
|
|
20
|
+
UIAnnotationTypes
|
|
20
21
|
} from "@sap-ux/vocabularies-types";
|
|
21
|
-
import {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
CreationMode,
|
|
25
|
-
FormatOptionsType,
|
|
26
|
-
HorizontalAlign,
|
|
27
|
-
Importance,
|
|
28
|
-
ManifestTableColumn,
|
|
29
|
-
NavigationSettingsConfiguration,
|
|
30
|
-
NavigationTargetConfiguration,
|
|
31
|
-
SelectionMode,
|
|
32
|
-
TableColumnSettings,
|
|
33
|
-
TableManifestConfiguration,
|
|
34
|
-
TableManifestSettingsConfiguration,
|
|
35
|
-
TemplateType,
|
|
36
|
-
VariantManagementType,
|
|
37
|
-
ViewPathConfiguration,
|
|
38
|
-
VisualizationType
|
|
39
|
-
} from "../../ManifestSettings";
|
|
40
|
-
import { EntityType, Property, TypeDefinition } from "@sap-ux/annotation-converter";
|
|
41
|
-
import { TableID } from "../../helpers/ID";
|
|
42
|
-
import {
|
|
43
|
-
AnnotationAction,
|
|
44
|
-
BaseAction,
|
|
45
|
-
CustomAction,
|
|
46
|
-
getActionsFromManifest,
|
|
47
|
-
isActionNavigable,
|
|
48
|
-
removeDuplicateActions
|
|
49
|
-
} from "sap/fe/core/converters/controls/Common/Action";
|
|
50
|
-
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
22
|
+
import { FilterFunctions } from "@sap-ux/vocabularies-types/dist/generated/Capabilities";
|
|
23
|
+
import { CommonAnnotationTerms } from "@sap-ux/vocabularies-types/dist/generated/Common";
|
|
24
|
+
import { SemanticKey } from "@sap-ux/vocabularies-types/types/generated/Common";
|
|
51
25
|
import {
|
|
52
26
|
collectRelatedProperties,
|
|
53
27
|
collectRelatedPropertiesRecursively,
|
|
@@ -58,6 +32,20 @@ import {
|
|
|
58
32
|
isDataFieldForActionAbstract,
|
|
59
33
|
isDataFieldTypes
|
|
60
34
|
} from "sap/fe/core/converters/annotations/DataField";
|
|
35
|
+
import {
|
|
36
|
+
AnnotationAction,
|
|
37
|
+
BaseAction,
|
|
38
|
+
CustomAction,
|
|
39
|
+
getActionsFromManifest,
|
|
40
|
+
isActionNavigable,
|
|
41
|
+
removeDuplicateActions
|
|
42
|
+
} from "sap/fe/core/converters/controls/Common/Action";
|
|
43
|
+
import { bindingContextPathVisitor, Entity, UI } from "sap/fe/core/converters/helpers/BindingHelper";
|
|
44
|
+
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
45
|
+
import { IssueCategory, IssueCategoryType, IssueSeverity, IssueType } from "sap/fe/core/converters/helpers/IssueManager";
|
|
46
|
+
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
47
|
+
import tableFormatters from "sap/fe/core/formatters/TableFormatter";
|
|
48
|
+
import { MessageType } from "sap/fe/core/formatters/TableFormatterTypes";
|
|
61
49
|
import {
|
|
62
50
|
and,
|
|
63
51
|
annotationExpression,
|
|
@@ -76,10 +64,7 @@ import {
|
|
|
76
64
|
or,
|
|
77
65
|
resolveBindingString
|
|
78
66
|
} from "sap/fe/core/helpers/BindingExpression";
|
|
79
|
-
import {
|
|
80
|
-
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
81
|
-
import tableFormatters from "sap/fe/core/formatters/TableFormatter";
|
|
82
|
-
import { MessageType } from "sap/fe/core/formatters/TableFormatterTypes";
|
|
67
|
+
import { replaceSpecialChars } from "sap/fe/core/helpers/StableIdHelper";
|
|
83
68
|
import {
|
|
84
69
|
DataModelObjectPath,
|
|
85
70
|
getTargetObjectPath,
|
|
@@ -87,39 +72,55 @@ import {
|
|
|
87
72
|
isPathSearchable,
|
|
88
73
|
isPathUpdatable
|
|
89
74
|
} from "sap/fe/core/templating/DataModelPathHelper";
|
|
90
|
-
import {
|
|
91
|
-
import {
|
|
92
|
-
|
|
93
|
-
import ManifestWrapper from "../../ManifestWrapper";
|
|
94
|
-
import ConverterContext from "../../ConverterContext";
|
|
75
|
+
import { DisplayMode, EDM_TYPE_MAPPING, getDisplayMode } from "sap/fe/core/templating/DisplayModeFormatter";
|
|
76
|
+
import { getNonSortablePropertiesRestrictions } from "sap/fe/core/templating/EntitySetHelper";
|
|
95
77
|
import {
|
|
96
|
-
isProperty,
|
|
97
|
-
getAssociatedUnitProperty,
|
|
98
78
|
getAssociatedCurrencyProperty,
|
|
79
|
+
getAssociatedTimezoneProperty,
|
|
80
|
+
getAssociatedUnitProperty,
|
|
81
|
+
getTargetValueOnDataPoint,
|
|
99
82
|
isPathExpression,
|
|
100
|
-
|
|
83
|
+
isProperty
|
|
101
84
|
} from "sap/fe/core/templating/PropertyHelper";
|
|
85
|
+
import ConverterContext from "../../ConverterContext";
|
|
102
86
|
import { AggregationHelper } from "../../helpers/Aggregation";
|
|
103
|
-
import {
|
|
87
|
+
import { TableID } from "../../helpers/ID";
|
|
88
|
+
import {
|
|
89
|
+
ActionType,
|
|
90
|
+
AvailabilityType,
|
|
91
|
+
CreationMode,
|
|
92
|
+
FormatOptionsType,
|
|
93
|
+
HorizontalAlign,
|
|
94
|
+
Importance,
|
|
95
|
+
ManifestTableColumn,
|
|
96
|
+
NavigationSettingsConfiguration,
|
|
97
|
+
NavigationTargetConfiguration,
|
|
98
|
+
SelectionMode,
|
|
99
|
+
TableColumnSettings,
|
|
100
|
+
TableManifestConfiguration,
|
|
101
|
+
TableManifestSettingsConfiguration,
|
|
102
|
+
TemplateType,
|
|
103
|
+
VariantManagementType,
|
|
104
|
+
ViewPathConfiguration,
|
|
105
|
+
VisualizationType
|
|
106
|
+
} from "../../ManifestSettings";
|
|
107
|
+
import ManifestWrapper from "../../ManifestWrapper";
|
|
104
108
|
import { getMessageTypeFromCriticalityType } from "./Criticality";
|
|
105
|
-
import { FilterFunctions } from "@sap-ux/vocabularies-types/dist/generated/Capabilities";
|
|
106
|
-
import { SemanticKey } from "@sap-ux/vocabularies-types/types/generated/Common";
|
|
107
|
-
import { getNonSortablePropertiesRestrictions } from "sap/fe/core/templating/EntitySetHelper";
|
|
108
109
|
import {
|
|
109
110
|
generateStandardActionsContext,
|
|
110
|
-
|
|
111
|
+
getCreateVisibility,
|
|
112
|
+
getCreationRow,
|
|
111
113
|
getDeleteVisibility,
|
|
114
|
+
getInsertUpdateActionsTemplating,
|
|
115
|
+
getMassEditVisibility,
|
|
116
|
+
getRestrictions,
|
|
112
117
|
getStandardActionCreate,
|
|
113
118
|
getStandardActionDelete,
|
|
114
|
-
getStandardActionPaste,
|
|
115
119
|
getStandardActionMassEdit,
|
|
120
|
+
getStandardActionPaste,
|
|
116
121
|
isDraftOrStickySupported,
|
|
117
|
-
getInsertUpdateActionsTemplating,
|
|
118
|
-
getCreateVisibility,
|
|
119
122
|
isInDisplayMode,
|
|
120
|
-
|
|
121
|
-
getRestrictions,
|
|
122
|
-
getCreationRow
|
|
123
|
+
StandardActionConfigType
|
|
123
124
|
} from "./table/StandardActions";
|
|
124
125
|
|
|
125
126
|
export type TableAnnotationConfiguration = {
|
|
@@ -135,6 +136,7 @@ export type TableAnnotationConfiguration = {
|
|
|
135
136
|
press?: string;
|
|
136
137
|
rowHighlighting: BindingExpression<MessageType>;
|
|
137
138
|
rowNavigated: BindingExpression<boolean>;
|
|
139
|
+
visible?: BindingExpression<boolean>;
|
|
138
140
|
};
|
|
139
141
|
selectionMode: string | undefined;
|
|
140
142
|
standardActions: {
|
|
@@ -211,6 +213,7 @@ export type TableControlConfiguration = {
|
|
|
211
213
|
enablePaste: boolean;
|
|
212
214
|
enableFullScreen: boolean;
|
|
213
215
|
showRowCount: boolean;
|
|
216
|
+
inlineCreationRowCount?: number;
|
|
214
217
|
enableMassEdit: boolean | undefined;
|
|
215
218
|
enableAutoColumnWidth: boolean;
|
|
216
219
|
dataStateIndicatorFilter: string | undefined;
|
|
@@ -236,6 +239,7 @@ export type BaseTableColumn = ConfigurableObject & {
|
|
|
236
239
|
propertyInfos?: string[];
|
|
237
240
|
caseSensitive?: boolean;
|
|
238
241
|
sortable: boolean;
|
|
242
|
+
isGroupable?: boolean;
|
|
239
243
|
horizontalAlign?: HorizontalAlign;
|
|
240
244
|
formatOptions: FormatOptionsType;
|
|
241
245
|
importance: string;
|
|
@@ -253,26 +257,26 @@ export type AnnotationTableColumn = BaseTableColumn & {
|
|
|
253
257
|
tooltip?: string;
|
|
254
258
|
groupLabel?: string;
|
|
255
259
|
group?: string;
|
|
256
|
-
isGroupable?: boolean;
|
|
257
260
|
FieldGroupHiddenExpressions?: BindingExpression<string>;
|
|
258
261
|
showDataFieldsLabel?: boolean;
|
|
259
262
|
isKey?: boolean;
|
|
260
263
|
unit?: string;
|
|
261
264
|
unitText?: string;
|
|
265
|
+
timezoneText?: string;
|
|
266
|
+
timezone?: string;
|
|
262
267
|
exportSettings?: {
|
|
263
268
|
template?: string;
|
|
264
269
|
label?: string;
|
|
265
|
-
fieldLabel?: string;
|
|
266
270
|
wrap?: boolean;
|
|
267
271
|
type?: string;
|
|
268
272
|
inputFormat?: string;
|
|
269
273
|
format?: string;
|
|
270
274
|
scale?: number;
|
|
271
275
|
delimiter?: boolean;
|
|
272
|
-
trueValue?: boolean;
|
|
273
|
-
falseValue?: boolean;
|
|
274
276
|
unit?: string;
|
|
275
277
|
unitProperty?: string;
|
|
278
|
+
timezone?: string;
|
|
279
|
+
timezoneProperty?: string;
|
|
276
280
|
};
|
|
277
281
|
isDataPointFakeTargetProperty?: boolean;
|
|
278
282
|
textArrangement?: {
|
|
@@ -296,7 +300,7 @@ export type WidthCalculation = null | {
|
|
|
296
300
|
includeLabel?: boolean;
|
|
297
301
|
gap?: number;
|
|
298
302
|
// only relevant for complex types
|
|
299
|
-
excludeProperties?: string
|
|
303
|
+
excludeProperties?: string[];
|
|
300
304
|
verticalArrangement?: boolean;
|
|
301
305
|
};
|
|
302
306
|
|
|
@@ -322,6 +326,8 @@ export type TableVisualization = {
|
|
|
322
326
|
enableAnalyticsSearch?: boolean;
|
|
323
327
|
operationAvailableMap: string;
|
|
324
328
|
operationAvailableProperties: string;
|
|
329
|
+
headerInfoTitle: string;
|
|
330
|
+
semanticKeys: string[];
|
|
325
331
|
};
|
|
326
332
|
|
|
327
333
|
type SorterType = {
|
|
@@ -362,7 +368,8 @@ export function getTableActions(
|
|
|
362
368
|
enableOnSelect: "overwrite",
|
|
363
369
|
enableAutoScroll: "overwrite",
|
|
364
370
|
enabled: "overwrite",
|
|
365
|
-
defaultValuesExtensionFunction: "overwrite"
|
|
371
|
+
defaultValuesExtensionFunction: "overwrite",
|
|
372
|
+
command: "overwrite"
|
|
366
373
|
}
|
|
367
374
|
);
|
|
368
375
|
}
|
|
@@ -411,7 +418,7 @@ export function getTableColumns(
|
|
|
411
418
|
* @param converterContext The converter context.
|
|
412
419
|
* @returns The aggregate definitions from the entityType, or undefined if the entity doesn't support analytical queries.
|
|
413
420
|
*/
|
|
414
|
-
export const getAggregateDefinitionsFromEntityType = function(
|
|
421
|
+
export const getAggregateDefinitionsFromEntityType = function (
|
|
415
422
|
entityType: EntityType,
|
|
416
423
|
tableColumns: TableColumn[],
|
|
417
424
|
converterContext: ConverterContext
|
|
@@ -419,7 +426,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
419
426
|
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
420
427
|
|
|
421
428
|
function findColumnFromPath(path: string): TableColumn | undefined {
|
|
422
|
-
return tableColumns.find(column => {
|
|
429
|
+
return tableColumns.find((column) => {
|
|
423
430
|
const annotationColumn = column as AnnotationTableColumn;
|
|
424
431
|
return annotationColumn.propertyInfos === undefined && annotationColumn.relativePath === path;
|
|
425
432
|
});
|
|
@@ -432,7 +439,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
432
439
|
// Keep a set of all currency/unit properties, as we don't want to consider them as aggregates
|
|
433
440
|
// They are aggregates for technical reasons (to manage multi-units situations) but it doesn't make sense from a user standpoint
|
|
434
441
|
const mCurrencyOrUnitProperties = new Set();
|
|
435
|
-
tableColumns.forEach(oColumn => {
|
|
442
|
+
tableColumns.forEach((oColumn) => {
|
|
436
443
|
const oTableColumn = oColumn as AnnotationTableColumn;
|
|
437
444
|
if (oTableColumn.unit) {
|
|
438
445
|
mCurrencyOrUnitProperties.add(oTableColumn.unit);
|
|
@@ -442,15 +449,15 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
442
449
|
const aCustomAggregateAnnotations = aggregationHelper.getCustomAggregateDefinitions();
|
|
443
450
|
const mRawDefinitions: Record<string, string[]> = {};
|
|
444
451
|
|
|
445
|
-
aCustomAggregateAnnotations.forEach(annotation => {
|
|
446
|
-
const oAggregatedProperty = aggregationHelper._entityType.entityProperties.find(oProperty => {
|
|
452
|
+
aCustomAggregateAnnotations.forEach((annotation) => {
|
|
453
|
+
const oAggregatedProperty = aggregationHelper._entityType.entityProperties.find((oProperty) => {
|
|
447
454
|
return oProperty.name === annotation.qualifier;
|
|
448
455
|
});
|
|
449
456
|
|
|
450
457
|
if (oAggregatedProperty) {
|
|
451
458
|
const aContextDefiningProperties = annotation.annotations?.Aggregation?.ContextDefiningProperties;
|
|
452
459
|
mRawDefinitions[oAggregatedProperty.name] = aContextDefiningProperties
|
|
453
|
-
? aContextDefiningProperties.map(oCtxDefProperty => {
|
|
460
|
+
? aContextDefiningProperties.map((oCtxDefProperty) => {
|
|
454
461
|
return oCtxDefProperty.value;
|
|
455
462
|
})
|
|
456
463
|
: [];
|
|
@@ -458,7 +465,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
458
465
|
});
|
|
459
466
|
const mResult: Record<string, AggregateData> = {};
|
|
460
467
|
|
|
461
|
-
tableColumns.forEach(oColumn => {
|
|
468
|
+
tableColumns.forEach((oColumn) => {
|
|
462
469
|
const oTableColumn = oColumn as AnnotationTableColumn;
|
|
463
470
|
if (oTableColumn.propertyInfos === undefined && oTableColumn.relativePath) {
|
|
464
471
|
const aRawContextDefiningProperties = mRawDefinitions[oTableColumn.relativePath];
|
|
@@ -474,7 +481,7 @@ export const getAggregateDefinitionsFromEntityType = function(
|
|
|
474
481
|
relativePath: oTableColumn.relativePath
|
|
475
482
|
};
|
|
476
483
|
const aContextDefiningProperties: string[] = [];
|
|
477
|
-
aRawContextDefiningProperties.forEach(contextDefiningPropertyName => {
|
|
484
|
+
aRawContextDefiningProperties.forEach((contextDefiningPropertyName) => {
|
|
478
485
|
const oColumn = findColumnFromPath(contextDefiningPropertyName);
|
|
479
486
|
if (oColumn) {
|
|
480
487
|
aContextDefiningProperties.push(oColumn.name);
|
|
@@ -506,18 +513,22 @@ function updateTableVisualizationForAnalytics(
|
|
|
506
513
|
presentationVariantAnnotation?: PresentationVariantTypeTypes
|
|
507
514
|
) {
|
|
508
515
|
if (tableVisualization.control.type === "AnalyticalTable") {
|
|
509
|
-
const aggregatesDefinitions = getAggregateDefinitionsFromEntityType(entityType, tableVisualization.columns, converterContext)
|
|
516
|
+
const aggregatesDefinitions = getAggregateDefinitionsFromEntityType(entityType, tableVisualization.columns, converterContext),
|
|
517
|
+
aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
510
518
|
|
|
511
519
|
if (aggregatesDefinitions) {
|
|
512
520
|
tableVisualization.enableAnalytics = true;
|
|
513
521
|
tableVisualization.aggregates = aggregatesDefinitions;
|
|
514
522
|
|
|
515
|
-
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
516
523
|
const allowedTransformations = aggregationHelper.getAllowedTransformations();
|
|
517
524
|
tableVisualization.enableAnalyticsSearch = allowedTransformations ? allowedTransformations.indexOf("search") >= 0 : true;
|
|
518
525
|
|
|
519
526
|
// Add group and sort conditions from the presentation variant
|
|
520
|
-
tableVisualization.annotation.groupConditions = getGroupConditions(
|
|
527
|
+
tableVisualization.annotation.groupConditions = getGroupConditions(
|
|
528
|
+
presentationVariantAnnotation,
|
|
529
|
+
tableVisualization.columns,
|
|
530
|
+
tableVisualization.control.type
|
|
531
|
+
);
|
|
521
532
|
tableVisualization.annotation.aggregateConditions = getAggregateConditions(
|
|
522
533
|
presentationVariantAnnotation,
|
|
523
534
|
tableVisualization.columns
|
|
@@ -525,6 +536,12 @@ function updateTableVisualizationForAnalytics(
|
|
|
525
536
|
}
|
|
526
537
|
|
|
527
538
|
tableVisualization.control.type = "GridTable"; // AnalyticalTable isn't a real type for the MDC:Table, so we always switch back to Grid
|
|
539
|
+
} else if (tableVisualization.control.type === "ResponsiveTable") {
|
|
540
|
+
tableVisualization.annotation.groupConditions = getGroupConditions(
|
|
541
|
+
presentationVariantAnnotation,
|
|
542
|
+
tableVisualization.columns,
|
|
543
|
+
tableVisualization.control.type
|
|
544
|
+
);
|
|
528
545
|
}
|
|
529
546
|
}
|
|
530
547
|
|
|
@@ -562,18 +579,20 @@ function getNavigationTargetPath(converterContext: ConverterContext, navigationP
|
|
|
562
579
|
*/
|
|
563
580
|
export function updateLinkedProperties(entityType: EntityType, tableColumns: TableColumn[]) {
|
|
564
581
|
function findColumnByPath(path: string): TableColumn | undefined {
|
|
565
|
-
return tableColumns.find(column => {
|
|
582
|
+
return tableColumns.find((column) => {
|
|
566
583
|
const annotationColumn = column as AnnotationTableColumn;
|
|
567
584
|
return annotationColumn.propertyInfos === undefined && annotationColumn.relativePath === path;
|
|
568
585
|
});
|
|
569
586
|
}
|
|
570
587
|
|
|
571
|
-
tableColumns.forEach(oColumn => {
|
|
588
|
+
tableColumns.forEach((oColumn) => {
|
|
572
589
|
const oTableColumn = oColumn as AnnotationTableColumn;
|
|
573
590
|
if (oTableColumn.propertyInfos === undefined && oTableColumn.relativePath) {
|
|
574
591
|
const oProperty = entityType.entityProperties.find((oProp: Property) => oProp.name === oTableColumn.relativePath);
|
|
575
592
|
if (oProperty) {
|
|
576
593
|
const oUnit = getAssociatedCurrencyProperty(oProperty) || getAssociatedUnitProperty(oProperty);
|
|
594
|
+
const oTimezone = getAssociatedTimezoneProperty(oProperty);
|
|
595
|
+
const sTimezone = oProperty?.annotations?.Common?.Timezone;
|
|
577
596
|
if (oUnit) {
|
|
578
597
|
const oUnitColumn = findColumnByPath(oUnit.name);
|
|
579
598
|
oTableColumn.unit = oUnitColumn?.name;
|
|
@@ -583,6 +602,12 @@ export function updateLinkedProperties(entityType: EntityType, tableColumns: Tab
|
|
|
583
602
|
oTableColumn.unitText = `${sUnit}`;
|
|
584
603
|
}
|
|
585
604
|
}
|
|
605
|
+
if (oTimezone) {
|
|
606
|
+
const oTimezoneColumn = findColumnByPath(oTimezone.name);
|
|
607
|
+
oTableColumn.timezone = oTimezoneColumn?.name;
|
|
608
|
+
} else if (sTimezone) {
|
|
609
|
+
oTableColumn.timezoneText = sTimezone.toString();
|
|
610
|
+
}
|
|
586
611
|
|
|
587
612
|
const displayMode = getDisplayMode(oProperty),
|
|
588
613
|
textAnnotation = oProperty.annotations.Common?.Text;
|
|
@@ -600,6 +625,21 @@ export function updateLinkedProperties(entityType: EntityType, tableColumns: Tab
|
|
|
600
625
|
});
|
|
601
626
|
}
|
|
602
627
|
|
|
628
|
+
function getSemanticKeysAndTitleInfo(converterContext: ConverterContext) {
|
|
629
|
+
const headerInfoTitlePath = (converterContext.getAnnotationEntityType()?.annotations?.UI?.HeaderInfo?.Title as DataFieldTypes)?.Value
|
|
630
|
+
?.path;
|
|
631
|
+
const semanticKeyAnnotations: any[] | undefined = converterContext.getAnnotationEntityType()?.annotations?.Common?.SemanticKey;
|
|
632
|
+
|
|
633
|
+
let semanticKeyColumns: string[] = [];
|
|
634
|
+
if (semanticKeyAnnotations) {
|
|
635
|
+
semanticKeyAnnotations.forEach(function (oColumn: any) {
|
|
636
|
+
semanticKeyColumns.push(oColumn.value);
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
return { headerInfoTitlePath, semanticKeyColumns };
|
|
641
|
+
}
|
|
642
|
+
|
|
603
643
|
export function createTableVisualization(
|
|
604
644
|
lineItemAnnotation: LineItem,
|
|
605
645
|
visualizationPath: string,
|
|
@@ -619,7 +659,7 @@ export function createTableVisualization(
|
|
|
619
659
|
const navigationSettings = converterContext.getManifestWrapper().getNavigationConfiguration(navigationTargetPath);
|
|
620
660
|
const columns = getTableColumns(lineItemAnnotation, visualizationPath, converterContext, navigationSettings);
|
|
621
661
|
const operationAvailableMap = getOperationAvailableMap(lineItemAnnotation, converterContext);
|
|
622
|
-
|
|
662
|
+
const semanticKeysAndHeaderInfoTitle = getSemanticKeysAndTitleInfo(converterContext);
|
|
623
663
|
const oVisualization: TableVisualization = {
|
|
624
664
|
type: VisualizationType.Table,
|
|
625
665
|
annotation: getTableAnnotationConfiguration(
|
|
@@ -635,7 +675,9 @@ export function createTableVisualization(
|
|
|
635
675
|
actions: removeDuplicateActions(getTableActions(lineItemAnnotation, visualizationPath, converterContext, navigationSettings)),
|
|
636
676
|
columns: columns,
|
|
637
677
|
operationAvailableMap: JSON.stringify(operationAvailableMap),
|
|
638
|
-
operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext)
|
|
678
|
+
operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext),
|
|
679
|
+
headerInfoTitle: semanticKeysAndHeaderInfoTitle.headerInfoTitlePath,
|
|
680
|
+
semanticKeys: semanticKeysAndHeaderInfoTitle.semanticKeyColumns
|
|
639
681
|
};
|
|
640
682
|
|
|
641
683
|
updateLinkedProperties(converterContext.getAnnotationEntityType(lineItemAnnotation), columns);
|
|
@@ -653,6 +695,7 @@ export function createDefaultTableVisualization(converterContext: ConverterConte
|
|
|
653
695
|
const tableManifestConfig = getTableManifestConfiguration(undefined, "", converterContext, false);
|
|
654
696
|
const columns = getColumnsFromEntityType({}, converterContext.getEntityType(), [], [], converterContext, tableManifestConfig.type);
|
|
655
697
|
const operationAvailableMap = getOperationAvailableMap(undefined, converterContext);
|
|
698
|
+
const semanticKeysAndHeaderInfoTitle = getSemanticKeysAndTitleInfo(converterContext);
|
|
656
699
|
const oVisualization: TableVisualization = {
|
|
657
700
|
type: VisualizationType.Table,
|
|
658
701
|
annotation: getTableAnnotationConfiguration(undefined, "", converterContext, tableManifestConfig, columns),
|
|
@@ -660,7 +703,9 @@ export function createDefaultTableVisualization(converterContext: ConverterConte
|
|
|
660
703
|
actions: [],
|
|
661
704
|
columns: columns,
|
|
662
705
|
operationAvailableMap: JSON.stringify(operationAvailableMap),
|
|
663
|
-
operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext)
|
|
706
|
+
operationAvailableProperties: getOperationAvailableProperties(operationAvailableMap, converterContext),
|
|
707
|
+
headerInfoTitle: semanticKeysAndHeaderInfoTitle.headerInfoTitlePath,
|
|
708
|
+
semanticKeys: semanticKeysAndHeaderInfoTitle.semanticKeyColumns
|
|
664
709
|
};
|
|
665
710
|
|
|
666
711
|
updateLinkedProperties(converterContext.getEntityType(), columns);
|
|
@@ -678,14 +723,14 @@ export function createDefaultTableVisualization(converterContext: ConverterConte
|
|
|
678
723
|
*/
|
|
679
724
|
function getOperationAvailableMap(lineItemAnnotation: LineItem | undefined, converterContext: ConverterContext): Record<string, any> {
|
|
680
725
|
const operationAvailableMap: Record<string, any> = {};
|
|
681
|
-
const addToMap = function(key: string, value: any) {
|
|
726
|
+
const addToMap = function (key: string, value: any) {
|
|
682
727
|
if (key) {
|
|
683
728
|
operationAvailableMap[key] = value;
|
|
684
729
|
}
|
|
685
730
|
};
|
|
686
731
|
|
|
687
732
|
if (lineItemAnnotation) {
|
|
688
|
-
lineItemAnnotation.forEach(dataField => {
|
|
733
|
+
lineItemAnnotation.forEach((dataField) => {
|
|
689
734
|
if (dataField.$Type === UIAnnotationTypes.DataFieldForAction) {
|
|
690
735
|
const actionName = dataField.Action as string;
|
|
691
736
|
if (actionName?.indexOf("/") < 0 && !dataField.Determining) {
|
|
@@ -783,7 +828,7 @@ function getUIHiddenExpForActionsRequiringContext(
|
|
|
783
828
|
isEntitySet: boolean
|
|
784
829
|
): Expression<boolean>[] {
|
|
785
830
|
const aUiHiddenPathExpressions: Expression<boolean>[] = [];
|
|
786
|
-
lineItemAnnotation.forEach(dataField => {
|
|
831
|
+
lineItemAnnotation.forEach((dataField) => {
|
|
787
832
|
// Check if the lineItem context is the same as that of the action:
|
|
788
833
|
if (
|
|
789
834
|
(dataField.$Type === UIAnnotationTypes.DataFieldForAction &&
|
|
@@ -877,7 +922,7 @@ function getBindingExpFromContext(
|
|
|
877
922
|
* @returns {boolean} `true` if there is at least 1 action that meets the criteria
|
|
878
923
|
*/
|
|
879
924
|
function hasBoundActionsAlwaysVisibleInToolBar(lineItemAnnotation: LineItem, currentEntityType: EntityType): boolean {
|
|
880
|
-
return lineItemAnnotation.some(dataField => {
|
|
925
|
+
return lineItemAnnotation.some((dataField) => {
|
|
881
926
|
if (
|
|
882
927
|
(dataField.$Type === UIAnnotationTypes.DataFieldForAction ||
|
|
883
928
|
dataField.$Type === UIAnnotationTypes.DataFieldForIntentBasedNavigation) &&
|
|
@@ -896,7 +941,7 @@ function hasBoundActionsAlwaysVisibleInToolBar(lineItemAnnotation: LineItem, cur
|
|
|
896
941
|
}
|
|
897
942
|
|
|
898
943
|
function hasCustomActionsAlwaysVisibleInToolBar(manifestActions: Record<string, CustomAction>): boolean {
|
|
899
|
-
return Object.keys(manifestActions).some(actionKey => {
|
|
944
|
+
return Object.keys(manifestActions).some((actionKey) => {
|
|
900
945
|
const action = manifestActions[actionKey];
|
|
901
946
|
if (action.requiresSelection && action.visible?.toString() === "true") {
|
|
902
947
|
return true;
|
|
@@ -915,7 +960,7 @@ function hasCustomActionsAlwaysVisibleInToolBar(manifestActions: Record<string,
|
|
|
915
960
|
function getVisibleExpForCustomActionsRequiringContext(manifestActions: Record<string, CustomAction>): Expression<boolean>[] {
|
|
916
961
|
const aVisiblePathExpressions: Expression<boolean>[] = [];
|
|
917
962
|
if (manifestActions) {
|
|
918
|
-
Object.keys(manifestActions).forEach(actionKey => {
|
|
963
|
+
Object.keys(manifestActions).forEach((actionKey) => {
|
|
919
964
|
const action = manifestActions[actionKey];
|
|
920
965
|
if (action.requiresSelection === true && action.visible !== undefined) {
|
|
921
966
|
if (typeof action.visible === "string") {
|
|
@@ -983,7 +1028,7 @@ export function getSelectionMode(
|
|
|
983
1028
|
// Mass Edit in OP is enabled only in edit mode.
|
|
984
1029
|
return compileBinding(
|
|
985
1030
|
ifElse(
|
|
986
|
-
and(
|
|
1031
|
+
and(UI.IsEditable, massEditVisibilityExpression),
|
|
987
1032
|
constant("Multi"),
|
|
988
1033
|
ifElse(deleteButtonVisibilityExpression, constant("Multi"), constant("None"))
|
|
989
1034
|
)
|
|
@@ -1031,11 +1076,7 @@ export function getSelectionMode(
|
|
|
1031
1076
|
massEditVisibilityExpression
|
|
1032
1077
|
);
|
|
1033
1078
|
return compileBinding(
|
|
1034
|
-
ifElse(
|
|
1035
|
-
and(equal(bindingExpression("/editMode", "ui"), "Editable"), buttonVisibilityExpression),
|
|
1036
|
-
constant(selectionMode),
|
|
1037
|
-
constant(SelectionMode.None)
|
|
1038
|
-
)
|
|
1079
|
+
ifElse(and(UI.IsEditable, buttonVisibilityExpression), constant(selectionMode), constant(SelectionMode.None))
|
|
1039
1080
|
);
|
|
1040
1081
|
} else {
|
|
1041
1082
|
return SelectionMode.None;
|
|
@@ -1062,7 +1103,7 @@ export function getSelectionMode(
|
|
|
1062
1103
|
);
|
|
1063
1104
|
return compileBinding(
|
|
1064
1105
|
ifElse(
|
|
1065
|
-
and(
|
|
1106
|
+
and(UI.IsEditable, editModebuttonVisibilityExpression),
|
|
1066
1107
|
constant(selectionMode),
|
|
1067
1108
|
ifElse(
|
|
1068
1109
|
or(...aHiddenBindingExpressions.concat(aVisibleBindingExpressions)),
|
|
@@ -1220,15 +1261,17 @@ function _getCreationBehaviour(
|
|
|
1220
1261
|
lineItemAnnotation: LineItem | undefined,
|
|
1221
1262
|
tableManifestConfiguration: TableControlConfiguration,
|
|
1222
1263
|
converterContext: ConverterContext,
|
|
1223
|
-
navigationSettings: NavigationSettingsConfiguration
|
|
1264
|
+
navigationSettings: NavigationSettingsConfiguration,
|
|
1265
|
+
visualizationPath: string
|
|
1224
1266
|
): TableAnnotationConfiguration["create"] {
|
|
1225
1267
|
const navigation = navigationSettings?.create || navigationSettings?.detail;
|
|
1226
|
-
|
|
1268
|
+
const tableManifestSettings: TableManifestConfiguration = converterContext.getManifestControlConfiguration(visualizationPath);
|
|
1269
|
+
const originalTableSettings = (tableManifestSettings && tableManifestSettings.tableSettings) || {};
|
|
1227
1270
|
// cross-app
|
|
1228
1271
|
if (navigation?.outbound && navigation.outboundDetail && navigationSettings?.create) {
|
|
1229
1272
|
return {
|
|
1230
1273
|
mode: "External",
|
|
1231
|
-
outbound: navigation.outbound
|
|
1274
|
+
outbound: navigation.outbound,
|
|
1232
1275
|
outboundDetail: navigation.outboundDetail,
|
|
1233
1276
|
navigationSettings: navigationSettings
|
|
1234
1277
|
};
|
|
@@ -1238,11 +1281,10 @@ function _getCreationBehaviour(
|
|
|
1238
1281
|
if (lineItemAnnotation) {
|
|
1239
1282
|
// in-app
|
|
1240
1283
|
const targetAnnotations = converterContext.getEntitySet()?.annotations;
|
|
1241
|
-
newAction = targetAnnotations?.Common?.DraftRoot?.NewAction || targetAnnotations?.Session?.StickySessionSupported?.NewAction;
|
|
1284
|
+
newAction = targetAnnotations?.Common?.DraftRoot?.NewAction || targetAnnotations?.Session?.StickySessionSupported?.NewAction;
|
|
1242
1285
|
|
|
1243
1286
|
if (tableManifestConfiguration.creationMode === CreationMode.CreationRow && newAction) {
|
|
1244
1287
|
// A combination of 'CreationRow' and 'NewAction' does not make sense
|
|
1245
|
-
// TODO: Or does it?
|
|
1246
1288
|
throw Error(`Creation mode '${CreationMode.CreationRow}' can not be used with a custom 'new' action (${newAction})`);
|
|
1247
1289
|
}
|
|
1248
1290
|
if (navigation?.route) {
|
|
@@ -1259,6 +1301,10 @@ function _getCreationBehaviour(
|
|
|
1259
1301
|
// no navigation or no route specified - fallback to inline create if original creation mode was 'NewPage'
|
|
1260
1302
|
if (tableManifestConfiguration.creationMode === CreationMode.NewPage) {
|
|
1261
1303
|
tableManifestConfiguration.creationMode = CreationMode.Inline;
|
|
1304
|
+
// In case there was no specific configuration for the createAtEnd we force it to false
|
|
1305
|
+
if (originalTableSettings.creationMode?.createAtEnd === undefined) {
|
|
1306
|
+
tableManifestConfiguration.createAtEnd = false;
|
|
1307
|
+
}
|
|
1262
1308
|
}
|
|
1263
1309
|
|
|
1264
1310
|
return {
|
|
@@ -1268,7 +1314,7 @@ function _getCreationBehaviour(
|
|
|
1268
1314
|
};
|
|
1269
1315
|
}
|
|
1270
1316
|
|
|
1271
|
-
const _getRowConfigurationProperty = function(
|
|
1317
|
+
const _getRowConfigurationProperty = function (
|
|
1272
1318
|
lineItemAnnotation: LineItem | undefined,
|
|
1273
1319
|
visualizationPath: string,
|
|
1274
1320
|
converterContext: ConverterContext,
|
|
@@ -1314,7 +1360,8 @@ const _getRowConfigurationProperty = function(
|
|
|
1314
1360
|
press: pressProperty,
|
|
1315
1361
|
action: pressProperty ? "Navigation" : undefined,
|
|
1316
1362
|
rowHighlighting: compileBinding(criticalityProperty),
|
|
1317
|
-
rowNavigated: compileBinding(rowNavigatedExpression)
|
|
1363
|
+
rowNavigated: compileBinding(rowNavigatedExpression),
|
|
1364
|
+
visible: compileBinding(not(UI.IsInactive))
|
|
1318
1365
|
};
|
|
1319
1366
|
};
|
|
1320
1367
|
|
|
@@ -1329,7 +1376,7 @@ const _getRowConfigurationProperty = function(
|
|
|
1329
1376
|
* @param tableType The table type.
|
|
1330
1377
|
* @returns {AnnotationTableColumn[]} The column from the entityType
|
|
1331
1378
|
*/
|
|
1332
|
-
export const getColumnsFromEntityType = function(
|
|
1379
|
+
export const getColumnsFromEntityType = function (
|
|
1333
1380
|
columnsToBeCreated: Record<string, Property>,
|
|
1334
1381
|
entityType: EntityType,
|
|
1335
1382
|
annotationColumns: AnnotationTableColumn[] = [],
|
|
@@ -1343,7 +1390,7 @@ export const getColumnsFromEntityType = function(
|
|
|
1343
1390
|
|
|
1344
1391
|
entityType.entityProperties.forEach((property: Property) => {
|
|
1345
1392
|
// Catch already existing columns - which were added before by LineItem Annotations
|
|
1346
|
-
const exists = annotationColumns.some(column => {
|
|
1393
|
+
const exists = annotationColumns.some((column) => {
|
|
1347
1394
|
return column.name === property.name;
|
|
1348
1395
|
});
|
|
1349
1396
|
|
|
@@ -1368,10 +1415,11 @@ export const getColumnsFromEntityType = function(
|
|
|
1368
1415
|
aggregationHelper,
|
|
1369
1416
|
converterContext
|
|
1370
1417
|
);
|
|
1371
|
-
|
|
1418
|
+
|
|
1419
|
+
const semanticKeys = converterContext.getAnnotationsByTerm("Common", CommonAnnotationTerms.SemanticKey, [
|
|
1372
1420
|
converterContext.getEntityType()
|
|
1373
1421
|
])[0];
|
|
1374
|
-
const oColumnDraftIndicator = getDefaultDraftIndicatorForColumn(columnInfo.name, semanticKeys);
|
|
1422
|
+
const oColumnDraftIndicator = getDefaultDraftIndicatorForColumn(columnInfo.name, semanticKeys, false, null);
|
|
1375
1423
|
if (Object.keys(oColumnDraftIndicator).length > 0) {
|
|
1376
1424
|
columnInfo.formatOptions = {
|
|
1377
1425
|
...oColumnDraftIndicator
|
|
@@ -1384,6 +1432,7 @@ export const getColumnsFromEntityType = function(
|
|
|
1384
1432
|
template: relatedPropertiesInfo.exportSettingsTemplate,
|
|
1385
1433
|
wrap: relatedPropertiesInfo.exportSettingsWrapping
|
|
1386
1434
|
};
|
|
1435
|
+
columnInfo.exportSettings.type = _getExportDataType(property.type, relatedPropertyNames.length > 1);
|
|
1387
1436
|
|
|
1388
1437
|
if (relatedPropertiesInfo.exportUnitName) {
|
|
1389
1438
|
columnInfo.exportSettings.unitProperty = relatedPropertiesInfo.exportUnitName;
|
|
@@ -1391,9 +1440,14 @@ export const getColumnsFromEntityType = function(
|
|
|
1391
1440
|
} else if (relatedPropertiesInfo.exportUnitString) {
|
|
1392
1441
|
columnInfo.exportSettings.unit = relatedPropertiesInfo.exportUnitString;
|
|
1393
1442
|
}
|
|
1443
|
+
if (relatedPropertiesInfo.exportTimezoneName) {
|
|
1444
|
+
columnInfo.exportSettings.timezoneProperty = relatedPropertiesInfo.exportTimezoneName;
|
|
1445
|
+
} else if (relatedPropertiesInfo.exportTimezoneString) {
|
|
1446
|
+
columnInfo.exportSettings.timezone = relatedPropertiesInfo.exportTimezoneString;
|
|
1447
|
+
}
|
|
1394
1448
|
|
|
1395
1449
|
// Collect information of related columns to be created.
|
|
1396
|
-
relatedPropertyNames.forEach(name => {
|
|
1450
|
+
relatedPropertyNames.forEach((name) => {
|
|
1397
1451
|
columnsToBeCreated[name] = relatedPropertiesInfo.properties[name];
|
|
1398
1452
|
});
|
|
1399
1453
|
}
|
|
@@ -1401,7 +1455,7 @@ export const getColumnsFromEntityType = function(
|
|
|
1401
1455
|
if (additionalPropertyNames.length > 0) {
|
|
1402
1456
|
columnInfo.additionalPropertyInfos = additionalPropertyNames;
|
|
1403
1457
|
// Create columns for additional properties identified for ALP use case.
|
|
1404
|
-
additionalPropertyNames.forEach(name => {
|
|
1458
|
+
additionalPropertyNames.forEach((name) => {
|
|
1405
1459
|
// Intentional overwrite as we require only one new PropertyInfo for a related Property.
|
|
1406
1460
|
columnsToBeCreated[name] = relatedPropertiesInfo.additionalProperties[name];
|
|
1407
1461
|
});
|
|
@@ -1424,7 +1478,7 @@ export const getColumnsFromEntityType = function(
|
|
|
1424
1478
|
* @param {ConverterContext} converterContext The converter context
|
|
1425
1479
|
* @returns {AnnotationTableColumn} The annotation column definition
|
|
1426
1480
|
*/
|
|
1427
|
-
const getColumnDefinitionFromProperty = function(
|
|
1481
|
+
const getColumnDefinitionFromProperty = function (
|
|
1428
1482
|
property: Property,
|
|
1429
1483
|
fullPropertyPath: string,
|
|
1430
1484
|
relativePath: string,
|
|
@@ -1445,6 +1499,10 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1445
1499
|
const sDateInputFormat: string | undefined = property.type === "Edm.Date" ? "YYYY-MM-DD" : undefined;
|
|
1446
1500
|
const dataType: string | undefined = getDataFieldDataType(property);
|
|
1447
1501
|
const propertyTypeConfig = !isDataPointFakeProperty ? getTypeConfig(property, dataType) : undefined;
|
|
1502
|
+
const semanticKeys: SemanticKey = converterContext.getAnnotationsByTerm("Common", CommonAnnotationTerms.SemanticKey, [
|
|
1503
|
+
converterContext.getEntityType()
|
|
1504
|
+
])[0];
|
|
1505
|
+
const sortable = !isHidden && nonSortableColumns.indexOf(relativePath) === -1 && !isDataPointFakeProperty;
|
|
1448
1506
|
const oTypeConfig = !isDataPointFakeProperty
|
|
1449
1507
|
? {
|
|
1450
1508
|
className: property.type || dataType,
|
|
@@ -1460,25 +1518,29 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1460
1518
|
type: exportType,
|
|
1461
1519
|
inputFormat: sDateInputFormat,
|
|
1462
1520
|
scale: property.scale,
|
|
1463
|
-
delimiter: property.type === "Edm.Int64" ? true : false
|
|
1464
|
-
trueValue: property.type === "Edm.Boolean" ? "Yes" : undefined,
|
|
1465
|
-
falseValue: property.type === "Edm.Boolean" ? "No" : undefined
|
|
1521
|
+
delimiter: property.type === "Edm.Int64" ? true : false
|
|
1466
1522
|
};
|
|
1467
1523
|
|
|
1468
1524
|
if (!isDataPointFakeProperty) {
|
|
1469
1525
|
const oUnitProperty = getAssociatedCurrencyProperty(property) || getAssociatedUnitProperty(property);
|
|
1526
|
+
const oTimezoneProperty = getAssociatedTimezoneProperty(property);
|
|
1470
1527
|
const sUnitText = property?.annotations?.Measures?.ISOCurrency || property?.annotations?.Measures?.Unit;
|
|
1528
|
+
const sTimezoneText = property?.annotations?.Common?.Timezone;
|
|
1471
1529
|
if (oUnitProperty) {
|
|
1472
1530
|
exportSettings.unitProperty = oUnitProperty.name;
|
|
1473
1531
|
exportSettings.type = "Currency"; // Force to a currency because there's a unitProperty (otherwise the value isn't properly formatted when exported)
|
|
1474
1532
|
} else if (sUnitText) {
|
|
1475
1533
|
exportSettings.unit = `${sUnitText}`;
|
|
1476
1534
|
}
|
|
1535
|
+
if (oTimezoneProperty) {
|
|
1536
|
+
exportSettings.timezoneProperty = oTimezoneProperty.name;
|
|
1537
|
+
} else if (sTimezoneText) {
|
|
1538
|
+
exportSettings.timezone = sTimezoneText.toString();
|
|
1539
|
+
}
|
|
1477
1540
|
}
|
|
1478
1541
|
|
|
1479
1542
|
const oColumn: any = {
|
|
1480
1543
|
key: key,
|
|
1481
|
-
isGroupable: !isDataPointFakeProperty && !isHidden ? aggregationHelper.isPropertyGroupable(property) : false,
|
|
1482
1544
|
type: ColumnType.Annotation,
|
|
1483
1545
|
label: _getLabel(property, isGroup),
|
|
1484
1546
|
groupLabel: isGroup ? _getLabel(property) : null,
|
|
@@ -1492,13 +1554,15 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1492
1554
|
relativePath: isDataPointFakeProperty
|
|
1493
1555
|
? (property as any).annotations?.UI?.DataFieldDefault?.Target?.$target?.Value?.path || (property as any).Value.path
|
|
1494
1556
|
: relativePath,
|
|
1495
|
-
sortable:
|
|
1557
|
+
sortable: sortable,
|
|
1558
|
+
isGroupable: aggregationHelper.isAnalyticsSupported() ? aggregationHelper.isPropertyGroupable(property) : sortable,
|
|
1496
1559
|
isKey: property.isKey,
|
|
1497
1560
|
isDataPointFakeTargetProperty: isDataPointFakeProperty,
|
|
1498
1561
|
exportSettings: exportSettings,
|
|
1499
1562
|
caseSensitive: isFilteringCaseSensitive(converterContext),
|
|
1500
1563
|
typeConfig: oTypeConfig,
|
|
1501
|
-
visualSettings: isDataPointFakeProperty ? { widthCalculation: null } : undefined
|
|
1564
|
+
visualSettings: isDataPointFakeProperty ? { widthCalculation: null } : undefined,
|
|
1565
|
+
importance: getImportance((property as any).annotations?.UI?.DataFieldDefault, semanticKeys)
|
|
1502
1566
|
};
|
|
1503
1567
|
const sTooltip = _getTooltip(property);
|
|
1504
1568
|
if (sTooltip) {
|
|
@@ -1515,7 +1579,7 @@ const getColumnDefinitionFromProperty = function(
|
|
|
1515
1579
|
* @returns {boolean} True for valid columns, false for invalid columns
|
|
1516
1580
|
* @private
|
|
1517
1581
|
*/
|
|
1518
|
-
const _isValidColumn = function(dataField: DataFieldAbstractTypes) {
|
|
1582
|
+
const _isValidColumn = function (dataField: DataFieldAbstractTypes) {
|
|
1519
1583
|
switch (dataField.$Type) {
|
|
1520
1584
|
case UIAnnotationTypes.DataFieldForAction:
|
|
1521
1585
|
case UIAnnotationTypes.DataFieldForIntentBasedNavigation:
|
|
@@ -1539,11 +1603,12 @@ const _isValidColumn = function(dataField: DataFieldAbstractTypes) {
|
|
|
1539
1603
|
* SAP Fiori elements will evaluate either the UI.Hidden annotation defined on the annotation itself or on the target property.
|
|
1540
1604
|
*
|
|
1541
1605
|
* @param {DataModelObjectPath} dataFieldModelPath The metapath referring to the annotation that is evaluated by SAP Fiori elements.
|
|
1542
|
-
* @param {
|
|
1606
|
+
* @param {object} [formatOptions] FormatOptions optional.
|
|
1607
|
+
* @param {boolean} formatOptions.isAnalytics This flag is used to check if the analytic table has GroupHeader expanded.
|
|
1543
1608
|
* @param {boolean} [returnExpression] ReturnExpression optional.
|
|
1544
1609
|
* @returns {BindingExpression<string>} An expression that you can bind to the UI.
|
|
1545
1610
|
*/
|
|
1546
|
-
export const _getVisibleExpression = function(
|
|
1611
|
+
export const _getVisibleExpression = function (
|
|
1547
1612
|
dataFieldModelPath: DataModelObjectPath,
|
|
1548
1613
|
formatOptions?: any,
|
|
1549
1614
|
returnExpression: boolean = false
|
|
@@ -1586,17 +1651,18 @@ export const _getVisibleExpression = function(
|
|
|
1586
1651
|
or(not(isAnalyticalGroupHeaderExpanded), isAnalyticalLeaf)
|
|
1587
1652
|
]
|
|
1588
1653
|
);
|
|
1589
|
-
return returnExpression ? (
|
|
1654
|
+
return returnExpression ? (expression as any as BindingExpression<string>) : compileBinding(expression);
|
|
1590
1655
|
};
|
|
1591
1656
|
|
|
1592
1657
|
/**
|
|
1593
1658
|
* Returns hidden binding expressions for a field group.
|
|
1594
1659
|
* @param {DataFieldAbstractTypes} dataFieldGroup DataField defined in the annotations
|
|
1595
|
-
* @param {
|
|
1660
|
+
* @param {object} fieldFormatOptions FormatOptions optional.
|
|
1661
|
+
* @param {boolean} fieldFormatOptions.isAnalytics This flag is used to check if the analytic table has GroupHeader expanded.
|
|
1596
1662
|
* @returns {BindingExpression<string>} Compile binding of field group expressions.
|
|
1597
1663
|
* @private
|
|
1598
1664
|
*/
|
|
1599
|
-
const _getFieldGroupHiddenExpressions = function(
|
|
1665
|
+
const _getFieldGroupHiddenExpressions = function (
|
|
1600
1666
|
dataFieldGroup: DataFieldAbstractTypes,
|
|
1601
1667
|
fieldFormatOptions: any
|
|
1602
1668
|
): BindingExpression<string> | undefined {
|
|
@@ -1611,7 +1677,7 @@ const _getFieldGroupHiddenExpressions = function(
|
|
|
1611
1677
|
);
|
|
1612
1678
|
});
|
|
1613
1679
|
return compileBinding(
|
|
1614
|
-
ifElse(or(...(
|
|
1680
|
+
ifElse(or(...(aFieldGroupHiddenExpressions as any as ExpressionOrPrimitive<boolean>[])), constant(true), constant(false))
|
|
1615
1681
|
);
|
|
1616
1682
|
} else {
|
|
1617
1683
|
return undefined;
|
|
@@ -1625,7 +1691,7 @@ const _getFieldGroupHiddenExpressions = function(
|
|
|
1625
1691
|
* @returns {string} Label of the property or DataField
|
|
1626
1692
|
* @private
|
|
1627
1693
|
*/
|
|
1628
|
-
const _getLabel = function(property: DataFieldAbstractTypes | Property, isGroup: boolean = false): string | undefined {
|
|
1694
|
+
const _getLabel = function (property: DataFieldAbstractTypes | Property, isGroup: boolean = false): string | undefined {
|
|
1629
1695
|
if (!property) {
|
|
1630
1696
|
return undefined;
|
|
1631
1697
|
}
|
|
@@ -1655,7 +1721,7 @@ const _getLabel = function(property: DataFieldAbstractTypes | Property, isGroup:
|
|
|
1655
1721
|
}
|
|
1656
1722
|
};
|
|
1657
1723
|
|
|
1658
|
-
const _getTooltip = function(source: DataFieldAbstractTypes | Property): string | undefined {
|
|
1724
|
+
const _getTooltip = function (source: DataFieldAbstractTypes | Property): string | undefined {
|
|
1659
1725
|
if (!source) {
|
|
1660
1726
|
return undefined;
|
|
1661
1727
|
}
|
|
@@ -1693,7 +1759,7 @@ export function getRowStatusVisibility(): Expression<boolean> {
|
|
|
1693
1759
|
* @param entityType The entity type for the LineItem
|
|
1694
1760
|
* @returns {AnnotationTableColumn[]} The array of columns created.
|
|
1695
1761
|
*/
|
|
1696
|
-
const _createRelatedColumns = function(
|
|
1762
|
+
const _createRelatedColumns = function (
|
|
1697
1763
|
columnsToBeCreated: Record<string, Property>,
|
|
1698
1764
|
existingColumns: AnnotationTableColumn[],
|
|
1699
1765
|
nonSortableColumns: string[],
|
|
@@ -1704,11 +1770,11 @@ const _createRelatedColumns = function(
|
|
|
1704
1770
|
const relatedPropertyNameMap: Record<string, string> = {};
|
|
1705
1771
|
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
1706
1772
|
|
|
1707
|
-
Object.keys(columnsToBeCreated).forEach(name => {
|
|
1773
|
+
Object.keys(columnsToBeCreated).forEach((name) => {
|
|
1708
1774
|
const property = columnsToBeCreated[name],
|
|
1709
1775
|
annotationPath = converterContext.getAbsoluteAnnotationPath(name),
|
|
1710
1776
|
// Check whether the related column already exists.
|
|
1711
|
-
relatedColumn = existingColumns.find(column => column.name === name);
|
|
1777
|
+
relatedColumn = existingColumns.find((column) => column.name === name);
|
|
1712
1778
|
if (relatedColumn === undefined) {
|
|
1713
1779
|
// Case 1: Key contains DataField prefix to ensure all property columns have the same key format.
|
|
1714
1780
|
// New created property column is set to hidden.
|
|
@@ -1735,7 +1801,7 @@ const _createRelatedColumns = function(
|
|
|
1735
1801
|
const newName = "Property::" + name;
|
|
1736
1802
|
|
|
1737
1803
|
// Checking whether the related property column has already been created in a previous iteration.
|
|
1738
|
-
if (!existingColumns.some(column => column.name === newName)) {
|
|
1804
|
+
if (!existingColumns.some((column) => column.name === newName)) {
|
|
1739
1805
|
// Create a new property column with 'Property::' prefix,
|
|
1740
1806
|
// Set it to hidden as it is only consumed by Complex property infos.
|
|
1741
1807
|
relatedColumns.push(
|
|
@@ -1757,10 +1823,10 @@ const _createRelatedColumns = function(
|
|
|
1757
1823
|
|
|
1758
1824
|
// The property 'name' has been prefixed with 'Property::' for uniqueness.
|
|
1759
1825
|
// Update the same in other propertyInfos[] references which point to this property.
|
|
1760
|
-
existingColumns.forEach(column => {
|
|
1761
|
-
column.propertyInfos = column.propertyInfos?.map(propertyInfo => relatedPropertyNameMap[propertyInfo] ?? propertyInfo);
|
|
1826
|
+
existingColumns.forEach((column) => {
|
|
1827
|
+
column.propertyInfos = column.propertyInfos?.map((propertyInfo) => relatedPropertyNameMap[propertyInfo] ?? propertyInfo);
|
|
1762
1828
|
column.additionalPropertyInfos = column.additionalPropertyInfos?.map(
|
|
1763
|
-
propertyInfo => relatedPropertyNameMap[propertyInfo] ?? propertyInfo
|
|
1829
|
+
(propertyInfo) => relatedPropertyNameMap[propertyInfo] ?? propertyInfo
|
|
1764
1830
|
);
|
|
1765
1831
|
});
|
|
1766
1832
|
|
|
@@ -1776,7 +1842,7 @@ const _createRelatedColumns = function(
|
|
|
1776
1842
|
* @returns {string} The name of annotation columns
|
|
1777
1843
|
* @private
|
|
1778
1844
|
*/
|
|
1779
|
-
const _getAnnotationColumnName = function(dataField: DataFieldAbstractTypes) {
|
|
1845
|
+
const _getAnnotationColumnName = function (dataField: DataFieldAbstractTypes) {
|
|
1780
1846
|
// This is needed as we have flexibility changes already that we have to check against
|
|
1781
1847
|
if (isDataFieldTypes(dataField)) {
|
|
1782
1848
|
return dataField.Value?.path;
|
|
@@ -1796,12 +1862,12 @@ const _getAnnotationColumnName = function(dataField: DataFieldAbstractTypes) {
|
|
|
1796
1862
|
* @returns {boolean} `showDataFieldsLabel` value from the manifest
|
|
1797
1863
|
* @private
|
|
1798
1864
|
*/
|
|
1799
|
-
const _getShowDataFieldsLabel = function(fieldGroupName: string, visualizationPath: string, converterContext: ConverterContext): boolean {
|
|
1865
|
+
const _getShowDataFieldsLabel = function (fieldGroupName: string, visualizationPath: string, converterContext: ConverterContext): boolean {
|
|
1800
1866
|
const oColumns = converterContext.getManifestControlConfiguration(visualizationPath)?.columns;
|
|
1801
1867
|
const aColumnKeys = oColumns && Object.keys(oColumns);
|
|
1802
1868
|
return (
|
|
1803
1869
|
aColumnKeys &&
|
|
1804
|
-
!!aColumnKeys.find(function(key: string) {
|
|
1870
|
+
!!aColumnKeys.find(function (key: string) {
|
|
1805
1871
|
return key === fieldGroupName && oColumns[key].showDataFieldsLabel;
|
|
1806
1872
|
})
|
|
1807
1873
|
);
|
|
@@ -1812,7 +1878,7 @@ const _getShowDataFieldsLabel = function(fieldGroupName: string, visualizationPa
|
|
|
1812
1878
|
* @param dataField The `DataField` being processed.
|
|
1813
1879
|
* @returns {string} The relative path
|
|
1814
1880
|
*/
|
|
1815
|
-
const _getRelativePath = function(dataField: DataFieldAbstractTypes): string {
|
|
1881
|
+
const _getRelativePath = function (dataField: DataFieldAbstractTypes): string {
|
|
1816
1882
|
let relativePath: string = "";
|
|
1817
1883
|
|
|
1818
1884
|
switch (dataField.$Type) {
|
|
@@ -1837,7 +1903,7 @@ const _getRelativePath = function(dataField: DataFieldAbstractTypes): string {
|
|
|
1837
1903
|
return relativePath;
|
|
1838
1904
|
};
|
|
1839
1905
|
|
|
1840
|
-
const _sliceAtSlash = function(path: string, isLastSlash: boolean, isLastPart: boolean) {
|
|
1906
|
+
const _sliceAtSlash = function (path: string, isLastSlash: boolean, isLastPart: boolean) {
|
|
1841
1907
|
const iSlashIndex = isLastSlash ? path.lastIndexOf("/") : path.indexOf("/");
|
|
1842
1908
|
|
|
1843
1909
|
if (iSlashIndex === -1) {
|
|
@@ -1854,7 +1920,7 @@ const _sliceAtSlash = function(path: string, isLastSlash: boolean, isLastPart: b
|
|
|
1854
1920
|
* @param nonSortableColumns Collection of non-sortable column names as per annotation
|
|
1855
1921
|
* @returns {boolean} True if the column is sortable
|
|
1856
1922
|
*/
|
|
1857
|
-
const _isColumnSortable = function(dataField: DataFieldAbstractTypes, propertyPath: string, nonSortableColumns: string[]): boolean {
|
|
1923
|
+
const _isColumnSortable = function (dataField: DataFieldAbstractTypes, propertyPath: string, nonSortableColumns: string[]): boolean {
|
|
1858
1924
|
let isSortable: boolean = false;
|
|
1859
1925
|
if (nonSortableColumns.indexOf(propertyPath) === -1) {
|
|
1860
1926
|
// Column is not marked as non-sortable via annotation
|
|
@@ -1880,7 +1946,7 @@ const _isColumnSortable = function(dataField: DataFieldAbstractTypes, propertyPa
|
|
|
1880
1946
|
* @param {ConverterContext} converterContext The instance of the converter context
|
|
1881
1947
|
* @returns {boolean} Returns 'false' if FilterFunctions annotation supports 'tolower', else 'true'
|
|
1882
1948
|
*/
|
|
1883
|
-
export const isFilteringCaseSensitive = function(converterContext: ConverterContext): boolean {
|
|
1949
|
+
export const isFilteringCaseSensitive = function (converterContext: ConverterContext): boolean {
|
|
1884
1950
|
const filterFunctions: FilterFunctions | undefined =
|
|
1885
1951
|
converterContext.getEntitySet()?.annotations?.Capabilities?.FilterFunctions ||
|
|
1886
1952
|
converterContext.getEntityContainer().annotations?.Capabilities?.FilterFunctions;
|
|
@@ -1898,93 +1964,197 @@ function getDefaultFormatOptionsForTable(): FormatOptionsType {
|
|
|
1898
1964
|
};
|
|
1899
1965
|
}
|
|
1900
1966
|
|
|
1967
|
+
function _findSemanticKeyValues(semanticKeys: any[], name: string): any {
|
|
1968
|
+
const aSemanticKeyValues: string[] = [];
|
|
1969
|
+
let bSemanticKeyFound = false;
|
|
1970
|
+
for (let i = 0; i < semanticKeys.length; i++) {
|
|
1971
|
+
aSemanticKeyValues.push(semanticKeys[i].value);
|
|
1972
|
+
if (semanticKeys[i].value === name) {
|
|
1973
|
+
bSemanticKeyFound = true;
|
|
1974
|
+
}
|
|
1975
|
+
}
|
|
1976
|
+
return {
|
|
1977
|
+
values: aSemanticKeyValues,
|
|
1978
|
+
semanticKeyFound: bSemanticKeyFound
|
|
1979
|
+
};
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
function _findProperties(semanticKeyValues: any[], fieldGroupProperties: any[]) {
|
|
1983
|
+
let semanticKeyHasPropertyInFieldGroup = false;
|
|
1984
|
+
let sPropertyPath;
|
|
1985
|
+
if (semanticKeyValues && semanticKeyValues.length >= 1 && fieldGroupProperties && fieldGroupProperties.length >= 1) {
|
|
1986
|
+
for (let i = 0; i < semanticKeyValues.length; i++) {
|
|
1987
|
+
if ([semanticKeyValues[i]].some((tmp) => fieldGroupProperties.indexOf(tmp) >= 0)) {
|
|
1988
|
+
semanticKeyHasPropertyInFieldGroup = true;
|
|
1989
|
+
sPropertyPath = semanticKeyValues[i];
|
|
1990
|
+
break;
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
return {
|
|
1995
|
+
semanticKeyHasPropertyInFieldGroup: semanticKeyHasPropertyInFieldGroup,
|
|
1996
|
+
fieldGroupPropertyPath: sPropertyPath
|
|
1997
|
+
};
|
|
1998
|
+
}
|
|
1999
|
+
|
|
2000
|
+
function _findSemanticKeyValuesInFieldGroup(dataFieldGroup: DataFieldAbstractTypes | null, semanticKeyValues: []): any {
|
|
2001
|
+
const aProperties: any[] = [];
|
|
2002
|
+
let _propertiesFound: { semanticKeyHasPropertyInFieldGroup: boolean; fieldGroupPropertyPath: any } = {
|
|
2003
|
+
semanticKeyHasPropertyInFieldGroup: false,
|
|
2004
|
+
fieldGroupPropertyPath: undefined
|
|
2005
|
+
};
|
|
2006
|
+
if (
|
|
2007
|
+
dataFieldGroup &&
|
|
2008
|
+
dataFieldGroup.$Type === UIAnnotationTypes.DataFieldForAnnotation &&
|
|
2009
|
+
dataFieldGroup.Target?.$target?.$Type === UIAnnotationTypes.FieldGroupType
|
|
2010
|
+
) {
|
|
2011
|
+
dataFieldGroup.Target.$target.Data?.forEach((innerDataField: DataFieldAbstractTypes) => {
|
|
2012
|
+
if (
|
|
2013
|
+
(innerDataField.$Type === UIAnnotationTypes.DataField || innerDataField.$Type === UIAnnotationTypes.DataFieldWithUrl) &&
|
|
2014
|
+
innerDataField.Value
|
|
2015
|
+
) {
|
|
2016
|
+
aProperties.push(innerDataField.Value.path);
|
|
2017
|
+
}
|
|
2018
|
+
_propertiesFound = _findProperties(semanticKeyValues, aProperties);
|
|
2019
|
+
});
|
|
2020
|
+
}
|
|
2021
|
+
return {
|
|
2022
|
+
semanticKeyHasPropertyInFieldGroup: _propertiesFound.semanticKeyHasPropertyInFieldGroup,
|
|
2023
|
+
propertyPath: _propertiesFound.fieldGroupPropertyPath
|
|
2024
|
+
};
|
|
2025
|
+
}
|
|
2026
|
+
|
|
1901
2027
|
/**
|
|
1902
2028
|
* Returns default format options with draftIndicator for a column.
|
|
1903
2029
|
* @param name
|
|
1904
2030
|
* @param semanticKeys
|
|
2031
|
+
* @param isFieldGroupColumn
|
|
2032
|
+
* @param dataFieldGroup
|
|
1905
2033
|
* @returns {FormatOptionsType} Collection of format options with default values
|
|
1906
2034
|
*/
|
|
1907
|
-
function getDefaultDraftIndicatorForColumn(
|
|
1908
|
-
|
|
1909
|
-
|
|
2035
|
+
function getDefaultDraftIndicatorForColumn(
|
|
2036
|
+
name: string,
|
|
2037
|
+
semanticKeys: any[],
|
|
2038
|
+
isFieldGroupColumn: boolean,
|
|
2039
|
+
dataFieldGroup: DataFieldAbstractTypes | null
|
|
2040
|
+
) {
|
|
1910
2041
|
if (!semanticKeys) {
|
|
1911
2042
|
return {};
|
|
1912
2043
|
}
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
bSemanticKeyFound = true;
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
if (bSemanticKeyFound) {
|
|
2044
|
+
const semanticKey = _findSemanticKeyValues(semanticKeys, name);
|
|
2045
|
+
const semanticKeyInFieldGroup = _findSemanticKeyValuesInFieldGroup(dataFieldGroup, semanticKey.values);
|
|
2046
|
+
if (semanticKey.semanticKeyFound) {
|
|
1920
2047
|
return {
|
|
1921
2048
|
hasDraftIndicator: true,
|
|
1922
|
-
semantickeys:
|
|
2049
|
+
semantickeys: semanticKey.values,
|
|
1923
2050
|
objectStatusTextVisibility: compileBinding(getRowStatusVisibility())
|
|
1924
2051
|
};
|
|
1925
2052
|
} else {
|
|
1926
|
-
|
|
2053
|
+
if (!semanticKeyInFieldGroup.semanticKeyHasPropertyInFieldGroup) {
|
|
2054
|
+
return {};
|
|
2055
|
+
} else {
|
|
2056
|
+
// Semantic Key has a property in a FieldGroup
|
|
2057
|
+
return {
|
|
2058
|
+
FieldGroupDraftIndicatorPropertyPath: semanticKeyInFieldGroup.propertyPath,
|
|
2059
|
+
FieldGroupName: name
|
|
2060
|
+
};
|
|
2061
|
+
}
|
|
1927
2062
|
}
|
|
1928
2063
|
}
|
|
1929
2064
|
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
function _getAnnotationImportance(lineItem: DataFieldAbstractTypes, semanticKeys: SemanticKey): Importance {
|
|
1939
|
-
switch (lineItem.annotations?.UI?.Importance) {
|
|
1940
|
-
case "UI.ImportanceType/High":
|
|
1941
|
-
return Importance.High;
|
|
1942
|
-
case "UI.ImportanceType/Medium":
|
|
1943
|
-
return Importance.Medium;
|
|
1944
|
-
case "UI.ImportanceType/Low":
|
|
1945
|
-
return Importance.Low;
|
|
1946
|
-
default:
|
|
1947
|
-
return _getDefaultAnnotationImportance(lineItem, semanticKeys);
|
|
2065
|
+
function _getImpNumber(dataField: DataFieldTypes): number {
|
|
2066
|
+
const importance = dataField?.annotations?.UI?.Importance as string;
|
|
2067
|
+
|
|
2068
|
+
if (importance && importance.includes("UI.ImportanceType/High")) {
|
|
2069
|
+
return 3;
|
|
2070
|
+
}
|
|
2071
|
+
if (importance && importance.includes("UI.ImportanceType/Medium")) {
|
|
2072
|
+
return 2;
|
|
1948
2073
|
}
|
|
2074
|
+
if (importance && importance.includes("UI.ImportanceType/Low")) {
|
|
2075
|
+
return 1;
|
|
2076
|
+
}
|
|
2077
|
+
return 0;
|
|
2078
|
+
}
|
|
2079
|
+
|
|
2080
|
+
function _getDataFieldImportance(dataField: DataFieldTypes): Importance {
|
|
2081
|
+
const importance = dataField?.annotations?.UI?.Importance as string;
|
|
2082
|
+
return importance ? (importance.split("/")[1] as Importance) : Importance.None;
|
|
2083
|
+
}
|
|
2084
|
+
|
|
2085
|
+
function _getMaxImportance(fields: DataFieldTypes[]): Importance {
|
|
2086
|
+
if (fields && fields.length > 0) {
|
|
2087
|
+
let maxImpNumber = -1;
|
|
2088
|
+
let impNumber = -1;
|
|
2089
|
+
let DataFieldWithMaxImportance;
|
|
2090
|
+
for (const field of fields) {
|
|
2091
|
+
impNumber = _getImpNumber(field);
|
|
2092
|
+
if (impNumber > maxImpNumber) {
|
|
2093
|
+
maxImpNumber = impNumber;
|
|
2094
|
+
DataFieldWithMaxImportance = field;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
return _getDataFieldImportance(DataFieldWithMaxImportance as DataFieldTypes);
|
|
2098
|
+
}
|
|
2099
|
+
return Importance.None;
|
|
1949
2100
|
}
|
|
1950
2101
|
|
|
1951
2102
|
/**
|
|
1952
|
-
* Returns the
|
|
2103
|
+
* Returns the importance value for a column.
|
|
1953
2104
|
*
|
|
1954
|
-
* @param
|
|
2105
|
+
* @param dataField
|
|
1955
2106
|
* @param semanticKeys
|
|
1956
2107
|
* @returns {Importance} The importance value
|
|
1957
2108
|
*/
|
|
1958
|
-
function
|
|
2109
|
+
export function getImportance(dataField: DataFieldAbstractTypes, semanticKeys: SemanticKey): Importance | undefined {
|
|
2110
|
+
//Evaluate default Importance is not set explicitly
|
|
2111
|
+
let fieldsWithImportance, mapSemanticKeys: any;
|
|
1959
2112
|
//Check if semanticKeys are defined at the EntitySet level
|
|
1960
|
-
if (
|
|
1961
|
-
|
|
2113
|
+
if (semanticKeys && semanticKeys.length > 0) {
|
|
2114
|
+
mapSemanticKeys = semanticKeys.map(function (key) {
|
|
2115
|
+
return key.value;
|
|
2116
|
+
});
|
|
1962
2117
|
}
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
2118
|
+
if (!dataField) {
|
|
2119
|
+
return undefined;
|
|
2120
|
+
}
|
|
2121
|
+
if (dataField.$Type === UIAnnotationTypes.DataFieldForAnnotation) {
|
|
2122
|
+
const fieldGroupData = (dataField as any).Target["$target"]["Data"] as FieldGroupType,
|
|
2123
|
+
fieldGroupHasSemanticKey =
|
|
2124
|
+
fieldGroupData &&
|
|
2125
|
+
(fieldGroupData as any).some(function (fieldGroupDataField: DataFieldAbstractTypes) {
|
|
2126
|
+
return (
|
|
2127
|
+
(fieldGroupDataField as unknown as DataFieldTypes)?.Value?.path &&
|
|
2128
|
+
fieldGroupDataField.$Type !== UIAnnotationTypes.DataFieldForAnnotation &&
|
|
2129
|
+
mapSemanticKeys &&
|
|
2130
|
+
mapSemanticKeys.includes((fieldGroupDataField as unknown as DataFieldTypes)?.Value?.path)
|
|
2131
|
+
);
|
|
2132
|
+
});
|
|
1967
2133
|
//If a FieldGroup contains a semanticKey, importance set to High
|
|
1968
|
-
if (
|
|
1969
|
-
return
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
:
|
|
2134
|
+
if (fieldGroupHasSemanticKey) {
|
|
2135
|
+
return Importance.High;
|
|
2136
|
+
} else {
|
|
2137
|
+
//If the DataFieldForAnnotation has an Importance we take it
|
|
2138
|
+
if (dataField?.annotations?.UI?.Importance) {
|
|
2139
|
+
return _getDataFieldImportance(dataField as unknown as DataFieldTypes);
|
|
2140
|
+
}
|
|
2141
|
+
// else the highest importance (if any) is returned
|
|
2142
|
+
fieldsWithImportance =
|
|
2143
|
+
fieldGroupData &&
|
|
2144
|
+
(fieldGroupData as any).filter(function (item: DataFieldTypes) {
|
|
2145
|
+
return item?.annotations?.UI?.Importance;
|
|
2146
|
+
});
|
|
2147
|
+
return _getMaxImportance(fieldsWithImportance as DataFieldTypes[]);
|
|
1979
2148
|
}
|
|
2149
|
+
//If the current field is a semanticKey, importance set to High
|
|
1980
2150
|
}
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
2151
|
+
return (dataField as DataFieldTypes).Value &&
|
|
2152
|
+
(dataField as DataFieldTypes)?.Value?.path &&
|
|
2153
|
+
mapSemanticKeys &&
|
|
2154
|
+
mapSemanticKeys.includes((dataField as DataFieldTypes).Value.path)
|
|
1984
2155
|
? Importance.High
|
|
1985
|
-
:
|
|
2156
|
+
: _getDataFieldImportance(dataField as unknown as DataFieldTypes);
|
|
1986
2157
|
}
|
|
1987
|
-
|
|
1988
2158
|
/**
|
|
1989
2159
|
* Returns line items from metadata annotations.
|
|
1990
2160
|
*
|
|
@@ -1993,7 +2163,7 @@ function _getDefaultAnnotationImportance(lineItem: DataFieldAbstractTypes, seman
|
|
|
1993
2163
|
* @param {ConverterContext} converterContext The converter context
|
|
1994
2164
|
* @returns {TableColumn[]} The columns from the annotations
|
|
1995
2165
|
*/
|
|
1996
|
-
const getColumnsFromAnnotations = function(
|
|
2166
|
+
const getColumnsFromAnnotations = function (
|
|
1997
2167
|
lineItemAnnotation: LineItem,
|
|
1998
2168
|
visualizationPath: string,
|
|
1999
2169
|
converterContext: ConverterContext
|
|
@@ -2004,11 +2174,11 @@ const getColumnsFromAnnotations = function(
|
|
|
2004
2174
|
nonSortableColumns: string[] = getNonSortablePropertiesRestrictions(converterContext.getEntitySet()),
|
|
2005
2175
|
tableManifestSettings: TableManifestConfiguration = converterContext.getManifestControlConfiguration(visualizationPath),
|
|
2006
2176
|
tableType: TableType = tableManifestSettings?.tableSettings?.type || "ResponsiveTable";
|
|
2007
|
-
const semanticKeys: SemanticKey = converterContext.getAnnotationsByTerm("Common",
|
|
2177
|
+
const semanticKeys: SemanticKey = converterContext.getAnnotationsByTerm("Common", CommonAnnotationTerms.SemanticKey, [
|
|
2008
2178
|
converterContext.getEntityType()
|
|
2009
2179
|
])[0];
|
|
2010
2180
|
if (lineItemAnnotation) {
|
|
2011
|
-
lineItemAnnotation.forEach(lineItem => {
|
|
2181
|
+
lineItemAnnotation.forEach((lineItem) => {
|
|
2012
2182
|
if (!_isValidColumn(lineItem)) {
|
|
2013
2183
|
return;
|
|
2014
2184
|
}
|
|
@@ -2033,7 +2203,7 @@ const getColumnsFromAnnotations = function(
|
|
|
2033
2203
|
const sDateInputFormat: string | undefined = dataType === "Edm.Date" ? "YYYY-MM-DD" : undefined;
|
|
2034
2204
|
const formatOptions = {
|
|
2035
2205
|
...getDefaultFormatOptionsForTable(),
|
|
2036
|
-
...getDefaultDraftIndicatorForColumn(name, semanticKeys)
|
|
2206
|
+
...getDefaultDraftIndicatorForColumn(name, semanticKeys, isFieldGroupColumn, lineItem)
|
|
2037
2207
|
};
|
|
2038
2208
|
let fieldGroupHiddenExpressions: BindingExpression<string>;
|
|
2039
2209
|
if (
|
|
@@ -2047,9 +2217,7 @@ const getColumnsFromAnnotations = function(
|
|
|
2047
2217
|
wrap: relatedPropertiesInfo.exportSettingsWrapping,
|
|
2048
2218
|
type: dataType ? _getExportDataType(dataType, relatedPropertyNames.length > 1) : undefined,
|
|
2049
2219
|
inputFormat: sDateInputFormat,
|
|
2050
|
-
delimiter: dataType === "Edm.Int64" ? true : false
|
|
2051
|
-
trueValue: dataType === "Edm.Boolean" ? "Yes" : undefined,
|
|
2052
|
-
falseValue: dataType === "Edm.Boolean" ? "No" : undefined
|
|
2220
|
+
delimiter: dataType === "Edm.Int64" ? true : false
|
|
2053
2221
|
};
|
|
2054
2222
|
|
|
2055
2223
|
if (relatedPropertiesInfo.exportUnitName) {
|
|
@@ -2058,6 +2226,11 @@ const getColumnsFromAnnotations = function(
|
|
|
2058
2226
|
} else if (relatedPropertiesInfo.exportUnitString) {
|
|
2059
2227
|
exportSettings.unit = relatedPropertiesInfo.exportUnitString;
|
|
2060
2228
|
}
|
|
2229
|
+
if (relatedPropertiesInfo.exportTimezoneName) {
|
|
2230
|
+
exportSettings.timezoneProperty = relatedPropertiesInfo.exportTimezoneName;
|
|
2231
|
+
} else if (relatedPropertiesInfo.exportTimezoneString) {
|
|
2232
|
+
exportSettings.timezone = relatedPropertiesInfo.exportTimezoneString;
|
|
2233
|
+
}
|
|
2061
2234
|
const propertyTypeConfig = dataType && getTypeConfig(lineItem, dataType);
|
|
2062
2235
|
const oTypeConfig = propertyTypeConfig
|
|
2063
2236
|
? {
|
|
@@ -2082,18 +2255,6 @@ const getColumnsFromAnnotations = function(
|
|
|
2082
2255
|
visualSettings.widthCalculation = null;
|
|
2083
2256
|
}
|
|
2084
2257
|
|
|
2085
|
-
// TODO: For situation POC - increase width of the column with the situations indicator - works for the situations demo app only!
|
|
2086
|
-
// Might be a good idea to move the complete column width determination to the converter, that would allow us to widen
|
|
2087
|
-
// the columns as needed. This workaround only deals with Date columns.
|
|
2088
|
-
const { hasDraftIndicator } = getDefaultDraftIndicatorForColumn(name, semanticKeys);
|
|
2089
|
-
const widthOverride =
|
|
2090
|
-
(converterContext.getEntityType().annotations as any).FE?.Situations &&
|
|
2091
|
-
hasDraftIndicator &&
|
|
2092
|
-
lineItem.$Type === UIAnnotationTypes.DataField &&
|
|
2093
|
-
lineItem.Value.$target.type === "Edm.Date"
|
|
2094
|
-
? "11em"
|
|
2095
|
-
: undefined;
|
|
2096
|
-
|
|
2097
2258
|
const oColumn: any = {
|
|
2098
2259
|
key: KeyHelper.generateKeyFromDataField(lineItem),
|
|
2099
2260
|
type: ColumnType.Annotation,
|
|
@@ -2111,14 +2272,15 @@ const getColumnsFromAnnotations = function(
|
|
|
2111
2272
|
propertyInfos: relatedPropertyNames.length > 0 ? relatedPropertyNames : undefined,
|
|
2112
2273
|
additionalPropertyInfos: additionalPropertyNames.length > 0 ? additionalPropertyNames : undefined,
|
|
2113
2274
|
exportSettings: exportSettings,
|
|
2114
|
-
width: lineItem.annotations?.HTML5?.CssDefaults?.width ||
|
|
2115
|
-
importance:
|
|
2275
|
+
width: lineItem.annotations?.HTML5?.CssDefaults?.width || undefined,
|
|
2276
|
+
importance: getImportance(lineItem as DataFieldTypes, semanticKeys),
|
|
2116
2277
|
isNavigable: true,
|
|
2117
2278
|
formatOptions: formatOptions,
|
|
2118
2279
|
exportContactProperty: relatedPropertiesInfo.exportSettingsContactProperty,
|
|
2119
2280
|
caseSensitive: isFilteringCaseSensitive(converterContext),
|
|
2120
2281
|
typeConfig: oTypeConfig,
|
|
2121
|
-
visualSettings: visualSettings
|
|
2282
|
+
visualSettings: visualSettings,
|
|
2283
|
+
timezoneText: exportSettings.timezone
|
|
2122
2284
|
};
|
|
2123
2285
|
const sTooltip = _getTooltip(lineItem);
|
|
2124
2286
|
if (sTooltip) {
|
|
@@ -2128,12 +2290,12 @@ const getColumnsFromAnnotations = function(
|
|
|
2128
2290
|
annotationColumns.push(oColumn as AnnotationTableColumn);
|
|
2129
2291
|
|
|
2130
2292
|
// Collect information of related columns to be created.
|
|
2131
|
-
relatedPropertyNames.forEach(name => {
|
|
2293
|
+
relatedPropertyNames.forEach((name) => {
|
|
2132
2294
|
columnsToBeCreated[name] = relatedPropertiesInfo.properties[name];
|
|
2133
2295
|
});
|
|
2134
2296
|
|
|
2135
2297
|
// Create columns for additional properties identified for ALP use case.
|
|
2136
|
-
additionalPropertyNames.forEach(name => {
|
|
2298
|
+
additionalPropertyNames.forEach((name) => {
|
|
2137
2299
|
// Intentional overwrite as we require only one new PropertyInfo for a related Property.
|
|
2138
2300
|
columnsToBeCreated[name] = relatedPropertiesInfo.additionalProperties[name];
|
|
2139
2301
|
});
|
|
@@ -2167,7 +2329,7 @@ const getColumnsFromAnnotations = function(
|
|
|
2167
2329
|
* @param entityType
|
|
2168
2330
|
* @returns {string[]} The columns from the annotations
|
|
2169
2331
|
*/
|
|
2170
|
-
const _getPropertyNames = function(
|
|
2332
|
+
const _getPropertyNames = function (
|
|
2171
2333
|
properties: string[] | undefined,
|
|
2172
2334
|
annotationColumns: AnnotationTableColumn[],
|
|
2173
2335
|
converterContext: ConverterContext,
|
|
@@ -2175,8 +2337,8 @@ const _getPropertyNames = function(
|
|
|
2175
2337
|
): string[] | undefined {
|
|
2176
2338
|
let matchedProperties: string[] | undefined;
|
|
2177
2339
|
if (properties) {
|
|
2178
|
-
matchedProperties = properties.map(function(propertyPath) {
|
|
2179
|
-
const annotationColumn = annotationColumns.find(function(annotationColumn) {
|
|
2340
|
+
matchedProperties = properties.map(function (propertyPath) {
|
|
2341
|
+
const annotationColumn = annotationColumns.find(function (annotationColumn) {
|
|
2180
2342
|
return annotationColumn.relativePath === propertyPath && annotationColumn.propertyInfos === undefined;
|
|
2181
2343
|
});
|
|
2182
2344
|
if (annotationColumn) {
|
|
@@ -2198,9 +2360,9 @@ const _getPropertyNames = function(
|
|
|
2198
2360
|
return matchedProperties;
|
|
2199
2361
|
};
|
|
2200
2362
|
|
|
2201
|
-
const _appendCustomTemplate = function(properties: string[]): string {
|
|
2363
|
+
const _appendCustomTemplate = function (properties: string[]): string {
|
|
2202
2364
|
return properties
|
|
2203
|
-
.map(property => {
|
|
2365
|
+
.map((property) => {
|
|
2204
2366
|
return `{${properties.indexOf(property)}}`;
|
|
2205
2367
|
})
|
|
2206
2368
|
.join(`${"\n"}`);
|
|
@@ -2217,7 +2379,7 @@ const _appendCustomTemplate = function(properties: string[]): string {
|
|
|
2217
2379
|
* @param {boolean} isAnnotationColumn Whether the column, defined in manifest, corresponds to an existing annotation column.
|
|
2218
2380
|
* @returns {any} Determined property value for the column
|
|
2219
2381
|
*/
|
|
2220
|
-
const _getManifestOrDefaultValue = function(property: any, defaultValue: any, isAnnotationColumn: boolean): any {
|
|
2382
|
+
const _getManifestOrDefaultValue = function (property: any, defaultValue: any, isAnnotationColumn: boolean): any {
|
|
2221
2383
|
if (property === undefined) {
|
|
2222
2384
|
// If annotation column has no property defined in manifest,
|
|
2223
2385
|
// do not overwrite it with manifest column's default value.
|
|
@@ -2236,7 +2398,7 @@ const _getManifestOrDefaultValue = function(property: any, defaultValue: any, is
|
|
|
2236
2398
|
* @param navigationSettings
|
|
2237
2399
|
* @returns {Record<string, CustomColumn>} The columns from the manifest
|
|
2238
2400
|
*/
|
|
2239
|
-
const getColumnsFromManifest = function(
|
|
2401
|
+
const getColumnsFromManifest = function (
|
|
2240
2402
|
columns: Record<string, ManifestTableColumn>,
|
|
2241
2403
|
annotationColumns: AnnotationTableColumn[],
|
|
2242
2404
|
converterContext: ConverterContext,
|
|
@@ -2248,7 +2410,7 @@ const getColumnsFromManifest = function(
|
|
|
2248
2410
|
for (const key in columns) {
|
|
2249
2411
|
const manifestColumn = columns[key];
|
|
2250
2412
|
// To identify the annotation column property overwrite via manifest use-case.
|
|
2251
|
-
const isAnnotationColumn = annotationColumns.some(column => column.key === key);
|
|
2413
|
+
const isAnnotationColumn = annotationColumns.some((column) => column.key === key);
|
|
2252
2414
|
KeyHelper.validateKey(key);
|
|
2253
2415
|
const propertyInfos: string[] | undefined = _getPropertyNames(
|
|
2254
2416
|
manifestColumn.properties,
|
|
@@ -2286,6 +2448,7 @@ const getColumnsFromManifest = function(
|
|
|
2286
2448
|
isNavigable: isAnnotationColumn ? undefined : isActionNavigable(manifestColumn, navigationSettings, true),
|
|
2287
2449
|
settings: manifestColumn.settings,
|
|
2288
2450
|
sortable: false,
|
|
2451
|
+
isGroupable: false,
|
|
2289
2452
|
propertyInfos: propertyInfos,
|
|
2290
2453
|
formatOptions: _getManifestOrDefaultValue(
|
|
2291
2454
|
manifestColumn.formatOptions,
|
|
@@ -2297,7 +2460,6 @@ const getColumnsFromManifest = function(
|
|
|
2297
2460
|
),
|
|
2298
2461
|
exportSettings: {
|
|
2299
2462
|
template: propertyInfos ? _appendCustomTemplate(propertyInfos) : undefined,
|
|
2300
|
-
fieldLabel: propertyInfos ? manifestColumn.header : undefined,
|
|
2301
2463
|
wrap: propertyInfos && propertyInfos.length > 1 ? true : false
|
|
2302
2464
|
},
|
|
2303
2465
|
caseSensitive: isFilteringCaseSensitive(converterContext)
|
|
@@ -2316,13 +2478,21 @@ export function getP13nMode(
|
|
|
2316
2478
|
const tableManifestSettings: TableManifestConfiguration = converterContext.getManifestControlConfiguration(visualizationPath);
|
|
2317
2479
|
const variantManagement: VariantManagementType = manifestWrapper.getVariantManagement();
|
|
2318
2480
|
const aPersonalization: string[] = [];
|
|
2319
|
-
const
|
|
2481
|
+
const isAnalyticalTable = tableManifestConfiguration.type === "AnalyticalTable";
|
|
2482
|
+
const isResponsiveTable = tableManifestConfiguration.type === "ResponsiveTable";
|
|
2320
2483
|
if (tableManifestSettings?.tableSettings?.personalization !== undefined) {
|
|
2321
2484
|
// Personalization configured in manifest.
|
|
2322
2485
|
const personalization: any = tableManifestSettings.tableSettings.personalization;
|
|
2323
2486
|
if (personalization === true) {
|
|
2324
2487
|
// Table personalization fully enabled.
|
|
2325
|
-
|
|
2488
|
+
switch (tableManifestConfiguration.type) {
|
|
2489
|
+
case "AnalyticalTable":
|
|
2490
|
+
return "Sort,Column,Filter,Group,Aggregate";
|
|
2491
|
+
case "ResponsiveTable":
|
|
2492
|
+
return "Sort,Column,Filter,Group";
|
|
2493
|
+
default:
|
|
2494
|
+
return "Sort,Column,Filter";
|
|
2495
|
+
}
|
|
2326
2496
|
} else if (typeof personalization === "object") {
|
|
2327
2497
|
// Specific personalization options enabled in manifest. Use them as is.
|
|
2328
2498
|
if (personalization.sort) {
|
|
@@ -2334,10 +2504,10 @@ export function getP13nMode(
|
|
|
2334
2504
|
if (personalization.filter) {
|
|
2335
2505
|
aPersonalization.push("Filter");
|
|
2336
2506
|
}
|
|
2337
|
-
if (personalization.group &&
|
|
2507
|
+
if (personalization.group && (isAnalyticalTable || isResponsiveTable)) {
|
|
2338
2508
|
aPersonalization.push("Group");
|
|
2339
2509
|
}
|
|
2340
|
-
if (personalization.aggregate &&
|
|
2510
|
+
if (personalization.aggregate && isAnalyticalTable) {
|
|
2341
2511
|
aPersonalization.push("Aggregate");
|
|
2342
2512
|
}
|
|
2343
2513
|
return aPersonalization.length > 0 ? aPersonalization.join(",") : undefined;
|
|
@@ -2346,23 +2516,31 @@ export function getP13nMode(
|
|
|
2346
2516
|
// No personalization configured in manifest.
|
|
2347
2517
|
aPersonalization.push("Sort");
|
|
2348
2518
|
aPersonalization.push("Column");
|
|
2349
|
-
if (
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2519
|
+
if (converterContext.getTemplateType() === TemplateType.ListReport) {
|
|
2520
|
+
if (variantManagement === VariantManagementType.Control || _isFilterBarHidden(manifestWrapper, converterContext)) {
|
|
2521
|
+
// Feature parity with V2.
|
|
2522
|
+
// Enable table filtering by default only in case of Control level variant management.
|
|
2523
|
+
// Or when the LR filter bar is hidden via manifest setting
|
|
2524
|
+
aPersonalization.push("Filter");
|
|
2525
|
+
}
|
|
2526
|
+
} else {
|
|
2353
2527
|
aPersonalization.push("Filter");
|
|
2354
2528
|
}
|
|
2355
|
-
|
|
2529
|
+
|
|
2530
|
+
if (isAnalyticalTable) {
|
|
2356
2531
|
aPersonalization.push("Group");
|
|
2357
2532
|
aPersonalization.push("Aggregate");
|
|
2358
2533
|
}
|
|
2534
|
+
if (isResponsiveTable) {
|
|
2535
|
+
aPersonalization.push("Group");
|
|
2536
|
+
}
|
|
2359
2537
|
return aPersonalization.join(",");
|
|
2360
2538
|
}
|
|
2361
2539
|
return undefined;
|
|
2362
2540
|
}
|
|
2363
2541
|
|
|
2364
2542
|
/**
|
|
2365
|
-
* Returns a
|
|
2543
|
+
* Returns a Boolean value suggesting if a filter bar is being used on the page.
|
|
2366
2544
|
*
|
|
2367
2545
|
* Chart has a dependency to filter bar (issue with loading data). Once resolved, the check for chart should be removed here.
|
|
2368
2546
|
* Until then, hiding filter bar is now allowed if a chart is being used on LR.
|
|
@@ -2400,7 +2578,7 @@ function getSortConditions(
|
|
|
2400
2578
|
const conditions = {
|
|
2401
2579
|
sorters: sorters
|
|
2402
2580
|
};
|
|
2403
|
-
presentationVariantAnnotation.SortOrder.forEach(condition => {
|
|
2581
|
+
presentationVariantAnnotation.SortOrder.forEach((condition) => {
|
|
2404
2582
|
const conditionProperty = condition.Property;
|
|
2405
2583
|
if (conditionProperty && nonSortableProperties.indexOf(conditionProperty.$target?.name) === -1) {
|
|
2406
2584
|
const infoName = convertPropertyPathsToInfoNames([conditionProperty], columns)[0];
|
|
@@ -2427,9 +2605,9 @@ function getSortConditions(
|
|
|
2427
2605
|
|
|
2428
2606
|
function convertPropertyPathsToInfoNames(paths: PropertyPath[], columns: TableColumn[]): string[] {
|
|
2429
2607
|
const infoNames: string[] = [];
|
|
2430
|
-
paths.forEach(currentPath => {
|
|
2608
|
+
paths.forEach((currentPath) => {
|
|
2431
2609
|
if (currentPath?.$target?.name) {
|
|
2432
|
-
const propertyInfo = columns.find(column => {
|
|
2610
|
+
const propertyInfo = columns.find((column) => {
|
|
2433
2611
|
const annotationColumn = column as AnnotationTableColumn;
|
|
2434
2612
|
return !annotationColumn.propertyInfos && annotationColumn.relativePath === currentPath?.$target?.name;
|
|
2435
2613
|
});
|
|
@@ -2451,12 +2629,16 @@ function convertPropertyPathsToInfoNames(paths: PropertyPath[], columns: TableCo
|
|
|
2451
2629
|
*/
|
|
2452
2630
|
function getGroupConditions(
|
|
2453
2631
|
presentationVariantAnnotation: PresentationVariantTypeTypes | undefined,
|
|
2454
|
-
columns: TableColumn[]
|
|
2632
|
+
columns: TableColumn[],
|
|
2633
|
+
tableType: string
|
|
2455
2634
|
): string | undefined {
|
|
2456
2635
|
let groupConditions: string | undefined;
|
|
2457
2636
|
if (presentationVariantAnnotation?.GroupBy) {
|
|
2458
|
-
|
|
2459
|
-
|
|
2637
|
+
let aGroupBy = presentationVariantAnnotation.GroupBy as PropertyPath[];
|
|
2638
|
+
if (tableType === "ResponsiveTable") {
|
|
2639
|
+
aGroupBy = aGroupBy.slice(0, 1);
|
|
2640
|
+
}
|
|
2641
|
+
const aGroupLevels = convertPropertyPathsToInfoNames(aGroupBy, columns).map((infoName) => {
|
|
2460
2642
|
return { name: infoName };
|
|
2461
2643
|
});
|
|
2462
2644
|
|
|
@@ -2480,7 +2662,7 @@ function getAggregateConditions(
|
|
|
2480
2662
|
if (presentationVariantAnnotation?.Total) {
|
|
2481
2663
|
const aTotals = presentationVariantAnnotation.Total as PropertyPath[];
|
|
2482
2664
|
const aggregates: Record<string, object> = {};
|
|
2483
|
-
convertPropertyPathsToInfoNames(aTotals, columns).forEach(infoName => {
|
|
2665
|
+
convertPropertyPathsToInfoNames(aTotals, columns).forEach((infoName) => {
|
|
2484
2666
|
aggregates[infoName] = {};
|
|
2485
2667
|
});
|
|
2486
2668
|
|
|
@@ -2510,7 +2692,13 @@ export function getTableAnnotationConfiguration(
|
|
|
2510
2692
|
const targetCapabilities = getCapabilityRestriction(converterContext);
|
|
2511
2693
|
const navigationTargetPath = getNavigationTargetPath(converterContext, navigationPropertyPath);
|
|
2512
2694
|
const navigationSettings = pageManifestSettings.getNavigationConfiguration(navigationTargetPath);
|
|
2513
|
-
const creationBehaviour = _getCreationBehaviour(
|
|
2695
|
+
const creationBehaviour = _getCreationBehaviour(
|
|
2696
|
+
lineItemAnnotation,
|
|
2697
|
+
tableManifestConfiguration,
|
|
2698
|
+
converterContext,
|
|
2699
|
+
navigationSettings,
|
|
2700
|
+
visualizationPath
|
|
2701
|
+
);
|
|
2514
2702
|
const standardActionsContext = generateStandardActionsContext(
|
|
2515
2703
|
converterContext,
|
|
2516
2704
|
creationBehaviour.mode as CreationMode,
|
|
@@ -2588,6 +2776,9 @@ export function getTableAnnotationConfiguration(
|
|
|
2588
2776
|
function _getExportDataType(dataType: string, isComplexProperty: boolean = false): string {
|
|
2589
2777
|
let exportDataType: string = "String";
|
|
2590
2778
|
if (isComplexProperty) {
|
|
2779
|
+
if (dataType === "Edm.DateTimeOffset") {
|
|
2780
|
+
exportDataType = "DateTime";
|
|
2781
|
+
}
|
|
2591
2782
|
return exportDataType;
|
|
2592
2783
|
} else {
|
|
2593
2784
|
switch (dataType) {
|
|
@@ -2783,7 +2974,7 @@ export function getTableManifestConfiguration(
|
|
|
2783
2974
|
): TableControlConfiguration {
|
|
2784
2975
|
const tableManifestSettings: TableManifestConfiguration = converterContext.getManifestControlConfiguration(visualizationPath);
|
|
2785
2976
|
const tableSettings = (tableManifestSettings && tableManifestSettings.tableSettings) || {};
|
|
2786
|
-
const creationMode = CreationMode.NewPage;
|
|
2977
|
+
const creationMode = tableSettings.creationMode?.name || CreationMode.NewPage;
|
|
2787
2978
|
const enableAutoColumnWidth = !converterContext.getManifestWrapper().isPhone();
|
|
2788
2979
|
const enablePaste =
|
|
2789
2980
|
tableSettings.enablePaste !== undefined ? tableSettings.enablePaste : converterContext.getTemplateType() === "ObjectPage"; // Paste is disabled by default excepted for OP
|
|
@@ -2792,13 +2983,18 @@ export function getTableManifestConfiguration(
|
|
|
2792
2983
|
const isCondensedTableLayoutCompliant = checkCondensedLayout && converterContext.getManifestWrapper().isCondensedLayoutCompliant();
|
|
2793
2984
|
const oFilterConfiguration = _getFilterConfiguration(tableSettings, lineItemAnnotation, converterContext);
|
|
2794
2985
|
const customValidationFunction = tableSettings.creationMode?.customValidationFunction;
|
|
2795
|
-
const condensedTableLayout = tableSettings.condensedTableLayout !== undefined ? tableSettings.condensedTableLayout : false;
|
|
2796
2986
|
const entityType = converterContext.getEntityType();
|
|
2797
2987
|
const aggregationHelper = new AggregationHelper(entityType, converterContext);
|
|
2798
2988
|
const tableType: TableType = _getTableType(tableSettings, aggregationHelper, converterContext);
|
|
2989
|
+
const condensedTableLayout =
|
|
2990
|
+
tableSettings.condensedTableLayout !== undefined && tableType !== "ResponsiveTable" ? tableSettings.condensedTableLayout : false;
|
|
2799
2991
|
const oConfiguration = {
|
|
2800
|
-
|
|
2801
|
-
|
|
2992
|
+
// If no createAtEnd is specified it will be false for Inline create and true otherwise
|
|
2993
|
+
createAtEnd:
|
|
2994
|
+
tableSettings.creationMode?.createAtEnd !== undefined
|
|
2995
|
+
? tableSettings.creationMode?.createAtEnd
|
|
2996
|
+
: creationMode !== CreationMode.Inline,
|
|
2997
|
+
creationMode: creationMode,
|
|
2802
2998
|
customValidationFunction: customValidationFunction,
|
|
2803
2999
|
dataStateIndicatorFilter: dataStateIndicatorFilter,
|
|
2804
3000
|
// if a custom validation function is provided, disableAddRowButtonForEmptyData should not be considered, i.e. set to false
|
|
@@ -2811,7 +3007,7 @@ export function getTableManifestConfiguration(
|
|
|
2811
3007
|
headerVisible: true,
|
|
2812
3008
|
multiSelectMode: _getMultiSelectMode(tableSettings, tableType, converterContext),
|
|
2813
3009
|
selectionLimit: tableSettings.selectAll === true || tableSettings.selectionLimit === 0 ? 0 : tableSettings.selectionLimit || 200,
|
|
2814
|
-
|
|
3010
|
+
inlineCreationRowCount: tableSettings.creationMode?.inlineCreationRowCount ? tableSettings.creationMode?.inlineCreationRowCount : 2,
|
|
2815
3011
|
showRowCount:
|
|
2816
3012
|
!tableSettings?.quickVariantSelection?.showCounts && !converterContext.getManifestWrapper().getViewConfiguration()?.showCounts,
|
|
2817
3013
|
type: tableType,
|