mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-07 03:08:11 +08:00
temp
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
|||||||
Button,
|
Button,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
Icon,
|
Icon,
|
||||||
Position
|
Position,
|
||||||
} from "@blueprintjs/core";
|
} from "@blueprintjs/core";
|
||||||
import CategoryFlipperLayout from "./categoryFlipperLayout";
|
import CategoryFlipperLayout from "./categoryFlipperLayout";
|
||||||
import AnnoMenu from "./annoMenuCategory";
|
import AnnoMenu from "./annoMenuCategory";
|
||||||
@@ -17,17 +17,19 @@ import AnnoDialogAddLabel from "./annoDialogAddLabel";
|
|||||||
import * as globals from "../../globals";
|
import * as globals from "../../globals";
|
||||||
import maybeTruncateString from "../../util/maybeTruncateString";
|
import maybeTruncateString from "../../util/maybeTruncateString";
|
||||||
|
|
||||||
@connect(state => ({
|
// add comment
|
||||||
|
|
||||||
|
@connect((state) => ({
|
||||||
colorAccessor: state.colors.colorAccessor,
|
colorAccessor: state.colors.colorAccessor,
|
||||||
categoricalSelection: state.categoricalSelection,
|
categoricalSelection: state.categoricalSelection,
|
||||||
annotations: state.annotations,
|
annotations: state.annotations,
|
||||||
universe: state.universe
|
universe: state.universe,
|
||||||
}))
|
}))
|
||||||
class Category extends React.Component {
|
class Category extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
isChecked: true
|
isChecked: true,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +49,7 @@ class Category extends React.Component {
|
|||||||
cat.categoryValueSelected,
|
cat.categoryValueSelected,
|
||||||
(res, cond) => (cond ? res + 1 : res),
|
(res, cond) => (cond ? res + 1 : res),
|
||||||
0
|
0
|
||||||
)
|
),
|
||||||
};
|
};
|
||||||
if (categoryCount.selectedCatCount === categoryCount.totalCatCount) {
|
if (categoryCount.selectedCatCount === categoryCount.totalCatCount) {
|
||||||
/* everything is on, so not indeterminate */
|
/* everything is on, so not indeterminate */
|
||||||
@@ -69,7 +71,7 @@ class Category extends React.Component {
|
|||||||
const { dispatch, metadataField } = this.props;
|
const { dispatch, metadataField } = this.props;
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "color by categorical metadata",
|
type: "color by categorical metadata",
|
||||||
colorAccessor: metadataField
|
colorAccessor: metadataField,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -77,7 +79,7 @@ class Category extends React.Component {
|
|||||||
const { dispatch, metadataField } = this.props;
|
const { dispatch, metadataField } = this.props;
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "categorical metadata filter all of these",
|
type: "categorical metadata filter all of these",
|
||||||
metadataField
|
metadataField,
|
||||||
});
|
});
|
||||||
this.setState({ isChecked: true });
|
this.setState({ isChecked: true });
|
||||||
}
|
}
|
||||||
@@ -86,7 +88,7 @@ class Category extends React.Component {
|
|||||||
const { dispatch, metadataField } = this.props;
|
const { dispatch, metadataField } = this.props;
|
||||||
dispatch({
|
dispatch({
|
||||||
type: "categorical metadata filter none of these",
|
type: "categorical metadata filter none of these",
|
||||||
metadataField
|
metadataField,
|
||||||
});
|
});
|
||||||
this.setState({ isChecked: false });
|
this.setState({ isChecked: false });
|
||||||
}
|
}
|
||||||
@@ -114,21 +116,21 @@ class Category extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
maxWidth: globals.maxControlsWidth
|
maxWidth: globals.maxControlsWidth,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "baseline"
|
alignItems: "baseline",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "flex-start",
|
justifyContent: "flex-start",
|
||||||
alignItems: "flex-start"
|
alignItems: "flex-start",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<label className="bp3-control bp3-checkbox">
|
<label className="bp3-control bp3-checkbox">
|
||||||
@@ -143,13 +145,13 @@ class Category extends React.Component {
|
|||||||
usePortal
|
usePortal
|
||||||
modifiers={{
|
modifiers={{
|
||||||
preventOverflow: { enabled: false },
|
preventOverflow: { enabled: false },
|
||||||
hide: { enabled: false }
|
hide: { enabled: false },
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
display: "inline-block"
|
display: "inline-block",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{truncatedString || metadataField}
|
{truncatedString || metadataField}
|
||||||
@@ -173,7 +175,7 @@ class Category extends React.Component {
|
|||||||
isUserAnno,
|
isUserAnno,
|
||||||
annotations,
|
annotations,
|
||||||
isExpanded,
|
isExpanded,
|
||||||
onExpansionChange
|
onExpansionChange,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const isStillLoading = !(categoricalSelection?.[metadataField] ?? false);
|
const isStillLoading = !(categoricalSelection?.[metadataField] ?? false);
|
||||||
@@ -202,7 +204,7 @@ class Category extends React.Component {
|
|||||||
style={{
|
style={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "flex-start",
|
justifyContent: "flex-start",
|
||||||
alignItems: "flex-start"
|
alignItems: "flex-start",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<label className="bp3-control bp3-checkbox">
|
<label className="bp3-control bp3-checkbox">
|
||||||
@@ -210,7 +212,7 @@ class Category extends React.Component {
|
|||||||
data-testclass="category-select"
|
data-testclass="category-select"
|
||||||
data-testid={`${metadataField}:category-select`}
|
data-testid={`${metadataField}:category-select`}
|
||||||
onChange={this.handleToggleAllClick.bind(this)}
|
onChange={this.handleToggleAllClick.bind(this)}
|
||||||
ref={el => {
|
ref={(el) => {
|
||||||
this.checkbox = el;
|
this.checkbox = el;
|
||||||
return el;
|
return el;
|
||||||
}}
|
}}
|
||||||
@@ -227,14 +229,14 @@ class Category extends React.Component {
|
|||||||
usePortal
|
usePortal
|
||||||
modifiers={{
|
modifiers={{
|
||||||
preventOverflow: { enabled: false },
|
preventOverflow: { enabled: false },
|
||||||
hide: { enabled: false }
|
hide: { enabled: false },
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
data-testid={`${metadataField}:category-expand`}
|
data-testid={`${metadataField}:category-expand`}
|
||||||
style={{
|
style={{
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
display: "inline-block"
|
display: "inline-block",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const editingCategory =
|
const editingCategory =
|
||||||
|
|||||||
Reference in New Issue
Block a user