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
+13 -2
View File
@@ -149,6 +149,7 @@ const GeneSets = (
*/
case "geneset: update": {
const { genesetName, update } = action;
if (
typeof genesetName !== "string" ||
!genesetName ||
@@ -157,8 +158,18 @@ const GeneSets = (
throw new Error(
"geneset: update -- geneset name unspecified or does not exist."
);
if (state.genesets.has(update.genesetName))
throw new Error("geneset: update -- update specified existing name.");
/* now that we've confirmed the gene set exists, check for duplicates */
const genesetNameIsDuplicate = state.genesets.has(update.genesetName);
const descriptionIsDuplicate =
state.genesets.get(update.genesetName) &&
state.genesets.get(update.genesetName).genesetDescription ===
update.genesetDescription;
if (genesetNameIsDuplicate && descriptionIsDuplicate)
throw new Error(
"geneset: update -- update specified existing name and description."
);
const prevGs = state.genesets.get(genesetName);
const newGs = {
-1
View File
@@ -60,7 +60,6 @@ const Reducer = undoable(
"layoutChoice",
"centroidLabels",
"genesets",
"genesetsUI",
"annotations",
],
undoableConfig