From ff3e185c434dc25d11bed45a936cd54fd3c34bd7 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Thu, 7 Apr 2022 11:34:59 +0200 Subject: [PATCH] feat(ui) - dashboard - wip --- .../CustomMetricPieChart/CustomMetricPieChart.tsx | 2 +- .../Dashboard/components/DashboardModal/DashboardModal.tsx | 1 - .../Dashboard/components/MetricsList/MetricsList.tsx | 3 ++- .../Dashboard/components/WidgetPreview/WidgetPreview.tsx | 2 -- frontend/app/components/Errors/Error/Trend.js | 1 - .../app/components/Session/Layout/ToolPanel/Performance.js | 1 - frontend/app/mstore/metricStore.ts | 2 -- frontend/app/mstore/types/dashboard.ts | 1 - 8 files changed, 3 insertions(+), 10 deletions(-) diff --git a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricPieChart/CustomMetricPieChart.tsx b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricPieChart/CustomMetricPieChart.tsx index 91dbed7b5..a7e46eb20 100644 --- a/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricPieChart/CustomMetricPieChart.tsx +++ b/frontend/app/components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricPieChart/CustomMetricPieChart.tsx @@ -113,7 +113,7 @@ function CustomMetricPieChart(props: Props) { }} > {data && data.values && data.values.map((entry, index) => ( - + ))} diff --git a/frontend/app/components/Dashboard/components/DashboardModal/DashboardModal.tsx b/frontend/app/components/Dashboard/components/DashboardModal/DashboardModal.tsx index a5ba99dfb..4814ada0d 100644 --- a/frontend/app/components/Dashboard/components/DashboardModal/DashboardModal.tsx +++ b/frontend/app/components/Dashboard/components/DashboardModal/DashboardModal.tsx @@ -15,7 +15,6 @@ interface Props { } function DashboardModal(props) { const { history, siteId, dashboardId } = props; - console.log('DashboardModal', props); const { dashboardStore } = useStore(); const { hideModal } = useModal(); const dashboard = useObserver(() => dashboardStore.dashboardInstance); diff --git a/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx b/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx index 349386980..3916e0a05 100644 --- a/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx +++ b/frontend/app/components/Dashboard/components/MetricsList/MetricsList.tsx @@ -14,7 +14,8 @@ function MetricsList(props: Props) { const filterList = (list) => { const filterRE = getRE(metricsSearch, 'i'); let _list = list.filter(w => { - return filterRE.test(w.name) || filterRE.test(w.metricType) || filterRE.test(w.owner) ; + const dashbaordNames = w.dashboards.map(d => d.name).join(' '); + return filterRE.test(w.name) || filterRE.test(w.metricType) || filterRE.test(w.owner) || filterRE.test(dashbaordNames); }); return _list } diff --git a/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx b/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx index 2c40dd0f0..cf2e9fe21 100644 --- a/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx +++ b/frontend/app/components/Dashboard/components/WidgetPreview/WidgetPreview.tsx @@ -25,8 +25,6 @@ function WidgetPreview(props: Props) { metric.update({ ...changedDates, rangeName: changedDates.rangeValue }); } - console.log('view', metric.viewType) - return useObserver(() => (
diff --git a/frontend/app/components/Errors/Error/Trend.js b/frontend/app/components/Errors/Error/Trend.js index e6dcc1445..03b01909f 100644 --- a/frontend/app/components/Errors/Error/Trend.js +++ b/frontend/app/components/Errors/Error/Trend.js @@ -20,7 +20,6 @@ function Trend({ title = '', chart, onDateChange, timeFormat = 'hh:mm a' }) { if (!Array.isArray(chart)) return null const getDateFormat = val => { - console.log(val); const d = new Date(val); return (d.getMonth()+ 1) + '/' + d.getDate() } diff --git a/frontend/app/components/Session/Layout/ToolPanel/Performance.js b/frontend/app/components/Session/Layout/ToolPanel/Performance.js index 295085e46..f76c32f33 100644 --- a/frontend/app/components/Session/Layout/ToolPanel/Performance.js +++ b/frontend/app/components/Session/Layout/ToolPanel/Performance.js @@ -151,7 +151,6 @@ const NodesCountTooltip = ({ active, payload } ) => { const TICKS_COUNT = 10; function generateTicks(data: Array): Array { if (data.length === 0) return []; - console.log(data, data[0]) const minTime = data[0].time; const maxTime = data[data.length-1].time; diff --git a/frontend/app/mstore/metricStore.ts b/frontend/app/mstore/metricStore.ts index 455452adb..bb4815389 100644 --- a/frontend/app/mstore/metricStore.ts +++ b/frontend/app/mstore/metricStore.ts @@ -124,7 +124,6 @@ export default class MetricStore implements IMetricStore { } get paginatedList(): IWidget[] { - console.log('here...' + this.page) const start = (this.page - 1) * this.pageSize const end = start + this.pageSize return this.metrics.slice(start, end) @@ -187,7 +186,6 @@ export default class MetricStore implements IMetricStore { this.isLoading = true return metricService.getMetricChartData(metric) .then(data => { - console.log('data', data) // runInAction(() => { // metric.data = data // }) diff --git a/frontend/app/mstore/types/dashboard.ts b/frontend/app/mstore/types/dashboard.ts index bd6551ba3..aefe7541f 100644 --- a/frontend/app/mstore/types/dashboard.ts +++ b/frontend/app/mstore/types/dashboard.ts @@ -139,7 +139,6 @@ export default class Dashboard implements IDashboard { } swapWidgetPosition(positionA, positionB) { - console.log('swapWidgetPosition', positionA, positionB) const widgetA = this.widgets[positionA] const widgetB = this.widgets[positionB] this.widgets[positionA] = widgetB