Skip to content

Fix: Proposals component form introduced regression#5179

Merged
oriolgual merged 3 commits intodecidim:masterfrom
CodiTramuntana:fix/proposals_component_form_introduced_regression
Jun 6, 2019
Merged

Fix: Proposals component form introduced regression#5179
oriolgual merged 3 commits intodecidim:masterfrom
CodiTramuntana:fix/proposals_component_form_introduced_regression

Conversation

@aitorlb
Copy link
Copy Markdown
Contributor

@aitorlb aitorlb commented Jun 6, 2019

🎩 What? Why?

The reason settings[:participatory_texts_enabled] was returning nil in 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 to nil every 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 spec because 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

📋 Subtasks

  • Add CHANGELOG entry

@aitorlb aitorlb requested a review from a team as a code owner June 6, 2019 08:08
@oriolgual oriolgual merged commit 1e935f9 into decidim:master 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
@tramuntanal tramuntanal deleted the fix/proposals_component_form_introduced_regression branch February 19, 2021 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants