rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
464 stars 493 forks source link

On sign-in, users should be served up their most recently used role #3345

Closed cielf closed 7 months ago

cielf commented 1 year ago

Summary

When a multi-roled user signs in, they should go to their most recently-used role.

Why

This has a couple of benefits: 1/ Continuation of flow -- when you sign in, you pick up closer to where you left off 2/ It is also a band-aid for the problem where we have partners that were mistakenly created as banks. [We have a better fix in the works, too.]

Details

We don't currently persist any indicator of current role. We'll need to do that when a role is changed, and have the sign-in know to go to the current role.

Potential 'gotchas'

Criteria for completion

brodyf42 commented 1 year ago

I would like to take this one.

cielf commented 1 year ago

I'm sorry @brodyf42 -- I totally missed your comment. Are you still interested?

brodyf42 commented 1 year ago

@cielf, I can still take it on. I haven't really started working on it except doing some investigation into the application. This is my first time working in human-essentials.

cielf commented 1 year ago

It's yours then -- so far it only is impacting a handful of users, but it would be nice if they didn't have the extra step every time they log in that they do now.

github-actions[bot] commented 1 year ago

This issue has been inactive for 242 hours (10.08 days) and will be automatically unassigned after 118 more hours (4.92 days).

brodyf42 commented 1 year ago

@cielf I am sorry, but some circumstances have changed, and I won't be able to work on this issue in the near future. Please feel free to unassign me.

cielf commented 1 year ago

@brodyf42 Not a problem. Hope they are happy circumstances.

patrickarnett commented 1 year ago

Hi @cielf, can I grab this?

cielf commented 1 year ago

@patrickarnett Assigning it to you!

github-actions[bot] commented 1 year ago

This issue has been inactive for 243 hours (10.13 days) and will be automatically unassigned after 117 more hours (4.88 days).

github-actions[bot] commented 1 year ago

This issue has been inactive for 363 hours (15.13 days) and is past the limit of 360 hours (15.00 days) so is being unassigned.

awwaiid commented 1 year ago

@patrickarnett made a PR at https://github.com/rubyforgood/human-essentials/pull/3564, but it didn't quite get to the heart of this. Whomever (including Patrick) picks this up next, please refer to the conversation in that PR for some adjustments to the approach -- namely, adding last_role_id onto users, reading that for setting the role on a new session, and writing to it when the role is changed.

vincent-truong-main commented 7 months ago

Hi I'd like to take this on.

cielf commented 7 months ago

Hey @vincent-truong-dev It turns out we have a pull request in flight on this one! Please find another issue. Thank you.