feat: calendar subscription web UI (Slice 4B of calendar sync payload) #249
No reviewers
Labels
No labels
agent:hermes
bug
chore
dependency
feature
status:blocked
status:in-progress
status:needs-info
status:needs-review
status:ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
owlburtoe/Shiftd!249
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "worktree-feat+calendar-sync-slice-4b-web-ui"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Slice 4B of the Calendar Sync Payload enrichment (spec Section C, "Settings UI"). Frontend web UI for the staff calendar subscription. Builds on merged Slice 4A (#246, backend token model + ICS feed + dept-scoped subscription endpoints).
What it adds
UserProfileTab, after Role & Assignment):navigator.clipboard+ success/error toast).webcal://scheme so calendar apps add the feed directly.AlertDialogwith the exact spec confirmation copy: "Existing calendar subscriptions will stop syncing. You'll need to re-add the URL to each calendar app."CalendarSubscriptionCard.tsxfollows the repo'sFacilityAddressSectionpattern: pure exported helpers (toWebcalUrl,getCalendarSubscriptionErrorMessage,CALENDAR_REGENERATE_WARNING) + a presentationalCalendarSubscriptionView+ a thin data container (useQuery/useMutation, clipboard, toasts). Regenerate writes the new URL straight into the query cache.api.ts:fetchCalendarSubscriptionUrl/regenerateCalendarSubscriptionUrlhitting the 4A endpoints via the existing dept-scoped path auto-rewrite (/api/staff/me/...→/api/d/{slug}/staff/me/...).Scope
Frontend-only. No schema, migration, or OpenAPI change (4A already added the
CalendarSubscriptionschema + the three operations).Testing — all green
CalendarSubscriptionCard.test.tsx(12):toWebcalUrl(https/http/already-webcal/empty), exact warning constant, error mapping (403 → permission / generic / fallback), and the presentational view (URL input,webcal://href derivation, loading hides URL, Copy + Regenerate present). Pure-helper + headlessrenderToStaticMarkupstyle, no jsdom — matches the repo convention.pnpm check-typesclean;pnpm check:url-generationclean; eslint clean on changed files.Slice 4C (iOS subscription UI) is the remaining sibling; it also depends only on 4A and is independent of this PR.