mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 10:38:11 +08:00
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:
co-authored by
bkmartinjr
parent
99a795a688
commit
876ceb4d8b
@@ -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 = {
|
||||
|
||||
@@ -60,7 +60,6 @@ const Reducer = undoable(
|
||||
"layoutChoice",
|
||||
"centroidLabels",
|
||||
"genesets",
|
||||
"genesetsUI",
|
||||
"annotations",
|
||||
],
|
||||
undoableConfig
|
||||
|
||||
Reference in New Issue
Block a user