Conversation
|
@decidim/lot-px @decidim/product Can you review the screenshots attached to the description ti see if the design of the related spaces is correct? If it is not, we need the design soon... |
decidim-conferences/app/helpers/decidim/conferences/admin/conferences_helper.rb
Show resolved
Hide resolved
| module ConferencesHelper | ||
| include Decidim::ResourceHelper | ||
|
|
||
| def participatory_processes_for_conference(conference_participatory_processes) |
There was a problem hiding this comment.
Move these new methods to cells
|
|
||
| <%= attachments_for current_participatory_space %> | ||
|
|
||
| <%= participatory_processes_for_conference(conference_participatory_processes) if conference_participatory_processes.present? %> |
@isaacmg410 it is fine |
b5215a3 to
445b7ca
Compare
|
@mrcasals requested changes applied 😄 |
|
@decidim/lot-core ready to be merged 😄 |
mrcasals
left a comment
There was a problem hiding this comment.
The current solution is linked to processes/assemblies/consultations. There's no way to use external participatory spaces, which I think would be nice.
Also, why not include initiatives here too? 😕
|
|
||
| module Decidim | ||
| module Conferences | ||
| # This cell renders the participatory spaces card for an instance of a Participatory Space |
There was a problem hiding this comment.
These docs seem wrong, as reading this it seems it receives a single participatory space as model, but it in fact receives a collection of participatory spaces. Can you add a line explaining this please? 😄
| def consultations(conference) | ||
| @consultations ||= conference.participatory_space_sibling_scope(:consultations) | ||
| .includes(:consultation) | ||
| .where(decidim_consultation_id: @form.consultations_ids) |
There was a problem hiding this comment.
I'm not sure about this, since it implies it knows a lot about how consultations work internally 😕
There was a problem hiding this comment.
when you make conference.participatory_space_sibling_scope(:consultations) it returns questions. The Consultations module says that Question is a participatory space 😕
| ) | ||
| end | ||
|
|
||
| def participatory_processes(conference) |
There was a problem hiding this comment.
No need to pass conference around as a parameter, you have access to it globally already.
| .perform_later(@conference.id, checksum) | ||
| end | ||
|
|
||
| def participatory_processes(conference) |
| def consultations(conference) | ||
| @consultations ||= conference.participatory_space_sibling_scope(:consultations) | ||
| .includes(:consultation) | ||
| .where(decidim_consultation_id: @form.consultations_ids) |
There was a problem hiding this comment.
Same problem, I think we know too much about how consultations work. What happens if the app doesn't have decidim-consultations? It's an optional gem, and it's not bundled with decidim metagem 😕
There was a problem hiding this comment.
So the principal concern here is: why can't you use a simple where(id: @form.consultation_ids) here? Why all these includes and collects?
There was a problem hiding this comment.
Is more or less what I say before. The Participatory Space in Consultations mdoule is Question. FI we need to related Conference with Consultation we need to do something like that
There was a problem hiding this comment.
Although I agree it's weird, both Consultations and Questions are participatory spaces, how come if you ask for consultations you get questions?
There was a problem hiding this comment.
The issue seems to be here:
I don't know why questions are the space and consultations the resource.
There was a problem hiding this comment.
What happens if you change the model_class_name to Consultation @isaacmg410?
There was a problem hiding this comment.
Will many things break up? Then we will change the register_resource to Question?
There was a problem hiding this comment.
I'm going to try it at my machine.
There was a problem hiding this comment.
I changed:
participatory_space.model_class_name = "Decidim::Consultations::Question"To
participatory_space.model_class_name = "Decidim::Consultation"And
Decidim::Consultations::Question.where(organization: organization)To
Decidim::Consultation.where(organization: organization)And all tests pass and the navigation seems to work OK. Now conference.participatory_space_sibling_scope(:consultations) returns consultations as expected.
There was a problem hiding this comment.
I will try also, and if all is okey. Go for it?
| end | ||
|
|
||
| def conference_consultations | ||
| @conference_consultations ||= @current_participatory_space.linked_participatory_space_resources("Consultation", "included_consultations") |
There was a problem hiding this comment.
Why are you using a String here instead of a Symbol?
There was a problem hiding this comment.
because if I use a symbol :consultations it returns a Question
| end | ||
|
|
||
| def consultations_for_select | ||
| @consultations_for_select ||= Decidim.find_participatory_space_manifest(:consultations) |
There was a problem hiding this comment.
Same, what happens with this collect if decidim-consultations is not installed?
There was a problem hiding this comment.
The same as I said before
| include Decidim::ResourceHelper | ||
|
|
||
| def participatory_spaces_for_conference(conference_participatory_spaces) | ||
| cell("decidim/conferences/participatory_spaces", conference_participatory_spaces) |
There was a problem hiding this comment.
I think you can safely replace the method call with the cell "blabla" one, so we can remove this whole file
decidim-conferences/app/helpers/decidim/conferences/admin/conferences_helper.rb
Show resolved
Hide resolved
| @stats ||= ConferenceStatsPresenter.new(conference: current_participatory_space) | ||
| end | ||
|
|
||
| def conference_participatory_processes |
There was a problem hiding this comment.
This logic could be wrapped in cells too. Those cells can render ParticipatorySpacesCell directly.
What do you think about this?
How we can add here external participatory spaces? |
bd923b6 to
317ff39
Compare
317ff39 to
3cfd22c
Compare
|
@decidim/lot-core, requested changes applied 😄 |
| <%= participatory_spaces_for_conference(conference_assemblies) if conference_assemblies.present? %> | ||
| <%= participatory_spaces_for_conference(conference_consultations) if conference_consultations.present? %> | ||
| <%= cell("decidim/conferences/linked_participatory_spaces", current_participatory_space) %> | ||
| <%#= participatory_spaces_for_conference(conference_participatory_processes) if conference_participatory_processes.present? %> |
There was a problem hiding this comment.
Can you remove this commented code please? 😄
There was a problem hiding this comment.
Done! Sorry man! 😃
|
@decidim/lot-core all checks are green 😄 🎉 |
🎩 What? Why?
This PR adds the Relationship with other spaces. Each Conference-page should potentially be related to participatory processes, consultations and assemblies.
📌 Related Issues
📋 Subtasks
CHANGELOGentry📷 Screenshots (optional)