diff --git a/ui/bun.lockb b/ui/bun.lockb index f1f0164..034bb86 100755 Binary files a/ui/bun.lockb and b/ui/bun.lockb differ diff --git a/ui/package.json b/ui/package.json index 8a1a22f..7ee1f80 100644 --- a/ui/package.json +++ b/ui/package.json @@ -20,7 +20,7 @@ "@koupr/ui": "1.9.0", "@reduxjs/toolkit": "1.9.2", "classnames": "2.5.1", - "formik": "2.2.9", + "formik": "2.4.5", "framer-motion": "9.0.4", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/ui/src/api/action.ts b/ui/src/api/action.ts index ac36642..1154d5b 100644 --- a/ui/src/api/action.ts +++ b/ui/src/api/action.ts @@ -1,5 +1,4 @@ -/* eslint-disable react-hooks/rules-of-hooks */ -import useSWR from 'swr' +import useSWR, { SWRConfiguration } from 'swr' import { DatabaseObject } from './common-models' import { Diff } from './comparison' import { apiFetch, apiFetcher } from './fetch' @@ -155,7 +154,7 @@ export type DropObjectsFailure = { } export default class ActionAPI { - static useGetById(id?: string, swrOptions?: any) { + static useGetById(id?: string, swrOptions?: SWRConfiguration) { return useSWR(id ? `/actions/${id}` : null, apiFetcher, swrOptions) } @@ -168,11 +167,11 @@ export default class ActionAPI { }).then((result) => result.json()) } - static useGetAll(swrOptions?: any) { + static useGetAll(swrOptions?: SWRConfiguration) { return useSWR(`/actions`, apiFetcher, swrOptions) } - static useGetAllByType(type: string, swrOptions?: any) { + static useGetAllByType(type: string, swrOptions?: SWRConfiguration) { return useSWR( `/actions?${new URLSearchParams({ type })}`, apiFetcher, diff --git a/ui/src/api/comparison.ts b/ui/src/api/comparison.ts index d90be18..bd313c0 100644 --- a/ui/src/api/comparison.ts +++ b/ui/src/api/comparison.ts @@ -1,4 +1,3 @@ -/* eslint-disable react-hooks/rules-of-hooks */ import { DatabaseObject } from './common-models' import { apiFetch } from './fetch' diff --git a/ui/src/api/connection.ts b/ui/src/api/connection.ts index efd126f..62e5e5b 100644 --- a/ui/src/api/connection.ts +++ b/ui/src/api/connection.ts @@ -1,5 +1,4 @@ -/* eslint-disable react-hooks/rules-of-hooks */ -import useSWR from 'swr' +import useSWR, { SWRConfiguration } from 'swr' import { apiFetch, apiFetcher } from './fetch' export type Connection = { @@ -31,7 +30,7 @@ export type UpdateOptions = { } export default class ConnectionAPI { - static useGetById(id?: string, swrOptions?: any) { + static useGetById(id?: string, swrOptions?: SWRConfiguration) { return useSWR( id ? `/connections/${id}` : null, apiFetcher, @@ -48,7 +47,7 @@ export default class ConnectionAPI { }).then((result) => result.json()) } - static useGetAll(swrOptions?: any) { + static useGetAll(swrOptions?: SWRConfiguration) { return useSWR(`/connections`, apiFetcher, swrOptions) } diff --git a/ui/src/components/connection/create.tsx b/ui/src/components/connection/create.tsx index 053aaec..95f4b8c 100644 --- a/ui/src/components/connection/create.tsx +++ b/ui/src/components/connection/create.tsx @@ -15,7 +15,14 @@ import { FormLabel, } from '@chakra-ui/react' import { variables } from '@koupr/ui' -import { Field, FieldAttributes, Form, Formik, FormikHelpers } from 'formik' +import { + Field, + FieldAttributes, + FieldProps, + Form, + Formik, + FormikHelpers, +} from 'formik' import * as Yup from 'yup' import { BsEye, BsEyeSlash } from 'react-icons/bs' import { FiChevronLeft } from 'react-icons/fi' @@ -103,9 +110,9 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => { - {({ field }: FieldAttributes) => ( + {({ field }: FieldAttributes) => ( Name @@ -114,11 +121,9 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => { )} - {({ field }: FieldAttributes) => ( + {({ field }: FieldAttributes) => ( JDBC URL @@ -127,13 +132,11 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => { )} - {({ field }: FieldAttributes) => ( + {({ field }: FieldAttributes) => ( JDBC username @@ -144,13 +147,11 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => { )} - {({ field }: FieldAttributes) => ( + {({ field }: FieldAttributes) => ( JDBC password @@ -184,13 +185,11 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => { )} - {({ field }: FieldAttributes) => ( + {({ field }: FieldAttributes) => ( Database type @@ -201,10 +200,10 @@ const Create = ({ onComplete, onDismiss }: CreateProps) => { w="250px" >