import * as React from 'react'; import { observer } from 'mobx-react'; import ErrorIcon from '../ErrorIcon'; import autobind from 'autobind-decorator'; import { IDriverAnnotationControlsState, IDriverAnnotationControlsHandlers, } from '../../alterationFiltering/AnnotationFilteringSettings'; import { EditableSpan, DefaultTooltip, getNCBIlink, } from 'cbioportal-frontend-commons'; import 'rc-tooltip/assets/bootstrap_white.css'; enum EVENT_KEY { distinguishDrivers = '0', annotateOncoKb = '1', annotateHotspots = '2', annotateCBioPortal = '3', annotateCOSMIC = '4', customDriverBinaryAnnotation = '5', } export interface DriverAnnotationControlsProps { state: IDriverAnnotationControlsState; handlers: IDriverAnnotationControlsHandlers; resultsView?: boolean; } @observer export default class DriverAnnotationControls extends React.Component< DriverAnnotationControlsProps, {} > { @autobind private onInputClick(event: React.MouseEvent) { switch ((event.target as HTMLInputElement).value) { case EVENT_KEY.distinguishDrivers: this.props.handlers.onSelectDistinguishDrivers( !this.props.state.distinguishDrivers ); break; case EVENT_KEY.annotateOncoKb: this.props.handlers.onSelectAnnotateOncoKb( !this.props.state.annotateDriversOncoKb ); break; case EVENT_KEY.annotateHotspots: this.props.handlers.onSelectAnnotateHotspots && this.props.handlers.onSelectAnnotateHotspots( !this.props.state.annotateDriversHotspots ); break; case EVENT_KEY.customDriverBinaryAnnotation: this.props.handlers.onSelectCustomDriverAnnotationBinary && this.props.handlers.onSelectCustomDriverAnnotationBinary( !this.props.state.annotateCustomDriverBinary ); break; } } @autobind private onCustomDriverTierCheckboxClick( event: React.MouseEvent ) { this.props.handlers.onSelectCustomDriverAnnotationTier && this.props.handlers.onSelectCustomDriverAnnotationTier( (event.target as HTMLInputElement).value, !( this.props.state.selectedCustomDriverAnnotationTiers && this.props.state.selectedCustomDriverAnnotationTiers.get( (event.target as HTMLInputElement).value ) ) ); } render() { return (
{this.props.resultsView && ( {!this.props.state .annotateDriversOncoKbDisabled && (
)} {this.props.handlers.onSelectAnnotateHotspots && !this.props.state .annotateDriversHotspotsDisabled && (
} placement="top" >
)} {/*{this.props.handlers*/} {/* .onChangeAnnotateCBioPortalInputValue && (*/} {/*
*/} {/* */} {/* */} {/*
*/} {/*)}*/} {/*{this.props.handlers*/} {/* .onChangeAnnotateCOSMICInputValue && (*/} {/*
*/} {/* */} {/* */} {/*
*/} {/*)}*/} )} {!!this.props.state .customDriverAnnotationBinaryMenuLabel && (
)} {!!this.props.state .customDriverAnnotationTiersMenuLabel && (    { this.props.state .customDriverAnnotationTiersMenuLabel }   driver tiers filter
{( this.props.state .customDriverAnnotationTiers || [] ).map(tier => (
))}
)}
); } }