From 670050bcfbfdad2093c2f3f09cc5cdd2b2840320 Mon Sep 17 00:00:00 2001 From: Kate Bicalho Date: Sat, 16 Mar 2024 16:43:06 -0400 Subject: [PATCH 1/4] edited code for removing image upload --- client/src/components/AddItemButton.tsx | 13 +++---------- client/src/components/EditItem.tsx | 23 ++++++++--------------- client/src/components/TableWidget.tsx | 12 ------------ 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/client/src/components/AddItemButton.tsx b/client/src/components/AddItemButton.tsx index b568456..fd4ac86 100644 --- a/client/src/components/AddItemButton.tsx +++ b/client/src/components/AddItemButton.tsx @@ -465,7 +465,7 @@ function AddItemButton(props: { name="name" value={state.name} onChange={handleChange} - // error={nameError} + // error={nameError} /> @@ -492,7 +492,7 @@ function AddItemButton(props: { placeholder="Location" value={state.whereFound} onChange={handleChange} - // error={locationError} + // error={locationError} /> @@ -551,13 +551,6 @@ function AddItemButton(props: { onChange={handleChange} error={buildingError} /> - {state.identifiable ? ( 4 - ? props.item.timeFound.trim() - : "0" + props.item.timeFound.trim()) + "T" + + (props.item.timeFound.trim().length > 4 + ? props.item.timeFound.trim() + : "0" + props.item.timeFound.trim()) ), name: props.item.name, whereFound: props.item.whereFound, @@ -404,13 +404,6 @@ function EditItem(props: { onChange={handleChange} /> - {state.identifiable ? ( 4 - ? props.item.timeFound.trim() - : "0" + props.item.timeFound.trim()) + "T" + + (props.item.timeFound.trim().length > 4 + ? props.item.timeFound.trim() + : "0" + props.item.timeFound.trim()) ), name: props.item.name, whereFound: props.item.whereFound, diff --git a/client/src/components/TableWidget.tsx b/client/src/components/TableWidget.tsx index 02b3f2a..860293b 100644 --- a/client/src/components/TableWidget.tsx +++ b/client/src/components/TableWidget.tsx @@ -11,7 +11,6 @@ import ApproveSwitch from "./ApproveSwitch"; import AvailableSwitch from "./AvailableSwitch"; import EditButton from "./EditItem"; import HistoryAccordion from "./HistoryAccordion"; -import ImageModal from "./ImageModal"; import PublicDisplaySwitch from "./PublicDisplaySwitch"; import UnarchiveButton from "./UnarchiveButton"; @@ -123,14 +122,6 @@ const TableWidget = (props: { > Building - changeSort("image")} - > - Image - {!props.isArchivedItems && props.isUser ? ( {item.whereFound} {item.description} {item.building} - - - {!props.isArchivedItems && props.isUser ? ( Date: Sat, 16 Mar 2024 16:53:56 -0400 Subject: [PATCH 2/4] removed image upload options but commented out instead of deleted --- client/src/components/AddItemButton.tsx | 7 +++++++ client/src/components/EditItem.tsx | 7 +++++++ client/src/components/TableWidget.tsx | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/client/src/components/AddItemButton.tsx b/client/src/components/AddItemButton.tsx index fd4ac86..6648639 100644 --- a/client/src/components/AddItemButton.tsx +++ b/client/src/components/AddItemButton.tsx @@ -551,6 +551,13 @@ function AddItemButton(props: { onChange={handleChange} error={buildingError} /> + {/* */} {state.identifiable ? ( + {/* */} {state.identifiable ? ( Building + {/* changeSort("image")} + > + Image + */} {!props.isArchivedItems && props.isUser ? ( {item.whereFound} {item.description} {item.building} + {/* + + */} {!props.isArchivedItems && props.isUser ? ( Date: Sat, 16 Mar 2024 17:29:59 -0400 Subject: [PATCH 3/4] linting fixes --- client/src/components/AddItemButton.tsx | 6 +++--- client/src/components/EditItem.tsx | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/src/components/AddItemButton.tsx b/client/src/components/AddItemButton.tsx index 6648639..aec2afd 100644 --- a/client/src/components/AddItemButton.tsx +++ b/client/src/components/AddItemButton.tsx @@ -465,7 +465,7 @@ function AddItemButton(props: { name="name" value={state.name} onChange={handleChange} - // error={nameError} + // error={nameError} /> @@ -492,7 +492,7 @@ function AddItemButton(props: { placeholder="Location" value={state.whereFound} onChange={handleChange} - // error={locationError} + // error={locationError} /> diff --git a/client/src/components/EditItem.tsx b/client/src/components/EditItem.tsx index 989fa82..33cba07 100644 --- a/client/src/components/EditItem.tsx +++ b/client/src/components/EditItem.tsx @@ -94,10 +94,10 @@ function EditItem(props: { const [state, setState] = useState({ date: new Date( new Date(props.item.dateFound).toISOString().substring(0, 10) + - "T" + - (props.item.timeFound.trim().length > 4 - ? props.item.timeFound.trim() - : "0" + props.item.timeFound.trim()) + "T" + + (props.item.timeFound.trim().length > 4 + ? props.item.timeFound.trim() + : "0" + props.item.timeFound.trim()) ), name: props.item.name, whereFound: props.item.whereFound, @@ -499,10 +499,10 @@ function EditItem(props: { new Date(props.item.dateFound) .toISOString() .substring(0, 10) + - "T" + - (props.item.timeFound.trim().length > 4 - ? props.item.timeFound.trim() - : "0" + props.item.timeFound.trim()) + "T" + + (props.item.timeFound.trim().length > 4 + ? props.item.timeFound.trim() + : "0" + props.item.timeFound.trim()) ), name: props.item.name, whereFound: props.item.whereFound, From e0ab12a6fcc8bec6e1ac121c8ec773f285444db2 Mon Sep 17 00:00:00 2001 From: Michelle Li Date: Sat, 16 Mar 2024 17:32:59 -0400 Subject: [PATCH 4/4] linting fixes pt 2 --- client/src/components/AddItemButton.tsx | 12 ++++++------ client/src/components/EditItem.tsx | 16 ++++++++-------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/client/src/components/AddItemButton.tsx b/client/src/components/AddItemButton.tsx index aec2afd..7240215 100644 --- a/client/src/components/AddItemButton.tsx +++ b/client/src/components/AddItemButton.tsx @@ -148,12 +148,12 @@ function AddItemButton(props: { const handleRadioChange = (e: any, { name, value }: any) => { setState({ ...state, [name]: value === "true" }); }; - const handleFileChange = ( - e: React.ChangeEvent, - { name, value }: any - ) => { - setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] }); - }; + // const handleFileChange = ( + // e: React.ChangeEvent, + // { name, value }: any + // ) => { + // setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] }); + // }; const uploadImage = (imageFile: File) => { const imageName = "test"; diff --git a/client/src/components/EditItem.tsx b/client/src/components/EditItem.tsx index 33cba07..17650c9 100644 --- a/client/src/components/EditItem.tsx +++ b/client/src/components/EditItem.tsx @@ -126,14 +126,14 @@ function EditItem(props: { const handleRadioChange = (e: any, { name, value }: any) => { setState({ ...state, [name]: value === "true" }); }; - const handleFileChange = ( - e: React.ChangeEvent, - { name, value }: any - ) => { - console.log("handling file change"); - console.log(name + " " + value); - setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] }); - }; + // const handleFileChange = ( + // e: React.ChangeEvent, + // { name, value }: any + // ) => { + // console.log("handling file change"); + // console.log(name + " " + value); + // setState({ ...state, [name]: value, imageObject: e?.target?.files?.[0] }); + // }; const uploadImage = (imageFile: File) => { console.log("attempting to edit image");