-
Notifications
You must be signed in to change notification settings - Fork 1
Allow users to add reference materials #297
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
base: vetting-workflow
Are you sure you want to change the base?
Conversation
c99e650 to
a1400c0
Compare
BryonLewis
left a comment
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.
Some minor changes and questions about the overall
| @pytest.mark.django_db | ||
| def test_create_vetting_details(client): | ||
| test_text = 'foo' | ||
| data = {'reference_materials': test_text} | ||
| test_user = UserFactory() | ||
| client.force_login(user=test_user) | ||
| resp = client.post( | ||
| f'/api/v1/vetting/user/{test_user.id}', data=data, content_type='application/json' | ||
| ) | ||
| assert resp.status_code == 200 | ||
| assert resp.json()['user_id'] == test_user.id |
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.
There is a DB constraint for the text size, should we be testin that in the tests?
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.
client/src/views/Spectrogram.vue
Outdated
| <v-dialog | ||
| v-model="referenceDialog" | ||
| max-width="50%" | ||
| > | ||
| <template #activator="{ props }"> | ||
| <v-btn | ||
| v-bind="props" | ||
| > | ||
| Add reference materials | ||
| </v-btn> | ||
| </template> | ||
| <v-card> | ||
| <v-card-title> | ||
| Reference Materials | ||
| </v-card-title> | ||
| <v-card-text> | ||
| <v-textarea | ||
| v-model="reviewerMaterials" | ||
| placeholder="Describe any reference materials used during labeling" | ||
| @update:model-value="saveReviewerMaterials" | ||
| /> | ||
| </v-card-text> | ||
| <v-card-actions> | ||
| <v-btn | ||
| @click="referenceDialog = false" | ||
| > | ||
| Close | ||
| </v-btn> | ||
| </v-card-actions> |
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.
Since it is already in a V-dialog I would probably swap this to using a submit/cancel button and have the saving of new data connected to the submit button and cancellation prevent saving the data.
Mostly because with 500ms if you are a fast typer and hit the 2000 character limit you could get an unseen error that doesn't save the data (or if you are pasting data in).
I'd suggest swapping it to that instead of debouncing and also making it so the textarea has a limit of 2000 characters and then it will have a rule show up as well as disabling the submit button.
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.
Refactored into a separate component in 2dff11e
8db34c7 to
821c17d
Compare
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 think it is missing a way to open the Reference Materials Dialog
BryonLewis
left a comment
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.
The length check was set to 20 instead of 2000.
Minor note about 'save'/'close' ordering. Up to you if you want to change it.
Co-authored-by: Bryon Lewis <61746913+BryonLewis@users.noreply.github.com>
BryonLewis
left a comment
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.
👍
Vetting Workflow
Fix #287
Models vetting details for a particular user. Right now this means being able to capture any reference materials used by a user.
This is currently implemented as a text field that is accessible from the spectrogram sidebar.
