mirror of
https://github.com/apache/superset.git
synced 2026-04-17 07:05:04 +00:00
[dashboard] adding an option to duplicate slices when "Saving AS" (#3391)
* [dashboard] adding an option to duplicate slices when "Saving AS" * Fix tests
This commit is contained in:
committed by
GitHub
parent
3b4cd812ae
commit
e53f3032bb
@@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import ControlHeader from '../ControlHeader';
|
||||
import Checkbox from '../../../components/Checkbox';
|
||||
|
||||
const propTypes = {
|
||||
name: PropTypes.string.isRequired,
|
||||
@@ -15,24 +16,22 @@ const defaultProps = {
|
||||
onChange: () => {},
|
||||
};
|
||||
|
||||
const checkboxStyle = { paddingRight: '5px' };
|
||||
|
||||
export default class CheckboxControl extends React.Component {
|
||||
onToggle() {
|
||||
this.props.onChange(!this.props.value);
|
||||
onChange(checked) {
|
||||
this.props.onChange(checked);
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<ControlHeader
|
||||
{...this.props}
|
||||
onClick={this.onToggle.bind(this)}
|
||||
leftNode={
|
||||
<span>
|
||||
<i
|
||||
className={`fa fa-check ${this.props.value ? 'text-primary' : 'text-transparent'}`}
|
||||
onClick={this.onToggle.bind(this)}
|
||||
style={{ border: '1px solid #aaa', borderRadius: '2px', cursor: 'pointer' }}
|
||||
/>
|
||||
|
||||
</span>
|
||||
<Checkbox
|
||||
onChange={this.onChange.bind(this)}
|
||||
style={checkboxStyle}
|
||||
checked={!!this.props.value}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user