-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Enterprise Search] Refactor RoleMappingsTable to use EuiInMemoryTable #101918
[Enterprise Search] Refactor RoleMappingsTable to use EuiInMemoryTable #101918
Conversation
Both tables use the same actions
d74459e
to
5b0f023
Compare
This is way better than the bespoke one I wrote and it comes with pagination for free - Also fixes a typo in the i18n id
5b0f023
to
78fb896
Compare
incremental: true, | ||
fullWidth: false, | ||
placeholder: FILTER_ROLE_MAPPINGS_PLACEHOLDER, | ||
'data-test-subj': 'RoleMappingsTableSearchInput', |
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.
Are you using this attribute?
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.
Not yet, but we hope to write some Cypress tests before 8.0 and I believe it could be used there.
const actionsCol: EuiBasicTableColumn<SharedRoleMapping> = { | ||
field: 'id', | ||
name: '', | ||
align: 'right', | ||
render: (_, { id }: SharedRoleMapping) => ( | ||
<UsersAndRolesRowActions | ||
onManageClick={() => initializeRoleMapping(id)} | ||
onDeleteClick={() => handleDeleteMapping(id)} | ||
/> | ||
</> | ||
); | ||
), | ||
}; |
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 feel like this should probably be an action column https://elastic.github.io/eui/#/tabular-content/tables#adding-actions-to-table but its fine if this got polished later
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.
Yeah, I went back and forth with it. Ultimately, I decided against it because it limits the display to 2 icon buttons before collapsing the others with an ellipsis and the forthcoming invitations table for pending invitations has 3. I wasn't sure if there was any design difference between bespoke actions and that actions column but didn't want to have a mixture of them on this layout if there was.
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.
Sorry for the lateness on this, but semi related to this, FYI we do need to add a column header to action columns - it's an a11y issue / axe failure for a table cell not to have an accompanying table heading. We can definitely add it later though, I intend to do an axe pass on our plugin next week
💚 Build SucceededMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
elastic#101918) * Add shared actions component Both tables use the same actions * Refactor RoleMappingsTable to use EuiInMemoryTable This is way better than the bespoke one I wrote and it comes with pagination for free - Also fixes a typo in the i18n id
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
#101918) (#101940) * Add shared actions component Both tables use the same actions * Refactor RoleMappingsTable to use EuiInMemoryTable This is way better than the bespoke one I wrote and it comes with pagination for free - Also fixes a typo in the i18n id Co-authored-by: Scotty Bollinger <scotty.bollinger@elastic.co>
Summary
EuiInMemoryTable
is way better than the bespoke one I wrote and it comes with pagination for free. Will also use this component in the Users table coming in a future PR.Also adds a shared
UsersAndRolesRowActions
component for use in both tables.Please review
ent-search
companion PR as a part of this review.Checklist