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 verification data export page in stats module #552

Merged
merged 10 commits into from
Nov 11, 2024

Conversation

mllocs
Copy link
Contributor

@mllocs mllocs commented Oct 4, 2024

🎩 What? Why?

On some occasions, it is necessary to know the sociodemographic data of the participants in a process. Currently, this data can be obtained from the verification form. That is, if you ask for the date of birth, gender, and postal code during the verification, you can then aggregate this data to know the sociodemographic profile of the participants.

📌 Related Issues

📷 Screenshots (optional)

Screenshot 2024-10-04 at 11 59 58

@mllocs
Copy link
Contributor Author

mllocs commented Oct 7, 2024

I managed to add the decidim-stats module to our decidim-lot2-staging server. You can find the new export page here https://decidim-lot2.populate.tools/stats/authorization_exports

@furilo There might not be enough verifications data to export, do you want me to create some?

@furilo furilo requested a review from NilHomedes October 8, 2024 09:14
furilo
furilo previously approved these changes Oct 8, 2024
@mllocs
Copy link
Contributor Author

mllocs commented Oct 8, 2024

@NilHomedes In our staging we don't have the verification method used in decidim-barcelona (app/services/census_authorization_handler.rb), so when exporting the data, you'll miss the fields that doesn't match the metadata structure.

To fully test this we could try to configure your authorization method to our staging or, in case you have a staging server, we could deploy the export data page there.

@mllocs mllocs self-assigned this Oct 8, 2024
ferblape
ferblape previously approved these changes Oct 10, 2024
Copy link
Contributor

@ferblape ferblape left a comment

Choose a reason for hiding this comment

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

Apart from the translations, the rest looks ok to me

@NilHomedes
Copy link
Collaborator

NilHomedes commented Oct 14, 2024

Hi @mllocs

To fully test this we could try to configure your authorization method to our staging or, in case you have a staging server, we could deploy the export data page there.

Yes, that could be the best way to test this module. Take into account that Barcelona is using different authorizations handlers:


By the way, I leave a couple of things I have seen:

  • 1) To comply with Decidim Design system, we should add an icon to the side menu element “Export data”.
  1. It seems that is not taking the birthday data. As you can see, the “Example Authorization” has a birthday filed, but it’s empty when exporting the data.

imatge

So the question is: This module would work for any type of authorizations handler? Or it will only works for Barcelona's authorizations?

@mllocs
Copy link
Contributor Author

mllocs commented Oct 15, 2024

  • 1) To comply with Decidim Design system, we should add an icon to the side menu element “Export data”.

@furilo @NilHomedes which icon do you suggest to use for "Export data"? https://nightly.decidim.org/design/foundations/iconography

@furilo
Copy link

furilo commented Oct 15, 2024

  • 1) To comply with Decidim Design system, we should add an icon to the side menu element “Export data”.

@furilo @NilHomedes which icon do you suggest to use for "Export data"? https://nightly.decidim.org/design/foundations/iconography

I guess download-line

@furilo
Copy link

furilo commented Oct 15, 2024

Or download-cloud-2-line

@mllocs
Copy link
Contributor Author

mllocs commented Oct 15, 2024

It seems that is not taking the birthday data. As you can see, the “Example Authorization” has a birthday filed, but it’s empty when exporting the data.

This is because the "Example Authorization" doesn't even store the birthday as a metadata 🤷 https://github.com/decidim/decidim/blob/develop/decidim-generators/lib/decidim/generators/app_templates/dummy_authorization_handler.rb#L72
It will work for the barcelona verification methods, I'll try to set them up in our staging... 🤞

@mllocs
Copy link
Contributor Author

mllocs commented Oct 15, 2024

So the question is: This module would work for any type of authorizations handler? Or it will only works for Barcelona's authorizations?

It will work for authorizations that store the metadata the same way Barcelona's authorizations do.

@NilHomedes
Copy link
Collaborator

@mllocs Thanks for the explanation, now it's clearer to me.
In this case, I would wait until we can test this in Barcelona's environment

…celona into feat/add-verifications-export-page-to-stats-module
@fblupi fblupi temporarily deployed to decidim-barcelona-staging November 5, 2024 16:01 Inactive
@mllocs
Copy link
Contributor Author

mllocs commented Nov 6, 2024

@NilHomedes I tried it in decidim-barcelona's staging, this is what I found:

  • Exporting "El padró" method worked well except for the "scope_name" column, I'm fixing that.
  • Exporting "Codi per SMS" didn't export any data, I wonder if It should work or if that method doesn't collect any kind of census data.

@mllocs
Copy link
Contributor Author

mllocs commented Nov 7, 2024

@fblupi I added a commit fixing one little thing, could you redeploy please?

@fblupi fblupi temporarily deployed to decidim-barcelona-staging November 7, 2024 16:00 Inactive
@fblupi
Copy link
Contributor

fblupi commented Nov 7, 2024

@mllocs I've just deployed it

NilHomedes
NilHomedes previously approved these changes Nov 8, 2024
Copy link
Collaborator

@NilHomedes NilHomedes left a comment

Choose a reason for hiding this comment

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

Working as expected, thanks @mllocs 💯

I'm approving this to move it forward.
Just one suggestion, could you document this new feature in the Readme module?

@fblupi fblupi merged commit 84e0cbb into master Nov 11, 2024
5 checks passed
@fblupi fblupi deleted the feat/add-verifications-export-page-to-stats-module branch November 11, 2024 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query aggregated verification data from the admin panel, filtered by periods and dates
5 participants