-
Notifications
You must be signed in to change notification settings - Fork 11
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
feat: Migrate annotations table to V2 data #1433
Conversation
559543a
to
49eaad5
Compare
22f3340
to
b3a5f3e
Compare
@@ -115,16 +119,10 @@ export function DownloadOptionsContent() { | |||
value={getTomogramName(referenceTomogram)} | |||
/> | |||
)} | |||
{annotationToDownload && tomogramToDownload?.alignment && ( |
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.
We don't need to check the tomogramToDownload?.alignment anymore?
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.
Yeah this code was super messed up. It was never supposed to display the alignmentId
of the tomogram (also this condition never evaluated to true
because it's impossible to download a single annotation and single tomogram at the same time 😭).
<AnnotationAlignmentCallout | ||
alignmentId={tomogramToDownload.alignment.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.
Oh I see! re: tomogramToDownload.alignment.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.
Yeah this condition was also just never evaluating to true (effect was that on this page you'd always see the truncated version of the callout)...
useDownloadModalContext() | ||
|
||
const annotationFileAlignmentId = | ||
annotationShapeToDownload?.annotationFiles.edges.find( |
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.
is this something we want to deduplicate?
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.
this should just produce on alignmentId
at the end (technically all the files rn should have the same alignmentId
but in a future world maybe it won't be)
const LOADING_ANNOTATIONS: AnnotationShape[] = range(0, MAX_PER_PAGE).map( | ||
() => ({ | ||
id: 0, | ||
annotationFiles: { | ||
edges: [], | ||
}, | ||
annotation: { | ||
annotationMethod: '', | ||
authors: { | ||
edges: [], | ||
}, | ||
depositionDate: '', | ||
id: 0, | ||
lastModifiedDate: '', | ||
methodLinks: { | ||
edges: [], | ||
}, | ||
methodType: Annotation_Method_Type_Enum.Manual, | ||
objectId: '', | ||
objectName: '', | ||
releaseDate: '', | ||
}, | ||
shapeType: Annotation_File_Shape_Type_Enum.Point, | ||
}), |
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.
Such a different shape!
@@ -209,7 +208,7 @@ export function getDatasetsFilter({ | |||
where.runs.annotations ??= {} | |||
where.runs.annotations.annotationShapes = { | |||
shapeType: { | |||
_in: objectShapeTypes as Annotation_File_Shape_Type_Enum[], // TODO(bchu): Remove typecast. | |||
_in: objectShapeTypes, |
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.
nice
@rainandbare Thanks for looking through! |
closes #1373
closes #1020
closes #581
#1232
Annotation_File_Shape_Type_Enum
values from V2 directly.