From b3debda1215825a873794c1febf13fd62e65b402 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 22 Apr 2022 15:22:25 +0200 Subject: [PATCH] change(ui) - filter series limit to 3, widget drilldown sessions pagination --- .../components/MetricsList/MetricsList.tsx | 6 +++- .../components/WidgetForm/WidgetForm.tsx | 6 ++-- .../WidgetSessions/WidgetSessions.tsx | 31 +++++++++++++------ frontend/app/components/ui/Button/Button.js | 2 +- frontend/app/mstore/metricStore.ts | 6 ++++ 5 files changed, 38 insertions(+), 13 deletions(-) diff --git a/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx b/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx index f46d76de0..9d895de13 100644 --- a/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx +++ b/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx @@ -1,5 +1,5 @@ import { useObserver } from 'mobx-react-lite'; -import React from 'react'; +import React, { useEffect } from 'react'; import { NoContent, Pagination } from 'UI'; import { useStore } from 'App/mstore'; import { getRE } from 'App/utils'; @@ -22,6 +22,10 @@ function MetricsList(props: Props) { const list: any = metricsSearch !== '' ? filterList(metrics) : metrics; const lenth = list.length; + useEffect(() => { + metricStore.updateKey('sessionsPage', 1); + }, []) + return useObserver(() => (
diff --git a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx index 72c9c33c7..79b44bc5a 100644 --- a/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx +++ b/frontend/app/components/Dashboard/components/WidgetForm/WidgetForm.tsx @@ -29,6 +29,7 @@ function WidgetForm(props: Props) { const isTable = metric.metricType === 'table'; const _issueOptions = [{ text: 'All', value: 'all' }].concat(issueOptions); const canAddToDashboard = metric.exists() && dashboards.length > 0; + const canAddSeries = metric.series.length < 3; const write = ({ target: { value, name } }) => metricStore.merge({ [ name ]: value }); const writeOption = (e, { value, name }) => { @@ -150,16 +151,17 @@ function WidgetForm(props: Props) {
-