feat(PBI-79/ST-1334): user-settings pendingSprintDraft-slot
- lib/user-settings.ts: nieuw workflow.pendingSprintDraft veld met compacte intent-shape (pbiIntent + per-PBI storyOverrides). - actions/sprint-draft.ts: setPendingSprintDraftAction + clearPendingSprintDraftAction met product-membership-check + Zod-validatie. - stores/user-settings/store.ts: setPendingSprintDraft / clearPendingSprintDraft optimistic acties + fine-grained mutators upsertPbiIntent / upsertStoryOverride. Sprint-draft actions worden dynamisch geïmporteerd zodat jsdom-tests zonder DATABASE_URL niet falen. - Tests: nieuwe sprint-draft.test.ts (action-laag), uitbreiding user-settings store-tests (5 nieuwe cases) en schema-tests (4 cases). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
2af6f24598
commit
56c55e1813
6 changed files with 636 additions and 0 deletions
|
|
@ -48,13 +48,36 @@ const LayoutPrefs = z.object({
|
|||
activeSprints: z.record(z.string(), z.string().nullable()).optional(),
|
||||
}).strict()
|
||||
|
||||
const PbiIntent = z.enum(['all', 'none'])
|
||||
|
||||
const StoryOverrides = z.object({
|
||||
add: z.array(z.string()),
|
||||
remove: z.array(z.string()),
|
||||
}).strict()
|
||||
|
||||
const PendingSprintDraftSchema = z.object({
|
||||
goal: z.string().min(1),
|
||||
startAt: z.string().datetime().optional(),
|
||||
endAt: z.string().datetime().optional(),
|
||||
pbiIntent: z.record(z.string(), PbiIntent).default({}),
|
||||
storyOverrides: z.record(z.string(), StoryOverrides).default({}),
|
||||
}).strict()
|
||||
|
||||
const WorkflowPrefs = z.object({
|
||||
pendingSprintDraft: z.record(z.string(), PendingSprintDraftSchema).optional(),
|
||||
}).strict()
|
||||
|
||||
export const UserSettingsSchema = z.object({
|
||||
views: ViewsPrefs.optional(),
|
||||
devTools: DevToolsPrefs.optional(),
|
||||
layout: LayoutPrefs.optional(),
|
||||
workflow: WorkflowPrefs.optional(),
|
||||
}).strict()
|
||||
|
||||
export type UserSettings = z.infer<typeof UserSettingsSchema>
|
||||
export type PendingSprintDraft = z.infer<typeof PendingSprintDraftSchema>
|
||||
export type PbiIntent = z.infer<typeof PbiIntent>
|
||||
export type StoryOverrides = z.infer<typeof StoryOverrides>
|
||||
|
||||
export const DEFAULT_USER_SETTINGS: UserSettings = {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue