mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
style: improve the "Create New Chart" screen's usability (#11383)
* style: make disabled buttons more readable * making more of a CTA for VizControl
This commit is contained in:
committed by
GitHub
parent
5a3d23dc01
commit
64b5aae6bc
@@ -38,16 +38,17 @@ const propTypes = {
|
||||
name: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func,
|
||||
value: PropTypes.string.isRequired,
|
||||
labelBsStyle: PropTypes.string,
|
||||
};
|
||||
|
||||
const defaultProps = {
|
||||
onChange: () => {},
|
||||
labelBsStyle: 'default',
|
||||
};
|
||||
|
||||
const registry = getChartMetadataRegistry();
|
||||
|
||||
const IMAGE_PER_ROW = 6;
|
||||
const LABEL_STYLE = { cursor: 'pointer' };
|
||||
const DEFAULT_ORDER = [
|
||||
'line',
|
||||
'big_number',
|
||||
@@ -160,7 +161,7 @@ export default class VizTypeControl extends React.PureComponent {
|
||||
|
||||
render() {
|
||||
const { filter, showModal } = this.state;
|
||||
const { value } = this.props;
|
||||
const { value, labelBsStyle } = this.props;
|
||||
|
||||
const filterString = filter.toLowerCase();
|
||||
const filteredTypes = DEFAULT_ORDER.filter(type => registry.has(type))
|
||||
@@ -198,7 +199,7 @@ export default class VizTypeControl extends React.PureComponent {
|
||||
}
|
||||
>
|
||||
<>
|
||||
<Label onClick={this.toggleModal} style={LABEL_STYLE}>
|
||||
<Label onClick={this.toggleModal} bsStyle={labelBsStyle}>
|
||||
{registry.has(value) ? registry.get(value).name : `${value}`}
|
||||
</Label>
|
||||
{!registry.has(value) && (
|
||||
|
||||
Reference in New Issue
Block a user