OpenOversight icon indicating copy to clipboard operation
OpenOversight copied to clipboard

589/add year selector

Open McEileen opened this issue 5 years ago • 9 comments

Status

Ready for review

Description of Changes

Fixes #604 and #589 .

Changes proposed in this pull request:

  • Add last_employment_date and last_employment_details fields to all officers.
  • Add last_employment_date and last_employment_details fields to the add/edit officer forms.
  • Add a year dropdown selector to the page that displays all of a department's officers.

Notes for Deployment

Screenshots (if appropriate)

YearSelector

Tests and linting

  • [x] I have rebased my changes on current develop

  • [x] pytests pass in the development environment on my local machine (There are two failing tests, test_admin_can_disable_user and test_lastname_capitalization, however, they were failing before this PR.

  • [x] flake8 checks pass

McEileen avatar Mar 13 '19 16:03 McEileen

I'm not understanding what the 'Year' dropdown in the filter section does. Does that mean year of employment?

dismantl avatar Mar 20 '19 20:03 dismantl

Yes, so for example, if someone were trying to find an officer they interacted with in 2018, they could select "2018" in the dropdown. @camfassett pointed out in this issue that as we obtain rosters for 2019, we want historic data to remain accessible to the public. It's a good way to see how officer's assignments or roster sizes change over time.

McEileen avatar Mar 20 '19 20:03 McEileen

Could someone please review this when they get a chance? Thanks! :pray:

McEileen avatar Mar 26 '19 21:03 McEileen

@r4v5 @redshiftzero Could one of you please review this PR? @dismantl already reviewed it once and his main feedback was to remove the hardcoded lists of years and to instead use a QuerySelectField. Thank you! :pray:

McEileen avatar Jun 21 '19 22:06 McEileen

~~I found a bug in this PR where officers that started working for a department after the year selected would still appear in results. For example, if a user selected "1970" from the drop-down selector, an officer that started working in "2005" would still appear in the results. I will fix this bug and then ping someone for a re-review.~~ The PR is ready for re-review! I fixed the bug where the year selector returned officers who worked for the department after the selected year. I also fixed a bug where adding a new officer to the department would cause the year_choices() method to return duplicate years. @redshiftzero @r4v5 @dismantl @b-meson @brianmwaters Your thoughts are appreciated.

McEileen avatar Feb 24 '20 04:02 McEileen

Still working on my in-depth code review here, but I noticed in the meantime that the "year" selector only appears in the filter bar on the left-hand side of the officer listing page, but not on the "find an officer" page (e.g, /find). This seems to sort of make sense, but just want to verify that that's by design and not an oversight (ba-dum tiss)

brianmwaters avatar Jul 10 '20 20:07 brianmwaters

Still working on my in-depth code review here, but I noticed in the meantime that the "year" selector only appears in the filter bar on the left-hand side of the officer listing page, but not on the "find an officer" page (e.g, /find). This seems to sort of make sense, but just want to verify that that's by design and not an oversight (ba-dum tiss)

Yep, I only put the "year" selector on the browse page, since that's where the original issue, #589, requested it. Still, thanks for opening (ba-dum tiss?) my eyes to this.

McEileen avatar Jul 27 '20 01:07 McEileen

I responded to feedback. Here's a video of the feature in action.

McEileen avatar Jul 29 '20 02:07 McEileen

I responded to feedback. Thanks to everyone who offered their thoughts.

McEileen avatar Aug 02 '20 20:08 McEileen