-
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.
Hide civic Fix reVUE to fit new genome nexus model Update packages - set cheerio and parse5 version in resolutions, because the 'juice' dependency in cbioportal frontend commons causes some conficts, using older version of cheerio and parse5 is a temp fix.
- Loading branch information
Showing
10 changed files
with
470 additions
and
237 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
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
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
200 changes: 100 additions & 100 deletions
200
src/component/variantPage/clinicalImplication/Civic.tsx
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 |
---|---|---|
@@ -1,112 +1,112 @@ | ||
import { observer } from 'mobx-react'; | ||
// import { observer } from 'mobx-react'; | ||
import * as React from 'react'; | ||
|
||
import { ICivicEvidenceSummary, ICivicVariantSummary } from 'cbioportal-utils'; | ||
import { DefaultTooltip } from 'cbioportal-frontend-commons'; | ||
// import { ICivicEvidenceSummary, ICivicVariantSummary } from 'cbioportal-utils'; | ||
// import { DefaultTooltip } from 'cbioportal-frontend-commons'; | ||
|
||
import { | ||
ClinicalSignificance, | ||
Evidence, | ||
EvidenceType, | ||
} from '../../../util/EvidenceUtils'; | ||
import EvidenceSummary from './EvidenceSummary'; | ||
import functionalGroupsStyle from '../functionalGroups.module.scss'; | ||
// import { | ||
// ClinicalSignificance, | ||
// Evidence, | ||
// EvidenceType, | ||
// } from '../../../util/EvidenceUtils'; | ||
// import EvidenceSummary from './EvidenceSummary'; | ||
// import functionalGroupsStyle from '../functionalGroups.module.scss'; | ||
|
||
interface ICivicProps { | ||
civic?: ICivicVariantSummary; | ||
isCanonicalTranscriptSelected: boolean; | ||
} | ||
// interface ICivicProps { | ||
// civic?: ICivicVariantSummary; | ||
// isCanonicalTranscriptSelected: boolean; | ||
// } | ||
|
||
const DEFAULT_CIVIC_URL = 'https://civicdb.org/'; | ||
// const DEFAULT_CIVIC_URL = 'https://civicdb.org/'; | ||
|
||
function getEvidenceUrl(civic: ICivicVariantSummary, evidenceId: number) { | ||
return `https://civicdb.org/events/genes/${civic.geneId}/summary/variants/${civic.id}/summary/evidence/${evidenceId}/summary#evidence`; | ||
} | ||
// function getEvidenceUrl(civic: ICivicVariantSummary, evidenceId: number) { | ||
// return `https://civicdb.org/events/genes/${civic.geneId}/summary/variants/${civic.id}/summary/evidence/${evidenceId}/summary#evidence`; | ||
// } | ||
|
||
const CivicInfo: React.FunctionComponent<{ | ||
url: string; | ||
isCanonicalTranscriptSelected: boolean; | ||
}> = (props) => { | ||
return ( | ||
<DefaultTooltip | ||
placement="top" | ||
overlay={ | ||
<div style={{ maxWidth: 350 }}> | ||
<a | ||
href={props.url} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
CIViC | ||
</a>{' '} | ||
is a community-edited forum for discussion and | ||
interpretation of peer-reviewed publications pertaining to | ||
the clinical relevance of variants (or biomarker | ||
alterations) in cancer. | ||
</div> | ||
} | ||
> | ||
<a href={props.url} target="_blank" rel="noopener noreferrer"> | ||
CIViC <i className="fas fa-external-link-alt" /> | ||
{!props.isCanonicalTranscriptSelected && `*`} | ||
</a> | ||
</DefaultTooltip> | ||
); | ||
}; | ||
// const CivicInfo: React.FunctionComponent<{ | ||
// url: string; | ||
// isCanonicalTranscriptSelected: boolean; | ||
// }> = (props) => { | ||
// return ( | ||
// <DefaultTooltip | ||
// placement="top" | ||
// overlay={ | ||
// <div style={{ maxWidth: 350 }}> | ||
// <a | ||
// href={props.url} | ||
// target="_blank" | ||
// rel="noopener noreferrer" | ||
// > | ||
// CIViC | ||
// </a>{' '} | ||
// is a community-edited forum for discussion and | ||
// interpretation of peer-reviewed publications pertaining to | ||
// the clinical relevance of variants (or biomarker | ||
// alterations) in cancer. | ||
// </div> | ||
// } | ||
// > | ||
// <a href={props.url} target="_blank" rel="noopener noreferrer"> | ||
// CIViC <i className="fas fa-external-link-alt" /> | ||
// {!props.isCanonicalTranscriptSelected && `*`} | ||
// </a> | ||
// </DefaultTooltip> | ||
// ); | ||
// }; | ||
|
||
function civicEvidenceToEvidence( | ||
civicEvidence: ICivicEvidenceSummary | ||
): Evidence { | ||
return { | ||
...civicEvidence, | ||
clinicalSignificance: civicEvidence.clinicalSignificance.includes( | ||
ClinicalSignificance.Sensitivity | ||
) | ||
? ClinicalSignificance.Sensitivity | ||
: civicEvidence.clinicalSignificance, | ||
} as Evidence; | ||
} | ||
// function civicEvidenceToEvidence( | ||
// civicEvidence: ICivicEvidenceSummary | ||
// ): Evidence { | ||
// return { | ||
// ...civicEvidence, | ||
// clinicalSignificance: civicEvidence.clinicalSignificance.includes( | ||
// ClinicalSignificance.Sensitivity | ||
// ) | ||
// ? ClinicalSignificance.Sensitivity | ||
// : civicEvidence.clinicalSignificance, | ||
// } as Evidence; | ||
// } | ||
|
||
@observer | ||
export default class Civic extends React.Component<ICivicProps> { | ||
get clinicalEvidences() { | ||
return ( | ||
this.props.civic?.evidences | ||
.map(civicEvidenceToEvidence) | ||
.filter( | ||
(e) => | ||
e.type === EvidenceType.Predictive || | ||
e.type === EvidenceType.Prognostic || | ||
e.type === EvidenceType.Diagnostic | ||
) || [] | ||
); | ||
} | ||
// @observer | ||
// export default class Civic extends React.Component<ICivicProps> { | ||
// get clinicalEvidences() { | ||
// return ( | ||
// this.props.civic?.evidences | ||
// .map(civicEvidenceToEvidence) | ||
// .filter( | ||
// (e) => | ||
// e.type === EvidenceType.Predictive || | ||
// e.type === EvidenceType.Prognostic || | ||
// e.type === EvidenceType.Diagnostic | ||
// ) || [] | ||
// ); | ||
// } | ||
|
||
public render() { | ||
const url = this.props.civic ? this.props.civic.url : DEFAULT_CIVIC_URL; | ||
// public render() { | ||
// const url = this.props.civic ? this.props.civic.url : DEFAULT_CIVIC_URL; | ||
|
||
return ( | ||
<div className={functionalGroupsStyle['functional-group']}> | ||
<div className={functionalGroupsStyle['data-source']}> | ||
<CivicInfo | ||
url={url} | ||
isCanonicalTranscriptSelected={ | ||
this.props.isCanonicalTranscriptSelected | ||
} | ||
/> | ||
</div> | ||
<EvidenceSummary | ||
url={url} | ||
evidences={this.clinicalEvidences} | ||
getEvidenceUrl={this.getEvidenceUrl} | ||
/> | ||
</div> | ||
); | ||
} | ||
// return ( | ||
// <div className={functionalGroupsStyle['functional-group']}> | ||
// <div className={functionalGroupsStyle['data-source']}> | ||
// <CivicInfo | ||
// url={url} | ||
// isCanonicalTranscriptSelected={ | ||
// this.props.isCanonicalTranscriptSelected | ||
// } | ||
// /> | ||
// </div> | ||
// <EvidenceSummary | ||
// url={url} | ||
// evidences={this.clinicalEvidences} | ||
// getEvidenceUrl={this.getEvidenceUrl} | ||
// /> | ||
// </div> | ||
// ); | ||
// } | ||
|
||
private getEvidenceUrl = (evidence: ICivicEvidenceSummary) => { | ||
return this.props.civic | ||
? getEvidenceUrl(this.props.civic, evidence.id) | ||
: DEFAULT_CIVIC_URL; | ||
}; | ||
} | ||
// private getEvidenceUrl = (evidence: ICivicEvidenceSummary) => { | ||
// return this.props.civic | ||
// ? getEvidenceUrl(this.props.civic, evidence.id) | ||
// : DEFAULT_CIVIC_URL; | ||
// }; | ||
// } |
Oops, something went wrong.