Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add location data to proposals export and import #8679

Merged
merged 5 commits into from
Jan 5, 2022

Conversation

andreslucena
Copy link
Member

🎩 What? Why?

As @PierreMesure said:

Lets Decidim export proposals with their location metadata (address, latitude, longitude) and reimport from a file.

This supersedes his job, adding specs and dropping the :coordinates parent key. I think it's easier to just follow the Proposals' data model (like proposal.latitude).

📌 Related Issues

Link your PR to an issue

Testing

  • Export proposals from a Proposals component with geotagging
  • Reimport them back in another component

♥️ Thank you!

@andreslucena
Copy link
Member Author

@PierreMesure I went ahead and added the specs. For me, working with Decidim is like 80% of the time just finding where to make the changes, but as you've already made most of the job I just had to find the spec files. For that, what I do is use grep with the class name that I'm changing:

$ grep -r ProposalSerializer decidim-proposals/spec/
decidim-proposals/spec/services/decidim/proposals/proposal_serializer_spec.rb:    describe ProposalSerializer do
$ grep -r ProposalCreator decidim-proposals/spec/
decidim-proposals/spec/lib/decidim/admin/import/importer_spec.rb:  let(:creator) { Decidim::Proposals::Import::ProposalCreator }
decidim-proposals/spec/lib/decidim/proposals/import/proposal_creator_spec.rb:describe Decidim::Proposals::Import::ProposalCreator do

I call this method "Grep Driven Development" 😅

@andreslucena andreslucena added module: proposals type: fix PRs that implement a fix for a bug labels Jan 4, 2022
@PierreMesure
Copy link
Contributor

That's cool! I'll try to get better at specs in 2022!

@andreslucena andreslucena merged commit 42ab4ff into develop Jan 5, 2022
@andreslucena andreslucena deleted the fix/proposals-geocoding-export branch January 5, 2022 07:45
andreslucena added a commit that referenced this pull request Jan 25, 2022
Co-authored-by: Pierre Mesure <pierre@mesu.re>
@alecslupu alecslupu added this to the 0.26.0 milestone Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: proposals type: fix PRs that implement a fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal export doesn't display address column
3 participants