-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add supporting links tab in publication page (#441)
* Add supporting links tab in publication page * Use node v16.0.0 * Change tab link to supporting_links * Add banner on supporting links tab * Add linkout icon and change url to supporting-links
- Loading branch information
Showing
3 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ import { groupFilesByAttrNameAndValue } from '../lib/filterHelpers'; | |
import { Atlas, Entity, setTab } from '../lib/helpers'; | ||
import styles from './PublicationTabs.module.scss'; | ||
import { Badge } from 'react-bootstrap'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faExternalLinkAlt } from '@fortawesome/free-solid-svg-icons'; | ||
|
||
interface IPublicationTabsProps { | ||
router: NextRouter; | ||
|
@@ -29,6 +31,7 @@ export enum PublicationTab { | |
PARTICIPANTS = 'participants', | ||
BIOSPECIMENS = 'biospecimens', | ||
TOOLS = 'tools', | ||
SUPPORTING_LINKS = 'supporting-links', | ||
// other tab names are autogenerated based on assay names | ||
} | ||
|
||
|
@@ -229,6 +232,23 @@ const toolsContent: { [id: string]: JSX.Element[] } = { | |
</>, | ||
], | ||
}; | ||
|
||
const supportingLinks: { [id: string]: JSX.Element[] } = { | ||
vanderbilt_crc_chen_2021: [ | ||
<ul> | ||
<li> | ||
<a | ||
href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE196256" | ||
target="_blank" | ||
> | ||
Mouse Mist1 and Lrig1 apc tumors (GEO: GSE196256) | ||
<FontAwesomeIcon icon={faExternalLinkAlt} /> | ||
</a> | ||
</li> | ||
</ul>, | ||
], | ||
}; | ||
|
||
const PublicationTabs: React.FunctionComponent<IPublicationTabsProps> = observer( | ||
(props) => { | ||
const activeTab = props.router.query.tab || PublicationTab.ABSTRACT; | ||
|
@@ -363,6 +383,26 @@ const PublicationTabs: React.FunctionComponent<IPublicationTabsProps> = observer | |
</a> | ||
</li> | ||
)} | ||
{pubId && pubId in supportingLinks && ( | ||
<li className="nav-item"> | ||
<a | ||
onClick={() => | ||
setTab( | ||
PublicationTab.SUPPORTING_LINKS, | ||
props.router | ||
) | ||
} | ||
className={`nav-link ${ | ||
activeTab === | ||
PublicationTab.SUPPORTING_LINKS | ||
? 'active' | ||
: '' | ||
}`} | ||
> | ||
Supporting Links | ||
</a> | ||
</li> | ||
)} | ||
</ul> | ||
</div> | ||
|
||
|
@@ -488,6 +528,40 @@ const PublicationTabs: React.FunctionComponent<IPublicationTabsProps> = observer | |
)} | ||
</div> | ||
)} | ||
{activeTab === PublicationTab.SUPPORTING_LINKS && ( | ||
<div | ||
className={`tab-content fileTab ${ | ||
activeTab !== PublicationTab.SUPPORTING_LINKS | ||
? 'd-none' | ||
: '' | ||
}`} | ||
> | ||
<div className="alert alert-info" role="alert"> | ||
Supporting Links and Supporting Link | ||
Descriptions are provided by authors and are not | ||
verified by the NIH NCI or the HTAN DCC. If you | ||
think a link has been provided erroneously, | ||
please contact the corresponding author(s) and | ||
the{' '} | ||
<a | ||
href="mailto:[email protected]" | ||
className="alert-link" | ||
> | ||
HTAN DCC | ||
</a> | ||
. | ||
</div> | ||
{props.router.query.id && | ||
props.router.query.id.toString() in | ||
supportingLinks ? ( | ||
supportingLinks[ | ||
props.router.query.id.toString() | ||
] | ||
) : ( | ||
<div /> | ||
)} | ||
</div> | ||
)} | ||
</div> | ||
</> | ||
); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
196a0c6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
htan-portal-nextjs – ./
htan-portal-nextjs-git-master-htan.vercel.app
htan-portal-nextjs-htan.vercel.app
www.humantumoratlas.org
data.humantumoratlas.org
htan-portal-nextjs.vercel.app
humantumoratlas.org