Skip to content

Remove jQuery AJAX from the repo tag edit form #29526

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

Merged
merged 4 commits into from
Mar 2, 2024

Conversation

yardenshoham
Copy link
Member

  • Removed all jQuery AJAX calls and replaced with our fetch wrapper
  • Tested the repo tag edit form functionality and it works as before

Demo using fetch instead of jQuery AJAX

action

- Removed all jQuery AJAX calls and replaced with our fetch wrapper
- Tested the repo tag edit form functionality and it works as before

Signed-off-by: Yarden Shoham <[email protected]>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 1, 2024
@yardenshoham yardenshoham added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Mar 1, 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 Mar 1, 2024
if (xhr.responseJSON.invalidTopics.length > 0) {
topicPrompts.formatPrompt = xhr.responseJSON.message;
} catch (error) {
if (error.response?.status === 422) {
Copy link
Member

@silverwind silverwind Mar 1, 2024

Choose a reason for hiding this comment

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

What is error.response? I don't think it's part of the fetch standard. Also I think the logic is wrong because fetch will not throw on negative status codes. Fetch only throws on network errors, nothing else.

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 thought it throws. I will fix it

@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 Mar 2, 2024
@yardenshoham yardenshoham added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 2, 2024
@lunny lunny merged commit 2089b97 into go-gitea:main Mar 2, 2024
@GiteaBot GiteaBot added this to the 1.22.0 milestone Mar 2, 2024
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 2, 2024
@yardenshoham yardenshoham deleted the repo-home-jquery-ajax branch March 2, 2024 09:29
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 2, 2024
* upstream/main:
  Remove jQuery AJAX from the repo tag edit form (go-gitea#29526)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 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. 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