feat: submitted column + bug fixes

This commit is contained in:
SethBurkart123
2025-06-06 12:21:46 +10:00
parent c202af9688
commit a009f40ac2
3 changed files with 31 additions and 10 deletions
@@ -335,6 +335,10 @@
background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%); background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
} }
.column-submitted .column-header {
background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
}
.column-marked .column-header { .column-marked .column-header {
background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%); background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
} }
@@ -352,6 +356,10 @@
background: linear-gradient(135deg, var(--background-secondary) 0%, #991b1b 100%); background: linear-gradient(135deg, var(--background-secondary) 0%, #991b1b 100%);
} }
.dark .column-submitted .column-header {
background: linear-gradient(135deg, var(--background-secondary) 0%, #92400e 100%);
}
.dark .column-marked .column-header { .dark .column-marked .column-header {
background: linear-gradient(135deg, var(--background-secondary) 0%, #065f46 100%); background: linear-gradient(135deg, var(--background-secondary) 0%, #065f46 100%);
} }
+14 -2
View File
@@ -114,6 +114,7 @@ export function renderGrid(container: HTMLElement, data: any) {
'UPCOMING': [] as any[], 'UPCOMING': [] as any[],
'DUE_SOON': [] as any[], 'DUE_SOON': [] as any[],
'OVERDUE': [] as any[], 'OVERDUE': [] as any[],
'SUBMITTED': [] as any[],
'MARKS_RELEASED': [] as any[] 'MARKS_RELEASED': [] as any[]
}; };
@@ -146,6 +147,12 @@ export function renderGrid(container: HTMLElement, data: any) {
className: 'column-overdue', className: 'column-overdue',
icon: '🚨' icon: '🚨'
}, },
{
key: 'SUBMITTED',
title: 'Submitted',
className: 'column-submitted',
icon: '📝'
},
{ {
key: 'MARKS_RELEASED', key: 'MARKS_RELEASED',
title: 'Marked', title: 'Marked',
@@ -155,14 +162,19 @@ export function renderGrid(container: HTMLElement, data: any) {
]; ];
columns.forEach(column => { columns.forEach(column => {
const assessmentList = statusGroups[column.key as keyof typeof statusGroups];
// Skip SUBMITTED column if it's empty
if (column.key === 'SUBMITTED' && assessmentList.length === 0) {
return;
}
const columnParentEl = document.createElement('div'); const columnParentEl = document.createElement('div');
columnParentEl.className = 'kanban-column-parent'; columnParentEl.className = 'kanban-column-parent';
const columnEl = document.createElement('div'); const columnEl = document.createElement('div');
columnEl.className = `kanban-column ${column.className}`; columnEl.className = `kanban-column ${column.className}`;
const assessmentList = statusGroups[column.key as keyof typeof statusGroups];
columnEl.innerHTML = /* html */` columnEl.innerHTML = /* html */`
<div class="column-header"> <div class="column-header">
<div class="column-title"> <div class="column-title">
@@ -41,19 +41,20 @@ export function determineStatus(item: any): string {
return 'MARKS_RELEASED'; return 'MARKS_RELEASED';
} }
// Check if submitted (awaiting marking)
if (item.submitted) {
return 'SUBMITTED';
}
const now = new Date(); const now = new Date();
const due = new Date(item.due); const due = new Date(item.due);
// Calculate the difference in days (more precise calculation) // Calculate the difference in days (consistent with formatDate)
const diffTime = due.getTime() - now.getTime(); const diffTime = due.getTime() - now.getTime();
const diffDays = diffTime / (1000 * 60 * 60 * 24); const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
// Check if overdue (more than 1 day past due) // Check if overdue (past due date, but not including today)
if (diffDays < -1) { if (diffDays < 0) {
// If it's submitted but still overdue, treat as DUE_SOON since it's awaiting marking
if (item.submitted) {
return 'DUE_SOON';
}
return 'OVERDUE'; return 'OVERDUE';
} }