Skip to content

Add cost to proposal answers#5695

Merged
tramuntanal merged 14 commits intomasterfrom
proposals/add-cost-to-answers
Feb 18, 2020
Merged

Add cost to proposal answers#5695
tramuntanal merged 14 commits intomasterfrom
proposals/add-cost-to-answers

Conversation

@mrcasals
Copy link
Copy Markdown
Contributor

@mrcasals mrcasals commented Feb 10, 2020

🎩 What? Why?

This PR adds some fields to proposal answers. These new fields are only required if the proposal is accepted.

📌 Related Issues

📋 Subtasks

  • Add CHANGELOG entry
  • Fix proposal answer form tests and make sure fields are only required when answer is accepted.
  • Show fields in the admin UI
  • Remove null: false restriction from DB
  • Add frontend

📷 Screenshots (optional)

New fields in the proposal page in admin:
image

Costs in the public page:
image

When cost report is long, a toggle appears by default:
image

You can expand the toggle to read the full report:
image

@mrcasals mrcasals self-assigned this Feb 10, 2020
@mrcasals mrcasals added project: PAM2020 Barcelona City Council contract status: WIP labels Feb 10, 2020
@mrcasals mrcasals force-pushed the proposals/add-cost-to-answers branch 3 times, most recently from c165596 to 4249e8a Compare February 11, 2020 14:56
@mrcasals mrcasals changed the title [WIP] Add cost to proposal answers Add cost to proposal answers Feb 11, 2020
@mrcasals mrcasals requested review from agustibr and leio10 February 11, 2020 15:02
agustibr
agustibr previously approved these changes Feb 11, 2020
Copy link
Copy Markdown
Contributor

@agustibr agustibr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

leio10
leio10 previously approved these changes Feb 12, 2020
Copy link
Copy Markdown
Contributor

@leio10 leio10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mrcasals
Copy link
Copy Markdown
Contributor Author

@decidim/core this has been approved by @decidim/product, can you review it please? 😄

@tramuntanal
Copy link
Copy Markdown
Contributor

tramuntanal commented Feb 13, 2020

Hi @mrcasals ,
If I mark the proposal as accepted but left all fields blank, I get the " There's been a problem answering this proposal " error message, but then I can not see what happened anywhere.

Can you add the corresponding errors to each mandatory field please?

Also the "Accepted" radio button looses its value. It would be great to keep it set between requests.

@mrcasals
Copy link
Copy Markdown
Contributor Author

mrcasals commented Feb 13, 2020

@tramuntanal I fixed it in the last commit, the problem was that if there was any error, then the controller was redirecting, thus losing the form errors. Here's a screen capture of the code behaving correctly:

image

I've pushed it to staging again for you to check, just in case.

tramuntanal
tramuntanal previously approved these changes Feb 15, 2020
@tramuntanal
Copy link
Copy Markdown
Contributor

Can you merge master in order to re-execute all tests please?

@mrcasals mrcasals force-pushed the proposals/add-cost-to-answers branch from cc8cd32 to 2c51087 Compare February 17, 2020 12:01
@tramuntanal tramuntanal merged commit f50e7be into master Feb 18, 2020
@tramuntanal tramuntanal deleted the proposals/add-cost-to-answers branch February 18, 2020 10:45
microstudi pushed a commit to Platoniq/decidim that referenced this pull request Feb 21, 2020
* Estimated costs in proposal view

* Description tag updated

* Lited CSS

* Add migration with new fields

* Add step attribute

* Update Gemfile.lock

* Use defaults instead of overwriting all values

* Add fields to proposal answer form

* Update answers with costs

* Show costs in proposal page

* Add changelog

* Rubocop fixes

* Add text toggle on cost report

* Render action on error

Co-authored-by: Javier Usobiaga <javier@swwweet.com>
@oriolgual oriolgual mentioned this pull request Feb 23, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in-review project: PAM2020 Barcelona City Council contract

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add costs fields to proposal answers

5 participants