Added initial transactions list page and edited technician dashboard component names for better readability

This commit is contained in:
Keannu Bernasol 2023-12-14 18:13:55 +08:00
parent be6e1ba229
commit 08fd217ccb
5 changed files with 21 additions and 6 deletions

View file

@ -17,6 +17,7 @@ import EquipmentLogsPage from "./Pages/EquipmentLogsPage/EquipmentLogsPage";
import EquipmentInstanceLogsPage from "./Pages/EquipmentInstanceLogsPage/EquipmentInstanceLogsPage"; import EquipmentInstanceLogsPage from "./Pages/EquipmentInstanceLogsPage/EquipmentInstanceLogsPage";
import EquipmentInstancesFilteredListPage from "./Pages/EquipmentInstancesListPage/EquipmentInstancesFilteredListPage"; import EquipmentInstancesFilteredListPage from "./Pages/EquipmentInstancesListPage/EquipmentInstancesFilteredListPage";
import RestrictedPage from "./Components/RestrictedPage/RestrictedPage"; import RestrictedPage from "./Components/RestrictedPage/RestrictedPage";
import TransactionsListPage from "./Pages/TransactionsListPage/TransactionsListPage";
const queryClient = new QueryClient(); const queryClient = new QueryClient();
const router = createHashRouter([ const router = createHashRouter([
@ -84,6 +85,17 @@ const router = createHashRouter([
), ),
errorElement: <ErrorPage />, errorElement: <ErrorPage />,
}, },
{
path: "/view/transactions",
element: (
<>
<Revalidator />
<RestrictedPage allow_only="Technician" />
<TransactionsListPage />
</>
),
errorElement: <ErrorPage />,
},
{ {
path: "/view/equipments/logs", path: "/view/equipments/logs",
element: ( element: (

View file

@ -12,7 +12,7 @@ import Popup from "reactjs-popup";
import AddItemModal from "../AddItemModal/AddItemModal"; import AddItemModal from "../AddItemModal/AddItemModal";
import AddSKUModal from "../AddSKUModal/AddSKUModal"; import AddSKUModal from "../AddSKUModal/AddSKUModal";
import { useState } from "react"; import { useState } from "react";
export default function TechnicianButtons() { export default function TechnicianEquipmentButtons() {
const [addSKUmodalOpen, SetAddSKUModalOpen] = useState(false); const [addSKUmodalOpen, SetAddSKUModalOpen] = useState(false);
const [additemmodalOpen, SetAddItemModalOpen] = useState(false); const [additemmodalOpen, SetAddItemModalOpen] = useState(false);
const navigate = useNavigate(); const navigate = useNavigate();

View file

@ -4,7 +4,7 @@ import ManageSearchIcon from "@mui/icons-material/ManageSearch";
import styles from "../../styles"; import styles from "../../styles";
import { colors } from "../../styles"; import { colors } from "../../styles";
export default function TechnicianLogs() { export default function TechnicianLogButtons() {
const navigate = useNavigate(); const navigate = useNavigate();
return ( return (
<> <>

View file

@ -2,8 +2,8 @@ import Header from "../../Components/Header/Header";
import styles from "../../styles"; import styles from "../../styles";
import RestrictedComponent from "../../Components/RestrictedComponent/RestrictedComponent"; import RestrictedComponent from "../../Components/RestrictedComponent/RestrictedComponent";
import TechnicianWidgets from "../../Components/DashboardPage/TechnicianWidgets"; import TechnicianWidgets from "../../Components/DashboardPage/TechnicianWidgets";
import TechnicianButtons from "../../Components/DashboardPage/TechnicianButtons"; import TechnicianEquipmentButtons from "../../Components/DashboardPage/TechnicianEquipmentButtons";
import TechnicianLogs from "../../Components/DashboardPage/TechnicianLogs"; import TechnicianLogButtons from "../../Components/DashboardPage/TechnicianLogButtons";
export default function Dashboard() { export default function Dashboard() {
return ( return (
<div style={styles.background}> <div style={styles.background}>
@ -12,10 +12,10 @@ export default function Dashboard() {
<TechnicianWidgets /> <TechnicianWidgets />
</RestrictedComponent> </RestrictedComponent>
<RestrictedComponent allow_only={"Technician"}> <RestrictedComponent allow_only={"Technician"}>
<TechnicianButtons /> <TechnicianEquipmentButtons />
</RestrictedComponent> </RestrictedComponent>
<RestrictedComponent allow_only={"Technician"}> <RestrictedComponent allow_only={"Technician"}>
<TechnicianLogs /> <TechnicianLogButtons />
</RestrictedComponent> </RestrictedComponent>
</div> </div>
); );

View file

@ -0,0 +1,3 @@
export default function TransactionsListPage() {
return <div>{"TransactionsListPage"}</div>;
}