Skip to content

Commit 18c672a

Browse files
committed
adding missing commit for #1852
1 parent 4ad2cdc commit 18c672a

File tree

5 files changed

+41
-42
lines changed

5 files changed

+41
-42
lines changed

frontend/packages/data-portal/app/components/Deposition/DepositedInTableCell.tsx

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,27 @@ export function DepositedInTableCell({
2222
runId?: number
2323
runName?: string
2424
}) {
25-
const depositItems: DepositItem[] = useMemo(
26-
() => [
27-
...(datasetId && datasetTitle
28-
? [
29-
{
30-
label: 'dataset' as I18nKeys,
31-
value: datasetTitle,
32-
url: `/datasets/${datasetId}`,
33-
},
34-
]
35-
: []),
25+
const depositItems = useMemo(() => {
26+
const items: DepositItem[] = []
3627

37-
...(runId && runName
38-
? [
39-
{
40-
label: 'run' as I18nKeys,
41-
value: runName,
42-
url: `/runs/${runId}`,
43-
},
44-
]
45-
: []),
46-
],
47-
[datasetId, datasetTitle, runId, runName],
48-
)
28+
if (datasetId && datasetTitle) {
29+
items.push({
30+
label: 'dataset' as I18nKeys,
31+
value: datasetTitle,
32+
url: `/datasets/${datasetId}`,
33+
})
34+
}
35+
36+
if (runId && runName) {
37+
items.push({
38+
label: 'run' as I18nKeys,
39+
value: runName,
40+
url: `/runs/${runId}`,
41+
})
42+
}
43+
44+
return items
45+
}, [datasetId, datasetTitle, runId, runName])
4946

5047
const { t } = useI18n()
5148

frontend/packages/data-portal/app/components/Deposition/DepositionAnnotationTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const LOADING_ANNOTATIONS = Array.from(
3737
edges: [
3838
{
3939
node: {
40-
s3Path: 's3://example.com/loading',
40+
s3Path: '',
4141
},
4242
},
4343
],
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { TableCount } from './TableCount'
2+
import type { TableHeaderProps } from './types'
3+
4+
export function TableCountHeader({
5+
filteredCount,
6+
totalCount,
7+
countLabel,
8+
}: TableHeaderProps) {
9+
return (
10+
<div className="ml-sds-xl flex items-center">
11+
<TableCount
12+
filteredCount={filteredCount}
13+
totalCount={totalCount}
14+
type={countLabel}
15+
/>
16+
</div>
17+
)
18+
}

frontend/packages/data-portal/app/graphql/getDatasetByIdV2.server.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const GET_DATASET_BY_ID_QUERY_V2 = gql(`
4141
description
4242
deposition{
4343
id
44+
description
4445
annotationsAggregate(where: {annotationShapes: {annotationFilesAggregate: {count: {filter: {isVisualizationDefault: {_eq: true}}}}}}) {
4546
aggregate {
4647
count

frontend/packages/data-portal/app/routes/depositions.$id.tsx

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ import { DepositionMetadataDrawer } from 'app/components/Deposition/DepositionMe
1717
import { DepositionTableRenderer } from 'app/components/Deposition/DepositionTableRenderer'
1818
import { NoFilteredResults } from 'app/components/NoFilteredResults'
1919
import { TablePageLayout } from 'app/components/TablePageLayout'
20-
import { TableCount } from 'app/components/TablePageLayout/TableCount'
21-
import type { TableHeaderProps } from 'app/components/TablePageLayout/types'
20+
import { TableCountHeader } from 'app/components/TablePageLayout/TableCountHeader'
2221
import { DEPOSITION_FILTERS } from 'app/constants/filterQueryParams'
2322
import { QueryParams } from 'app/constants/query'
2423
import { getDepositionAnnotations } from 'app/graphql/getDepositionAnnotationsV2.server'
@@ -221,19 +220,3 @@ export default function DepositionByIdPage() {
221220
/>
222221
)
223222
}
224-
225-
function TableCountHeader({
226-
filteredCount,
227-
totalCount,
228-
countLabel,
229-
}: TableHeaderProps) {
230-
return (
231-
<div className="ml-sds-xl flex items-center">
232-
<TableCount
233-
filteredCount={filteredCount}
234-
totalCount={totalCount}
235-
type={countLabel}
236-
/>
237-
</div>
238-
)
239-
}

0 commit comments

Comments
 (0)