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

Refactor RepoBranchTagSelector #32681

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Nov 30, 2024

RepoBranchTagSelector seems to be the dirtiest code ever and one of hardest JS modules to touch, a lot of unrelated things were mixed together.

To make it maintainable and easy to add more features, rewrite it.

It is still not perfect due to some legacy problems (for example: pass data into the sfc), overall it is much better than before (and jQuery is also removed)

Manually tested:

Repo Home:

image

image

Commits page:

image

Release page:

image

Commit Cherry-pick:

image

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 30, 2024
@pull-request-size pull-request-size bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Nov 30, 2024
@github-actions github-actions bot added modifies/templates This PR modifies the template files modifies/frontend labels Nov 30, 2024
@wxiaoguang wxiaoguang force-pushed the refactor-branch-dropdown branch from d0b7624 to 3a548cb Compare November 30, 2024 06:16
@wxiaoguang wxiaoguang force-pushed the refactor-branch-dropdown branch from 3a548cb to e82471b Compare November 30, 2024 06:23
@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 Nov 30, 2024
{{template "repo/branch_dropdown" dict
"Repository" .Repository
"ShowTabBranches" true
"CurrentRefType" "branch"
Copy link
Member

Choose a reason for hiding this comment

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

looks like start showing from branch tab is not correct. when i want to see source from tag, dropdown button still shows branch name

Copy link
Contributor Author

@wxiaoguang wxiaoguang Dec 2, 2024

Choose a reason for hiding this comment

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

Nope, this selector is used to choose the base branch to receive a cherry-pick commit. It is not used for "source of tags".

This is the same behavior as old code, old code used "noTag" true to disable the tag tab and only show branch tab.

@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 Dec 2, 2024
@lunny lunny added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Dec 2, 2024
@wxiaoguang wxiaoguang enabled auto-merge (squash) December 2, 2024 01:01
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Dec 2, 2024
@wxiaoguang wxiaoguang merged commit e3e3260 into go-gitea:main Dec 2, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.24.0 milestone Dec 2, 2024
@wxiaoguang wxiaoguang deleted the refactor-branch-dropdown branch December 2, 2024 01:44
@wxiaoguang wxiaoguang modified the milestones: 1.24.0, 1.23.0 Dec 2, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Dec 2, 2024
* giteaofficial/main:
  Refactor RepoBranchTagSelector (go-gitea#32681)
  Allow to disable the password-based login (sign-in) form (go-gitea#32687)
  Fix JS error when reply comment on Conversation page (go-gitea#32685)
  fix(go-gitea#32667): 🐛 Fixe a keystring misuse and refactor duplicates keystrings (go-gitea#32668)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. 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.

5 participants