Skip to content

Commit

Permalink
PORTALS-3372: If LLFS_Metabolomics study key, redirect to LLFS
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-hodgson committed Jan 8, 2025
1 parent 30f191c commit 4a0b93b
Showing 1 changed file with 65 additions and 56 deletions.
121 changes: 65 additions & 56 deletions apps/portals/elportal/src/pages/StudyDetailsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import DetailsPage from '@sage-bionetworks/synapse-portal-framework/components/DetailsPage/index'
import { MarkdownSynapseFromColumnData } from '@sage-bionetworks/synapse-portal-framework/components/DetailsPage/markdown/MarkdownSynapseFromColumnData'
import RedirectWithQuery from '@sage-bionetworks/synapse-portal-framework/components/RedirectWithQuery'
import RedirectToURL from '@sage-bionetworks/synapse-portal-framework/components/RedirectToURL'
import { useGetPortalComponentSearchParams } from '@sage-bionetworks/synapse-portal-framework/utils/UseGetPortalComponentSearchParams'
import { ColumnSingleValueFilterOperator } from '@sage-bionetworks/synapse-types'
import { Outlet, RouteObject } from 'react-router-dom'
Expand Down Expand Up @@ -49,63 +50,71 @@ export const studyDetailsPageRoutes: RouteObject[] = [
{
path: studyDetailsPageTabConfig[0].path,
element: (
<DetailsPageContent
content={[
{
id: 'Study Description',
title: 'Study Description',
element: (
<MarkdownSynapseFromColumnData columnName={'studyDescription'} />
),
},
{
id: 'Acknowledgement',
title: 'Acknowledgement',
element: (
<MarkdownSynapseFromColumnData columnName={'ackContext'} />
),
},
{
id: 'acknowledgementFull',
element: (
<MarkdownSynapseFromColumnData
columnName={'acknowledgment'}
MarkdownCollapseProps={{
textDescription: 'full statement',
showCopyPlainText: true,
}}
/>
),
},
{
id: 'Methods',
title: 'Methods',
element: <MarkdownSynapseFromColumnData columnName={'methods'} />,
},
{
id: 'Related Studies',
title: 'Related Studies',
element: (
<DetailsPageContextConsumer columnName={'relatedStudies'}>
{({ value }) => {
if (!value) {
return null
}
<>
<DetailsPageContent
content={[
{
id: 'Study Description',
title: 'Study Description',
element: (
<MarkdownSynapseFromColumnData
columnName={'studyDescription'}
/>
),
},
{
id: 'Acknowledgement',
title: 'Acknowledgement',
element: (
<MarkdownSynapseFromColumnData columnName={'ackContext'} />
),
},
{
id: 'acknowledgementFull',
element: (
<MarkdownSynapseFromColumnData
columnName={'acknowledgment'}
MarkdownCollapseProps={{
textDescription: 'full statement',
showCopyPlainText: true,
}}
/>
),
},
{
id: 'Methods',
title: 'Methods',
element: <MarkdownSynapseFromColumnData columnName={'methods'} />,
},
{
id: 'Related Studies',
title: 'Related Studies',
element: (
<DetailsPageContextConsumer columnName={'relatedStudies'}>
{({ value }) => {
if (!value) {
return null
}

return (
<CardContainerLogic
sqlOperator={ColumnSingleValueFilterOperator.IN}
sql={studiesSql}
{...studyCardConfiguration}
searchParams={{ id: value }}
/>
)
}}
</DetailsPageContextConsumer>
),
},
]}
/>
return (
<CardContainerLogic
sqlOperator={ColumnSingleValueFilterOperator.IN}
sql={studiesSql}
{...studyCardConfiguration}
searchParams={{ id: value }}
/>
)
}}
</DetailsPageContextConsumer>
),
},
]}
/>
<RedirectToURL
toURL="/Explore/Studies/DetailsPage/StudyDetails?studyKey=LLFS"
search="studyKey=LLFS_Metabolomics"
/>
</>
),
},
{
Expand Down

0 comments on commit 4a0b93b

Please sign in to comment.