Add epic filter to kanban board
- Add epicId filter to KanbanFilterOptions - Filter issues by parent epic when epicId is set - Add epic dropdown to kanban controls with title-first format - Pass epics list from kanban page to controls
This commit is contained in:
parent
2cfaa9b406
commit
74871545c7
3 changed files with 28 additions and 0 deletions
|
|
@ -11,6 +11,7 @@ export interface KanbanFilterOptions {
|
|||
type?: string;
|
||||
priority?: string;
|
||||
showClosed?: boolean;
|
||||
epicId?: string;
|
||||
}
|
||||
|
||||
export interface KanbanStats {
|
||||
|
|
@ -123,6 +124,7 @@ export function filterKanbanIssues(issues: BeadIssue[], filters: KanbanFilterOpt
|
|||
const type = (filters.type ?? '').trim().toLowerCase();
|
||||
const priority = (filters.priority ?? '').trim();
|
||||
const showClosed = filters.showClosed ?? false;
|
||||
const epicId = filters.epicId?.trim();
|
||||
|
||||
return issues.filter((issue) => {
|
||||
if (!showClosed && issue.status === 'closed') {
|
||||
|
|
@ -144,6 +146,15 @@ export function filterKanbanIssues(issues: BeadIssue[], filters: KanbanFilterOpt
|
|||
return false;
|
||||
}
|
||||
|
||||
if (epicId) {
|
||||
// Filter to show only tasks belonging to this epic
|
||||
const parentDep = issue.dependencies.find((dep) => dep.type === 'parent');
|
||||
const issueEpicId = parentDep?.target ?? (issue.id.includes('.') ? issue.id.split('.')[0] : null);
|
||||
if (issueEpicId !== epicId) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue