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

Allow sorting by computed columns in EuiInMemoryTable #2044

Merged

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Jun 14, 2019

Summary

Fixes #2012.

Previously the actively sorted column was tracked by the column's field value. In computed columns there is no field. This PR changes the tracking to use name, and updates EuiInMemoryTable and EuiBasicTable to accept the target column's field or name, providing backwards compatibility.

I've updated one existing unit test so it actually tests something, and have added four more unit tests to cover the new sort case and check two forms of backwards compatibility. Updated the In-Memory Table - Custom sort values docs section with an example of sorting by a computed field.

Checklist

- [ ] This was checked in mobile
- [ ] This was checked in IE11
- [ ] This was checked in dark mode

  • Any props added have proper autodocs
  • Documentation examples were added
  • A changelog entry exists and is marked appropriately
  • This was checked for breaking changes and labeled appropriately
  • Jest tests were updated or added to match the most common scenarios
    - [ ] This was checked against keyboard-only and screenreader scenarios
    - [ ] This required updates to Framer X components

Co-Authored-By: Rory Hunter <pugnascotia@users.noreply.github.com>
Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

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

I pulled this down, built it locally, copied the files over to my local Kibana, and tried it out and it works great! LGTM!

@chandlerprall
Copy link
Contributor Author

@pugnascotia applied your suggestions, definitely like testing against the explicit values!

@chandlerprall
Copy link
Contributor Author

jenkins test this

1 similar comment
@chandlerprall
Copy link
Contributor Author

jenkins test this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sortable property ignored if no field is set for EuiTable
3 participants