From 6ac1259f7a8c2daba9c14e7cbc9f7da0b14321fc Mon Sep 17 00:00:00 2001 From: Gala Date: Wed, 10 Aug 2022 11:24:02 +0200 Subject: [PATCH 1/5] changing content --- explorer/src/components/UptimeChart.tsx | 6 +++--- explorer/src/pages/MixnodeDetail/index.tsx | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/explorer/src/components/UptimeChart.tsx b/explorer/src/components/UptimeChart.tsx index 8d6c934775..44490c1196 100644 --- a/explorer/src/components/UptimeChart.tsx +++ b/explorer/src/components/UptimeChart.tsx @@ -23,7 +23,7 @@ export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptim const color = theme.palette.text.primary; React.useEffect(() => { if (uptimeStory.data?.history) { - const allFormattedChartData: FormattedChartData = [['Date', 'Uptime']]; + const allFormattedChartData: FormattedChartData = [['Date', 'Routing Score']]; uptimeStory.data.history.forEach((eachDate) => { const formattedDateUptimeRecord: FormattedDateRecord = [ format(new Date(eachDate.date), 'MMM dd'), @@ -34,7 +34,7 @@ export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptim setFormattedChartData(allFormattedChartData); } else { const emptyData: any = [ - ['Date', 'Uptime'], + ['Date', 'Routing Score'], ['Jul 27', 10], ]; setFormattedChartData(emptyData); @@ -55,7 +55,7 @@ export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptim uptimeStory.data ? formattedChartData : [ - ['Date', 'Uptime'], + ['Date', 'Routing Score'], [format(new Date(Date.now()), 'MMM dd'), 0], ] } diff --git a/explorer/src/pages/MixnodeDetail/index.tsx b/explorer/src/pages/MixnodeDetail/index.tsx index 121f451a52..b04bac0535 100644 --- a/explorer/src/pages/MixnodeDetail/index.tsx +++ b/explorer/src/pages/MixnodeDetail/index.tsx @@ -137,9 +137,14 @@ const PageMixnodeDetailWithState: React.FC = () => { {uptimeStory && ( - - {uptimeStory.error && } - + + {uptimeStory.error && } + )} From f96a60b6a23ddb0480995f6416c0501313d8c522 Mon Sep 17 00:00:00 2001 From: Gala Date: Tue, 16 Aug 2022 12:10:17 +0200 Subject: [PATCH 2/5] log in staging --- explorer/src/components/UptimeChart.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/explorer/src/components/UptimeChart.tsx b/explorer/src/components/UptimeChart.tsx index 44490c1196..38261dd5ee 100644 --- a/explorer/src/components/UptimeChart.tsx +++ b/explorer/src/components/UptimeChart.tsx @@ -19,6 +19,7 @@ type FormattedChartData = [FormattedChartHeadings | FormattedDateRecord]; export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptimeStory, loading }) => { const [formattedChartData, setFormattedChartData] = React.useState(); + console.log('title, xLabel, yLabel, uptimeStory, loading', title, xLabel, yLabel, uptimeStory, loading); const theme = useTheme(); const color = theme.palette.text.primary; React.useEffect(() => { From b3fcbb6726951cdfacf4da72f94d62af988e6858 Mon Sep 17 00:00:00 2001 From: Gala Date: Tue, 16 Aug 2022 12:28:09 +0200 Subject: [PATCH 3/5] remove log --- explorer/src/components/UptimeChart.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/explorer/src/components/UptimeChart.tsx b/explorer/src/components/UptimeChart.tsx index 38261dd5ee..5c67623aab 100644 --- a/explorer/src/components/UptimeChart.tsx +++ b/explorer/src/components/UptimeChart.tsx @@ -19,7 +19,6 @@ type FormattedChartData = [FormattedChartHeadings | FormattedDateRecord]; export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptimeStory, loading }) => { const [formattedChartData, setFormattedChartData] = React.useState(); - console.log('title, xLabel, yLabel, uptimeStory, loading', title, xLabel, yLabel, uptimeStory, loading); const theme = useTheme(); const color = theme.palette.text.primary; React.useEffect(() => { @@ -88,7 +87,7 @@ export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptim }, }, vAxis: { - // % uptime vertical + // % Routing Score vertical viewWindow: { min: 0, max: 100, From 574e5cf10ab3240335b1fcbb85e4fa18640f1ad2 Mon Sep 17 00:00:00 2001 From: Gala Date: Tue, 16 Aug 2022 13:42:48 +0200 Subject: [PATCH 4/5] change legend --- explorer/src/components/UptimeChart.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/explorer/src/components/UptimeChart.tsx b/explorer/src/components/UptimeChart.tsx index 5c67623aab..7f6ed43551 100644 --- a/explorer/src/components/UptimeChart.tsx +++ b/explorer/src/components/UptimeChart.tsx @@ -23,7 +23,7 @@ export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptim const color = theme.palette.text.primary; React.useEffect(() => { if (uptimeStory.data?.history) { - const allFormattedChartData: FormattedChartData = [['Date', 'Routing Score']]; + const allFormattedChartData: FormattedChartData = [['Date', 'Score']]; uptimeStory.data.history.forEach((eachDate) => { const formattedDateUptimeRecord: FormattedDateRecord = [ format(new Date(eachDate.date), 'MMM dd'), @@ -34,7 +34,7 @@ export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptim setFormattedChartData(allFormattedChartData); } else { const emptyData: any = [ - ['Date', 'Routing Score'], + ['Date', 'Score'], ['Jul 27', 10], ]; setFormattedChartData(emptyData); @@ -87,7 +87,7 @@ export const UptimeChart: React.FC = ({ title, xLabel, yLabel, uptim }, }, vAxis: { - // % Routing Score vertical + // vertical / % Routing Score viewWindow: { min: 0, max: 100, From 1dae3c3fc29b6354a54c96339c0a83a405754088 Mon Sep 17 00:00:00 2001 From: Gala Date: Tue, 16 Aug 2022 14:08:00 +0200 Subject: [PATCH 5/5] remove vAxis label --- explorer/src/components/UptimeChart.tsx | 2 +- explorer/src/pages/MixnodeDetail/index.tsx | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/explorer/src/components/UptimeChart.tsx b/explorer/src/components/UptimeChart.tsx index 7f6ed43551..51f2c9b62b 100644 --- a/explorer/src/components/UptimeChart.tsx +++ b/explorer/src/components/UptimeChart.tsx @@ -8,7 +8,7 @@ import { ApiState, UptimeStoryResponse } from '../typeDefs/explorer-api'; interface ChartProps { title?: string; xLabel: string; - yLabel: string; + yLabel?: string; uptimeStory: ApiState; loading: boolean; } diff --git a/explorer/src/pages/MixnodeDetail/index.tsx b/explorer/src/pages/MixnodeDetail/index.tsx index b04bac0535..ac53ebebf0 100644 --- a/explorer/src/pages/MixnodeDetail/index.tsx +++ b/explorer/src/pages/MixnodeDetail/index.tsx @@ -139,12 +139,7 @@ const PageMixnodeDetailWithState: React.FC = () => { {uptimeStory && ( {uptimeStory.error && } - + )}