Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[explorev2] making Datasource an Viz controls not clearable #1845

Merged
merged 2 commits into from
Dec 15, 2016

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Dec 15, 2016

screen shot 2016-12-14 at 4 16 08 pm

screen shot 2016-12-14 at 4 13 23 pm

Other SelectField and new ones can now be set as non-clearable for places where null isn't right.

@@ -50,10 +52,11 @@ export default class SelectField extends React.Component {
return opt.label;
}
render() {
const options = this.props.choices.map((c) => ({ value: c[0], label: c[1] }));
const choices = this.props.choices || [];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could add choices: [] in defaultProps, to get rid of this line.

@@ -7,12 +7,13 @@ import Select, { Creatable } from 'react-select';
const propTypes = {
name: PropTypes.string.isRequired,
choices: PropTypes.array,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]).isRequired,
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.array]),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious why this is no longer required...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why it was there in the first place, seems like conceptually value can be null, especially if the field is clearable, which they all were. I'd have to run some checks on master but I'm thinking this was throwing warnings and I removed the isRequired to stop the warnings.

@ascott
Copy link

ascott commented Dec 15, 2016

lgtm

@mistercrunch mistercrunch merged commit bf67d64 into apache:master Dec 15, 2016
@mistercrunch mistercrunch deleted the clearable branch December 15, 2016 16:53
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.1 labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants