@sapui5/sap.fe.core 1.97.0 → 1.100.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 +7 -4
- package/src/sap/fe/core/.library +1 -1
- package/src/sap/fe/core/AnnotationHelper.js +309 -405
- package/src/sap/fe/core/AnnotationHelper.ts +315 -0
- package/src/sap/fe/core/AppComponent.js +389 -397
- package/src/sap/fe/core/AppComponent.ts +403 -0
- package/src/sap/fe/core/AppStateHandler.js +198 -181
- package/src/sap/fe/core/AppStateHandler.ts +171 -0
- package/src/sap/fe/core/BaseController.js +83 -58
- package/src/sap/fe/core/BaseController.ts +68 -0
- package/src/sap/fe/core/BusyLocker.js +105 -121
- package/src/sap/fe/core/BusyLocker.ts +98 -0
- package/src/sap/fe/core/CommonUtils.js +2164 -2379
- package/src/sap/fe/core/CommonUtils.ts +2177 -0
- package/src/sap/fe/core/ExtensionAPI.js +279 -266
- package/src/sap/fe/core/ExtensionAPI.ts +250 -0
- package/src/sap/fe/core/PageController.js +218 -125
- package/src/sap/fe/core/PageController.ts +129 -0
- package/src/sap/fe/core/RouterProxy.js +924 -807
- package/src/sap/fe/core/RouterProxy.ts +840 -0
- package/src/sap/fe/core/Synchronization.js +41 -35
- package/src/sap/fe/core/Synchronization.ts +29 -0
- package/src/sap/fe/core/TemplateComponent.js +173 -155
- package/src/sap/fe/core/TemplateComponent.ts +173 -0
- package/src/sap/fe/core/TemplateModel.js +79 -54
- package/src/sap/fe/core/TemplateModel.ts +63 -0
- package/src/sap/fe/core/TransactionHelper.js +1560 -1579
- package/src/sap/fe/core/TransactionHelper.ts +1717 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +521 -581
- package/src/sap/fe/core/actions/draft.ts +566 -0
- package/src/sap/fe/core/actions/messageHandling.js +564 -511
- package/src/sap/fe/core/actions/messageHandling.ts +552 -0
- package/src/sap/fe/core/actions/nonDraft.js +17 -19
- package/src/sap/fe/core/actions/nonDraft.ts +12 -0
- package/src/sap/fe/core/actions/operations.js +1093 -1211
- package/src/sap/fe/core/actions/operations.ts +1192 -0
- package/src/sap/fe/core/actions/sticky.js +114 -104
- package/src/sap/fe/core/actions/sticky.ts +119 -0
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +70 -66
- package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
- package/src/sap/fe/core/controllerextensions/EditFlow.js +1594 -1701
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +719 -505
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -813
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1005 -973
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +530 -476
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +137 -46
- package/src/sap/fe/core/controllerextensions/MassEdit.js +144 -0
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +234 -232
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +302 -337
- package/src/sap/fe/core/controllerextensions/PageReady.ts +23 -17
- package/src/sap/fe/core/controllerextensions/Paginator.js +189 -148
- package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -146
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +145 -106
- package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +220 -244
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +593 -634
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +29 -27
- package/src/sap/fe/core/controllerextensions/ViewState.js +789 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -3
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- package/src/sap/fe/core/controls/CommandExecution.js +68 -66
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +91 -75
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +131 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +105 -110
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +122 -140
- package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
- package/src/sap/fe/core/controls/FilterBar.js +163 -159
- package/src/sap/fe/core/controls/FilterBar.ts +143 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +46 -44
- package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +127 -116
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -255
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +151 -141
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -367
- package/src/sap/fe/core/converters/ConverterContext.ts +33 -19
- package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +16 -1
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -354
- package/src/sap/fe/core/converters/ManifestWrapper.ts +34 -6
- package/src/sap/fe/core/converters/MetaModelConverter.js +72 -9
- package/src/sap/fe/core/converters/MetaModelConverter.ts +75 -16
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
- package/src/sap/fe/core/converters/annotations/DataField.js +28 -14
- package/src/sap/fe/core/converters/annotations/DataField.ts +38 -14
- package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
- package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
- package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
- package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
- package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Form.js +21 -11
- package/src/sap/fe/core/converters/controls/Common/Form.ts +28 -6
- package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +75 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +507 -408
- package/src/sap/fe/core/converters/controls/Common/Table.ts +618 -500
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +592 -0
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +718 -0
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +465 -59
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +462 -72
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
- package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
- package/src/sap/fe/core/converters/helpers/Aggregation.js +118 -121
- package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
- package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
- package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
- package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
- package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
- package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
- package/src/sap/fe/core/converters/helpers/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +28 -7
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +23 -6
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +20 -7
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -14
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -90
- package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
- package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
- package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
- package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
- package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
- package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
- package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
- package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
- package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
- package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
- package/src/sap/fe/core/fpm/Component.js +51 -54
- package/src/sap/fe/core/fpm/Component.ts +48 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +373 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +417 -0
- package/src/sap/fe/core/helpers/BindingExpression.js +489 -442
- package/src/sap/fe/core/helpers/BindingExpression.ts +486 -469
- package/src/sap/fe/core/helpers/ClassSupport.js +212 -76
- package/src/sap/fe/core/helpers/ClassSupport.ts +198 -71
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
- package/src/sap/fe/core/helpers/EditState.js +81 -84
- package/src/sap/fe/core/helpers/EditState.ts +81 -0
- package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
- package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
- package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
- package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
- package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
- package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
- package/src/sap/fe/core/helpers/MassEditHelper.js +604 -0
- package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +253 -225
- package/src/sap/fe/core/helpers/ModelHelper.ts +250 -0
- package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
- package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
- package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +334 -0
- package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
- package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
- package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
- package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
- package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
- package/src/sap/fe/core/library.js +427 -425
- package/src/sap/fe/core/library.support.js +23 -27
- package/src/sap/fe/core/library.support.ts +23 -0
- package/src/sap/fe/core/library.ts +420 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +64 -0
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +69 -0
- package/src/sap/fe/core/messagebundle.properties +78 -13
- package/src/sap/fe/core/messagebundle_ar.properties +58 -7
- package/src/sap/fe/core/messagebundle_bg.properties +58 -7
- package/src/sap/fe/core/messagebundle_ca.properties +58 -7
- package/src/sap/fe/core/messagebundle_cs.properties +59 -8
- package/src/sap/fe/core/messagebundle_cy.properties +58 -7
- package/src/sap/fe/core/messagebundle_da.properties +58 -7
- package/src/sap/fe/core/messagebundle_de.properties +58 -7
- package/src/sap/fe/core/messagebundle_el.properties +58 -7
- package/src/sap/fe/core/messagebundle_en.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_GB.properties +57 -6
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +61 -6
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +58 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +58 -7
- package/src/sap/fe/core/messagebundle_es.properties +58 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +58 -7
- package/src/sap/fe/core/messagebundle_et.properties +58 -7
- package/src/sap/fe/core/messagebundle_fi.properties +60 -9
- package/src/sap/fe/core/messagebundle_fr.properties +64 -13
- package/src/sap/fe/core/messagebundle_fr_CA.properties +59 -8
- package/src/sap/fe/core/messagebundle_hi.properties +58 -7
- package/src/sap/fe/core/messagebundle_hr.properties +58 -7
- package/src/sap/fe/core/messagebundle_hu.properties +59 -8
- package/src/sap/fe/core/messagebundle_id.properties +61 -10
- package/src/sap/fe/core/messagebundle_it.properties +58 -7
- package/src/sap/fe/core/messagebundle_iw.properties +58 -7
- package/src/sap/fe/core/messagebundle_ja.properties +58 -7
- package/src/sap/fe/core/messagebundle_kk.properties +58 -7
- package/src/sap/fe/core/messagebundle_ko.properties +58 -7
- package/src/sap/fe/core/messagebundle_lt.properties +58 -7
- package/src/sap/fe/core/messagebundle_lv.properties +59 -8
- package/src/sap/fe/core/messagebundle_ms.properties +58 -7
- package/src/sap/fe/core/messagebundle_nl.properties +58 -7
- package/src/sap/fe/core/messagebundle_no.properties +58 -7
- package/src/sap/fe/core/messagebundle_pl.properties +58 -7
- package/src/sap/fe/core/messagebundle_pt.properties +59 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +58 -7
- package/src/sap/fe/core/messagebundle_ro.properties +58 -7
- package/src/sap/fe/core/messagebundle_ru.properties +58 -7
- package/src/sap/fe/core/messagebundle_sh.properties +58 -7
- package/src/sap/fe/core/messagebundle_sk.properties +58 -7
- package/src/sap/fe/core/messagebundle_sl.properties +58 -7
- package/src/sap/fe/core/messagebundle_sv.properties +59 -8
- package/src/sap/fe/core/messagebundle_th.properties +58 -7
- package/src/sap/fe/core/messagebundle_tr.properties +60 -9
- package/src/sap/fe/core/messagebundle_uk.properties +58 -7
- package/src/sap/fe/core/messagebundle_vi.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +58 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +58 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +67 -92
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
- package/src/sap/fe/core/services/RoutingServiceFactory.js +927 -1152
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
- package/src/sap/fe/core/services/ShellServicesFactory.js +649 -707
- package/src/sap/fe/core/services/ShellServicesFactory.ts +52 -15
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +569 -637
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +78 -102
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -478
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +460 -0
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
- package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
- package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
- package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -1
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
- package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
- package/src/sap/fe/core/templating/DataModelPathHelper.js +97 -127
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +112 -135
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
- package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
- package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
- package/src/sap/fe/core/templating/FilterHelper.js +140 -78
- package/src/sap/fe/core/templating/FilterHelper.ts +149 -78
- package/src/sap/fe/core/templating/PropertyHelper.js +3 -3
- package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
- package/src/sap/fe/core/templating/UIFormatters.js +76 -135
- package/src/sap/fe/core/templating/UIFormatters.ts +76 -99
- package/src/sap/fe/core/type/Email.js +1 -1
- package/src/sap/fe/core/type/Email.ts +4 -6
- package/ui5.yaml +0 -3
- package/src/sap/fe/core/controls/filterbar.d.js +0 -8
- package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AvailabilityType,
|
|
3
|
-
FilterFieldManifestConfiguration,
|
|
4
|
-
FilterManifestConfiguration,
|
|
5
|
-
FilterSettings,
|
|
6
|
-
TemplateType
|
|
7
|
-
} from "../../ManifestSettings";
|
|
1
|
+
import { AvailabilityType, FilterFieldManifestConfiguration, FilterManifestConfiguration, FilterSettings } from "../../ManifestSettings";
|
|
8
2
|
import { EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
|
|
9
3
|
import ConverterContext from "sap/fe/core/converters/ConverterContext";
|
|
10
4
|
import { AnnotationTerm, DataFieldAbstractTypes, DataFieldTypes, ReferenceFacetTypes, UIAnnotationTerms } from "@sap-ux/vocabularies-types";
|
|
@@ -12,8 +6,10 @@ import {
|
|
|
12
6
|
getSelectionVariantConfiguration,
|
|
13
7
|
SelectionVariantConfiguration,
|
|
14
8
|
TableVisualization,
|
|
15
|
-
isFilteringCaseSensitive
|
|
9
|
+
isFilteringCaseSensitive,
|
|
10
|
+
getTypeConfig
|
|
16
11
|
} from "sap/fe/core/converters/controls/Common/Table";
|
|
12
|
+
import { ChartVisualization } from "sap/fe/core/converters/controls/Common/Chart";
|
|
17
13
|
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
18
14
|
import { getVisualFilters, VisualFilters } from "sap/fe/core/converters/controls/ListReport/VisualFilters";
|
|
19
15
|
import { SelectOptionType, FieldGroupType, FieldGroup } from "@sap-ux/vocabularies-types/dist/generated/UI";
|
|
@@ -22,8 +18,10 @@ import { getSelectionVariant } from "../Common/DataVisualization";
|
|
|
22
18
|
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
23
19
|
import { IssueType, IssueSeverity, IssueCategory } from "sap/fe/core/converters/helpers/IssueManager";
|
|
24
20
|
import { PropertyPath } from "@sap-ux/vocabularies-types/dist/Edm";
|
|
21
|
+
//import { hasValueHelp } from "sap/fe/core/templating/PropertyHelper";
|
|
25
22
|
|
|
26
23
|
export type FilterField = ConfigurableObject & {
|
|
24
|
+
type?: string;
|
|
27
25
|
conditionPath: string;
|
|
28
26
|
availability: AvailabilityType;
|
|
29
27
|
annotationPath: string;
|
|
@@ -42,13 +40,21 @@ type FilterGroup = {
|
|
|
42
40
|
groupLabel?: string;
|
|
43
41
|
};
|
|
44
42
|
|
|
43
|
+
enum filterFieldType {
|
|
44
|
+
Default = "Default",
|
|
45
|
+
Slot = "Slot"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const sEdmString = "Edm.String";
|
|
49
|
+
const sStringDataType = "sap.ui.model.odata.type.String";
|
|
50
|
+
|
|
45
51
|
export type CustomElementFilterField = CustomElement<FilterField>;
|
|
46
52
|
|
|
47
53
|
/**
|
|
48
54
|
* Enter all DataFields of a given FieldGroup into the filterFacetMap.
|
|
49
55
|
*
|
|
50
56
|
* @param {AnnotationTerm<FieldGroupType>} fieldGroup
|
|
51
|
-
* @returns {Record<string, FilterGroup>} The map of facets for the given
|
|
57
|
+
* @returns {Record<string, FilterGroup>} The map of facets for the given FieldGroup
|
|
52
58
|
*/
|
|
53
59
|
function getFieldGroupFilterGroups(fieldGroup: AnnotationTerm<FieldGroupType>): Record<string, FilterGroup> {
|
|
54
60
|
const filterFacetMap: Record<string, FilterGroup> = {};
|
|
@@ -76,8 +82,8 @@ function getExcludedFilterProperties(selectionVariants: SelectionVariantConfigur
|
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
/**
|
|
79
|
-
* Check that all the tables for a dedicated
|
|
80
|
-
* @param {TableVisualization[]} listReportTables List
|
|
85
|
+
* Check that all the tables for a dedicated entity set are configured as analytical table.
|
|
86
|
+
* @param {TableVisualization[]} listReportTables List report tables
|
|
81
87
|
* @param {string} contextPath
|
|
82
88
|
* @returns {boolean} Is FilterBar search field hidden or not
|
|
83
89
|
*/
|
|
@@ -119,10 +125,10 @@ function getSelectionVariants(
|
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
/**
|
|
122
|
-
* Returns the condition path required for the condition model. It looks
|
|
128
|
+
* Returns the condition path required for the condition model. It looks as follows:
|
|
123
129
|
* <1:N-PropertyName>*\/<1:1-PropertyName>/<PropertyName>.
|
|
124
130
|
*
|
|
125
|
-
* @param entityType The root
|
|
131
|
+
* @param entityType The root EntityType
|
|
126
132
|
* @param propertyPath The full path to the target property
|
|
127
133
|
* @returns {string} The formatted condition path
|
|
128
134
|
*/
|
|
@@ -172,6 +178,70 @@ const _createFilterSelectionField = function(
|
|
|
172
178
|
return undefined;
|
|
173
179
|
};
|
|
174
180
|
|
|
181
|
+
export function getModelType(sType: any) {
|
|
182
|
+
type defaultModelType = {
|
|
183
|
+
[key: string]: {
|
|
184
|
+
[key: string]: string;
|
|
185
|
+
};
|
|
186
|
+
};
|
|
187
|
+
const mDefaultTypeForEdmType: defaultModelType = {
|
|
188
|
+
"Edm.Boolean": {
|
|
189
|
+
modelType: "Bool"
|
|
190
|
+
},
|
|
191
|
+
"Edm.Byte": {
|
|
192
|
+
modelType: "Int"
|
|
193
|
+
},
|
|
194
|
+
"Edm.Date": {
|
|
195
|
+
modelType: "Date"
|
|
196
|
+
},
|
|
197
|
+
"Edm.DateTime": {
|
|
198
|
+
modelType: "Date"
|
|
199
|
+
},
|
|
200
|
+
"Edm.DateTimeOffset": {
|
|
201
|
+
modelType: "DateTimeOffset"
|
|
202
|
+
},
|
|
203
|
+
"Edm.Decimal": {
|
|
204
|
+
modelType: "Decimal"
|
|
205
|
+
},
|
|
206
|
+
"Edm.Double": {
|
|
207
|
+
modelType: "Float"
|
|
208
|
+
},
|
|
209
|
+
"Edm.Float": {
|
|
210
|
+
modelType: "Float"
|
|
211
|
+
},
|
|
212
|
+
"Edm.Guid": {
|
|
213
|
+
modelType: "Guid"
|
|
214
|
+
},
|
|
215
|
+
"Edm.Int16": {
|
|
216
|
+
modelType: "Int"
|
|
217
|
+
},
|
|
218
|
+
"Edm.Int32": {
|
|
219
|
+
modelType: "Int"
|
|
220
|
+
},
|
|
221
|
+
"Edm.Int64": {
|
|
222
|
+
modelType: "Int"
|
|
223
|
+
},
|
|
224
|
+
"Edm.SByte": {
|
|
225
|
+
modelType: "Int"
|
|
226
|
+
},
|
|
227
|
+
"Edm.Single": {
|
|
228
|
+
modelType: "Float"
|
|
229
|
+
},
|
|
230
|
+
"Edm.String": {
|
|
231
|
+
modelType: "String"
|
|
232
|
+
},
|
|
233
|
+
"Edm.Time": {
|
|
234
|
+
modelType: "TimeOfDay"
|
|
235
|
+
},
|
|
236
|
+
"Edm.TimeOfDay": {
|
|
237
|
+
modelType: "TimeOfDay"
|
|
238
|
+
},
|
|
239
|
+
"Edm.Stream": {
|
|
240
|
+
//no corresponding modelType - ignore for filtering
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
return sType && sType in mDefaultTypeForEdmType && mDefaultTypeForEdmType[sType].modelType;
|
|
244
|
+
}
|
|
175
245
|
const _getSelectionFields = function(
|
|
176
246
|
entityType: EntityType,
|
|
177
247
|
navigationPath: string,
|
|
@@ -217,7 +287,7 @@ const _getSelectionFieldsByPath = function(
|
|
|
217
287
|
includeHidden,
|
|
218
288
|
converterContext
|
|
219
289
|
);
|
|
220
|
-
} else if (property.targetType !== undefined) {
|
|
290
|
+
} else if (property.targetType !== undefined && property.targetType._type === "ComplexType") {
|
|
221
291
|
// handle ComplexType properties
|
|
222
292
|
localSelectionFields = _getSelectionFields(
|
|
223
293
|
entityType,
|
|
@@ -258,7 +328,7 @@ const _getFilterField = function(
|
|
|
258
328
|
filterField = _createFilterSelectionField(entityType, entityType.resolvePath(propertyPath), propertyPath, true, converterContext);
|
|
259
329
|
}
|
|
260
330
|
if (!filterField) {
|
|
261
|
-
converterContext.getDiagnostics()
|
|
331
|
+
converterContext.getDiagnostics()?.addIssue(IssueCategory.Annotation, IssueSeverity.High, IssueType.MISSING_SELECTIONFIELD);
|
|
262
332
|
}
|
|
263
333
|
// defined SelectionFields are available by default
|
|
264
334
|
if (filterField) {
|
|
@@ -318,7 +388,7 @@ const _getDefaultFilterFields = function(
|
|
|
318
388
|
};
|
|
319
389
|
|
|
320
390
|
/**
|
|
321
|
-
* Get all
|
|
391
|
+
* Get all parameter filter fields in case of a parameterized service.
|
|
322
392
|
* @param {ConverterContext} converterContext
|
|
323
393
|
* @returns {FilterField[]} An array of parameter filterfields
|
|
324
394
|
*/
|
|
@@ -342,20 +412,28 @@ function _getParameterFields(converterContext: ConverterContext): FilterField[]
|
|
|
342
412
|
* Determines if the FilterBar search field is hidden or not.
|
|
343
413
|
*
|
|
344
414
|
* @param {TableVisualization[]} listReportTables The list report tables
|
|
415
|
+
* @param {ChartVisualization[]} charts The ALP charts
|
|
345
416
|
* @param {ConverterContext} converterContext The converter context
|
|
346
417
|
* @returns {boolean} The information if the FilterBar search field is hidden or not
|
|
347
418
|
*/
|
|
348
|
-
export const getFilterBarhideBasicSearch = function(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
419
|
+
export const getFilterBarhideBasicSearch = function(
|
|
420
|
+
listReportTables: TableVisualization[],
|
|
421
|
+
charts: ChartVisualization[],
|
|
422
|
+
converterContext: ConverterContext
|
|
423
|
+
): boolean {
|
|
424
|
+
// Check if charts allow search
|
|
425
|
+
const noSearchInCharts = charts.length === 0 || charts.every(chart => !chart.applySupported.enableSearch);
|
|
426
|
+
|
|
427
|
+
// Check if all tables are analytical and none of them allow for search
|
|
428
|
+
const noSearchInTables =
|
|
429
|
+
listReportTables.length === 0 || listReportTables.every(table => table.enableAnalytics && !table.enableAnalyticsSearch);
|
|
430
|
+
|
|
431
|
+
const contextPath = converterContext.getContextPath();
|
|
432
|
+
if (contextPath && noSearchInCharts && noSearchInTables) {
|
|
353
433
|
return true;
|
|
434
|
+
} else {
|
|
435
|
+
return false;
|
|
354
436
|
}
|
|
355
|
-
// Tries to find a non-analytical table with the main entity set (page entity set) as collection
|
|
356
|
-
// if at least one table matches these conditions, basic search field must be displayed.
|
|
357
|
-
const sContextPath = converterContext.getContextPath();
|
|
358
|
-
return checkAllTableForEntitySetAreAnalytical(listReportTables, sContextPath);
|
|
359
437
|
};
|
|
360
438
|
|
|
361
439
|
/**
|
|
@@ -383,9 +461,14 @@ export const getManifestFilterFields = function(
|
|
|
383
461
|
const filterField = definedFilterFields[sKey];
|
|
384
462
|
const propertyName = KeyHelper.getPathFromSelectionFieldKey(sKey);
|
|
385
463
|
const selectionField = selectionFields[propertyName];
|
|
386
|
-
const
|
|
464
|
+
const type = filterField.type === "Slot" ? filterFieldType.Slot : filterFieldType.Default;
|
|
465
|
+
const visualFilter =
|
|
466
|
+
filterField && filterField?.visualFilter
|
|
467
|
+
? getVisualFilters(entityType, converterContext, sKey, definedFilterFields)
|
|
468
|
+
: undefined;
|
|
387
469
|
filterFields[sKey] = {
|
|
388
470
|
key: sKey,
|
|
471
|
+
type: type,
|
|
389
472
|
annotationPath: selectionField?.annotationPath,
|
|
390
473
|
conditionPath: selectionField?.conditionPath || propertyName,
|
|
391
474
|
template: filterField.template,
|
|
@@ -403,10 +486,326 @@ export const getFilterField = function(propertyPath: string, converterContext: C
|
|
|
403
486
|
return _getFilterField({}, propertyPath, converterContext, entityType);
|
|
404
487
|
};
|
|
405
488
|
|
|
489
|
+
export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any, sRestriction: any) {
|
|
490
|
+
if (sRestriction === "RequiredProperties" || sRestriction === "NonFilterableProperties") {
|
|
491
|
+
let aProps = [];
|
|
492
|
+
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation[sRestriction]) {
|
|
493
|
+
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function(oProperty: any) {
|
|
494
|
+
return oProperty.$PropertyPath || oProperty.value;
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
return aProps;
|
|
498
|
+
} else if (sRestriction === "FilterAllowedExpressions") {
|
|
499
|
+
const mAllowedExpressions = {} as any;
|
|
500
|
+
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation.FilterExpressionRestrictions) {
|
|
501
|
+
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function(oProperty: any) {
|
|
502
|
+
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
503
|
+
if (mAllowedExpressions[oProperty.Property.value]) {
|
|
504
|
+
mAllowedExpressions[oProperty.Property.value].push(oProperty.AllowedExpressions);
|
|
505
|
+
} else {
|
|
506
|
+
mAllowedExpressions[oProperty.Property.value] = [oProperty.AllowedExpressions];
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
return mAllowedExpressions;
|
|
511
|
+
}
|
|
512
|
+
return oFilterRestrictionsAnnotation;
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
const getSearchFilterPropertyInfo = function() {
|
|
516
|
+
return {
|
|
517
|
+
name: "$search",
|
|
518
|
+
path: "$search",
|
|
519
|
+
dataType: sStringDataType,
|
|
520
|
+
maxConditions: 1
|
|
521
|
+
};
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
const getEditStateFilterPropertyInfo = function() {
|
|
525
|
+
return {
|
|
526
|
+
name: "$editState",
|
|
527
|
+
path: "$editState",
|
|
528
|
+
groupLabel: "",
|
|
529
|
+
group: "",
|
|
530
|
+
dataType: sStringDataType,
|
|
531
|
+
hiddenFilter: false
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
const getSearchRestrictions = function(converterContext: ConverterContext) {
|
|
536
|
+
return converterContext.getEntitySet()?.annotations?.Capabilities?.SearchRestrictions;
|
|
537
|
+
};
|
|
538
|
+
|
|
539
|
+
export const getNavigationRestrictions = function(converterContext: ConverterContext, sNavigationPath: string) {
|
|
540
|
+
const oNavigationRestrictions: any = converterContext.getEntitySet()?.annotations?.Capabilities?.NavigationRestrictions;
|
|
541
|
+
const aRestrictedProperties = oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties;
|
|
542
|
+
return (
|
|
543
|
+
aRestrictedProperties &&
|
|
544
|
+
aRestrictedProperties.find(function(oRestrictedProperty: any) {
|
|
545
|
+
return (
|
|
546
|
+
oRestrictedProperty &&
|
|
547
|
+
oRestrictedProperty.NavigationProperty &&
|
|
548
|
+
(oRestrictedProperty.NavigationProperty.$NavigationPropertyPath === sNavigationPath ||
|
|
549
|
+
oRestrictedProperty.NavigationProperty.value === sNavigationPath)
|
|
550
|
+
);
|
|
551
|
+
})
|
|
552
|
+
);
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
const _fetchBasicPropertyInfo = function(oFilterFieldInfo: any) {
|
|
556
|
+
return {
|
|
557
|
+
key: oFilterFieldInfo.key,
|
|
558
|
+
annotationPath: oFilterFieldInfo.annotationPath,
|
|
559
|
+
conditionPath: oFilterFieldInfo.conditionPath,
|
|
560
|
+
name: oFilterFieldInfo.conditionPath,
|
|
561
|
+
label: oFilterFieldInfo.label,
|
|
562
|
+
hiddenFilter: oFilterFieldInfo.availability === "Hidden",
|
|
563
|
+
display: "Value",
|
|
564
|
+
isParameter: oFilterFieldInfo.isParameter,
|
|
565
|
+
caseSensitive: oFilterFieldInfo.caseSensitive,
|
|
566
|
+
availability: oFilterFieldInfo.availability,
|
|
567
|
+
position: oFilterFieldInfo.position,
|
|
568
|
+
type: oFilterFieldInfo.type,
|
|
569
|
+
template: oFilterFieldInfo.template,
|
|
570
|
+
menu: oFilterFieldInfo.menu
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
export const getSpecificAllowedExpression = function(aExpressions: any) {
|
|
575
|
+
const aAllowedExpressionsPriority = [
|
|
576
|
+
"SingleValue",
|
|
577
|
+
"MultiValue",
|
|
578
|
+
"SingleRange",
|
|
579
|
+
"MultiRange",
|
|
580
|
+
"SearchExpression",
|
|
581
|
+
"MultiRangeOrSearchExpression"
|
|
582
|
+
];
|
|
583
|
+
|
|
584
|
+
aExpressions.sort(function(a: any, b: any) {
|
|
585
|
+
return aAllowedExpressionsPriority.indexOf(a) - aAllowedExpressionsPriority.indexOf(b);
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
return aExpressions[0];
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
export const displayMode = function(oPropertyAnnotations: any, oCollectionAnnotations: any) {
|
|
592
|
+
const oTextAnnotation = oPropertyAnnotations?.Common?.Text,
|
|
593
|
+
oTextArrangmentAnnotation =
|
|
594
|
+
oTextAnnotation &&
|
|
595
|
+
((oPropertyAnnotations && oPropertyAnnotations?.Common?.Text?.annotations?.UI?.TextArrangement) ||
|
|
596
|
+
(oCollectionAnnotations && oCollectionAnnotations?.UI?.TextArrangement));
|
|
597
|
+
|
|
598
|
+
if (oTextArrangmentAnnotation) {
|
|
599
|
+
if (oTextArrangmentAnnotation.valueOf() === "UI.TextArrangementType/TextOnly") {
|
|
600
|
+
return "Description";
|
|
601
|
+
} else if (oTextArrangmentAnnotation.valueOf() === "UI.TextArrangementType/TextLast") {
|
|
602
|
+
return "ValueDescription";
|
|
603
|
+
}
|
|
604
|
+
return "DescriptionValue"; //TextFirst
|
|
605
|
+
}
|
|
606
|
+
return oTextAnnotation ? "DescriptionValue" : "Value";
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
const _fetchPropertyInfo = function(converterContext: ConverterContext, oFilterFieldInfo: any, oTypeConfig: any) {
|
|
610
|
+
let oPropertyInfo = _fetchBasicPropertyInfo(oFilterFieldInfo);
|
|
611
|
+
const sAnnotationPath = oFilterFieldInfo.annotationPath;
|
|
612
|
+
|
|
613
|
+
if (!sAnnotationPath) {
|
|
614
|
+
return oPropertyInfo;
|
|
615
|
+
}
|
|
616
|
+
const targetPropertyObject = converterContext.getConverterContextFor(sAnnotationPath).getDataModelObjectPath().targetObject;
|
|
617
|
+
|
|
618
|
+
const oPropertyAnnotations = targetPropertyObject?.annotations;
|
|
619
|
+
const oCollectionAnnotations = converterContext?.getDataModelObjectPath().targetObject?.annotations;
|
|
620
|
+
|
|
621
|
+
const oFormatOptions = oTypeConfig.formatOptions;
|
|
622
|
+
const oConstraints = oTypeConfig.constraints;
|
|
623
|
+
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
624
|
+
formatOptions: oFormatOptions,
|
|
625
|
+
constraints: oConstraints,
|
|
626
|
+
display: displayMode(oPropertyAnnotations, oCollectionAnnotations)
|
|
627
|
+
});
|
|
628
|
+
return oPropertyInfo;
|
|
629
|
+
};
|
|
630
|
+
|
|
631
|
+
export const isMultiValue = function(oProperty: any) {
|
|
632
|
+
let bIsMultiValue = true;
|
|
633
|
+
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
634
|
+
switch (oProperty.filterExpression) {
|
|
635
|
+
case "SearchExpression":
|
|
636
|
+
case "SingleRange":
|
|
637
|
+
case "SingleValue":
|
|
638
|
+
bIsMultiValue = false;
|
|
639
|
+
break;
|
|
640
|
+
default:
|
|
641
|
+
break;
|
|
642
|
+
}
|
|
643
|
+
if (oProperty.type && oProperty.type.indexOf("Boolean") > 0) {
|
|
644
|
+
bIsMultiValue = false;
|
|
645
|
+
}
|
|
646
|
+
return bIsMultiValue;
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
const getAnnotatedSelectionFieldData = function(
|
|
650
|
+
converterContext: ConverterContext,
|
|
651
|
+
lrTables: TableVisualization[] = [],
|
|
652
|
+
annotationPath: string = ""
|
|
653
|
+
) {
|
|
654
|
+
// Fetch all selectionVariants defined in the different visualizations and different views (multi table mode)
|
|
655
|
+
const selectionVariants: SelectionVariantConfiguration[] = getSelectionVariants(lrTables, converterContext);
|
|
656
|
+
|
|
657
|
+
// create a map of properties to be used in selection variants
|
|
658
|
+
const excludedFilterProperties: Record<string, boolean> = getExcludedFilterProperties(selectionVariants);
|
|
659
|
+
const entityType = converterContext.getEntityType();
|
|
660
|
+
//Filters which has to be added which is part of SV/Default annotations but not present in the SelectionFields
|
|
661
|
+
const annotatedSelectionFields = ((annotationPath && converterContext.getEntityTypeAnnotation(annotationPath)?.annotation) ||
|
|
662
|
+
entityType.annotations?.UI?.SelectionFields ||
|
|
663
|
+
[]) as PropertyPath[];
|
|
664
|
+
|
|
665
|
+
// create a map of all potential filter fields based on...
|
|
666
|
+
const filterFields: Record<string, FilterField> = {
|
|
667
|
+
// ...non hidden properties of the entity
|
|
668
|
+
..._getSelectionFields(entityType, "", entityType.entityProperties, false, converterContext),
|
|
669
|
+
// ...additional manifest defined navigation properties
|
|
670
|
+
..._getSelectionFieldsByPath(
|
|
671
|
+
entityType,
|
|
672
|
+
converterContext.getManifestWrapper().getFilterConfiguration().navigationProperties,
|
|
673
|
+
false,
|
|
674
|
+
converterContext
|
|
675
|
+
)
|
|
676
|
+
};
|
|
677
|
+
|
|
678
|
+
const propertyInfoFields: any =
|
|
679
|
+
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
680
|
+
const propertyPath = selectionField.value;
|
|
681
|
+
if (!(propertyPath in excludedFilterProperties)) {
|
|
682
|
+
const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
|
|
683
|
+
if (filterField) {
|
|
684
|
+
filterField.group = "";
|
|
685
|
+
filterField.groupLabel = "";
|
|
686
|
+
selectionFields.push(filterField);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
return selectionFields;
|
|
690
|
+
}, []) || [];
|
|
691
|
+
|
|
692
|
+
return {
|
|
693
|
+
excludedFilterProperties: excludedFilterProperties,
|
|
694
|
+
entityType: entityType,
|
|
695
|
+
annotatedSelectionFields: annotatedSelectionFields,
|
|
696
|
+
filterFields: filterFields,
|
|
697
|
+
propertyInfoFields: propertyInfoFields
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
export const processSelectionFields = function(propertyInfoFields: any, converterContext: ConverterContext) {
|
|
701
|
+
//get TypeConfig function
|
|
702
|
+
const aTypeConfig: any = [];
|
|
703
|
+
const selectionFieldTypes: any = [];
|
|
704
|
+
const _fnTypeConfig = function(property: Property) {
|
|
705
|
+
const oTypeConfig = getTypeConfig(property, undefined);
|
|
706
|
+
selectionFieldTypes.push(property?.type);
|
|
707
|
+
if (property?.type === sEdmString && (!oTypeConfig.constraints.nullable || oTypeConfig.constraints.nullable === true)) {
|
|
708
|
+
oTypeConfig.formatOptions.parseKeepsEmptyString = false;
|
|
709
|
+
}
|
|
710
|
+
aTypeConfig.push(oTypeConfig);
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
//add typeConfig
|
|
714
|
+
propertyInfoFields.forEach(function(parameterField: any) {
|
|
715
|
+
if (parameterField.annotationPath) {
|
|
716
|
+
const propertyConvertyContext = converterContext.getConverterContextFor(parameterField.annotationPath);
|
|
717
|
+
const propertyTargetObject = propertyConvertyContext.getDataModelObjectPath().targetObject;
|
|
718
|
+
_fnTypeConfig(propertyTargetObject);
|
|
719
|
+
} else {
|
|
720
|
+
selectionFieldTypes.push(sEdmString);
|
|
721
|
+
aTypeConfig.push({ type: sStringDataType });
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
|
|
725
|
+
// filterRestrictions
|
|
726
|
+
const oFilterRestrictions = converterContext.getEntitySet()?.annotations?.Capabilities?.FilterRestrictions;
|
|
727
|
+
const oRet = {} as any;
|
|
728
|
+
oRet["RequiredProperties"] = getFilterRestrictions(oFilterRestrictions, "RequiredProperties") || [];
|
|
729
|
+
oRet["NonFilterableProperties"] = getFilterRestrictions(oFilterRestrictions, "NonFilterableProperties") || [];
|
|
730
|
+
oRet["FilterAllowedExpressions"] = getFilterRestrictions(oFilterRestrictions, "FilterAllowedExpressions") || {};
|
|
731
|
+
|
|
732
|
+
const sEntitySetPath = converterContext.getContextPath();
|
|
733
|
+
const aPathParts = sEntitySetPath.split("/");
|
|
734
|
+
if (aPathParts.length > 2) {
|
|
735
|
+
const sNavigationPath = aPathParts[aPathParts.length - 1];
|
|
736
|
+
aPathParts.splice(-1, 1);
|
|
737
|
+
const oNavigationRestrictions = getNavigationRestrictions(converterContext, sNavigationPath);
|
|
738
|
+
const oNavigationFilterRestrictions = oNavigationRestrictions && oNavigationRestrictions.FilterRestrictions;
|
|
739
|
+
oRet.RequiredProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "RequiredProperties") || []);
|
|
740
|
+
oRet.NonFilterableProperties.concat(getFilterRestrictions(oNavigationFilterRestrictions, "NonFilterableProperties") || []);
|
|
741
|
+
oRet.FilterAllowedExpressions = {
|
|
742
|
+
...(getFilterRestrictions(oNavigationFilterRestrictions, "FilterAllowedExpressions") || {}),
|
|
743
|
+
...oRet.FilterAllowedExpressions
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
const isCaseSensitive = isFilteringCaseSensitive(converterContext);
|
|
747
|
+
const aRequiredProps = oRet.RequiredProperties;
|
|
748
|
+
const aNonFilterableProps = oRet.NonFilterableProperties;
|
|
749
|
+
let oPropertyInfo;
|
|
750
|
+
const aFetchedProperties: any = [];
|
|
751
|
+
|
|
752
|
+
// process the fields to add necessary properties
|
|
753
|
+
Object.keys(propertyInfoFields).forEach(function(sFilterFieldKey: string) {
|
|
754
|
+
const oConvertedProperty = propertyInfoFields[sFilterFieldKey];
|
|
755
|
+
let sPropertyPath;
|
|
756
|
+
if (oConvertedProperty.conditionPath) {
|
|
757
|
+
sPropertyPath = oConvertedProperty.conditionPath.replace(/\+|\*/g, "");
|
|
758
|
+
}
|
|
759
|
+
if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
|
|
760
|
+
oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[sFilterFieldKey]);
|
|
761
|
+
if (oPropertyInfo) {
|
|
762
|
+
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
763
|
+
maxConditions: !oPropertyInfo.isParameter && isMultiValue(oPropertyInfo) ? -1 : 1,
|
|
764
|
+
required: oPropertyInfo.isParameter || aRequiredProps.indexOf(sPropertyPath) >= 0,
|
|
765
|
+
caseSensitive: isCaseSensitive,
|
|
766
|
+
dataType: selectionFieldTypes[sFilterFieldKey]
|
|
767
|
+
});
|
|
768
|
+
|
|
769
|
+
aFetchedProperties.push(oPropertyInfo);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
//add edit
|
|
775
|
+
if (converterContext.getDataModelObjectPath().targetObject?.annotations?.Common?.DraftRoot) {
|
|
776
|
+
aFetchedProperties.push(getEditStateFilterPropertyInfo());
|
|
777
|
+
}
|
|
778
|
+
// add search
|
|
779
|
+
const searchRestrictions = getSearchRestrictions(converterContext);
|
|
780
|
+
const hideBasicSearch = Boolean(searchRestrictions && !searchRestrictions.Searchable);
|
|
781
|
+
if (sEntitySetPath && hideBasicSearch !== true) {
|
|
782
|
+
if (!searchRestrictions || searchRestrictions?.Searchable) {
|
|
783
|
+
aFetchedProperties.push(getSearchFilterPropertyInfo());
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
return aFetchedProperties;
|
|
788
|
+
};
|
|
789
|
+
|
|
790
|
+
export const insertCustomManifestElements = function(
|
|
791
|
+
filterFields: FilterField[],
|
|
792
|
+
entityType: EntityType,
|
|
793
|
+
converterContext: ConverterContext
|
|
794
|
+
) {
|
|
795
|
+
return insertCustomElements(filterFields, getManifestFilterFields(entityType, converterContext), {
|
|
796
|
+
"availability": "overwrite",
|
|
797
|
+
label: "overwrite",
|
|
798
|
+
type: "overwrite",
|
|
799
|
+
position: "overwrite",
|
|
800
|
+
template: "overwrite",
|
|
801
|
+
settings: "overwrite",
|
|
802
|
+
visualFilter: "overwrite"
|
|
803
|
+
});
|
|
804
|
+
};
|
|
805
|
+
|
|
406
806
|
/**
|
|
407
807
|
* Retrieve the configuration for the selection fields that will be used within the filter bar
|
|
408
808
|
* This configuration takes into account annotation and the selection variants.
|
|
409
|
-
*
|
|
410
809
|
* @param {ConverterContext} converterContext
|
|
411
810
|
* @param {TableVisualization[]} lrTables
|
|
412
811
|
* @param {string} annotationPath
|
|
@@ -416,14 +815,39 @@ export const getSelectionFields = function(
|
|
|
416
815
|
converterContext: ConverterContext,
|
|
417
816
|
lrTables: TableVisualization[] = [],
|
|
418
817
|
annotationPath: string = ""
|
|
419
|
-
):
|
|
420
|
-
|
|
421
|
-
const
|
|
818
|
+
): any {
|
|
819
|
+
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
|
|
820
|
+
const parameterFields = _getParameterFields(converterContext);
|
|
821
|
+
let propertyInfoFields: FilterField[] = JSON.parse(JSON.stringify(oAnnotatedSelectionFieldData.propertyInfoFields));
|
|
822
|
+
const entityType = oAnnotatedSelectionFieldData.entityType;
|
|
823
|
+
|
|
824
|
+
propertyInfoFields = parameterFields.concat(propertyInfoFields);
|
|
825
|
+
|
|
826
|
+
propertyInfoFields = insertCustomManifestElements(propertyInfoFields, entityType, converterContext);
|
|
827
|
+
|
|
828
|
+
const aFetchedProperties = processSelectionFields(propertyInfoFields, converterContext);
|
|
829
|
+
aFetchedProperties.sort(function(a: any, b: any) {
|
|
830
|
+
if (a.groupLabel === undefined || a.groupLabel === null) {
|
|
831
|
+
return -1;
|
|
832
|
+
}
|
|
833
|
+
if (b.groupLabel === undefined || b.groupLabel === null) {
|
|
834
|
+
return 1;
|
|
835
|
+
}
|
|
836
|
+
return a.groupLabel.localeCompare(b.groupLabel);
|
|
837
|
+
});
|
|
422
838
|
|
|
839
|
+
let sFetchProperties = JSON.stringify(aFetchedProperties);
|
|
840
|
+
sFetchProperties = sFetchProperties.replace(/\{/g, "\\{");
|
|
841
|
+
sFetchProperties = sFetchProperties.replace(/\}/g, "\\}");
|
|
842
|
+
const sPropertyInfo = sFetchProperties;
|
|
843
|
+
// end of propertyFields processing
|
|
844
|
+
|
|
845
|
+
// to populate selection fields
|
|
846
|
+
let propSelectionFields: FilterField[] = JSON.parse(JSON.stringify(oAnnotatedSelectionFieldData.propertyInfoFields));
|
|
847
|
+
propSelectionFields = parameterFields.concat(propSelectionFields);
|
|
423
848
|
// create a map of properties to be used in selection variants
|
|
424
|
-
const excludedFilterProperties: Record<string, boolean> =
|
|
425
|
-
const
|
|
426
|
-
const filterFacets = entityType.annotations.UI?.FilterFacets;
|
|
849
|
+
const excludedFilterProperties: Record<string, boolean> = oAnnotatedSelectionFieldData.excludedFilterProperties;
|
|
850
|
+
const filterFacets = entityType?.annotations?.UI?.FilterFacets;
|
|
427
851
|
let filterFacetMap: Record<string, FilterGroup> = {};
|
|
428
852
|
|
|
429
853
|
const aFieldGroups = converterContext.getAnnotationsByTerm("UI", UIAnnotationTerms.FieldGroup);
|
|
@@ -454,22 +878,10 @@ export const getSelectionFields = function(
|
|
|
454
878
|
}
|
|
455
879
|
|
|
456
880
|
// create a map of all potential filter fields based on...
|
|
457
|
-
const filterFields: Record<string, FilterField> =
|
|
458
|
-
// ...non hidden properties of the entity
|
|
459
|
-
..._getSelectionFields(entityType, "", entityType.entityProperties, false, converterContext),
|
|
460
|
-
// ...additional manifest defined navigation properties
|
|
461
|
-
..._getSelectionFieldsByPath(
|
|
462
|
-
entityType,
|
|
463
|
-
converterContext.getManifestWrapper().getFilterConfiguration().navigationProperties,
|
|
464
|
-
false,
|
|
465
|
-
converterContext
|
|
466
|
-
)
|
|
467
|
-
};
|
|
881
|
+
const filterFields: Record<string, FilterField> = oAnnotatedSelectionFieldData.filterFields;
|
|
468
882
|
|
|
469
883
|
//Filters which has to be added which is part of SV/Default annotations but not present in the SelectionFields
|
|
470
|
-
const annotatedSelectionFields =
|
|
471
|
-
entityType.annotations?.UI?.SelectionFields ||
|
|
472
|
-
[]) as PropertyPath[];
|
|
884
|
+
const annotatedSelectionFields = oAnnotatedSelectionFieldData.annotatedSelectionFields;
|
|
473
885
|
const defaultFilters = _getDefaultFilterFields(
|
|
474
886
|
filterFields,
|
|
475
887
|
aSelectOptions,
|
|
@@ -478,24 +890,9 @@ export const getSelectionFields = function(
|
|
|
478
890
|
excludedFilterProperties,
|
|
479
891
|
annotatedSelectionFields
|
|
480
892
|
);
|
|
481
|
-
const parameterFields = _getParameterFields(converterContext);
|
|
482
893
|
|
|
483
894
|
// finally create final list of filter fields by adding the SelectionFields first (order matters)...
|
|
484
|
-
let allFilters =
|
|
485
|
-
.concat(
|
|
486
|
-
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
487
|
-
const propertyPath = selectionField.value;
|
|
488
|
-
if (!(propertyPath in excludedFilterProperties)) {
|
|
489
|
-
const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
|
|
490
|
-
if (filterField) {
|
|
491
|
-
filterField.group = "";
|
|
492
|
-
filterField.groupLabel = "";
|
|
493
|
-
selectionFields.push(filterField);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
return selectionFields;
|
|
497
|
-
}, []) || []
|
|
498
|
-
)
|
|
895
|
+
let allFilters = propSelectionFields
|
|
499
896
|
// To add the FilterField which is not part of the Selection Fields but the property is mentioned in the Selection Variant
|
|
500
897
|
.concat(defaultFilters || [])
|
|
501
898
|
// ...and adding remaining filter fields, that are not used in a SelectionVariant (order doesn't matter)
|
|
@@ -522,14 +919,7 @@ export const getSelectionFields = function(
|
|
|
522
919
|
}
|
|
523
920
|
}
|
|
524
921
|
|
|
525
|
-
const selectionFields =
|
|
526
|
-
"availability": "overwrite",
|
|
527
|
-
label: "overwrite",
|
|
528
|
-
position: "overwrite",
|
|
529
|
-
template: "overwrite",
|
|
530
|
-
settings: "overwrite",
|
|
531
|
-
visualFilter: "overwrite"
|
|
532
|
-
});
|
|
922
|
+
const selectionFields = insertCustomManifestElements(allFilters, entityType, converterContext);
|
|
533
923
|
|
|
534
924
|
// Add caseSensitive property to all selection fields.
|
|
535
925
|
const isCaseSensitive = isFilteringCaseSensitive(converterContext);
|
|
@@ -537,5 +927,5 @@ export const getSelectionFields = function(
|
|
|
537
927
|
filterField.caseSensitive = isCaseSensitive;
|
|
538
928
|
});
|
|
539
929
|
|
|
540
|
-
return selectionFields;
|
|
930
|
+
return { selectionFields, sPropertyInfo };
|
|
541
931
|
};
|