From e57d151043a75645be06bf0aa74410ab551933f2 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 28 Jan 2022 00:15:54 +0530 Subject: [PATCH] feat(fitlers) - fitlers and custommetrics --- .../shared/Filters/FilterSource/FilterSource.tsx | 14 ++++++++++++-- .../FilterValueDropdown/FilterValueDropdown.tsx | 3 +-- frontend/app/types/filter/filter.js | 1 - 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/shared/Filters/FilterSource/FilterSource.tsx b/frontend/app/components/shared/Filters/FilterSource/FilterSource.tsx index 9ecb970e9..cc622b82a 100644 --- a/frontend/app/components/shared/Filters/FilterSource/FilterSource.tsx +++ b/frontend/app/components/shared/Filters/FilterSource/FilterSource.tsx @@ -9,14 +9,24 @@ interface Props { function FilterSource(props: Props) { const { filter } = props; + console.log('FilterSource', filter.source); + const onChange = ({ target: { value, name } }) => { - props.onUpdate({ ...filter, source: [value] }) + props.onUpdate({ ...filter, [name]: [value] }) } const renderFiled = () => { switch(filter.sourceType) { case FilterType.NUMBER: - return + return ( + + ) } } diff --git a/frontend/app/components/shared/Filters/FilterValueDropdown/FilterValueDropdown.tsx b/frontend/app/components/shared/Filters/FilterValueDropdown/FilterValueDropdown.tsx index b489be676..31d830d11 100644 --- a/frontend/app/components/shared/Filters/FilterValueDropdown/FilterValueDropdown.tsx +++ b/frontend/app/components/shared/Filters/FilterValueDropdown/FilterValueDropdown.tsx @@ -22,8 +22,7 @@ function FilterValueDropdown(props: Props) { // const options = [] return ( -
- { filter.sourceOperatorOptions &&
test
} +