Add participatory spaces to open data files#13313
Conversation
Ok, I agree with what you're saying. I've done it in 2d6688b This is ready for another round @alecslupu |
alecslupu
left a comment
There was a problem hiding this comment.
@andreslucena , can you take a look on the category and attachments fields, for some reason, the CSV export for those 2 fields are plain hashses ...
eeb8682 to
c02910e
Compare
@alecslupu I decided to just remove them from the OpenData CSV as I don't like adding them on a column. I'm leaning in adding them to another file (i.e. For the moment as I don't have a solution that I'm happy with, I think it's better to just remove them from the current PR. That was done in c02910e (I moved them to the other serializers that are used for the Import/Export feature in the admin panel, where this is not an issue as they're using JSON). Can you check this PR again please? Thanks! |
alecslupu
left a comment
There was a problem hiding this comment.
The Assemblies, conferences and initiatives are ok. There is an issue with participatory_processes
...pp/serializers/decidim/participatory_processes/open_data_participatory_process_serializer.rb
Outdated
Show resolved
Hide resolved
...pp/serializers/decidim/participatory_processes/open_data_participatory_process_serializer.rb
Outdated
Show resolved
Hide resolved
...rializers/decidim/participatory_processes/open_data_participatory_process_serializer_spec.rb
Outdated
Show resolved
Hide resolved
…to ParticipatoryProcessSerializer
259c17e to
3c46767
Compare
* Extract 'Download Open Data files' example to its own spec * Add missing resources to spec * Extract shared context file with common methods * Add open data file for participatory processes * Extract shared example file with includes/does not include examples * Add open data file for assemblies * Add open data file for conferences * Fix exporting of the open data file * Add ExportManifest#open_data_serializer to have more control in the serialized fields * Fix rubocop offenses * Workaround Bullet exceptions in CI for these examples * Remove unecessary include in Conferences * Add OpenDataAssemblySerializer * Add OpenDataConferenceSerializer * Add OpenDataInitiativeSerializer * Fix comment for OpenDataParticipatoryProcessSerializer * Add attachments to the open data serializers * Add IDs to initiatives export Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro> * Fix typo Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro> * Fix fields in initiatives - Replace id with reference (for consistency with other spaces' exports) - Add missing fields from the export * Introduce ParticipatorySpaceSerializer Also remove some not needed attributes (such as decidim_organization_id), and move others out of the OpenData serializers (as weight). * Add assembly type to Assembly serializers * Fix typo * Remove categories and attachments from OpenData serializers * Move steps serialization from OpenDataParticipatoryProcessSerializer to ParticipatoryProcessSerializer --------- Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
🎩 What? Why?
Until now, the "Download Open Data files" link from the footer only returned some components:
With this change, we're also adding
ParticpatorySpaces:One important thing to notice is that as some spaces can have different publication scopes (as in "not published" or "private" or "private and transparent"), then we need to take that into account when downloading them.
Another thing to mention is that as the Serializer is used for the import/export features, I created a new method for this in the
ParticipatorySpaceManifestcalledopen_data_serializer. With this, we can differentiate between the attributes that need to be exported in each case.📌 Related Issues
Testing
📷 Screenshots
Before
After