@sapui5/sap.fe.core 1.99.0 → 1.101.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -4
- package/src/sap/fe/core/.library +2 -3
- package/src/sap/fe/core/AnnotationHelper.js +43 -92
- package/src/sap/fe/core/AnnotationHelper.ts +43 -107
- package/src/sap/fe/core/AppComponent.js +381 -399
- package/src/sap/fe/core/AppComponent.ts +397 -0
- package/src/sap/fe/core/AppStateHandler.js +131 -162
- package/src/sap/fe/core/AppStateHandler.ts +2 -2
- package/src/sap/fe/core/BaseController.js +82 -58
- package/src/sap/fe/core/BaseController.ts +67 -0
- package/src/sap/fe/core/CommonUtils.js +179 -31
- package/src/sap/fe/core/CommonUtils.ts +295 -125
- package/src/sap/fe/core/ExtensionAPI.js +279 -274
- package/src/sap/fe/core/ExtensionAPI.ts +242 -0
- package/src/sap/fe/core/PageController.js +158 -29
- package/src/sap/fe/core/PageController.ts +65 -37
- package/src/sap/fe/core/RouterProxy.js +700 -750
- package/src/sap/fe/core/RouterProxy.ts +47 -31
- package/src/sap/fe/core/Synchronization.js +21 -31
- package/src/sap/fe/core/TemplateComponent.js +193 -118
- package/src/sap/fe/core/TemplateComponent.ts +104 -109
- package/src/sap/fe/core/TemplateModel.js +24 -44
- package/src/sap/fe/core/TemplateModel.ts +3 -3
- package/src/sap/fe/core/TransactionHelper.js +1368 -1369
- package/src/sap/fe/core/TransactionHelper.ts +201 -171
- package/src/sap/fe/core/actions/collaboration/ActivitySync.js +406 -0
- package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +362 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +146 -0
- package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +129 -0
- package/src/sap/fe/core/actions/collaboration/Manage.js +264 -0
- package/src/sap/fe/core/actions/collaboration/Manage.ts +246 -0
- package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +100 -0
- package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
- package/src/sap/fe/core/actions/draft.js +324 -220
- package/src/sap/fe/core/actions/draft.ts +209 -133
- package/src/sap/fe/core/actions/messageHandling.js +79 -48
- package/src/sap/fe/core/actions/messageHandling.ts +113 -83
- package/src/sap/fe/core/actions/operations.js +37 -18
- package/src/sap/fe/core/actions/operations.ts +51 -20
- package/src/sap/fe/core/actions/sticky.js +17 -4
- package/src/sap/fe/core/actions/sticky.ts +21 -4
- 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 +707 -0
- package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -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/controllerextensions/EditFlow.js +1854 -1669
- package/src/sap/fe/core/controllerextensions/EditFlow.ts +1792 -0
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +79 -54
- package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +60 -0
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +716 -779
- package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +785 -0
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +796 -816
- package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +810 -0
- package/src/sap/fe/core/controllerextensions/InternalRouting.js +1056 -1005
- package/src/sap/fe/core/controllerextensions/InternalRouting.ts +1001 -0
- package/src/sap/fe/core/controllerextensions/KPIManagement.js +498 -532
- package/src/sap/fe/core/controllerextensions/KPIManagement.ts +13 -12
- package/src/sap/fe/core/controllerextensions/MassEdit.js +141 -169
- package/src/sap/fe/core/controllerextensions/MassEdit.ts +155 -0
- package/src/sap/fe/core/controllerextensions/MessageHandler.js +221 -244
- package/src/sap/fe/core/controllerextensions/MessageHandler.ts +215 -0
- package/src/sap/fe/core/controllerextensions/PageReady.js +312 -345
- package/src/sap/fe/core/controllerextensions/PageReady.ts +57 -53
- package/src/sap/fe/core/controllerextensions/Paginator.js +188 -175
- package/src/sap/fe/core/controllerextensions/Paginator.ts +169 -0
- package/src/sap/fe/core/controllerextensions/Placeholder.js +157 -149
- package/src/sap/fe/core/controllerextensions/Placeholder.ts +149 -0
- package/src/sap/fe/core/controllerextensions/Routing.js +144 -125
- package/src/sap/fe/core/controllerextensions/Routing.ts +131 -0
- package/src/sap/fe/core/controllerextensions/RoutingListener.js +7 -6
- package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
- package/src/sap/fe/core/controllerextensions/Share.js +230 -268
- package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
- package/src/sap/fe/core/controllerextensions/SideEffects.js +603 -644
- package/src/sap/fe/core/controllerextensions/SideEffects.ts +68 -68
- package/src/sap/fe/core/controllerextensions/ViewState.js +774 -806
- package/src/sap/fe/core/controllerextensions/ViewState.ts +796 -0
- package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
- package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
- 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 +92 -68
- package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
- package/src/sap/fe/core/controls/ConditionalWrapper.js +165 -79
- package/src/sap/fe/core/controls/ConditionalWrapper.ts +74 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
- package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
- package/src/sap/fe/core/controls/CustomQuickViewPage.js +167 -125
- package/src/sap/fe/core/controls/CustomQuickViewPage.ts +116 -0
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +163 -122
- package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +155 -0
- package/src/sap/fe/core/controls/FieldWrapper.js +212 -141
- package/src/sap/fe/core/controls/FieldWrapper.ts +104 -0
- package/src/sap/fe/core/controls/FileWrapper.js +313 -0
- package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
- package/src/sap/fe/core/controls/FilterBar.js +197 -159
- package/src/sap/fe/core/controls/FilterBar.ts +148 -0
- package/src/sap/fe/core/controls/FormElementWrapper.js +100 -39
- package/src/sap/fe/core/controls/FormElementWrapper.ts +37 -0
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +37 -42
- package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
- package/src/sap/fe/core/controls/filterbar/FilterContainer.js +147 -115
- package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +102 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilter.js +300 -265
- package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +252 -0
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +185 -140
- package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +335 -322
- package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
- package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +75 -74
- package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +71 -0
- package/src/sap/fe/core/converters/ConverterContext.js +348 -379
- package/src/sap/fe/core/converters/ConverterContext.ts +19 -16
- package/src/sap/fe/core/converters/ManifestSettings.js +13 -1
- package/src/sap/fe/core/converters/ManifestSettings.ts +17 -2
- package/src/sap/fe/core/converters/ManifestWrapper.js +354 -378
- package/src/sap/fe/core/converters/ManifestWrapper.ts +10 -0
- package/src/sap/fe/core/converters/MetaModelConverter.js +6 -4
- package/src/sap/fe/core/converters/MetaModelConverter.ts +5 -2
- package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
- package/src/sap/fe/core/converters/TemplateConverter.ts +2 -1
- package/src/sap/fe/core/converters/annotations/DataField.js +26 -13
- package/src/sap/fe/core/converters/annotations/DataField.ts +40 -17
- package/src/sap/fe/core/converters/controls/Common/Action.js +10 -10
- package/src/sap/fe/core/converters/controls/Common/Action.ts +20 -19
- package/src/sap/fe/core/converters/controls/Common/Chart.js +8 -8
- package/src/sap/fe/core/converters/controls/Common/Chart.ts +12 -11
- package/src/sap/fe/core/converters/controls/Common/Form.js +6 -6
- package/src/sap/fe/core/converters/controls/Common/Form.ts +7 -3
- package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
- package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -2
- package/src/sap/fe/core/converters/controls/Common/Table.js +326 -86
- package/src/sap/fe/core/converters/controls/Common/Table.ts +384 -167
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +120 -55
- package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +158 -98
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +206 -223
- package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +263 -287
- 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 +5 -2
- package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +4 -1
- package/src/sap/fe/core/converters/helpers/Aggregation.js +115 -133
- 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/Key.js +42 -57
- package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
- 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 +51 -27
- package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +69 -43
- package/src/sap/fe/core/converters/templates/ListReportConverter.js +42 -25
- package/src/sap/fe/core/converters/templates/ListReportConverter.ts +91 -65
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +11 -9
- package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +8 -8
- package/src/sap/fe/core/designtime/AppComponent.designtime.js +92 -98
- 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/KPIFormatter.js +3 -12
- package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -2
- package/src/sap/fe/core/formatters/TableFormatter.js +53 -2
- package/src/sap/fe/core/formatters/TableFormatter.ts +51 -0
- 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 +80 -55
- package/src/sap/fe/core/fpm/Component.ts +43 -0
- package/src/sap/fe/core/helpers/AppStartupHelper.js +323 -309
- package/src/sap/fe/core/helpers/AppStartupHelper.ts +363 -337
- package/src/sap/fe/core/helpers/BindingExpression.js +7 -7
- package/src/sap/fe/core/helpers/BindingExpression.ts +7 -7
- package/src/sap/fe/core/helpers/ClassSupport.js +307 -166
- package/src/sap/fe/core/helpers/ClassSupport.ts +348 -155
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +5 -4
- package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -5
- package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
- package/src/sap/fe/core/helpers/FPMHelper.ts +1 -1
- package/src/sap/fe/core/helpers/MassEditHelper.js +735 -684
- package/src/sap/fe/core/helpers/MassEditHelper.ts +803 -0
- package/src/sap/fe/core/helpers/ModelHelper.js +53 -1
- package/src/sap/fe/core/helpers/ModelHelper.ts +46 -0
- 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 +7 -3
- package/src/sap/fe/core/helpers/SemanticDateOperators.ts +7 -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 +1 -7
- package/src/sap/fe/core/helpers/StableIdHelper.ts +0 -4
- 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 +425 -451
- package/src/sap/fe/core/library.support.js +22 -33
- 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 +5 -3
- package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +4 -4
- package/src/sap/fe/core/messagebundle.properties +45 -13
- package/src/sap/fe/core/messagebundle_ar.properties +29 -7
- package/src/sap/fe/core/messagebundle_bg.properties +29 -7
- package/src/sap/fe/core/messagebundle_ca.properties +29 -7
- package/src/sap/fe/core/messagebundle_cs.properties +29 -7
- package/src/sap/fe/core/messagebundle_cy.properties +29 -7
- package/src/sap/fe/core/messagebundle_da.properties +29 -7
- package/src/sap/fe/core/messagebundle_de.properties +29 -7
- package/src/sap/fe/core/messagebundle_el.properties +29 -7
- package/src/sap/fe/core/messagebundle_en.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_GB.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +29 -7
- package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +29 -7
- package/src/sap/fe/core/messagebundle_es.properties +29 -7
- package/src/sap/fe/core/messagebundle_es_MX.properties +29 -7
- package/src/sap/fe/core/messagebundle_et.properties +29 -7
- package/src/sap/fe/core/messagebundle_fi.properties +30 -8
- package/src/sap/fe/core/messagebundle_fr.properties +31 -9
- package/src/sap/fe/core/messagebundle_fr_CA.properties +31 -9
- package/src/sap/fe/core/messagebundle_hi.properties +29 -7
- package/src/sap/fe/core/messagebundle_hr.properties +29 -7
- package/src/sap/fe/core/messagebundle_hu.properties +29 -7
- package/src/sap/fe/core/messagebundle_id.properties +29 -7
- package/src/sap/fe/core/messagebundle_it.properties +29 -7
- package/src/sap/fe/core/messagebundle_iw.properties +29 -7
- package/src/sap/fe/core/messagebundle_ja.properties +28 -6
- package/src/sap/fe/core/messagebundle_kk.properties +29 -7
- package/src/sap/fe/core/messagebundle_ko.properties +29 -7
- package/src/sap/fe/core/messagebundle_lt.properties +29 -7
- package/src/sap/fe/core/messagebundle_lv.properties +30 -8
- package/src/sap/fe/core/messagebundle_ms.properties +29 -7
- package/src/sap/fe/core/messagebundle_nl.properties +29 -7
- package/src/sap/fe/core/messagebundle_no.properties +29 -7
- package/src/sap/fe/core/messagebundle_pl.properties +29 -7
- package/src/sap/fe/core/messagebundle_pt.properties +30 -8
- package/src/sap/fe/core/messagebundle_pt_PT.properties +29 -7
- package/src/sap/fe/core/messagebundle_ro.properties +29 -7
- package/src/sap/fe/core/messagebundle_ru.properties +29 -7
- package/src/sap/fe/core/messagebundle_sh.properties +29 -7
- package/src/sap/fe/core/messagebundle_sk.properties +29 -7
- package/src/sap/fe/core/messagebundle_sl.properties +29 -7
- package/src/sap/fe/core/messagebundle_sv.properties +30 -8
- package/src/sap/fe/core/messagebundle_th.properties +28 -6
- package/src/sap/fe/core/messagebundle_tr.properties +32 -10
- package/src/sap/fe/core/messagebundle_uk.properties +29 -7
- package/src/sap/fe/core/messagebundle_vi.properties +29 -7
- package/src/sap/fe/core/messagebundle_zh_CN.properties +29 -7
- package/src/sap/fe/core/messagebundle_zh_TW.properties +29 -7
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +47 -73
- package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +1 -1
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +158 -196
- package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +5 -6
- package/src/sap/fe/core/services/EnvironmentServiceFactory.js +70 -96
- package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +7 -6
- package/src/sap/fe/core/services/NavigationServiceFactory.js +287 -342
- package/src/sap/fe/core/services/NavigationServiceFactory.ts +11 -14
- package/src/sap/fe/core/services/ResourceModelServiceFactory.js +70 -105
- package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +6 -3
- package/src/sap/fe/core/services/RoutingServiceFactory.js +796 -820
- package/src/sap/fe/core/services/RoutingServiceFactory.ts +62 -53
- package/src/sap/fe/core/services/ShellServicesFactory.js +694 -741
- package/src/sap/fe/core/services/ShellServicesFactory.ts +33 -33
- package/src/sap/fe/core/services/SideEffectsServiceFactory.js +570 -595
- package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +23 -4
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +357 -389
- package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +25 -29
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +43 -5
- package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +7 -4
- package/src/sap/fe/core/support/CommonHelper.js +1 -1
- package/src/sap/fe/core/support/CommonHelper.ts +1 -4
- package/src/sap/fe/core/support/Diagnostics.js +36 -48
- package/src/sap/fe/core/templating/DataModelPathHelper.js +91 -90
- package/src/sap/fe/core/templating/DataModelPathHelper.ts +126 -123
- package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
- package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
- package/src/sap/fe/core/templating/FilterHelper.js +25 -32
- package/src/sap/fe/core/templating/FilterHelper.ts +36 -35
- package/src/sap/fe/core/templating/PropertyHelper.js +16 -2
- package/src/sap/fe/core/templating/PropertyHelper.ts +31 -24
- package/src/sap/fe/core/templating/UIFormatters.js +150 -44
- package/src/sap/fe/core/templating/UIFormatters.ts +165 -67
- 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/controllerextensions/ControllerExtensionMetadata.js +0 -75
|
@@ -1,24 +1,24 @@
|
|
|
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 {
|
|
19
|
-
import { IssueType, IssueSeverity, IssueCategory } from "sap/fe/core/converters/helpers/IssueManager";
|
|
20
|
-
import { PropertyPath } from "@sap-ux/vocabularies-types/dist/Edm";
|
|
21
|
-
import { hasValueHelp } from "sap/fe/core/templating/PropertyHelper";
|
|
21
|
+
//import { hasValueHelp } from "sap/fe/core/templating/PropertyHelper";
|
|
22
22
|
|
|
23
23
|
export type FilterField = ConfigurableObject & {
|
|
24
24
|
type?: string;
|
|
@@ -45,6 +45,9 @@ enum filterFieldType {
|
|
|
45
45
|
Slot = "Slot"
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
const sEdmString = "Edm.String";
|
|
49
|
+
const sStringDataType = "sap.ui.model.odata.type.String";
|
|
50
|
+
|
|
48
51
|
export type CustomElementFilterField = CustomElement<FilterField>;
|
|
49
52
|
|
|
50
53
|
/**
|
|
@@ -71,7 +74,7 @@ function getFieldGroupFilterGroups(fieldGroup: AnnotationTerm<FieldGroupType>):
|
|
|
71
74
|
|
|
72
75
|
function getExcludedFilterProperties(selectionVariants: SelectionVariantConfiguration[]): Record<string, boolean> {
|
|
73
76
|
return selectionVariants.reduce((previousValue: Record<string, boolean>, selectionVariant) => {
|
|
74
|
-
selectionVariant.propertyNames.forEach(propertyName => {
|
|
77
|
+
selectionVariant.propertyNames.forEach((propertyName) => {
|
|
75
78
|
previousValue[propertyName] = true;
|
|
76
79
|
});
|
|
77
80
|
return previousValue;
|
|
@@ -86,7 +89,7 @@ function getExcludedFilterProperties(selectionVariants: SelectionVariantConfigur
|
|
|
86
89
|
*/
|
|
87
90
|
function checkAllTableForEntitySetAreAnalytical(listReportTables: TableVisualization[], contextPath: string | undefined) {
|
|
88
91
|
if (contextPath && listReportTables.length > 0) {
|
|
89
|
-
return listReportTables.every(visualization => {
|
|
92
|
+
return listReportTables.every((visualization) => {
|
|
90
93
|
return visualization.enableAnalytics && contextPath === visualization.annotation.collection;
|
|
91
94
|
});
|
|
92
95
|
}
|
|
@@ -99,13 +102,13 @@ function getSelectionVariants(
|
|
|
99
102
|
): SelectionVariantConfiguration[] {
|
|
100
103
|
const selectionVariantPaths: string[] = [];
|
|
101
104
|
return lrTableVisualizations
|
|
102
|
-
.map(visualization => {
|
|
105
|
+
.map((visualization) => {
|
|
103
106
|
const tableFilters = visualization.control.filters;
|
|
104
107
|
const tableSVConfigs: SelectionVariantConfiguration[] = [];
|
|
105
108
|
for (const key in tableFilters) {
|
|
106
109
|
if (Array.isArray(tableFilters[key].paths)) {
|
|
107
110
|
const paths = tableFilters[key].paths;
|
|
108
|
-
paths.forEach(path => {
|
|
111
|
+
paths.forEach((path) => {
|
|
109
112
|
if (path && path.annotationPath && selectionVariantPaths.indexOf(path.annotationPath) === -1) {
|
|
110
113
|
selectionVariantPaths.push(path.annotationPath);
|
|
111
114
|
const selectionVariantConfig = getSelectionVariantConfiguration(path.annotationPath, converterContext);
|
|
@@ -129,7 +132,7 @@ function getSelectionVariants(
|
|
|
129
132
|
* @param propertyPath The full path to the target property
|
|
130
133
|
* @returns {string} The formatted condition path
|
|
131
134
|
*/
|
|
132
|
-
const _getConditionPath = function(entityType: EntityType, propertyPath: string): string {
|
|
135
|
+
const _getConditionPath = function (entityType: EntityType, propertyPath: string): string {
|
|
133
136
|
const parts = propertyPath.split("/");
|
|
134
137
|
let partialPath;
|
|
135
138
|
let key = "";
|
|
@@ -145,7 +148,7 @@ const _getConditionPath = function(entityType: EntityType, propertyPath: string)
|
|
|
145
148
|
return key;
|
|
146
149
|
};
|
|
147
150
|
|
|
148
|
-
const _createFilterSelectionField = function(
|
|
151
|
+
const _createFilterSelectionField = function (
|
|
149
152
|
entityType: EntityType,
|
|
150
153
|
property: Property,
|
|
151
154
|
fullPropertyPath: string,
|
|
@@ -239,7 +242,7 @@ export function getModelType(sType: any) {
|
|
|
239
242
|
};
|
|
240
243
|
return sType && sType in mDefaultTypeForEdmType && mDefaultTypeForEdmType[sType].modelType;
|
|
241
244
|
}
|
|
242
|
-
const _getSelectionFields = function(
|
|
245
|
+
const _getSelectionFields = function (
|
|
243
246
|
entityType: EntityType,
|
|
244
247
|
navigationPath: string,
|
|
245
248
|
properties: Array<Property> | undefined,
|
|
@@ -260,7 +263,7 @@ const _getSelectionFields = function(
|
|
|
260
263
|
return selectionFieldMap;
|
|
261
264
|
};
|
|
262
265
|
|
|
263
|
-
const _getSelectionFieldsByPath = function(
|
|
266
|
+
const _getSelectionFieldsByPath = function (
|
|
264
267
|
entityType: EntityType,
|
|
265
268
|
propertyPaths: Array<string> | undefined,
|
|
266
269
|
includeHidden: boolean,
|
|
@@ -294,12 +297,7 @@ const _getSelectionFieldsByPath = function(
|
|
|
294
297
|
converterContext
|
|
295
298
|
);
|
|
296
299
|
} else {
|
|
297
|
-
const navigationPath = propertyPath.includes("/")
|
|
298
|
-
? propertyPath
|
|
299
|
-
.split("/")
|
|
300
|
-
.splice(0, 1)
|
|
301
|
-
.join("/")
|
|
302
|
-
: "";
|
|
300
|
+
const navigationPath = propertyPath.includes("/") ? propertyPath.split("/").splice(0, 1).join("/") : "";
|
|
303
301
|
localSelectionFields = _getSelectionFields(entityType, navigationPath, [property], includeHidden, converterContext);
|
|
304
302
|
}
|
|
305
303
|
|
|
@@ -312,13 +310,14 @@ const _getSelectionFieldsByPath = function(
|
|
|
312
310
|
return selectionFields;
|
|
313
311
|
};
|
|
314
312
|
|
|
315
|
-
const _getFilterField = function(
|
|
313
|
+
const _getFilterField = function (
|
|
316
314
|
filterFields: Record<string, FilterField>,
|
|
317
315
|
propertyPath: string,
|
|
318
316
|
converterContext: ConverterContext,
|
|
319
317
|
entityType: EntityType
|
|
320
318
|
): FilterField | undefined {
|
|
321
319
|
let filterField: FilterField | undefined = filterFields[propertyPath];
|
|
320
|
+
const availability = filterField && filterField.availability;
|
|
322
321
|
if (filterField) {
|
|
323
322
|
delete filterFields[propertyPath];
|
|
324
323
|
} else {
|
|
@@ -329,14 +328,13 @@ const _getFilterField = function(
|
|
|
329
328
|
}
|
|
330
329
|
// defined SelectionFields are available by default
|
|
331
330
|
if (filterField) {
|
|
332
|
-
filterField.availability = AvailabilityType.Default;
|
|
331
|
+
filterField.availability = availability === AvailabilityType.Hidden ? AvailabilityType.Hidden : AvailabilityType.Default;
|
|
333
332
|
filterField.isParameter = !!entityType.annotations?.Common?.ResultContext;
|
|
334
333
|
}
|
|
335
334
|
return filterField;
|
|
336
335
|
};
|
|
337
336
|
|
|
338
|
-
const _getDefaultFilterFields = function(
|
|
339
|
-
filterFields: Record<string, FilterField>,
|
|
337
|
+
const _getDefaultFilterFields = function (
|
|
340
338
|
aSelectOptions: any[],
|
|
341
339
|
entityType: EntityType,
|
|
342
340
|
converterContext: ConverterContext,
|
|
@@ -347,7 +345,7 @@ const _getDefaultFilterFields = function(
|
|
|
347
345
|
const UISelectionFields: any = {};
|
|
348
346
|
const properties = entityType.entityProperties;
|
|
349
347
|
// Using entityType instead of entitySet
|
|
350
|
-
annotatedSelectionFields?.forEach(SelectionField => {
|
|
348
|
+
annotatedSelectionFields?.forEach((SelectionField) => {
|
|
351
349
|
UISelectionFields[SelectionField.value] = true;
|
|
352
350
|
});
|
|
353
351
|
if (aSelectOptions && aSelectOptions.length > 0) {
|
|
@@ -355,12 +353,12 @@ const _getDefaultFilterFields = function(
|
|
|
355
353
|
const propertyName: any = selectOption.PropertyName;
|
|
356
354
|
const sPropertyPath: string = propertyName.value;
|
|
357
355
|
const UISelectionFields: any = {};
|
|
358
|
-
annotatedSelectionFields?.forEach(SelectionField => {
|
|
356
|
+
annotatedSelectionFields?.forEach((SelectionField) => {
|
|
359
357
|
UISelectionFields[SelectionField.value] = true;
|
|
360
358
|
});
|
|
361
359
|
if (!(sPropertyPath in excludedFilterProperties)) {
|
|
362
360
|
if (!(sPropertyPath in UISelectionFields)) {
|
|
363
|
-
const FilterField: FilterField | undefined =
|
|
361
|
+
const FilterField: FilterField | undefined = getFilterField(sPropertyPath, converterContext, entityType);
|
|
364
362
|
if (FilterField) {
|
|
365
363
|
selectionFields.push(FilterField);
|
|
366
364
|
}
|
|
@@ -373,7 +371,7 @@ const _getDefaultFilterFields = function(
|
|
|
373
371
|
const PropertyPath = property.name;
|
|
374
372
|
if (!(PropertyPath in excludedFilterProperties)) {
|
|
375
373
|
if (defaultFilterValue && !(PropertyPath in UISelectionFields)) {
|
|
376
|
-
const FilterField: FilterField | undefined =
|
|
374
|
+
const FilterField: FilterField | undefined = getFilterField(PropertyPath, converterContext, entityType);
|
|
377
375
|
if (FilterField) {
|
|
378
376
|
selectionFields.push(FilterField);
|
|
379
377
|
}
|
|
@@ -396,11 +394,18 @@ function _getParameterFields(converterContext: ConverterContext): FilterField[]
|
|
|
396
394
|
const parameterConverterContext =
|
|
397
395
|
isParameterized && converterContext.getConverterContextFor("/" + dataModelObjectPath.startingEntitySet.name);
|
|
398
396
|
|
|
399
|
-
const parameterFields = (
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
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[];
|
|
404
409
|
|
|
405
410
|
return parameterFields;
|
|
406
411
|
}
|
|
@@ -413,17 +418,17 @@ function _getParameterFields(converterContext: ConverterContext): FilterField[]
|
|
|
413
418
|
* @param {ConverterContext} converterContext The converter context
|
|
414
419
|
* @returns {boolean} The information if the FilterBar search field is hidden or not
|
|
415
420
|
*/
|
|
416
|
-
export const getFilterBarhideBasicSearch = function(
|
|
421
|
+
export const getFilterBarhideBasicSearch = function (
|
|
417
422
|
listReportTables: TableVisualization[],
|
|
418
423
|
charts: ChartVisualization[],
|
|
419
424
|
converterContext: ConverterContext
|
|
420
425
|
): boolean {
|
|
421
426
|
// Check if charts allow search
|
|
422
|
-
const noSearchInCharts = charts.length === 0 || charts.every(chart => !chart.applySupported.enableSearch);
|
|
427
|
+
const noSearchInCharts = charts.length === 0 || charts.every((chart) => !chart.applySupported.enableSearch);
|
|
423
428
|
|
|
424
429
|
// Check if all tables are analytical and none of them allow for search
|
|
425
430
|
const noSearchInTables =
|
|
426
|
-
listReportTables.length === 0 || listReportTables.every(table => table.enableAnalytics && !table.enableAnalyticsSearch);
|
|
431
|
+
listReportTables.length === 0 || listReportTables.every((table) => table.enableAnalytics && !table.enableAnalyticsSearch);
|
|
427
432
|
|
|
428
433
|
const contextPath = converterContext.getContextPath();
|
|
429
434
|
if (contextPath && noSearchInCharts && noSearchInTables) {
|
|
@@ -440,7 +445,7 @@ export const getFilterBarhideBasicSearch = function(
|
|
|
440
445
|
* @param converterContext The converter context
|
|
441
446
|
* @returns {Record<string, CustomElementFilterField>} The filter fields defined in the manifest
|
|
442
447
|
*/
|
|
443
|
-
export const getManifestFilterFields = function(
|
|
448
|
+
export const getManifestFilterFields = function (
|
|
444
449
|
entityType: EntityType,
|
|
445
450
|
converterContext: ConverterContext
|
|
446
451
|
): Record<string, CustomElementFilterField> {
|
|
@@ -448,7 +453,7 @@ export const getManifestFilterFields = function(
|
|
|
448
453
|
const definedFilterFields: Record<string, FilterFieldManifestConfiguration> = fbConfig?.filterFields || {};
|
|
449
454
|
const selectionFields: Record<string, FilterField> = _getSelectionFieldsByPath(
|
|
450
455
|
entityType,
|
|
451
|
-
Object.keys(definedFilterFields).map(key => KeyHelper.getPathFromSelectionFieldKey(key)),
|
|
456
|
+
Object.keys(definedFilterFields).map((key) => KeyHelper.getPathFromSelectionFieldKey(key)),
|
|
452
457
|
true,
|
|
453
458
|
converterContext
|
|
454
459
|
);
|
|
@@ -479,15 +484,15 @@ export const getManifestFilterFields = function(
|
|
|
479
484
|
return filterFields;
|
|
480
485
|
};
|
|
481
486
|
|
|
482
|
-
export const getFilterField = function(propertyPath: string, converterContext: ConverterContext, entityType: EntityType) {
|
|
487
|
+
export const getFilterField = function (propertyPath: string, converterContext: ConverterContext, entityType: EntityType) {
|
|
483
488
|
return _getFilterField({}, propertyPath, converterContext, entityType);
|
|
484
489
|
};
|
|
485
490
|
|
|
486
|
-
export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any, sRestriction: any) {
|
|
491
|
+
export const getFilterRestrictions = function (oFilterRestrictionsAnnotation: any, sRestriction: any) {
|
|
487
492
|
if (sRestriction === "RequiredProperties" || sRestriction === "NonFilterableProperties") {
|
|
488
493
|
let aProps = [];
|
|
489
494
|
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation[sRestriction]) {
|
|
490
|
-
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function(oProperty: any) {
|
|
495
|
+
aProps = oFilterRestrictionsAnnotation[sRestriction].map(function (oProperty: any) {
|
|
491
496
|
return oProperty.$PropertyPath || oProperty.value;
|
|
492
497
|
});
|
|
493
498
|
}
|
|
@@ -495,7 +500,7 @@ export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any
|
|
|
495
500
|
} else if (sRestriction === "FilterAllowedExpressions") {
|
|
496
501
|
const mAllowedExpressions = {} as any;
|
|
497
502
|
if (oFilterRestrictionsAnnotation && oFilterRestrictionsAnnotation.FilterExpressionRestrictions) {
|
|
498
|
-
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function(oProperty: any) {
|
|
503
|
+
oFilterRestrictionsAnnotation.FilterExpressionRestrictions.forEach(function (oProperty: any) {
|
|
499
504
|
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
500
505
|
if (mAllowedExpressions[oProperty.Property.value]) {
|
|
501
506
|
mAllowedExpressions[oProperty.Property.value].push(oProperty.AllowedExpressions);
|
|
@@ -509,37 +514,36 @@ export const getFilterRestrictions = function(oFilterRestrictionsAnnotation: any
|
|
|
509
514
|
return oFilterRestrictionsAnnotation;
|
|
510
515
|
};
|
|
511
516
|
|
|
512
|
-
const getSearchFilterPropertyInfo = function() {
|
|
517
|
+
const getSearchFilterPropertyInfo = function () {
|
|
513
518
|
return {
|
|
514
519
|
name: "$search",
|
|
515
520
|
path: "$search",
|
|
516
|
-
dataType:
|
|
521
|
+
dataType: sStringDataType,
|
|
517
522
|
maxConditions: 1
|
|
518
523
|
};
|
|
519
524
|
};
|
|
520
525
|
|
|
521
|
-
const getEditStateFilterPropertyInfo = function() {
|
|
526
|
+
const getEditStateFilterPropertyInfo = function () {
|
|
522
527
|
return {
|
|
523
528
|
name: "$editState",
|
|
524
529
|
path: "$editState",
|
|
525
530
|
groupLabel: "",
|
|
526
531
|
group: "",
|
|
527
|
-
dataType:
|
|
528
|
-
tooltip: null,
|
|
532
|
+
dataType: sStringDataType,
|
|
529
533
|
hiddenFilter: false
|
|
530
534
|
};
|
|
531
535
|
};
|
|
532
536
|
|
|
533
|
-
const getSearchRestrictions = function(converterContext: ConverterContext) {
|
|
537
|
+
const getSearchRestrictions = function (converterContext: ConverterContext) {
|
|
534
538
|
return converterContext.getEntitySet()?.annotations?.Capabilities?.SearchRestrictions;
|
|
535
539
|
};
|
|
536
540
|
|
|
537
|
-
export const getNavigationRestrictions = function(converterContext: ConverterContext, sNavigationPath: string) {
|
|
541
|
+
export const getNavigationRestrictions = function (converterContext: ConverterContext, sNavigationPath: string) {
|
|
538
542
|
const oNavigationRestrictions: any = converterContext.getEntitySet()?.annotations?.Capabilities?.NavigationRestrictions;
|
|
539
543
|
const aRestrictedProperties = oNavigationRestrictions && oNavigationRestrictions.RestrictedProperties;
|
|
540
544
|
return (
|
|
541
545
|
aRestrictedProperties &&
|
|
542
|
-
aRestrictedProperties.find(function(oRestrictedProperty: any) {
|
|
546
|
+
aRestrictedProperties.find(function (oRestrictedProperty: any) {
|
|
543
547
|
return (
|
|
544
548
|
oRestrictedProperty &&
|
|
545
549
|
oRestrictedProperty.NavigationProperty &&
|
|
@@ -550,30 +554,26 @@ export const getNavigationRestrictions = function(converterContext: ConverterCon
|
|
|
550
554
|
);
|
|
551
555
|
};
|
|
552
556
|
|
|
553
|
-
const _fetchBasicPropertyInfo = function(oFilterFieldInfo: any) {
|
|
557
|
+
const _fetchBasicPropertyInfo = function (oFilterFieldInfo: any) {
|
|
554
558
|
return {
|
|
555
559
|
key: oFilterFieldInfo.key,
|
|
556
560
|
annotationPath: oFilterFieldInfo.annotationPath,
|
|
557
561
|
conditionPath: oFilterFieldInfo.conditionPath,
|
|
558
562
|
name: oFilterFieldInfo.conditionPath,
|
|
559
|
-
path: oFilterFieldInfo.conditionPath,
|
|
560
|
-
groupLabel: oFilterFieldInfo.groupLabel,
|
|
561
|
-
group: oFilterFieldInfo.group,
|
|
562
563
|
label: oFilterFieldInfo.label,
|
|
563
|
-
tooltip: null,
|
|
564
564
|
hiddenFilter: oFilterFieldInfo.availability === "Hidden",
|
|
565
|
-
removeFromAppState: false,
|
|
566
|
-
hasValueHelp: false,
|
|
567
565
|
display: "Value",
|
|
568
566
|
isParameter: oFilterFieldInfo.isParameter,
|
|
569
567
|
caseSensitive: oFilterFieldInfo.caseSensitive,
|
|
570
568
|
availability: oFilterFieldInfo.availability,
|
|
571
569
|
position: oFilterFieldInfo.position,
|
|
572
|
-
type: oFilterFieldInfo.type
|
|
570
|
+
type: oFilterFieldInfo.type,
|
|
571
|
+
template: oFilterFieldInfo.template,
|
|
572
|
+
menu: oFilterFieldInfo.menu
|
|
573
573
|
};
|
|
574
574
|
};
|
|
575
575
|
|
|
576
|
-
export const getSpecificAllowedExpression = function(aExpressions: any) {
|
|
576
|
+
export const getSpecificAllowedExpression = function (aExpressions: any) {
|
|
577
577
|
const aAllowedExpressionsPriority = [
|
|
578
578
|
"SingleValue",
|
|
579
579
|
"MultiValue",
|
|
@@ -583,14 +583,14 @@ export const getSpecificAllowedExpression = function(aExpressions: any) {
|
|
|
583
583
|
"MultiRangeOrSearchExpression"
|
|
584
584
|
];
|
|
585
585
|
|
|
586
|
-
aExpressions.sort(function(a: any, b: any) {
|
|
586
|
+
aExpressions.sort(function (a: any, b: any) {
|
|
587
587
|
return aAllowedExpressionsPriority.indexOf(a) - aAllowedExpressionsPriority.indexOf(b);
|
|
588
588
|
});
|
|
589
589
|
|
|
590
590
|
return aExpressions[0];
|
|
591
591
|
};
|
|
592
592
|
|
|
593
|
-
export const displayMode = function(oPropertyAnnotations: any, oCollectionAnnotations: any) {
|
|
593
|
+
export const displayMode = function (oPropertyAnnotations: any, oCollectionAnnotations: any) {
|
|
594
594
|
const oTextAnnotation = oPropertyAnnotations?.Common?.Text,
|
|
595
595
|
oTextArrangmentAnnotation =
|
|
596
596
|
oTextAnnotation &&
|
|
@@ -608,7 +608,7 @@ export const displayMode = function(oPropertyAnnotations: any, oCollectionAnnota
|
|
|
608
608
|
return oTextAnnotation ? "DescriptionValue" : "Value";
|
|
609
609
|
};
|
|
610
610
|
|
|
611
|
-
const _fetchPropertyInfo = function(converterContext: ConverterContext, oFilterFieldInfo: any, oTypeConfig: any) {
|
|
611
|
+
const _fetchPropertyInfo = function (converterContext: ConverterContext, oFilterFieldInfo: any, oTypeConfig: any) {
|
|
612
612
|
let oPropertyInfo = _fetchBasicPropertyInfo(oFilterFieldInfo);
|
|
613
613
|
const sAnnotationPath = oFilterFieldInfo.annotationPath;
|
|
614
614
|
|
|
@@ -616,47 +616,21 @@ const _fetchPropertyInfo = function(converterContext: ConverterContext, oFilterF
|
|
|
616
616
|
return oPropertyInfo;
|
|
617
617
|
}
|
|
618
618
|
const targetPropertyObject = converterContext.getConverterContextFor(sAnnotationPath).getDataModelObjectPath().targetObject;
|
|
619
|
-
|
|
620
|
-
$MaxLength: targetPropertyObject.maxLength,
|
|
621
|
-
$Type: targetPropertyObject.type,
|
|
622
|
-
$kind: targetPropertyObject._type
|
|
623
|
-
};
|
|
619
|
+
|
|
624
620
|
const oPropertyAnnotations = targetPropertyObject?.annotations;
|
|
625
621
|
const oCollectionAnnotations = converterContext?.getDataModelObjectPath().targetObject?.annotations;
|
|
626
622
|
|
|
627
|
-
let oFilterDefaultValue;
|
|
628
623
|
const oFormatOptions = oTypeConfig.formatOptions;
|
|
629
624
|
const oConstraints = oTypeConfig.constraints;
|
|
630
|
-
const bRemoveFromAppState =
|
|
631
|
-
oPropertyAnnotations?.PersonalData?.IsPotentiallySensitive ||
|
|
632
|
-
oPropertyAnnotations?.ExcludeFromNavigationContext ||
|
|
633
|
-
oPropertyAnnotations?.Analytics?.Measure;
|
|
634
|
-
|
|
635
|
-
const oFilterDefaultValueAnnotation = oPropertyAnnotations?.Common?.FilterDefaultValue;
|
|
636
|
-
if (oFilterDefaultValueAnnotation) {
|
|
637
|
-
oFilterDefaultValue = oFilterDefaultValueAnnotation["$" + getModelType(oProperty.$Type)];
|
|
638
|
-
}
|
|
639
625
|
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
640
|
-
tooltip: oPropertyAnnotations?.Common?.QuickInfo?.valueOf() || undefined,
|
|
641
|
-
removeFromAppState: bRemoveFromAppState,
|
|
642
|
-
hasValueHelp: hasValueHelp(targetPropertyObject),
|
|
643
626
|
formatOptions: oFormatOptions,
|
|
644
627
|
constraints: oConstraints,
|
|
645
|
-
display: displayMode(oPropertyAnnotations, oCollectionAnnotations)
|
|
646
|
-
defaultFilterConditions: oFilterDefaultValue
|
|
647
|
-
? [
|
|
648
|
-
{
|
|
649
|
-
fieldPath: oFilterFieldInfo.conditionPath,
|
|
650
|
-
operator: "EQ",
|
|
651
|
-
values: [oFilterDefaultValue]
|
|
652
|
-
}
|
|
653
|
-
]
|
|
654
|
-
: undefined
|
|
628
|
+
display: displayMode(oPropertyAnnotations, oCollectionAnnotations)
|
|
655
629
|
});
|
|
656
630
|
return oPropertyInfo;
|
|
657
631
|
};
|
|
658
632
|
|
|
659
|
-
export const isMultiValue = function(oProperty: any) {
|
|
633
|
+
export const isMultiValue = function (oProperty: any) {
|
|
660
634
|
let bIsMultiValue = true;
|
|
661
635
|
//SingleValue | MultiValue | SingleRange | MultiRange | SearchExpression | MultiRangeOrSearchExpression
|
|
662
636
|
switch (oProperty.filterExpression) {
|
|
@@ -674,7 +648,7 @@ export const isMultiValue = function(oProperty: any) {
|
|
|
674
648
|
return bIsMultiValue;
|
|
675
649
|
};
|
|
676
650
|
|
|
677
|
-
const getAnnotatedSelectionFieldData = function(
|
|
651
|
+
const getAnnotatedSelectionFieldData = function (
|
|
678
652
|
converterContext: ConverterContext,
|
|
679
653
|
lrTables: TableVisualization[] = [],
|
|
680
654
|
annotationPath: string = ""
|
|
@@ -702,6 +676,11 @@ const getAnnotatedSelectionFieldData = function(
|
|
|
702
676
|
converterContext
|
|
703
677
|
)
|
|
704
678
|
};
|
|
679
|
+
let aSelectOptions: any[] = [];
|
|
680
|
+
const selectionVariant = getSelectionVariant(entityType, converterContext);
|
|
681
|
+
if (selectionVariant) {
|
|
682
|
+
aSelectOptions = selectionVariant.SelectOptions;
|
|
683
|
+
}
|
|
705
684
|
|
|
706
685
|
const propertyInfoFields: any =
|
|
707
686
|
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
@@ -717,189 +696,56 @@ const getAnnotatedSelectionFieldData = function(
|
|
|
717
696
|
return selectionFields;
|
|
718
697
|
}, []) || [];
|
|
719
698
|
|
|
720
|
-
|
|
721
|
-
excludedFilterProperties: excludedFilterProperties,
|
|
722
|
-
entityType: entityType,
|
|
723
|
-
annotatedSelectionFields: annotatedSelectionFields,
|
|
724
|
-
filterFields: filterFields,
|
|
725
|
-
propertyInfoFields: propertyInfoFields
|
|
726
|
-
};
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
/**
|
|
730
|
-
* Retrieve the configuration for the selection fields that will be used within the filter bar
|
|
731
|
-
* This configuration takes into account annotation and the selection variants.
|
|
732
|
-
*
|
|
733
|
-
* @param {ConverterContext} converterContext
|
|
734
|
-
* @param {TableVisualization[]} lrTables
|
|
735
|
-
* @param {string} annotationPath
|
|
736
|
-
* @returns {FilterSelectionField[]} An array of selection fields
|
|
737
|
-
*/
|
|
738
|
-
export const getSelectionFields = function(
|
|
739
|
-
converterContext: ConverterContext,
|
|
740
|
-
lrTables: TableVisualization[] = [],
|
|
741
|
-
annotationPath: string = ""
|
|
742
|
-
): FilterField[] {
|
|
743
|
-
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
|
|
744
|
-
|
|
745
|
-
// create a map of properties to be used in selection variants
|
|
746
|
-
const excludedFilterProperties: Record<string, boolean> = oAnnotatedSelectionFieldData.excludedFilterProperties;
|
|
747
|
-
const entityType = oAnnotatedSelectionFieldData.entityType;
|
|
748
|
-
const filterFacets = entityType.annotations.UI?.FilterFacets;
|
|
749
|
-
let filterFacetMap: Record<string, FilterGroup> = {};
|
|
750
|
-
|
|
751
|
-
const aFieldGroups = converterContext.getAnnotationsByTerm("UI", UIAnnotationTerms.FieldGroup);
|
|
752
|
-
|
|
753
|
-
if (filterFacets === undefined || filterFacets.length < 0) {
|
|
754
|
-
for (const i in aFieldGroups) {
|
|
755
|
-
filterFacetMap = {
|
|
756
|
-
...filterFacetMap,
|
|
757
|
-
...getFieldGroupFilterGroups(aFieldGroups[i] as AnnotationTerm<FieldGroupType>)
|
|
758
|
-
};
|
|
759
|
-
}
|
|
760
|
-
} else {
|
|
761
|
-
filterFacetMap = filterFacets.reduce((previousValue: Record<string, FilterGroup>, filterFacet: ReferenceFacetTypes) => {
|
|
762
|
-
for (let i = 0; i < (filterFacet.Target.$target as FieldGroup).Data.length; i++) {
|
|
763
|
-
previousValue[((filterFacet.Target.$target as FieldGroup).Data[i] as DataFieldTypes).Value.path] = {
|
|
764
|
-
group: filterFacet?.ID?.toString(),
|
|
765
|
-
groupLabel: filterFacet?.Label?.toString()
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
return previousValue;
|
|
769
|
-
}, {});
|
|
770
|
-
}
|
|
771
|
-
|
|
772
|
-
let aSelectOptions: any[] = [];
|
|
773
|
-
const selectionVariant = getSelectionVariant(entityType, converterContext);
|
|
774
|
-
if (selectionVariant) {
|
|
775
|
-
aSelectOptions = selectionVariant.SelectOptions;
|
|
776
|
-
}
|
|
777
|
-
|
|
778
|
-
// create a map of all potential filter fields based on...
|
|
779
|
-
const filterFields: Record<string, FilterField> = oAnnotatedSelectionFieldData.filterFields;
|
|
780
|
-
|
|
781
|
-
//Filters which has to be added which is part of SV/Default annotations but not present in the SelectionFields
|
|
782
|
-
const annotatedSelectionFields = oAnnotatedSelectionFieldData.annotatedSelectionFields;
|
|
783
|
-
const defaultFilters = _getDefaultFilterFields(
|
|
784
|
-
filterFields,
|
|
699
|
+
let defaultFilterFields = _getDefaultFilterFields(
|
|
785
700
|
aSelectOptions,
|
|
786
701
|
entityType,
|
|
787
702
|
converterContext,
|
|
788
703
|
excludedFilterProperties,
|
|
789
704
|
annotatedSelectionFields
|
|
790
705
|
);
|
|
791
|
-
const parameterFields = _getParameterFields(converterContext);
|
|
792
|
-
const propertyInfoFields: any =
|
|
793
|
-
annotatedSelectionFields?.reduce((selectionFields: FilterField[], selectionField) => {
|
|
794
|
-
const propertyPath = selectionField.value;
|
|
795
|
-
if (!(propertyPath in excludedFilterProperties)) {
|
|
796
|
-
const filterField: FilterField | undefined = _getFilterField(filterFields, propertyPath, converterContext, entityType);
|
|
797
|
-
if (filterField) {
|
|
798
|
-
filterField.group = "";
|
|
799
|
-
filterField.groupLabel = "";
|
|
800
|
-
selectionFields.push(filterField);
|
|
801
|
-
}
|
|
802
|
-
}
|
|
803
|
-
return selectionFields;
|
|
804
|
-
}, []) || [];
|
|
805
|
-
|
|
806
|
-
// finally create final list of filter fields by adding the SelectionFields first (order matters)...
|
|
807
|
-
let allFilters = parameterFields
|
|
808
|
-
.concat(propertyInfoFields)
|
|
809
|
-
// To add the FilterField which is not part of the Selection Fields but the property is mentioned in the Selection Variant
|
|
810
|
-
.concat(defaultFilters || [])
|
|
811
|
-
// ...and adding remaining filter fields, that are not used in a SelectionVariant (order doesn't matter)
|
|
812
|
-
.concat(
|
|
813
|
-
Object.keys(filterFields)
|
|
814
|
-
.filter(propertyPath => !(propertyPath in excludedFilterProperties))
|
|
815
|
-
.map(propertyPath => {
|
|
816
|
-
return Object.assign(filterFields[propertyPath], filterFacetMap[propertyPath]);
|
|
817
|
-
})
|
|
818
|
-
);
|
|
819
|
-
const sContextPath = converterContext.getContextPath();
|
|
820
706
|
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
allFilters = allFilters.filter(filterField => {
|
|
830
|
-
return aggregatableProperties.indexOf(filterField.key) === -1;
|
|
831
|
-
});
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
|
|
835
|
-
const selectionFields = insertCustomElements(allFilters, getManifestFilterFields(entityType, converterContext), {
|
|
836
|
-
"availability": "overwrite",
|
|
837
|
-
label: "overwrite",
|
|
838
|
-
type: "overwrite",
|
|
839
|
-
position: "overwrite",
|
|
840
|
-
template: "overwrite",
|
|
841
|
-
settings: "overwrite",
|
|
842
|
-
visualFilter: "overwrite"
|
|
843
|
-
});
|
|
844
|
-
|
|
845
|
-
// Add caseSensitive property to all selection fields.
|
|
846
|
-
const isCaseSensitive = isFilteringCaseSensitive(converterContext);
|
|
847
|
-
selectionFields.forEach(filterField => {
|
|
848
|
-
filterField.caseSensitive = isCaseSensitive;
|
|
849
|
-
});
|
|
850
|
-
|
|
851
|
-
return selectionFields;
|
|
707
|
+
return {
|
|
708
|
+
excludedFilterProperties: excludedFilterProperties,
|
|
709
|
+
entityType: entityType,
|
|
710
|
+
annotatedSelectionFields: annotatedSelectionFields,
|
|
711
|
+
filterFields: filterFields,
|
|
712
|
+
propertyInfoFields: propertyInfoFields,
|
|
713
|
+
defaultFilterFields: defaultFilterFields
|
|
714
|
+
};
|
|
852
715
|
};
|
|
853
|
-
|
|
854
|
-
|
|
716
|
+
export const processSelectionFields = function (
|
|
717
|
+
propertyInfoFields: any,
|
|
855
718
|
converterContext: ConverterContext,
|
|
856
|
-
|
|
857
|
-
lrCharts: ChartVisualization[] = [],
|
|
858
|
-
annotationPath: string = ""
|
|
719
|
+
defaultValuePropertyFields: any
|
|
859
720
|
) {
|
|
860
|
-
|
|
861
|
-
//const annotatedSelectionFields: any = oAnnotatedSelectionFieldData.annotatedSelectionFields;
|
|
721
|
+
//get TypeConfig function
|
|
862
722
|
const selectionFieldTypes: any = [];
|
|
863
|
-
const
|
|
864
|
-
const
|
|
865
|
-
|
|
866
|
-
const oTypeConfig = getTypeConfig(property, undefined);
|
|
723
|
+
const aTypeConfig: any = {};
|
|
724
|
+
const _fnTypeConfig = function (property: Property, key: string) {
|
|
725
|
+
const oTypeConfig = getTypeConfig(property, property?.type);
|
|
867
726
|
selectionFieldTypes.push(property?.type);
|
|
868
|
-
if (property?.type ===
|
|
727
|
+
if (property?.type === sEdmString && (!oTypeConfig.constraints.nullable || oTypeConfig.constraints.nullable === true)) {
|
|
869
728
|
oTypeConfig.formatOptions.parseKeepsEmptyString = false;
|
|
870
729
|
}
|
|
871
|
-
aTypeConfig
|
|
730
|
+
aTypeConfig[key] = oTypeConfig;
|
|
872
731
|
};
|
|
873
732
|
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
propertyInfoFields
|
|
879
|
-
propertyInfoFields,
|
|
880
|
-
getManifestFilterFields(converterContext.getEntityType(), converterContext),
|
|
881
|
-
{
|
|
882
|
-
"availability": "overwrite",
|
|
883
|
-
label: "overwrite",
|
|
884
|
-
type: "overwrite",
|
|
885
|
-
position: "overwrite",
|
|
886
|
-
template: "overwrite",
|
|
887
|
-
settings: "overwrite",
|
|
888
|
-
visualFilter: "overwrite"
|
|
889
|
-
}
|
|
890
|
-
);
|
|
891
|
-
|
|
892
|
-
propertyInfoFields.forEach(function(parameterField: any) {
|
|
733
|
+
if (defaultValuePropertyFields) {
|
|
734
|
+
propertyInfoFields = propertyInfoFields.concat(defaultValuePropertyFields);
|
|
735
|
+
}
|
|
736
|
+
//add typeConfig
|
|
737
|
+
propertyInfoFields.forEach(function (parameterField: any) {
|
|
893
738
|
if (parameterField.annotationPath) {
|
|
894
739
|
const propertyConvertyContext = converterContext.getConverterContextFor(parameterField.annotationPath);
|
|
895
740
|
const propertyTargetObject = propertyConvertyContext.getDataModelObjectPath().targetObject;
|
|
896
|
-
_fnTypeConfig(propertyTargetObject);
|
|
741
|
+
_fnTypeConfig(propertyTargetObject, parameterField.key);
|
|
897
742
|
} else {
|
|
898
|
-
selectionFieldTypes.push(
|
|
899
|
-
aTypeConfig.
|
|
743
|
+
selectionFieldTypes.push(sEdmString);
|
|
744
|
+
aTypeConfig[parameterField.key] = { type: sStringDataType };
|
|
900
745
|
}
|
|
901
746
|
});
|
|
902
747
|
|
|
748
|
+
// filterRestrictions
|
|
903
749
|
const oFilterRestrictions = converterContext.getEntitySet()?.annotations?.Capabilities?.FilterRestrictions;
|
|
904
750
|
const oRet = {} as any;
|
|
905
751
|
oRet["RequiredProperties"] = getFilterRestrictions(oFilterRestrictions, "RequiredProperties") || [];
|
|
@@ -920,58 +766,94 @@ export const getPropertyInfoFields = function(
|
|
|
920
766
|
...oRet.FilterAllowedExpressions
|
|
921
767
|
};
|
|
922
768
|
}
|
|
923
|
-
|
|
769
|
+
const isCaseSensitive = isFilteringCaseSensitive(converterContext);
|
|
924
770
|
const aRequiredProps = oRet.RequiredProperties;
|
|
925
771
|
const aNonFilterableProps = oRet.NonFilterableProperties;
|
|
926
|
-
const mAllowedExpressions = oRet.FilterAllowedExpressions;
|
|
927
772
|
let oPropertyInfo;
|
|
928
|
-
const aFetchedProperties: any = []
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
const
|
|
933
|
-
|
|
773
|
+
const aFetchedProperties: any = [];
|
|
774
|
+
|
|
775
|
+
// process the fields to add necessary properties
|
|
776
|
+
propertyInfoFields.forEach(function (propertyInfoField: any) {
|
|
777
|
+
const oConvertedProperty = propertyInfoField;
|
|
778
|
+
let sPropertyPath;
|
|
779
|
+
if (oConvertedProperty.conditionPath) {
|
|
780
|
+
sPropertyPath = oConvertedProperty.conditionPath.replace(/\+|\*/g, "");
|
|
781
|
+
}
|
|
934
782
|
if (aNonFilterableProps.indexOf(sPropertyPath) === -1) {
|
|
935
|
-
oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[
|
|
783
|
+
oPropertyInfo = _fetchPropertyInfo(converterContext, oConvertedProperty, aTypeConfig[propertyInfoField.key]);
|
|
936
784
|
if (oPropertyInfo) {
|
|
937
|
-
if (mAllowedExpressions[sPropertyPath] && mAllowedExpressions[sPropertyPath].length > 0) {
|
|
938
|
-
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
939
|
-
filterExpression: getSpecificAllowedExpression(mAllowedExpressions[sPropertyPath])
|
|
940
|
-
});
|
|
941
|
-
} else {
|
|
942
|
-
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
943
|
-
filterExpression: "auto"
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
785
|
oPropertyInfo = Object.assign(oPropertyInfo, {
|
|
947
786
|
maxConditions: !oPropertyInfo.isParameter && isMultiValue(oPropertyInfo) ? -1 : 1,
|
|
948
787
|
required: oPropertyInfo.isParameter || aRequiredProps.indexOf(sPropertyPath) >= 0,
|
|
949
788
|
caseSensitive: isCaseSensitive,
|
|
950
|
-
|
|
951
|
-
dataType: selectionFieldTypes[sFilterFieldKey]
|
|
952
|
-
//label: getLocalizedText(oConvertedProperty.label)
|
|
789
|
+
dataType: aTypeConfig[propertyInfoField.key].type
|
|
953
790
|
});
|
|
954
791
|
|
|
955
792
|
aFetchedProperties.push(oPropertyInfo);
|
|
956
|
-
if (oPropertyInfo.isParameter) {
|
|
957
|
-
aParameterFields.push(sPropertyPath);
|
|
958
|
-
}
|
|
959
793
|
}
|
|
960
794
|
}
|
|
961
795
|
});
|
|
962
796
|
|
|
797
|
+
//add edit
|
|
963
798
|
if (converterContext.getDataModelObjectPath().targetObject?.annotations?.Common?.DraftRoot) {
|
|
964
799
|
aFetchedProperties.push(getEditStateFilterPropertyInfo());
|
|
965
800
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
801
|
+
// add search
|
|
802
|
+
const searchRestrictions = getSearchRestrictions(converterContext);
|
|
803
|
+
const hideBasicSearch = Boolean(searchRestrictions && !searchRestrictions.Searchable);
|
|
804
|
+
if (sEntitySetPath && hideBasicSearch !== true) {
|
|
969
805
|
if (!searchRestrictions || searchRestrictions?.Searchable) {
|
|
970
806
|
aFetchedProperties.push(getSearchFilterPropertyInfo());
|
|
971
807
|
}
|
|
972
808
|
}
|
|
973
809
|
|
|
974
|
-
aFetchedProperties
|
|
810
|
+
return aFetchedProperties;
|
|
811
|
+
};
|
|
812
|
+
|
|
813
|
+
export const insertCustomManifestElements = function (
|
|
814
|
+
filterFields: FilterField[],
|
|
815
|
+
entityType: EntityType,
|
|
816
|
+
converterContext: ConverterContext
|
|
817
|
+
) {
|
|
818
|
+
return insertCustomElements(filterFields, getManifestFilterFields(entityType, converterContext), {
|
|
819
|
+
"availability": "overwrite",
|
|
820
|
+
label: "overwrite",
|
|
821
|
+
type: "overwrite",
|
|
822
|
+
position: "overwrite",
|
|
823
|
+
template: "overwrite",
|
|
824
|
+
settings: "overwrite",
|
|
825
|
+
visualFilter: "overwrite"
|
|
826
|
+
});
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Retrieve the configuration for the selection fields that will be used within the filter bar
|
|
831
|
+
* This configuration takes into account annotation and the selection variants.
|
|
832
|
+
* @param {ConverterContext} converterContext
|
|
833
|
+
* @param {TableVisualization[]} lrTables
|
|
834
|
+
* @param {string} annotationPath
|
|
835
|
+
* @returns {FilterSelectionField[]} An array of selection fields
|
|
836
|
+
*/
|
|
837
|
+
export const getSelectionFields = function (
|
|
838
|
+
converterContext: ConverterContext,
|
|
839
|
+
lrTables: TableVisualization[] = [],
|
|
840
|
+
annotationPath: string = ""
|
|
841
|
+
): any {
|
|
842
|
+
const oAnnotatedSelectionFieldData = getAnnotatedSelectionFieldData(converterContext, lrTables, annotationPath);
|
|
843
|
+
const parameterFields = _getParameterFields(converterContext);
|
|
844
|
+
let propertyInfoFields: FilterField[] = JSON.parse(JSON.stringify(oAnnotatedSelectionFieldData.propertyInfoFields));
|
|
845
|
+
const entityType = oAnnotatedSelectionFieldData.entityType;
|
|
846
|
+
|
|
847
|
+
propertyInfoFields = parameterFields.concat(propertyInfoFields);
|
|
848
|
+
|
|
849
|
+
propertyInfoFields = insertCustomManifestElements(propertyInfoFields, entityType, converterContext);
|
|
850
|
+
|
|
851
|
+
const aFetchedProperties = processSelectionFields(
|
|
852
|
+
propertyInfoFields,
|
|
853
|
+
converterContext,
|
|
854
|
+
oAnnotatedSelectionFieldData.defaultFilterFields
|
|
855
|
+
);
|
|
856
|
+
aFetchedProperties.sort(function (a: any, b: any) {
|
|
975
857
|
if (a.groupLabel === undefined || a.groupLabel === null) {
|
|
976
858
|
return -1;
|
|
977
859
|
}
|
|
@@ -984,6 +866,100 @@ export const getPropertyInfoFields = function(
|
|
|
984
866
|
let sFetchProperties = JSON.stringify(aFetchedProperties);
|
|
985
867
|
sFetchProperties = sFetchProperties.replace(/\{/g, "\\{");
|
|
986
868
|
sFetchProperties = sFetchProperties.replace(/\}/g, "\\}");
|
|
869
|
+
const sPropertyInfo = sFetchProperties;
|
|
870
|
+
// end of propertyFields processing
|
|
987
871
|
|
|
988
|
-
|
|
872
|
+
// to populate selection fields
|
|
873
|
+
let propSelectionFields: FilterField[] = JSON.parse(JSON.stringify(oAnnotatedSelectionFieldData.propertyInfoFields));
|
|
874
|
+
propSelectionFields = parameterFields.concat(propSelectionFields);
|
|
875
|
+
// create a map of properties to be used in selection variants
|
|
876
|
+
const excludedFilterProperties: Record<string, boolean> = oAnnotatedSelectionFieldData.excludedFilterProperties;
|
|
877
|
+
const filterFacets = entityType?.annotations?.UI?.FilterFacets;
|
|
878
|
+
let filterFacetMap: Record<string, FilterGroup> = {};
|
|
879
|
+
|
|
880
|
+
const aFieldGroups = converterContext.getAnnotationsByTerm("UI", UIAnnotationTerms.FieldGroup);
|
|
881
|
+
|
|
882
|
+
if (filterFacets === undefined || filterFacets.length < 0) {
|
|
883
|
+
for (const i in aFieldGroups) {
|
|
884
|
+
filterFacetMap = {
|
|
885
|
+
...filterFacetMap,
|
|
886
|
+
...getFieldGroupFilterGroups(aFieldGroups[i] as AnnotationTerm<FieldGroupType>)
|
|
887
|
+
};
|
|
888
|
+
}
|
|
889
|
+
} else {
|
|
890
|
+
filterFacetMap = filterFacets.reduce((previousValue: Record<string, FilterGroup>, filterFacet: ReferenceFacetTypes) => {
|
|
891
|
+
for (let i = 0; i < (filterFacet.Target.$target as FieldGroup).Data.length; i++) {
|
|
892
|
+
previousValue[((filterFacet.Target.$target as FieldGroup).Data[i] as DataFieldTypes).Value.path] = {
|
|
893
|
+
group: filterFacet?.ID?.toString(),
|
|
894
|
+
groupLabel: filterFacet?.Label?.toString()
|
|
895
|
+
};
|
|
896
|
+
}
|
|
897
|
+
return previousValue;
|
|
898
|
+
}, {});
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
// create a map of all potential filter fields based on...
|
|
902
|
+
const filterFields: Record<string, FilterField> = oAnnotatedSelectionFieldData.filterFields;
|
|
903
|
+
|
|
904
|
+
// finally create final list of filter fields by adding the SelectionFields first (order matters)...
|
|
905
|
+
let allFilters = propSelectionFields
|
|
906
|
+
|
|
907
|
+
// ...and adding remaining filter fields, that are not used in a SelectionVariant (order doesn't matter)
|
|
908
|
+
.concat(
|
|
909
|
+
Object.keys(filterFields)
|
|
910
|
+
.filter((propertyPath) => !(propertyPath in excludedFilterProperties))
|
|
911
|
+
.map((propertyPath) => {
|
|
912
|
+
return Object.assign(filterFields[propertyPath], filterFacetMap[propertyPath]);
|
|
913
|
+
})
|
|
914
|
+
);
|
|
915
|
+
const sContextPath = converterContext.getContextPath();
|
|
916
|
+
|
|
917
|
+
//if all tables are analytical tables "aggregatable" properties must be excluded
|
|
918
|
+
if (checkAllTableForEntitySetAreAnalytical(lrTables, sContextPath)) {
|
|
919
|
+
// Currently all agregates are root entity properties (no properties coming from navigation) and all
|
|
920
|
+
// tables with same entitySet gets same aggreagte configuration that's why we can use first table into
|
|
921
|
+
// LR to get aggregates (without currency/unit properties since we expect to be able to filter them).
|
|
922
|
+
const aggregates = lrTables[0].aggregates;
|
|
923
|
+
if (aggregates) {
|
|
924
|
+
const aggregatableProperties: string[] = Object.keys(aggregates).map((aggregateKey) => aggregates[aggregateKey].relativePath);
|
|
925
|
+
allFilters = allFilters.filter((filterField) => {
|
|
926
|
+
return aggregatableProperties.indexOf(filterField.key) === -1;
|
|
927
|
+
});
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
const selectionFields = insertCustomManifestElements(allFilters, entityType, converterContext);
|
|
932
|
+
|
|
933
|
+
// Add caseSensitive property to all selection fields.
|
|
934
|
+
const isCaseSensitive = isFilteringCaseSensitive(converterContext);
|
|
935
|
+
selectionFields.forEach((filterField) => {
|
|
936
|
+
filterField.caseSensitive = isCaseSensitive;
|
|
937
|
+
});
|
|
938
|
+
|
|
939
|
+
return { selectionFields, sPropertyInfo };
|
|
940
|
+
};
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* Determines whether the filter bar inside a value help dialog should be expanded. This is true if one of the following condition holds:
|
|
944
|
+
* (1) a filter property is mandatory,
|
|
945
|
+
* (2) no search field exists (entity isn't search enabled),
|
|
946
|
+
* (3) when the data isn't loaded by default (annotation FetchValues = 2).
|
|
947
|
+
* @param {ConverterContext} converterContext The converter context
|
|
948
|
+
* @param {any} filterRestrictionsAnnotation The FilterRestriction annotation
|
|
949
|
+
* @param {any} valueListAnnotation The ValueList annotation
|
|
950
|
+
* @returns {boolean} The value for expandFilterFields
|
|
951
|
+
*/
|
|
952
|
+
export const getExpandFilterFields = function(
|
|
953
|
+
converterContext: ConverterContext,
|
|
954
|
+
filterRestrictionsAnnotation: any,
|
|
955
|
+
valueListAnnotation: any
|
|
956
|
+
): boolean {
|
|
957
|
+
const requiredProperties = getFilterRestrictions(filterRestrictionsAnnotation, "RequiredProperties");
|
|
958
|
+
const searchRestrictions = getSearchRestrictions(converterContext);
|
|
959
|
+
const hideBasicSearch = Boolean(searchRestrictions && !searchRestrictions.Searchable);
|
|
960
|
+
const valueList = valueListAnnotation.getObject();
|
|
961
|
+
if (requiredProperties.length > 0 || hideBasicSearch || valueList?.FetchValues === 2) {
|
|
962
|
+
return true;
|
|
963
|
+
}
|
|
964
|
+
return false;
|
|
989
965
|
};
|