From 6049c24d71049dd378a886f0f33d5c9835fc48f2 Mon Sep 17 00:00:00 2001 From: sasse Date: Mon, 13 May 2024 09:52:16 +0200 Subject: [PATCH] fix(validation): remove buggy OPAL validation --- .../src/components/import/ImportExcel.tsx | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/frontend/src/components/import/ImportExcel.tsx b/frontend/src/components/import/ImportExcel.tsx index 389b5b9..3516a2d 100644 --- a/frontend/src/components/import/ImportExcel.tsx +++ b/frontend/src/components/import/ImportExcel.tsx @@ -44,20 +44,20 @@ export default (props: { }).then((res) => res.json()); }); - const { - data: columnCheck, - mutate: checkColumns, - isSuccess: isSuccessColumnCheck, - isLoading: isLoadingColumnCheck, - isError: isErrorColumnCheck - } = useMutation(() => { - const file = new FormData(); - file.append("file", props.files); - return fetch(`/api/instrument/columnCheck`, { - method: "POST", - body: file, - }).then((res) => res.json()); - }); + // const { + // data: columnCheck, + // mutate: checkColumns, + // isSuccess: isSuccessColumnCheck, + // isLoading: isLoadingColumnCheck, + // isError: isErrorColumnCheck + // } = useMutation(() => { + // const file = new FormData(); + // file.append("file", props.files); + // return fetch(`/api/instrument/columnCheck`, { + // method: "POST", + // body: file, + // }).then((res) => res.json()); + // }); const pick = () => { if (props.hasFile) { @@ -65,22 +65,22 @@ export default (props: { } }; - const check_columns = () => { - if (props.hasFile) { - checkColumns(); - } - }; - - const displayColumnCheck = (item: any) => { - return ( - item ? - item.length > 1 ? - item.map((element: string, i: any) => -
{element}
) - : item - : "-" - ) - } + // const check_columns = () => { + // if (props.hasFile) { + // checkColumns(); + // } + // }; + // + // const displayColumnCheck = (item: any) => { + // return ( + // item ? + // item.length > 1 ? + // item.map((element: string, i: any) => + //
{element}
) + // : item + // : "-" + // ) + // } return ( <> @@ -126,7 +126,7 @@ export default (props: { { pick(); - check_columns() + // check_columns() }} isDisabled={!props.hasFile} > @@ -137,14 +137,14 @@ export default (props: { {isError && The file could not be validated. Try again, use another format or report via the blue feedback button.} - {isLoadingColumnCheck && } + {/*{isLoadingColumnCheck && }*/} - {columnCheck && columnCheck.length == 0 && - OPAL format validated - } - {columnCheck && columnCheck.length != 0 && - The following columns are required for the OPAL - format: {displayColumnCheck(columnCheck)}} + {/*{columnCheck && columnCheck.length == 0 &&*/} + {/* OPAL format validated*/} + {/*}*/} + {/*{columnCheck && columnCheck.length != 0 &&*/} + {/* The following columns are required for the OPAL*/} + {/* format: {displayColumnCheck(columnCheck)}}*/}