From 9867a5b8bcfddcebc42190ae35adbcea1596a2f9 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Fri, 17 Jun 2022 15:48:05 +0200 Subject: [PATCH] feat(ui) - sessions - widget - data reload --- .../Dashboard/components/WidgetChart/WidgetChart.tsx | 2 +- frontend/app/mstore/types/error.ts | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx index 0d9e3283a..e6368be84 100644 --- a/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx +++ b/frontend/app/components/Dashboard/components/WidgetChart/WidgetChart.tsx @@ -86,7 +86,7 @@ function WidgetChart(props: Props) { prevMetricRef.current = metric; const payload = isWidget ? { ...params } : { ...metricParams, ...metric.toJson() }; debounceRequest(metric, payload, isWidget); - }, [period, depsString, _metric.page]); + }, [period, depsString, _metric.page, metric.metricType, metric.metricOf, metric.viewType]); const renderChart = () => { const { metricType, viewType, metricOf } = metric; diff --git a/frontend/app/mstore/types/error.ts b/frontend/app/mstore/types/error.ts index 2f8b8fbec..54382f081 100644 --- a/frontend/app/mstore/types/error.ts +++ b/frontend/app/mstore/types/error.ts @@ -1,4 +1,3 @@ - export default class Error { sessionId: string = '' messageId: string = '' @@ -14,6 +13,7 @@ export default class Error { chart: any = [] sessions: number = 0 users: number = 0 + firstOccurrence: string = '' lastOccurrence: string = '' timestamp: string = '' @@ -23,7 +23,6 @@ export default class Error { fromJSON(json: any) { this.sessionId = json.sessionId this.messageId = json.messageId - this.timestamp = json.timestamp this.errorId = json.errorId this.projectId = json.projectId this.source = json.source @@ -31,15 +30,20 @@ export default class Error { this.message = json.message this.time = json.time this.function = json.function - this.chart = json.chart this.stack0InfoString = getStck0InfoString(json.stack || []) + + this.chart = json.chart this.sessions = json.sessions this.users = json.users + this.firstOccurrence = json.firstOccurrence + this.lastOccurrence = json.lastOccurrence + this.timestamp = json.timestamp + return this } } -function getStck0InfoString(stack) { +function getStck0InfoString(stack: any) { const stack0 = stack[0]; if (!stack0) return ""; let s = stack0.function || "";