Skip to content

Conversation

@myabc
Copy link
Contributor

@myabc myabc commented Jan 19, 2026

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:

  • Adds Request.js as peer/dev dependency
  • Replaces fetch() calls with Request.JS

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-Token headers automatically.

Merge checklist

  • Added/updated tests
  • Added/updated documentation in Lookbook (patterns, previews, etc)
  • Tested major browsers (Chrome, Firefox, Edge, ...)

@myabc myabc changed the title code maintenance/69553 rid jquery ckeditor fixup [#69553] Remove jQuery from CKEditor build [FIXUP] Jan 19, 2026
@myabc myabc added enhancement New feature or request needs review labels Jan 19, 2026
myabc added a commit to opf/openproject that referenced this pull request Jan 19, 2026
Built from upstream commit: 122e338255f254940dc02a5c2e72681e8d9c5d37

See upstream PRs:
- opf/commonmark-ckeditor-build#107
- opf/commonmark-ckeditor-build#108
@myabc myabc marked this pull request as ready for review January 19, 2026 15:22
Copilot AI review requested due to automatic review settings January 19, 2026 15:22
Copy link
Contributor

Copilot AI left a 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.js as a dependency for CSRF-aware HTTP requests
  • Replaced fetch() with Request.JS get() and post() 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.

@myabc myabc force-pushed the code-maintenance/69553-rid-jquery-ckeditor-fixup branch from 122e338 to 509e734 Compare January 19, 2026 15:27
myabc added a commit to opf/openproject that referenced this pull request Jan 19, 2026
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.
@myabc myabc force-pushed the code-maintenance/69553-rid-jquery-ckeditor-fixup branch from 509e734 to 7795208 Compare January 19, 2026 15:49
myabc added a commit to opf/openproject that referenced this pull request Jan 19, 2026
Built from upstream commit: 7795208016d3efbf1cd8545aa852824fd2f3b149

See upstream PRs:
- opf/commonmark-ckeditor-build#107
- opf/commonmark-ckeditor-build#108
@myabc myabc requested review from a team and oliverguenther January 19, 2026 15:52
myabc added a commit to opf/openproject that referenced this pull request Jan 20, 2026
Built from upstream commit: 7795208016d3efbf1cd8545aa852824fd2f3b149

See upstream PRs:
- opf/commonmark-ckeditor-build#107
- opf/commonmark-ckeditor-build#108
Copy link
Member

@akabiru akabiru left a 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

@myabc myabc merged commit ec8c1b8 into master Jan 20, 2026
4 checks passed
@myabc myabc deleted the code-maintenance/69553-rid-jquery-ckeditor-fixup branch January 20, 2026 14:44
myabc added a commit to opf/openproject that referenced this pull request Jan 20, 2026
Built from upstream commit: ec8c1b8b1a0a858467fdd4f15a761a25fd85f801

See upstream PRs:
- opf/commonmark-ckeditor-build#107
- opf/commonmark-ckeditor-build#108
myabc added a commit to opf/openproject that referenced this pull request Jan 20, 2026
Built from upstream commit: ec8c1b8b1a0a858467fdd4f15a761a25fd85f801

See upstream PRs:
- opf/commonmark-ckeditor-build#107
- opf/commonmark-ckeditor-build#108
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request needs review

Development

Successfully merging this pull request may close these issues.

3 participants