mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-21 16:18:12 +08:00
prepopulate input (#2129)
This commit is contained in:
@@ -8,6 +8,7 @@ import { memoize } from "../../util/dataframe/util";
|
||||
import Truncate from "../util/truncate";
|
||||
import * as globals from "../../globals";
|
||||
import GenesetMenus from "./menus/genesetMenus";
|
||||
import EditGenesetNameDialogue from "./menus/editGenesetNameDialogue";
|
||||
import HistogramBrush from "../brushableHistogram";
|
||||
|
||||
@connect((state, ownProps) => {
|
||||
@@ -115,6 +116,8 @@ class GeneSet extends React.Component {
|
||||
const { setName, setGenes } = 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;
|
||||
|
||||
return (
|
||||
<div style={{ marginBottom: 3 }}>
|
||||
<div
|
||||
@@ -166,7 +169,7 @@ class GeneSet extends React.Component {
|
||||
</div>
|
||||
|
||||
<div style={{ marginLeft: 15, marginTop: 5, marginRight: 0 }}>
|
||||
{isOpen ? (
|
||||
{isOpen && !genesetIsEmpty && (
|
||||
<Tooltip
|
||||
content="Aggregate all genes in this geneset, and allow coloring by and selecting on the entire set."
|
||||
position={Position.BOTTOM_RIGHT}
|
||||
@@ -187,11 +190,17 @@ class GeneSet extends React.Component {
|
||||
onChange={this.toggleSummaryHisto}
|
||||
/>
|
||||
</Tooltip>
|
||||
) : null}
|
||||
)}
|
||||
|
||||
{isOpen && genesetIsEmpty && (
|
||||
<p style={{ fontStyle: "italic", color: "lightgrey" }}>
|
||||
No genes to display
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isOpen &&
|
||||
(!toggleSummaryHisto
|
||||
(!toggleSummaryHisto && !genesetIsEmpty
|
||||
? this.renderGenes()
|
||||
: setGenes.length > 0 && (
|
||||
<HistogramBrush
|
||||
@@ -200,6 +209,7 @@ class GeneSet extends React.Component {
|
||||
setGenes={setGenes}
|
||||
/>
|
||||
))}
|
||||
<EditGenesetNameDialogue parentGeneset={setName} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Button } from "@blueprintjs/core";
|
||||
import GeneSet from "./geneSet";
|
||||
|
||||
import CreateGenesetDialogue from "./menus/createGenesetDialogue";
|
||||
import EditGenesetNameDialogue from "./menus/editGenesetNameDialogue";
|
||||
|
||||
@connect((state) => {
|
||||
return {
|
||||
@@ -66,7 +65,6 @@ class GeneExpression extends React.Component {
|
||||
</Button>
|
||||
</div>
|
||||
<CreateGenesetDialogue />
|
||||
<EditGenesetNameDialogue />
|
||||
</div>
|
||||
<div>{this.renderDiffexpGeneSets()}</div>
|
||||
<div>{this.renderGeneSets()}</div>
|
||||
|
||||
@@ -14,7 +14,7 @@ class RenameGeneset extends React.PureComponent {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
genesetName: "",
|
||||
genesetName: props.parentGeneset,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -54,12 +54,12 @@ class RenameGeneset extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
const { genesetName } = this.state;
|
||||
const { genesetsUI } = this.props;
|
||||
const { genesetsUI, parentGeneset } = this.props;
|
||||
|
||||
return (
|
||||
<>
|
||||
<AnnoDialog
|
||||
isActive={genesetsUI.isEditingGenesetName}
|
||||
isActive={genesetsUI.isEditingGenesetName === parentGeneset}
|
||||
inputProps={{
|
||||
"data-testid": `${genesetsUI.isEditingGenesetName}:rename-geneset-dialog`,
|
||||
}}
|
||||
@@ -74,6 +74,7 @@ class RenameGeneset extends React.PureComponent {
|
||||
validationError={genesetsUI.isEditingGenesetName === genesetName}
|
||||
annoInput={
|
||||
<LabelInput
|
||||
label={genesetName}
|
||||
onChange={this.handleChange}
|
||||
inputProps={{
|
||||
"data-testid": "rename-geneset-modal",
|
||||
|
||||
Reference in New Issue
Block a user