Skip to content

Rbac integration and landfill manager dashboard completed #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion client/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import '@mantine/core/styles.css';
import '@mantine/charts/styles.css';

import { ColorSchemeScript, MantineProvider } from '@mantine/core';

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -19,7 +23,10 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<head>
<ColorSchemeScript />
</head>
<body className={inter.className}><MantineProvider>{children}</MantineProvider></body>
</html>
);
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,60 @@
"use client"
import { Button } from "@/components/ui/button";
import EmptyFillContainer from "../../cards/EmptyFillContainer";
import { Cog, Download, Send, Upload, UserRoundCog } from "lucide-react";
import LanfFillUpcomingVehiclesInDashboard from "../../../dataTables/LandFillUpcomingVehicleInDashboard";
import PendingBillList from "@/components/dataTables/PendingBillList";
import { landfillId } from "@/data/cookieNames";
import useGetLandfillDatabyID from "@/hooks/landFillDashboard/getLandFillDataById";
import { getCookie } from "@/lib/cookieFunctions";
import { useEffect } from "react";
import { AreaChart, PieChart } from "@mantine/charts";

export default function LandfillManagerDashboard() {

const { getLandfillDatabyID, landfillData } = useGetLandfillDatabyID();


useEffect(() => {
getLandfillDatabyID(getCookie(landfillId))
}, []);

useEffect(() => {
// alert(JSON.stringify(landfillData))
}, [landfillData]);

return (
<main className="flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 max-h-[calc(100vh-60px)] overflow-scroll">
<div className="flex flex-1 items-center justify-center rounded-lg border border-dashed shadow-sm">
<div className="grid grid-flow-row gap-4 grid-col-1 md:grid-cols-6 w-full h-full">
<div className="md:col-span-4 min-h-36">
<EmptyFillContainer><LanfFillUpcomingVehiclesInDashboard /></EmptyFillContainer>
</div>
<div className="grid grid-flow-row gap-4 md:grid-cols-8 grid-cols-1 w-full h-full">
<div className="md:col-span-2 min-h-36">
<EmptyFillContainer>CURRENT STORAGE</EmptyFillContainer>
<EmptyFillContainer className="flex md:flex-col justify-around md:justify-center md:gap-6 items-center max-h-min">
<div className="text-center color-black flex flex-col items-center justify-center gap-5">
{" "}
<div><b> STORAGE STATUS OF </b><br /><b>OF {(landfillData?.name)?.toUpperCase()} </b></div>
<div>
{" "}
<b>{landfillData?.graphData?.emptyPercentage}%</b> EMPTY
<br />
<b>{landfillData?.graphData?.fullPercentage}%</b> FULL
</div>
</div>
{(landfillData?.graphData?.empty !== undefined && landfillData?.graphData?.full !== undefined) ? <PieChart
// labels={["30% EMPTY", "70% FULL"]}
data={[
{ name: "30% EMPTY", value: (landfillData?.graphData?.empty), color: "rgb(121, 121, 121)" },
{ name: "70% FULL", value: (landfillData?.graphData?.full) , color: "rgb(0, 0, 0)" },
]}
withTooltip
// background={["rgb(121, 121, 121)", "rgb(0, 0, 0)"]}
/> : "loading..."}
</EmptyFillContainer>
</div>
<div className="md:col-span-6 min-h-36">
<EmptyFillContainer>PENDING BILLS</EmptyFillContainer>
<EmptyFillContainer><LanfFillUpcomingVehiclesInDashboard /></EmptyFillContainer>
</div>
<div className="md:col-span-8 min-h-36">
<EmptyFillContainer><PendingBillList /></EmptyFillContainer>
</div>

</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,111 +1,42 @@
"use client";
import GoogleMapComponent from "@/components/maps/GoogleMap";
import EmptyFillContainer from "../../cards/EmptyFillContainer";
import LanfFillUpcomingVehicles from "../../../dataTables/LandFillUpcomingVehicle";
import LandFillDeliveredVehicles from "../../../dataTables/LandFillDeliveredVehicles";
import { AllStsMapShow } from "@/components/maps/AllStsShow";
import { Button } from "@/components/ui/button";
import {
Card,
CardHeader,
CardTitle,
CardDescription,
CardContent,
CardFooter,
} from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
import { Cog, LogOut } from "lucide-react";


export default function LandfillManagerDumpEntries() {

return (

<main className="flex flex-1 flex-col gap-4 p-4 lg:gap-6 lg:p-6 max-h-[calc(100vh-60px)] overflow-scroll">
<div className="flex items-center hidden">
<h1 className="text-lg font-semibold md:text-2xl">SETTINGS</h1>
<div className="flex items-center justify-between">
<h1 className="text-lg font-semibold md:text-2xl">DUMP ENTRIES</h1>
<div className="flex-grow-1"></div>
<div className="flex gap-2">
<Button variant="ghost" size="sm" className="w-full text-md border shadow-lg py-4">
OUTGOING DUMP ENTRY
<LogOut size={20} className="ml-4" />
</Button>
</div>
</div>
<div className="flex flex-1 items-center justify-center md:justify-start rounded-lg border border-dashed shadow-sm md:px-10">
<div className="grid gap-12 lg:grid-cols-2 w-full h-full p-6">
{/* <h1 className="text-lg font-semibold md:text-2xl">ADD NEW DUMP ENTRY</h1> */}
<div className="flex flex-col justify-center items-center gap-4">
<h1 className="font-bold leading-none text-3xl tracking-tight">ADD STORAGE ENTRIES</h1>
<Card className="w-[95%]">
<CardHeader>
<CardTitle>Create project</CardTitle>
<CardDescription>
Deploy your new project in one-click.
</CardDescription>
</CardHeader>
<CardContent>
<form>
<div className="grid w-full items-center gap-4">
<div className="flex flex-col space-y-1.5">
<Label htmlFor="name">Name</Label>
<Input id="name" placeholder="Name of your project" />
</div>
<div className="flex flex-col space-y-1.5">
<Label htmlFor="framework">Framework</Label>
<Select>
<SelectTrigger id="framework">
<SelectValue placeholder="Select" />
</SelectTrigger>
<SelectContent position="popper">
<SelectItem value="next">Next.js</SelectItem>
<SelectItem value="sveltekit">SvelteKit</SelectItem>
<SelectItem value="astro">Astro</SelectItem>
<SelectItem value="nuxt">Nuxt.js</SelectItem>
</SelectContent>
</Select>
</div>
</div>
</form>
</CardContent>
<CardFooter className="flex justify-between">
<Button variant="outline">Cancel</Button>
<Button>Deploy</Button>
</CardFooter>
</Card>
</div>
<div className="flex flex-col justify-center items-center gap-4">
<h1 className="font-bold leading-none text-3xl tracking-tight">ADD DUMP ENTRIES</h1>
<Card className="w-[95%]">
<CardHeader>
<CardTitle>Create project</CardTitle>
<CardDescription>
Deploy your new project in one-click.
</CardDescription>
</CardHeader>
<CardContent>
<form>
<div className="grid w-full items-center gap-4">
<div className="flex flex-col space-y-1.5">
<Label htmlFor="name">Name</Label>
<Input id="name" placeholder="Name of your project" />
</div>
<div className="flex flex-col space-y-1.5">
<Label htmlFor="framework">Framework</Label>
<Select>
<SelectTrigger id="framework">
<SelectValue placeholder="Select" />
</SelectTrigger>
<SelectContent position="popper">
<SelectItem value="next">Next.js</SelectItem>
<SelectItem value="sveltekit">SvelteKit</SelectItem>
<SelectItem value="astro">Astro</SelectItem>
<SelectItem value="nuxt">Nuxt.js</SelectItem>
</SelectContent>
</Select>
</div>
</div>
</form>
</CardContent>
<CardFooter className="flex justify-between">
<Button variant="outline">Cancel</Button>
<Button>Deploy</Button>
</CardFooter>
</Card>
<div className="flex flex-1 items-center justify-center rounded-lg border border-dashed shadow-sm">
<div className="grid grid-cols-1 md:grid-cols-2 grid-rows-2 grid-flow-row gap-2 md:gap-4 w-full md:h-full max-h-max">
<div className="col-span-2 row-span-1 min-h-48">
<EmptyFillContainer>
<LanfFillUpcomingVehicles />
</EmptyFillContainer>
</div>
<div className="col-span-2 row-span-1 min-h-48">
<EmptyFillContainer>
<LandFillDeliveredVehicles />
</EmptyFillContainer>
</div>
</div>
</div>
</main>
);
);
}
Loading