mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-09-25 20:38:11 +08:00
* 1510-smoke-test * config default * update tests * update test config * fix linter errors * more comments * address comments * use npm install in push_tests.yml * use environment.default.json * adding docs * Take care of @mweiden's nits * Save screenshots in the __tests__/screenshots/ directory * typo * docs * Add chart tests (#1580) * merge tests * check if bin creation returned null before rendering charts (#1576) * check if bin creation returned null before rendering charts * refactor chart rendering into functions (#1577) * little fixes from PR * reintroduce fix to check for null values * change getAllByClass to return element * slice instead * new stackedbar test * feedback-1573-test (#1579) * feedback-1573-test * enable whole test set * revert tests Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> * tweak test to actually render chart * include snapshot * remove async * fix getAllHistograms * properly grab id Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com> Co-authored-by: Matt Weiden <538456+mweiden@users.noreply.github.com> Co-authored-by: Severiano Badajoz <sbadajoz@chanzuckerberg.com>
57 lines
1.5 KiB
JavaScript
57 lines
1.5 KiB
JavaScript
import React from "react";
|
|
import { Button, MenuItem } from "@blueprintjs/core";
|
|
import { Select } from "@blueprintjs/select";
|
|
|
|
class DuplicateCategorySelect extends React.PureComponent {
|
|
constructor(props) {
|
|
super(props);
|
|
this.state = {};
|
|
}
|
|
|
|
render() {
|
|
const {
|
|
allCategoryNames,
|
|
categoryToDuplicate,
|
|
handleModalDuplicateCategorySelection,
|
|
} = this.props;
|
|
return (
|
|
<div>
|
|
<p>
|
|
Optionally duplicate all labels & cell assignments from existing
|
|
category into new category:
|
|
</p>
|
|
<Select
|
|
items={
|
|
allCategoryNames ||
|
|
[] /* this is a placeholder, could be a subcomponent to avoid this */
|
|
}
|
|
filterable={false}
|
|
itemRenderer={(d, { handleClick }) => {
|
|
return (
|
|
<MenuItem
|
|
data-testclass="duplicate-category-dropdown-option"
|
|
onClick={handleClick}
|
|
key={d}
|
|
text={d}
|
|
/>
|
|
);
|
|
}}
|
|
noResults={<MenuItem disabled text="No results." />}
|
|
onItemSelect={(d) => {
|
|
handleModalDuplicateCategorySelection(d);
|
|
}}
|
|
>
|
|
{/* children become the popover target; render value here */}
|
|
<Button
|
|
data-testid="duplicate-category-dropdown"
|
|
text={categoryToDuplicate || "None (all cells 'unassigned')"}
|
|
rightIcon="double-caret-vertical"
|
|
/>
|
|
</Select>
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default DuplicateCategorySelect;
|