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 duplicate project board when hitting enter key #27746

Merged
merged 2 commits into from
Oct 23, 2023

Conversation

lng2020
Copy link
Member

@lng2020 lng2020 commented Oct 23, 2023

When hitting the enter key to create a new project column, the request is sent twice because the submit event and key up event are both triggered.
Probably a better solution is to rewrite these parts of the code to avoid using native jQuery but reuse the form-fetch-action class. But it's beyond my ability.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 23, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 23, 2023
@lng2020 lng2020 added backport/v1.20 This PR should be backported to Gitea 1.20 backport/v1.21 This PR should be backported to Gitea 1.21 labels Oct 23, 2023
@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 Oct 23, 2023
@@ -193,20 +193,6 @@ export function initRepoProject() {
const url = $(this).data('url');
createNewColumn(url, columnTitle, projectColorInput);
});

$('.new-project-column').on('input keyup', (e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why input event is also removed?

Copy link
Member Author

@lng2020 lng2020 Oct 23, 2023

Choose a reason for hiding this comment

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

It's not working. The input event is to enable/disable the confirm button. But the confirm button is not disabled at the first place. We don't use this kind of enable/disable attribute in other buttons either. So I removed it.

Copy link
Member Author

Choose a reason for hiding this comment

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

The frontend and backend are both introduced in the PR that implements the Project feature. So It has some personal code style. As I said in the description, It would be great if this part of frontend code is refactored to align other POST forms that we used in Gitea.

@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 Oct 23, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 23, 2023
@lunny lunny enabled auto-merge (squash) October 23, 2023 12:29
@lunny lunny merged commit 51d1dc2 into go-gitea:main Oct 23, 2023
24 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Oct 23, 2023
@GiteaBot
Copy link
Collaborator

I was unable to create a backport for 1.20. @lng2020, please send one manually. 🍵

go run ./contrib/backport 27746
...  // fix git conflicts if any
go run ./contrib/backport --continue

@GiteaBot GiteaBot added the backport/manual No power to the bots! Create your backport yourself! label Oct 23, 2023
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Oct 23, 2023
When hitting the `enter` key to create a new project column, the request
is sent twice because the `submit` event and `key up` event are both
triggered.
Probably a better solution is to rewrite these parts of the code to
avoid using native jQuery but reuse the `form-fetch-action` class. But
it's beyond my ability.
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 23, 2023
lunny pushed a commit that referenced this pull request Oct 23, 2023
Backport #27746 by @lng2020

When hitting the `enter` key to create a new project column, the request
is sent twice because the `submit` event and `key up` event are both
triggered.
Probably a better solution is to rewrite these parts of the code to
avoid using native jQuery but reuse the `form-fetch-action` class. But
it's beyond my ability.

Co-authored-by: Nanguan Lin <70063547+lng2020@users.noreply.github.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Oct 24, 2023
* giteaofficial/main:
  Do not force creation of _cargo-index repo on publish (go-gitea#27266)
  Upgrade to golangci-lint@v1.55.0 (go-gitea#27756)
  Fix incorrect "tab" parameter for repo search sub-template (go-gitea#27755)
  Fix label render containing invalid HTML (go-gitea#27752)
  Fix duplicate project board when hitting `enter` key (go-gitea#27746)
  Fix `link-action` redirect network error (go-gitea#27734)
@lng2020 lng2020 deleted the fix_dupilcate_board branch November 7, 2023 07:48
fuxiaohei pushed a commit to fuxiaohei/gitea that referenced this pull request Jan 17, 2024
When hitting the `enter` key to create a new project column, the request
is sent twice because the `submit` event and `key up` event are both
triggered.
Probably a better solution is to rewrite these parts of the code to
avoid using native jQuery but reuse the `form-fetch-action` class. But
it's beyond my ability.
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 21, 2024
@lunny lunny added the backport/done All backports for this PR have been created label Feb 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/manual No power to the bots! Create your backport yourself! backport/v1.20 This PR should be backported to Gitea 1.20 backport/v1.21 This PR should be backported to Gitea 1.21 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants