How should FEM Classifier get the User resource? #2362
Replies: 5 comments 11 replies
-
@shaunanoordin thanks for bringing this up. I noted that we're duplicating the request for the UPP in this issue since it pertains to the workflow assignment feature: #2205 My thoughts there was actually to remove it from the classifier stores and instead pass in specific functions as props to the classifier for updating the tutorial seen timestamp because that's the only thing it is used for in the classifier and keep the responsibility of loading the UPP in the project app. I'm a little wary of making big changes to the classifier for something that is very experimental. For this, what exactly do you need from the user resource? Is it the id, display name, or something else? |
Beta Was this translation helpful? Give feedback.
-
Future work to keep in mind: interventions in the classifier (when you press Done) use |
Beta Was this translation helpful? Give feedback.
-
I've added a |
Beta Was this translation helpful? Give feedback.
-
#4803 updates the classifier to get the current user from Panoptes session cookies last for 2 weeks (I think.) You can refresh a bearer token, which lasts for 2 hours, as long as the session cookie is valid. |
Beta Was this translation helpful? Give feedback.
-
See #4845. |
Beta Was this translation helpful? Give feedback.
-
I want FEM's
lib-classifer
to know if and which user is currently logged in. Unfortunately, onlyapp-project
is aware of theuser
resource, due to current separation of responsibilities.As such, I want to discuss how
lib-classifier
could best get access to said resource. Does anyone have any thoughts in this? You can skip down to the "Solutions" bit to see what I'm proposing.Context
As part of the (insert name of grant here) grant's work on the concept of "serendipitous discovery", I'm building a basic Talk interface into the Classifier. (Henceforth called Quicktalk; see PR 2324 for technical details.)
The QuickTalk component needs to know two things: 1. which Subject the user is currently classifying (hence, this component must live in
lib-classifier
) and 2. which user is logged in, IF we want to allow users to post comments about the Subject (we do want to allow users to post comments, so this is where the problem comes in.)Notes:
The Problem(s)
lib-classifier
shouldn't need to know who's logged in, because the user identity isn't essential to the Classification process, and the Classifier should be generalised so it can be plugged into any theoretical front-end project (not just Zooniverse.org)lib-classifier
shouldn't need to know who's logged in"The Solutions?
I have two ideas on how to get around this.
Option 1: pass the User resource from
app-project
down tolib-classifier
In
app-project/ClassifyPage
...app-project
takes care of the user resource, as god.exe intended.Option 2:
lib-classifier
should just fetch the user resource again if it cares so darn much about who's classifying...Wait, actually,
lib-classifier
actually DOES already fetch the user resource, separate from whateverapp-project is doing
.In the UserProjectPreferenceStore, we see that the
checkForUser()
function pulls the currently-logged-in user resource just to get their user preference, but doesn't proceed to save the user details.I can create a separate UserStore in
lib-classifier
that stores said user data, and we can then call it a day.app-project
andlib-classifier
continue to be (mostly) independent from each other.app-project
Beta Was this translation helpful? Give feedback.
All reactions