From 0c806b57cd5f6971c9d54e1b7b91db7291478959 Mon Sep 17 00:00:00 2001 From: Cannon Lock Date: Tue, 10 Dec 2024 15:19:31 -0600 Subject: [PATCH] Linter --- web_ui/frontend/app/origin/page.tsx | 11 +++++- .../frontend/components/DataExportTable.tsx | 38 +++++++++---------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/web_ui/frontend/app/origin/page.tsx b/web_ui/frontend/app/origin/page.tsx index 0339bab11..8c042eb1d 100644 --- a/web_ui/frontend/app/origin/page.tsx +++ b/web_ui/frontend/app/origin/page.tsx @@ -19,7 +19,14 @@ 'use client'; import { useState, Suspense } from 'react'; -import { Box, IconButton, Grid, Tooltip, Typography, Skeleton } from '@mui/material'; +import { + Box, + IconButton, + Grid, + Tooltip, + Typography, + Skeleton, +} from '@mui/material'; import { Key, CheckCircle } from '@mui/icons-material'; import RateGraph from '@/components/graphs/RateGraph'; @@ -85,7 +92,7 @@ export default function Home() { )} - }> + }> diff --git a/web_ui/frontend/components/DataExportTable.tsx b/web_ui/frontend/components/DataExportTable.tsx index 1275bab63..e50be19ee 100644 --- a/web_ui/frontend/components/DataExportTable.tsx +++ b/web_ui/frontend/components/DataExportTable.tsx @@ -12,7 +12,8 @@ import { Pagination, Paper, Alert, - IconButton, LinearProgress, + IconButton, + LinearProgress, } from '@mui/material'; import React, { ReactElement, useEffect, useMemo, useState } from 'react'; import { Skeleton } from '@mui/material'; @@ -353,9 +354,9 @@ export const getExportData = async (): Promise => { const generateEditUrl = (editUrl: string, fromUrl: string) => { try { - let updatedFromUrl = new URL(fromUrl) - if(updatedFromUrl.searchParams.get('from_registry') === null) { - updatedFromUrl.searchParams.append('from_registry', 'true') + let updatedFromUrl = new URL(fromUrl); + if (updatedFromUrl.searchParams.get('from_registry') === null) { + updatedFromUrl.searchParams.append('from_registry', 'true'); } const url = new URL(editUrl); url.searchParams.append('fromUrl', updatedFromUrl.toString()); @@ -364,15 +365,14 @@ const generateEditUrl = (editUrl: string, fromUrl: string) => { console.error('Failed to generate editUrl', e); return editUrl; } -} +}; export const DataExportTable = ({ boxProps }: { boxProps?: BoxProps }) => { - - const searchParams = useSearchParams() - const from_registry = searchParams.get('from_registry') == 'true' + const searchParams = useSearchParams(); + const from_registry = searchParams.get('from_registry') == 'true'; const [pending, setPending] = useState(false); - const [ fromUrl, setFromUrl ] = useState(undefined); + const [fromUrl, setFromUrl] = useState(undefined); const { data, mutate } = useSWR('getDataExport', getExportData, { refreshInterval: from_registry ? 10000 : 0, }); @@ -381,13 +381,12 @@ export const DataExportTable = ({ boxProps }: { boxProps?: BoxProps }) => { setFromUrl(window.location.href); setPending(true); setTimeout(() => { - mutate() + mutate(); setPending(false); }, 10000); }, []); const dataEnhanced = useMemo(() => { - // If no from URL return current data if (!fromUrl) { return data; @@ -398,24 +397,25 @@ export const DataExportTable = ({ boxProps }: { boxProps?: BoxProps }) => { return undefined; } - let dataEnhanced = structuredClone(data) + let dataEnhanced = structuredClone(data); dataEnhanced.editUrl = generateEditUrl(dataEnhanced.editUrl, fromUrl); dataEnhanced.exports.map((val) => { val.editUrl = generateEditUrl(val.editUrl, fromUrl); }); return dataEnhanced; - - }, [data, fromUrl]) + }, [data, fromUrl]); return ( - {from_registry && pending && - - - Starting Update Watcher; Will Poll Every 10 Seconds; + {from_registry && pending && ( + + + + Starting Update Watcher; Will Poll Every 10 Seconds; + - } + )} Origin