Add attachments to Initiatives#5844
Add attachments to Initiatives#5844jesusdb merged 15 commits intodecidim:developfrom armandfardeau:feature/add-attachment-to-initiatives
Conversation
|
@armandfardeau I have a minor bug to report. |
Indeed that's quite strange! I will check asap :) |
|
@armandfardeau If you want to fix this as well at the same time. Might be worth squashing it into this PR : #5860 |
I suggest we fix this after this one. |
| def trigger_attachment_errors | ||
| return if attachment.blank? | ||
| return if attachment.valid? | ||
|
|
||
| attachment.errors.each { |error| errors.add(:attachment, error) } | ||
|
|
||
| attachment = Attachment.new(file: attachment.try(:file)) | ||
|
|
||
| errors.add(:attachment, :file) if !attachment.save && attachment.errors.has_key?(:file) | ||
| end |
There was a problem hiding this comment.
This little trick solves a part of the problem. Due to wicked's wizard, the validation on the form is not done until the final step, so we ensure that validations are triggered before. Quite sure this is the ugliest way to do it so if someone has an idea, I'm in! 😀
|
Link to Metadecidim proposal |
tramuntanal
left a comment
There was a problem hiding this comment.
Hi @armandfardeau , can you check the tests, merge develop and solve conflicts? 😉
|
@tramuntanal Armand just resolved the conflict. This should be ready to be merged. Thanks in advance. |
|
@tramuntanal Hello and sorry for the delay! It should be all good now! |
|
It looks good to me! But could you check the conflicting files, please? |
|
@jesusdb Seems all good to me ;) |
|
@jesusdb could you check if we can merge this now ? Thanks in advance ! |
* develop: Include year in meetings card (decidim#6102) Add attachment enabled option to initiative types and initiatives (decidim#6036) Fix a flaky test in group profile conversations (decidim#6123) Add attachments to Initiatives (decidim#5844) Add initiatives export (decidim#6070) Improvements to conversations with more than one participant (decidim#6094) Elections module and election administration (decidim#6065) Separate forms in steps (decidim#6108) Add sorting by publishing date to initiatives (decidim#6016) Improve proposal preview: Use proposal card when previewing a proposal draft (decidim#6064) Newsletter templates fixes (decidim#6096) # Conflicts: # decidim-initiatives/app/models/decidim/initiative.rb # decidim-initiatives/spec/system/admin/initiative_types_controller_spec.rb
* feature/add_areas_to_initiatives: (30 commits) Adds areas to FO filters Fix lint issue Fixes rubocop issues Updates changelog Adds areas to initiatives Send notification when signature threshold reached (decidim#6098) Adds filter by initiative type to admin panel (decidim#6093) Require confirmation on exiting a survey mid-answering (decidim#6118) Information message when there isn't any Proposal (decidim#6063) Set email asset host dynamically (decidim#5888) Harmonizes the design of initiatives search in FO (decidim#6090) Include year in meetings card (decidim#6102) Add attachment enabled option to initiative types and initiatives (decidim#6036) Fix a flaky test in group profile conversations (decidim#6123) Add attachments to Initiatives (decidim#5844) Add initiatives export (decidim#6070) Improvements to conversations with more than one participant (decidim#6094) Elections module and election administration (decidim#6065) Separate forms in steps (decidim#6108) Add sorting by publishing date to initiatives (decidim#6016) ... # Conflicts: # decidim-initiatives/app/cells/decidim/initiatives/initiative_m_cell.rb # decidim-initiatives/app/commands/decidim/initiatives/admin/update_initiative.rb # decidim-initiatives/app/controllers/decidim/initiatives/initiatives_controller.rb # decidim-initiatives/app/forms/decidim/initiatives/admin/initiative_form.rb # decidim-initiatives/app/helpers/decidim/initiatives/application_helper.rb # decidim-initiatives/app/models/decidim/initiative.rb # decidim-initiatives/app/services/decidim/initiatives/initiative_search.rb # decidim-initiatives/app/views/decidim/initiatives/create_initiative/fill_data.html.erb # decidim-initiatives/app/views/decidim/initiatives/initiatives/_filters.html.erb # decidim-initiatives/app/views/decidim/initiatives/initiatives/_tags.html.erb # decidim-initiatives/config/locales/en.yml # decidim-initiatives/db/migrate/20200514085422_add_area_to_initiatives.rb # decidim-initiatives/db/migrate/20200514102631_add_area_enabled_option_to_initiatives.rb # decidim-initiatives/spec/forms/initiative_form_spec.rb # decidim-initiatives/spec/services/decidim/initiatives/initiative_search_spec.rb # decidim-initiatives/spec/shared/update_initiative_type_example.rb # decidim-initiatives/spec/system/admin/admin_manages_initiatives_spec.rb # decidim-initiatives/spec/system/admin/initiative_types_controller_spec.rb # decidim-initiatives/spec/system/filter_initiatives_spec.rb


🎩 What? Why?
Adds the possibility for the user to add a file when filing an initiative, then allows to modify the attachments from the back office.
📌 Related Issues
📋 Subtasks
CHANGELOGentry📷 Screenshots (optional)