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

[explore] improve metric(s) and groupby(s) controls #2921

Merged
merged 4 commits into from
Jun 9, 2017

Conversation

mistercrunch
Copy link
Member

  • surface verbose_name, description & expression in controls
  • [table viz] surface verbose name in table header

screen shot 2017-06-06 at 11 33 15 pm

@@ -75,6 +75,7 @@ class ChartContainer extends React.PureComponent {
return {
viewSqlQuery: this.props.queryResponse.query,
containerId: props.containerId,
datasource: props.datasource,
Copy link
Contributor

@ascott ascott Jun 8, 2017

Choose a reason for hiding this comment

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

curious why we are using this.props and props in this method. would be nice to clean this up and use either props or this.props for consistency, obvs optional.

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch, should be consistent and props. all around

@@ -27,6 +31,9 @@ const defaultProps = {
multi: false,
onChange: () => {},
showHeader: true,
optionRenderer: opt => opt.label,
valueRenderer: opt => opt.label,
Copy link
Contributor

Choose a reason for hiding this comment

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

should this be valueRenderer: opt => opt.value?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bit confusing but essentially the optionRenderer applies to what's in the dropdown and the valueRenderer applies to the selected item(s). It's nice to have this level of control, for instance we could show the expression behind the metric only on the selected metric, not in the list if we wanted to.

So they both should show the label.

@@ -18,6 +19,48 @@ const ROW_LIMIT_OPTIONS = [10, 50, 100, 250, 500, 1000, 5000, 10000, 50000];

const SERIES_LIMITS = [0, 5, 10, 25, 50, 100, 500];

const metricRenderer = m => (
Copy link
Contributor

Choose a reason for hiding this comment

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

ideally components shouldn't live in a stores file. these should probably be their own component files so they can be used in other places as needed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, I thought about it when starting to write it, especially makes sense as it is fairly large. I'll address that.

- surface verbose_name, description & expression in controls
- [table viz] surface verbose name in table header
@ascott
Copy link
Contributor

ascott commented Jun 9, 2017

LGTM!

@mistercrunch mistercrunch merged commit 16141ec into apache:master Jun 9, 2017
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.18.5 labels Feb 26, 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.18.5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants