Skip to content

Commit

Permalink
add section to table of contents
Browse files Browse the repository at this point in the history
  • Loading branch information
austenem committed Sep 26, 2024
1 parent 9ee78ff commit 167b193
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ export type ProcessedDatasetDetails = ProcessedDatasetInfo &
| 'dataset_type'
| 'creation_action'
| 'mapped_consortium'
| 'contributors'
| 'contacts'
>;

export function useProcessedDatasetDetails(uuid: string) {
Expand Down
8 changes: 6 additions & 2 deletions context/app/static/js/pages/Dataset/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export type ProcessedDatasetInfo = Pick<
| 'dbgap_sra_experiment_url'
| 'is_component'
| 'visualization'
| 'contributors'
| 'contacts'
>;

type VitessceConf = object | undefined;
Expand Down Expand Up @@ -106,6 +108,7 @@ function useProcessedDatasets(includeComponents?: boolean) {
'dbgap_sra_experiment_url',
'is_component',
'visualization',
'contributors',
],
size: 10000,
};
Expand All @@ -128,13 +131,14 @@ function getProcessedDatasetSection({
hit: Required<SearchHit<ProcessedDatasetInfo>>;
conf?: VitessceConf;
}) {
const { pipeline, hubmap_id, files, metadata, visualization } = hit._source;
const { pipeline, hubmap_id, files, metadata, visualization, creation_action, contributors } = hit._source;

const shouldDisplaySection = {
summary: true,
visualization: visualization || Boolean(conf && 'data' in conf && conf?.data),
files: Boolean(files),
files: Boolean(files?.length !== 0),
analysis: Boolean(metadata?.dag_provenance_list),
attribution: creation_action !== 'Central Process' && Boolean(contributors),
};

const sectionsToDisplay = Object.entries(shouldDisplaySection).filter(([_k, v]) => v === true);
Expand Down

0 comments on commit 167b193

Please sign in to comment.