mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-01 19:48:12 +08:00
Conditionally truncate category string (#1206)
* maybe truncate string * add string formatting to test * correct import * destructuring * add maxlength * test * Respond to feedback from @bkmartinjr Co-authored-by: Matt Weiden <538456+mweiden@users.noreply.github.com>
This commit is contained in:
co-authored by
Matt Weiden
parent
28ddb60b2f
commit
234f25b782
@@ -9,6 +9,7 @@ import AnnoDialogEditCategoryName from "./annoDialogEditCategoryName";
|
||||
import AnnoDialogAddLabel from "./annoDialogAddLabel";
|
||||
|
||||
import * as globals from "../../globals";
|
||||
import maybeTruncateString from "../../util/maybeTruncateString";
|
||||
|
||||
@connect(state => ({
|
||||
colorAccessor: state.colors.colorAccessor,
|
||||
@@ -204,7 +205,7 @@ class Category extends React.Component {
|
||||
{isUserAnno ? (
|
||||
<Icon style={{ marginRight: 5 }} icon="tag" iconSize={16} />
|
||||
) : null}
|
||||
{metadataField}
|
||||
{maybeTruncateString(metadataField, globals.categoryDisplayStringMaxLength)}
|
||||
{isExpanded ? (
|
||||
<FaChevronDown
|
||||
data-testclass="category-expand-is-expanded"
|
||||
|
||||
Reference in New Issue
Block a user