Keep a note on the overview until somebody ticks it off
A note with a follow-up date is a task, and the overview is where tasks are looked for. Until now it lived only in the employee file, which is the one place you go when you already know who you are looking for. Follow-ups behave differently from everything else on that card, and the difference is the point: an entry on Monday is over on Tuesday, an unfinished task is not. So there is no lower bound on the date — what was due and never ticked off stays, marked overdue in red, sorted to the top because it is sorted by date. A task that drops out of the list by itself is a forgotten task. Only "Erledigt" removes it. A note without a follow-up date never appears: it is a record, not a task. Checked against the live database — an overdue one and an upcoming one appear, one without a date and one beyond the chosen period do not, and ticking the overdue one off removes exactly it. The probe notes were deleted again. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,6 +102,24 @@ export async function loadDashboardData(tx: Tx, p: DashboardParams) {
|
||||
.where((e) => e.lit(zeigt("return")))
|
||||
).as("upcomingReturns"),
|
||||
|
||||
// Wiedervorlagen. Sie verhalten sich anders als der Rest dieser Karte:
|
||||
// ein Eintritt am Montag ist am Dienstag vorbei, eine Wiedervorlage
|
||||
// nicht. Deshalb gibt es hier **keine untere Grenze** — was fällig war
|
||||
// und nicht abgehakt wurde, bleibt stehen, bis jemand „Erledigt" klickt.
|
||||
// Eine Aufgabe, die von selbst aus der Liste rutscht, ist eine
|
||||
// vergessene Aufgabe.
|
||||
jsonArrayFrom(
|
||||
eb
|
||||
.selectFrom("employee_notes as n")
|
||||
.innerJoin("employees as e", "e.id", "n.employee_id")
|
||||
.select(["n.id", "n.employee_id", "n.due_date", "n.category", "n.note_text", "e.first_name", "e.last_name"])
|
||||
.where("n.done", "=", false)
|
||||
.where("n.due_date", "is not", null)
|
||||
.where("n.due_date", "<=", bisIso)
|
||||
.where((x) => x.lit(zeigt("note")))
|
||||
.orderBy("n.due_date")
|
||||
).as("upcomingNotes"),
|
||||
|
||||
jsonArrayFrom(
|
||||
eb
|
||||
.selectFrom("employee_history as h")
|
||||
@@ -135,6 +153,7 @@ export async function loadDashboardData(tx: Tx, p: DashboardParams) {
|
||||
upcomingHires: g.upcomingHires,
|
||||
upcomingExits: g.upcomingExits,
|
||||
upcomingReturns: g.upcomingReturns,
|
||||
upcomingNotes: g.upcomingNotes,
|
||||
history: g.history,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ export const ANSTEHEND_ARTEN = [
|
||||
{ value: "hire", label: "Eintritt" },
|
||||
{ value: "exit", label: "Austritt" },
|
||||
{ value: "return", label: "Rückkehr" },
|
||||
{ value: "note", label: "Wiedervorlage" },
|
||||
] as const;
|
||||
|
||||
export type AnstehendArt = (typeof ANSTEHEND_ARTEN)[number]["value"];
|
||||
|
||||
Reference in New Issue
Block a user