-
Notifications
You must be signed in to change notification settings - Fork 7
[#69553] Remove jQuery from CKEditor build [FIXUP] #108
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
[#69553] Remove jQuery from CKEditor build [FIXUP] #108
Conversation
Built from upstream commit: 122e338255f254940dc02a5c2e72681e8d9c5d37 See upstream PRs: - opf/commonmark-ckeditor-build#107 - opf/commonmark-ckeditor-build#108
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.
Pull request overview
This PR fixes broken mentions (work package and user) and previews that resulted from the jQuery removal in PR #107. The fix replaces native fetch() calls with Rails Request.JS, which automatically handles CSRF token headers required by the Rails backend.
Changes:
- Added
@rails/request.jsas a dependency for CSRF-aware HTTP requests - Replaced
fetch()with Request.JSget()andpost()functions in three files - Updated documentation to reflect the use of Request.JS instead of raw Fetch API
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Added @rails/request.js dependency and React peer dependency |
| package-lock.json | Lock file updates for new dependencies |
| src/plugins/op-preview.plugin.js | Replaced fetch() with Request.JS post() for preview functionality |
| src/mentions/work-package-mentions.js | Replaced fetch() with Request.JS get() for work package autocomplete |
| src/mentions/user-mentions.js | Replaced fetch() with Request.JS get() for user mentions |
| README.md | Updated documentation to mention Request.JS instead of Fetch API |
| CHANGELOG.md | Updated changelog to reflect Request.JS usage |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
122e338 to
509e734
Compare
Built from upstream commit: 509e73464638e45f84d0b713089ea31b8cfb3ced See upstream PRs: - opf/commonmark-ckeditor-build#107 - opf/commonmark-ckeditor-build#108
Request.JS provides a wrapper around `fetch`, taking care of setting the `X-CSRF-Token` header.
509e734 to
7795208
Compare
Built from upstream commit: 7795208016d3efbf1cd8545aa852824fd2f3b149 See upstream PRs: - opf/commonmark-ckeditor-build#107 - opf/commonmark-ckeditor-build#108
Built from upstream commit: 7795208016d3efbf1cd8545aa852824fd2f3b149 See upstream PRs: - opf/commonmark-ckeditor-build#107 - opf/commonmark-ckeditor-build#108
akabiru
left a comment
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.
Looking good to me! Just one question
Built from upstream commit: ec8c1b8b1a0a858467fdd4f15a761a25fd85f801 See upstream PRs: - opf/commonmark-ckeditor-build#107 - opf/commonmark-ckeditor-build#108
Built from upstream commit: ec8c1b8b1a0a858467fdd4f15a761a25fd85f801 See upstream PRs: - opf/commonmark-ckeditor-build#107 - opf/commonmark-ckeditor-build#108
Important
Follow on from #107
Ticket
https://community.openproject.org/wp/69553
What are you trying to accomplish?
Fixes broken mentions (work package, user) and previews.
In detail:
What approach did you choose and why?
I went with Rails Request.JS as we are already using it in core. It takes care of setting
X-CSRF-Tokenheaders automatically.Merge checklist