-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 AJAX from the repo-issue.js
file
#29776
Remove jQuery AJAX from the repo-issue.js
file
#29776
Conversation
Signed-off-by: Yarden Shoham <git@yardenshoham.com>
} | ||
let data; | ||
try { | ||
data = await response?.json(); // the response is probably not a JSON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move line into above try
imho and remove the ?
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The response isn't a JSON though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we find out what responses are possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns the full page (HTML)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always? Then why do we try to parse JSON? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which demons did we summon now?
And why does this sound like HTMX to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it but the URL is dynamic and we don't replace content, we reload. It's certainly possible but I'd have to add some form
and inputs
and have the HX-Refresh
header in the response so I decided it's not worth it
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: silverwind <me@silverwind.io>
} | ||
let data; | ||
try { | ||
data = await response?.json(); // the response is probably not a JSON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which demons did we summon now?
And why does this sound like HTMX to me?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok if it works
* giteaofficial/main: Update JS dependences (go-gitea#29797) Unify search boxes (go-gitea#29530) Fix document error about 'make trans-copy' (go-gitea#29710) Remove jQuery AJAX from the diff functions (go-gitea#29743) Fix Safari spinner rendering (go-gitea#29801) Remove jQuery AJAX from the `repo-issue.js` file (go-gitea#29776) Improve commit record's ui in comment list (go-gitea#26619) enable tailwind nesting (go-gitea#29746)
Removed all jQuery AJAX calls and replaced with our fetch wrapper.
Tested the following functionalities and they work as before:
Demo using
fetch
instead of jQuery AJAXUpdating the due-date of an issue
Deleting a comment
Updating a branch in a pull request
Checking and unchecking the "Allow edits from maintainers" checkbox
Requesting review and removing review request
Toggling the WIP status of a pull request
Clicking the new code comment button on the diff page
Editing the issue title and target branch