Fix task creation to respect sprint selection dropdown
This commit is contained in:
parent
e10b99621e
commit
226e446f5f
@ -482,7 +482,7 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"lastUpdated": 1771551465295,
|
"lastUpdated": 1771551566326,
|
||||||
"sprints": [
|
"sprints": [
|
||||||
{
|
{
|
||||||
"name": "Sprint 1",
|
"name": "Sprint 1",
|
||||||
|
|||||||
@ -128,9 +128,9 @@ export default function Home() {
|
|||||||
...newTask,
|
...newTask,
|
||||||
projectId: selectedProjectId,
|
projectId: selectedProjectId,
|
||||||
status: newTask.status || "backlog",
|
status: newTask.status || "backlog",
|
||||||
sprintId: currentSprint?.id, // Auto-assign to current sprint
|
sprintId: newTask.sprintId || currentSprint?.id, // Use selected sprint or default to current
|
||||||
} as any)
|
} as any)
|
||||||
setNewTask({ title: "", description: "", type: "task", priority: "medium", status: "backlog", tags: [] })
|
setNewTask({ title: "", description: "", type: "task", priority: "medium", status: "backlog", tags: [], sprintId: undefined })
|
||||||
setNewTaskOpen(false)
|
setNewTaskOpen(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -495,9 +495,11 @@ export default function Home() {
|
|||||||
onChange={(e) => setNewTask({ ...newTask, sprintId: e.target.value || undefined })}
|
onChange={(e) => setNewTask({ ...newTask, sprintId: e.target.value || undefined })}
|
||||||
className="w-full mt-1.5 px-3 py-2 bg-slate-800 border border-slate-700 rounded-lg text-white focus:outline-none focus:border-blue-500"
|
className="w-full mt-1.5 px-3 py-2 bg-slate-800 border border-slate-700 rounded-lg text-white focus:outline-none focus:border-blue-500"
|
||||||
>
|
>
|
||||||
<option value="">No Sprint</option>
|
<option value="">Auto (Current Sprint)</option>
|
||||||
{sprints.filter(s => s.projectId === selectedProjectId).map((sprint) => (
|
{sprints.sort((a, b) => new Date(a.startDate).getTime() - new Date(b.startDate).getTime()).map((sprint) => (
|
||||||
<option key={sprint.id} value={sprint.id}>{sprint.name}</option>
|
<option key={sprint.id} value={sprint.id}>
|
||||||
|
{sprint.name} ({new Date(sprint.startDate).toLocaleDateString()})
|
||||||
|
</option>
|
||||||
))}
|
))}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user