Show each sprint as separate section ordered by date
This commit is contained in:
parent
bbde17ec11
commit
e10b99621e
@ -482,7 +482,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lastUpdated": 1771546378027,
|
"lastUpdated": 1771551465295,
|
||||||
"sprints": [
|
"sprints": [
|
||||||
{
|
{
|
||||||
"name": "Sprint 1",
|
"name": "Sprint 1",
|
||||||
@ -494,6 +494,26 @@
|
|||||||
"sprintId": "sprint-1",
|
"sprintId": "sprint-1",
|
||||||
"id": "sprint-1",
|
"id": "sprint-1",
|
||||||
"createdAt": "2026-02-16T00:00:00.000Z"
|
"createdAt": "2026-02-16T00:00:00.000Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Sprint 2",
|
||||||
|
"goal": "",
|
||||||
|
"startDate": "2026-02-23",
|
||||||
|
"endDate": "2026-03-01",
|
||||||
|
"status": "planning",
|
||||||
|
"projectId": "1",
|
||||||
|
"id": "1771551323429",
|
||||||
|
"createdAt": "2026-02-20T01:35:23.429Z"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Sprint 3",
|
||||||
|
"goal": "",
|
||||||
|
"startDate": "2026-03-02",
|
||||||
|
"endDate": "2026-03-08",
|
||||||
|
"status": "planning",
|
||||||
|
"projectId": "1",
|
||||||
|
"id": "1771551465241",
|
||||||
|
"createdAt": "2026-02-20T01:37:45.241Z"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -189,7 +189,6 @@ export function BacklogView() {
|
|||||||
const [activeId, setActiveId] = useState<string | null>(null)
|
const [activeId, setActiveId] = useState<string | null>(null)
|
||||||
const [openSections, setOpenSections] = useState<Record<string, boolean>>({
|
const [openSections, setOpenSections] = useState<Record<string, boolean>>({
|
||||||
current: true,
|
current: true,
|
||||||
other: false,
|
|
||||||
backlog: true,
|
backlog: true,
|
||||||
})
|
})
|
||||||
const [isCreatingSprint, setIsCreatingSprint] = useState(false)
|
const [isCreatingSprint, setIsCreatingSprint] = useState(false)
|
||||||
@ -226,10 +225,6 @@ export function BacklogView() {
|
|||||||
? tasks.filter((t) => t.sprintId === currentSprint.id)
|
? tasks.filter((t) => t.sprintId === currentSprint.id)
|
||||||
: []
|
: []
|
||||||
|
|
||||||
const otherSprintsTasks = otherSprints.flatMap((sprint) =>
|
|
||||||
tasks.filter((t) => t.sprintId === sprint.id)
|
|
||||||
)
|
|
||||||
|
|
||||||
const backlogTasks = tasks.filter((t) => !t.sprintId)
|
const backlogTasks = tasks.filter((t) => !t.sprintId)
|
||||||
|
|
||||||
// Get active task for drag overlay
|
// Get active task for drag overlay
|
||||||
@ -310,18 +305,31 @@ export function BacklogView() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Other Sprints Section */}
|
{/* Other Sprints Sections - ordered by start date */}
|
||||||
{otherSprints.length > 0 && (
|
{otherSprints
|
||||||
<div id="other">
|
.sort((a, b) => new Date(a.startDate).getTime() - new Date(b.startDate).getTime())
|
||||||
<TaskSection
|
.map((sprint) => {
|
||||||
title="Other Sprints"
|
const sprintTasks = tasks.filter((t) => t.sprintId === sprint.id)
|
||||||
tasks={otherSprintsTasks}
|
return (
|
||||||
isOpen={openSections.other}
|
<div key={sprint.id} id={`sprint-${sprint.id}`}>
|
||||||
onToggle={() => toggleSection("other")}
|
<TaskSection
|
||||||
onTaskClick={(task) => selectTask(task.id)}
|
title={sprint.name}
|
||||||
/>
|
tasks={sprintTasks}
|
||||||
</div>
|
isOpen={openSections[sprint.id] ?? false}
|
||||||
)}
|
onToggle={() => toggleSection(sprint.id)}
|
||||||
|
onTaskClick={(task) => selectTask(task.id)}
|
||||||
|
sprintInfo={{
|
||||||
|
name: sprint.name,
|
||||||
|
date: `${format(new Date(sprint.startDate), "MMM d")} - ${format(
|
||||||
|
new Date(sprint.endDate),
|
||||||
|
"MMM d"
|
||||||
|
)}`,
|
||||||
|
status: sprint.status,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
})}
|
||||||
|
|
||||||
{/* Create Sprint Button */}
|
{/* Create Sprint Button */}
|
||||||
{!isCreatingSprint ? (
|
{!isCreatingSprint ? (
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user