mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-30 14:08:11 +08:00
[WIP] JS lint and dead code removal (#1053)
* lint and dead code removal * fix regressions
This commit is contained in:
@@ -83,7 +83,7 @@ class Categories extends React.Component {
|
||||
|
||||
categoryNameErrorMessage = name => {
|
||||
const err = this.categoryNameError(name);
|
||||
if (err == "duplicate") {
|
||||
if (err === "duplicate") {
|
||||
return (
|
||||
<span>
|
||||
<span style={{ fontStyle: "italic" }}>{name}</span> already exists -
|
||||
@@ -91,7 +91,7 @@ class Categories extends React.Component {
|
||||
</span>
|
||||
);
|
||||
}
|
||||
if (err == "characters") {
|
||||
if (err === "characters") {
|
||||
return (
|
||||
<span>
|
||||
<span style={{ fontStyle: "italic" }}>{name}</span> contains illegal
|
||||
|
||||
@@ -149,7 +149,7 @@ class Category extends React.Component {
|
||||
or return an error type.
|
||||
*/
|
||||
const { metadataField, universe } = this.props;
|
||||
const obsByName = universe.schema.annotations.obsByName;
|
||||
const { obsByName } = universe.schema.annotations;
|
||||
|
||||
if (obsByName[metadataField].categories.indexOf(name) !== -1) {
|
||||
return "duplicate";
|
||||
@@ -165,7 +165,7 @@ class Category extends React.Component {
|
||||
labelNameErrorMessage = name => {
|
||||
const { metadataField } = this.props;
|
||||
const err = this.labelNameError(name);
|
||||
if (err == "duplicate") {
|
||||
if (err === "duplicate") {
|
||||
return (
|
||||
<span>
|
||||
<span style={{ fontStyle: "italic" }}>{name}</span> already exists
|
||||
@@ -174,7 +174,7 @@ class Category extends React.Component {
|
||||
</span>
|
||||
);
|
||||
}
|
||||
if (err == "characters") {
|
||||
if (err === "characters") {
|
||||
return (
|
||||
<span>
|
||||
<span style={{ fontStyle: "italic" }}>{name}</span> contains illegal
|
||||
@@ -242,8 +242,7 @@ class Category extends React.Component {
|
||||
colorAccessor,
|
||||
categoricalSelection,
|
||||
isUserAnno,
|
||||
annotations,
|
||||
universe
|
||||
annotations
|
||||
} = this.props;
|
||||
const { isTruncated } = categoricalSelection[metadataField];
|
||||
|
||||
@@ -288,7 +287,6 @@ class Category extends React.Component {
|
||||
type="checkbox"
|
||||
/>
|
||||
<span className="bp3-control-indicator" />
|
||||
{""}
|
||||
</label>
|
||||
<span
|
||||
data-testid={`category-expand-${metadataField}`}
|
||||
|
||||
@@ -144,7 +144,9 @@ class Occupancy extends React.Component {
|
||||
categoryIndex
|
||||
} = this.props;
|
||||
|
||||
this.canvas?.getContext("2d").clearRect(0, 0, this._WIDTH, this._HEIGHT);
|
||||
const { canvas } = this;
|
||||
if (canvas)
|
||||
canvas.getContext("2d").clearRect(0, 0, this._WIDTH, this._HEIGHT);
|
||||
|
||||
const colorByIsCatagoricalData = !!categoricalSelection[colorAccessor];
|
||||
|
||||
|
||||
@@ -9,13 +9,12 @@ import {
|
||||
MenuItem,
|
||||
Popover,
|
||||
Position,
|
||||
Icon,
|
||||
PopoverInteractionKind
|
||||
PopoverInteractionKind,
|
||||
Tooltip
|
||||
} from "@blueprintjs/core";
|
||||
import Occupancy from "./occupancy";
|
||||
import * as globals from "../../globals";
|
||||
import styles from "./categorical.css";
|
||||
import { Tooltip } from "@blueprintjs/core";
|
||||
|
||||
import { AnnotationsHelpers } from "../../util/stateManager";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user