Skip to content

Commit

Permalink
bchu todos
Browse files Browse the repository at this point in the history
  • Loading branch information
codemonkey800 committed Oct 23, 2024
1 parent 3450c94 commit d167a22
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type AuthorInfoV2 = {
primaryAuthorStatus?: boolean | null
}

// TODO(bchu): Delete this when everything migrated.
// TODO(kira-api-migration): Delete this when everything migrated.
export function convertToAuthorInfoV2(author: AuthorInfo): AuthorInfoV2 {
return 'corresponding_author_status' in author ||
'primary_author_status' in author
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useFeatureFlag } from 'app/utils/featureFlags'

import { I18n } from '../I18n'
import { Tooltip } from '../Tooltip'
import { useRunById } from 'app/hooks/useRunById'

export function AnnotationOverviewTable() {
const { activeAnnotation: annotation } = useAnnotation()
Expand All @@ -30,6 +31,13 @@ export function AnnotationOverviewTable() {
[annotation],
)

const { annotationShapes } = useRunById()
const v2AnnotationShape = annotationShapes.find(
(currentAnnotation) =>
currentAnnotation.annotation?.id === annotation?.id &&
currentAnnotation.shapeType === annotation?.shape_type,
)

if (!annotation) {
return null
}
Expand Down Expand Up @@ -106,8 +114,10 @@ export function AnnotationOverviewTable() {
/>
</Tooltip>
),
// TODO(bchu): Integrate with alignment.id after annotations field migrated.
values: [],
values: [
v2AnnotationShape?.annotationFiles.edges.at(0)?.node
.alignmentId ?? '--',
],
},
]
: []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ export function AnnotationTable() {
datasetId: run.dataset.id,
runId: run.id,
annotationId: annotation.id,
referenceTomogramId: tomograms[0]?.id, // TODO(bchu): is_portal_standard
referenceTomogramId: tomograms.find(
(tomogram) => tomogram.isPortalStandard,
)?.id,
objectShapeType: annotation.shape_type,
fileFormat: annotation.format,
annotationName: `${annotation.fileId} ${annotation.object_name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function TomogramMetadataDrawer() {
},
{
label: t('relatedDatabases'),
values: [], // TODO
values: [tomogram.relatedDatabaseEntries ?? ''],
renderValue: (value: string) => (
<DatabaseEntryList entries={value} />
),
Expand Down Expand Up @@ -99,11 +99,11 @@ export function TomogramMetadataDrawer() {
},
{
label: t('releaseDate'),
values: [], // TODO
values: [tomogram.releaseDate ?? ''],
},
{
label: t('lastModifiedDate'),
values: [], // TODO
values: [tomogram.lastModifiedDate ?? ''],
},
)}
/>
Expand All @@ -113,11 +113,11 @@ export function TomogramMetadataDrawer() {
data={getTableData(
{
label: t('portalStandardStatus'),
values: [], // TODO
values: [tomogram.isPortalStandard ? 'True' : 'False'],
},
{
label: t('submittedByDatasetAuthor'),
values: [], // TODO
values: [tomogram.isAuthorSubmitted ? 'True' : 'False'],
},
{
label: t('reconstructionSoftware'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ const GET_RUN_BY_ID_QUERY_V2 = gql(`
sizeY
sizeZ
voxelSpacing
releaseDate
lastModifiedDate
relatedDatabaseEntries
deposition {
id
depositionDate
Expand Down

0 comments on commit d167a22

Please sign in to comment.