Updated api usage, corrected table designs

This commit is contained in:
2026-09-27 13:31:27 +02:00
parent 2efd2859c7
commit c1c5641d1e
11 changed files with 13413 additions and 3582 deletions
@@ -534,28 +534,28 @@ export const ChangeManagementPage: React.FC = () => {
</div>
</div>
<div className="bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden">
<div className="bg-[#0f1523]/80 rounded-2xl border border-slate-800/80 shadow-lg backdrop-blur-sm overflow-hidden">
<div className="overflow-x-auto">
<table className="w-full text-left border-collapse">
<table className="w-full text-left text-xs border-collapse">
<thead>
<tr className="border-b border-slate-800/80 bg-slate-900/50 text-[11px] font-semibold text-slate-400 uppercase tracking-wider">
<SortableTh column="title" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort}>
<tr className="bg-[#0d121f]/95 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold text-[11px]">
<SortableTh column="title" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort} className="py-3.5 px-5 whitespace-nowrap">
Issue Summary
</SortableTh>
<SortableTh column="priority" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort}>
<SortableTh column="priority" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort} className="py-3.5 px-4 whitespace-nowrap">
Priority
</SortableTh>
<SortableTh column="assignedTo" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort}>
<SortableTh column="assignedTo" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort} className="py-3.5 px-4 whitespace-nowrap">
Assigned To
</SortableTh>
<SortableTh column="status" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort}>
<SortableTh column="status" currentColumn={issueSortCol} direction={issueSortDir} onSort={handleIssueSort} className="py-3.5 px-4 whitespace-nowrap">
Status
</SortableTh>
<th className="py-3 px-4">Resolution Notes</th>
<th className="py-3 px-4 text-right">Actions</th>
<th className="py-3.5 px-4 font-semibold whitespace-nowrap">Resolution Notes</th>
<th className="py-3.5 px-5 text-right font-medium whitespace-nowrap">Actions</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/60 text-xs">
<tbody className="divide-y divide-slate-800/60">
{loadingIssues ? (
<tr>
<td colSpan={6} className="py-12 text-center text-slate-400">
@@ -575,8 +575,8 @@ export const ChangeManagementPage: React.FC = () => {
sortedIssues.map((iss) => {
const isResolved = iss.status === ActivityStatus.Inactive || !!iss.resolvedAt;
return (
<tr key={iss.id} className="hover:bg-slate-800/30 transition">
<td className="py-3.5 px-4 font-semibold text-white">
<tr key={iss.id} className="hover:bg-slate-800/40 transition-colors">
<td className="py-3.5 px-5 font-semibold text-white">
<div className="flex items-start gap-2.5">
<AlertOctagon
className={`w-4 h-4 mt-0.5 shrink-0 ${isResolved ? 'text-emerald-400' : 'text-rose-400'}`}
@@ -587,14 +587,14 @@ export const ChangeManagementPage: React.FC = () => {
</div>
</div>
</td>
<td className="py-3.5 px-4">{getPriorityBadge(iss.priority)}</td>
<td className="py-3.5 px-4 text-slate-300">
<td className="py-3.5 px-4 whitespace-nowrap">{getPriorityBadge(iss.priority)}</td>
<td className="py-3.5 px-4 whitespace-nowrap text-slate-300">
<div className="flex items-center gap-1.5">
<User className="w-3.5 h-3.5 text-slate-400" />
<span className="truncate max-w-[150px]">{iss.assignedTo ? getUserEmail(iss.assignedTo) : 'Unassigned'}</span>
</div>
</td>
<td className="py-3.5 px-4">
<td className="py-3.5 px-4 whitespace-nowrap">
{isResolved ? (
<span className="inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-[11px] font-semibold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20">
<CheckCircle2 className="w-3 h-3" /> Resolved
@@ -608,7 +608,7 @@ export const ChangeManagementPage: React.FC = () => {
<td className="py-3.5 px-4 text-slate-400 max-w-xs truncate">
{iss.resolution || <span className="italic text-slate-600">Pending resolution...</span>}
</td>
<td className="py-3.5 px-4 text-right space-x-2">
<td className="py-3.5 px-5 text-right whitespace-nowrap space-x-2">
<button
onClick={() => openResolveIssue(iss)}
className="px-2.5 py-1 text-xs font-medium text-amber-400 hover:text-amber-300 bg-amber-950/40 hover:bg-amber-900/40 rounded-lg border border-amber-800/40 transition cursor-pointer"
@@ -733,27 +733,27 @@ export const ChangeManagementPage: React.FC = () => {
</div>
</div>
<div className="bg-[#0f1523]/80 backdrop-blur-md rounded-2xl border border-slate-800/80 shadow-xl overflow-hidden">
<div className="bg-[#0f1523]/80 rounded-2xl border border-slate-800/80 shadow-lg backdrop-blur-sm overflow-hidden">
<div className="overflow-x-auto">
<table className="w-full text-left border-collapse">
<table className="w-full text-left text-xs border-collapse">
<thead>
<tr className="border-b border-slate-800/80 bg-slate-900/50 text-[11px] font-semibold text-slate-400 uppercase tracking-wider">
<SortableTh column="title" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort}>
<tr className="bg-[#0d121f]/95 border-b border-slate-800/80 text-slate-400 uppercase tracking-wider font-semibold text-[11px]">
<SortableTh column="title" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort} className="py-3.5 px-5 whitespace-nowrap">
Change Proposal
</SortableTh>
<SortableTh column="justification" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort}>
<SortableTh column="justification" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort} className="py-3.5 px-4 whitespace-nowrap">
Justification
</SortableTh>
<SortableTh column="revisedBudget" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort}>
<SortableTh column="revisedBudget" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort} className="py-3.5 px-4 whitespace-nowrap">
Revised Budget
</SortableTh>
<SortableTh column="status" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort}>
<SortableTh column="status" currentColumn={changeSortCol} direction={changeSortDir} onSort={handleChangeSort} className="py-3.5 px-4 whitespace-nowrap">
Governance Status
</SortableTh>
<th className="py-3 px-4 text-right">In-Place Decision</th>
<th className="py-3.5 px-5 text-right font-medium whitespace-nowrap">In-Place Decision</th>
</tr>
</thead>
<tbody className="divide-y divide-slate-800/60 text-xs">
<tbody className="divide-y divide-slate-800/60">
{loadingChanges ? (
<tr>
<td colSpan={5} className="py-12 text-center text-slate-400">
@@ -771,8 +771,8 @@ export const ChangeManagementPage: React.FC = () => {
</tr>
) : (
sortedChanges.map((cr) => (
<tr key={cr.id} className="hover:bg-slate-800/30 transition">
<td className="py-3.5 px-4 font-semibold text-white">
<tr key={cr.id} className="hover:bg-slate-800/40 transition-colors">
<td className="py-3.5 px-5 whitespace-nowrap font-semibold text-white">
<div className="flex items-center gap-2">
<GitPullRequest className="w-4 h-4 text-amber-400 shrink-0" />
<span>{cr.title}</span>
@@ -781,11 +781,11 @@ export const ChangeManagementPage: React.FC = () => {
<td className="py-3.5 px-4 text-slate-300 max-w-xs truncate" title={cr.justification || ''}>
{cr.justification || 'None'}
</td>
<td className="py-3.5 px-4 font-mono font-semibold text-slate-200">
<td className="py-3.5 px-4 whitespace-nowrap font-mono font-semibold text-slate-200">
{formatZAR(cr.revisedBudget || 0)}
</td>
<td className="py-3.5 px-4">{getApprovalStatusBadge(cr.status)}</td>
<td className="py-3.5 px-4 text-right space-x-2">
<td className="py-3.5 px-4 whitespace-nowrap">{getApprovalStatusBadge(cr.status)}</td>
<td className="py-3.5 px-5 text-right whitespace-nowrap space-x-2">
{cr.status === ApprovalStatus.Approved ? (
<span className="text-xs font-semibold text-emerald-400 bg-emerald-500/10 px-2.5 py-1 rounded-lg border border-emerald-500/20">
Resolved & Enacted