Skip to content

Filter and search polling officers#7411

Merged
mrcasals merged 12 commits intodevelopfrom
feat/polling-officers-filtering
Feb 18, 2021
Merged

Filter and search polling officers#7411
mrcasals merged 12 commits intodevelopfrom
feat/polling-officers-filtering

Conversation

@orlera
Copy link
Copy Markdown
Contributor

@orlera orlera commented Feb 17, 2021

🎩 What? Why?

This is yet another building block for #7105, #7106. More PRs will follow.

Allows the admin to:

  • Search Polling Officers by their user details (name, email, nickname) and their associated Polling Station title;
  • Filter Polling Officers by their role (president, manager, unassigned).

NB: Since the role of and officer is not a DB field, but rather a calculated value depending on a number of fields, I had to work around the normal ransack usage for filtering changing the query based on the requested filter.
If you know or see a better way to do this, please shout 🙂

📌 Related Issues

Link your PR to an issue

📋 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

Screen.Recording.2021-02-17.at.14.46.01.mov

♥️ Thank you!

@orlera orlera self-assigned this Feb 17, 2021
@orlera orlera added project: e-voting Barcelona City Council contract module: elections labels Feb 17, 2021
Base automatically changed from feat/assign-officers-to-polling-stations to develop February 17, 2021 13:53
leio10
leio10 previously approved these changes Feb 18, 2021
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.

Great! 💎

@orlera orlera marked this pull request as ready for review February 18, 2021 12:25
@orlera
Copy link
Copy Markdown
Contributor Author

orlera commented Feb 18, 2021

@decidim/mantainers this can be reviewed! 🔍

@mrcasals
Copy link
Copy Markdown
Contributor

@orlera conflicts!

Comment on lines +17 to +22
query =
collection
# Includes the presided and managed polling station
.joins("LEFT JOIN decidim_votings_polling_stations presided_station ON decidim_votings_polling_officers.presided_polling_station_id = presided_station.id
LEFT JOIN decidim_votings_polling_stations managed_station ON decidim_votings_polling_officers.managed_polling_station_id = managed_station.id
LEFT JOIN decidim_users ON decidim_users.id = decidim_votings_polling_officers.decidim_user_id")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you move this to a query object, please? 😄

@orlera
Copy link
Copy Markdown
Contributor Author

orlera commented Feb 18, 2021

@mrcasals Conflicts solved and suggestion addressed! 👍

mrcasals
mrcasals previously approved these changes Feb 18, 2021
@orlera orlera force-pushed the feat/polling-officers-filtering branch from 429654a to c9b3a3e Compare February 18, 2021 14:43
@mrcasals mrcasals merged commit b06393c into develop Feb 18, 2021
@mrcasals mrcasals deleted the feat/polling-officers-filtering branch February 18, 2021 15:37
entantoencuanto added a commit that referenced this pull request Feb 25, 2021
* develop: (232 commits)
  Add Votings to Open Data export (#7388)
  Add order in not highlighted assemblies by weight (#7444)
  Resort Menus (#7460)
  Polling Officer Zone (#7439)
  Fix session timeout when using multiple windows or tabs (#7459)
  Fix display of debates with multiple dates (#7393)
  chore: split election tests (#7451)
  style: make selected values primary labels with delete button (#7448)
  Fix and tests to avoid registered users being invited again (#7392)
  Migrate Admin menus to Menu Registry (#7368)
  New Crowdin updates (#7338)
  Bump to carrierwave 2.2.0 (#7441)
  Voting: show callout when Polling Stations miss Polling Officers (#7417)
  Further default orders for the API (#7436)
  Fix random order inconsistencies (#7437)
  Ensure Rails is locked to 5.2.4.x series (#7430)
  Add default order by ID to API list queries (#7424)
  Update dependencies (#7422)
  Ignore warning on CI when no artifacts to upload (#7420)
  Filter and search polling officers (#7411)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: elections project: e-voting Barcelona City Council contract

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants