Skip to content

Commit

Permalink
Remove retrieve from locations (only CUC is needed) (#215)
Browse files Browse the repository at this point in the history
* remove all places to specify retrieve from location (comment out)

* missed filed

* linting fixes

* edited code for removing image upload

* linting fixes

* linting fixes pt 2

* remove all places to specify retrieve from location (comment out)

* linting fix

* redo linting fixes

* linting fix

---------

Co-authored-by: Richard Zhan <rzhan@andrew.cmu.edu>
Co-authored-by: Kate Bicalho <katebicalho@kates-mbp-5.wifi.local.cmu.edu>
Co-authored-by: axgu <86838870+axgu@users.noreply.github.com>
  • Loading branch information
4 people authored Mar 23, 2024
1 parent 29acdcf commit 51361cc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
50 changes: 25 additions & 25 deletions client/src/components/AddItemButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -117,7 +117,7 @@ function AddItemButton(props: {
description: "",
value: "general",
identifiable: false,
building: buildplace(),
building: "CUC",
image: "",
imagePath: "",
imageObject: null as any,
Expand All @@ -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();

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -540,7 +540,7 @@ function AddItemButton(props: {
onChange={handleRadioChange}
/>
</Form.Group>
<Form.Select
{/* <Form.Select
fluid
required
label="Building (Lost and Found Desk)"
Expand All @@ -550,7 +550,7 @@ function AddItemButton(props: {
value={state.building}
onChange={handleChange}
error={buildingError}
/>
/> */}
{/* <Form.Input
label="Image Upload"
name="imagePath"
Expand Down
20 changes: 10 additions & 10 deletions client/src/components/EditItem.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TODO: #126 Replace any annotations with appropriate type
/* eslint-disable @typescript-eslint/no-explicit-any */
import { BuildingType } from "../enums/locationTypes";
// import { BuildingType } from "../enums/locationTypes";
import { PermissionType } from "../enums/permissionType";
import { Item } from "../interface/item";
import { User } from "../interface/user";
Expand Down Expand Up @@ -65,13 +65,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,
// }));

function EditItem(props: {
// TODO: #127 Replace bad Function type with appropriate type
Expand Down Expand Up @@ -392,7 +392,7 @@ function EditItem(props: {
onChange={handleRadioChange}
/>
</Form.Group>
<Form.Group widths="equal">
{/* <Form.Group widths="equal">
<Form.Select
fluid
required
Expand All @@ -403,7 +403,7 @@ function EditItem(props: {
value={state.building}
onChange={handleChange}
/>
</Form.Group>
</Form.Group> */}
{/* <Form.Input
label="Image Upload"
name="imagePath"
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/ItemCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ const ItemCard = (props: { item: Item }) => {
<Card.Content className="bottom-content">
<b>Found: </b>
{props.item.whereFound} <br />
<b>Retrieve From: </b>
{props.item.whereToRetrieve.retrieveLocation}
{/* <b>Retrieve From: </b>
{props.item.whereToRetrieve.retrieveLocation} */}
</Card.Content>
</Card>
</div>
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/TableWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const TableWidget = (props: {
>
Description
</Table.HeaderCell>
<Table.HeaderCell
{/* <Table.HeaderCell
sorted={
props.sort.column === "building"
? props.sort.direction
Expand All @@ -122,7 +122,7 @@ const TableWidget = (props: {
onClick={() => changeSort("building")}
>
Building
</Table.HeaderCell>
</Table.HeaderCell> */}
{/* <Table.HeaderCell
sorted={
props.sort.column === "image" ? props.sort.direction : undefined
Expand Down Expand Up @@ -229,7 +229,7 @@ const TableWidget = (props: {
<Table.Cell>{item.name}</Table.Cell>
<Table.Cell>{item.whereFound}</Table.Cell>
<Table.Cell>{item.description}</Table.Cell>
<Table.Cell>{item.building}</Table.Cell>
{/* <Table.Cell>{item.building}</Table.Cell> */}
{/* <Table.Cell>
<ImageModal image={item.image}></ImageModal>
</Table.Cell> */}
Expand Down

0 comments on commit 51361cc

Please sign in to comment.