mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 11:44:40 +00:00
feat: submitted column + bug fixes
This commit is contained in:
@@ -335,6 +335,10 @@
|
||||
background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%);
|
||||
}
|
||||
|
||||
.column-submitted .column-header {
|
||||
background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
|
||||
}
|
||||
|
||||
.column-marked .column-header {
|
||||
background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%);
|
||||
}
|
||||
@@ -352,6 +356,10 @@
|
||||
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 {
|
||||
background: linear-gradient(135deg, var(--background-secondary) 0%, #065f46 100%);
|
||||
}
|
||||
|
||||
@@ -114,6 +114,7 @@ export function renderGrid(container: HTMLElement, data: any) {
|
||||
'UPCOMING': [] as any[],
|
||||
'DUE_SOON': [] as any[],
|
||||
'OVERDUE': [] as any[],
|
||||
'SUBMITTED': [] as any[],
|
||||
'MARKS_RELEASED': [] as any[]
|
||||
};
|
||||
|
||||
@@ -146,6 +147,12 @@ export function renderGrid(container: HTMLElement, data: any) {
|
||||
className: 'column-overdue',
|
||||
icon: '🚨'
|
||||
},
|
||||
{
|
||||
key: 'SUBMITTED',
|
||||
title: 'Submitted',
|
||||
className: 'column-submitted',
|
||||
icon: '📝'
|
||||
},
|
||||
{
|
||||
key: 'MARKS_RELEASED',
|
||||
title: 'Marked',
|
||||
@@ -155,14 +162,19 @@ export function renderGrid(container: HTMLElement, data: any) {
|
||||
];
|
||||
|
||||
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');
|
||||
columnParentEl.className = 'kanban-column-parent';
|
||||
|
||||
const columnEl = document.createElement('div');
|
||||
columnEl.className = `kanban-column ${column.className}`;
|
||||
|
||||
const assessmentList = statusGroups[column.key as keyof typeof statusGroups];
|
||||
|
||||
columnEl.innerHTML = /* html */`
|
||||
<div class="column-header">
|
||||
<div class="column-title">
|
||||
|
||||
@@ -41,19 +41,20 @@ export function determineStatus(item: any): string {
|
||||
return 'MARKS_RELEASED';
|
||||
}
|
||||
|
||||
// Check if submitted (awaiting marking)
|
||||
if (item.submitted) {
|
||||
return 'SUBMITTED';
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
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 diffDays = diffTime / (1000 * 60 * 60 * 24);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
// Check if overdue (more than 1 day past due)
|
||||
if (diffDays < -1) {
|
||||
// If it's submitted but still overdue, treat as DUE_SOON since it's awaiting marking
|
||||
if (item.submitted) {
|
||||
return 'DUE_SOON';
|
||||
}
|
||||
// Check if overdue (past due date, but not including today)
|
||||
if (diffDays < 0) {
|
||||
return 'OVERDUE';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user