import * as React from 'react';
import { observer } from 'mobx-react';
import {
caseCounts,
getNumPatients,
getNumSamples,
MissingSamplesMessage,
StudyViewComparisonGroup,
} from '../GroupComparisonUtils';
import { StudyViewPageStore } from '../../studyView/StudyViewPageStore';
import autobind from 'autobind-decorator';
import { action, computed, makeObservable, observable } from 'mobx';
import ErrorIcon from '../../../shared/components/ErrorIcon';
import styles from '../styles.module.scss';
import { CirclePicker, CirclePickerProps } from 'react-color';
import { OverlayTrigger, Popover } from 'react-bootstrap';
import { COLORS } from '../../studyView/StudyViewUtils';
import {
CLI_FEMALE_COLOR,
CLI_NO_COLOR,
CLI_YES_COLOR,
DARK_GREY,
} from '../../../shared/lib/Colors';
import { DefaultTooltip, TruncatedText } from 'cbioportal-frontend-commons';
import classnames from 'classnames';
import { ColorPickerIcon } from 'pages/groupComparison/comparisonGroupManager/ColorPickerIcon';
import { getBrowserWindow } from 'cbioportal-frontend-commons';
export interface IGroupCheckboxProps {
group: StudyViewComparisonGroup;
store: StudyViewPageStore;
markedForDeletion: boolean;
markedWithWarningSign: boolean;
studyIds: string[];
restore: (group: StudyViewComparisonGroup) => void;
delete: (group: StudyViewComparisonGroup) => void;
shareGroup: (group: StudyViewComparisonGroup) => void;
color: string;
onChangeGroupColor: (
group: StudyViewComparisonGroup,
color: string | undefined
) => void;
}
const COLOR_UNDEFINED = '#FFFFFF';
@observer
export default class GroupCheckbox extends React.Component<
IGroupCheckboxProps,
{}
> {
constructor(props: IGroupCheckboxProps) {
super(props);
makeObservable(this);
}
@autobind
private onCheckboxClick() {
this.props.store.toggleComparisonGroupSelected(this.props.group.uid);
this.props.store.flagDuplicateColorsForSelectedGroups(
this.props.group.uid,
this.props.color!
);
}
@autobind
private onRestoreClick() {
this.props.restore(this.props.group);
}
@autobind
private onDeleteClick() {
this.props.delete(this.props.group);
}
@autobind
private shareGroup() {
this.props.shareGroup(this.props.group);
}
@computed get label() {
return (