Create / edit geneset description (#2139)

* geneset description add

* edit geneset description

* default state for desc

* remove log

* naming, todo

* check for both dup name and desc

* fixes

* do not store gene set modal state in history stack

* Update createGenesetDialogue.js

* Update editGenesetNameDialogue.js

Co-authored-by: bkmartinjr <bruce@chanzuckerberg.com>
This commit is contained in:
Colin Megill
2021-04-21 19:50:29 -04:00
committed by GitHub
co-authored by bkmartinjr
parent 99a795a688
commit 876ceb4d8b
9 changed files with 170 additions and 69 deletions
@@ -1,6 +1,7 @@
import React from "react";
import { connect } from "react-redux";
import { Tooltip, Position, Switch } from "@blueprintjs/core";
import { Position, Switch } from "@blueprintjs/core";
import { Tooltip2 } from "@blueprintjs/popover2";
import { FaChevronRight, FaChevronDown } from "react-icons/fa";
import actions from "../../actions";
import Gene from "./gene";
@@ -128,7 +129,7 @@ class GeneSet extends React.Component {
}
render() {
const { setName, setGenes } = this.props;
const { setName, setGenes, genesetDescription } = this.props;
const { isOpen, toggleSummaryHisto } = this.state;
const genesetNameLengthVisible = 120; /* this magic number determines how much of a long geneset name we see */
const genesetIsEmpty = setGenes.length === 0;
@@ -156,7 +157,11 @@ class GeneSet extends React.Component {
}}
onClick={this.onGenesetMenuClick}
>
<Truncate>
<Truncate
tooltipAddendum={
genesetDescription ? `: ${genesetDescription}` : ""
}
>
<span
style={{
maxWidth: globals.leftSidebarWidth - genesetNameLengthVisible,
@@ -185,7 +190,7 @@ class GeneSet extends React.Component {
<div style={{ marginLeft: 15, marginTop: 5, marginRight: 0 }}>
{isOpen && !genesetIsEmpty && (
<Tooltip
<Tooltip2
content="Aggregate all genes in this geneset, and allow coloring by and selecting on the entire set."
position={Position.BOTTOM_RIGHT}
usePortal
@@ -204,7 +209,7 @@ class GeneSet extends React.Component {
innerLabelChecked="on"
onChange={this.toggleSummaryHisto}
/>
</Tooltip>
</Tooltip2>
)}
{isOpen && genesetIsEmpty && (
@@ -223,7 +228,10 @@ class GeneSet extends React.Component {
setGenes={setGenes}
/>
))}
<EditGenesetNameDialogue parentGeneset={setName} />
<EditGenesetNameDialogue
parentGeneset={setName}
parentGenesetDescription={genesetDescription}
/>
</div>
);
}