diff --git a/client/src/components/categorical/categorical.js b/client/src/components/categorical/categorical.js
index 98bb8785..660f3f51 100644
--- a/client/src/components/categorical/categorical.js
+++ b/client/src/components/categorical/categorical.js
@@ -7,7 +7,8 @@ import {
InputGroup,
Dialog,
Classes,
- MenuItem
+ MenuItem,
+ Colors
} from "@blueprintjs/core";
import { Select } from "@blueprintjs/select";
import { connect } from "react-redux";
@@ -57,7 +58,11 @@ class Categories extends React.Component {
};
render() {
- const { createAnnoModeActive, categoryToDuplicate } = this.state;
+ const {
+ createAnnoModeActive,
+ categoryToDuplicate,
+ newCategoryText
+ } = this.state;
const {
categoricalSelection,
writableCategoriesEnabled,
@@ -76,26 +81,30 @@ class Categories extends React.Component {
>
{/* READ ONLY CATEGORICAL FIELDS */}
{/* this is duplicative but flat, could be abstracted */}
- {_.map(allCategoryNames, catName =>
- !schema.annotations.obsByName[catName].writable ? (
-
- ) : null
+ {_.map(
+ allCategoryNames,
+ catName =>
+ !schema.annotations.obsByName[catName].writable ? (
+
+ ) : null
)}
{/* WRITEABLE FIELDS */}
- {_.map(allCategoryNames, catName =>
- schema.annotations.obsByName[catName].writable ? (
-
- ) : null
+ {_.map(
+ allCategoryNames,
+ catName =>
+ schema.annotations.obsByName[catName].writable ? (
+
+ ) : null
)}
{writableCategoriesEnabled ? (
@@ -116,12 +125,33 @@ class Categories extends React.Component {
New, unique category name:
this.setState({ newCategoryText: e.target.value })
}
leftIcon="tag"
/>
+
+
+ {newCategoryText}
+ {" "}
+ already exists
+
+
Optionally duplicate all labels & cell assignments from
existing category into new category:
@@ -157,6 +187,9 @@ class Categories extends React.Component {
diff --git a/client/src/components/categorical/category.js b/client/src/components/categorical/category.js
index 24395911..84476ee0 100644
--- a/client/src/components/categorical/category.js
+++ b/client/src/components/categorical/category.js
@@ -2,7 +2,7 @@ import React from "react";
import _ from "lodash";
import { connect } from "react-redux";
import { FaChevronRight, FaChevronDown } from "react-icons/fa";
-import { Flipper, Flipped, Spring } from "react-flip-toolkit";
+import { Flipper, Flipped } from "react-flip-toolkit";
import {
Button,
Tooltip,
@@ -14,7 +14,8 @@ import {
Classes,
Icon,
Position,
- PopoverInteractionKind
+ PopoverInteractionKind,
+ Colors
} from "@blueprintjs/core";
import * as globals from "../../globals";
@@ -345,11 +346,38 @@ class Category extends React.Component {
New, unique label name:
this.setState({ newLabelText: e.target.value })
}
leftIcon="tag"
/>
+
+
+ {newLabelText}
+ {" "}
+ already exists within{" "}
+
+ {metadataField}
+
+
diff --git a/client/src/reducers/annotations.js b/client/src/reducers/annotations.js
index a47a44b8..047b9abd 100644
--- a/client/src/reducers/annotations.js
+++ b/client/src/reducers/annotations.js
@@ -5,7 +5,7 @@ const Annotations = (
state = {
isEditingCategoryName: false,
isEditingLabelName: false,
- categoryBeingEdited: false,
+ categoryBeingEdited: null,
categoryAddingNewLabel: null,
labelEditable: { category: null, label: null }
},
@@ -46,7 +46,7 @@ const Annotations = (
case "annotation: category edited":
return {
...state,
- isEditingCategoryName: true,
+ isEditingCategoryName: false,
categoryBeingEdited: null
};