-
Notifications
You must be signed in to change notification settings - Fork 843
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
EuiSuperDatePicker #1351
EuiSuperDatePicker #1351
Conversation
Wowsah! Can't wait to go through this one. I'll probably make this a quick pass tomorrow and anything that's just style related can be a follow-up PR so that this can unblock your Kibana implementation. |
…w, now to now isInvalid, recenlty selected in reverse order
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.
I just concentrated the code review on the actual components and will leave the more complicated logic/utility bits for @chandlerprall to review :)
My comments were all mostly small things and can probably change after the fact (another PR). My main concerns are the ones listed above when it comes to interaction and the pretty format state.
src/components/date_picker/super_date_picker/date_popover/absolute_tab.js
Outdated
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/date_popover/absolute_tab.js
Show resolved
Hide resolved
|
||
EuiSuperDatePicker.defaultProps = { | ||
from: 'now-15m', | ||
to: 'now', |
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.
This may too much work, but I find 'start' and 'end' to be more understandable than 'from' and 'to'. Maybe we could change them?
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.
Maybe let's just change these as the prop names for the larger component and not worry about the sub-components for now. But at least the consumer will only have knowledge of start
and end
needs.
src/components/date_picker/super_date_picker/quick_select_popover/commonly_used.js
Outdated
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/date_popover/relative_tab.js
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/date_popover/date_popover_button.js
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/super_date_picker.js
Outdated
Show resolved
Hide resolved
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.
Ok I did a final review and tested in IE11 and Firefox. There are a few issues in each but nothing major. I'll still be doing a follow up design PR anyway, so I can take a look into those. But I think we're good to merge!
Thank you so much @nreese! This is definitely one of the best components we've built!
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.
Nice work @nreese!
Is this mergable @nreese? Actually got a request from @justinkambic to use it in something he's got for 6.6 (I know it won't get into the global scope, this is something different he's working on). I could likely get it into another PR I have going today for Kibana if so, then he could use it. |
@snide I was waiting on a review from @chandlerprall before merging but if you think it should merge as-is, I can always address his feedback in a separate PR |
No. I just totally forgot we had that part to do still. No worries. |
src/components/date_picker/super_date_picker/date_popover/absolute_tab.js
Outdated
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/date_popover/absolute_tab.js
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/date_popover/absolute_tab.js
Outdated
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/date_popover/date_popover_button.js
Outdated
Show resolved
Hide resolved
src/components/date_picker/super_date_picker/quick_select_popover/refresh_interval.js
Show resolved
Hide resolved
}; | ||
} | ||
|
||
static getDerivedStateFromProps = (nextProps) => { |
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.
Same thing here, overriding state
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.
Overriding the state is intended. The point is that when the props update, the state must update to reflect what is getting passed in.
}; | ||
} | ||
|
||
static getDerivedStateFromProps = (nextProps) => { |
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.
Unfortunately, same case here
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.
Overriding the state is intended. The point is that when the props update, the state must update to reflect what is getting passed in.
src/components/date_picker/super_date_picker/super_date_picker.js
Outdated
Show resolved
Hide resolved
…ab, EuiRefreshInterval, and EuiRelativeTab
@chandlerprall After passing |
@chandlerprall This is ready for a another look |
@nreese Should we also introduce kibana localization/i18n to this PR? |
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.
Changes LGTM! Thanks @nreese !
Summary
This PR replaces the globalDatePicker pattern with a fully functional EuiSuperDatePicker component that can be used as the Kibana global date picker.
Checklist