Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Milestone filter for closed issues shows only closed milestones #22411

Closed
achikhv opened this issue Jan 12, 2023 · 2 comments · Fixed by #22423
Closed

Milestone filter for closed issues shows only closed milestones #22411

achikhv opened this issue Jan 12, 2023 · 2 comments · Fixed by #22423
Labels
Milestone

Comments

@achikhv
Copy link

achikhv commented Jan 12, 2023

Description

The issue is somehow related to #11924

We started to use gitea issues and noticed some behavior that could be a bug. It seems that closed issue list allows to filter only by closed milestones. Current opened milestones are not listed there.

Suppose I have pending milestone, which is only partly done. I cannot see which issues are completed from the issue list. Instead I must go to milestones and click on "Closed" link. It's a little bit confusing. I think that filtering closed issues by pending opened milestones is a common operation and should be available.

Please see test issues. Milestones filter is disabled, as there are no closed milestones.
https://try.gitea.io/achikhv/test/issues?q=&type=all&sort=&state=closed&labels=&milestone=0&assignee=0&poster=0

Gitea Version

1.18.0

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Downloaded windows binary and started as windows service.

Database

MSSQL

@lunny lunny added this to the 1.18.1 milestone Jan 12, 2023
@lunny lunny modified the milestones: 1.18.1, 1.18.2, 1.18.3 Jan 18, 2023
@jolheiser jolheiser modified the milestones: 1.18.3, 1.18.4 Jan 23, 2023
@lunny lunny modified the milestones: 1.18.4, 1.18.5 Feb 19, 2023
@delvh delvh modified the milestones: 1.18.5, 1.18.6 Feb 22, 2023
@BElluu
Copy link
Contributor

BElluu commented Apr 1, 2023

Hi,
I think the problem is that there is no value in the closed issues tab in variable .Milestones in /templates/repo/issue/list.tmpl
I can disable condition to enable Milestone dropdown (red underscore) but still in this droplist are not any milestone.
.Milestones must be empty (orange underscore). I do not find why yet.
image

@BElluu
Copy link
Contributor

BElluu commented Apr 1, 2023

Hi,
After 2 hours I found how it works and why :)
Everything is because of state. When we are on Open tab our state=open and we see only open milestones. When we are on Closed tab our state=closed and we can see only closed milestones. Milestone filter is disabled when you do not have any milestone in a given state - in the case presented by the author of the issue - closed milestone. If you have at least one, it will be enabled. But it's still not good, because we want to filter closed issues by open milestones.

Problem is in model/issues/milestones.go
image

where we have filtering by is_closed depends on state.

In /routers/web/repo/issue.go we pass state, so we can chage it to all
image

With all we can filter open and closed issues by all milestones (open and closed) + milestones tab still works ok.

Milestones
image
image

Issues
image
image

EDIT
Crap. I'm blind and didn't see #22423 🤣

@lunny lunny modified the milestones: 1.18.6, 1.19.1 Apr 2, 2023
@6543 6543 modified the milestones: 1.19.1, 1.19.2 Apr 12, 2023
@lunny lunny modified the milestones: 1.19.2, 1.19.3 Apr 28, 2023
6543 pushed a commit that referenced this issue Apr 30, 2023
Now we have `All milestones`, `No milestones`, `Open milestones` and
`Closed milestones`.
Fix #11924
Fix #22411 

<img width="1166" alt="image"
src="https://user-images.githubusercontent.com/81045/212243375-95eea035-a972-44b8-8088-53db614cb07e.png">
GiteaBot pushed a commit to GiteaBot/gitea that referenced this issue Apr 30, 2023
Now we have `All milestones`, `No milestones`, `Open milestones` and
`Closed milestones`.
Fix go-gitea#11924
Fix go-gitea#22411 

<img width="1166" alt="image"
src="https://user-images.githubusercontent.com/81045/212243375-95eea035-a972-44b8-8088-53db614cb07e.png">
silverwind pushed a commit that referenced this issue Apr 30, 2023
Backport #22423 by @lunny

Now we have `All milestones`, `No milestones`, `Open milestones` and
`Closed milestones`.
Fix #11924
Fix #22411 

<img width="1166" alt="image"
src="https://user-images.githubusercontent.com/81045/212243375-95eea035-a972-44b8-8088-53db614cb07e.png">

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants