Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
bchu1 committed Jan 17, 2025
1 parent 53190ef commit 22f3340
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function ConfigureTomogramDownloadContent() {

const {
tomogramToDownload,
allAnnotationFiles = [],
allAnnotationShapes = [],
allTomograms = [],
runId,
} = useDownloadModalContext()
Expand Down Expand Up @@ -84,7 +84,7 @@ export function ConfigureTomogramDownloadContent() {
<Radio
value={DownloadConfig.AllAnnotations}
label={t('downloadAllAnnotations')}
disabled={allAnnotationFiles.length === 0}
disabled={allAnnotationShapes.length === 0}
disabledTooltip={t('noAnnotationsAvailableToDownload')}
description={t('downloadAvailableAnnotationsInSupported')}
onClick={setAllAnnotationsConfig}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export function DownloadOptionsContent() {
{annotationShapeToDownload && (
<ModalSubtitle
label={t('alignmentId')}
value={`${IdPrefix.Alignment}-${annotationShapeToDownload.id}`}
value={`${IdPrefix.Alignment}-${annotationShapeToDownload.id}`} Wait for Kira's PR cuz of merge conflicts
/>
)}
{fileFormat && (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { createContext, useContext } from 'react'

import { GetRunByIdQuery } from 'app/__generated__/graphql'
import { AnnotationShape, TomogramV2 } from 'app/types/gqlResponseTypes'

export type DownloadModalType = 'dataset' | 'runs' | 'annotation'
Expand All @@ -9,7 +8,7 @@ export interface DownloadModalContextValue {
annotationShapeToDownload?: AnnotationShape
tomogramToDownload?: TomogramV2

allAnnotationFiles?: GetRunByIdQuery['annotation_files']
allAnnotationShapes?: AnnotationShape[]
allTomograms?: TomogramV2[]
allTomogramProcessing?: string[]
datasetId?: number
Expand Down
12 changes: 5 additions & 7 deletions frontend/packages/data-portal/app/routes/runs.$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,14 @@ export default function RunByIdPage() {
<DownloadModal
annotationShapeToDownload={activeAnnotationShape}
tomogramToDownload={activeTomogram}
allAnnotationFiles={annotationFiles}
allAnnotationShapes={annotationShapes}
allTomograms={tomograms}
allTomogramProcessing={processingMethods}
datasetId={run.dataset.id}
datasetTitle={run.dataset.title}
fileSize={fileSize}
httpsPath={httpsPath}
objectName={activeAnnotationShape?.object_name}
objectName={activeAnnotationShape?.annotation?.objectName}
runId={run.id}
runName={run.name}
s3Path={match({
Expand All @@ -259,11 +259,9 @@ export default function RunByIdPage() {
.with(
{ annotationId },
() =>
activeAnnotationShape?.files.find(
(file) =>
file.format === fileFormat &&
file.shape_type === objectShapeType,
)?.s3_path,
activeAnnotationShape?.annotationFiles.edges.find(
(file) => file.node.format === fileFormat,
)?.node.s3Path,
)
.otherwise(() => undefined)}
tomogramId={activeTomogram?.id ?? undefined}
Expand Down

0 comments on commit 22f3340

Please sign in to comment.