Skip to content

Commit

Permalink
feat: rename analysis portals to resources and add ncbi links (#214) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterckx authored Jan 20, 2025
1 parent c53cba3 commit 3c12dea
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export const GENOME_BROWSER = "UCSC Genome Browser";
export const NCBI_ASSEMBLY = "NCBI Genome Assembly";
export const NCBI_TAXONOMY = "NCBI Taxonomy";
export const NCBI_DATASETS_URL = "https://www.ncbi.nlm.nih.gov/datasets";
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import {
BRCDataCatalogOrganism,
} from "../../../../apis/catalog/brc-analytics-catalog/common/entities";
import * as C from "../../../../components";
import { GENOME_BROWSER, NCBI_DATASETS_URL } from "./constants";
import {
GENOME_BROWSER,
NCBI_ASSEMBLY,
NCBI_DATASETS_URL,
NCBI_TAXONOMY,
} from "./constants";
import { ColumnDef } from "@tanstack/react-table";
import {
BRC_DATA_CATALOG_CATEGORY_KEY,
Expand Down Expand Up @@ -309,19 +314,41 @@ export const buildGenomeAnalysisPortals = (
genome: BRCDataCatalogGenome
): ComponentProps<typeof C.AnalysisPortals> => {
return {
portals: genome.ucscBrowserUrl
? [
{
imageProps: {
alt: GENOME_BROWSER,
src: "/analysis-portals/ucsc-genome.png",
width: 20,
portals: [
...(genome.ucscBrowserUrl
? [
{
imageProps: {
alt: GENOME_BROWSER,
src: "/analysis-portals/ucsc-genome.png",
width: 20,
},
label: GENOME_BROWSER,
url: genome.ucscBrowserUrl,
},
label: GENOME_BROWSER,
url: genome.ucscBrowserUrl,
},
]
: [],
]
: []),
{
imageProps: {
alt: NCBI_ASSEMBLY,
src: "/analysis-portals/ncbi.png",
width: 20,
},
label: NCBI_ASSEMBLY,
url: `${NCBI_DATASETS_URL}/genome/${genome.accession}`,
},
{
imageProps: {
alt: NCBI_TAXONOMY,
src: "/analysis-portals/ncbi.png",
width: 20,
},
label: NCBI_TAXONOMY,
url: `${NCBI_DATASETS_URL}/taxonomy/${encodeURIComponent(
genome.ncbiTaxonomyId
)}`,
},
],
};
};

Expand Down
Binary file added public/analysis-portals/ncbi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const sideColumn: ComponentsConfig = [
{
component: C.SectionTitle,
props: {
title: "Analysis Portals",
title: "Resources",
},
} as ComponentConfig<typeof C.SectionTitle>,
{
Expand Down

0 comments on commit 3c12dea

Please sign in to comment.