From 4ad2657cd9e7b43b3de766ecc9324f8e6c68bf17 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 5 Jul 2024 17:12:19 +0200 Subject: [PATCH] change(ui): additional filters for path analysis and insights --- .../DashboardList/NewDashModal/CreateCard.tsx | 4 +- .../components/WidgetForm/WidgetFormNew.tsx | 114 +++++++++++++----- 2 files changed, 87 insertions(+), 31 deletions(-) diff --git a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CreateCard.tsx b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CreateCard.tsx index f60c90c3b..ee76fee04 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CreateCard.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/CreateCard.tsx @@ -7,6 +7,7 @@ import {useStore} from "App/mstore"; import { HEATMAP } from "App/constants/card"; import {renderClickmapThumbnail} from "Components/Dashboard/components/WidgetForm/renderMap"; import WidgetPreview from "Components/Dashboard/components/WidgetPreview/WidgetPreview"; +import WidgetFormNew from 'Components/Dashboard/components/WidgetForm/WidgetFormNew'; const getTitleByType = (type: string) => { switch (type) { @@ -93,7 +94,8 @@ function CreateCard(props: Props) { - + {/**/} + ); diff --git a/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx b/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx index c088fb29d..d5cedb426 100644 --- a/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx +++ b/frontend/app/components/Dashboard/components/WidgetForm/WidgetFormNew.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Card, Space, Typography, Button, Alert } from 'antd'; +import { Card, Space, Typography, Button, Alert, Form } from 'antd'; import { useStore } from 'App/mstore'; import { eventKeys } from 'Types/filter/newFilter'; import { @@ -11,15 +11,16 @@ import { RESOURCE_MONITORING, RETENTION, TABLE, - USER_PATH, WEB_VITALS + USER_PATH, WEB_VITALS, TIMESERIES } from 'App/constants/card'; import FilterSeries from 'Components/Dashboard/components/FilterSeries/FilterSeries'; -import { metricOf } from 'App/constants/filterOptions'; +import { issueCategories, metricOf } from 'App/constants/filterOptions'; import { AudioWaveform, ChevronDown, ChevronUp, PlusIcon } from 'lucide-react'; import { observer } from 'mobx-react-lite'; import AddStepButton from 'Components/Dashboard/components/FilterSeries/AddStepButton'; import FilterItem from 'Shared/Filters/FilterItem'; import { FilterKey } from 'Types/filter/filterType'; +import Select from 'Shared/Select'; function WidgetFormNew() { const { metricStore, dashboardStore, aiFiltersStore } = useStore(); @@ -111,17 +112,18 @@ const FilterSection = observer(({ metric, excludeFilterKeys }: any) => { } {!isSingleSeries && canAddSeries && ( - + @@ -132,34 +134,86 @@ const FilterSection = observer(({ metric, excludeFilterKeys }: any) => { }); -const PathAnalysisFilter = observer(({ metric }: any) => ( - -
- metric.updateStartPoint(val)} - onRemoveFilter={() => { - }} - /> -
-
-)); +const PathAnalysisFilter = observer(({ metric, writeOption }: any) => { + const metricValueOptions = [ + { value: 'location', label: 'Pages' }, + { value: 'click', label: 'Clicks' }, + { value: 'input', label: 'Input' }, + { value: 'custom', label: 'Custom' } + ]; + return ( + + + + + + + + metric.updateStartPoint(val)} + onRemoveFilter={() => { + }} + /> + + + ); +}); + +const InsightsFilter = observer(({ metric, writeOption }: any) => { + return ( + + + +