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

[EuiDataGrid] Handle exposed ref APIs potentially pointing to invalid, off-page, or out of view cells #5572

Merged
merged 10 commits into from
Feb 1, 2022

Commits on Jan 27, 2022

  1. Enable sorting + targeting row indices outside of the current page

    - to test handling the exposed APIs when dealing with sorted/paginated data
    cee-chen committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    2874148 View commit details
    Browse the repository at this point in the history
  2. Switch data grid example to Typescript

    - to test type issues during consumer usage
    
    + @ts-ignore faker complaints
    cee-chen committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    eaeaba2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7786fcc View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4a80624 View commit details
    Browse the repository at this point in the history
  5. [setup] Move imperative handler setup to its own util file

    - this will let us set up ref-specific helpers & add more comment context without bloating the main file
    cee-chen committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    540de15 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9477d1f View commit details
    Browse the repository at this point in the history
  7. Add getVisibleRowIndex helper

    - Converts the `rowIndex` from the consumer to a `visibleRowIndex` that our internal state can use
    
    - Account for sorted grid by finding the inversed index of the `sortedRowMap`
    - To make this easier, I converted soredRowMap to an array (since it's already only uses numbers for both keys and values), since arrays have a handy .findIndex method
    
    - Handles automatically paginating the grid if the targeted cell is on a different page
    cee-chen committed Jan 27, 2022
    Configuration menu
    Copy the full SHA
    74a833f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ba29a97 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    56465f6 View commit details
    Browse the repository at this point in the history

Commits on Feb 1, 2022

  1. [PR feedback] Rename fns to indicate multiple concerns

    - having a side effect in a getter feels bad, so change that to a `find`
    - rename use hook to indicate sorting and pagination concerns
    cee-chen committed Feb 1, 2022
    Configuration menu
    Copy the full SHA
    55a4ba6 View commit details
    Browse the repository at this point in the history