Switch to rails-ujs
What does this MR do?
-
Switch to @rails/ujs package
Remove jquery-ujs and use rails-ujs instead
-
Fix counting of pending AJAX requests
@rails/ujs uses native XHR rather than jQuery AJAX. Thus we add event listeners to count pending Rails UJS requests. This uses the same methodology as our request counting for axios.
-
Disable usage of csrf token in Rails
Rails UJS
.csrfToken
doesn't seem to overrideable. As it uses the same methodology under the hood, we do not need to cache the CSRF token: -
Ensure that leave_url pages have Rails initialized
On these pages we need Rails initialized immediately in order to be able to get the confirmation dialog toggled. As we defer initialization in main.js, it might be too late.
-
Fix the user notifications spec
Closes #219253 (closed)
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team