Skip to content

Import proposal answers#8271

Merged
leio10 merged 81 commits intodecidim:developfrom
mainio:feature/import_proposal_answers
Sep 30, 2021
Merged

Import proposal answers#8271
leio10 merged 81 commits intodecidim:developfrom
mainio:feature/import_proposal_answers

Conversation

@lahdeero
Copy link
Copy Markdown
Contributor

@lahdeero lahdeero commented Aug 31, 2021

🎩 What? Why?

Imports proposal answers from file (excel, csv, json).

📌 Related Issues

https://meta.decidim.org/processes/roadmap/f/122/proposals/14922

Testing

  1. Create .xlsx file, colums: id, state, answer/en (depends on organization locales)
  2. Write rows to excel. Example row: 1, accepted, This is proposal is very nice.
  3. Go to admin panel -> components -> Proposals (component must match proposal's component!) -> Import (dropdown) -> Import proposal answers from a file
  4. Upload file and select "Import"
  5. Check proposal answers

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

image

image

♥️ Thank you!

@andreslucena andreslucena changed the title Feature import proposal answers Import proposal answers Aug 31, 2021
Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen left a comment

Choose a reason for hiding this comment

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

Some review comments when going through.

@ahukkanen
Copy link
Copy Markdown
Contributor

Just to note here that the bugs/issues are already fixed and we have also added better errors in these situations:

  • Missing column headers in the import file
  • Duplicate column headers in the import file
  • Invalid import file (e.g. incorrectly formatted JSON)

Feel free to test in the QA environment linked above.

@andreslucena
Copy link
Copy Markdown
Member

Hi! I tried to import some proposals answers but I get an error:

 There was a problem during the import  
 Found error in the import file on lines 3 and 5. Please check that these lines are formatted correctly and contain valid records.

I have the same error with CSV and XLSX.

This is the file that I'm using: proposals-answers-example.csv, in this process: https://pr8271.decidimqa.mainiotech.fi/admin/participatory_processes/pb-2022/components/3/imports?name=answers

Also regarding the wording of the error, Grammarly says that it should be "Found an error in the import file on lines 3 and 5. Please check that these lines are formatted correctly and contain valid records."

@ahukkanen
Copy link
Copy Markdown
Contributor

@andreslucena Your import document contains amendment IDs on lines 3 and 5. You cannot import answers for amendments, so these lines are incorrect.

We'll fix the wording with the error message.

@ahukkanen
Copy link
Copy Markdown
Contributor

@andreslucena The wording is now fixed for the error message.

@andreslucena
Copy link
Copy Markdown
Member

You cannot import answers for amendments, so these lines are incorrect.

You're right, after removing those lines everything works as expected.

I thought that somehow I got to import answers to Amendments because that's what I've seen in the admin panel:

imatge

But I think it's actually an unrelated bug (from the seed contents), so we can skip that for now.

Ready to be reviewed by you @decidim/maintainers

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.

Huge and outstanding job! 👏🔝

@leio10 leio10 merged commit 6af00df into decidim:develop Sep 30, 2021
@ahukkanen ahukkanen deleted the feature/import_proposal_answers branch September 30, 2021 08:20
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants