Skip to content

Commit 8651db0

Browse files
committed
Run prettier on all front
1 parent 3889733 commit 8651db0

31 files changed

+184
-157
lines changed

front/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"dev": "next dev",
77
"build": "next build",
88
"start": "next start",
9+
"format": "prettier --write .",
910
"lint": "next lint",
1011
"lint:fix": "eslint --fix --ext .js,.jsx,.ts,.tsx ./src"
1112
},

front/postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ module.exports = {
33
tailwindcss: {},
44
autoprefixer: {},
55
},
6-
}
6+
};

front/src/api/annotation_tasks.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ export function registerAnnotationTasksAPI(
9292
recording_tag__key: params.recording_tag?.key,
9393
recording_tag__value: params.recording_tag?.value,
9494
sound_event_annotation_tag__key: params.sound_event_annotation_tag?.key,
95-
sound_event_annotation_tag__value: params.sound_event_annotation_tag?.value,
95+
sound_event_annotation_tag__value:
96+
params.sound_event_annotation_tag?.value,
9697
pending__eq: params.pending,
9798
assigned__eq: params.assigned,
9899
verified__eq: params.verified,

front/src/api/clip_predictions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
PredictionTagSchema,
1010
RecordingSchema,
1111
UserRunSchema,
12-
PredictedTagFilterSchema
12+
PredictedTagFilterSchema,
1313
} from "@/schemas";
1414

1515
import type { ClipPrediction, Tag } from "@/types";

front/src/app/(auth)/first/page.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,10 @@ export default function Page() {
2828
[router],
2929
);
3030

31-
const handleAuthenticationError = useCallback(
32-
() => {
33-
toast.error("This is not your first time here, is it?");
34-
router.push("/login");
35-
},
36-
[router],
37-
);
31+
const handleAuthenticationError = useCallback(() => {
32+
toast.error("This is not your first time here, is it?");
33+
router.push("/login");
34+
}, [router]);
3835

3936
return (
4037
<div className="flex flex-col items-center justify-center min-h-screen">

front/src/app/(base)/annotation_projects/detail/tasks/page.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export default function Page() {
2323

2424
return (
2525
<Center>
26-
<AnnotationProjectTasks annotationProject={project} onAddTasks={onCreateTasks} />
26+
<AnnotationProjectTasks
27+
annotationProject={project}
28+
onAddTasks={onCreateTasks}
29+
/>
2730
</Center>
2831
);
2932
}

front/src/app/(base)/exploration/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default function Page() {
1111
<div className="flex flex-col gap-4">
1212
<h1 className="text-center text-5xl">Exploration Tools</h1>
1313
<h2 className="text-center text-3xl text-stone-500 dark:text-stone-500">
14-
Utilize the provided tools to delve into your data
14+
Utilize the provided tools to delve into your data
1515
</h2>
1616
</div>
1717
<div className="flex flex-row gap-8 w-full justify-center">

front/src/app/(base)/exploration/recordings/page.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ export default function Page() {
2525
/>
2626
);
2727
}
28-

front/src/app/(base)/page.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export default function Page() {
88
<div className="container mx-auto p-16">
99
<div className="flex flex-col gap-4">
1010
<h1 className="text-center text-7xl">
11-
<span className="text-6xl font-thin">
12-
Welcome to
13-
</span>
11+
<span className="text-6xl font-thin">Welcome to</span>
1412
<br />
1513
<Image
1614
src="/whombat.svg"

front/src/components/annotation_projects/AnnotationProjectHeader.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ import {
66

77
import Header from "@/components/Header";
88
import { H1 } from "@/components/Headings";
9-
import { DatasetIcon, EditIcon, ClipsIcon, TagsIcon, TasksIcon } from "@/components/icons";
9+
import {
10+
DatasetIcon,
11+
EditIcon,
12+
ClipsIcon,
13+
TagsIcon,
14+
TasksIcon,
15+
} from "@/components/icons";
1016
import Tabs from "@/components/Tabs";
1117

1218
import type { AnnotationProject } from "@/types";
@@ -43,7 +49,7 @@ export default function AnnotationProjectHeader({
4349
id: "clips",
4450
title: "Clips",
4551
isActive: selectedLayoutSegment === "clips",
46-
icon: <ClipsIcon className="w-5 h-5 align-middle"/>,
52+
icon: <ClipsIcon className="w-5 h-5 align-middle" />,
4753
onClick: () => {
4854
router.push(
4955
`/annotation_projects/detail/clips/?${params.toString()}`,

front/src/components/annotation_projects/AnnotationProjectTaskClips.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useMemo } from "react";
22

33
import AnnotationTaskTable from "@/components/annotation_tasks/AnnotationTaskTable";
44

5-
import type {AnnotationProject, AnnotationTask} from "@/types";
5+
import type { AnnotationProject, AnnotationTask } from "@/types";
66

77
export default function AnnotationProjectTaskClips({
88
annotationProject,
@@ -11,7 +11,6 @@ export default function AnnotationProjectTaskClips({
1111
annotationProject: AnnotationProject;
1212
getAnnotationTaskLink?: (annotationTask: AnnotationTask) => string;
1313
}) {
14-
1514
const getAnnotationTaskLink = useMemo(() => {
1615
if (getAnnotationTaskLinkFn == null) return undefined;
1716

@@ -20,7 +19,10 @@ export default function AnnotationProjectTaskClips({
2019
return `${url}&annotation_project_uuid=${annotationProject.uuid}`;
2120
};
2221
}, [getAnnotationTaskLinkFn, annotationProject.uuid]);
23-
const filter = useMemo(() => ({ annotation_project: annotationProject }), [annotationProject]);
22+
const filter = useMemo(
23+
() => ({ annotation_project: annotationProject }),
24+
[annotationProject],
25+
);
2426

2527
return (
2628
<AnnotationTaskTable

front/src/components/annotation_tasks/AnnotationTaskTable.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ export default function AnnotationTaskTable({
2626
const table = useAnnotationTaskTable({
2727
data: annotationTasks.items,
2828
getAnnotationTaskLink: getAnnotationTaskLink,
29-
pathFormatter
29+
pathFormatter,
3030
});
3131

3232
if (annotationTasks.isLoading || annotationTasks.data == null) {
3333
return <Loading />;
3434
}
3535

36-
return (
36+
return (
3737
<div className="flex flex-col gap-y-4">
3838
<div className="flex flex-row justify-between space-x-4">
3939
<div className="flex flex-row space-x-3 basis-1/2">
@@ -60,7 +60,7 @@ export default function AnnotationTaskTable({
6060
/>
6161
<div className="w-full">
6262
<div className="overflow-x-auto overflow-y-auto w-full max-h-screen rounded-md outline outline-1 outline-stone-200 dark:outline-stone-800">
63-
<Table table={table}/>
63+
<Table table={table} />
6464
</div>
6565
</div>
6666
<Pagination {...annotationTasks.pagination} />

front/src/components/audio/Player.tsx

+7-5
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,19 @@ function SelectSpeed({
170170
key={option.value.toString()}
171171
value={option.value}
172172
className={({ active }) =>
173-
`relative cursor-default select-none p-1 ${active
174-
? "bg-emerald-100 text-emerald-900"
175-
: "text-stone-900 dark:text-stone-300"
173+
`relative cursor-default select-none p-1 ${
174+
active
175+
? "bg-emerald-100 text-emerald-900"
176+
: "text-stone-900 dark:text-stone-300"
176177
}`
177178
}
178179
>
179180
{({ selected }) => (
180181
<>
181182
<span
182-
className={`block truncate ${selected ? "text-emerald-500 font-medium" : "font-normal"
183-
}`}
183+
className={`block truncate ${
184+
selected ? "text-emerald-500 font-medium" : "font-normal"
185+
}`}
184186
>
185187
{option.label}
186188
</span>

front/src/components/clip_evaluations/ClipEvaluationTags.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ export default function ClipEvaluationTags(props: {
6262
{...getTagColor(tag)}
6363
/>
6464
))}
65-
{predictedTags.length === 0 && (
66-
<Empty padding="p-0">No tags.</Empty>
67-
)}
65+
{predictedTags.length === 0 && <Empty padding="p-0">No tags.</Empty>}
6866
</div>
6967
</div>
7068
</div>

front/src/components/colors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1586,6 +1586,6 @@ const ALL_COLORS_DARK = [
15861586
"dark:outline-rose-700",
15871587
"dark:outline-rose-800",
15881588
"dark:outline-rose-900",
1589-
]
1589+
];
15901590

15911591
export { ALL_COLORS, ALL_COLORS_DARK };

front/src/components/evaluation_sets/ModelEvaluationSummary.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default function ModelEvaluationSummary({
4848
<div className="inline-flex gap-2 items-baseline">
4949
<Link
5050
mode="text"
51-
padding="p-0"
51+
padding="p-0"
5252
href={`/evaluation/detail/model_run/?evaluation_set_uuid=${evaluationSet.uuid}&model_run_uuid=${modelRun.uuid}`}
5353
>
5454
{modelRun.name}

front/src/components/filters/FilterBar.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { useMemo } from "react";
22

3-
import { FilterIcon } from "@/components/icons";
3+
import { FilterIcon } from "@/components/icons";
44

55
import type { FilterDef } from "@/components/filters/FilterMenu";
66
import type { Filter } from "@/hooks/utils/useFilter";

front/src/components/filters/annotation_tasks.tsx

+29-28
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import FilterBadge from "@/components/filters/FilterBadge";
2-
import { BooleanFilter, } from "@/components/filters/Filters";
3-
import { CompleteIcon, EditIcon, NeedsReviewIcon, VerifiedIcon, } from "@/components/icons";
2+
import { BooleanFilter } from "@/components/filters/Filters";
3+
import {
4+
CompleteIcon,
5+
EditIcon,
6+
NeedsReviewIcon,
7+
VerifiedIcon,
8+
} from "@/components/icons";
49

510
import type { AnnotationTaskFilter } from "@/api/annotation_tasks";
611
import type { FilterDef } from "@/components/filters/FilterMenu";
@@ -11,53 +16,50 @@ const annotationTaskFilterDefs: FilterDef<AnnotationTaskFilter>[] = [
1116
name: "Verified",
1217
field: "verified",
1318
selector: ({ setFilter }) => (
14-
<BooleanFilter
15-
onChange={(val) => setFilter("verified", val)}
16-
/>
19+
<BooleanFilter onChange={(val) => setFilter("verified", val)} />
1720
),
1821
render: ({ value, clear }) => (
1922
<FilterBadge
20-
field="Verified"
21-
value={value ? "Yes" : "No"}
22-
onRemove={clear} />
23+
field="Verified"
24+
value={value ? "Yes" : "No"}
25+
onRemove={clear}
26+
/>
2327
),
2428
description: "Select only verified annotation tasks.",
2529
icon: (
2630
<VerifiedIcon className="h-5 w-5 inline-block text-stone-500 mr-1 align-middle" />
2731
),
2832
},
29-
{
33+
{
3034
name: "Needs Review",
3135
field: "rejected",
3236
selector: ({ setFilter }) => (
33-
<BooleanFilter
34-
onChange={(val) => setFilter("rejected", val)}
35-
/>
37+
<BooleanFilter onChange={(val) => setFilter("rejected", val)} />
3638
),
3739
render: ({ value, clear }) => (
3840
<FilterBadge
39-
field="Rejected"
40-
value={value ? "Yes" : "No"}
41-
onRemove={clear} />
41+
field="Rejected"
42+
value={value ? "Yes" : "No"}
43+
onRemove={clear}
44+
/>
4245
),
4346
description: "Select only annotation tasks that need review.",
4447
icon: (
4548
<NeedsReviewIcon className="h-5 w-5 inline-block text-stone-500 mr-1 align-middle" />
4649
),
4750
},
48-
{
51+
{
4952
name: "Pending",
5053
field: "pending",
5154
selector: ({ setFilter }) => (
52-
<BooleanFilter
53-
onChange={(val) => setFilter("pending", val)}
54-
/>
55+
<BooleanFilter onChange={(val) => setFilter("pending", val)} />
5556
),
5657
render: ({ value, clear }) => (
5758
<FilterBadge
58-
field="Pending"
59-
value={value ? "Yes" : "No"}
60-
onRemove={clear} />
59+
field="Pending"
60+
value={value ? "Yes" : "No"}
61+
onRemove={clear}
62+
/>
6163
),
6264
description: "Select only pending annotation tasks.",
6365
icon: (
@@ -68,15 +70,14 @@ const annotationTaskFilterDefs: FilterDef<AnnotationTaskFilter>[] = [
6870
name: "Completed",
6971
field: "completed",
7072
selector: ({ setFilter }) => (
71-
<BooleanFilter
72-
onChange={(val) => setFilter("completed", val)}
73-
/>
73+
<BooleanFilter onChange={(val) => setFilter("completed", val)} />
7474
),
7575
render: ({ value, clear }) => (
7676
<FilterBadge
77-
field="Completed"
78-
value={value ? "Yes" : "No"}
79-
onRemove={clear} />
77+
field="Completed"
78+
value={value ? "Yes" : "No"}
79+
onRemove={clear}
80+
/>
8081
),
8182
description: "Select only verified annotation tasks.",
8283
icon: (

front/src/components/filters/tasks.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ const tasksFilterDefs: FilterDef<AnnotationTaskFilter>[] = [
8282
/>
8383
),
8484
selector: ({ setFilter }) => (
85-
<TagFilter onChange={(val) => setFilter("sound_event_annotation_tag", val)} />
85+
<TagFilter
86+
onChange={(val) => setFilter("sound_event_annotation_tag", val)}
87+
/>
8688
),
8789
description: "Select task that contain a sound event with a specific tag",
8890
icon: (

front/src/components/search/Search.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import type { FuseOptionKey } from "fuse.js";
2121
import type { ReactElement, ReactNode } from "react";
2222
import type { AriaListBoxOptions, AriaPopoverProps } from "react-aria";
2323

24-
function EmptyMessage({ }: { state: ComboBoxState<any> }) {
24+
function EmptyMessage({}: { state: ComboBoxState<any> }) {
2525
return <div className="p-2">No results</div>;
2626
}
2727

@@ -167,8 +167,8 @@ function ListBox<T>({
167167
{state.collection.size === 0
168168
? emptyMessage({ state })
169169
: Array.from(state.collection).map((item) => (
170-
<Option key={item.key} item={item} state={state} />
171-
))}
170+
<Option key={item.key} item={item} state={state} />
171+
))}
172172
</ul>
173173
</div>
174174
);

front/src/components/search/SearchMenu.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@ function MenuOption<T>({
159159
return (
160160
<Combobox.Option
161161
className={({ active }) =>
162-
`relative cursor-default select-none p-2 rounded-md ${active
163-
? "bg-stone-200 dark:bg-stone-800 text-emerald-600 dark:text-emerald-500"
164-
: ""
162+
`relative cursor-default select-none p-2 rounded-md ${
163+
active
164+
? "bg-stone-200 dark:bg-stone-800 text-emerald-600 dark:text-emerald-500"
165+
: ""
165166
}`
166167
}
167168
value={option}

front/src/components/tables/TableMap.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export default function TableMap({
7878
className="absolute left-1/2 z-40 px-4 mt-3 transform -translate-x-1/2 sm:px-0 lg:max-w-3xl"
7979
>
8080
<div className="dark:bg-stone-800 bg-stone-200 w-80 border border-stone-300 dark:border-stone-700 border-1 p-2 rounded-md">
81-
<LocationInput value={initialValue} onChange={onChange} />
81+
<LocationInput value={initialValue} onChange={onChange} />
8282
</div>
8383
</Popover.Panel>
8484
</Float>

0 commit comments

Comments
 (0)