pet-rescue icon indicating copy to clipboard operation
pet-rescue copied to clipboard

Staff Dashboard Metrics: As staff I can see a tile for overdue tasks and click it to render a table of pets with overdue tasks

Open kasugaijin opened this issue 9 months ago • 2 comments

On the staff dashboard index page we can add value by showing a quick glance of metrics, and allowing staff to quickly access work that needs to be done.

In this issue, we want to modify one of the existing tiles to show information on Pet Tasks. Specifically, show the total number of tasks that are not complete AND not overdue, and the number of tasks that are overdue, on all pets. The staff should be able to click on each stat in the tile, and using hotwire, we render a table below of Pets for which these tasks belong. For example, if I click 'Overdue', the table is populated with Pets with overdue tasks. Let's create a table that shows the Pet image, name, and a column for the number of tasks. The staff should be able to click this pet name and be redirected to that pet's show page.

This is a rough representation of the requirements (ignore the columns to the right of the pet name, these are irrelevant). lol

  • On the index action we will want to generate the stats for overdue tasks and incomplete tasks (not overdue) to show in the tile
  • Make two new actions on the staff dashboard controller to handle generating the responses for click the Overdue and Not overdue links in the tile, you will need to get the appropriate data for the table, including Pet image, name, and number of tasks (incomplete and not overdue, or overdue)
  • Add tests to make sure the collections generated for each route contain what we expect
  • The table should be paginated (I'd say 5 rows per page?)

There's a lot happening here, so let me know if you have questions!

kasugaijin avatar May 14 '24 15:05 kasugaijin