diff --git a/client/src/components/AddItemButton.tsx b/client/src/components/AddItemButton.tsx index b568456..9cd7417 100644 --- a/client/src/components/AddItemButton.tsx +++ b/client/src/components/AddItemButton.tsx @@ -64,13 +64,13 @@ function exampleReducer(dispatchState: any, action: any) { // { key: "tepper", text: "Tepper Building", value: "Tepper Building" }, // ]; -const buildings = Object.keys(BuildingType) - .filter((value) => value !== "ALL") - .map((key) => ({ - key, - text: key, - value: key, - })); +// const buildings = Object.keys(BuildingType) +// .filter((value) => value !== "ALL") +// .map((key) => ({ +// key, +// text: key, +// value: key, +// })); // const templates = Object.keys(TemplateType) // .filter((value) => value !== "ALL") @@ -117,7 +117,7 @@ function AddItemButton(props: { description: "", value: "general", identifiable: false, - building: buildplace(), + building: "CUC", image: "", imagePath: "", imageObject: null as any, @@ -137,8 +137,8 @@ function AddItemButton(props: { // const[timeError, setTimeError] = useState(false); // const[locationError, setLocationError] = useState(false); // const[descriptionError, setDescriptionError] = useState(false); - const [buildingError, setBuildingError] = useState(false); - const [formError, setFormError] = useState(false); + // const [buildingError, setBuildingError] = useState(false); + const [formError, _setFormError] = useState(false); const history = useHistory(); @@ -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"; @@ -246,21 +246,21 @@ function AddItemButton(props: { notes, } = state; - let error = false; + // let error = false; - if (building === "") { - setBuildingError(true); - error = true; - } else { - setBuildingError(false); - } + // if (building === "") { + // setBuildingError(true); + // error = true; + // } else { + // setBuildingError(false); + // } - if (error) { - setFormError(true); - return; - } else { - setFormError(false); - } + // if (error) { + // setFormError(true); + // return; + // } else { + // setFormError(false); + // } // if user, send notifcation to admins with notifs on if (!props.isAdmin) { @@ -540,7 +540,7 @@ function AddItemButton(props: { onChange={handleRadioChange} /> - - */} + {/* + /> */} {state.identifiable ? ( value !== "ALL") - .map((key) => ({ - key, - text: key, - value: key, - })); +// const buildings = Object.keys(BuildingType) +// .filter((value) => value !== "ALL") +// .map((key) => ({ +// key, +// text: key, +// value: key, +// })); function EditItem(props: { // TODO: #127 Replace bad Function type with appropriate type @@ -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"); @@ -396,7 +396,7 @@ function EditItem(props: { onChange={handleRadioChange} /> - + {/* - - */} + {/* + /> */} {state.identifiable ? ( { Found: {props.item.whereFound}
- Retrieve From: - {props.item.whereToRetrieve.retrieveLocation} + {/* Retrieve From: + {props.item.whereToRetrieve.retrieveLocation} */}
diff --git a/client/src/components/TableWidget.tsx b/client/src/components/TableWidget.tsx index 02b3f2a..7a9d2dd 100644 --- a/client/src/components/TableWidget.tsx +++ b/client/src/components/TableWidget.tsx @@ -11,7 +11,7 @@ import ApproveSwitch from "./ApproveSwitch"; import AvailableSwitch from "./AvailableSwitch"; import EditButton from "./EditItem"; import HistoryAccordion from "./HistoryAccordion"; -import ImageModal from "./ImageModal"; +// import ImageModal from "./ImageModal"; import PublicDisplaySwitch from "./PublicDisplaySwitch"; import UnarchiveButton from "./UnarchiveButton"; @@ -113,7 +113,7 @@ const TableWidget = (props: { > Description - changeSort("building")} > Building - - */} + {/* changeSort("image")} > Image - + */} {!props.isArchivedItems && props.isUser ? ( {item.name} {item.whereFound} {item.description} - {item.building} - + {/* {item.building} */} + {/* - + */} {!props.isArchivedItems && props.isUser ? (