Skip to content

Commit

Permalink
chore(ui): format code
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Oct 30, 2024
1 parent 4401aea commit fc439c8
Show file tree
Hide file tree
Showing 19 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
12 changes: 6 additions & 6 deletions ui/src/api/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default class ActionAPI {
return useSWR<Action[]>(
`/actions?${new URLSearchParams({ type })}`,
apiFetcher,
swrOptions
swrOptions,
)
}

Expand Down Expand Up @@ -210,7 +210,7 @@ export default class ActionAPI {
}

static async runDisableConstraints(
options: DisableConstraintsOptions
options: DisableConstraintsOptions,
): Promise<DisableConstraintsSummary> {
return apiFetch(`/actions/run/disable_constraints`, {
method: 'POST',
Expand All @@ -222,7 +222,7 @@ export default class ActionAPI {
}

static async runEnableConstraints(
options: EnableConstraintsOptions
options: EnableConstraintsOptions,
): Promise<EnableConstraintsSummary> {
return apiFetch(`/actions/run/enable_constraints`, {
method: 'POST',
Expand All @@ -234,7 +234,7 @@ export default class ActionAPI {
}

static async runDisableTriggers(
options: DisableTriggersOptions
options: DisableTriggersOptions,
): Promise<DisableTriggersSummary> {
return apiFetch(`/actions/run/disable_triggers`, {
method: 'POST',
Expand All @@ -246,7 +246,7 @@ export default class ActionAPI {
}

static async runEnableTriggers(
options: EnableTriggersOptions
options: EnableTriggersOptions,
): Promise<EnableTriggersSummary> {
return apiFetch(`/actions/run/enable_triggers`, {
method: 'POST',
Expand All @@ -258,7 +258,7 @@ export default class ActionAPI {
}

static async runDropObjects(
options: DropObjectsOptions
options: DropObjectsOptions,
): Promise<DropObjectsSummary> {
return apiFetch(`/actions/run/drop_objects`, {
method: 'POST',
Expand Down
2 changes: 1 addition & 1 deletion ui/src/api/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default class ConnectionAPI {
return useSWR<Connection>(
id ? `/connections/${id}` : null,
apiFetcher,
swrOptions
swrOptions,
)
}

Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/actions/delete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Delete = ({ id, open, onComplete, onDismiss }: DeleteProps) => {
setDeleteLoading(false)
}
},
[onComplete, onClose]
[onComplete, onClose],
)

return (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/actions/run/clone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Clone = () => {
setLoading(false)
}
},
[]
[],
)

if (!connections) {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/actions/run/migrate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Migrate = () => {
setLoading(false)
}
},
[]
[],
)

if (!connections) {
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/comparison/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const Comparison = () => {
setTargetInvalid(!targetConnectionId)
if (sourceConnectionId && targetConnectionId) {
navigate(
`/comparison/${sourceConnectionId}/${targetConnectionId}`
`/comparison/${sourceConnectionId}/${targetConnectionId}`,
)
}
}}
Expand Down
4 changes: 2 additions & 2 deletions ui/src/components/comparison/result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const Result = ({
(state) =>
state.entities.comparisons.items[
`${sourceConnectionId}:${targetConnectionId}`
]
],
)
const [loading, setLoading] = useState(false)
const { data: sourceConnection } =
Expand All @@ -63,7 +63,7 @@ const Result = ({
comparisonSet({
key: `${sourceConnectionId}:${targetConnectionId}`,
value: comparison,
})
}),
)
setFailed(false)
} catch {
Expand Down
7 changes: 5 additions & 2 deletions ui/src/components/connection/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => {
})

const handleSubmit = useCallback(
async (values: FormValues, { setSubmitting }: FormikHelpers<FormValues>) => {
async (
values: FormValues,
{ setSubmitting }: FormikHelpers<FormValues>,
) => {
setSubmitting(true)
try {
await ConnectionAPI.create({
Expand All @@ -69,7 +72,7 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => {
setSubmitting(false)
}
},
[toast, onComplete]
[toast, onComplete],
)

return (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/connection/delete.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Delete = ({ id, open, onComplete, onDismiss }: DeleteProps) => {
setDeleteLoading(false)
}
},
[onComplete, onClose]
[onComplete, onClose],
)

return (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/connection/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Edit = ({ id }: EditProps) => {
setSubmitting(false)
}
},
[id, toast, navigate]
[id, toast, navigate],
)

if (!connection) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type ConstraintsProps = {
const Constraints = ({ connectionId }: ConstraintsProps) => {
const constraints = useAppSelector(
(state) =>
state.entities.introspections.items[connectionId]?.constraints || []
state.entities.introspections.items[connectionId]?.constraints || [],
)
if (constraints && constraints.length > 0) {
return (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/introspection/database-objects/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ type DatabaseObjectsProps = {
const DatabaseObjects = ({ connectionId, onDismiss }: DatabaseObjectsProps) => {
const dispatch = useAppDispatch()
const introspection = useAppSelector(
(state) => state.entities.introspections.items[connectionId]
(state) => state.entities.introspections.items[connectionId],
)
const { data: connection } = ConnectionAPI.useGetById(connectionId)
const [loading, setLoading] = useState(false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type IndexesProps = {

const Indexes = ({ connectionId }: IndexesProps) => {
const indexes = useAppSelector(
(state) => state.entities.introspections.items[connectionId]?.indexes || []
(state) => state.entities.introspections.items[connectionId]?.indexes || [],
)
if (indexes && indexes.length > 0) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ type MaterializedViewsProps = {
const MaterializedViews = ({ connectionId }: MaterializedViewsProps) => {
const materializedViews = useAppSelector(
(state) =>
state.entities.introspections.items[connectionId]?.materializedViews || []
state.entities.introspections.items[connectionId]?.materializedViews ||
[],
)
if (materializedViews && materializedViews.length > 0) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type SequencesProps = {
const Sequences = ({ connectionId }: SequencesProps) => {
const sequences = useAppSelector(
(state) =>
state.entities.introspections.items[connectionId]?.sequences || []
state.entities.introspections.items[connectionId]?.sequences || [],
)
if (sequences && sequences.length > 0) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type ViewsProps = {

const Sources = ({ connectionId }: ViewsProps) => {
const sources = useAppSelector(
(state) => state.entities.introspections.items[connectionId]?.sources || []
(state) => state.entities.introspections.items[connectionId]?.sources || [],
)
const [red500] = useToken('colors', ['red.500'])
const [green500] = useToken('colors', ['green.500'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ type TablesProps = {

const Tables = ({ connectionId }: TablesProps) => {
const tables = useAppSelector(
(state) => state.entities.introspections.items[connectionId]?.tables || []
(state) => state.entities.introspections.items[connectionId]?.tables || [],
)
if (tables && tables.length > 0) {
return (
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/introspection/database-objects/views.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type ViewsProps = {

const Views = ({ connectionId }: ViewsProps) => {
const views = useAppSelector(
(state) => state.entities.introspections.items[connectionId]?.views || []
(state) => state.entities.introspections.items[connectionId]?.views || [],
)
if (views && views.length > 0) {
return (
Expand Down

0 comments on commit fc439c8

Please sign in to comment.