Fix: Proposals component form introduced regression#5179
Merged
oriolgual merged 3 commits intodecidim:masterfrom Jun 6, 2019
Merged
Conversation
1 task
oriolgual
approved these changes
Jun 6, 2019
aitorlb
added a commit
to CodiTramuntana/decidim
that referenced
this pull request
Jun 14, 2019
I refactored a spec in the last commit but realized after fixing a rubocop warning that the error was not being raised anymore. The error is a regression that was fixed in decidim#5179, which updated the component setting :participatory_texts_enabled from true to false when the checkbox was being disabled from the frontend. I disabled the rubocop warning and made sure the error is catched now, testing it in the branch that introduced the regression.
oriolgual
pushed a commit
that referenced
this pull request
Jun 17, 2019
* Admin configuration of amendments by step and link rejected emendation w promoted proposal * Refactor settings_helper.rb * Add specs * Update settings_helper and form.js * Update amendments permissions * Fix eslint offense and update comments * Add component step settings visibility tests * Fix rubocop offense and update comment * Fix spec I refactored a spec in the last commit but realized after fixing a rubocop warning that the error was not being raised anymore. The error is a regression that was fixed in #5179, which updated the component setting :participatory_texts_enabled from true to false when the checkbox was being disabled from the frontend. I disabled the rubocop warning and made sure the error is catched now, testing it in the branch that introduced the regression. * Change #promoted_to_proposal * Add more tests to amend_proposal_spec and update comments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
The reason
settings[:participatory_texts_enabled]was returningnilin the component form validation was that the checkbox was being disabled via HTML and that caused the form to ignore the value from that field, essentially updating the value tonilevery time.I did not catch it via tests
because I did not succeed in using anything other than a stub for the form in the specbecause the system tests were not as good as they could be.I've changed the code to emulate the appearance of a disabled element and prevented clicking via javascript.
I'm sorry for the inconveniences.
📌 Related Issues
form.jsinassets/config/decidim_admin_manifest.js#5165📋 Subtasks
CHANGELOGentry