From 887e064ae988f6c2ae9bc241627184b068a7f53a Mon Sep 17 00:00:00 2001 From: Albrecht Degering Date: Mon, 20 Jul 2026 17:34:36 +0200 Subject: [PATCH] feat(scheduling): add a task-focused poll workspace --- webui/package.json | 4 + .../test-scheduling-page-structure.mjs | 34 + webui/src/api/scheduling.ts | 21 + .../features/scheduling/SchedulingPage.tsx | 1345 ++++++++++++----- webui/src/i18n/generatedTranslations.ts | 210 ++- webui/src/styles/scheduling.css | 538 +++++-- 6 files changed, 1658 insertions(+), 494 deletions(-) create mode 100644 webui/scripts/test-scheduling-page-structure.mjs diff --git a/webui/package.json b/webui/package.json index 7a64c66..694ed89 100644 --- a/webui/package.json +++ b/webui/package.json @@ -13,6 +13,10 @@ }, "./styles/scheduling.css": "./src/styles/scheduling.css" }, + "scripts": { + "test:view-model": "node --experimental-strip-types --test tests/scheduling-view-model.test.ts", + "test:ui-structure": "node scripts/test-scheduling-page-structure.mjs" + }, "peerDependencies": { "@govoplan/core-webui": "^0.1.8", "lucide-react": "^1.23.0", diff --git a/webui/scripts/test-scheduling-page-structure.mjs b/webui/scripts/test-scheduling-page-structure.mjs new file mode 100644 index 0000000..1135ad0 --- /dev/null +++ b/webui/scripts/test-scheduling-page-structure.mjs @@ -0,0 +1,34 @@ +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; + +const pagePath = fileURLToPath(new URL("../src/features/scheduling/SchedulingPage.tsx", import.meta.url)); +const apiPath = fileURLToPath(new URL("../src/api/scheduling.ts", import.meta.url)); +const page = readFileSync(pagePath, "utf8"); +const api = readFileSync(apiPath, "utf8"); + +assert.match(page, /usePlatformUiCapability\("calendar\.picker"\)/); +assert.match(page, /hasScope\(auth, "calendar:calendar:read"\)/); +assert.match(page, /Boolean\(calendarPickerCapability\) && canReadCalendars && canReadAvailability && canWriteCalendarEvent/); +assert.doesNotMatch(page, /@govoplan\/calendar-webui|govoplan-calendar\/webui/); +assert.match(page, /className="scheduling-full-editor"/); +assert.match(page, /className="scheduling-page-actions"/); + +const editorActions = page.slice( + page.indexOf('
'), + page.indexOf('
', page.indexOf('
')) +); +assert.ok(editorActions.indexOf("I18N.discard") < editorActions.indexOf("I18N.save")); +assert.match(page, /