From 5ef07ea78a03363a1083cb04bfeb0105b2e5e220 Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 14 Nov 2024 15:50:29 +0000 Subject: [PATCH 1/3] Remove links for entities without tables --- src/main/cliapp/src/components/EntityCountsComponent.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/cliapp/src/components/EntityCountsComponent.js b/src/main/cliapp/src/components/EntityCountsComponent.js index 7a5333e73..13073b14b 100644 --- a/src/main/cliapp/src/components/EntityCountsComponent.js +++ b/src/main/cliapp/src/components/EntityCountsComponent.js @@ -29,6 +29,7 @@ export const EntityCountsComponent = () => { name: CLASSES[key].name, link: CLASSES[key].link, type: CLASSES[key].type, + hasTable: CLASSES[key].hasTable, isIndexed: CLASSES[key].isIndexed, dbCount: res.entity[key]['dbCount'], esCount: res.entity[key]['esCount'], @@ -44,6 +45,9 @@ export const EntityCountsComponent = () => { }, []); const nameHyperlinkTemplate = (rowData) => { + if (!rowData.hasTable) { + return rowData.name; + } return {rowData.name}; }; From 10e1b8c0c7fca464fac63c21aa1beaf8bf9cbb3a Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 14 Nov 2024 15:59:29 +0000 Subject: [PATCH 2/3] Use link presence instead of hasTable to allow linking to parent tables --- .../src/components/EntityCountsComponent.js | 3 +-- src/main/cliapp/src/constants/Classes.js | 21 ------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/src/main/cliapp/src/components/EntityCountsComponent.js b/src/main/cliapp/src/components/EntityCountsComponent.js index 13073b14b..d1caed616 100644 --- a/src/main/cliapp/src/components/EntityCountsComponent.js +++ b/src/main/cliapp/src/components/EntityCountsComponent.js @@ -29,7 +29,6 @@ export const EntityCountsComponent = () => { name: CLASSES[key].name, link: CLASSES[key].link, type: CLASSES[key].type, - hasTable: CLASSES[key].hasTable, isIndexed: CLASSES[key].isIndexed, dbCount: res.entity[key]['dbCount'], esCount: res.entity[key]['esCount'], @@ -45,7 +44,7 @@ export const EntityCountsComponent = () => { }, []); const nameHyperlinkTemplate = (rowData) => { - if (!rowData.hasTable) { + if (!rowData.link) { return rowData.name; } return {rowData.name}; diff --git a/src/main/cliapp/src/constants/Classes.js b/src/main/cliapp/src/constants/Classes.js index 37e0a9145..4f9fd3acf 100644 --- a/src/main/cliapp/src/constants/Classes.js +++ b/src/main/cliapp/src/constants/Classes.js @@ -98,7 +98,6 @@ export const CLASSES = Object.freeze({ Reference: { name: 'Literature References', link: '/#/references', type: 'entity', hasTable: true, isIndexed: false }, SequenceTargetingReagent: { name: 'Sequence Targeting Reagents', - link: '/#/sqtrs', type: 'entity', hasTable: false, isIndexed: true, @@ -108,56 +107,48 @@ export const CLASSES = Object.freeze({ Exon: { name: 'Exons', link: '/#/exons', type: 'entity', hasTable: false, isIndexed: false }, CodingSequence: { name: 'Coding Sequences', - link: '/#/codingSequences', type: 'entity', hasTable: false, isIndexed: false, }, AssemblyComponent: { name: 'Assembly Components', - link: '/#/assemblyComponents', type: 'entity', hasTable: false, isIndexed: false, }, GenomeAssembly: { name: 'Genome Assemblies', - link: '/#/genomeAssemblies', type: 'entity', hasTable: false, isIndexed: true, }, GeneExpressionAnnotation: { name: 'Gene Expression Annotations', - link: '/#/geneExpressionAnnotations', type: 'entity', hasTable: false, isIndexed: true, }, PredictedVariantConsequence: { name: 'Predicted Variant Consequences', - link: '/#/predictedVariantConsequences', type: 'entity', hasTable: false, isIndexed: false, }, HTPExpressionDatasetAnnotation: { name: 'HTP Expression Dataset Annotations', - link: '/#/htpExpressionDatasetAnnotations', type: 'entity', hasTable: false, isIndexed: false, }, HTPExpressionDatasetSampleAnnotation: { name: 'HTP Expression Dataset Sample Annotations', - link: '/#/htpExpressionDatasetSampleAnnotations', type: 'entity', hasTable: false, isIndexed: false, }, GeneOntologyAnnotation: { name: 'Gene Ontology Annotations', - link: '/#/geneOntologyAnnotations', type: 'entity', hasTable: false, isIndexed: false, @@ -226,73 +217,61 @@ export const CLASSES = Object.freeze({ AlleleGeneAssociation: { name: 'Allele Gene Associations', - link: '/#/alleleGeneAssociations', type: 'association', hasTable: false, }, AlleleVariantAssociation: { name: 'Allele Variant Associations', - link: '/#/alleleVariantAssociations', type: 'association', hasTable: false, }, CodingSequenceGenomicLocationAssociation: { name: 'CDS Genomic Locations', - link: '/#/cdsGenomicLocations', type: 'association', hasTable: false, }, ExonGenomicLocationAssociation: { name: 'Exon Genomic Locations', - link: '/#/exonGenomicLocations', type: 'association', hasTable: false, }, GeneGenomicLocationAssociation: { name: 'Gene Genomic Locations', - link: '/#/geneGenomicLocations', type: 'association', hasTable: false, }, TranscriptGenomicLocationAssociation: { name: 'Transcript Genomic Locations', - link: '/#/transcriptGenomicLocations', type: 'association', hasTable: false, }, VariantGenomicLocationAssociation: { name: 'Variant Genomic Locations', - link: '/#/variantGenomicLocations', type: 'association', hasTable: false, }, ConstructGenomicEntityAssociation: { name: 'Construct Genomic Entity Associations', - link: '/#/constructGenomicEntityAssociations', type: 'association', hasTable: false, }, SequenceTargetingReagentGeneAssociation: { name: 'SQTR Gene Associations', - link: '/#/sqtrGeneAssociations', type: 'association', hasTable: false, }, TranscriptCodingSequenceAssociation: { name: 'Transcript CDS Associations', - link: '/#/transcriptCodingSequenceAssociations', type: 'association', hasTable: false, }, TranscriptExonAssociation: { name: 'Transcript Exon Associations', - link: '/#/transcriptExonAssociations', type: 'association', hasTable: false, }, TranscriptGeneAssociation: { name: 'Transcript Gene Associations', - link: '/#/transcriptGeneAssociations', type: 'association', hasTable: false, }, From 27baf84ebc4869dd1c8e1d58bdf35b0948f40fff Mon Sep 17 00:00:00 2001 From: markquintontulloch Date: Thu, 14 Nov 2024 16:13:07 +0000 Subject: [PATCH 3/3] Failsafe check for links on dashboard --- src/main/cliapp/src/containers/dashboardPage/Dashboard.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/cliapp/src/containers/dashboardPage/Dashboard.js b/src/main/cliapp/src/containers/dashboardPage/Dashboard.js index 7ab4e2623..856dda775 100644 --- a/src/main/cliapp/src/containers/dashboardPage/Dashboard.js +++ b/src/main/cliapp/src/containers/dashboardPage/Dashboard.js @@ -26,6 +26,9 @@ export const Dashboard = () => { }, []); const nameHyperlinkTemplate = (rowData) => { + if (!rowData.link) { + return rowData.name; + } return {rowData.name}; };