@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,23 +1,23 @@
|
|
|
1
|
-
import { AvailabilityType, FilterFieldManifestConfiguration, FilterManifestConfiguration, FilterSettings } from "../../ManifestSettings";
|
|
2
1
|
import { EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
|
|
3
|
-
import ConverterContext from "sap/fe/core/converters/ConverterContext";
|
|
4
2
|
import { AnnotationTerm, DataFieldAbstractTypes, DataFieldTypes, ReferenceFacetTypes, UIAnnotationTerms } from "@sap-ux/vocabularies-types";
|
|
3
|
+
import { PropertyPath } from "@sap-ux/vocabularies-types/dist/Edm";
|
|
4
|
+
import { FieldGroup, FieldGroupType, SelectOptionType } from "@sap-ux/vocabularies-types/dist/generated/UI";
|
|
5
|
+
import { ChartVisualization } from "sap/fe/core/converters/controls/Common/Chart";
|
|
5
6
|
import {
|
|
6
7
|
getSelectionVariantConfiguration,
|
|
7
|
-
|
|
8
|
-
TableVisualization,
|
|
8
|
+
getTypeConfig,
|
|
9
9
|
isFilteringCaseSensitive,
|
|
10
|
-
|
|
10
|
+
SelectionVariantConfiguration,
|
|
11
|
+
TableVisualization
|
|
11
12
|
} from "sap/fe/core/converters/controls/Common/Table";
|
|
12
|
-
import { ChartVisualization } from "sap/fe/core/converters/controls/Common/Chart";
|
|
13
|
-
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
14
13
|
import { getVisualFilters, VisualFilters } from "sap/fe/core/converters/controls/ListReport/VisualFilters";
|
|
15
|
-
import
|
|
14
|
+
import ConverterContext from "sap/fe/core/converters/ConverterContext";
|
|
15
|
+
import { ConfigurableObject, CustomElement, insertCustomElements, Placement } from "sap/fe/core/converters/helpers/ConfigurableObject";
|
|
16
|
+
import { IssueCategory, IssueSeverity, IssueType } from "sap/fe/core/converters/helpers/IssueManager";
|
|
17
|
+
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
16
18
|
import { annotationExpression, compileBinding } from "sap/fe/core/helpers/BindingExpression";
|
|
19
|
+
import { AvailabilityType, FilterFieldManifestConfiguration, FilterManifestConfiguration, FilterSettings } from "../../ManifestSettings";
|
|
17
20
|
import { getSelectionVariant } from "../Common/DataVisualization";
|
|
18
|
-
import { KeyHelper } from "sap/fe/core/converters/helpers/Key";
|
|
19
|
-
import { IssueType, IssueSeverity, IssueCategory } from "sap/fe/core/converters/helpers/IssueManager";
|
|
20
|
-
import { PropertyPath } from "@sap-ux/vocabularies-types/dist/Edm";
|
|
21
21
|
//import { hasValueHelp } from "sap/fe/core/templating/PropertyHelper";
|
|
22
22
|
|
|
23
23
|
export type FilterField = ConfigurableObject & {
|
|
@@ -74,7 +74,7 @@ function getFieldGroupFilterGroups(fieldGroup: AnnotationTerm<FieldGroupType>):
|
|
|
74
74
|
|
|
75
75
|
function getExcludedFilterProperties(selectionVariants: SelectionVariantConfiguration[]): Record<string, boolean> {
|
|
76
76
|
return selectionVariants.reduce((previousValue: Record<string, boolean>, selectionVariant) => {
|
|
77
|
-
selectionVariant.propertyNames.forEach(propertyName => {
|
|
77
|
+
selectionVariant.propertyNames.forEach((propertyName) => {
|
|
78
78
|
previousValue[propertyName] = true;
|
|
79
79
|
});
|
|
80
80
|
return previousValue;
|
|
@@ -89,7 +89,7 @@ function getExcludedFilterProperties(selectionVariants: SelectionVariantConfigur
|
|
|
89
89
|
*/
|
|
90
90
|
function checkAllTableForEntitySetAreAnalytical(listReportTables: TableVisualization[], contextPath: string | undefined) {
|
|
91
91
|
if (contextPath && listReportTables.length > 0) {
|
|
92
|
-
return listReportTables.every(visualization => {
|
|
92
|
+
return listReportTables.every((visualization) => {
|
|
93
93
|
return visualization.enableAnalytics && contextPath === visualization.annotation.collection;
|
|
94
94
|
});
|
|
95
95
|
}
|
|
@@ -102,13 +102,13 @@ function getSelectionVariants(
|
|
|
102
102
|
): SelectionVariantConfiguration[] {
|
|
103
103
|
const selectionVariantPaths: string[] = [];
|
|
104
104
|
return lrTableVisualizations
|
|
105
|
-
.map(visualization => {
|
|
105
|
+
.map((visualization) => {
|
|
106
106
|
const tableFilters = visualization.control.filters;
|
|
107
107
|
const tableSVConfigs: SelectionVariantConfiguration[] = [];
|
|
108
108
|
for (const key in tableFilters) {
|
|
109
109
|
if (Array.isArray(tableFilters[key].paths)) {
|
|
110
110
|
const paths = tableFilters[key].paths;
|
|
111
|
-
paths.forEach(path => {
|
|
111
|
+
paths.forEach((path) => {
|
|
112
112
|
if (path && path.annotationPath && selectionVariantPaths.indexOf(path.annotationPath) === -1) {
|
|
113
113
|
selectionVariantPaths.push(path.annotationPath);
|
|
114
114
|
const selectionVariantConfig = getSelectionVariantConfiguration(path.annotationPath, converterContext);
|
|
@@ -132,7 +132,7 @@ function getSelectionVariants(
|
|
|
132
132
|
* @param propertyPath The full path to the target property
|
|
133
133
|
* @returns {string} The formatted condition path
|
|
134
134
|
*/
|
|
135
|
-
const _getConditionPath = function(entityType: EntityType, propertyPath: string): string {
|
|
135
|
+
const _getConditionPath = function (entityType: EntityType, propertyPath: string): string {
|
|
136
136
|
const parts = propertyPath.split("/");
|
|
137
137
|
let partialPath;
|
|
138
138
|
let key = "";
|
|
@@ -148,7 +148,7 @@ const _getConditionPath = function(entityType: EntityType, propertyPath: string)
|
|
|
148
148
|
return key;
|
|
149
149
|
};
|
|
150
150
|
|
|
151
|
-
const _createFilterSelectionField = function(
|
|
151
|
+
const _createFilterSelectionField = function (
|
|
152
152
|
entityType: EntityType,
|
|
153
153
|
property: Property,
|
|
154
154
|
fullPropertyPath: string,
|
|
@@ -242,7 +242,7 @@ export function getModelType(sType: any) {
|
|
|
242
242
|
};
|
|
243
243
|
return sType && sType in mDefaultTypeForEdmType && mDefaultTypeForEdmType[sType].modelType;
|
|
244
244
|
}
|
|
245
|
-
const _getSelectionFields = function(
|
|
245
|
+
const _getSelectionFields = function (
|
|
246
246
|
entityType: EntityType,
|
|
247
247
|
navigationPath: string,
|
|
248
248
|
properties: Array<Property> | undefined,
|
|
@@ -263,7 +263,7 @@ const _getSelectionFields = function(
|
|
|
263
263
|
return selectionFieldMap;
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
-
const _getSelectionFieldsByPath = function(
|
|
266
|
+
const _getSelectionFieldsByPath = function (
|
|
267
267
|
entityType: EntityType,
|
|
268
268
|
propertyPaths: Array<string> | undefined,
|
|
269
269
|
includeHidden: boolean,
|
|
@@ -297,12 +297,7 @@ const _getSelectionFieldsByPath = function(
|
|
|
297
297
|
converterContext
|
|
298
298
|
);
|
|
299
299
|
} else {
|
|
300
|
-
const navigationPath = propertyPath.includes("/")
|
|
301
|
-
? propertyPath
|
|
302
|
-
.split("/")
|
|
303
|
-
.splice(0, 1)
|
|
304
|
-
.join("/")
|
|
305
|
-
: "";
|
|
300
|
+
const navigationPath = propertyPath.includes("/") ? propertyPath.split("/").splice(0, 1).join("/") : "";
|
|
306
301
|
localSelectionFields = _getSelectionFields(entityType, navigationPath, [property], includeHidden, converterContext);
|
|
307
302
|
}
|
|
308
303
|
|
|
@@ -315,13 +310,14 @@ const _getSelectionFieldsByPath = function(
|
|
|
315
310
|
return selectionFields;
|
|
316
311
|
};
|
|
317
312
|
|
|
318
|
-
const _getFilterField = function(
|
|
313
|
+
const _getFilterField = function (
|
|
319
314
|
filterFields: Record<string, FilterField>,
|
|
320
315
|
propertyPath: string,
|
|
321
316
|
converterContext: ConverterContext,
|
|
322
317
|
entityType: EntityType
|
|
323
318
|
): FilterField | undefined {
|
|
324
319
|
let filterField: FilterField | undefined = filterFields[propertyPath];
|
|
320
|
+
const availability = filterField && filterField.availability;
|
|
325
321
|
if (filterField) {
|
|
326
322
|
delete filterFields[propertyPath];
|
|
327
323
|
} else {
|
|
@@ -332,14 +328,13 @@ const _getFilterField = function(
|
|
|
332
328
|
}
|
|
333
329
|
// defined SelectionFields are available by default
|
|
334
330
|
if (filterField) {
|
|
335
|
-
filterField.availability = AvailabilityType.Default;
|
|
331
|
+
filterField.availability = availability === AvailabilityType.Hidden ? AvailabilityType.Hidden : AvailabilityType.Default;
|
|
336
332
|
filterField.isParameter = !!entityType.annotations?.Common?.ResultContext;
|
|
337
333
|
}
|
|
338
334
|
return filterField;
|
|
339
335
|
};
|
|
340
336
|
|
|
341
|
-
const _getDefaultFilterFields = function(
|
|
342
|
-
filterFields: Record<string, FilterField>,
|
|
337
|
+
const _getDefaultFilterFields = function (
|
|
343
338
|
aSelectOptions: any[],
|
|
344
339
|
entityType: EntityType,
|
|
345
340
|
converterContext: ConverterContext,
|
|
@@ -350,7 +345,7 @@ const _getDefaultFilterFields = function(
|
|
|
350
345
|
const UISelectionFields: any = {};
|
|
351
346
|
const properties = entityType.entityProperties;
|
|
352
347
|
// Using entityType instead of entitySet
|
|
353
|
-
annotatedSelectionFields?.forEach(SelectionField => {
|
|
348
|
+
annotatedSelectionFields?.forEach((SelectionField) => {
|
|
354
349
|
UISelectionFields[SelectionField.value] = true;
|
|
355
350
|
});
|
|
356
351
|
if (aSelectOptions && aSelectOptions.length > 0) {
|
|
@@ -358,12 +353,12 @@ const _getDefaultFilterFields = function(
|
|
|
358
353
|
const propertyName: any = selectOption.PropertyName;
|
|
359
354
|
const sPropertyPath: string = propertyName.value;
|
|
360
355
|
const UISelectionFields: any = {};
|
|
361
|
-
annotatedSelectionFields?.forEach(SelectionField => {
|
|
356
|
+
annotatedSelectionFields?.forEach((SelectionField) => {
|
|
362
357
|
UISelectionFields[SelectionField.value] = true;
|
|
363
358
|
});
|
|
364
359
|
if (!(sPropertyPath in excludedFilterProperties)) {
|
|
365
360
|
if (!(sPropertyPath in UISelectionFields)) {
|
|
366
|
-
const FilterField: FilterField | undefined =
|
|
361
|
+
const FilterField: FilterField | undefined = getFilterField(sPropertyPath, converterContext, entityType);
|
|
367
362
|
if (FilterField) {
|
|
368
363
|
selectionFields.push(FilterField);
|
|
369
364
|
}
|
|
@@ -376,7 +371,7 @@ const _getDefaultFilterFields = function(
|
|
|
376
371
|
const PropertyPath = property.name;
|
|
377
372
|
if (!(PropertyPath in excludedFilterProperties)) {
|
|
378
373
|
if (defaultFilterValue && !(PropertyPath in UISelectionFields)) {
|
|
379
|
-
const FilterField: FilterField | undefined =
|
|
374
|
+
const FilterField: FilterField | undefined = getFilterField(PropertyPath, converterContext, entityType);
|
|
380
375
|
if (FilterField) {
|
|
381
376
|
selectionFields.push(FilterField);
|
|
382
377
|
}
|
|
@@ -395,15 +390,22 @@ const _getDefaultFilterFields = function(
|
|
|
395
390
|
function _getParameterFields(converterContext: ConverterContext): FilterField[] {
|
|
396
391
|
const dataModelObjectPath = converterContext.getDataModelObjectPath();
|
|
397
392
|
const parameterEntityType = dataModelObjectPath.startingEntitySet.entityType;
|
|
398
|
-
const isParameterized = !!parameterEntityType.annotations?.Common?.ResultContext;
|
|
393
|
+
const isParameterized = !!parameterEntityType.annotations?.Common?.ResultContext && !dataModelObjectPath.targetEntitySet;
|
|
399
394
|
const parameterConverterContext =
|
|
400
395
|
isParameterized && converterContext.getConverterContextFor("/" + dataModelObjectPath.startingEntitySet.name);
|
|
401
396
|
|
|
402
|
-
const parameterFields = (
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
397
|
+
const parameterFields = (
|
|
398
|
+
parameterConverterContext
|
|
399
|
+
? parameterEntityType.entityProperties.map(function (property) {
|
|
400
|
+
return _getFilterField(
|
|
401
|
+
{} as Record<string, FilterField>,
|
|
402
|
+
property.name,
|
|
403
|
+
parameterConverterContext,
|
|
404
|
+
parameterEntityType
|
|
405
|
+
);
|
|
406
|
+
})
|
|
407
|
+
: []
|
|
408
|
+
) as FilterField[];
|
|
407
409
|
|
|
408
410
|
return parameterFields;
|
|
409
411
|
}
|
|
@@ -416,17 +418,17 @@ function _getParameterFields(converterContext: ConverterContext): FilterField[]
|
|
|
416
418
|
* @param {ConverterContext} converterContext The converter context
|
|
417
419
|
* @returns {boolean} The information if the FilterBar search field is hidden or not
|
|
418
420
|
*/
|
|
419
|
-
export const getFilterBarhideBasicSearch = function(
|
|
421
|
+
export const getFilterBarhideBasicSearch = function (
|
|
420
422
|
listReportTables: TableVisualization[],
|
|
421
423
|
charts: ChartVisualization[],
|
|
422
424
|
converterContext: ConverterContext
|
|
423
425
|
): boolean {
|
|
424
426
|
// Check if charts allow search
|
|
425
|
-
const noSearchInCharts = charts.length === 0 || charts.every(chart => !chart.applySupported.enableSearch);
|
|
427
|
+
const noSearchInCharts = charts.length === 0 || charts.every((chart) => !chart.applySupported.enableSearch);
|
|
426
428
|
|
|
427
429
|
// Check if all tables are analytical and none of them allow for search
|
|
428
430
|
const noSearchInTables =
|
|
429
|
-
listReportTables.length === 0 || listReportTables.every(table => table.enableAnalytics && !table.enableAnalyticsSearch);
|
|
431
|
+
listReportTables.length === 0 || listReportTables.every((table) => table.enableAnalytics && !table.enableAnalyticsSearch);
|
|
430
432
|
|
|
431
433
|
const contextPath = converterContext.getContextPath();
|
|
432
434
|
if (contextPath && noSearchInCharts && noSearchInTables) {
|
|
@@ -443,7 +445,7 @@ export const getFilterBarhideBasicSearch = function(
|
|
|
443
445
|
* @param converterContext The converter context
|
|
444
446
|
* @returns {Record<string, CustomElementFilterField>} The filter fields defined in the manifest
|
|
445
447
|
*/
|
|
446
|
-
export const getManifestFilterFields = function(
|
|
448
|
+
export const getManifestFilterFields = function (
|
|
447
449
|
entityType: EntityType,
|
|
448
450
|
converterContext: ConverterContext
|
|
449
451
|
): Record<string, CustomElementFilterField> {
|
|
@@ -451,7 +453,7 @@ export const getManifestFilterFields = function(
|
|
|
451
453
|
const definedFilterFields: Record<string, FilterFieldManifestConfiguration> = fbConfig?.filterFields || {};
|
|
452
454
|
const selectionFields: Record<string, FilterField> = _getSelectionFieldsByPath(
|
|
453
455
|
entityType,
|
|
454
|
-
Object.keys(definedFilterFields).map(key => KeyHelper.getPathFromSelectionFieldKey(key)),
|
|
456
|
+
Object.keys(definedFilterFields).map((key) => KeyHelper.getPathFromSelectionFieldKey(key)),
|
|
455
457
|
true,
|
|
456
458
|
converterContext
|
|
457
459
|
);
|
|
@@ -482,15 +484,15 @@ export const getManifestFilterFields = function(
|
|
|
482
484
|
return filterFields;
|
|
483
485
|
};
|
|
484
486
|
|
|
485
|
-
export const getFilterField = function(propertyPath: string, converterContext: ConverterContext, entityType: EntityType) {
|
|
487
|
+
export const getFilterField = function (propertyPath: string, converterContext: ConverterContext, entityType: EntityType) {
|
|
486
488
|
return _getFilterField({}, propertyPath, converterContext, entityType);
|
|
487
489
|
};
|
|
488
490
|
|
|
489
|
-
export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any, sRestriction: any) {
|
|
491
|
+
export const getFilterRestrictions = function (oFilterRestrictionsAnnotation: any, sRestriction: any) {
|
|
490
492
|
if (sRestriction === "RequiredProperties" || sRestriction === "NonFilterableProperties") {
|
|
491
493
|
let aProps = [];
|
|
492
494
|
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation[sRestriction]) {
|
|
493
|
-
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function(oProperty: any) {
|
|
495
|
+
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function (oProperty: any) {
|
|
494
496
|
return oProperty.$PropertyPath || oProperty.value;
|
|
495
497
|
});
|
|
496
498
|
}
|
|
@@ -498,7 +500,7 @@ export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any
|
|
|
498
500
|
} else if (sRestriction === "FilterAllowedExpressions") {
|
|
499
501
|
const mAllowedExpressions = {} as any;
|
|
500
502
|
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation.FilterExpressionRestrictions) {
|
|
501
|
-
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function(oProperty: any) {
|
|
503
|
+
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function (oProperty: any) {
|
|
502
504
|
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
503
505
|
if (mAllowedExpressions[oProperty.Property.value]) {
|
|
504
506
|
mAllowedExpressions[oProperty.Property.value].push(oProperty.AllowedExpressions);
|
|
@@ -512,7 +514,7 @@ export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any
|
|
|
512
514
|
return oFilterRestrictionsAnnotation;
|
|
513
515
|
};
|
|
514
516
|
|
|
515
|
-
const getSearchFilterPropertyInfo = function() {
|
|
517
|
+
const getSearchFilterPropertyInfo = function () {
|
|
516
518
|
return {
|
|
517
519
|
name: "$search",
|
|
518
520
|
path: "$search",
|
|
@@ -521,7 +523,7 @@ const getSearchFilterPropertyInfo = function() {
|
|
|
521
523
|
};
|
|
522
524
|
};
|
|
523
525
|
|
|
524
|
-
const getEditStateFilterPropertyInfo = function() {
|
|
526
|
+
const getEditStateFilterPropertyInfo = function () {
|
|
525
527
|
return {
|
|
526
528
|
name: "$editState",
|
|
527
529
|
path: "$editState",
|
|
@@ -532,16 +534,16 @@ const getEditStateFilterPropertyInfo = function() {
|
|
|
532
534
|
};
|
|
533
535
|
};
|
|
534
536
|
|
|
535
|
-
const getSearchRestrictions = function(converterContext: ConverterContext) {
|
|
537
|
+
const getSearchRestrictions = function (converterContext: ConverterContext) {
|
|
536
538
|
return converterContext.getEntitySet()?.annotations?.Capabilities?.SearchRestrictions;
|
|
537
539
|
};
|
|
538
540
|
|
|
539
|
-
export const getNavigationRestrictions = function(converterContext: ConverterContext, sNavigationPath: string) {
|
|
541
|
+
export const getNavigationRestrictions = function (converterContext: ConverterContext, sNavigationPath: string) {
|
|
540
542
|
const oNavigationRestrictions: any = converterContext.getEntitySet()?.annotations?.Capabilities?.NavigationRestrictions;
|
|
541
543
|
const aRestrictedProperties = oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties;
|
|
542
544
|
return (
|
|
543
545
|
aRestrictedProperties &&
|
|
544
|
-
aRestrictedProperties.find(function(oRestrictedProperty: any) {
|
|
546
|
+
aRestrictedProperties.find(function (oRestrictedProperty: any) {
|
|
545
547
|
return (
|
|
546
548
|
oRestrictedProperty &&
|
|
547
549
|
oRestrictedProperty.NavigationProperty &&
|
|
@@ -552,7 +554,7 @@ export const getNavigationRestrictions = function(converterContext: ConverterCon
|
|
|
552
554
|
);
|
|
553
555
|
};
|
|
554
556
|
|
|
555
|
-
const _fetchBasicPropertyInfo = function(oFilterFieldInfo: any) {
|
|
557
|
+
const _fetchBasicPropertyInfo = function (oFilterFieldInfo: any) {
|
|
556
558
|
return {
|
|
557
559
|
key: oFilterFieldInfo.key,
|
|
558
560
|
annotationPath: oFilterFieldInfo.annotationPath,
|
|
@@ -571,7 +573,7 @@ const _fetchBasicPropertyInfo = function(oFilterFieldInfo: any) {
|
|
|
571
573
|
};
|
|
572
574
|
};
|
|
573
575
|
|
|
574
|
-
export const getSpecificAllowedExpression = function(aExpressions: any) {
|
|
576
|
+
export const getSpecificAllowedExpression = function (aExpressions: any) {
|
|
575
577
|
const aAllowedExpressionsPriority = [
|
|
576
578
|
"SingleValue",
|
|
577
579
|
"MultiValue",
|
|
@@ -581,14 +583,14 @@ export const getSpecificAllowedExpression = function(aExpressions: any) {
|
|
|
581
583
|
"MultiRangeOrSearchExpression"
|
|
582
584
|
];
|
|
583
585
|
|
|
584
|
-
aExpressions.sort(function(a: any, b: any) {
|
|
586
|
+
aExpressions.sort(function (a: any, b: any) {
|
|
585
587
|
return aAllowedExpressionsPriority.indexOf(a) - aAllowedExpressionsPriority.indexOf(b);
|
|
586
588
|
});
|
|
587
589
|
|
|
588
590
|
return aExpressions[0];
|
|
589
591
|
};
|
|
590
592
|
|
|
591
|
-
export const displayMode = function(oPropertyAnnotations: any, oCollectionAnnotations: any) {
|
|
593
|
+
export const displayMode = function (oPropertyAnnotations: any, oCollectionAnnotations: any) {
|
|
592
594
|
const oTextAnnotation = oPropertyAnnotations?.Common?.Text,
|
|
593
595
|
oTextArrangmentAnnotation =
|
|
594
596
|
oTextAnnotation &&
|
|
@@ -606,7 +608,7 @@ export const displayMode = function(oPropertyAnnotations: any, oCollectionAnnota
|
|
|
606
608
|
return oTextAnnotation ? "DescriptionValue" : "Value";
|
|
607
609
|
};
|
|
608
610
|
|
|
609
|
-
const _fetchPropertyInfo = function(converterContext: ConverterContext, oFilterFieldInfo: any, oTypeConfig: any) {
|
|
611
|
+
const _fetchPropertyInfo = function (converterContext: ConverterContext, oFilterFieldInfo: any, oTypeConfig: any) {
|
|
610
612
|
let oPropertyInfo = _fetchBasicPropertyInfo(oFilterFieldInfo);
|
|
611
613
|
const sAnnotationPath = oFilterFieldInfo.annotationPath;
|
|
612
614
|
|
|
@@ -628,7 +630,7 @@ const _fetchPropertyInfo = function(converterContext: ConverterContext, oFilterF
|
|
|
628
630
|
return oPropertyInfo;
|
|
629
631
|
};
|
|
630
632
|
|
|
631
|
-
export const isMultiValue = function(oProperty: any) {
|
|
633
|
+
export const isMultiValue = function (oProperty: any) {
|
|
632
634
|
let bIsMultiValue = true;
|
|
633
635
|
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
634
636
|
switch (oProperty.filterExpression) {
|
|
@@ -646,10 +648,11 @@ export const isMultiValue = function(oProperty: any) {
|
|
|
646
648
|
return bIsMultiValue;
|
|
647
649
|
};
|
|
648
650
|
|
|
649
|
-
const getAnnotatedSelectionFieldData = function(
|
|
651
|
+
const getAnnotatedSelectionFieldData = function (
|
|
650
652
|
converterContext: ConverterContext,
|
|
651
653
|
lrTables: TableVisualization[] = [],
|
|
652
|
-
annotationPath: string = ""
|
|
654
|
+
annotationPath: string = "",
|
|
655
|
+
includeHidden: boolean = false
|
|
653
656
|
) {
|
|
654
657
|
// Fetch all selectionVariants defined in the different visualizations and different views (multi table mode)
|
|
655
658
|
const selectionVariants: SelectionVariantConfiguration[] = getSelectionVariants(lrTables, converterContext);
|
|
@@ -665,15 +668,20 @@ const getAnnotatedSelectionFieldData = function(
|
|
|
665
668
|
// create a map of all potential filter fields based on...
|
|
666
669
|
const filterFields: Record<string, FilterField> = {
|
|
667
670
|
// ...non hidden properties of the entity
|
|
668
|
-
..._getSelectionFields(entityType, "", entityType.entityProperties,
|
|
671
|
+
..._getSelectionFields(entityType, "", entityType.entityProperties, includeHidden, converterContext),
|
|
669
672
|
// ...additional manifest defined navigation properties
|
|
670
673
|
..._getSelectionFieldsByPath(
|
|
671
674
|
entityType,
|
|
672
675
|
converterContext.getManifestWrapper().getFilterConfiguration().navigationProperties,
|
|
673
|
-
|
|
676
|
+
includeHidden,
|
|
674
677
|
converterContext
|
|
675
678
|
)
|
|
676
679
|
};
|
|
680
|
+
let aSelectOptions: any[] = [];
|
|
681
|
+
const selectionVariant = getSelectionVariant(entityType, converterContext);
|
|
682
|
+
if (selectionVariant) {
|
|
683
|
+
aSelectOptions = selectionVariant.SelectOptions;
|
|
684
|
+
}
|
|
677
685
|
|
|
678
686
|
const propertyInfoFields: any =
|
|
679
687
|
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
@@ -689,36 +697,55 @@ const getAnnotatedSelectionFieldData = function(
|
|
|
689
697
|
return selectionFields;
|
|
690
698
|
}, []) || [];
|
|
691
699
|
|
|
700
|
+
const defaultFilterFields = _getDefaultFilterFields(
|
|
701
|
+
aSelectOptions,
|
|
702
|
+
entityType,
|
|
703
|
+
converterContext,
|
|
704
|
+
excludedFilterProperties,
|
|
705
|
+
annotatedSelectionFields
|
|
706
|
+
);
|
|
707
|
+
|
|
692
708
|
return {
|
|
693
709
|
excludedFilterProperties: excludedFilterProperties,
|
|
694
710
|
entityType: entityType,
|
|
695
711
|
annotatedSelectionFields: annotatedSelectionFields,
|
|
696
712
|
filterFields: filterFields,
|
|
697
|
-
propertyInfoFields: propertyInfoFields
|
|
713
|
+
propertyInfoFields: propertyInfoFields,
|
|
714
|
+
defaultFilterFields: defaultFilterFields
|
|
698
715
|
};
|
|
699
716
|
};
|
|
700
|
-
export const processSelectionFields = function(
|
|
717
|
+
export const processSelectionFields = function (
|
|
718
|
+
propertyInfoFields: any,
|
|
719
|
+
converterContext: ConverterContext,
|
|
720
|
+
defaultValuePropertyFields?: any
|
|
721
|
+
) {
|
|
701
722
|
//get TypeConfig function
|
|
702
|
-
const aTypeConfig: any = [];
|
|
703
723
|
const selectionFieldTypes: any = [];
|
|
704
|
-
const
|
|
705
|
-
|
|
724
|
+
const aTypeConfig: any = {};
|
|
725
|
+
const _fnTypeConfig = function (property: Property, key: string) {
|
|
726
|
+
const oTypeConfig = getTypeConfig(property, property?.type);
|
|
706
727
|
selectionFieldTypes.push(property?.type);
|
|
707
|
-
if (
|
|
728
|
+
if (
|
|
729
|
+
property?.type === sEdmString &&
|
|
730
|
+
(oTypeConfig.constraints.nullable === undefined || oTypeConfig.constraints.nullable === true)
|
|
731
|
+
) {
|
|
708
732
|
oTypeConfig.formatOptions.parseKeepsEmptyString = false;
|
|
709
733
|
}
|
|
710
|
-
aTypeConfig
|
|
734
|
+
aTypeConfig[key] = oTypeConfig;
|
|
711
735
|
};
|
|
712
736
|
|
|
737
|
+
if (defaultValuePropertyFields) {
|
|
738
|
+
propertyInfoFields = propertyInfoFields.concat(defaultValuePropertyFields);
|
|
739
|
+
}
|
|
713
740
|
//add typeConfig
|
|
714
|
-
propertyInfoFields.forEach(function(parameterField: any) {
|
|
741
|
+
propertyInfoFields.forEach(function (parameterField: any) {
|
|
715
742
|
if (parameterField.annotationPath) {
|
|
716
743
|
const propertyConvertyContext = converterContext.getConverterContextFor(parameterField.annotationPath);
|
|
717
744
|
const propertyTargetObject = propertyConvertyContext.getDataModelObjectPath().targetObject;
|
|
718
|
-
_fnTypeConfig(propertyTargetObject);
|
|
745
|
+
_fnTypeConfig(propertyTargetObject, parameterField.key);
|
|
719
746
|
} else {
|
|
720
747
|
selectionFieldTypes.push(sEdmString);
|
|
721
|
-
aTypeConfig.
|
|
748
|
+
aTypeConfig[parameterField.key] = { type: sStringDataType };
|
|
722
749
|
}
|
|
723
750
|
});
|
|
724
751
|
|
|
@@ -750,20 +777,20 @@ export const processSelectionFields = function(propertyInfoFields: any, converte
|
|
|
750
777
|
const aFetchedProperties: any = [];
|
|
751
778
|
|
|
752
779
|
// process the fields to add necessary properties
|
|
753
|
-
|
|
754
|
-
const oConvertedProperty =
|
|
780
|
+
propertyInfoFields.forEach(function (propertyInfoField: any) {
|
|
781
|
+
const oConvertedProperty = propertyInfoField;
|
|
755
782
|
let sPropertyPath;
|
|
756
783
|
if (oConvertedProperty.conditionPath) {
|
|
757
784
|
sPropertyPath = oConvertedProperty.conditionPath.replace(/\+|\*/g, "");
|
|
758
785
|
}
|
|
759
786
|
if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
|
|
760
|
-
oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[
|
|
787
|
+
oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[propertyInfoField.key]);
|
|
761
788
|
if (oPropertyInfo) {
|
|
762
789
|
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
763
790
|
maxConditions: !oPropertyInfo.isParameter && isMultiValue(oPropertyInfo) ? -1 : 1,
|
|
764
791
|
required: oPropertyInfo.isParameter || aRequiredProps.indexOf(sPropertyPath) >= 0,
|
|
765
792
|
caseSensitive: isCaseSensitive,
|
|
766
|
-
dataType:
|
|
793
|
+
dataType: aTypeConfig[propertyInfoField.key].type
|
|
767
794
|
});
|
|
768
795
|
|
|
769
796
|
aFetchedProperties.push(oPropertyInfo);
|
|
@@ -787,7 +814,7 @@ export const processSelectionFields = function(propertyInfoFields: any, converte
|
|
|
787
814
|
return aFetchedProperties;
|
|
788
815
|
};
|
|
789
816
|
|
|
790
|
-
export const insertCustomManifestElements = function(
|
|
817
|
+
export const insertCustomManifestElements = function (
|
|
791
818
|
filterFields: FilterField[],
|
|
792
819
|
entityType: EntityType,
|
|
793
820
|
converterContext: ConverterContext
|
|
@@ -811,12 +838,13 @@ export const insertCustomManifestElements = function(
|
|
|
811
838
|
* @param {string} annotationPath
|
|
812
839
|
* @returns {FilterSelectionField[]} An array of selection fields
|
|
813
840
|
*/
|
|
814
|
-
export const getSelectionFields = function(
|
|
841
|
+
export const getSelectionFields = function (
|
|
815
842
|
converterContext: ConverterContext,
|
|
816
843
|
lrTables: TableVisualization[] = [],
|
|
817
|
-
annotationPath: string = ""
|
|
844
|
+
annotationPath: string = "",
|
|
845
|
+
includeHidden?: boolean
|
|
818
846
|
): any {
|
|
819
|
-
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
|
|
847
|
+
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath, includeHidden);
|
|
820
848
|
const parameterFields = _getParameterFields(converterContext);
|
|
821
849
|
let propertyInfoFields: FilterField[] = JSON.parse(JSON.stringify(oAnnotatedSelectionFieldData.propertyInfoFields));
|
|
822
850
|
const entityType = oAnnotatedSelectionFieldData.entityType;
|
|
@@ -825,8 +853,12 @@ export const getSelectionFields = function(
|
|
|
825
853
|
|
|
826
854
|
propertyInfoFields = insertCustomManifestElements(propertyInfoFields, entityType, converterContext);
|
|
827
855
|
|
|
828
|
-
const aFetchedProperties = processSelectionFields(
|
|
829
|
-
|
|
856
|
+
const aFetchedProperties = processSelectionFields(
|
|
857
|
+
propertyInfoFields,
|
|
858
|
+
converterContext,
|
|
859
|
+
oAnnotatedSelectionFieldData.defaultFilterFields
|
|
860
|
+
);
|
|
861
|
+
aFetchedProperties.sort(function (a: any, b: any) {
|
|
830
862
|
if (a.groupLabel === undefined || a.groupLabel === null) {
|
|
831
863
|
return -1;
|
|
832
864
|
}
|
|
@@ -871,35 +903,17 @@ export const getSelectionFields = function(
|
|
|
871
903
|
}, {});
|
|
872
904
|
}
|
|
873
905
|
|
|
874
|
-
let aSelectOptions: any[] = [];
|
|
875
|
-
const selectionVariant = getSelectionVariant(entityType, converterContext);
|
|
876
|
-
if (selectionVariant) {
|
|
877
|
-
aSelectOptions = selectionVariant.SelectOptions;
|
|
878
|
-
}
|
|
879
|
-
|
|
880
906
|
// create a map of all potential filter fields based on...
|
|
881
907
|
const filterFields: Record<string, FilterField> = oAnnotatedSelectionFieldData.filterFields;
|
|
882
908
|
|
|
883
|
-
//Filters which has to be added which is part of SV/Default annotations but not present in the SelectionFields
|
|
884
|
-
const annotatedSelectionFields = oAnnotatedSelectionFieldData.annotatedSelectionFields;
|
|
885
|
-
const defaultFilters = _getDefaultFilterFields(
|
|
886
|
-
filterFields,
|
|
887
|
-
aSelectOptions,
|
|
888
|
-
entityType,
|
|
889
|
-
converterContext,
|
|
890
|
-
excludedFilterProperties,
|
|
891
|
-
annotatedSelectionFields
|
|
892
|
-
);
|
|
893
|
-
|
|
894
909
|
// finally create final list of filter fields by adding the SelectionFields first (order matters)...
|
|
895
910
|
let allFilters = propSelectionFields
|
|
896
|
-
|
|
897
|
-
.concat(defaultFilters || [])
|
|
911
|
+
|
|
898
912
|
// ...and adding remaining filter fields, that are not used in a SelectionVariant (order doesn't matter)
|
|
899
913
|
.concat(
|
|
900
914
|
Object.keys(filterFields)
|
|
901
|
-
.filter(propertyPath => !(propertyPath in excludedFilterProperties))
|
|
902
|
-
.map(propertyPath => {
|
|
915
|
+
.filter((propertyPath) => !(propertyPath in excludedFilterProperties))
|
|
916
|
+
.map((propertyPath) => {
|
|
903
917
|
return Object.assign(filterFields[propertyPath], filterFacetMap[propertyPath]);
|
|
904
918
|
})
|
|
905
919
|
);
|
|
@@ -912,8 +926,8 @@ export const getSelectionFields = function(
|
|
|
912
926
|
// LR to get aggregates (without currency/unit properties since we expect to be able to filter them).
|
|
913
927
|
const aggregates = lrTables[0].aggregates;
|
|
914
928
|
if (aggregates) {
|
|
915
|
-
const aggregatableProperties: string[] = Object.keys(aggregates).map(aggregateKey => aggregates[aggregateKey].relativePath);
|
|
916
|
-
allFilters = allFilters.filter(filterField => {
|
|
929
|
+
const aggregatableProperties: string[] = Object.keys(aggregates).map((aggregateKey) => aggregates[aggregateKey].relativePath);
|
|
930
|
+
allFilters = allFilters.filter((filterField) => {
|
|
917
931
|
return aggregatableProperties.indexOf(filterField.key) === -1;
|
|
918
932
|
});
|
|
919
933
|
}
|
|
@@ -923,9 +937,34 @@ export const getSelectionFields = function(
|
|
|
923
937
|
|
|
924
938
|
// Add caseSensitive property to all selection fields.
|
|
925
939
|
const isCaseSensitive = isFilteringCaseSensitive(converterContext);
|
|
926
|
-
selectionFields.forEach(filterField => {
|
|
940
|
+
selectionFields.forEach((filterField) => {
|
|
927
941
|
filterField.caseSensitive = isCaseSensitive;
|
|
928
942
|
});
|
|
929
943
|
|
|
930
944
|
return { selectionFields, sPropertyInfo };
|
|
931
945
|
};
|
|
946
|
+
|
|
947
|
+
/**
|
|
948
|
+
* Determines whether the filter bar inside a value help dialog should be expanded. This is true if one of the following condition holds:
|
|
949
|
+
* (1) a filter property is mandatory,
|
|
950
|
+
* (2) no search field exists (entity isn't search enabled),
|
|
951
|
+
* (3) when the data isn't loaded by default (annotation FetchValues = 2).
|
|
952
|
+
* @param {ConverterContext} converterContext The converter context
|
|
953
|
+
* @param {any} filterRestrictionsAnnotation The FilterRestriction annotation
|
|
954
|
+
* @param {any} valueListAnnotation The ValueList annotation
|
|
955
|
+
* @returns {boolean} The value for expandFilterFields
|
|
956
|
+
*/
|
|
957
|
+
export const getExpandFilterFields = function (
|
|
958
|
+
converterContext: ConverterContext,
|
|
959
|
+
filterRestrictionsAnnotation: any,
|
|
960
|
+
valueListAnnotation: any
|
|
961
|
+
): boolean {
|
|
962
|
+
const requiredProperties = getFilterRestrictions(filterRestrictionsAnnotation, "RequiredProperties");
|
|
963
|
+
const searchRestrictions = getSearchRestrictions(converterContext);
|
|
964
|
+
const hideBasicSearch = Boolean(searchRestrictions && !searchRestrictions.Searchable);
|
|
965
|
+
const valueList = valueListAnnotation.getObject();
|
|
966
|
+
if (requiredProperties.length > 0 || hideBasicSearch || valueList?.FetchValues === 2) {
|
|
967
|
+
return true;
|
|
968
|
+
}
|
|
969
|
+
return false;
|
|
970
|
+
};
|