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

Pass values from global store to fields in exploreV2 #1561

Merged
merged 5 commits into from
Nov 9, 2016

Conversation

vera-liu
Copy link
Contributor

@vera-liu vera-liu commented Nov 8, 2016

Done:

  • Let ControlPanelsContainer listen to form_data, and pass down values to fields

e.g. when show_legend is set to true in url, checkbox will be toggled when loading

needs-review @ascott

@vera-liu vera-liu force-pushed the vliu_pass_store_to_fields branch from b4e2591 to 6dcad81 Compare November 8, 2016 22:52
@@ -14,6 +14,7 @@ const propTypes = {
places: PropTypes.number,
validators: PropTypes.any,
onChange: React.PropTypes.func,
value: PropTypes.any,
Copy link

@ascott ascott Nov 8, 2016

Choose a reason for hiding this comment

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

we could use PropTypes.oneOf([PropTypes.string, PropTypes.bool]) here to be more specific.

Copy link

Choose a reason for hiding this comment

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

should it be required?

@@ -1630,6 +1630,7 @@ const defaultFormData = {};
defaultFormData.slice_name = null;
defaultFormData.slice_id = null;
Object.keys(fields).forEach((k) => { defaultFormData[k] = fields[k].default; });
exports.defaultFormData = defaultFormData;
Copy link

Choose a reason for hiding this comment

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

it would be nice to use the
export function thing() {} or export const thing = {} syntax here, rather than exports.thing = thing;

maybe defaultFormData should be a function like this:

export function defaultFormData() {
  const data = {
    slice_name: null,
    slice_id: null,
  };
  Object.keys(fields).forEach((k) => { data[k] = fields[k].default; });
  return data;
}

@ascott
Copy link

ascott commented Nov 8, 2016

a few comments, but otherwise LGTM

@vera-liu vera-liu force-pushed the vliu_pass_store_to_fields branch from 6dcad81 to 2f76b4f Compare November 9, 2016 01:26
@vera-liu vera-liu force-pushed the vliu_pass_store_to_fields branch from 2f76b4f to 9b3c460 Compare November 9, 2016 01:27
@vera-liu vera-liu merged commit ad1cd55 into apache:master Nov 9, 2016
@ascott
Copy link

ascott commented Nov 9, 2016

🎉

@vera-liu vera-liu deleted the vliu_pass_store_to_fields branch November 14, 2016 21:32
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.13.0 labels Feb 19, 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.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants