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

[Emotion] Convert EuiDataGrid (Part 1) #7998

Merged
merged 9 commits into from
Sep 5, 2024

Conversation

cee-chen
Copy link
Member

@cee-chen cee-chen commented Sep 4, 2024

Summary

Part of #6394. I'm splitting up EuiDataGrid into smaller chunks for ease of review/QA, but as always, I still recommend following along by commit.

Converts the following miscellaenous parts of EuiDataGrid to Emotion:

  • EuiDataGrid wrapper(s) + grid body
  • Full screen CSS
  • Scrollbar overlay/styles
  • Pagination

QA

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
      - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA - N/A
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
      - [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist - N/A

@cee-chen cee-chen marked this pull request as ready for review September 4, 2024 05:18
@cee-chen cee-chen requested a review from a team as a code owner September 4, 2024 05:18
- move it to its own folder, it's a fairly top-level component in the DOM (similar to the controls/toolbar)

- simplify some of its rendering logic to a separate util (allows less conditional hooks shenanigans). Also allows us to remove the duplicate `useEuiTablePaginationDefaults()` logic, which is already done once at the topmost EuiDataGrid level

- clean up types - no need to have internal props in the top-level types file
+ requires vanilla Emotion CSS/classNames

+ delete variables, not used anywhere else and can be contained here
+ convert inline styles to logical CSS, clean up CSS slightly
- unfortunately loki doesn't screenshot scrollbars by default, but this at least helps with quick manual cross-browser QA
- Emotion `css` prop actually requires `className` under the hood to merge classes
@cee-chen cee-chen changed the title [EuiDataGrid] Convert pagination, scrollbars, and full screen to Emotion [Emotion] Convert EuiDataGrid (Part 1) Sep 4, 2024
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

Copy link
Contributor

@mgadewoll mgadewoll left a comment

Choose a reason for hiding this comment

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

🚢 🐈‍⬛ No visual regression were found and the code and improvements look good 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

[Pinning this here with loose relation]

The scrollbar tests across browsers went as expected (showing custom scrollbars or default ones) except for Safari which always shows the same static/non-overlaying ones it seemed. But that is Safari 🤷‍♀️

Copy link
Member Author

Choose a reason for hiding this comment

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

Safari: the new IE11!

@@ -187,6 +188,7 @@ export const EuiDataGridBodyCustomRender: FunctionComponent<
{...customGridBodyProps}
className={classNames(
'euiDataGrid__customRenderBody',
className,
Copy link
Contributor

Choose a reason for hiding this comment

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

TIL. Thanks for the note on the required className 👍

@cee-chen
Copy link
Member Author

cee-chen commented Sep 5, 2024

Thank you so much for the quick review Lene! 🙇

@cee-chen cee-chen merged commit 908a718 into elastic:main Sep 5, 2024
5 checks passed
@cee-chen cee-chen deleted the emotion/datagrid-misc branch September 5, 2024 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants