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

Filtering in Pull Request kept all the time. #13641

Closed
1 of 5 tasks
khmarbaise opened this issue Nov 19, 2020 · 3 comments
Closed
1 of 5 tasks

Filtering in Pull Request kept all the time. #13641

khmarbaise opened this issue Nov 19, 2020 · 3 comments
Labels

Comments

@khmarbaise
Copy link
Member

Description

If you goto the URL for the pull request you see a list (in this case exactly one) of pull request.

Now you can filter those entries by the Type as shown in the image:

pull-reqest-1

After the selection (as shown next) you will not see any entry which is perfectly fine:

pull-request-2

But now the problem arises: If you select from the "Type" -> All Issues the result kept empty in contradiction to before cause there was exactly one entry: (See the screen shot):

pull-request-3

Any selection of the filters does not change the filter given in the URL (as you can see in the last screen shot) which results in not being able to remove all the filters and going back to the beginning with the plain url https://try.gitea.io/khmtestorga/testrepo/pulls ...which can only be achieved if you manually select a complete different part and going back to pull requests....

The point seemed to be that if I select of "Type" -> "Assigned to you" a parameter assignee=42393 will be added to the URL. But that parameter can not be removed via "Type" -> "All Issues".

This can only be achieved if I select from "Assignee" manually "All Assignees" ...

Selecting the "Type->All Issues" could set the assignee=0 in the URL. This would resolve this inconvenience?

The question is: Is this a bug or intended behaviour?

@jolheiser
Copy link
Member

This is a bug.
It happens because in the template we are setting the assignee to the signed in user and it never gets cleared until the URL is changed.

<a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.SignedUser.ID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a>

What we should do is switch to using the same logic the other filters use

gitea/routers/repo/issue.go

Lines 128 to 135 in ad2a288

if ctx.IsSigned {
switch viewType {
case "created_by":
posterID = ctx.User.ID
case "mentioned":
mentionedID = ctx.User.ID
}
}

I should be able to make a PR for this later today (or anyone else is welcome to as well!) 🙂

@khmarbaise
Copy link
Member Author

If it would be ok I would like to take a look.....

@jolheiser
Copy link
Member

If it would be ok I would like to take a look.....

Absolutely!

khmarbaise added a commit to khmarbaise/gitea that referenced this issue Nov 19, 2020
 - The URL contains all the time the assignee in cases
   where once a type has been selected.

Signed-off-by: Karl Heinz Marbaise <[email protected]>
khmarbaise added a commit to khmarbaise/gitea that referenced this issue Nov 19, 2020
…e time.

 - The URL contains all the time the assignee in cases
   where once a type has been selected.
 - The same behaviour was observed issues viewed via milestones.

Signed-off-by: Karl Heinz Marbaise <[email protected]>
khmarbaise added a commit to khmarbaise/gitea that referenced this issue Nov 19, 2020
* Fixes go-gitea#13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.

Signed-off-by: Karl Heinz Marbaise <[email protected]>

* Followup Fixes go-gitea#13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.
 - The same behaviour was observed issues viewed via milestones.

Signed-off-by: Karl Heinz Marbaise <[email protected]>
jolheiser pushed a commit that referenced this issue Nov 19, 2020
* Fixes #13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.

Signed-off-by: Karl Heinz Marbaise <[email protected]>

* Followup Fixes #13641 - Filtering in Pull Request kept all the time.
 - The URL contains all the time the assignee in cases
   where once a type has been selected.
 - The same behaviour was observed issues viewed via milestones.

Signed-off-by: Karl Heinz Marbaise <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Jan 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants