import React from 'react'; import UsageAgreement from 'shared/components/UsageAgreement'; import { getServerConfig } from 'config/config'; import { getBrowserWindow } from 'cbioportal-frontend-commons'; import expiredStorage from 'expired-storage'; const STUDY_VIEW_WARNING_PERSISTENCE_KEY = 'private_study_link_warning_dismissed2'; export function shouldShowStudyViewWarning() { // we want to show a warning message on private cbioportal instances // to prevent users from adding links in manuscripts // we don't want to show this in MSK CIS setting (iframe) const showStudyViewWarning = ['triage-portal', 'mskcc-portal'].includes( getServerConfig().app_name! ) && !getBrowserWindow().isMSKCIS; return ( showStudyViewWarning && new expiredStorage().getItem(STUDY_VIEW_WARNING_PERSISTENCE_KEY) !== 'true' ); } export const StudyAgreement: React.FunctionComponent<{}> = function({}) { return ( WARNING:  All URLs in this website are private - do NOT include in manuscripts. } persistenceKey={STUDY_VIEW_WARNING_PERSISTENCE_KEY} expirationInDays={90} clauses={[ <> {' '} When adding a link to a cBioPortal cohort in a manuscript,{' '} I will not link to this private portal ( {window.location.hostname}) , but will instead link to this study on the public cBioPortal ( cbioportal.org ). Contact{' '} cbioportal@cbio.mskcc.org {' '} with any questions about getting the data transferred to the public cBioPortal. , <> When adding a link to a cBioPortal cohort in a manuscript,{' '} I will not link to this private portal ( {window.location.hostname}) , but will instead link to this study on the public cBioPortal ( cbioportal.org ). Contact{' '} cbioportal@cbio.mskcc.org {' '} with any questions about getting the data transferred to the public cBioPortal. , <> I have read the{' '} MSK-IMPACT Data publication guidelines . , ]} /> ); };