-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[Feature proposal] Multiple repositories selectable @ issues/PR page #6355
Comments
A local fix for persisting the repo list was achieved by simply moving the three lines if repoID > 0 {
opts.RepoIDs = []int64{repoID}
} in counts, err := models.CountIssuesByRepo(opts) to right before issues, err := models.Issues(opts) This keeps the list of repositories, whilst still making the selected one highlighted and only showing its issues/PR's. The next step is to enable multiple selections. I'm not really sure if there exists a function for querying a list of integers similar to how the repo id is currently queried using |
In strs := ctx.QueryStrings("ids[]")
ids := make([]int64, 0, len(strs)) |
@oscarlofwenhamn Could you send a PR for that? |
I've started working on multiple selection, though if available I could use a tip on finding documentation regarding what functions are available in the tmpl, specifically for finding if a repo ID is in the list of selected repos. I'm thinking something like |
The helper functions that Gitea provides can be found in modules/templates/helper.go Things like |
Thanks, @jolheiser. I managed to come across them, so it's good to know I'm not sniffing up the wrong tree. I think I am quite close to a local fix, though it is pretty clunky to be honest. I will post it when I confirm it works, maybe we can find a way to slim it down. |
There, it seems to be working. In order to pass all other selected RepoIDs when selecting/deselecting a repo, I've constructed the following snippet, which is added to the href-attribute of the repo links instead of the old Basically, I want to include all elements of First draft: {{with $include := true}}
{{range $.RepoIDs}}
{{if eq . $Repo.ID}}
{{$include = false}}
{{else}}
&repos[]={{.}}
{{end}}
{{end}}
{{if eq $include true}}
&repos[]={{$Repo.ID}}
{{end}}
{{end}} |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
Still working on this in #6369 though not completely finished yet. |
* Make repository list @ issues/PR page persist Will partially fix #6355 * Enable multiple selections in repo list @ issues/PR page Part of issue #6355 * Add RepoIDs to UserIssueStatsOptions to make "type" count correct when selecting one/multiple repos. * Replace variable "repo" with list "repos[]" and enable multiple selections of repositories from list by including/excluding RepoIDs in list. * * Remove redundant code * Add 'All' button Improves functionality of the page, so that backtracking is not necessary to reset the page * Remove redundant variable Completely replace 'RepoID' with 'RepoIDs' and remove redundant code * Add RepoIDs to label link * Revert part of code to previous version to troubleshoot build failure * Implement old and new pieces of code whilst adhering to multi select * Attempt to join the two versions Last commit passed tests but doesn't work in practice, this works in practice and hopefully passes the tests. * Update tests to desired state * Fix pagination implementation and tests * Pass repoIDs as `repos=[1,2,3...]` instead of several `repos[]=..` * Update tests file to reflect new functionality * Update template with new `repos` format * Implement new solution to show constant "total issues" count for "All" button * Correct behavior when passing zero to array * Comment out test url returning 404 This keeps returning 404 in the test despite working in practice, for the sake of running more tests I am commenting it out * Comment out another test url returning 404 Last attempt, if more tests crash I will uncomment the urls and request assistance. * Reenable tests and test fix * Re-enable tests * Make selecting "In your repositories" reset selection as passing IDs of repos belonging to other profiles causes breakage * Remove unnecessary (with multi-selection enable) code * Drop repo from repo map and total count if permission denied * Remove extra parenthesis * make template work again * find bug! * forgot the '#' at bugfixing * delete unused RepoID * compile regex only one time * make fmt * local variable = capital letter lower * check if repos query pattern is correct * pagination remove last , - make regex work again * use Replace instead of ReplaceAll; del delete * fix test * how did this test binary got in?!? dont forgot the "-p" at git add * ! * dont replace -> cut fisrt & last string Co-Authored-By: zeripath <art27@cantab.net> * jet another regex dont mind as long as it has the same result and is performatn ... Co-Authored-By: zeripath <art27@cantab.net> * dont use nonexisting repo for test * exclude /issues?type=created_by from test * add table to querys use same syntax in each query (table.colum) * add new issue for test * dont make a workaround or something else this need a refactor itself and is out of scope for this PR * fix misspell * CI.redo() * englisch txt update Co-Authored-By: zeripath <art27@cantab.net> * add sugestions * Tweak & Fix * CI.restart()
Description
As a user, I would like to be have the option to view issues and pull-requests from multiple repositories on their respective pages. Currently, selecting one repository removes the other repos from the list. This feels unnecessarily limiting, and not very intuitive. My suggestion is to use a similar style, but not remove the repos and also allow multiple selections.
Possible method
Currently, the page identifies what repo should be used by defining a number of variables including repo (e.g.
?type=all&repo=17&sort=&state=open
). Passing multiple repo entries here could make multiple selection possible, something like?type=all&repos[]=17&repos[]=21&repos[]=22&sort=&state=open
.I will test out a local fix, and post my findings here.
Illustration
The text was updated successfully, but these errors were encountered: