Skip to content

Commit b57f951

Browse files
committed
Run prettier
1 parent f07805a commit b57f951

25 files changed

Lines changed: 662 additions & 590 deletions

backend/frontend/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
<link rel="icon" type="image/x-icon" href="/common/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>OpenSpace Visual Tests</title>
8-
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Roboto" />
8+
<link
9+
rel="stylesheet"
10+
type="text/css"
11+
href="//fonts.googleapis.com/css?family=Roboto"
12+
/>
913
</head>
1014
<body>
1115
<div id="root"></div>

backend/frontend/src/App.tsx

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

55
function App() {
66
return (
@@ -10,7 +10,7 @@ function App() {
1010
<Route path="/compare" element={<Compare />} />
1111
</Routes>
1212
</BrowserRouter>
13-
)
13+
);
1414
}
1515

16-
export default App
16+
export default App;
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
import { Anchor } from '@mantine/core'
1+
import { Anchor } from '@mantine/core';
22

33
interface Props {
4-
type: string
5-
group: string
6-
name: string
7-
hardware: string
8-
timestamp?: string
9-
stopPropagation?: boolean
10-
};
4+
type: string;
5+
group: string;
6+
name: string;
7+
hardware: string;
8+
timestamp?: string;
9+
stopPropagation?: boolean;
10+
}
1111

1212
export function ImageThumbnail({
13-
type, group, name, hardware, timestamp, stopPropagation = false,
13+
type,
14+
group,
15+
name,
16+
hardware,
17+
timestamp,
18+
stopPropagation = false
1419
}: Props) {
15-
const timePart = timestamp ? `/${timestamp}` : ''
20+
const timePart = timestamp ? `/${timestamp}` : '';
1621
return (
1722
<Anchor
1823
href={`/api/result/${type}/${group}/${name}/${hardware}${timePart}`}
@@ -26,5 +31,5 @@ export function ImageThumbnail({
2631
alt={type}
2732
/>
2833
</Anchor>
29-
)
34+
);
3035
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import { Table } from '@mantine/core'
2-
import { SortColumn } from '../types'
1+
import { Table } from '@mantine/core';
2+
import { SortColumn } from '../types';
33

44
interface Props {
5-
sortKey: SortColumn
6-
label: string
7-
onSort: (col: SortColumn) => void
8-
};
5+
sortKey: SortColumn;
6+
label: string;
7+
onSort: (col: SortColumn) => void;
8+
}
99

1010
export function SortableHeader({ sortKey, label, onSort }: Props) {
1111
return (
1212
<Table.Th style={{ cursor: 'pointer' }} onClick={() => onSort(sortKey)}>
1313
{label}
1414
</Table.Th>
15-
)
15+
);
1616
}

backend/frontend/src/components/TestHistory.tsx

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { Anchor, Box, Button, Table, Text } from '@mantine/core'
2-
import { TestRecord, TestData } from '../types'
3-
import { diffDisplay, diffStyle, timingDisplay } from '../utils'
4-
import { ImageThumbnail } from './ImageThumbnail'
1+
import { Anchor, Box, Button, Table, Text } from '@mantine/core';
2+
import { TestRecord, TestData } from '../types';
3+
import { diffDisplay, diffStyle, timingDisplay } from '../utils';
4+
import { ImageThumbnail } from './ImageThumbnail';
55

66
interface Props {
7-
record: TestRecord
8-
onUpdateReference: (record: TestRecord) => void
9-
};
7+
record: TestRecord;
8+
onUpdateReference: (record: TestRecord) => void;
9+
}
1010

1111
export function TestHistory({ record, onUpdateReference }: Props) {
12-
const testData = [...record.data].reverse()
12+
const testData = [...record.data].reverse();
1313

1414
return (
1515
<Box p="md" bg="dark.8">
@@ -31,10 +31,21 @@ export function TestHistory({ record, onUpdateReference }: Props) {
3131
{testData.map((d: TestData, i: number) => (
3232
<Table.Tr key={d.timeStamp}>
3333
<Table.Td>
34-
<Text size="sm" c="dimmed">{new Date(d.timeStamp).toUTCString()}</Text>
34+
<Text size="sm" c="dimmed">
35+
{new Date(d.timeStamp).toUTCString()}
36+
</Text>
3537
</Table.Td>
3638
<Table.Td>
37-
<Box px={4} style={{ borderRadius: 4, display: 'inline-block', width: 70, textAlign: 'center', ...diffStyle(d.pixelError) }}>
39+
<Box
40+
px={4}
41+
style={{
42+
borderRadius: 4,
43+
display: 'inline-block',
44+
width: 70,
45+
textAlign: 'center',
46+
...diffStyle(d.pixelError)
47+
}}
48+
>
3849
<Text>{diffDisplay(d.pixelError)}</Text>
3950
</Box>
4051
</Table.Td>
@@ -58,16 +69,31 @@ export function TestHistory({ record, onUpdateReference }: Props) {
5869
</Anchor>
5970
</Table.Td>
6071
<Table.Td>
61-
<ImageThumbnail type="candidate" group={record.group} name={record.name}
62-
hardware={record.hardware} timestamp={d.timeStamp} />
72+
<ImageThumbnail
73+
type="candidate"
74+
group={record.group}
75+
name={record.name}
76+
hardware={record.hardware}
77+
timestamp={d.timeStamp}
78+
/>
6379
</Table.Td>
6480
<Table.Td>
65-
<ImageThumbnail type="reference" group={record.group} name={record.name}
66-
hardware={record.hardware} timestamp={d.timeStamp} />
81+
<ImageThumbnail
82+
type="reference"
83+
group={record.group}
84+
name={record.name}
85+
hardware={record.hardware}
86+
timestamp={d.timeStamp}
87+
/>
6788
</Table.Td>
6889
<Table.Td>
69-
<ImageThumbnail type="difference" group={record.group} name={record.name}
70-
hardware={record.hardware} timestamp={d.timeStamp} />
90+
<ImageThumbnail
91+
type="difference"
92+
group={record.group}
93+
name={record.name}
94+
hardware={record.hardware}
95+
timestamp={d.timeStamp}
96+
/>
7197
</Table.Td>
7298
<Table.Td>
7399
{i === 0 && (
@@ -81,5 +107,5 @@ export function TestHistory({ record, onUpdateReference }: Props) {
81107
</Table.Tbody>
82108
</Table>
83109
</Box>
84-
)
110+
);
85111
}
Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
1-
import { Anchor, Box, Table, Text } from '@mantine/core'
2-
import { TestRecord } from '../types'
3-
import { diffDisplay, diffStyle, timingDisplay } from '../utils'
4-
import { ImageThumbnail } from './ImageThumbnail'
1+
import { Anchor, Box, Table, Text } from '@mantine/core';
2+
import { TestRecord } from '../types';
3+
import { diffDisplay, diffStyle, timingDisplay } from '../utils';
4+
import { ImageThumbnail } from './ImageThumbnail';
55

66
interface Props {
7-
record: TestRecord
8-
onOpen: (record: TestRecord) => void
9-
};
7+
record: TestRecord;
8+
onOpen: (record: TestRecord) => void;
9+
}
1010

1111
export function TestRow({ record, onOpen }: Props) {
12-
const latestData = record.data[record.data.length - 1]
13-
if (!latestData) return null
12+
const latestData = record.data[record.data.length - 1];
13+
if (!latestData) return null;
1414

1515
return (
1616
<Table.Tr style={{ cursor: 'pointer' }} onClick={() => onOpen(record)}>
1717
<Table.Td style={{ width: 90 }}>
1818
<Box
1919
px={6}
2020
py={2}
21-
style={{ borderRadius: 4, textAlign: 'center', fontSize: 13, ...diffStyle(latestData.pixelError) }}
21+
style={{
22+
borderRadius: 4,
23+
textAlign: 'center',
24+
fontSize: 13,
25+
...diffStyle(latestData.pixelError)
26+
}}
2227
>
2328
{diffDisplay(latestData.pixelError)}
2429
</Box>
@@ -42,22 +47,31 @@ export function TestRow({ record, onOpen }: Props) {
4247
</Table.Td>
4348
<Table.Td>
4449
<ImageThumbnail
45-
type="candidate" group={record.group} name={record.name}
46-
hardware={record.hardware} stopPropagation
50+
type="candidate"
51+
group={record.group}
52+
name={record.name}
53+
hardware={record.hardware}
54+
stopPropagation
4755
/>
4856
</Table.Td>
4957
<Table.Td>
5058
<ImageThumbnail
51-
type="reference" group={record.group} name={record.name}
52-
hardware={record.hardware} stopPropagation
59+
type="reference"
60+
group={record.group}
61+
name={record.name}
62+
hardware={record.hardware}
63+
stopPropagation
5364
/>
5465
</Table.Td>
5566
<Table.Td>
5667
<ImageThumbnail
57-
type="difference" group={record.group} name={record.name}
58-
hardware={record.hardware} stopPropagation
68+
type="difference"
69+
group={record.group}
70+
name={record.name}
71+
hardware={record.hardware}
72+
stopPropagation
5973
/>
6074
</Table.Td>
6175
</Table.Tr>
62-
)
76+
);
6377
}

backend/frontend/src/main.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { StrictMode } from 'react'
2-
import { createRoot } from 'react-dom/client'
3-
import '@mantine/core/styles.css'
4-
import './styles/common.css'
5-
import { MantineProvider } from '@mantine/core'
6-
import App from './App'
1+
import { StrictMode } from 'react';
2+
import { createRoot } from 'react-dom/client';
3+
import '@mantine/core/styles.css';
4+
import './styles/common.css';
5+
import { MantineProvider } from '@mantine/core';
6+
import App from './App';
77

88
createRoot(document.getElementById('root')!).render(
99
<StrictMode>
1010
<MantineProvider defaultColorScheme="dark">
1111
<App />
1212
</MantineProvider>
1313
</StrictMode>
14-
)
14+
);

0 commit comments

Comments
 (0)