diff --git a/frontend/packages/data-portal/app/components/AuthorLink/types.ts b/frontend/packages/data-portal/app/components/AuthorLink/types.ts index 319e2de54..181333a8b 100644 --- a/frontend/packages/data-portal/app/components/AuthorLink/types.ts +++ b/frontend/packages/data-portal/app/components/AuthorLink/types.ts @@ -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 diff --git a/frontend/packages/data-portal/app/components/Download/ConfigureTomogramDownloadContent.tsx b/frontend/packages/data-portal/app/components/Download/ConfigureTomogramDownloadContent.tsx index 1291c66d0..3c6418f2b 100644 --- a/frontend/packages/data-portal/app/components/Download/ConfigureTomogramDownloadContent.tsx +++ b/frontend/packages/data-portal/app/components/Download/ConfigureTomogramDownloadContent.tsx @@ -183,6 +183,7 @@ export function ConfigureTomogramDownloadContent() { className="!w-full !mt-sds-xl !mb-sds-xxs" intent="info" expandable + sdsStage="open" >

diff --git a/frontend/packages/data-portal/app/components/Download/DownloadOptionsContent.tsx b/frontend/packages/data-portal/app/components/Download/DownloadOptionsContent.tsx index 61b594a87..161f848eb 100644 --- a/frontend/packages/data-portal/app/components/Download/DownloadOptionsContent.tsx +++ b/frontend/packages/data-portal/app/components/Download/DownloadOptionsContent.tsx @@ -140,6 +140,12 @@ export function DownloadOptionsContent() { value={tomogramToDownload.alignment.id} /> )} + {annotationToDownload && ( + + )} {fileFormat && ( span:nth-child(1) { @apply flex items-center p-0; } + + :global(.MuiButtonBase-root) { + @apply !px-sds-s !py-sds-xs; + } } .inputText { diff --git a/frontend/packages/data-portal/app/components/Run/AnnotationOveriewTable.tsx b/frontend/packages/data-portal/app/components/Run/AnnotationOveriewTable.tsx index 5cfd16a60..21bc2eaeb 100644 --- a/frontend/packages/data-portal/app/components/Run/AnnotationOveriewTable.tsx +++ b/frontend/packages/data-portal/app/components/Run/AnnotationOveriewTable.tsx @@ -10,6 +10,7 @@ import { MethodLinkDataType } from 'app/components/Deposition/MethodLinks/type' import { Link } from 'app/components/Link' import { IdPrefix } from 'app/constants/idPrefixes' import { useI18n } from 'app/hooks/useI18n' +import { useRunById } from 'app/hooks/useRunById' import { useAnnotation } from 'app/state/annotation' import { useFeatureFlag } from 'app/utils/featureFlags' @@ -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 } @@ -106,8 +114,10 @@ export function AnnotationOverviewTable() { /> ), - // TODO(bchu): Integrate with alignment.id after annotations field migrated. - values: [], + values: [ + v2AnnotationShape?.annotationFiles.edges.at(0)?.node + .alignmentId ?? '--', + ], }, ] : []), diff --git a/frontend/packages/data-portal/app/components/Run/AnnotationTable.tsx b/frontend/packages/data-portal/app/components/Run/AnnotationTable.tsx index 9ef10c5f1..17f0f0b94 100644 --- a/frontend/packages/data-portal/app/components/Run/AnnotationTable.tsx +++ b/frontend/packages/data-portal/app/components/Run/AnnotationTable.tsx @@ -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}`, diff --git a/frontend/packages/data-portal/app/components/Run/RunHeader.tsx b/frontend/packages/data-portal/app/components/Run/RunHeader.tsx index f11b70433..1036c11c4 100644 --- a/frontend/packages/data-portal/app/components/Run/RunHeader.tsx +++ b/frontend/packages/data-portal/app/components/Run/RunHeader.tsx @@ -65,7 +65,7 @@ export function RunHeader() { const tomogramV2 = tomograms.find( (currentTomogram) => - currentTomogram.isVisualizationDefault ?? + // TODO use `isVisualizationDefault` when data is ready currentTomogram.isAuthorSubmitted, ) ?? tomograms.at(0) diff --git a/frontend/packages/data-portal/app/components/Run/TomogramMetadataDrawer.tsx b/frontend/packages/data-portal/app/components/Run/TomogramMetadataDrawer.tsx index 7abe9489d..b4d3059fc 100644 --- a/frontend/packages/data-portal/app/components/Run/TomogramMetadataDrawer.tsx +++ b/frontend/packages/data-portal/app/components/Run/TomogramMetadataDrawer.tsx @@ -68,7 +68,7 @@ export function TomogramMetadataDrawer() { }, { label: t('relatedDatabases'), - values: [], // TODO + values: [tomogram.relatedDatabaseEntries ?? ''], renderValue: (value: string) => ( ), @@ -99,11 +99,11 @@ export function TomogramMetadataDrawer() { }, { label: t('releaseDate'), - values: [], // TODO + values: [tomogram.releaseDate ?? ''], }, { label: t('lastModifiedDate'), - values: [], // TODO + values: [tomogram.lastModifiedDate ?? ''], }, )} /> @@ -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'), @@ -138,7 +138,7 @@ export function TomogramMetadataDrawer() { { label: t('voxelSpacing'), subLabel: ( -

+
{t('sizeXYZ')}
), @@ -149,7 +149,9 @@ export function TomogramMetadataDrawer() { renderValues: (values: string[]) => ( ), }, @@ -194,7 +196,20 @@ export function TomogramMetadataDrawer() { }, { label: t('canonicalStatus'), - values: [], // TODO + values: [tomogram.isPortalStandard ? 'True' : 'False'], + labelExtra: ( + } + placement="top" + > + + + ), }, { label: t('alignmentType'), diff --git a/frontend/packages/data-portal/app/components/Run/TomogramTable.tsx b/frontend/packages/data-portal/app/components/Run/TomogramTable.tsx index 53e4ab80c..f6fcf1f29 100644 --- a/frontend/packages/data-portal/app/components/Run/TomogramTable.tsx +++ b/frontend/packages/data-portal/app/components/Run/TomogramTable.tsx @@ -67,13 +67,14 @@ export function TomogramsTable() { ), cell: ({ row: { original } }) => (
{getTomogramName(original)}
-
+ +
{`${t('tomogramId')}: ${IdPrefix.Tomogram}-${original.id}`} {original.isPortalStandard && ( @@ -84,7 +85,8 @@ export function TomogramsTable() { )}
-
+ +
edge.node)} compact @@ -110,7 +112,10 @@ export function TomogramsTable() { }), columnHelper.accessor('alignment.id', { header: () => ( - + } + > {t('alignmentId')} ), @@ -144,7 +149,7 @@ export function TomogramsTable() { cell: ({ getValue, row: { original } }) => ( {t('unitAngstrom', { value: getValue() })} -
+
({original.sizeX}, {original.sizeY}, {original.sizeZ})px
@@ -180,9 +185,8 @@ export function TomogramsTable() { cell: ({ row: { original } }) => (
- {/* TODO Use only `isVisualizationDefault` when data is available */} - {(original.isVisualizationDefault ?? - original.isAuthorSubmitted) && ( + {/* TODO use `isVisualizationDefault` when data is ready */} + {original.isAuthorSubmitted && (

{title && ( @@ -72,7 +75,11 @@ export function MetadataTable({ > {datum.renderValues?.(values) ?? match(values.length) - .with(0, () => null) + .with(0, () => ( + + {t('notSubmitted')} + + )) .with(1, () => ( {datum.renderValue?.(values[0]) ?? values[0]} diff --git a/frontend/packages/data-portal/app/components/TablePageLayout.tsx b/frontend/packages/data-portal/app/components/TablePageLayout.tsx index f4dcd4f49..57890f51b 100644 --- a/frontend/packages/data-portal/app/components/TablePageLayout.tsx +++ b/frontend/packages/data-portal/app/components/TablePageLayout.tsx @@ -178,10 +178,10 @@ function TablePageTabContent({ >

{banner &&
{banner}
} diff --git a/frontend/packages/data-portal/app/components/ViewTomogramButton.tsx b/frontend/packages/data-portal/app/components/ViewTomogramButton.tsx index daf53326f..0c3008f34 100644 --- a/frontend/packages/data-portal/app/components/ViewTomogramButton.tsx +++ b/frontend/packages/data-portal/app/components/ViewTomogramButton.tsx @@ -67,6 +67,7 @@ export function ViewTomogramButton({ }} onMouseEnter={() => setIsHoveringOver?.(true)} onMouseLeave={() => setIsHoveringOver?.(false)} + className="min-w-[144px]" >