feature to be able to filter project boards by milestones (#36321)
This pull request adds milestone filtering support to both repository and organization project boards. Users can now filter project issues by milestone, similar to how they filter by label or assignee. The implementation includes backend changes to fetch and filter milestones, as well as frontend updates to display a milestone filter dropdown in the project board UI. **Milestone filtering support:** * Added support for filtering project board issues by milestone in both repository and organization contexts, including handling for "no milestone" and "all milestones" options. (`routers/web/repo/projects.go` [[1]](diffhunk://#diff-5cba331a1ddf1eea017178cfefaaff9ad72a4b05797fb84bf508b0939aae2972R316-R330) [[2]](diffhunk://#diff-5cba331a1ddf1eea017178cfefaaff9ad72a4b05797fb84bf508b0939aae2972R421-R441); `routers/web/org/projects.go` [[3]](diffhunk://#diff-f4279417070a8e33829c338abeb42877500377f490abb1495ae6357d50b6a765R344-R357) [[4]](diffhunk://#diff-f4279417070a8e33829c338abeb42877500377f490abb1495ae6357d50b6a765R433-R485) * Updated the project board template to include a milestone filter dropdown, displaying open and closed milestones and integrating with the query string for filtering. (`templates/projects/view.tmpl` [[1]](diffhunk://#diff-e2c7e14d247ce381c352263a8fa639b8341690ff85f6dbebfa166ee3306542feL8-R8) [[2]](diffhunk://#diff-e2c7e14d247ce381c352263a8fa639b8341690ff85f6dbebfa166ee3306542feR19-R58) Solves Issue #35224 --------- Signed-off-by: josetduarte <6619440+josetduarte@users.noreply.github.com> Co-authored-by: joseduarte <joseduarte@aidhound.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -24,6 +24,18 @@ func (milestones MilestoneList) getMilestoneIDs() []int64 {
|
||||
return ids
|
||||
}
|
||||
|
||||
// SplitByOpenClosed splits the milestone list into open and closed milestones
|
||||
func (milestones MilestoneList) SplitByOpenClosed() (open, closed MilestoneList) {
|
||||
for _, m := range milestones {
|
||||
if m.IsClosed {
|
||||
closed = append(closed, m)
|
||||
} else {
|
||||
open = append(open, m)
|
||||
}
|
||||
}
|
||||
return open, closed
|
||||
}
|
||||
|
||||
// FindMilestoneOptions contain options to get milestones
|
||||
type FindMilestoneOptions struct {
|
||||
db.ListOptions
|
||||
|
||||
Reference in New Issue
Block a user