From 716e83d819dd66c68d9bb2079e6a57f943bdb9d6 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 26 Jun 2024 19:00:41 +0200 Subject: [PATCH] change(ui): insights card --- .../NewDashModal/Examples/InsightsExample.tsx | 65 ++++++++++--------- frontend/app/mstore/types/widget.ts | 2 - 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/Examples/InsightsExample.tsx b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/Examples/InsightsExample.tsx index abdb4654d..b3271aa33 100644 --- a/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/Examples/InsightsExample.tsx +++ b/frontend/app/components/Dashboard/components/DashboardList/NewDashModal/Examples/InsightsExample.tsx @@ -1,7 +1,7 @@ import React from 'react'; -import CustomMetricOverviewChart from "Components/Dashboard/Widgets/CustomMetricsWidgets/CustomMetricOverviewChart"; import ExCard from "Components/Dashboard/components/DashboardList/NewDashModal/Examples/ExCard"; import InsightsCard from "Components/Dashboard/Widgets/CustomMetricsWidgets/InsightsCard"; +import {InsightIssue} from "App/mstore/types/widget"; interface Props { title: string; @@ -10,35 +10,40 @@ interface Props { } function InsightsExample(props: Props) { - const data = [ - { - "category": "errors", - "name": "Error: Invalid unit value NaN", - "value": 562, - "oldValue": null, - "ratio": 7.472410583698976, - "change": null, - "isNew": true - }, - { - "category": "errors", - "name": "TypeError: e.node.getContext is not a function", - "value": 128, - "oldValue": 1, - "ratio": 1.7019013429065284, - "change": 12700.0, - "isNew": false - }, - { - "category": "errors", - "name": "Unhandled Promise Rejection: {\"message\":\"! POST error on /client/members; 400\",\"response\":{}}", - "value": 26, - "oldValue": null, - "ratio": 0.34569871027788857, - "change": null, - "isNew": true - } - ]; + const data = { + issues: [ + { + "category": "errors", + "name": "Error: Invalid unit value NaN", + "value": 562, + "oldValue": null, + "ratio": 7.472410583698976, + "change": 1, + "isNew": true + }, + { + "category": "errors", + "name": "TypeError: e.node.getContext is not a function", + "value": 128, + "oldValue": 1, + "ratio": 1.7019013429065284, + "change": 12700.0, + "isNew": false + }, + { + "category": "errors", + "name": "Unhandled Promise Rejection: {\"message\":\"! POST error on /client/members; 400\",\"response\":{}}", + "value": 26, + "oldValue": null, + "ratio": 0.34569871027788857, + "change": 1, + "isNew": true + } + ].map( + (i: any) => + new InsightIssue(i.category, i.name, i.ratio, i.oldValue, i.value, i.change, i.isNew) + ) + } return (