From ace432deeaf8958d7cc8f5cb0fcb88e9ec8db5a1 Mon Sep 17 00:00:00 2001 From: katie stahl Date: Tue, 10 Oct 2023 14:29:30 -0400 Subject: [PATCH] Dev (#442) * fix: use correct indication attribute name (#408) * fix: add URL cites back (#409) * add release information component for footer * run prettier * cleanup: make about links consistent (#413) * make footer no longer sticky * fix: correct source versioning (#421) * fix: clean up GtoP import (#419) * fix: use latest GO address (#424) * feat: bump drugbank version (#422) * feat: alphabetize sources * refactor: alphabetize sources * style: running prettier to prettify the sort data function * fix: sort on pmid and source columns * feat: add sources to interaction page * feat: reduce precision of interaction score on interaction page to 2 decimal places --------- Co-authored-by: James Stevenson Co-authored-by: Adam Coffman --- .../Browse/Sources/BrowseSources.tsx | 15 +- .../InteractionRecord/InteractionRecord.tsx | 27 ++- client/src/components/Layout/MainLayout.scss | 2 - client/src/components/Layout/MainLayout.tsx | 38 ++-- .../InteractionTable/InteractionTable.tsx | 8 +- .../ReleaseInformation.scss | 8 + .../ReleaseInformation/ReleaseInformation.tsx | 51 +++++ .../hooks/queries/useGetInteractionRecord.ts | 3 + client/src/index.css | 1 + client/src/pages/About/About.scss | 21 +- .../src/pages/About/SubSections/Contact.tsx | 195 +++++++++++++----- .../src/pages/About/SubSections/Overview.tsx | 86 +++++++- .../pages/About/SubSections/Publications.tsx | 59 +++--- .../tsv_exporters/gene_interactions_tsv.rb | 2 +- .../importers/api_importers/go/api_client.rb | 2 +- .../caris_molecular_intelligence.rb | 2 +- .../genome/importers/file_importers/cgi.rb | 2 +- .../clearity_foundation_biomarkers.rb | 1 + .../clearity_foundation_clinical_trial.rb | 1 + .../importers/file_importers/drugbank.rb | 2 +- .../genome/importers/file_importers/dtc.rb | 2 +- .../genome/importers/file_importers/fda.rb | 1 + .../file_importers/foundation_one_genes.rb | 2 +- .../file_importers/guide_to_pharmacology.rb | 80 +++---- .../importers/file_importers/pharmgkb.rb | 2 +- server/lib/genome/names.rb | 1 + 26 files changed, 439 insertions(+), 175 deletions(-) create mode 100644 client/src/components/Shared/ReleaseInformation/ReleaseInformation.scss create mode 100644 client/src/components/Shared/ReleaseInformation/ReleaseInformation.tsx diff --git a/client/src/components/Browse/Sources/BrowseSources.tsx b/client/src/components/Browse/Sources/BrowseSources.tsx index 277727e9..a7316f55 100644 --- a/client/src/components/Browse/Sources/BrowseSources.tsx +++ b/client/src/components/Browse/Sources/BrowseSources.tsx @@ -27,10 +27,17 @@ export const BrowseSources = () => { 'POTENTIALLY_DRUGGABLE' ); - let geneSources = geneData?.sources?.nodes; - let drugSources = drugData?.sources?.nodes; - let interactionSources = interactionData?.sources?.nodes; - let potentiallyDruggableSources = potentiallyDruggableData?.sources?.nodes; + const getSortedData = (data: any) => { + return data?.sources?.nodes?.sort( + (a: { sourceDbName: string }, b: { sourceDbName: any }) => + a.sourceDbName.localeCompare(b.sourceDbName) + ); + }; + + let geneSources = getSortedData(geneData); + let drugSources = getSortedData(drugData); + let interactionSources = getSortedData(interactionData); + let potentiallyDruggableSources = getSortedData(potentiallyDruggableData); const sectionsMap = [ { diff --git a/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx b/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx index b50fb760..21196af6 100644 --- a/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx +++ b/client/src/components/Interaction/InteractionRecord/InteractionRecord.tsx @@ -15,6 +15,7 @@ import AccordionSummary from '@mui/material/AccordionSummary'; import AccordionDetails from '@mui/material/AccordionDetails'; import ExpandMoreIcon from '@mui/icons-material/ExpandMore'; import ArrowRightIcon from '@mui/icons-material/ArrowRight'; +import { truncateDecimals } from 'utils/format'; export const InteractionRecord: React.FC = () => { const interactionId = useParams().id; @@ -61,7 +62,7 @@ export const InteractionRecord: React.FC = () => { Interaction Score: - {data?.interaction?.interactionScore} + {truncateDecimals(data?.interaction?.interactionScore, 2)} @@ -116,6 +117,30 @@ export const InteractionRecord: React.FC = () => { ), }, + { + name: 'Sources', + sectionContent: ( + + + + {data?.interaction?.sources.length + ? data?.interaction?.sources?.map( + (source: any, index: number) => { + return ( + + + {source.fullName} + + + ); + } + ) + : noData} + +
+
+ ), + }, ]; return ( diff --git a/client/src/components/Layout/MainLayout.scss b/client/src/components/Layout/MainLayout.scss index 8296bb44..0972e129 100644 --- a/client/src/components/Layout/MainLayout.scss +++ b/client/src/components/Layout/MainLayout.scss @@ -100,8 +100,6 @@ header { footer { background-color: var(--theme-primary); - position: fixed; - bottom: 0; color: white; margin-top: auto; width: 100%; diff --git a/client/src/components/Layout/MainLayout.tsx b/client/src/components/Layout/MainLayout.tsx index 2b9d0564..e83acd38 100644 --- a/client/src/components/Layout/MainLayout.tsx +++ b/client/src/components/Layout/MainLayout.tsx @@ -10,6 +10,7 @@ import { GlobalClientContext } from 'stores/Global/GlobalClient'; import './MainLayout.scss'; import { Box, Button, IconButton, Menu, MenuItem } from '@mui/material'; import HighlightOffIcon from '@mui/icons-material/HighlightOff'; +import ReleaseInformation from 'components/Shared/ReleaseInformation/ReleaseInformation'; type MainLayoutProps = { children: React.ReactNode; @@ -80,24 +81,29 @@ const Header: React.FC = () => { }; const Footer: React.FC = () => { - const { dispatch } = useContext(GlobalClientContext); + const { state, dispatch } = useContext(GlobalClientContext); return (
- Disclaimer: This resource is intended for purely research purposes. It - should not be used for emergencies or medical or professional advice. - dispatch({ type: ActionTypes.HideDisclaimer })} - > - - + {state.themeSettings.showDisclaimer && ( +
+ Disclaimer: This resource is intended for purely research purposes. It + should not be used for emergencies or medical or professional advice. + dispatch({ type: ActionTypes.HideDisclaimer })} + > + + +
+ )} +
); }; @@ -127,7 +133,7 @@ export const MainLayout = ({ children }: MainLayoutProps) => {
{children}
- {state.themeSettings.showDisclaimer &&