Show currently logged in users#3349
Conversation
|
Perhaps @Lionqueen94 or @stacktraceghost could have a look. |
|
This is cool! Thnx @yusufraji |
8a7268b to
8a43013
Compare
f4d3506 to
8c0067d
Compare
stacktraceghost
left a comment
There was a problem hiding this comment.
Thank you for your PR! I've reviewed it and have some comments.
|
@yusufraji Looks good! The only thing remaining to resolve #3251 would be to add the blue indicator dot for users that are logged in. Your initial PR body says you need help with the frontend implementation, are there any specific points you're struggling with? |
Not necessarily, just a skill issue, since I'm new to react/Typescript and all that's frontend. I looked into it just a little bit before raising the PR. I'll have a look again. |
|
@yusufraji let us know if you want to spend more time on this, otherwise I'd be happy to fix these last points and merge this PR. |
No worries, I've committed changes to address some of the review comments. But for the last comment, please go ahead and make the changes since I am not sure of how to resolve that comment.
I look forward to learning how I could have implemented this from your changes. |
|
@yusufraji this has a merge conflict after merging #3432 |
There is no state added; Computing on the fly should be cheap enough due to the relatively low number of users and sessions. This also adds a uniqe index on `user_id` on the `sessions` table for performance reasons. This also closes kiesraad#3443. Co-authored-by: Christian Jaeger <ch@christianjaeger.ch>
Add a blue indicator dot for logged in users.
49dd059 to
3f14e0a
Compare
|
I notice that the tests fail because of the session unique constraint. #3458 also adds this constraint and fixes failing tests. |
Yes; this PR primarily added the index for performance reasons. Given that your PR is merged, this PR can be rebased on top of the new main again and then doesn't need to add the constraint anymore. @yusufraji, we should add running the tests to our run-left-hooks script; I didn't realize it didn't do that already. (Explanation to the others: we turned the left hooks into a shell script so we could commit without the hooks running all the time; we run the script when we clean up the history.) |
There is no state added; Computing on the fly should be cheap enough due to the relatively low number of users and sessions. This also adds a uniqe index on `user_id` on the `sessions` table for performance reasons. This also closes kiesraad#3443. Co-authored-by: Christian Jaeger <ch@christianjaeger.ch>
Add a blue indicator dot for logged in users.
3f14e0a to
5dd6995
Compare
You can always commit using |
OK, I wasn't aware of that. I would probably end up just running with that option all the time, though, since my workflow commits very often and then I clean up things, and so will end up still preferring an explicit script. BTW I'm considering parallelizing the actions (in my/our script) to make use of my many cores when I actually do run the actions; I didn't see anything about lefthook that would do that, have I missed it? |
Lefthook runs all its commands in parallel in our setup: Line 4 in fbf31e2 |
|
This PR is primarily @yusufraji 's work, so take these comments as ideas, I'm not invested in them:
|
This shows users who are currently logged in.
Changes:
is_logged_infield to the User struct and table on the backendfalseby defaulttrueafter logging infalseafter logging outI still need help working on the frontend for the full implementation.
Resolves #3251