refactor(dnd): remove drag-and-drop reorder for stories and tasks
- Remove reorderStoriesAction, reorderTasksAction, reorderSprintStoriesAction - Delete REST route app/api/stories/[id]/tasks/reorder/route.ts - Remove DnD from backlog story-panel and task-panel (flat list) - Remove reorder-within-sprint branch from sprint-board-client handleDragEnd - Switch SortableSprintRow to plain SprintRow using useDraggable (membership drag kept) - Remove all DnD from task-list (status toggle + edit kept) - Remove story-order/task-order/sprint-story-order/sprint-task-order mutation types and store handlers - Remove related tests for deleted reorder route; fix sprint store tests
This commit is contained in:
parent
b816cbe710
commit
f68d985c2c
16 changed files with 52 additions and 816 deletions
|
|
@ -852,56 +852,6 @@ describe('restore-hint flow — chain triggert na ensure*Loaded', () => {
|
|||
// ─────────────────────────────────────────────────────────────────────────
|
||||
|
||||
describe('optimistic mutations', () => {
|
||||
it('rollback herstelt vorige sprint-story-order', () => {
|
||||
useSprintWorkspaceStore.getState().hydrateSnapshot(
|
||||
snapshotWith(
|
||||
makeSprint({ id: 'sp-1', product_id: 'prod-1' }),
|
||||
[
|
||||
makeStory({ id: 'a', pbi_id: 'p', sprint_id: 'sp-1', sort_order: 1 }),
|
||||
makeStory({ id: 'b', pbi_id: 'p', sprint_id: 'sp-1', sort_order: 2 }),
|
||||
],
|
||||
),
|
||||
)
|
||||
const prevOrder = [
|
||||
...useSprintWorkspaceStore.getState().relations.storyIdsBySprint['sp-1'],
|
||||
]
|
||||
|
||||
const id = useSprintWorkspaceStore.getState().applyOptimisticMutation({
|
||||
kind: 'sprint-story-order',
|
||||
sprintId: 'sp-1',
|
||||
prevStoryIds: prevOrder,
|
||||
})
|
||||
useSprintWorkspaceStore.setState((s) => {
|
||||
s.relations.storyIdsBySprint['sp-1'] = ['b', 'a']
|
||||
})
|
||||
|
||||
useSprintWorkspaceStore.getState().rollbackMutation(id)
|
||||
expect(useSprintWorkspaceStore.getState().relations.storyIdsBySprint['sp-1']).toEqual(
|
||||
prevOrder,
|
||||
)
|
||||
expect(useSprintWorkspaceStore.getState().pendingMutations[id]).toBeUndefined()
|
||||
})
|
||||
|
||||
it('settle ruimt pending op zonder state te wijzigen', () => {
|
||||
useSprintWorkspaceStore.getState().hydrateSnapshot(
|
||||
snapshotWith(makeSprint({ id: 'sp-1', product_id: 'prod-1' }), [
|
||||
makeStory({ id: 'a', pbi_id: 'p', sprint_id: 'sp-1' }),
|
||||
]),
|
||||
)
|
||||
const id = useSprintWorkspaceStore.getState().applyOptimisticMutation({
|
||||
kind: 'sprint-story-order',
|
||||
sprintId: 'sp-1',
|
||||
prevStoryIds: ['a'],
|
||||
})
|
||||
expect(useSprintWorkspaceStore.getState().pendingMutations[id]).toBeDefined()
|
||||
|
||||
useSprintWorkspaceStore.getState().settleMutation(id)
|
||||
expect(useSprintWorkspaceStore.getState().pendingMutations[id]).toBeUndefined()
|
||||
expect(useSprintWorkspaceStore.getState().relations.storyIdsBySprint['sp-1']).toEqual([
|
||||
'a',
|
||||
])
|
||||
})
|
||||
|
||||
it('SSE-echo van een al-bestaande sprint is idempotent', () => {
|
||||
useSprintWorkspaceStore.setState((s) => {
|
||||
s.context.activeProduct = { id: 'prod-1', name: 'P' }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue