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 assigned issues dashboard #920

Merged
merged 2 commits into from
Feb 14, 2017

Conversation

lunny
Copy link
Member

@lunny lunny commented Feb 13, 2017

fix #503

hgaiser and others added 2 commits February 13, 2017 12:06
* Fix assigned/created issues in dashboard.

* Use GetUserIssueStats for getting all Dashboard stats.

* Use gofmt to format the file properly.

* Replace &Issue{} with new(Issue).

* Check if user has access to given repository.

* Remove unnecessary filtering of issues.

* Return 404 error if invalid repository is given.

* Use correct number of issues in paginater.
@lunny lunny added type/bug type/enhancement An improvement of existing functionality labels Feb 13, 2017
@lunny lunny added this to the 1.1.0 milestone Feb 13, 2017
@lunny
Copy link
Member Author

lunny commented Feb 13, 2017

@jeppech could you try to confirm this?

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 13, 2017
@jeppech
Copy link

jeppech commented Feb 13, 2017

@lunny This works perfectly, thank you!
nj4xk4


openCountSession := countSession(false, isPull, repoID, repoIDs)
closedCountSession := countSession(true, isPull, repoID, repoIDs)
stats.YourRepositoriesCount, _ = countSession(false, isPull, repoID, repoIDs).
Copy link
Member

Choose a reason for hiding this comment

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

I don't like this. We're essentially assuming that the repositories in repoIDs are exactly the set of repositories that some user owns. Moreover, this will return the wrong count if repoID > 0.

Copy link
Member

Choose a reason for hiding this comment

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

It would be nice if we could change the interface of GetUserIssueStats so that we don't need to make these sort of implicit assumptions.

Copy link
Member Author

Choose a reason for hiding this comment

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

I cherry-pick from gogs/gogs#3560 and resolved the conflicts. I think we can improve this in further PRs.

Copy link
Member

Choose a reason for hiding this comment

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

Ok fine

@ethantkoenig
Copy link
Member

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 Feb 14, 2017
@Bwko
Copy link
Member

Bwko commented Feb 14, 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 Feb 14, 2017
@lunny lunny merged commit 7a9a5c8 into go-gitea:master Feb 14, 2017
@lunny lunny deleted the lunny/fix_assigned_issues_dashboard branch February 14, 2017 14:15
@Lourens-Rich
Copy link

Update to 43c94d0 give me that: template: user/dashboard/issues:10:44: executing "user/dashboard/issues" at <.IssueStats.YourRepo...>: YourRepositoriesCount is not a field of struct type interface {}

@lunny
Copy link
Member Author

lunny commented Feb 16, 2017

Have you recompile Gitea?

@Lourens-Rich
Copy link

Ops. First time when a forgot this, sorry.

@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 type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issues: Assigned to me
7 participants