TheOdinProject / theodinproject

Main Website for The Odin Project
http://www.theodinproject.com
MIT License
3.59k stars 2.06k forks source link

Feature: Admin v2 - Graph for overall lesson completions over time #4595

Closed KevinMulhern closed 2 weeks ago

KevinMulhern commented 3 weeks ago

Because:

This commit:

https://github.com/TheOdinProject/theodinproject/assets/7963776/caad6b73-f00a-4dfe-a49f-65f32b05044f

KevinMulhern commented 2 weeks ago

Steps for QA:

  1. Log in as a learner - kevin@odin.com, password
  2. Visit foundations and complete 5 lessons
  3. Wait 5 minutes for our reports refresh job to run - you can check the status by visiting this path: /sidekiq/cron
  4. Visit /admin_v2 and log in with admin@odin.com, password123
  5. Visit "Analytics -> All lesson completions" from the sidebar
  6. The lesson completions graph should have 5 as the the value for today
  7. Switch to month view, the graph should have 5 as the value for this month
Asartea commented 2 weeks ago

QA:

  1. Log in as a learner - kevin@odin.com, password ✅

  2. Visit foundations and complete 5 lessons image

  3. Wait 5 minutes for our reports refresh job to run - you can check the status by visiting this path: /sidekiq/cron ✅

  4. Visit /admin_v2 and log in with admin@odin.com, password123 ✅

  5. Visit "Analytics -> All lesson completions" from the sidebar ✅

  6. The lesson completions graph should have 5 as the the value for today image

  7. Switch to month view, the graph should have 5 as the value for this month image

Nit: If possible the y-axis of the chart should be constrained to integers only: It makes no sense to measure a .1 lesson completion Nit: It might be nice to seed some values for the graph if possible, because right now I can only test on a single datapoint (today), and would have to wait until tomorrow to test a second one

:bug: Bug:

Manually messing with the date selector seems to do weird things to the Day/Month switches. I manually set the range from July 9 to July 9, and clicking the month button got me this view image

It seems that if the date range doesn't include at least one first of the month the month view just breaks

I then manually set the range to July 2 - 9, and clicked the day button, which produced this: image

While technically correct, now the first value on the x-axis is July 9, whereas the first value in my selection is July 2

KevinMulhern commented 2 weeks ago

Thanks for the feedback @Asartea ⭐

If possible the y-axis of the chart should be constrained to integers only: It makes no sense to measure a .1 lesson completion

Done ✅

It seems that if the date range doesn't include at least one first of the month the month view just breaks

Thanks for pointing this out, I think I initially overcooked how we were handling months in favour of performance. I found a better, simpler way of handling months that should fix this and make it much more flexible ✅

While technically correct, now the first value on the x-axis is July 9, whereas the first value in my selection is July 2

I see what you mean with this. The x-axis labels come from the available dataset rather than the date selection. I think it's more of a available data problem than a bug. In production it won't be an issue, we'll always have lesson completions everyday in the available date range. I'm willing to let this one slide.