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

move issue filters to shared template #25729

Merged
merged 6 commits into from Jul 13, 2023

Conversation

denyskon
Copy link
Member

@denyskon denyskon commented Jul 6, 2023

Issue filters are being used on repo list page and on milestone issues page, and the code is mostly duplicated.

This PR does the following changes:

  • move issue filters into a shared template
  • allow filtering milestone issues by project, so no need to hide this filter on milestone issues page
  • remove some dead code (e. g. issue actions in milestone issues template)
  • fix label filter dropdown width

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 6, 2023
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 6, 2023
@denyskon denyskon added topic/ui Change the appearance of the Gitea UI type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Jul 6, 2023
@denyskon denyskon added this to the 1.21.0 milestone Jul 6, 2023
@puni9869
Copy link
Member

puni9869 commented Jul 7, 2023

Can you add the screenshots if available?

@denyskon
Copy link
Member Author

denyskon commented Jul 7, 2023

There isn't really anything to screenshot :)

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

It's quite tricky and uses a lot of {{if not .Milestone}} to construct different elements.

But I guess it's not worse than before ..... As long as there is a real requirement to use the "toolbar" on different pages, I think it could be good, and refactor next time when the page breaks in the future.

@GiteaBot GiteaBot 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 Jul 7, 2023
@denyskon
Copy link
Member Author

denyskon commented Jul 7, 2023

@wxiaoguang Would it be better to simply ignore the &milestone= parameter in backend? That would make most of the {{if not . Milestone }} cases obsolete

@wxiaoguang
Copy link
Contributor

I think it's fine. And force the MilestoneID=current milestone ID in backend when the page is "milestone issue list".

@denyskon
Copy link
Member Author

denyskon commented Jul 7, 2023

Done. The backend code doesn't even read that parameter, so there was no need to change it. The milestone ID is read from the page URL.

templates/repo/issue/filters.tmpl Show resolved Hide resolved
templates/repo/issue/filters.tmpl Show resolved Hide resolved
templates/repo/issue/filters.tmpl Show resolved Hide resolved
templates/repo/issue/filters.tmpl Show resolved Hide resolved
templates/repo/issue/filters.tmpl Show resolved Hide resolved
templates/repo/issue/filters.tmpl Show resolved Hide resolved
templates/repo/issue/filters.tmpl Outdated Show resolved Hide resolved
templates/repo/issue/list.tmpl Show resolved Hide resolved
@denyskon
Copy link
Member Author

denyskon commented Jul 7, 2023

Screenshots for changes I forgot I've made 😆

Before:

grafik
Bildschirmfoto vom 2023-07-07 15-00-00

After:

Bildschirmfoto vom 2023-07-07 15-02-18
grafik

Co-authored-by: 6543 <6543@obermui.de>
@puni9869
Copy link
Member

puni9869 commented Jul 8, 2023

@denyskon
Could you please add a UI screen shot for milestone page issue-filter in the mobile view port.
Navigation
Issue>Milestone->Click on any milestone

@denyskon
Copy link
Member Author

@puni9869 here you go :)
grafik

@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 Jul 12, 2023
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 13, 2023
@silverwind silverwind enabled auto-merge (squash) July 13, 2023 19:27
@silverwind silverwind merged commit eec45b4 into go-gitea:main Jul 13, 2023
24 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Jul 13, 2023
@denyskon denyskon deleted the refactor/issue-filters branch July 13, 2023 20:08
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jul 14, 2023
* giteaofficial/main:
  Fix incorrect release count (go-gitea#25879)
  Add Github related extensions in devcontainer (go-gitea#25800)
  Add error info if no user can fork the repo (go-gitea#25820)
  Fix wrong usage of PathEscapeSegments in branch list page (go-gitea#25864)
  fix incorrect repo url when changed the case of ownername (go-gitea#25733)
  Upgrade go dependencies (go-gitea#25819)
  Don't stack PR tab menu on small screens (go-gitea#25789)
  Link to list of vulnerabilities (go-gitea#25872)
  [skip ci] Updated translations via Crowdin
  move issue filters to shared template (go-gitea#25729)
  [skip ci] Updated translations via Crowdin
  Remove `git.FileBlame` (go-gitea#25841)
  Fix empty project displayed in issue sidebar (go-gitea#25802)
  Update blog links (go-gitea#25843)
  Fix margin on the `new/edit milestone` page (go-gitea#25801)
  Do not "guess" the file encoding/BOM when using API to upload files (go-gitea#25828)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Oct 11, 2023
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. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. topic/ui Change the appearance of the Gitea UI type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants