Skip to content

Commit e75d0c4

Browse files
committed
Run ESLint
1 parent b57f951 commit e75d0c4

17 files changed

Lines changed: 132 additions & 115 deletions

backend/frontend/src/App.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import { BrowserRouter, Routes, Route } from 'react-router-dom';
2-
import Home from './pages/Home';
1+
import { BrowserRouter, Route,Routes } from 'react-router-dom';
2+
33
import Compare from './pages/Compare';
4+
import Home from './pages/Home';
45

56
function App() {
67
return (
78
<BrowserRouter>
89
<Routes>
9-
<Route path="/" element={<Home />} />
10-
<Route path="/compare" element={<Compare />} />
10+
<Route path={"/"} element={<Home />} />
11+
<Route path={"/compare"} element={<Compare />} />
1112
</Routes>
1213
</BrowserRouter>
1314
);

backend/frontend/src/components/ImageThumbnail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ export function ImageThumbnail({
2121
return (
2222
<Anchor
2323
href={`/api/result/${type}/${group}/${name}/${hardware}${timePart}`}
24-
target="_blank"
24+
target={"_blank"}
2525
onClick={stopPropagation ? (e: React.MouseEvent) => e.stopPropagation() : undefined}
2626
>
2727
<img
2828
src={`/api/result/${type}-thumbnail/${group}/${name}/${hardware}${timePart}`}
2929
style={{ width: 170, height: 95.625 }}
30-
loading="lazy"
30+
loading={"lazy"}
3131
alt={type}
3232
/>
3333
</Anchor>

backend/frontend/src/components/SortableHeader.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Table } from '@mantine/core';
2+
23
import { SortColumn } from '../types';
34

45
interface Props {

backend/frontend/src/components/TestHistory.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Anchor, Box, Button, Table, Text } from '@mantine/core';
2-
import { TestRecord, TestData } from '../types';
2+
3+
import { TestData,TestRecord } from '../types';
34
import { diffDisplay, diffStyle, timingDisplay } from '../utils';
5+
46
import { ImageThumbnail } from './ImageThumbnail';
57

68
interface Props {
@@ -12,8 +14,8 @@ export function TestHistory({ record, onUpdateReference }: Props) {
1214
const testData = [...record.data].reverse();
1315

1416
return (
15-
<Box p="md" bg="dark.8">
16-
<Table horizontalSpacing="xs" verticalSpacing={4} withTableBorder withColumnBorders>
17+
<Box p={"md"} bg={"dark.8"}>
18+
<Table horizontalSpacing={"xs"} verticalSpacing={4} withTableBorder withColumnBorders>
1719
<Table.Thead>
1820
<Table.Tr>
1921
<Table.Th>Timestamp</Table.Th>
@@ -31,7 +33,7 @@ export function TestHistory({ record, onUpdateReference }: Props) {
3133
{testData.map((d: TestData, i: number) => (
3234
<Table.Tr key={d.timeStamp}>
3335
<Table.Td>
34-
<Text size="sm" c="dimmed">
36+
<Text size={"sm"} c={"dimmed"}>
3537
{new Date(d.timeStamp).toUTCString()}
3638
</Text>
3739
</Table.Td>
@@ -52,7 +54,7 @@ export function TestHistory({ record, onUpdateReference }: Props) {
5254
<Table.Td>
5355
<Anchor
5456
href={`https://github.com/OpenSpace/OpenSpace/commit/${d.commitHash}`}
55-
target="_blank"
57+
target={"_blank"}
5658
>
5759
{d.commitHash.substring(0, 8)}
5860
</Anchor>
@@ -63,14 +65,14 @@ export function TestHistory({ record, onUpdateReference }: Props) {
6365
<Table.Td>
6466
<Anchor
6567
href={`/api/result/log/${record.group}/${record.name}/${record.hardware}/${d.timeStamp}`}
66-
target="_blank"
68+
target={"_blank"}
6769
>
6870
Log ({d.nErrors} errors)
6971
</Anchor>
7072
</Table.Td>
7173
<Table.Td>
7274
<ImageThumbnail
73-
type="candidate"
75+
type={"candidate"}
7476
group={record.group}
7577
name={record.name}
7678
hardware={record.hardware}
@@ -79,7 +81,7 @@ export function TestHistory({ record, onUpdateReference }: Props) {
7981
</Table.Td>
8082
<Table.Td>
8183
<ImageThumbnail
82-
type="reference"
84+
type={"reference"}
8385
group={record.group}
8486
name={record.name}
8587
hardware={record.hardware}
@@ -88,7 +90,7 @@ export function TestHistory({ record, onUpdateReference }: Props) {
8890
</Table.Td>
8991
<Table.Td>
9092
<ImageThumbnail
91-
type="difference"
93+
type={"difference"}
9294
group={record.group}
9395
name={record.name}
9496
hardware={record.hardware}
@@ -97,7 +99,7 @@ export function TestHistory({ record, onUpdateReference }: Props) {
9799
</Table.Td>
98100
<Table.Td>
99101
{i === 0 && (
100-
<Button variant="default" onClick={() => onUpdateReference(record)}>
102+
<Button variant={"default"} onClick={() => onUpdateReference(record)}>
101103
Upgrade Candidate to Reference
102104
</Button>
103105
)}

backend/frontend/src/components/TestRow.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Anchor, Box, Table, Text } from '@mantine/core';
2+
23
import { TestRecord } from '../types';
34
import { diffDisplay, diffStyle, timingDisplay } from '../utils';
5+
46
import { ImageThumbnail } from './ImageThumbnail';
57

68
interface Props {
@@ -34,20 +36,20 @@ export function TestRow({ record, onOpen }: Props) {
3436
<Table.Td>{timingDisplay(latestData.timing)}</Table.Td>
3537
<Table.Td>
3638
<Anchor
37-
size="sm"
39+
size={"sm"}
3840
href={`https://github.com/OpenSpace/OpenSpace/commit/${latestData.commitHash}`}
39-
target="_blank"
41+
target={"_blank"}
4042
onClick={(e: React.MouseEvent) => e.stopPropagation()}
4143
>
4244
{latestData.commitHash.substring(0, 8)}
4345
</Anchor>
4446
</Table.Td>
4547
<Table.Td>
46-
<Text size="sm">{new Date(latestData.timeStamp).toISOString()}</Text>
48+
<Text size={"sm"}>{new Date(latestData.timeStamp).toISOString()}</Text>
4749
</Table.Td>
4850
<Table.Td>
4951
<ImageThumbnail
50-
type="candidate"
52+
type={"candidate"}
5153
group={record.group}
5254
name={record.name}
5355
hardware={record.hardware}
@@ -56,7 +58,7 @@ export function TestRow({ record, onOpen }: Props) {
5658
</Table.Td>
5759
<Table.Td>
5860
<ImageThumbnail
59-
type="reference"
61+
type={"reference"}
6062
group={record.group}
6163
name={record.name}
6264
hardware={record.hardware}
@@ -65,7 +67,7 @@ export function TestRow({ record, onOpen }: Props) {
6567
</Table.Td>
6668
<Table.Td>
6769
<ImageThumbnail
68-
type="difference"
70+
type={"difference"}
6971
group={record.group}
7072
name={record.name}
7173
hardware={record.hardware}

backend/frontend/src/main.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { StrictMode } from 'react';
22
import { createRoot } from 'react-dom/client';
3-
import '@mantine/core/styles.css';
4-
import './styles/common.css';
53
import { MantineProvider } from '@mantine/core';
4+
65
import App from './App';
76

7+
import '@mantine/core/styles.css';
8+
import './styles/common.css';
9+
810
createRoot(document.getElementById('root')!).render(
911
<StrictMode>
10-
<MantineProvider defaultColorScheme="dark">
12+
<MantineProvider defaultColorScheme={"dark"}>
1113
<App />
1214
</MantineProvider>
1315
</StrictMode>

backend/frontend/src/pages/Compare.tsx

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect, useRef } from 'react';
1+
import { useEffect, useRef,useState } from 'react';
22
import { Link, useSearchParams } from 'react-router-dom';
33
import {
44
Anchor,
@@ -11,6 +11,7 @@ import {
1111
TextInput,
1212
Title
1313
} from '@mantine/core';
14+
1415
import { TestRecord } from '../types';
1516
import { diffDisplay, diffStyle } from '../utils';
1617

@@ -42,7 +43,7 @@ function CompareCell({ type, group, name, hardware1, hardware2 }: Props) {
4243
textAlign: 'center'
4344
}}
4445
>
45-
<Anchor href={compareUrl} target="_blank">
46+
<Anchor href={compareUrl} target={"_blank"}>
4647
<img
4748
src={compareUrl}
4849
alt={`${hardware1} vs ${hardware2}`}
@@ -55,7 +56,7 @@ function CompareCell({ type, group, name, hardware1, hardware2 }: Props) {
5556
mt={2}
5657
style={{ borderRadius: 4, display: 'inline-block', ...diffStyle(pixelError) }}
5758
>
58-
<Text size="sm">{diffDisplay(pixelError)}</Text>
59+
<Text size={"sm"}>{diffDisplay(pixelError)}</Text>
5960
</Box>
6061
)}
6162
</Table.Td>
@@ -111,37 +112,37 @@ export default function Compare() {
111112
<Box>
112113
{/* Header */}
113114
<Box
114-
py="md"
115+
py={"md"}
115116
style={{ textAlign: 'center', backgroundColor: 'var(--mantine-color-dark-7)' }}
116117
>
117118
<Title order={1} style={{ fontVariant: 'small-caps' }}>
118-
<Link to="/" style={{ textDecoration: 'none', color: 'white' }}>
119+
<Link to={"/"} style={{ textDecoration: 'none', color: 'white' }}>
119120
OpenSpace Image Testing
120121
</Link>
121122
</Title>
122123
</Box>
123124

124125
{/* Input fields */}
125126
<Group
126-
p="sm"
127-
align="flex-end"
127+
p={"sm"}
128+
align={"flex-end"}
128129
style={{ backgroundColor: 'var(--mantine-color-dark-6)' }}
129130
>
130131
<TextInput
131-
label="Group"
132-
size="sm"
132+
label={"Group"}
133+
size={"sm"}
133134
value={group}
134135
onChange={(e) => setGroup(e.target.value)}
135136
/>
136137
<TextInput
137-
label="Name"
138-
size="sm"
138+
label={"Name"}
139+
size={"sm"}
139140
value={name}
140141
onChange={(e) => setName(e.target.value)}
141142
/>
142143
<Select
143-
label="Type"
144-
size="sm"
144+
label={"Type"}
145+
size={"sm"}
145146
w={160}
146147
value={type}
147148
onChange={(val) => setType((val ?? 'reference') as ImageType)}
@@ -156,15 +157,15 @@ export default function Compare() {
156157
</Group>
157158

158159
{shareUrl && (
159-
<Box px="sm" py="xs">
160-
<Anchor href={shareUrl} size="sm">
160+
<Box px={"sm"} py={"xs"}>
161+
<Anchor href={shareUrl} size={"sm"}>
161162
{shareUrl}
162163
</Anchor>
163164
</Box>
164165
)}
165166

166167
{hasResult && (
167-
<Table id="splom" withColumnBorders withTableBorder>
168+
<Table id={"splom"} withColumnBorders withTableBorder>
168169
<Table.Tbody>
169170
{hardwares.map((hw, i) => (
170171
<Table.Tr key={hw}>
@@ -182,15 +183,15 @@ export default function Compare() {
182183
>
183184
<Anchor
184185
href={`/api/result/${rType}/${rGroup}/${rName}/${hw}`}
185-
target="_blank"
186+
target={"_blank"}
186187
>
187188
<img
188189
src={`/api/result/${rType}-thumbnail/${rGroup}/${rName}/${hw}`}
189190
alt={hw}
190191
style={{ width: 150, height: 84.375 }}
191192
/>
192193
</Anchor>
193-
<Text size="sm" ta="center">
194+
<Text size={"sm"} ta={"center"}>
194195
{hw}
195196
</Text>
196197
</Table.Td>

0 commit comments

Comments
 (0)