-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Conversation
b4e2591
to
6dcad81
Compare
@@ -14,6 +14,7 @@ const propTypes = { | |||
places: PropTypes.number, | |||
validators: PropTypes.any, | |||
onChange: React.PropTypes.func, | |||
value: PropTypes.any, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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;
}
a few comments, but otherwise LGTM |
6dcad81
to
2f76b4f
Compare
2f76b4f
to
9b3c460
Compare
🎉 |
Done:
e.g. when show_legend is set to true in url, checkbox will be toggled when loading
needs-review @ascott