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

Fix counts on issues dashboard #2215

Merged
merged 4 commits into from Aug 3, 2017
Merged

Conversation

ethantkoenig
Copy link
Member

@ethantkoenig ethantkoenig commented Jul 26, 2017

Fixes #1325.

There is still a problem with the In your repositories/Assigned to you/Created by you counts, which always show the open counts, even if the user is looking at closed issues. I will fix this is a separate PR.

@lunny lunny added the type/bug label Jul 26, 2017
@lunny lunny added this to the 1.2.0 milestone Jul 26, 2017
models/issue.go Outdated
func Issues(opts *IssuesOptions) ([]*Issue, error) {
var sess *xorm.Session
if opts.Page >= 0 {
func (opts *IssuesOptions) setupSess(sess *xorm.Session) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not change this function name to setupSession? It would be more precise.

@lafriks
Copy link
Member

lafriks commented Jul 29, 2017

Can you add integration test for this?

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 29, 2017
@ethantkoenig
Copy link
Member Author

@lafriks Test added.

I decided to add a unit test instead of an integration test; IMO it's not sustainable to have a separate integration test for every possible corner case.

@lunny
Copy link
Member

lunny commented Aug 2, 2017

When I visit http://localhost:3000/issues?type=all&repo=2&sort=&state=open, 500 returned.

template: user/dashboard/issues:65:61: executing "user/dashboard/issues" at <.Repo.Owner.Name>: can't evaluate field Name in type *models.User

@lunny
Copy link
Member

lunny commented Aug 2, 2017

Oh, this is a new bug, maybe not related with this one.
I have confirmed it's this PR caused.

@ethantkoenig
Copy link
Member Author

@lunny Good catch, fixed

@lunny
Copy link
Member

lunny commented Aug 3, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 3, 2017
@lafriks
Copy link
Member

lafriks commented Aug 3, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Aug 3, 2017
@lunny lunny merged commit 7e0654b into go-gitea:master Aug 3, 2017
@ethantkoenig ethantkoenig deleted the fix/issues_counts branch August 3, 2017 16:25
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues page seem to list projects with wrong numbers
6 participants