Remove inline scripts from views and migrate to Stimulus controllers for CSP compliance#16517
Remove inline scripts from views and migrate to Stimulus controllers for CSP compliance#16517antopalidi wants to merge 14 commits intodevelopfrom
Conversation
…Stimulus controllers
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
alecslupu
left a comment
There was a problem hiding this comment.
@antopalidi This PR becomes too large, and it will be hard to review / work on.
When we migrated the fist stimuls controllers we did the following:
- Feature branch PR
- Atomic PRs in in the feature branch (this way we can track that x, y controller is being used in a,b place )
- Try to add some kind of header description for controller like we did in #16157
- Also, we need some specs.
Have a look on what we have done on:
There was a problem hiding this comment.
This should not be a controller. Check if you can add it in the entrypoint.
There was a problem hiding this comment.
This should not be a controller. Check if you can add it in the entrypoint.
There was a problem hiding this comment.
I do not understand this.
|
@antopalidi please do provide a separate PR for each checkbox (or even in the case of the |
@andreslucena i think tomorrow you'll have a meeting together. please, can you write the agreements after that? or @microstudi @alecslupu |
🎩 What? Why?
Remove all executable inline JavaScript from views, cells, and helpers to prepare for CSP hardening.
<script>blocks from views and cells to Stimulus controllers<script type="text/template">with HTML<template>elementsunsafe-evalrequirement)Decidim.configinitialization to inert<script type="application/json">blocks with hydration from external JSonclick,onchange) from views and Ruby helpersdynamic_fields.component.jsto work with<template>elements instead of<script type="text/template">📌 Related Issues
Testing
Describe the best way to test or validate your PR.
💰 Funding
This action is funded by Pokecode as an offering to the Decidim Association following the partners' meeting held on March 20th at Pokecode's request. This action is independent of Pokecode's partner fees. It is an offering of technical resources at zero cost as a show of support for the Decidim Association at a time when they have fewer technical resources available