mirror of
https://github.com/lemeow125/Borrowing-TrackerFrontend.git
synced 2024-11-17 06:19:27 +08:00
Fix equipment tally page
This commit is contained in:
parent
b5f4fc7326
commit
e589588d8c
2 changed files with 67 additions and 69 deletions
|
@ -38,14 +38,16 @@ export default function TechnicianWidgets() {
|
|||
if (isLoading) {
|
||||
return (
|
||||
<>
|
||||
<CircularProgress style={{ height: "128px", width: "128px" }} />
|
||||
<CircularProgress
|
||||
style={{ marginTop: "8px", height: "128px", width: "128px" }}
|
||||
/>
|
||||
<p
|
||||
style={{
|
||||
...styles.text_dark,
|
||||
...styles.text_L,
|
||||
}}
|
||||
>
|
||||
Loading
|
||||
Loading widgets...
|
||||
</p>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -65,10 +65,8 @@ export default function EquipmentTallyPage() {
|
|||
width: "100%",
|
||||
minHeight: "100%",
|
||||
minWidth: "100%",
|
||||
flexWrap: "wrap",
|
||||
}}
|
||||
>
|
||||
<div style={{ alignSelf: "flex-start", paddingLeft: "32px" }}>
|
||||
<div
|
||||
style={{
|
||||
...styles.flex_row,
|
||||
|
@ -91,9 +89,7 @@ export default function EquipmentTallyPage() {
|
|||
width: "256x",
|
||||
bgcolor: "background.paper",
|
||||
color: (theme) =>
|
||||
theme.palette.getContrastText(
|
||||
theme.palette.background.paper
|
||||
),
|
||||
theme.palette.getContrastText(theme.palette.background.paper),
|
||||
},
|
||||
}}
|
||||
value={filter}
|
||||
|
@ -118,10 +114,10 @@ export default function EquipmentTallyPage() {
|
|||
>
|
||||
Results Found:{" "}
|
||||
{
|
||||
equipments?.data?.filter((equipment) =>
|
||||
equipment_instances?.data?.filter((equipment) =>
|
||||
filter !== null
|
||||
? // If filter is not null, we filter if it matches any criteria
|
||||
equipment.name
|
||||
equipment.equipment_name
|
||||
.toLowerCase()
|
||||
.includes(filter.toLowerCase()) ||
|
||||
equipment.category
|
||||
|
@ -130,14 +126,14 @@ export default function EquipmentTallyPage() {
|
|||
equipment.last_updated
|
||||
.toLowerCase()
|
||||
.includes(filter?.toLowerCase()) ||
|
||||
equipment.category.toLowerCase() == filter.toLowerCase()
|
||||
equipment.status.toLowerCase() == filter.toLowerCase()
|
||||
: // If filter keyword is null then we just pass through everything as if we did not filter at all
|
||||
true
|
||||
).length
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ alignSelf: "flex-start", paddingLeft: "32px" }}></div>
|
||||
<TableContainer
|
||||
style={{ width: "90%", overflowY: "scroll", marginTop: "2rem" }}
|
||||
component={Paper}
|
||||
|
|
Loading…
Reference in a new issue