Skip to content

Commit fa4a413

Browse files
committed
style: format prettier with object wrapping set to collapse
1 parent b41c9e0 commit fa4a413

File tree

80 files changed

+146
-529
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+146
-529
lines changed

.prettierrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"bracketSpacing": true,
88
"bracketSameLine": false,
99
"useTabs": false,
10-
"tabWidth": 2
10+
"tabWidth": 2,
11+
"objectWrap": "collapse"
1112
}

pnpm-lock.yaml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/BaseCard.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,7 @@ export interface BaseCardProps {
4848
* String values to be displayed in the header section of the card. Only title is required.
4949
* Missing values are not displayed.
5050
*/
51-
header?: {
52-
title: string;
53-
subtitle?: string;
54-
avatar?: string;
55-
color?: string;
56-
};
51+
header?: { title: string; subtitle?: string; avatar?: string; color?: string };
5752
}
5853

5954
/**
@@ -85,10 +80,7 @@ export const BaseCard = ({
8580
{header.avatar?.[0].toUpperCase()}
8681
</Avatar>
8782
}
88-
slotProps={{
89-
subheader: { variant: "subtitle1" },
90-
title: { variant: "body1" },
91-
}}
83+
slotProps={{ subheader: { variant: "subtitle1" }, title: { variant: "body1" } }}
9284
subheader={header.subtitle}
9385
title={header.title}
9486
/>

src/components/CreateDatasetStorageSubscription.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ export interface CreateDatasetStorageSubscriptionProps {
1919
unit: UnitAllDetail;
2020
}
2121

22-
const initialValues = {
23-
allowance: 1000,
24-
name: "Dataset Storage",
25-
};
22+
const initialValues = { allowance: 1000, name: "Dataset Storage" };
2623

2724
export const CreateDatasetStorageSubscription = ({
2825
unit,
@@ -34,10 +31,12 @@ export const CreateDatasetStorageSubscription = ({
3431
return (
3532
<Formik
3633
initialValues={initialValues}
37-
validationSchema={yup.object().shape({
38-
name: yup.string().trim().required("A name is required"),
39-
allowance: yup.number().min(1).integer().required("An allowance is required"),
40-
})}
34+
validationSchema={yup
35+
.object()
36+
.shape({
37+
name: yup.string().trim().required("A name is required"),
38+
allowance: yup.number().min(1).integer().required("An allowance is required"),
39+
})}
4140
onSubmit={async ({ allowance, name }) => {
4241
try {
4342
await createProduct({

src/components/DataTable/DataTable.tsx

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ const fuzzyFilter: FilterFn<any> = (row, columnId, value, addMeta) => {
126126
const itemRank = rankItem(row.getValue(columnId), value);
127127

128128
// Store the itemRank info
129-
addMeta({
130-
itemRank,
131-
});
129+
addMeta({ itemRank });
132130

133131
// Return if the item should be filtered in/out
134132
return itemRank.passed;
@@ -224,16 +222,8 @@ export const DataTable = <Data extends Record<string, any>>(props: DataTableProp
224222
getRowId,
225223
data: tableData,
226224
columns: paddedColumns,
227-
filterFns: {
228-
fuzzy: fuzzyFilter,
229-
},
230-
state: {
231-
sorting,
232-
globalFilter,
233-
columnFilters,
234-
expanded,
235-
rowSelection,
236-
},
225+
filterFns: { fuzzy: fuzzyFilter },
226+
state: { sorting, globalFilter, columnFilters, expanded, rowSelection },
237227
initialState: {
238228
rowSelection: initialSelection
239229
? Object.fromEntries(initialSelection.map((id) => [id, true]))

src/components/FileSelector/AllFilesList.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ export const AllFilesList = ({
2626
const [breadcrumbs, setBreadcrumbs] = useState<string[]>([]);
2727
const subPath = "/" + breadcrumbs.join("/");
2828

29-
const { data, isLoading } = useGetFiles({
30-
project_id: projectId,
31-
path: subPath,
32-
});
29+
const { data, isLoading } = useGetFiles({ project_id: projectId, path: subPath });
3330

3431
const files =
3532
data?.files.filter((file) => !file.mime_type || mimeTypes?.includes(file.mime_type)) ?? [];

src/components/HorizontalList.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ export const HorizontalList = styled(List)({
88
display: "flex",
99
flexDirection: "row",
1010
flexWrap: "wrap",
11-
"& > li": {
12-
width: "auto",
13-
},
11+
"& > li": { width: "auto" },
1412
});

src/components/MolCard/DepictMolecule.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,11 @@ interface DepictMoleculePropsBase {
3030
}
3131

3232
export type DepictVariants =
33-
| {
34-
variant: "molFile";
35-
molFile: string;
36-
}
37-
| {
38-
variant: "smiles";
39-
smiles: string;
40-
};
33+
| { variant: "molFile"; molFile: string }
34+
| { variant: "smiles"; smiles: string };
4135

4236
export type DepictMoleculeProps = DepictMoleculePropsBase &
43-
DepictVariants & {
44-
depictParams: DepictParameters;
45-
};
37+
DepictVariants & { depictParams: DepictParameters };
4638

4739
type ImageProps = Omit<ComponentProps<"img">, "src">;
4840

src/components/ViewFilePopover/FilePlainTextViewerListItem.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ export const FilePlainTextViewerListItem = ({
2727
passHref
2828
href={{
2929
pathname: "/project/file",
30-
query: {
31-
project: router.query.project,
32-
file: fileName,
33-
path,
34-
},
30+
query: { project: router.query.project, file: fileName, path },
3531
}}
3632
>
3733
<ListItemButton

src/components/ViewFilePopover/SDFViewerListItem.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@ export const SDFViewerListItem = ({ fileName, path, onClick }: SDFViewerListItem
2525
passHref
2626
href={{
2727
pathname: "/viewer/sdf",
28-
query: {
29-
project: router.query.project,
30-
file: fileName,
31-
path,
32-
},
28+
query: { project: router.query.project, file: fileName, path },
3329
}}
3430
>
3531
<ListItemButton

src/components/ViewFilePopover/ViewFilePopover.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ export interface ViewFilePopoverProps {
1616
}
1717

1818
export const ViewFilePopover = ({ fileName, path }: ViewFilePopoverProps) => {
19-
const popupState = usePopupState({
20-
variant: "popover",
21-
popupId: `file-viewers-${fileName}`,
22-
});
19+
const popupState = usePopupState({ variant: "popover", popupId: `file-viewers-${fileName}` });
2320

2421
return (
2522
<>

src/components/instances/JobDetails/ExitCodeFromTask.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ export interface ExitCodeFromTaskProps {
99

1010
export const ExitCodeFromTask = ({ taskId }: ExitCodeFromTaskProps) => {
1111
const { data: code, isLoading } = useGetTask(taskId, undefined, {
12-
query: {
13-
select: (data) => data.exit_code,
14-
},
12+
query: { select: (data) => data.exit_code },
1513
});
1614

1715
if (code === undefined && !isLoading) {
@@ -29,12 +27,7 @@ export const ExitCodeFromTask = ({ taskId }: ExitCodeFromTaskProps) => {
2927
slotProps={
3028
isLoading
3129
? undefined
32-
: {
33-
secondary: {
34-
color: code === 0 ? "green" : "error",
35-
fontWeight: "bold",
36-
},
37-
}
30+
: { secondary: { color: code === 0 ? "green" : "error", fontWeight: "bold" } }
3831
}
3932
/>
4033
</ListItem>

src/components/instances/JobDetails/JobInputSection/useGetJobInputs.ts

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,12 @@ import { type InputFieldSchema } from "../../../runCards/JobCard/JobInputFields"
55
import { TEST_JOB_ID } from "../../../runCards/TestJob/jobId";
66

77
// Contains only fields we are interested in
8-
type ApplicationSpecification = {
9-
variables: Record<string, unknown>;
10-
};
8+
type ApplicationSpecification = { variables: Record<string, unknown> };
119

1210
// Contains only fields we are interested in
13-
type JobInput = {
14-
title: string;
15-
type: InputFieldSchema["type"];
16-
};
11+
type JobInput = { title: string; type: InputFieldSchema["type"] };
1712

18-
type JobInputs = {
19-
properties: Record<string, JobInput>;
20-
};
13+
type JobInputs = { properties: Record<string, JobInput> };
2114

2215
/**
2316
* Returns provided inputs with their information. It matches the provided inputs with their
@@ -31,9 +24,7 @@ export const useGetJobInputs = (instance: InstanceGetResponse | InstanceSummary)
3124
// Since the query will be disabled if job_id is undefined, providing -1 is fine
3225
instance.job_id ?? -1,
3326
undefined,
34-
{
35-
query: { enabled: inputsEnabled, retry: instance.job_id === TEST_JOB_ID ? 1 : 3 },
36-
},
27+
{ query: { enabled: inputsEnabled, retry: instance.job_id === TEST_JOB_ID ? 1 : 3 } },
3728
);
3829

3930
// Parse application specification
@@ -62,10 +53,5 @@ export const useGetJobInputs = (instance: InstanceGetResponse | InstanceSummary)
6253
};
6354
});
6455

65-
return {
66-
inputs: usedInputs,
67-
isLoading,
68-
isError,
69-
error,
70-
};
56+
return { inputs: usedInputs, isLoading, isError, error };
7157
};

src/components/instances/JobDetails/JobLink.tsx

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ const getResolvedPath = (path: string[]) => {
4040
return !containsGlob;
4141
});
4242

43-
return {
44-
resolvedPath,
45-
containsGlob,
46-
};
43+
return { resolvedPath, containsGlob };
4744
};
4845

4946
/**
@@ -68,26 +65,12 @@ export const JobLink = ({ projectId, path: originalPath, isFile }: JobLinkProps)
6865
const { filePath, fileName } = getFilePathAndName(resolvedPath);
6966

7067
return (
71-
<Box
72-
sx={{
73-
alignItems: "center",
74-
display: "flex",
75-
gap: 1,
76-
wordBreak: "break-all",
77-
}}
78-
>
68+
<Box sx={{ alignItems: "center", display: "flex", gap: 1, wordBreak: "break-all" }}>
7969
<Tooltip title="Locate file in project">
8070
<A
8171
legacyBehavior
8272
passHref
83-
href={{
84-
pathname: "/project",
85-
query: {
86-
...query,
87-
project: projectId,
88-
path: filePath,
89-
},
90-
}}
73+
href={{ pathname: "/project", query: { ...query, project: projectId, path: filePath } }}
9174
>
9275
<IconButton size="large">
9376
<Folder color="primary" fontSize="small" />
@@ -108,11 +91,7 @@ export const JobLink = ({ projectId, path: originalPath, isFile }: JobLinkProps)
10891
passHref
10992
href={{
11093
pathname: "/datasets",
111-
query: {
112-
...query,
113-
project: projectId,
114-
path: resolvedPath,
115-
},
94+
query: { ...query, project: projectId, path: resolvedPath },
11695
}}
11796
>
11897
<IconButton size="small">

src/components/instances/ResultApplicationCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ export const ResultApplicationCard = ({
7575
collapsedByDefault={collapsedByDefault}
7676
createdDateTime={instance.started ?? instance.launched}
7777
finishedDateTime={instance.stopped}
78-
href={{
79-
pathname: "/results/instance/[instanceId]",
80-
query: { ...query, instanceId },
81-
}}
78+
href={{ pathname: "/results/instance/[instanceId]", query: { ...query, instanceId } }}
8279
linkTitle="App"
8380
state={instance.phase}
8481
>

src/components/instances/ResultJobCard.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ export const ResultJobCard = ({
7575
collapsedByDefault={collapsedByDefault}
7676
createdDateTime={instance.started ?? instance.launched}
7777
finishedDateTime={instance.stopped}
78-
href={{
79-
pathname: "/results/instance/[instanceId]",
80-
query: { ...query, instanceId },
81-
}}
78+
href={{ pathname: "/results/instance/[instanceId]", query: { ...query, instanceId } }}
8279
linkTitle="Job"
8380
state={instance.phase}
8481
>

src/components/labels/NewLabelButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ export const NewLabelButton = ({ datasetId }: NewLabelButtonProps) => {
4545
<Formik
4646
validateOnMount
4747
initialValues={{ label: "", value: "" }}
48-
validationSchema={yup.object().shape({
49-
label: yup.string().trim().required("A label name is required"),
50-
})}
48+
validationSchema={yup
49+
.object()
50+
.shape({ label: yup.string().trim().required("A label name is required") })}
5151
onSubmit={async ({ label, value }) => {
5252
try {
5353
await addAnnotations({

src/components/projects/CreateProject/CreateProjectForm.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,7 @@ export const CreateProjectForm = ({
119119
}
120120

121121
const { project_id } = await createProject({
122-
data: {
123-
name: projectName,
124-
tier_product_id: productId,
125-
private: isPrivate,
126-
},
122+
data: { name: projectName, tier_product_id: productId, private: isPrivate },
127123
});
128124
enqueueSnackbar("Project created");
129125

@@ -167,10 +163,7 @@ export const CreateProjectForm = ({
167163
component="fieldset"
168164
sx={{
169165
display: "grid",
170-
gridTemplateColumns: {
171-
xs: "1fr",
172-
sm: "1fr 1fr auto" + (modal ? "" : " auto"),
173-
},
166+
gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr auto" + (modal ? "" : " auto") },
174167
gap: 1,
175168
alignItems: "baseline",
176169
}}

src/components/projects/EditProjectButton/PrivateProjectToggle.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,7 @@ export const PrivateProjectToggle = ({ projectId, isPrivate }: PrivateProjectTog
2323
const projectPrivacyChangeHandler = async (checked: boolean) => {
2424
if (projectId) {
2525
try {
26-
await adjustProject({
27-
projectId,
28-
data: {
29-
private: checked,
30-
},
31-
});
26+
await adjustProject({ projectId, data: { private: checked } });
3227
void queryClient.invalidateQueries({ queryKey: getGetProjectsQueryKey() });
3328
void queryClient.invalidateQueries({ queryKey: getGetProjectQueryKey(projectId) });
3429

0 commit comments

Comments
 (0)