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

Add paging and archive/private repository filtering to dashboard list #11321

Merged
merged 9 commits into from
May 16, 2020

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented May 7, 2020

Add paging to the dashboard repository list and additional filters for archived and private repositories.

Also fixes the tooltips and dropdowns from within the vue application.

Also updates the url as you change things so that on window reload you restore state.

repolist-other-filters
repolist-page-1
repolist-page-2

Fix #11268
Closes #10674

@zeripath zeripath added the topic/ui Change the appearance of the Gitea UI label May 7, 2020
// We should be able to see all non-private repositories that
// isn't in a private or limited organisation.
cond = cond.And(
builder.Eq{"is_private": false},
Copy link
Member

Choose a reason for hiding this comment

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

We should cache this kind of flag in the repo itself at some future time. These queries are impossible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah they're too expensive and fiddly.

It's so error prone.

Really we just need your accessibility table...

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label May 13, 2020
@lunny
Copy link
Member

lunny commented May 13, 2020

Should we have an all filter?

@lafriks lafriks added this to the 1.12.0 milestone May 13, 2020
@zeripath
Copy link
Contributor Author

zeripath commented May 13, 2020

that's what the indeterminate state does.

The filters will iterate between Indeterminate for both, unchecked for No private/archived, checked for only private/archived. Unfortunately the screenshot has the tooltip for the filter button displayed - if you mouseover the checkbox/label you'll get a tooltip for the checkbox which states "Both archived and unarchived" and similar for private.

It's difficult because there's still no really sensible tri-state for html and two checkboxes would be even more confusing.

@mrsdizzie
Copy link
Member

Since this won't remember settings across page refresh I think having the archive option unchecked would be a better default option. If not, you'd have to remember to click it each time to filter archived repos and I bet most people would rather archived repos not shown by default if they can't set their own preferences. Would that seem reasonable?

@zeripath
Copy link
Contributor Author

zeripath commented May 16, 2020

I didn't want to break existing behaviour - it would be a breaking change to make that happen.

I guess to handle persistence we could just start adding to the window url query component?


done

@6543
Copy link
Member

6543 commented May 16, 2020

have not looked deeper int this but can we hide the pagination element when there is only one page?

@zeripath
Copy link
Contributor Author

@6543 it already only appears if there is more than one page.

@zeripath
Copy link
Contributor Author

OK @mrsdizzie it now updates the search params as you select things and change them.

@codecov-io
Copy link

Codecov Report

Merging #11321 into master will increase coverage by 0.01%.
The diff coverage is 55.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11321      +/-   ##
==========================================
+ Coverage   43.94%   43.95%   +0.01%     
==========================================
  Files         614      614              
  Lines       87428    87483      +55     
==========================================
+ Hits        38423    38456      +33     
- Misses      44264    44289      +25     
+ Partials     4741     4738       -3     
Impacted Files Coverage Δ
models/repo_list.go 73.56% <45.45%> (-3.77%) ⬇️
routers/api/v1/repo/repo.go 76.69% <75.00%> (-0.04%) ⬇️
routers/repo/commit.go 26.61% <0.00%> (-2.43%) ⬇️
modules/queue/workerpool.go 57.35% <0.00%> (-1.11%) ⬇️
routers/repo/wiki.go 39.41% <0.00%> (-0.17%) ⬇️
modules/git/repo.go 49.79% <0.00%> (ø)
services/pull/pull.go 33.20% <0.00%> (ø)
routers/routes/routes.go 86.76% <0.00%> (+0.07%) ⬆️
models/issue.go 52.41% <0.00%> (+0.46%) ⬆️
modules/notification/webhook/webhook.go 43.59% <0.00%> (+0.58%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6603045...516c97e. Read the comment docs.

Copy link
Member

@mrsdizzie mrsdizzie left a comment

Choose a reason for hiding this comment

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

@zeripath That change was not totally what I was talking about but is nice : )

Right now every time you leave the dashboard page and come back, the option to include archived repos is set to 'on' even if you previously checked it to off. So for the case of the linked issue, this doesn't necessarily hide them as you have to manually re-hide them each time you visit the dashboard page. I think having it unchecked by default would be a desirable default even if it changes how it works now. I feel its only half breaking because it isn't going to stop something that currently works just by upgrading, it just moves the task of clicking the archive button to people who want to show and search archived repos which I imagine is a smaller subset of users (perhaps im wrong though).

just a small preference anyway, lgtm : )

@GiteaBot GiteaBot 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 May 16, 2020
@lafriks lafriks merged commit c86bc8e into go-gitea:master May 16, 2020
@zeripath zeripath deleted the fix-11268-more-filters-repo-list branch May 16, 2020 20:33
@zeripath
Copy link
Contributor Author

@mrsdizzie oh I see!! I think we could do more about saving options in general. I'll have a think

@bkraul
Copy link

bkraul commented May 16, 2020

It would make more sense to make this an account option. So that the hiding of the archived projects could take place at a more global level. For example, if I have the option set to hide archived repos, and I go to explore an org that has several archived repos, I will not see them. Just a thought. But thanks for this feature!

@zeripath
Copy link
Contributor Author

Why don't we open an issue, or better a pr to set it as unarchived as default so we can change it for 1.12...

@zeripath
Copy link
Contributor Author

@bkraul @mrsdizzie see #11440

@bkraul
Copy link

bkraul commented May 16, 2020

@zeripath From what I can see it still applies only to the dashboard, and not to the explorer.

@zeripath
Copy link
Contributor Author

OK sorry I missed that - that'll be have to be another PR. Please open an issue.

ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
…go-gitea#11321)

* Add archived options to SearchRepository

Signed-off-by: Andrew Thornton <[email protected]>

* Add only-private search

Signed-off-by: Andrew Thornton <[email protected]>

* Add filter options and paging to dashboard repository page

Signed-off-by: Andrew Thornton <[email protected]>

* swagger generate

Signed-off-by: Andrew Thornton <[email protected]>

* fix-swagger-again

Signed-off-by: Andrew Thornton <[email protected]>

* as per @mrsdizzie also remember state

Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: Lauris BH <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 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. topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature: Hide archived repositories from Web UI
9 participants