New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADR-18 - Workflow routing #1107
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When not logged in, /classify
should take you back to the current workflow in the MST store eg. when using the project navigation to navigate between Talk and the classifier.
So with the caveat that there's going to be an unavoidable full-page refresh in navigating between Talk and Classify, we're going to need to start storing some MST data on the browser. I'll add an edit to reflect this, but with PHT being a single workflow project it wouldn't need to be done at the same time as the PR that implements this change - sound okay? |
I agree, that's a separate issue. One where we would leverage stashing a snapshot of the store in the browser's local storage or indexedDB and load it back up when users navigate between Talk and the classify page. |
The store could be used to get the current workflow for all classifiers, with user prefs to persist settings across login sessions. That would greatly simplify the logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few more inline comments.
603907e
to
03a7558
Compare
🎏 Just to flag a quirk about the WildCam Lab Assignments:
Whatever the shape of the new workflow routing looks like, WildCam Labs can be modified to adopt it. However, this WildCam Labs scenario does show an edge case where an "I know what I'm doing, I really want to select this workflow, for reals" flag might be needed. |
Query: does this ADR plan to address what happens when a user types in an invalid workflow choice? What I'm reading:
My assumption:
My question:
|
Yeah, I don't want any magic happening either. We should treat it like any other web resource; if you don't have access to a workflow due to permissions, you get a 401 / 403 error (depending on login status) for example. We can do some nice stuff with the error page depending on the error code though. |
I'm supportive of an error message if you do not have permission to load that workflow with UI asking what you'd like to do. I think noting that is within scope of this ADR. |
Re the classroom experience:
We will likely have to continue doing something like this, but I'd like to consider that when we fully begin implementing workflow selection strategies and note in an ADR for that specifically. |
A lot of the conversation here is about how a workflow should be selected when the classify page first loads, if one isn't specified in the URL. At the moment, the classifier component handles selecting and loading a workflow. Are we proposing that the classifier component should be able to redirect the URL of the parent page, which requires it to have some knowledge of its parent and the window location? Or are we proposing that the responsibility for workflow selection should be moved out of the classifier component, so that the parent loads a workflow then passes it into the classifier? |
Good point. I'm strongly in favour of passing in a |
The model I've been leaning towards with PFE is something like: <WorkflowSelector>
<Classifier/>
</WorkflowSelector> or See zooniverse/Panoptes-Front-End#5318 for an example. EDIT: |
I don't think workflow selection strategy should be in a component at all, classifier, HOC, or a parent. I think it should be a set of functions called by the workflow store. We could support a workflow id prop too like we do for projects. |
@srallen and I also chatted briefly about spinning up a small API to handle workflow selection. |
I think everything's been covered that needs to be in the ADR, with a future ADR to cover exactly how we do workflow selection. Is this now good to merge? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep feel free to change this to be accepted status in the ADR. I don't want to lose the comments and concerns about workflow selection functionality here, so let's open a discussion issue for it as a basis to write an ADR for that. #642 can be incorporated into an ADR for workflow selection. And I think #806 can close since we agree on architecture and can open specific issues on implementation.
closes #806 |
Following chat in #1077 (comment), this adds an ADR for how we handle workflow routing. This was done in a bit of a rush, so comments welcome
cc #806