Refactored UI

Added Role filed to user table and endpoint implementation
This commit is contained in:
2026-09-28 10:25:00 +02:00
parent 7037ea72ca
commit ea71e55e2d
21 changed files with 3100 additions and 128 deletions
@@ -29,6 +29,7 @@ import {
} from '../services/api';
import { Modal } from '../components/ui/Modal';
import { useToast } from '../components/ui/Toast';
import { HelpTooltip } from '../components/ui/HelpTooltip';
import { ExportButton } from '../components/ui/ExportButton';
import { ExportColumn } from '../utils/exportUtils';
import { useTableSort, SortableTh } from '../utils/tableSort';
@@ -195,10 +196,18 @@ export const SiteVisitsPage: React.FC = () => {
<MapPin className="w-6 h-6" />
</div>
<div>
<h1 className="text-2xl sm:text-3xl font-bold tracking-tight text-white flex items-center gap-2.5">
Site Visits & Field Verification
</h1>
<p className="text-xs sm:text-sm text-slate-400">
<div className="flex items-center gap-2.5 flex-wrap">
<h1 className="text-2xl sm:text-3xl font-bold tracking-tight text-white flex items-center gap-2.5">
Site Visits & Field Verification
</h1>
<HelpTooltip
title="Field Inspection & Verification"
content="Log physical site inspection reports, track verified evidence, document findings, and record governance approvals."
size="sm"
placement="bottom"
/>
</div>
<p className="text-xs sm:text-sm text-slate-400 mt-1">
Log physical inspection reports, record field findings, and capture project feedback.
</p>
</div>
@@ -210,7 +219,14 @@ export const SiteVisitsPage: React.FC = () => {
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<div className="bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl space-y-2">
<div className="flex items-center justify-between text-slate-400">
<span className="text-xs font-semibold uppercase tracking-wider">Total Site Visits</span>
<div className="flex items-center gap-1.5">
<span className="text-xs font-semibold uppercase tracking-wider">Total Site Visits</span>
<HelpTooltip
title="Total Site Visits"
content="Total number of physical on-site inspection visits recorded across all projects."
size="sm"
/>
</div>
<MapPin className="w-4 h-4 text-emerald-400" />
</div>
<p className="text-2xl font-bold text-white">{siteVisits.length}</p>
@@ -219,7 +235,14 @@ export const SiteVisitsPage: React.FC = () => {
<div className="bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl space-y-2">
<div className="flex items-center justify-between text-slate-400">
<span className="text-xs font-semibold uppercase tracking-wider">Approved Reports</span>
<div className="flex items-center gap-1.5">
<span className="text-xs font-semibold uppercase tracking-wider">Approved Reports</span>
<HelpTooltip
title="Approved Inspection Reports"
content="Field inspection reports formally approved and verified by project governance."
size="sm"
/>
</div>
<CheckCircle2 className="w-4 h-4 text-teal-400" />
</div>
<p className="text-2xl font-bold text-teal-400">
@@ -230,7 +253,14 @@ export const SiteVisitsPage: React.FC = () => {
<div className="bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl space-y-2">
<div className="flex items-center justify-between text-slate-400">
<span className="text-xs font-semibold uppercase tracking-wider">Under Review</span>
<div className="flex items-center gap-1.5">
<span className="text-xs font-semibold uppercase tracking-wider">Under Review</span>
<HelpTooltip
title="Pending Sign-Off"
content="Inspection findings and reports currently awaiting governance evaluation."
size="sm"
/>
</div>
<FileText className="w-4 h-4 text-amber-400" />
</div>
<p className="text-2xl font-bold text-amber-400">
@@ -241,7 +271,14 @@ export const SiteVisitsPage: React.FC = () => {
<div className="bg-[#0f1523]/80 backdrop-blur-md p-5 rounded-2xl border border-slate-800/80 shadow-xl space-y-2">
<div className="flex items-center justify-between text-slate-400">
<span className="text-xs font-semibold uppercase tracking-wider">Audited Projects</span>
<div className="flex items-center gap-1.5">
<span className="text-xs font-semibold uppercase tracking-wider">Audited Projects</span>
<HelpTooltip
title="Audited Projects"
content="Projects with registered physical site monitoring records and active inspection history."
size="sm"
/>
</div>
<Building className="w-4 h-4 text-blue-400" />
</div>
<p className="text-2xl font-bold text-blue-400">{projects.length}</p>