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

Remove jQuery from the "quick submit" handler #29200

Merged
merged 4 commits into from
Feb 16, 2024

Conversation

yardenshoham
Copy link
Member

  • Switched to plain JavaScript
  • Tested the quick submit functionality and it works as before

Demo using JavaScript without jQuery

action

- Switched to plain JavaScript
- Tested the quick submit functionality and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 16, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Feb 16, 2024
@yardenshoham yardenshoham added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Feb 16, 2024
@github-actions github-actions bot added modifies/frontend and removed type/refactoring Existing code has been cleaned up. There should be no new functionality. labels Feb 16, 2024
@yardenshoham yardenshoham added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Feb 16, 2024
@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 Feb 16, 2024
@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 Feb 16, 2024
@silverwind silverwind self-requested a review February 16, 2024 17:14
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Feb 16, 2024
@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 Feb 16, 2024
@silverwind
Copy link
Member

Hope you tested it 😆

@@ -8,7 +8,7 @@ export function handleGlobalEnterQuickSubmit(target) {

// here use the event to trigger the submit event (instead of calling `submit()` method directly)
// otherwise the `areYouSure` handler won't be executed, then there will be an annoying "confirm to leave" dialog
form.dispatchEvent(new SubmitEvent('submit', {bubbles: true, cancelable: true}));
form.dispatchEvent(new SubmitEvent('submit'));
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Member

@silverwind silverwind Feb 16, 2024

Choose a reason for hiding this comment

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

Yes, but does that also apply to SubmitEvent? Neither MDN nor the HTML spec seem to give an answer, so we may need to test it. Might also be good to check what jQuery did internally and just do that.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was lied to
image

@wxiaoguang wxiaoguang self-requested a review February 16, 2024 17:18
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. labels Feb 16, 2024
This reverts commit cf8d365.
@GiteaBot GiteaBot removed the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 16, 2024
@GiteaBot GiteaBot added the lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. label Feb 16, 2024
@yardenshoham yardenshoham added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 16, 2024
@silverwind silverwind merged commit d8d4b33 into go-gitea:main Feb 16, 2024
26 checks passed
@GiteaBot GiteaBot added this to the 1.22.0 milestone Feb 16, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Feb 16, 2024
@yardenshoham yardenshoham deleted the quick-submit-jquerry branch February 16, 2024 20:08
silverwind pushed a commit that referenced this pull request Feb 17, 2024
…29223)

Partially related to #29200 and fix other potential bugs.

Co-authored-by: Giteabot <teabot@gitea.io>
wxiaoguang added a commit to wxiaoguang/gitea that referenced this pull request Feb 18, 2024
…o-gitea#29223)

Partially related to go-gitea#29200 and fix other potential bugs.

Co-authored-by: Giteabot <teabot@gitea.io>
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
- Switched to plain JavaScript
- Tested the quick submit functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/abbd6c49-ad0f-4f95-b4ba-e969b85a46e8)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
…o-gitea#29223)

Partially related to go-gitea#29200 and fix other potential bugs.

Co-authored-by: Giteabot <teabot@gitea.io>
6543 pushed a commit to 6543-forks/gitea that referenced this pull request Feb 26, 2024
- Switched to plain JavaScript
- Tested the quick submit functionality and it works as before

# Demo using JavaScript without jQuery

![action](https://github.com/go-gitea/gitea/assets/20454870/abbd6c49-ad0f-4f95-b4ba-e969b85a46e8)

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit d8d4b33)
Copy link

Automatically locked because of our CONTRIBUTING guidelines

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
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/XS Denotes a PR that changes 0-9 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