Fix sidebar buttons width, simplified restriction of technician components in homepage, and adjusted equipment instance status to match backend changes

This commit is contained in:
Keannu Bernasol 2023-12-16 14:59:41 +08:00
parent 9bb312808e
commit a6b6925310
4 changed files with 12 additions and 12 deletions

View file

@ -21,7 +21,7 @@ export default function AddItemModal() {
const [item, setItem] = useState({ const [item, setItem] = useState({
equipment: 0, equipment: 0,
remarks: "", remarks: "",
status: "WORKING", status: "Available",
}); });
const [error, setError] = useState(""); const [error, setError] = useState("");
@ -128,7 +128,7 @@ export default function AddItemModal() {
<RadioGroup <RadioGroup
aria-labelledby="demo-radio-buttons-group-label" aria-labelledby="demo-radio-buttons-group-label"
value={item.status} value={item.status}
defaultValue="Working" defaultValue="Available"
name="radio-buttons-group" name="radio-buttons-group"
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setItem({ ...item, status: e.target.value }); setItem({ ...item, status: e.target.value });
@ -142,9 +142,9 @@ export default function AddItemModal() {
}} }}
> >
<FormControlLabel <FormControlLabel
value="Working" value="Available"
control={<Radio />} control={<Radio />}
label="Working" label="Available"
style={styles.text_dark} style={styles.text_dark}
/> />
<FormControlLabel <FormControlLabel
@ -213,7 +213,7 @@ export default function AddItemModal() {
queryClient.invalidateQueries({ queryClient.invalidateQueries({
queryKey: ["equipment_instances"], queryKey: ["equipment_instances"],
}); });
setItem({ ...item, status: "WORKING", remarks: "" }); setItem({ ...item, status: "Available", remarks: "" });
} else { } else {
setError(JSON.stringify(data[1])); setError(JSON.stringify(data[1]));
} }

View file

@ -151,7 +151,7 @@ export default function TechnicianWidgets() {
> >
{queries[1].data {queries[1].data
? queries[1].data.filter( ? queries[1].data.filter(
(equipment) => equipment.status == "WORKING" (equipment) => equipment.status == "Available"
).length ).length
: 0} : 0}
</p> </p>
@ -186,7 +186,7 @@ export default function TechnicianWidgets() {
> >
{queries[1].data {queries[1].data
? queries[1].data.filter( ? queries[1].data.filter(
(equipment) => equipment.status == "BROKEN" (equipment) => equipment.status == "Broken"
).length ).length
: 0} : 0}
</p> </p>

View file

@ -23,8 +23,8 @@ export default function DrawerButton(props: props) {
onMouseLeave={() => setClicked(false)} onMouseLeave={() => setClicked(false)}
style={{ style={{
borderRadius: 24, borderRadius: 24,
minWidth: "128px", minWidth: "196px",
maxWidth: "128px", maxWidth: "196px",
borderColor: colors.button_border, borderColor: colors.button_border,
borderStyle: "solid", borderStyle: "solid",
borderWidth: "2px", borderWidth: "2px",

View file

@ -205,7 +205,7 @@ export default function EditItemInstanceModal(props: {
<RadioGroup <RadioGroup
aria-labelledby="demo-radio-buttons-group-label" aria-labelledby="demo-radio-buttons-group-label"
value={item.status} value={item.status}
defaultValue="Working" defaultValue="Available"
name="radio-buttons-group" name="radio-buttons-group"
onChange={(e: React.ChangeEvent<HTMLInputElement>) => { onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
setItem({ ...item, status: e.target.value }); setItem({ ...item, status: e.target.value });
@ -219,9 +219,9 @@ export default function EditItemInstanceModal(props: {
}} }}
> >
<FormControlLabel <FormControlLabel
value="Working" value="Available"
control={<Radio />} control={<Radio />}
label="Working" label="Available"
style={styles.text_dark} style={styles.text_dark}
/> />
<FormControlLabel <FormControlLabel