Skip to content

[EuiSuperDatePicker] Fixes for width and auto refresh#5383

Merged
cchaos merged 38 commits intoelastic:mainfrom
cchaos:fix/super_date_picker_width
Dec 6, 2021
Merged

[EuiSuperDatePicker] Fixes for width and auto refresh#5383
cchaos merged 38 commits intoelastic:mainfrom
cchaos:fix/super_date_picker_width

Conversation

@cchaos
Copy link
Copy Markdown
Contributor

@cchaos cchaos commented Nov 16, 2021

[EuiRefreshInterval] Updates

I did some user-testing on this with a sample size of 1 😂 , but the main feedback was that the "Start"/"Stop" nomenclature was confusing because it felt more like it was going to animate over a period of time, instead of refreshing. This new design was immediately recognizable as to what was going to occur.

  • Uses a toggle for start/pause
  • Disables inputs if paused
  • Invalidates value if 0 or less
  • Render in one row
  • Increases the default refreshInterval to 1000 / 1s

Screen Recording 2021-11-17 at 10 51 03 AM

I also looked at attempting to fix #2249 but the problem is, if it doesn't turn back off, then the refresh continues to happen constantly.


[New] EuiAutoRefresh & EuiAutoRefreshButton components

Fixes #1545

  • EuiAutoRefresh is just a [readOnly] text input that's wrapped in an EuiInputWrapper whose popover contains the EuiRefreshInterval.
  • EuiAutoRefreshButton is similar to the above but instead of an input, it's just an EuiEmptyButton.

Screen Shot 2021-11-17 at 10 25 27 AM


[EuiSuperDatePicker] Sizing updates

Screen.Recording.2021-11-17.at.10.30.10.AM.mp4
Screen.Recording.2021-11-17.at.10.33.29.AM.mp4
  • Removed ‘Show dates’ in favor of automatically expanding pretty format and opening start date popover (before it used to take 2 clicks to open the the start date when in pretty format. Now it's only one.
Screen.Recording.2021-11-17.at.10.39.22.AM.mp4

[EuiSuperDatePicker] Auto refresh updates

Fixes #4213

  • Simplified isAutoRefreshOnly to render the new EuiAutoRefresh component
  • Added EuiAutoRefreshButton as an append when turned on which provides a much better indicator that it is in fact on
  • prettyInterval(): added shortHand parameter
    image

[EuiSuperDatePicker] Other fixes


[EuiSuperUpdateButton] Added support for iconOnly version and moved responsive to customizable prop

  • Support in EuiSuperDatePicker with showUpdateButton = ‘iconOnly’
  • Fix min-widths on smaller screens
  • Split up prop types between internal and configurable
Screen.Recording.2021-11-17.at.10.58.57.AM.mp4

[EuiFormControlLayout] Fixes


[EuiIcon] Added timeRefresh

Screen Shot 2021-11-17 at 11 00 53 AM

Screen Shot 2021-11-17 at 11 00 48 AM


Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile (mostly, the Pattern example is a little tricky)
  • Checked in Chrome, Safari, Edge, and Firefox
  • Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for any docs examples
  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

cchaos added 19 commits November 14, 2021 14:26
- Adds `width` and `isQuickSelectOnly` props
- Adjusts styles accordingly with sensible min-widths
- Adds Playground
- Updated Save Queries example to show auto width and reducing to quick select only when KQL is in focus
- Fixed `dataTestSubj` -> `data-test-subj`
- Removed ‘Show dates’ in favor of automatically expandin pretty format and opening start date popover
…`readOnly`

And fixed border-radius for EuiSuperDatePicker with `append`
- disabling inputs if paused
- invalidating value if 0 or less
- always rendering (moved render logic to quick select)
- render in one row
…uiAutoRefresh component

- Increases the default `refreshInterval` to `1000` / `1s`
…urned on

- [prettyInterval()] added `shortHand` parameter
…esponsive` to customizable prop

- Support in EuiSuperDatePicker with `showUpdateButton = ‘iconOnly’`
- Fix min-widths on smaller screens
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

@cchaos cchaos added this to the Elastic Stack 8.1 milestone Nov 17, 2021
@cchaos cchaos marked this pull request as ready for review November 17, 2021 16:03
@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Nov 17, 2021

I've filled out the PR summary with screenshots and some more explanations now this PR is ready for review as I finalize all the checklist items.

@elizabetdev elizabetdev self-requested a review November 19, 2021 15:29
@elizabetdev
Copy link
Copy Markdown
Contributor

@cchaos I started reviewing this PR. Need to do some more tests. But before I continue, one thing that came to my mind for the EuiAutoRefreshButton is if we should allow an animation on refresh. For example, the icon could have a subtle animation.

This way users would have feedback and know that the refresh is working as expected.

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Nov 22, 2021

An animation could be helpful. I think that would require a new prop since the standalone EuiAutoRefresh doesn't actually handle the countdown. Can you make a specific issue for follow up? Since this PR is big enough already 😬

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

Copy link
Copy Markdown
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Changes LGTM once CI is passing!

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

…d button

- Change `TSX` source types examples back to `JS` for now
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

@cchaos
Copy link
Copy Markdown
Contributor Author

cchaos commented Dec 3, 2021

@miukimiu Can you spot check this for any design issues next week?

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

Co-authored-by: Constance <constancecchen@users.noreply.github.com>
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

Copy link
Copy Markdown
Contributor

@elizabetdev elizabetdev left a comment

Choose a reason for hiding this comment

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

Thanks, @cchaos! Great enhancements! LGTM! 🎉

Tested in Chrome, Safari, Edge, and Firefox. I also looked into the code.

export const SuperDatePickerExample = {
title: 'Super date picker',
intro: (
<EuiText grow={false}>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we remove the grow={false} so that the text has the same width as the rest of the page?

Suggested change
<EuiText grow={false}>
<EuiText>

Screenshot 2021-12-06 at 12 32 30

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removing grow actually aligns better with our our EuiPageHeader renders the description prop. I know it may seem odd comparatively, but it's a much better line-length for readability and will align with our guidelines pages.

@cchaos cchaos added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Dec 6, 2021
cchaos and others added 2 commits December 6, 2021 10:21
Co-authored-by: Elizabet Oliveira <elizabet.oliveira@elastic.co>
@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

@cee-chen
Copy link
Copy Markdown
Contributor

cee-chen commented Dec 6, 2021

jenkins test this

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

@kibanamachine
Copy link
Copy Markdown

Preview documentation changes for this PR: https://eui.elastic.co/pr_5383/

@cchaos cchaos merged commit 17692a4 into elastic:main Dec 6, 2021
@cchaos cchaos deleted the fix/super_date_picker_width branch December 6, 2021 21:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation)

Projects

None yet

4 participants