Adjust CRUD actions according to backend changes

This commit is contained in:
Keannu Bernasol 2023-12-09 09:44:13 +08:00
parent a14b09f2a0
commit fd1eb8ac3b
6 changed files with 16 additions and 148 deletions

View file

@ -1,14 +0,0 @@
# .woodpecker.yml
steps:
- name: build & copy
image: node:18-alpine
commands:
- apk add --no-cache openssh-client
- mkdir -p /root/.ssh/
- echo "$SSH_KEY" | tr -d '\r' > /root/.ssh/id_rsa
- chmod 600 /root/.ssh/id_rsa
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > /root/.ssh/config
- npm install
- npm run build
- scp -r dist/* root@10.0.10.4:/mnt/sda1/files/projects/equipment_tracker_frontend
secrets: [SSH_KEY]

View file

@ -17,7 +17,7 @@ import {
EquipmentInstanceLogListType,
} from "../Types/Types";
const debug = false;
const debug = true;
let backendURL;
if (debug) {

View file

@ -86,39 +86,13 @@ export default function AddSKUModal() {
<div style={styles.flex_row}>
<div style={styles.flex_column}>
<FormControlLabel
value="PC"
value="Glassware"
control={<Radio />}
label="Workstation"
label="Glassware"
style={styles.text_dark}
/>
<FormControlLabel
value="NETWORKING"
control={<Radio />}
label="Networking"
style={styles.text_dark}
/>
<FormControlLabel
value="CCTV"
control={<Radio />}
label="CCTV"
style={styles.text_dark}
/>
</div>
<div style={styles.flex_column}>
<FormControlLabel
value="FURNITURE"
control={<Radio />}
label="Furniture"
style={styles.text_dark}
/>
<FormControlLabel
value="PERIPHERALS"
control={<Radio />}
label="Peripherals"
style={styles.text_dark}
/>
<FormControlLabel
value="MISC"
value="Miscellaneous"
control={<Radio />}
label="Miscellaneous"
style={styles.text_dark}

View file

@ -197,8 +197,7 @@ export default function EditItemInstanceModal(props: {
Associated SKU:
</p>
<p style={{ ...styles.text_dark, ...styles.text_M }}>
{equipment.data?.equipment_name}
{" (SKU #" + equipment.data?.equipment + ")"}
{equipment.data?.equipment}
</p>
</div>

View file

@ -221,39 +221,13 @@ export default function EditSKUModal(props: {
<div style={styles.flex_row}>
<div style={styles.flex_column}>
<FormControlLabel
value="PC"
value="Glassware"
control={<Radio />}
label="Workstation"
label="Glassware"
style={styles.text_dark}
/>
<FormControlLabel
value="NETWORKING"
control={<Radio />}
label="Networking"
style={styles.text_dark}
/>
<FormControlLabel
value="CCTV"
control={<Radio />}
label="CCTV"
style={styles.text_dark}
/>
</div>
<div style={styles.flex_column}>
<FormControlLabel
value="FURNITURE"
control={<Radio />}
label="Furniture"
style={styles.text_dark}
/>
<FormControlLabel
value="PERIPHERALS"
control={<Radio />}
label="Peripherals"
style={styles.text_dark}
/>
<FormControlLabel
value="MISC"
value="Miscellaneous"
control={<Radio />}
label="Miscellaneous"
style={styles.text_dark}

View file

@ -3,10 +3,6 @@ import styles from "../../styles";
import { useQueries } from "@tanstack/react-query";
import { EquipmentsAPI, EquipmentInstancesAPI } from "../../Components/API/API";
import { Button, CircularProgress } from "@mui/material";
import ComputerIcon from "@mui/icons-material/Computer";
import RouterIcon from "@mui/icons-material/Router";
import CameraOutdoorIcon from "@mui/icons-material/CameraOutdoor";
import ChairIcon from "@mui/icons-material/Chair";
import FormatListBulletedIcon from "@mui/icons-material/FormatListBulleted";
import AddToQueueIcon from "@mui/icons-material/AddToQueue";
import NoteAddIcon from "@mui/icons-material/NoteAdd";
@ -18,6 +14,8 @@ import { useState } from "react";
import AddSKUModal from "../../Components/AddSKUModal/AddSKUModal";
import Popup from "reactjs-popup";
import AddItemModal from "../../Components/AddItemModal/AddItemModal";
import ScienceIcon from "@mui/icons-material/Science";
import ColorizeIcon from "@mui/icons-material/Colorize";
export default function Dashboard() {
const navigate = useNavigate();
@ -388,7 +386,7 @@ export default function Dashboard() {
},
}}
>
<ComputerIcon
<ScienceIcon
style={{
height: 64,
width: 64,
@ -397,7 +395,7 @@ export default function Dashboard() {
marginRight: "1rem",
}}
onClick={() => {
navigate("/view/equipment_instances/filter/PC");
navigate("/view/equipment_instances/filter/Glassware");
}}
/>
<p
@ -406,7 +404,7 @@ export default function Dashboard() {
...styles.text_M,
}}
>
Workstations
Glassware
</p>
</Button>
<Button
@ -419,7 +417,7 @@ export default function Dashboard() {
},
}}
>
<RouterIcon
<ColorizeIcon
style={{
height: 64,
width: 64,
@ -428,7 +426,7 @@ export default function Dashboard() {
marginRight: "1rem",
}}
onClick={() => {
navigate("/view/equipment_instances/filter/NETWORKING");
navigate("/view/equipment_instances/filter/Miscellaneous");
}}
/>
<p
@ -437,70 +435,7 @@ export default function Dashboard() {
...styles.text_M,
}}
>
Networking
</p>
</Button>
<Button
style={{
...styles.flex_column,
...{
alignSelf: "center",
justifyContent: "center",
flexWrap: "wrap",
},
}}
onClick={() => {
navigate("/view/equipment_instances/filter/CCTV");
}}
>
<CameraOutdoorIcon
style={{
height: 64,
width: 64,
fill: colors.font_dark,
marginLeft: "1rem",
marginRight: "1rem",
}}
/>
<p
style={{
...styles.text_dark,
...styles.text_M,
}}
>
CCTVs
</p>
</Button>
<Button
style={{
...styles.flex_column,
...{
alignSelf: "center",
justifyContent: "center",
flexWrap: "wrap",
},
}}
>
<ChairIcon
style={{
height: 64,
width: 64,
fill: colors.font_dark,
marginLeft: "1rem",
marginRight: "1rem",
}}
onClick={() => {
navigate("/view/equipment_instances/filter/FURNITURE");
}}
/>
<p
style={{
...styles.text_dark,
...styles.text_M,
}}
>
Furniture
Miscellaneous
</p>
</Button>
</div>