From 433207f8e4ef8a45947ab334dcf90aa6085b000c Mon Sep 17 00:00:00 2001
From: Keannu Bernasol
Date: Sat, 6 Jan 2024 20:47:26 +0800
Subject: [PATCH 01/20] Fix search bar in equipment instance list page
---
package-lock.json | 13 ++
package.json | 1 +
.../EquipmentInstancesListPage.tsx | 130 +++++++++---------
3 files changed, 77 insertions(+), 67 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 5d37b69..a2b5e18 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -23,6 +23,7 @@
"react-redux": "^8.1.3",
"react-router-dom": "^6.18.0",
"react-toastify": "^9.1.3",
+ "react-virtuoso": "^4.6.2",
"reactjs-popup": "^2.0.6",
"styled-components": "^6.1.1"
},
@@ -3895,6 +3896,18 @@
"react-dom": ">=16.6.0"
}
},
+ "node_modules/react-virtuoso": {
+ "version": "4.6.2",
+ "resolved": "https://registry.npmjs.org/react-virtuoso/-/react-virtuoso-4.6.2.tgz",
+ "integrity": "sha512-vvlqvzPif+MvBrJ09+hJJrVY0xJK9yran+A+/1iwY78k0YCVKsyoNPqoLxOxzYPggspNBNXqUXEcvckN29OxyQ==",
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "react": ">=16 || >=17 || >= 18",
+ "react-dom": ">=16 || >=17 || >= 18"
+ }
+ },
"node_modules/reactjs-popup": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/reactjs-popup/-/reactjs-popup-2.0.6.tgz",
diff --git a/package.json b/package.json
index 389aa1a..2bd2909 100644
--- a/package.json
+++ b/package.json
@@ -25,6 +25,7 @@
"react-redux": "^8.1.3",
"react-router-dom": "^6.18.0",
"react-toastify": "^9.1.3",
+ "react-virtuoso": "^4.6.2",
"reactjs-popup": "^2.0.6",
"styled-components": "^6.1.1"
},
diff --git a/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx b/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx
index 432b58a..b333d71 100644
--- a/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx
+++ b/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx
@@ -65,79 +65,75 @@ export default function EquipmentInstancesListPage() {
width: "100%",
minHeight: "100%",
minWidth: "100%",
- flexWrap: "wrap",
}}
>
-
-
+
+
+ theme.palette.getContrastText(theme.palette.background.paper),
+ },
+ }}
+ value={filter}
+ onChange={(_event, newValue) => {
+ setFilter(newValue);
+ }}
+ freeSolo
+ id="custom-input-demo"
+ options={["Available", "Broken", "Glassware", "Miscellaneous"]}
+ renderInput={(params) => (
+
+
+
+ )}
+ />
+
-
-
- theme.palette.getContrastText(
- theme.palette.background.paper
- ),
- },
- }}
- value={filter}
- onChange={(_event, newValue) => {
- setFilter(newValue);
- }}
- freeSolo
- id="custom-input-demo"
- options={["Available", "Broken", "Glassware", "Miscellaneous"]}
- renderInput={(params) => (
-
-
-
- )}
- />
-
- Results Found:{" "}
- {
- equipment_instances?.data?.filter((equipment) =>
- filter !== null
- ? // If filter is not null, we filter if it matches any criteria
- equipment.equipment_name
- .toLowerCase()
- .includes(filter.toLowerCase()) ||
- equipment.category
- .toLowerCase()
- .includes(filter.toLowerCase()) ||
- equipment.last_updated
- .toLowerCase()
- .includes(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
- }
-
-
+ Results Found:{" "}
+ {
+ equipment_instances?.data?.filter((equipment) =>
+ filter !== null
+ ? // If filter is not null, we filter if it matches any criteria
+ equipment.equipment_name
+ .toLowerCase()
+ .includes(filter.toLowerCase()) ||
+ equipment.category
+ .toLowerCase()
+ .includes(filter.toLowerCase()) ||
+ equipment.last_updated
+ .toLowerCase()
+ .includes(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
+ }
+
+
Date: Sun, 7 Jan 2024 08:29:30 +0800
Subject: [PATCH 02/20] add sku button position and alignment
---
.../EquipmentListPage/EquipmentListPage.tsx | 111 +++++++++---------
1 file changed, 55 insertions(+), 56 deletions(-)
diff --git a/src/Pages/EquipmentListPage/EquipmentListPage.tsx b/src/Pages/EquipmentListPage/EquipmentListPage.tsx
index 332c297..58bb098 100644
--- a/src/Pages/EquipmentListPage/EquipmentListPage.tsx
+++ b/src/Pages/EquipmentListPage/EquipmentListPage.tsx
@@ -64,68 +64,67 @@ export default function EquipmentListPage() {
display: "flex",
alignItems: "center",
justifyContent: "center",
- height: "100%",
+ height: "80%",
width: "100%",
- minHeight: "100%",
+ minHeight: "80%",
minWidth: "100%",
- flexWrap: "wrap",
- }}
+ }}>
+
+
+
{
+ SetAddSKUModalOpen(true);
+ }}
+ >
+
+
+ Add SKU
+
+
+
- >
-
- {
- SetAddSKUModalOpen(true);
+ SetAddSKUModalOpen(false)}
+ modal
+ position={"top center"}
+ contentStyle={{
+ width: "32rem",
+ borderRadius: 16,
+ borderColor: "grey",
+ borderStyle: "solid",
+ borderWidth: 1,
+ padding: 16,
+ alignContent: "center",
+ justifyContent: "center",
+ textAlign: "center",
}}
>
-
-
- Add SKU
-
-
-
-
- SetAddSKUModalOpen(false)}
- modal
- position={"top center"}
- contentStyle={{
- width: "32rem",
- borderRadius: 16,
- borderColor: "grey",
- borderStyle: "solid",
- borderWidth: 1,
- padding: 16,
- alignContent: "center",
- justifyContent: "center",
- textAlign: "center",
- }}
- >
-
-
+
+
Date: Sun, 7 Jan 2024 10:52:53 +0800
Subject: [PATCH 03/20] Update dropdown menu for new transaction
---
package-lock.json | 32 ++++++
package.json | 2 +
src/CountTransactionEquipments/test | 0
.../AddTransactionPage/AddTransactionPage.tsx | 97 ++++++++++++++-----
4 files changed, 107 insertions(+), 24 deletions(-)
delete mode 100644 src/CountTransactionEquipments/test
diff --git a/package-lock.json b/package-lock.json
index a2b5e18..97891f5 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -24,12 +24,14 @@
"react-router-dom": "^6.18.0",
"react-toastify": "^9.1.3",
"react-virtuoso": "^4.6.2",
+ "react-window": "^1.8.10",
"reactjs-popup": "^2.0.6",
"styled-components": "^6.1.1"
},
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
+ "@types/react-window": "^1.8.8",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
@@ -1762,6 +1764,15 @@
"@types/react": "*"
}
},
+ "node_modules/@types/react-window": {
+ "version": "1.8.8",
+ "resolved": "https://registry.npmjs.org/@types/react-window/-/react-window-1.8.8.tgz",
+ "integrity": "sha512-8Ls660bHR1AUA2kuRvVG9D/4XpRC6wjAaPT9dil7Ckc76eP9TKWZwwmgfq8Q1LANX3QNDnoU4Zp48A3w+zK69Q==",
+ "dev": true,
+ "dependencies": {
+ "@types/react": "*"
+ }
+ },
"node_modules/@types/scheduler": {
"version": "0.16.5",
"resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.5.tgz",
@@ -3373,6 +3384,11 @@
"resolved": "https://registry.npmjs.org/media-engine/-/media-engine-1.0.3.tgz",
"integrity": "sha512-aa5tG6sDoK+k70B9iEX1NeyfT8ObCKhNDs6lJVpwF6r8vhUfuKMslIcirq6HIUYuuUYLefcEQOn9bSBOvawtwg=="
},
+ "node_modules/memoize-one": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/memoize-one/-/memoize-one-5.2.1.tgz",
+ "integrity": "sha512-zYiwtZUcYyXKo/np96AGZAckk+FWWsUdJ3cHGGmld7+AhvcWmQyGCYUh1hc4Q/pkOhb65dQR/pqCyK0cOaHz4Q=="
+ },
"node_modules/merge2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
@@ -3908,6 +3924,22 @@
"react-dom": ">=16 || >=17 || >= 18"
}
},
+ "node_modules/react-window": {
+ "version": "1.8.10",
+ "resolved": "https://registry.npmjs.org/react-window/-/react-window-1.8.10.tgz",
+ "integrity": "sha512-Y0Cx+dnU6NLa5/EvoHukUD0BklJ8qITCtVEPY1C/nL8wwoZ0b5aEw8Ff1dOVHw7fCzMt55XfJDd8S8W8LCaUCg==",
+ "dependencies": {
+ "@babel/runtime": "^7.0.0",
+ "memoize-one": ">=3.1.1 <6"
+ },
+ "engines": {
+ "node": ">8.0.0"
+ },
+ "peerDependencies": {
+ "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
+ "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
+ }
+ },
"node_modules/reactjs-popup": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/reactjs-popup/-/reactjs-popup-2.0.6.tgz",
diff --git a/package.json b/package.json
index 2bd2909..a1000f4 100644
--- a/package.json
+++ b/package.json
@@ -26,12 +26,14 @@
"react-router-dom": "^6.18.0",
"react-toastify": "^9.1.3",
"react-virtuoso": "^4.6.2",
+ "react-window": "^1.8.10",
"reactjs-popup": "^2.0.6",
"styled-components": "^6.1.1"
},
"devDependencies": {
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
+ "@types/react-window": "^1.8.8",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react": "^4.0.3",
diff --git a/src/CountTransactionEquipments/test b/src/CountTransactionEquipments/test
deleted file mode 100644
index e69de29..0000000
diff --git a/src/Pages/AddTransactionPage/AddTransactionPage.tsx b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
index d088a53..0ea14c3 100644
--- a/src/Pages/AddTransactionPage/AddTransactionPage.tsx
+++ b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
@@ -20,6 +20,7 @@ import {
CircularProgress,
MenuItem,
OutlinedInput,
+ Autocomplete,
} from "@mui/material";
import React from "react";
import Header from "../../Components/Header/Header";
@@ -126,29 +127,50 @@ export default function AddTransactionPage() {
- Items Requested
-
+ Items Requested
+
+
+ id="equipment-autocomplete"
+ options={equipments.data || []}
+ getOptionLabel={(option) =>
+ `${option.equipment_name} (ID:${option.id})`
+ }
+ value={
+ equipments.data?.filter((equipment) =>
+ transaction.equipments.includes(equipment.id)
+ ) || []
+ }
+ onChange={(event, newValue) => {
SetTransaction({
...transaction,
- equipments: event.target.value as number[],
- })
- }
- input={ }
- >
- {equipments.data
- ?.filter((equipment) => equipment.status == "Available")
- .map((equipment) => (
-
- {`${equipment.equipment_name} (ID:${equipment.id})`}
-
- ))}
-
+ equipments: newValue.map((item) => item.id),
+ });
+ }}
+ renderInput={(params) => (
+
+ )}
+ />
- Assigned Teacher
+
+ Assigned Teacher
+
@@ -157,8 +179,7 @@ export default function AddTransactionPage() {
teacher: event.target.value as number,
})
}
- label={"Assigned Teacher"}
- input={ }
+ input={ }
>
{teachers.data?.map((teacher) => (
@@ -168,7 +189,14 @@ export default function AddTransactionPage() {
- Subject
+
+ Subject
+
) => {
@@ -181,7 +209,14 @@ export default function AddTransactionPage() {
/>
- Remarks
+
+ Remarks
+
- Consumables
+
+ Consumables
+
- Additional Members
+
+ Additional Members
+
Date: Sun, 7 Jan 2024 10:56:28 +0800
Subject: [PATCH 04/20] Remove redundant labels
---
src/Pages/AddTransactionPage/AddTransactionPage.tsx | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/src/Pages/AddTransactionPage/AddTransactionPage.tsx b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
index 0ea14c3..f9c69e1 100644
--- a/src/Pages/AddTransactionPage/AddTransactionPage.tsx
+++ b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
@@ -33,10 +33,10 @@ export default function AddTransactionPage() {
equipments: [] as number[],
teacher: 0,
subject: "",
- remarks: " ",
+ remarks: "",
transaction_status: "Pending Approval",
- consumables: " ",
- additional_members: " ",
+ consumables: "",
+ additional_members: "",
borrower: 0,
});
/*
@@ -147,7 +147,7 @@ export default function AddTransactionPage() {
transaction.equipments.includes(equipment.id)
) || []
}
- onChange={(event, newValue) => {
+ onChange={(_event, newValue) => {
SetTransaction({
...transaction,
equipments: newValue.map((item) => item.id),
@@ -203,7 +203,6 @@ export default function AddTransactionPage() {
SetTransaction({ ...transaction, subject: e.target.value });
setError("");
}}
- label={"Subject"}
value={transaction.subject}
placeholder={"The subject requiring the equipments"}
/>
@@ -224,7 +223,6 @@ export default function AddTransactionPage() {
SetTransaction({ ...transaction, remarks: e.target.value });
setError("");
}}
- label={"Remarks"}
value={transaction.remarks}
placeholder={"Optionally add a brief description of the request"}
/>
@@ -245,7 +243,6 @@ export default function AddTransactionPage() {
SetTransaction({ ...transaction, consumables: e.target.value });
setError("");
}}
- label={"Consumables"}
value={transaction.consumables}
placeholder={"Write down any consumables here"}
/>
@@ -269,7 +266,6 @@ export default function AddTransactionPage() {
});
setError("");
}}
- label={"Additional Members"}
value={transaction.additional_members}
placeholder={
"Write down any additional members borrowing on behalf of this transaction"
From c1c092080cb564fe2903f6b83805b473638e3660 Mon Sep 17 00:00:00 2001
From: Keannu Bernasol
Date: Sun, 7 Jan 2024 11:04:37 +0800
Subject: [PATCH 05/20] Refresh available equipments on transaction create
---
src/Pages/AddTransactionPage/AddTransactionPage.tsx | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/Pages/AddTransactionPage/AddTransactionPage.tsx b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
index f9c69e1..07d027c 100644
--- a/src/Pages/AddTransactionPage/AddTransactionPage.tsx
+++ b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
@@ -309,6 +309,9 @@ export default function AddTransactionPage() {
queryClient.invalidateQueries({
queryKey: ["equipment_instances"],
});
+ queryClient.invalidateQueries({
+ queryKey: ["equipment_instances_available"],
+ });
queryClient.invalidateQueries({
queryKey: ["transactions"],
});
From a685e3fcb51f5065e211c84ae6bb5bf13203ed71 Mon Sep 17 00:00:00 2001
From: Keannu Bernasol
Date: Sun, 7 Jan 2024 12:12:05 +0800
Subject: [PATCH 06/20] Update debug backend url
---
src/Components/API/API.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Components/API/API.tsx b/src/Components/API/API.tsx
index 10984e0..2d6f26f 100644
--- a/src/Components/API/API.tsx
+++ b/src/Components/API/API.tsx
@@ -23,11 +23,11 @@ import {
TransactionCreateType,
} from "../Types/Types";
-const debug = false;
+const debug = true;
let backendURL;
if (debug) {
- backendURL = "http://localhost:8000/";
+ backendURL = "http://localhost:8092/";
} else {
backendURL = "https://csm-backend.keannu1.duckdns.org/";
}
From 8810daa26caa9d1eccb9c1b7116711e5a0be6adc Mon Sep 17 00:00:00 2001
From: Keannu Bernasol
Date: Sun, 7 Jan 2024 12:20:22 +0800
Subject: [PATCH 07/20] Sort available equipments by id in ascending order
---
src/Pages/AddTransactionPage/AddTransactionPage.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Pages/AddTransactionPage/AddTransactionPage.tsx b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
index 07d027c..098b3eb 100644
--- a/src/Pages/AddTransactionPage/AddTransactionPage.tsx
+++ b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
@@ -138,7 +138,7 @@ export default function AddTransactionPage() {
a.id - b.id) || []}
getOptionLabel={(option) =>
`${option.equipment_name} (ID:${option.id})`
}
From b5f4fc73260b3b3d597f3c2f26e273f059028d7f Mon Sep 17 00:00:00 2001
From: Keannu Bernasol
Date: Sun, 7 Jan 2024 12:20:41 +0800
Subject: [PATCH 08/20] Turn off debug flag
---
src/Components/API/API.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Components/API/API.tsx b/src/Components/API/API.tsx
index 2d6f26f..4c43e72 100644
--- a/src/Components/API/API.tsx
+++ b/src/Components/API/API.tsx
@@ -23,7 +23,7 @@ import {
TransactionCreateType,
} from "../Types/Types";
-const debug = true;
+const debug = false;
let backendURL;
if (debug) {
From e589588d8ce016b36b5956b2af0d77a6a1e96c2e Mon Sep 17 00:00:00 2001
From: Keannu Bernasol
Date: Sun, 7 Jan 2024 12:28:06 +0800
Subject: [PATCH 09/20] Fix equipment tally page
---
.../Technician/TechnicianWidgets.tsx | 6 +-
.../EquipmentTallyPage/EquipmentTallyPage.tsx | 130 +++++++++---------
2 files changed, 67 insertions(+), 69 deletions(-)
diff --git a/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx b/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx
index 188ea7d..65726b0 100644
--- a/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx
+++ b/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx
@@ -38,14 +38,16 @@ export default function TechnicianWidgets() {
if (isLoading) {
return (
<>
-
+
- Loading
+ Loading widgets...
>
);
diff --git a/src/Pages/EquipmentTallyPage/EquipmentTallyPage.tsx b/src/Pages/EquipmentTallyPage/EquipmentTallyPage.tsx
index 6e703ab..51101bc 100644
--- a/src/Pages/EquipmentTallyPage/EquipmentTallyPage.tsx
+++ b/src/Pages/EquipmentTallyPage/EquipmentTallyPage.tsx
@@ -65,79 +65,75 @@ export default function EquipmentTallyPage() {
width: "100%",
minHeight: "100%",
minWidth: "100%",
- flexWrap: "wrap",
}}
>
-
-
+
+
+ theme.palette.getContrastText(theme.palette.background.paper),
+ },
+ }}
+ value={filter}
+ onChange={(_event, newValue) => {
+ setFilter(newValue);
+ }}
+ freeSolo
+ id="custom-input-demo"
+ options={["Glassware", "Miscellaneous"]}
+ renderInput={(params) => (
+
+
+
+ )}
+ />
+
-
-
- theme.palette.getContrastText(
- theme.palette.background.paper
- ),
- },
- }}
- value={filter}
- onChange={(_event, newValue) => {
- setFilter(newValue);
- }}
- freeSolo
- id="custom-input-demo"
- options={["Glassware", "Miscellaneous"]}
- renderInput={(params) => (
-
-
-
- )}
- />
-
- Results Found:{" "}
- {
- equipments?.data?.filter((equipment) =>
- filter !== null
- ? // If filter is not null, we filter if it matches any criteria
- equipment.name
- .toLowerCase()
- .includes(filter.toLowerCase()) ||
- equipment.category
- .toLowerCase()
- .includes(filter.toLowerCase()) ||
- equipment.last_updated
- .toLowerCase()
- .includes(filter?.toLowerCase()) ||
- equipment.category.toLowerCase() == filter.toLowerCase()
- : // If filter keyword is null then we just pass through everything as if we did not filter at all
- true
- ).length
- }
-
-
+ Results Found:{" "}
+ {
+ equipment_instances?.data?.filter((equipment) =>
+ filter !== null
+ ? // If filter is not null, we filter if it matches any criteria
+ equipment.equipment_name
+ .toLowerCase()
+ .includes(filter.toLowerCase()) ||
+ equipment.category
+ .toLowerCase()
+ .includes(filter.toLowerCase()) ||
+ equipment.last_updated
+ .toLowerCase()
+ .includes(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
+ }
+
+
Date: Sun, 7 Jan 2024 12:30:34 +0800
Subject: [PATCH 10/20] Improve technician widgets loading
---
.../Technician/TechnicianWidgets.tsx | 31 ++++---------------
1 file changed, 6 insertions(+), 25 deletions(-)
diff --git a/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx b/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx
index 65726b0..b412176 100644
--- a/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx
+++ b/src/Components/DashboardPage/Technician/TechnicianWidgets.tsx
@@ -6,7 +6,6 @@ import {
UserAPI,
TransactionsAPI,
} from "../../API/API";
-import CircularProgress from "@mui/material/CircularProgress";
import moment from "moment";
export default function TechnicianWidgets() {
@@ -34,24 +33,6 @@ export default function TechnicianWidgets() {
},
],
});
- const isLoading = queries.some((result) => result.isLoading);
- if (isLoading) {
- return (
- <>
-
-
- Loading widgets...
-
- >
- );
- }
return (
{queries[1].data?.filter(
(equipment) => equipment.status == "Pending"
- ).length || 0}
+ ).length || "Loading..."}
- {queries[1].data?.length || 0}
+ {queries[1].data?.length || "Loading..."}
@@ -169,7 +150,7 @@ export default function TechnicianWidgets() {
>
{queries[1].data?.filter(
(equipment) => equipment.status == "Available"
- ).length || 0}
+ ).length || "Loading..."}
{queries[1].data?.filter(
(equipment) => equipment.status == "Broken"
- ).length || 0}
+ ).length || "Loading..."}
@@ -249,7 +230,7 @@ export default function TechnicianWidgets() {
todayStartOfDay,
todayEndOfDay
)
- ).length || 0}
+ ).length || "Loading..."}
From b4ab7ae2e42035cb23f3f807c52bae84b35ae4d6 Mon Sep 17 00:00:00 2001
From: Keannu Bernasol
Date: Sun, 7 Jan 2024 12:47:23 +0800
Subject: [PATCH 11/20] Change site name
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index 6010514..cd834f8 100644
--- a/index.html
+++ b/index.html
@@ -4,7 +4,7 @@
- CITC Equipment Tracker
+ CSM Equipment Tracker
From 04ce14a5a0e75c3286f9595d6f084af5f771a941 Mon Sep 17 00:00:00 2001
From: Jerilyn Yare <102701655+Jy-re@users.noreply.github.com>
Date: Sun, 7 Jan 2024 12:56:01 +0800
Subject: [PATCH 12/20] student and teacher dashboard responsive
---
.../DashboardPage/Student/StudentDashboard.tsx | 17 +++++++----------
.../Student/StudentTransactionListView.tsx | 7 ++++---
.../Teacher/TeacherTransactionListView.tsx | 2 +-
.../TransactionEntry/TransactionEntry.tsx | 4 ++--
.../TransactionFilterMenu.tsx | 3 ++-
src/Pages/DashboardPage/DashboardPage.tsx | 6 +++---
6 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/src/Components/DashboardPage/Student/StudentDashboard.tsx b/src/Components/DashboardPage/Student/StudentDashboard.tsx
index 24fbc03..fcc8f40 100644
--- a/src/Components/DashboardPage/Student/StudentDashboard.tsx
+++ b/src/Components/DashboardPage/Student/StudentDashboard.tsx
@@ -1,7 +1,6 @@
+
import styles from "../../../styles";
import { Button } from "@mui/material";
-import AddBoxIcon from "@mui/icons-material/AddBox";
-import { colors } from "../../../styles";
import { useNavigate } from "react-router-dom";
export default function StudentDashboard() {
const navigate = useNavigate();
@@ -17,7 +16,7 @@ export default function StudentDashboard() {
justifyContent: "center",
flexWrap: "wrap",
marginTop: "40px",
-
+ width: "100%"
},
@@ -28,11 +27,10 @@ export default function StudentDashboard() {
...styles.flex_column,
...{
alignSelf: "center",
- justifyContent: "center",
- flexWrap: "wrap",
backgroundColor: "#CCDDFF",
- paddingInline: "90px",
- borderRadius: "20px"
+ borderRadius: "20px",
+ paddingInline: "100px",
+ width: "100%",
},
}}
onClick={() => {
@@ -43,9 +41,8 @@ export default function StudentDashboard() {
CLICK TO REQUEST BORROW ITEMS
diff --git a/src/Components/DashboardPage/Student/StudentTransactionListView.tsx b/src/Components/DashboardPage/Student/StudentTransactionListView.tsx
index ef08e2c..f41bf1f 100644
--- a/src/Components/DashboardPage/Student/StudentTransactionListView.tsx
+++ b/src/Components/DashboardPage/Student/StudentTransactionListView.tsx
@@ -39,10 +39,11 @@ export default function StudentTransactionListView() {
);
}
return (
-
+
diff --git a/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx b/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx
index 69d6818..351b62a 100644
--- a/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx
+++ b/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx
@@ -48,7 +48,7 @@ export default function TeacherTransactionListView() {
{transactions.data ? (
diff --git a/src/Components/TransactionEntry/TransactionEntry.tsx b/src/Components/TransactionEntry/TransactionEntry.tsx
index 2a47bff..757d53a 100644
--- a/src/Components/TransactionEntry/TransactionEntry.tsx
+++ b/src/Components/TransactionEntry/TransactionEntry.tsx
@@ -18,11 +18,11 @@ export default function TransactionEntry(props: props) {
style={{
alignSelf: "center",
justifySelf: "center",
- width: "584px",
backgroundColor: colors.header_color,
borderRadius: 16,
- margin: "10px",
+ marginTop: "10px",
paddingTop: "15px",
+ width: "100%"
}}
onClick={props.onClick}
diff --git a/src/Components/TransactionFilterMenu/TransactionFilterMenu.tsx b/src/Components/TransactionFilterMenu/TransactionFilterMenu.tsx
index 467b007..a3c9f24 100644
--- a/src/Components/TransactionFilterMenu/TransactionFilterMenu.tsx
+++ b/src/Components/TransactionFilterMenu/TransactionFilterMenu.tsx
@@ -41,10 +41,11 @@ export default function TransactionFilterMenu(props: props) {
alignSelf: "center",
justifyContent: "center",
flexWrap: "wrap",
+ width: "100%"
},
}}
>
-
+
Filter Transactions
diff --git a/src/Pages/DashboardPage/DashboardPage.tsx b/src/Pages/DashboardPage/DashboardPage.tsx
index 4f493d9..6dd68b6 100644
--- a/src/Pages/DashboardPage/DashboardPage.tsx
+++ b/src/Pages/DashboardPage/DashboardPage.tsx
@@ -21,10 +21,10 @@ export default function Dashboard() {
style={{
...styles.flex_column,
...{
- flexWrap: "wrap",
justifyContent: "center",
- marginLeft: "16px",
- marginRight: "16px",
+ alignItems: "center",
+ marginInline: "10px"
+
},
}}
>
From f00432aab717900ca9ccee522c24c203d4275293 Mon Sep 17 00:00:00 2001
From: psofia
Date: Sun, 7 Jan 2024 16:40:28 +0800
Subject: [PATCH 13/20] unc
---
.../Technician/TechnicianEquipmentButtons.tsx | 20 +--
.../EquipmentInstancesListPage.tsx | 126 +-----------------
2 files changed, 14 insertions(+), 132 deletions(-)
diff --git a/src/Components/DashboardPage/Technician/TechnicianEquipmentButtons.tsx b/src/Components/DashboardPage/Technician/TechnicianEquipmentButtons.tsx
index c944e3a..3e5ed98 100644
--- a/src/Components/DashboardPage/Technician/TechnicianEquipmentButtons.tsx
+++ b/src/Components/DashboardPage/Technician/TechnicianEquipmentButtons.tsx
@@ -68,7 +68,7 @@ export default function TechnicianEquipmentButtons() {
View All
- {/*
Add Item
- */}
- {/*
+
Add SKU
- */}
+
- {/*
Miscellaneous
- */}
+
- {/*
SetAddSKUModalOpen(false)}
modal
@@ -285,8 +285,8 @@ export default function TechnicianEquipmentButtons() {
}}
>
- */}
- {/*
+ SetAddItemModalOpen(false)}
modal
@@ -304,7 +304,7 @@ export default function TechnicianEquipmentButtons() {
}}
>
- */}
+
>
);
}
diff --git a/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx b/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx
index 4ef4751..e72d3c5 100644
--- a/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx
+++ b/src/Pages/EquipmentInstancesListPage/EquipmentInstancesListPage.tsx
@@ -16,22 +16,14 @@ import { useState } from "react";
import Popup from "reactjs-popup";
import Autocomplete from "@mui/material/Autocomplete";
import SearchIcon from "@mui/icons-material/Search";
-import AddItemModal from "../../Components/AddItemModal/AddItemModal";
-import AddToQueueIcon from "@mui/icons-material/AddToQueue";
-import ScienceIcon from "@mui/icons-material/Science";
-import ColorizeIcon from "@mui/icons-material/Colorize";
-import { Button } from "@mui/material";
-import { useNavigate } from "react-router-dom";
export default function EquipmentInstancesListPage() {
const [editmodalOpen, SetEditModalOpen] = useState(false);
const [selectedItem, SetSelectedItem] = useState(0);
- const [additemmodalOpen, SetAddItemModalOpen] = useState(false);
- const navigate = useNavigate();
const equipment_instances = useQuery({
queryKey: ["equipment_instances"],
@@ -83,121 +75,11 @@ export default function EquipmentInstancesListPage() {
minWidth: "100%",
}}
>
- {/* ADDED/INSERTED BUTTON,POPUP, TWO CATEGORY BUTTONS*/}
-
{
- SetAddItemModalOpen(true);
- }}
- >
-
-
- Add Item
-
-
+
+
-
SetAddItemModalOpen(false)}
- modal
- position={"top center"}
- contentStyle={{
- width: "32rem",
- borderRadius: 16,
- borderColor: "grey",
- borderStyle: "solid",
- borderWidth: 1,
- padding: 16,
- alignContent: "center",
- justifyContent: "center",
- textAlign: "center",
- }}
- >
-
-
-
-
- {
- navigate("/view/equipment_instances/filter/Glassware");
- }}
- />
-
- Glassware
-
-
-
- {
- navigate("/view/equipment_instances/filter/Miscellaneous");
- }}
- />
-
- Miscellaneous
-
-
+
+
Date: Tue, 9 Jan 2024 06:17:30 +0800
Subject: [PATCH 14/20] Changes Dashboard, Form, Added divs lang gyud. fix fix
lang gamay
---
src/Components/API/API.tsx | 2 +-
.../Teacher/TeacherTransactionListView.tsx | 2 +-
.../TransactionEntry/TransactionEntry.tsx | 3 +-
.../AddTransactionPage/AddTransactionPage.tsx | 118 ++++++++++++------
4 files changed, 84 insertions(+), 41 deletions(-)
diff --git a/src/Components/API/API.tsx b/src/Components/API/API.tsx
index 4c43e72..2d6f26f 100644
--- a/src/Components/API/API.tsx
+++ b/src/Components/API/API.tsx
@@ -23,7 +23,7 @@ import {
TransactionCreateType,
} from "../Types/Types";
-const debug = false;
+const debug = true;
let backendURL;
if (debug) {
diff --git a/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx b/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx
index 351b62a..592df68 100644
--- a/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx
+++ b/src/Components/DashboardPage/Teacher/TeacherTransactionListView.tsx
@@ -48,7 +48,7 @@ export default function TeacherTransactionListView() {
{transactions.data ? (
diff --git a/src/Components/TransactionEntry/TransactionEntry.tsx b/src/Components/TransactionEntry/TransactionEntry.tsx
index 757d53a..8f0ed31 100644
--- a/src/Components/TransactionEntry/TransactionEntry.tsx
+++ b/src/Components/TransactionEntry/TransactionEntry.tsx
@@ -22,7 +22,8 @@ export default function TransactionEntry(props: props) {
borderRadius: 16,
marginTop: "10px",
paddingTop: "15px",
- width: "100%"
+ width: "100%",
+ maxWidth: "550px"
}}
onClick={props.onClick}
diff --git a/src/Pages/AddTransactionPage/AddTransactionPage.tsx b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
index c8c2cf2..13ea135 100644
--- a/src/Pages/AddTransactionPage/AddTransactionPage.tsx
+++ b/src/Pages/AddTransactionPage/AddTransactionPage.tsx
@@ -3,7 +3,6 @@ import styles from "../../styles";
import { colors } from "../../styles";
import TextField from "@mui/material/TextField";
import AddToQueueIcon from "@mui/icons-material/AddToQueue";
-import Button from "../../Components/Button/Button";
import { toast } from "react-toastify";
import {
AvailableEquipmentInstancesAPI,
@@ -21,6 +20,9 @@ import {
MenuItem,
OutlinedInput,
Autocomplete,
+ Alert,
+ Stack
+
} from "@mui/material";
import React from "react";
import Header from "../../Components/Header/Header";
@@ -125,11 +127,17 @@ export default function AddTransactionPage() {
Borrowing Form
-
+
@@ -207,26 +215,7 @@ export default function AddTransactionPage() {
placeholder={"The subject requiring the equipments"}
/>
-
-
- Remarks
-
- ) => {
- SetTransaction({ ...transaction, remarks: e.target.value });
- setError("");
- }}
- value={transaction.remarks}
- placeholder={"Optionally add a brief description of the request"}
- />
-
+
@@ -268,24 +259,63 @@ export default function AddTransactionPage() {
}}
value={transaction.additional_members}
placeholder={
- "Write down any additional members borrowing on behalf of this transaction"
+ "1. Full Name ex. (Daniel John Padilla)\n2. Kathryn Bernardo \n3. ..."
}
/>
+
+
+ Remarks (optional)
+
+ ) => {
+ SetTransaction({ ...transaction, remarks: e.target.value });
+ setError("");
+ }}
+ value={transaction.remarks}
+ placeholder={"Add a brief description of the request or N/A."}
+ />
+
-
{error}
+
+
-
+
+
+ NOTE: please be reminded that borrowing of lab apparatus can only be
+ made once. Further requests of additional apparatus will not be
+ entertained.
+
+
+
+
+
{error}
+
+
{
console.log(JSON.stringify(transaction));
const data = await TransactionCreateAPI(transaction);
@@ -309,9 +339,6 @@ export default function AddTransactionPage() {
queryClient.invalidateQueries({
queryKey: ["equipment_instances"],
});
- queryClient.invalidateQueries({
- queryKey: ["equipment_instances_available"],
- });
queryClient.invalidateQueries({
queryKey: ["transactions"],
});
@@ -320,7 +347,22 @@ export default function AddTransactionPage() {
setError(JSON.stringify(data[1]));
}
}}
- />
+ style={{
+ display: "flex",
+ padding: "25px 38px",
+ justifyContent: "center",
+ alignItems: "center",
+ background: "#A7DA96",
+ height: "40px",
+ width: "100%",
+ marginTop: "1rem",
+ marginBottom: "1rem",
+ }}
+ >
+ Create Transaction
+
+
+
);
}
From b7f39a517b912a1b36f2a510e3d443266c66cd3a Mon Sep 17 00:00:00 2001
From: "Pongot, Jophiel"
Date: Tue, 9 Jan 2024 06:31:42 +0800
Subject: [PATCH 15/20] Landing Page configs.
---
src/Pages/LandingPage/LandingPage.tsx | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/Pages/LandingPage/LandingPage.tsx b/src/Pages/LandingPage/LandingPage.tsx
index c91d636..9058a1b 100644
--- a/src/Pages/LandingPage/LandingPage.tsx
+++ b/src/Pages/LandingPage/LandingPage.tsx
@@ -37,6 +37,7 @@ export default function LandingPage() {
minHeight: "100%",
minWidth: "100%",
flexWrap: "wrap",
+ backgroundColor: "#F2FAF4"
}}
>
@@ -51,19 +52,26 @@ export default function LandingPage() {
>
- CSM Inventory
+ Welcome!
+
+
+
+ CSM Borrowing and Inventory
Monitoring and Management System
From d08b43b3ad137aefaa8d11a805fd7dcac1c46d5f Mon Sep 17 00:00:00 2001
From: "Pongot, Jophiel"
Date: Tue, 9 Jan 2024 06:47:50 +0800
Subject: [PATCH 16/20] added and made chages to Login Modal
---
src/Components/API/API.tsx | 2 +-
src/Components/LoginModal/LoginModal.tsx | 101 +++++++++++++++--------
src/styles.tsx | 28 ++++++-
3 files changed, 90 insertions(+), 41 deletions(-)
diff --git a/src/Components/API/API.tsx b/src/Components/API/API.tsx
index 2d6f26f..4c43e72 100644
--- a/src/Components/API/API.tsx
+++ b/src/Components/API/API.tsx
@@ -23,7 +23,7 @@ import {
TransactionCreateType,
} from "../Types/Types";
-const debug = true;
+const debug = false;
let backendURL;
if (debug) {
diff --git a/src/Components/LoginModal/LoginModal.tsx b/src/Components/LoginModal/LoginModal.tsx
index fb6a5c0..ba18222 100644
--- a/src/Components/LoginModal/LoginModal.tsx
+++ b/src/Components/LoginModal/LoginModal.tsx
@@ -6,7 +6,6 @@ import InputAdornment from "@mui/material/InputAdornment";
import IconButton from "@mui/material/IconButton";
import Visibility from "@mui/icons-material/Visibility";
import VisibilityOff from "@mui/icons-material/VisibilityOff";
-import LoginIcon from "@mui/icons-material/Login";
import Checkbox from "@mui/material/Checkbox";
import Button from "../Button/Button";
import { useNavigate } from "react-router-dom";
@@ -14,6 +13,8 @@ import { LoginAPI } from "../API/API";
import { useDispatch } from "react-redux";
import { auth_toggle } from "../Plugins/Redux/Slices/AuthSlice/AuthSlice";
import { toast } from "react-toastify";
+import Logo_dako from "../../assets/Logo_dako.png"
+
export default function LoginModal() {
const navigate = useNavigate();
const [showPassword, setShowPassword] = useState(false);
@@ -28,25 +29,41 @@ export default function LoginModal() {
<>
-
-
Welcome back!
+
+
+ Welcome back!
+
+
+ Sign In to Continue
+
-
+
+
+
-
{error}
-
{
- const status = await LoginAPI(user, remember_session);
- if (status === true) {
- await dispatch(auth_toggle());
- navigate("/dashboard");
- toast("Logged in", {
- position: "top-right",
- autoClose: 2000,
- hideProgressBar: false,
- closeOnClick: true,
- pauseOnHover: true,
- draggable: true,
- progress: undefined,
- theme: "light",
- });
- } else {
- setError("Invalid login");
- }
+ marginBottom: "40px"
}}
/>
+
+
+ {
+ const status = await LoginAPI(user, remember_session);
+ if (status === true) {
+ await dispatch(auth_toggle());
+ navigate("/dashboard");
+ toast("Logged in", {
+ position: "top-right",
+ autoClose: 2000,
+ hideProgressBar: false,
+ closeOnClick: true,
+ pauseOnHover: true,
+ draggable: true,
+ progress: undefined,
+ theme: "light",
+ });
+ } else {
+ setError("Invalid login");
+ }
+ }}
+ style={{
+ display: "flex",
+ padding: "25px 38px",
+ justifyContent: "center",
+ alignItems: "center",
+ background: "#FBB217",
+ height: "40px",
+ width: "100%",
+ }}
+ >
+ Login
+
+
+
>
);
}
diff --git a/src/styles.tsx b/src/styles.tsx
index 315f0fa..73e7bb3 100644
--- a/src/styles.tsx
+++ b/src/styles.tsx
@@ -1,5 +1,5 @@
export const colors = {
- background: "#FFFFFF",
+ background: "#F2FAF4",
header_color: "#b2dfab",
font_dark: "#2e482e",
font_light: "#0e410d",
@@ -11,9 +11,20 @@ export const colors = {
green: "#80b28a",
gray: "#8F8F8F",
dark_green: "#17561D",
- dark_blue: "#19639D"
+ dark_blue: "#19639D",
+
+ font_dark_red: "#570404",
+
+ dandelion: "#FBB217",
+
+ lightgreen: "#D9FFD8",
+ darkgreen: "#00360C",
+ lightorange: "#FEFFCD",
+ lightred: "#ECC4B8",
+
+ form_dark: "#000000",
+ form_title: "#1E1A4D"
-
};
const styles: { [key: string]: React.CSSProperties } = {
@@ -30,7 +41,16 @@ const styles: { [key: string]: React.CSSProperties } = {
overflowY: "scroll",
},
-
+ text_normal: {
+ color: colors.font_dark,
+ fontWeight: "500",
+ },
+
+ text_dark_red: {
+ color: colors.font_dark_red,
+ fontWeight: "bold",
+ },
+
text_dark: {
color: colors.font_dark,
fontWeight: "bold",
From 8a53d12c8aeb720edc21784b937b221cc54cf66f Mon Sep 17 00:00:00 2001
From: "Pongot, Jophiel"
Date: Tue, 9 Jan 2024 06:56:05 +0800
Subject: [PATCH 17/20] si register modal sab, scrollable and noyys kaayo iyang
scroll bar.
---
src/Components/LoginModal/LoginModal.tsx | 1 -
.../RegisterModal/RegisterModal.tsx | 457 ++++++++++--------
src/index.css | 22 +
3 files changed, 273 insertions(+), 207 deletions(-)
diff --git a/src/Components/LoginModal/LoginModal.tsx b/src/Components/LoginModal/LoginModal.tsx
index ba18222..d92cd0d 100644
--- a/src/Components/LoginModal/LoginModal.tsx
+++ b/src/Components/LoginModal/LoginModal.tsx
@@ -7,7 +7,6 @@ import IconButton from "@mui/material/IconButton";
import Visibility from "@mui/icons-material/Visibility";
import VisibilityOff from "@mui/icons-material/VisibilityOff";
import Checkbox from "@mui/material/Checkbox";
-import Button from "../Button/Button";
import { useNavigate } from "react-router-dom";
import { LoginAPI } from "../API/API";
import { useDispatch } from "react-redux";
diff --git a/src/Components/RegisterModal/RegisterModal.tsx b/src/Components/RegisterModal/RegisterModal.tsx
index ca49625..4bf18d8 100644
--- a/src/Components/RegisterModal/RegisterModal.tsx
+++ b/src/Components/RegisterModal/RegisterModal.tsx
@@ -1,13 +1,11 @@
import { useState } from "react";
-import styles from "../../styles";
-import { colors } from "../../styles";
+import styles, { colors } from "../../styles";
import TextField from "@mui/material/TextField";
import InputAdornment from "@mui/material/InputAdornment";
import IconButton from "@mui/material/IconButton";
import Visibility from "@mui/icons-material/Visibility";
import VisibilityOff from "@mui/icons-material/VisibilityOff";
-import { AppRegistration } from "@mui/icons-material";
-import Button from "../Button/Button";
+import Logo_dako from "../../assets/Logo_dako.png";
import { useNavigate } from "react-router-dom";
import { RegisterAPI } from "../API/API";
import { toast } from "react-toastify";
@@ -34,216 +32,263 @@ export default function RegisterModal() {
const [error, setError] = useState("");
return (
<>
-
+ >
+
-
-
) => {
- setUser({ ...user, first_name: e.target.value });
- setError("");
- }}
- value={user.first_name}
- placeholder={"Enter your first name"}
- />
- ) =>
- setUser({ ...user, last_name: e.target.value })
- }
- value={user.last_name}
- placeholder={"Enter your last name"}
- />
- ) =>
- setUser({ ...user, email: e.target.value })
- }
- value={user.email}
- placeholder={"Enter your email"}
- />
-
-
- Course
-
- ) => {
- setUser({ ...user, course: e.target.value });
- setError("");
+
-
+
+ Enter required fields
+
+
+
+
+
+
+ ) => {
+ setUser({ ...user, first_name: e.target.value });
+ setError("");
+ }}
+ value={user.first_name}
+ placeholder={"Enter your first name"}
+ />
+ ) =>
+ setUser({ ...user, last_name: e.target.value })
+ }
+ value={user.last_name}
+ placeholder={"Enter your last name"}
+ />
+ ) =>
+ setUser({ ...user, email: e.target.value })
+ }
+ value={user.email}
+ placeholder={"Enter your email"}
+ />
+
+
+
+ Course
+
+ ) => {
+ setUser({ ...user, course: e.target.value });
+ setError("");
}}
>
- }
- label="BS Chemistry"
- style={styles.text_dark}
- />
- }
- label="BS Food Technology"
- style={styles.text_dark}
- />
- }
- label="BS Applied Physics"
- style={styles.text_dark}
- />
- }
- label="BS Environmental Science"
- style={styles.text_dark}
- />
-
-
-
- ) => {
- setUser({ ...user, username: e.target.value });
- setError("");
- }}
- value={user.username}
- placeholder={"Enter username"}
- />
-
- setShowPassword(!showPassword)}
- edge="end"
- >
- {showPassword ? : }
-
-
- ),
- }}
- label="Password"
- placeholder={"Enter password"}
- onChange={(e: React.ChangeEvent) =>
- setUser({ ...user, password: e.target.value })
- }
- value={user.password}
- />
-
- setShowPassword(!showPassword)}
- edge="end"
- >
- {showPassword ? : }
-
-
- ),
- }}
- label="Confirm Password"
- placeholder={"Re-enter password"}
- onChange={(e: React.ChangeEvent) => {
- setUser({ ...user, confirm_password: e.target.value });
- setError("");
- }}
- value={user.confirm_password}
- />
-
- {error}
-
- {
- if (user.password !== user.confirm_password) {
- setError("Passwords do not match");
- } else {
- const status = await RegisterAPI(user);
- if (status[0]) {
- setError(
- "Registration successful. Please activate your account using the email provided"
- );
- toast("Registration successful", {
- position: "top-right",
- autoClose: 2000,
- hideProgressBar: false,
- closeOnClick: true,
- pauseOnHover: true,
- draggable: true,
- progress: undefined,
- theme: "light",
- });
- setTimeout(() => {
- navigate(0);
- }, 3000);
- setUser({
- first_name: "",
- last_name: "",
- username: "",
- email: "",
- password: "",
- confirm_password: "",
- course: "",
- });
- } else {
- setError(JSON.stringify(status[1]));
+
+ }
+ label="BS Chemistry"
+ style={styles.text_dark}
+ />
+ }
+ label="BS Food Technology"
+ style={styles.text_dark}
+ />
+ }
+ label="BS Applied Physics"
+ style={styles.text_dark}
+ />
+ }
+ label="BS Environmental Science"
+ style={styles.text_dark}
+ />
+
+
+
+ ) => {
+ setUser({ ...user, username: e.target.value });
+ setError("");
+ }}
+ value={user.username}
+ placeholder={"Enter username"}
+ />
+
+ setShowPassword(!showPassword)}
+ edge="end"
+ >
+ {showPassword ? : }
+
+
+ ),
+ }}
+ label="Password"
+ placeholder={"Enter password"}
+ onChange={(e: React.ChangeEvent) =>
+ setUser({ ...user, password: e.target.value })
}
- }
- }}
- />
+ value={user.password}
+ />
+
+ setShowPassword(!showPassword)}
+ edge="end"
+ >
+ {showPassword ? : }
+
+
+ ),
+ }}
+ label="Confirm Password"
+ placeholder={"Re-enter password"}
+ onChange={(e: React.ChangeEvent) => {
+ setUser({ ...user, confirm_password: e.target.value });
+ setError("");
+ }}
+ value={user.confirm_password}
+ />
+
+
+
+
+
+ {
+ if (user.password !== user.confirm_password) {
+ setError("Passwords do not match");
+ } else {
+ const status = await RegisterAPI(user);
+ if (status[0]) {
+ setError(
+ "Registration successful. Please activate your account using the email provided"
+ );
+ toast("Registration successful", {
+ position: "top-right",
+ autoClose: 2000,
+ hideProgressBar: false,
+ closeOnClick: true,
+ pauseOnHover: true,
+ draggable: true,
+ progress: undefined,
+ theme: "light",
+ });
+ setTimeout(() => {
+ navigate(0);
+ }, 3000);
+ setUser({
+ first_name: "",
+ last_name: "",
+ username: "",
+ email: "",
+ password: "",
+ confirm_password: "",
+ course: "",
+ });
+ } else {
+ setError(JSON.stringify(status[1]));
+ }
+ }
+ }}
+ style={{
+ display: "flex",
+ padding: "25px 38px",
+ justifyContent: "center",
+ alignItems: "center",
+ background: "#FBB217",
+ height: "40px",
+ width: "100%",
+ }}
+ >
+ Register
+
+
+
>
);
}
diff --git a/src/index.css b/src/index.css
index b2acf00..69476d9 100644
--- a/src/index.css
+++ b/src/index.css
@@ -82,3 +82,25 @@ button:focus-visible {
background-color: #f9f9f9;
}
}
+
+.custom-scrollbar {
+ overflow-y: scroll;
+ max-height: 800px;
+ scrollbar-width: thin; /* For Firefox */
+ -webkit-overflow-scrolling: touch; /* For smooth scrolling on iOS */
+ -ms-overflow-style: none; /* For IE */
+ scrollbar-color: transparent transparent; /* For WebKit */
+}
+
+.custom-scrollbar::-webkit-scrollbar {
+ width: 6px; /* Adjust the width as needed */
+}
+
+.custom-scrollbar::-webkit-scrollbar-thumb {
+ background-color: #c4c4c4; /* Color of the thumb */
+ border-radius: 3px; /* Rounded corners of the thumb */
+}
+
+.custom-scrollbar::-webkit-scrollbar-track {
+ background-color: #f0f0f0; /* Color of the track */
+}
From fa89268e0ad5cc5a76d646c22bd9b5871f943059 Mon Sep 17 00:00:00 2001
From: "Pongot, Jophiel"
Date: Tue, 9 Jan 2024 07:17:14 +0800
Subject: [PATCH 18/20] added homepage navigation, and configure header
---
.../Technician/TechnicianNavigation.tsx | 124 ++++++++++++++++++
src/Components/Header/Header.tsx | 52 ++++++--
src/Pages/DashboardPage/DashboardPage.tsx | 53 ++++----
src/assets/Equipment.svg | 36 +++++
src/assets/Profile-Icon.png | Bin 0 -> 783 bytes
src/assets/Transaction.svg | 9 ++
src/assets/ustp-logo.png | Bin 0 -> 50682 bytes
7 files changed, 238 insertions(+), 36 deletions(-)
create mode 100644 src/Components/DashboardPage/Technician/TechnicianNavigation.tsx
create mode 100644 src/assets/Equipment.svg
create mode 100644 src/assets/Profile-Icon.png
create mode 100644 src/assets/Transaction.svg
create mode 100644 src/assets/ustp-logo.png
diff --git a/src/Components/DashboardPage/Technician/TechnicianNavigation.tsx b/src/Components/DashboardPage/Technician/TechnicianNavigation.tsx
new file mode 100644
index 0000000..dfa3f0a
--- /dev/null
+++ b/src/Components/DashboardPage/Technician/TechnicianNavigation.tsx
@@ -0,0 +1,124 @@
+import styles from "../../../styles";
+import { useNavigate } from "react-router-dom";
+import AssessmentIcon from "@mui/icons-material/Assessment";
+
+import equipment from "../../../assets/Equipment.svg";
+import transaction from "../../../assets/Transaction.svg";
+
+export default function TechnicianNavigation() {
+ const navigate = useNavigate();
+ return (
+ <>
+
+
+
+
+
+ Feature
+
+
{
+ navigate("/view/transactions");
+ }}
+ >
+
+
+
+ Manage Transactions
+
+
+
+
{
+ navigate("/dashboard");
+ }}
+ >
+
+
+
+ Manage Equipments
+
+
+
{
+ navigate("/view/transactions/report");
+ }}
+ >
+
+
+
+ Generate Report
+
+
+
+
+ >
+ );
+}
diff --git a/src/Components/Header/Header.tsx b/src/Components/Header/Header.tsx
index 37984a6..b5680f7 100644
--- a/src/Components/Header/Header.tsx
+++ b/src/Components/Header/Header.tsx
@@ -10,26 +10,32 @@ export interface props {
export default function Header(props: props) {
const [SidebarOpen, SetSidebarOpen] = useState(false);
return (
+
+