mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-06 02:28:11 +08:00
Use blueprint "disable" property to indicate disabled buttons (#1197)
* Use blueprint "disable" property to indicate that colorby disabled * Disable subset and reset buttons when action is not possible
This commit is contained in:
@@ -241,11 +241,10 @@ class Category extends React.Component {
|
|||||||
<Button
|
<Button
|
||||||
data-testclass="colorby"
|
data-testclass="colorby"
|
||||||
data-testid={`colorby-${metadataField}`}
|
data-testid={`colorby-${metadataField}`}
|
||||||
onClick={() => {
|
onClick={this.handleColorChange}
|
||||||
if (!isTruncated) this.handleColorChange();
|
active={colorAccessor === metadataField}
|
||||||
}}
|
intent={colorAccessor === metadataField ? "primary" : "none"}
|
||||||
active={colorAccessor === metadataField || isTruncated}
|
disabled={isTruncated}
|
||||||
intent={colorAccessor === metadataField && !isTruncated ? "primary" : "none"}
|
|
||||||
icon="tint"
|
icon="tint"
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|||||||
@@ -20,11 +20,9 @@ function Subset(props) {
|
|||||||
>
|
>
|
||||||
<AnchorButton
|
<AnchorButton
|
||||||
data-testid="subset-button"
|
data-testid="subset-button"
|
||||||
active={!subsetPossible}
|
disabled={!subsetPossible}
|
||||||
icon="pie-chart"
|
icon="pie-chart"
|
||||||
onClick={() => {
|
onClick={handleSubset}
|
||||||
if (subsetPossible) handleSubset();
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -34,11 +32,9 @@ function Subset(props) {
|
|||||||
>
|
>
|
||||||
<AnchorButton
|
<AnchorButton
|
||||||
data-testid="reset-subset-button"
|
data-testid="reset-subset-button"
|
||||||
active={!subsetResetPossible}
|
disabled={!subsetResetPossible}
|
||||||
icon="full-circle"
|
icon="full-circle"
|
||||||
onClick={() => {
|
onClick={handleSubsetReset}
|
||||||
if (subsetResetPossible) handleSubsetReset();
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user