t-paliad-030. Adds `/agenda` — a single page that merges every visible deadline and appointment into a day-grouped timeline, the third overview surface alongside Dashboard and the per-resource lists. - AgendaService: merges paliad.deadlines + paliad.appointments, gated by the same team-membership predicate used everywhere else; personal appointments stay creator-only. Items are sorted by date and tagged with urgency (overdue / today / tomorrow / this_week / later) so the client can apply the traffic-light colours without re-deriving buckets. - GET /api/agenda?from&to&types and GET /agenda with the same server-side hydration pattern as /dashboard (JSON payload spliced into the shell so the timeline paints on first frame). - Frontend: agenda.tsx + client/agenda.ts render a day-grouped timeline with type/range chips; filters round-trip through the URL. - Sidebar entry under "Übersicht"; DE+EN i18n across all new keys.
121 lines
5.8 KiB
TypeScript
121 lines
5.8 KiB
TypeScript
import { mkdir, cp, rm } from "fs/promises";
|
|
import { join } from "path";
|
|
import { renderIndex } from "./src/index";
|
|
import { renderLogin } from "./src/login";
|
|
import { renderKostenrechner } from "./src/kostenrechner";
|
|
import { renderFristenrechner } from "./src/fristenrechner";
|
|
import { renderDownloads } from "./src/downloads";
|
|
import { renderLinks } from "./src/links";
|
|
import { renderGlossary } from "./src/glossary";
|
|
import { renderGebuehrentabellen } from "./src/gebuehrentabellen";
|
|
import { renderChecklists } from "./src/checklists";
|
|
import { renderChecklistsDetail } from "./src/checklists-detail";
|
|
import { renderChecklistsInstance } from "./src/checklists-instance";
|
|
import { renderCourts } from "./src/courts";
|
|
import { renderProjects } from "./src/projects";
|
|
import { renderProjectsNew } from "./src/projects-new";
|
|
import { renderProjectsDetail } from "./src/projects-detail";
|
|
import { renderDeadlines } from "./src/deadlines";
|
|
import { renderDeadlinesNew } from "./src/deadlines-new";
|
|
import { renderDeadlinesDetail } from "./src/deadlines-detail";
|
|
import { renderDeadlinesCalendar } from "./src/deadlines-calendar";
|
|
import { renderAppointments } from "./src/appointments";
|
|
import { renderAppointmentsNew } from "./src/appointments-new";
|
|
import { renderAppointmentsDetail } from "./src/appointments-detail";
|
|
import { renderAppointmentsCalendar } from "./src/appointments-calendar";
|
|
import { renderSettings } from "./src/settings";
|
|
import { renderDashboard } from "./src/dashboard";
|
|
import { renderAgenda } from "./src/agenda";
|
|
import { renderOnboarding } from "./src/onboarding";
|
|
|
|
const DIST = join(import.meta.dir, "dist");
|
|
|
|
async function build() {
|
|
// Clean dist/
|
|
await rm(DIST, { recursive: true, force: true });
|
|
await mkdir(join(DIST, "assets"), { recursive: true });
|
|
|
|
// Bundle client-side JS
|
|
const result = await Bun.build({
|
|
entrypoints: [
|
|
join(import.meta.dir, "src/client/index.ts"),
|
|
join(import.meta.dir, "src/client/login.ts"),
|
|
join(import.meta.dir, "src/client/kostenrechner.ts"),
|
|
join(import.meta.dir, "src/client/fristenrechner.ts"),
|
|
join(import.meta.dir, "src/client/downloads.ts"),
|
|
join(import.meta.dir, "src/client/links.ts"),
|
|
join(import.meta.dir, "src/client/glossary.ts"),
|
|
join(import.meta.dir, "src/client/gebuehrentabellen.ts"),
|
|
join(import.meta.dir, "src/client/checklists.ts"),
|
|
join(import.meta.dir, "src/client/checklists-detail.ts"),
|
|
join(import.meta.dir, "src/client/checklists-instance.ts"),
|
|
join(import.meta.dir, "src/client/courts.ts"),
|
|
join(import.meta.dir, "src/client/projects.ts"),
|
|
join(import.meta.dir, "src/client/projects-new.ts"),
|
|
join(import.meta.dir, "src/client/projects-detail.ts"),
|
|
join(import.meta.dir, "src/client/deadlines.ts"),
|
|
join(import.meta.dir, "src/client/deadlines-new.ts"),
|
|
join(import.meta.dir, "src/client/deadlines-detail.ts"),
|
|
join(import.meta.dir, "src/client/deadlines-calendar.ts"),
|
|
join(import.meta.dir, "src/client/appointments.ts"),
|
|
join(import.meta.dir, "src/client/appointments-new.ts"),
|
|
join(import.meta.dir, "src/client/appointments-detail.ts"),
|
|
join(import.meta.dir, "src/client/appointments-calendar.ts"),
|
|
join(import.meta.dir, "src/client/settings.ts"),
|
|
join(import.meta.dir, "src/client/dashboard.ts"),
|
|
join(import.meta.dir, "src/client/agenda.ts"),
|
|
join(import.meta.dir, "src/client/onboarding.ts"),
|
|
],
|
|
outdir: join(DIST, "assets"),
|
|
naming: "[name].js",
|
|
minify: true,
|
|
});
|
|
|
|
if (!result.success) {
|
|
console.error("JS build failed:");
|
|
for (const log of result.logs) {
|
|
console.error(log);
|
|
}
|
|
process.exit(1);
|
|
}
|
|
|
|
// Copy CSS
|
|
await cp(
|
|
join(import.meta.dir, "src/styles/global.css"),
|
|
join(DIST, "assets/global.css"),
|
|
);
|
|
|
|
// Render HTML pages
|
|
await Bun.write(join(DIST, "index.html"), renderIndex());
|
|
await Bun.write(join(DIST, "login.html"), renderLogin("login.js"));
|
|
await Bun.write(join(DIST, "kostenrechner.html"), renderKostenrechner());
|
|
await Bun.write(join(DIST, "fristenrechner.html"), renderFristenrechner());
|
|
await Bun.write(join(DIST, "downloads.html"), renderDownloads());
|
|
await Bun.write(join(DIST, "links.html"), renderLinks());
|
|
await Bun.write(join(DIST, "glossary.html"), renderGlossary());
|
|
await Bun.write(join(DIST, "gebuehrentabellen.html"), renderGebuehrentabellen());
|
|
await Bun.write(join(DIST, "checklists.html"), renderChecklists());
|
|
await Bun.write(join(DIST, "checklists-detail.html"), renderChecklistsDetail());
|
|
await Bun.write(join(DIST, "checklists-instance.html"), renderChecklistsInstance());
|
|
await Bun.write(join(DIST, "courts.html"), renderCourts());
|
|
await Bun.write(join(DIST, "projects.html"), renderProjects());
|
|
await Bun.write(join(DIST, "projects-new.html"), renderProjectsNew());
|
|
await Bun.write(join(DIST, "projects-detail.html"), renderProjectsDetail());
|
|
await Bun.write(join(DIST, "deadlines.html"), renderDeadlines());
|
|
await Bun.write(join(DIST, "deadlines-new.html"), renderDeadlinesNew());
|
|
await Bun.write(join(DIST, "deadlines-detail.html"), renderDeadlinesDetail());
|
|
await Bun.write(join(DIST, "deadlines-calendar.html"), renderDeadlinesCalendar());
|
|
await Bun.write(join(DIST, "appointments.html"), renderAppointments());
|
|
await Bun.write(join(DIST, "appointments-new.html"), renderAppointmentsNew());
|
|
await Bun.write(join(DIST, "appointments-detail.html"), renderAppointmentsDetail());
|
|
await Bun.write(join(DIST, "appointments-calendar.html"), renderAppointmentsCalendar());
|
|
await Bun.write(join(DIST, "settings.html"), renderSettings());
|
|
await Bun.write(join(DIST, "dashboard.html"), renderDashboard());
|
|
await Bun.write(join(DIST, "agenda.html"), renderAgenda());
|
|
await Bun.write(join(DIST, "onboarding.html"), renderOnboarding());
|
|
|
|
console.log("Build complete \u2192 dist/");
|
|
}
|
|
|
|
build();
|