diff --git a/client/src/components/geneExpression/index.js b/client/src/components/geneExpression/index.js
index 05f6ad08..e9d9cc5a 100644
--- a/client/src/components/geneExpression/index.js
+++ b/client/src/components/geneExpression/index.js
@@ -6,6 +6,7 @@ import { Button } from "@blueprintjs/core";
import GeneSet from "./geneSet";
import CreateGenesetDialogue from "./menus/createGenesetDialogue";
+import EditGenesetNameDialogue from "./menus/editGenesetNameDialogue";
@connect((state) => {
return {
@@ -67,6 +68,7 @@ class GeneExpression extends React.Component {
) : null}
+
{this.renderDiffexpGeneSets()}
{this.renderGeneSets()}
diff --git a/client/src/components/geneExpression/menus/createGenesetDialogue.js b/client/src/components/geneExpression/menus/createGenesetDialogue.js
index 841eecd0..6c40149f 100644
--- a/client/src/components/geneExpression/menus/createGenesetDialogue.js
+++ b/client/src/components/geneExpression/menus/createGenesetDialogue.js
@@ -77,15 +77,16 @@ class CreateGenesetDialogue extends React.PureComponent {
<>
}
secondaryInstructions="Optionally add a list of comma separated genes to populate the gene set"
diff --git a/client/src/components/geneExpression/menus/editGenesetNameDialogue.js b/client/src/components/geneExpression/menus/editGenesetNameDialogue.js
new file mode 100644
index 00000000..ac7c2224
--- /dev/null
+++ b/client/src/components/geneExpression/menus/editGenesetNameDialogue.js
@@ -0,0 +1,104 @@
+import React from "react";
+import { connect } from "react-redux";
+import AnnoDialog from "../../categorical/annoDialog";
+import LabelInput from "../../categorical/labelInput";
+// import LabelInput from "../labelInput";
+// import { genesetPrompt, isGenesetErroneous } from "../genesetUtil";
+
+@connect((state) => ({
+ annotations: state.annotations,
+ schema: state.annoMatrix?.schema,
+ ontology: state.ontology,
+ obsCrossfilter: state.obsCrossfilter,
+ genesetsUI: state.genesetsUI,
+}))
+class RenameGeneset extends React.PureComponent {
+ constructor(props) {
+ super(props);
+ this.state = {
+ genesetName: "",
+ };
+ }
+
+ disableEditGenesetNameMode = (e) => {
+ const { dispatch } = this.props;
+ this.setState({
+ genesetName: "",
+ });
+ dispatch({
+ type: "geneset: disable rename geneset mode",
+ });
+ if (e) e.preventDefault();
+ };
+
+ renameGeneset = (e) => {
+ const { dispatch, genesetsUI } = this.props;
+ const { genesetName } = this.state;
+
+ dispatch({
+ type: "geneset: rename",
+ name: genesetsUI.isEditingGenesetName,
+ newName: genesetName,
+ });
+ dispatch({
+ type: "geneset: disable rename geneset mode",
+ });
+ e.preventDefault();
+ };
+
+ genesetNameError = () => {
+ /* todo genesets validation */
+ return false;
+ };
+
+ handleChange = (e) => {
+ this.setState({ genesetName: e });
+ };
+
+ instruction = () => {
+ return "New, unique geneset name";
+ /* todo genesets */
+ // return genesetPrompt(this.genesetNameError(geneset), "New, unique geneset", ":");
+ };
+
+ render() {
+ const { genesetName } = this.state;
+ const { genesetsUI } = this.props;
+
+ return (
+ <>
+
+ }
+ handleSubmit={this.renameGeneset}
+ handleCancel={this.disableEditGenesetNameMode}
+ />
+ >
+ );
+ }
+}
+
+export default RenameGeneset;
diff --git a/client/src/components/geneExpression/menus/genesetMenus.js b/client/src/components/geneExpression/menus/genesetMenus.js
index 5eb5bee8..1f036cb2 100644
--- a/client/src/components/geneExpression/menus/genesetMenus.js
+++ b/client/src/components/geneExpression/menus/genesetMenus.js
@@ -37,7 +37,7 @@ class GenesetMenus extends React.PureComponent {
const { dispatch, geneset } = this.props;
dispatch({
- type: "geneset: activate geneset edit mode",
+ type: "geneset: activate rename geneset mode",
data: geneset,
});
};
diff --git a/client/src/reducers/genesetsUI.js b/client/src/reducers/genesetsUI.js
index ad90a07e..08d31b00 100644
--- a/client/src/reducers/genesetsUI.js
+++ b/client/src/reducers/genesetsUI.js
@@ -28,6 +28,19 @@ const GeneSetsUI = (
isAddingGenesToGeneset: action.geneset,
};
}
+ case "geneset: activate rename geneset mode": {
+ console.log("reducer", action);
+ return {
+ ...state,
+ isEditingGenesetName: action.data,
+ };
+ }
+ case "geneset: disable rename geneset mode": {
+ return {
+ ...state,
+ isEditingGenesetName: null,
+ };
+ }
case "geneset: disable add new genes mode": {
return {
...state,