Prevent category collapsing on annotation edit, # of cells on add label button (#1204)

* collapse functionality

* expand collapse
This commit is contained in:
Colin Megill
2020-03-10 13:21:06 -04:00
committed by GitHub
parent d8231a9a3b
commit 1a93068810
3 changed files with 31 additions and 11 deletions
@@ -9,7 +9,8 @@ import { labelPrompt, isLabelErroneous } from "./labelUtil";
categoricalSelection: state.categoricalSelection,
annotations: state.annotations,
universe: state.universe,
ontology: state.ontology
ontology: state.ontology,
crossfilter: state.crossfilter
}))
class Category extends React.PureComponent {
constructor(props) {
@@ -73,7 +74,7 @@ class Category extends React.PureComponent {
render() {
const { newLabelText } = this.state;
const { metadataField, annotations, ontology } = this.props;
const { metadataField, annotations, ontology, crossfilter } = this.props;
const ontologyEnabled = ontology?.enabled ?? false;
return (
@@ -91,7 +92,7 @@ class Category extends React.PureComponent {
instruction={this.instruction(newLabelText)}
cancelTooltipContent="Close this dialog without adding a label."
primaryButtonText="Add label"
secondaryButtonText="Add label and assign currently selected cells"
secondaryButtonText={`Add label and assign ${crossfilter.countSelected()} currently selected cells`}
handleSecondaryButtonSubmit={this.addLabelAndAssignCells}
text={newLabelText}
validationError={this.labelNameError(newLabelText)}