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

Upgrade EUI to v94.1.0 (major EuiTable refactors) #180514

Merged
merged 37 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
3f3d30f
Upgrade EUI to v94.1.0
cee-chen Apr 9, 2024
1065a20
Convert `responsive` prop to new `responsiveBreakpoint` API
cee-chen Apr 9, 2024
3e093f9
Remove unused `textOnly` table prop
cee-chen Apr 9, 2024
6c86f0c
Remove `hasActions` table props
cee-chen Apr 9, 2024
f220cea
Remove `hasActions` prop + util
cee-chen Apr 9, 2024
8942389
Remove `isExpandable` table prop
cee-chen Apr 9, 2024
fc31f49
Remove `isExpandable` table prop with conditional logic
cee-chen Apr 9, 2024
6897cc2
Remove `isSelectable` table prop
cee-chen Apr 9, 2024
5ac1913
Remove `isSelectable` conditional table props
cee-chen Apr 9, 2024
c180bc3
[EuiTableRow] `isSelectable` prop update
cee-chen Apr 9, 2024
3db5f8c
[EuiTables] Misc syntax cleanups/chores
cee-chen Apr 9, 2024
86ce80b
Remove direct references to table classNames
cee-chen Apr 10, 2024
cdc3fbd
Remove deprecated `showOnHover` column API and direct className usage
cee-chen Apr 10, 2024
7284869
[Security] Replace role tables' custom actions/CSS with default actions
cee-chen Apr 10, 2024
c109b20
Update DOM snapshots of tables
cee-chen Apr 10, 2024
af64cf8
Update Enzyme snapshots
cee-chen Apr 10, 2024
e2e5cad
Fix Enzyme selectors
cee-chen Apr 10, 2024
89f107e
Fix Enzyme simulated events
cee-chen Apr 11, 2024
b6144ca
Fix test text assertions caused by mobile headers no longer rendering…
cee-chen Apr 10, 2024
a3a273e
Fix/simplify more mobile vs desktop test assertions
cee-chen Apr 11, 2024
e5e3aa9
Fix FTR selectors to account for removed modifier classNames/updated DOM
cee-chen Apr 11, 2024
ed44615
Fix FTR selectors around actions
cee-chen Apr 10, 2024
56ed18a
Fix failing FTR tests caused by examples missing EUI breakpoints prov…
cee-chen Apr 11, 2024
67e69d8
Update table cell chart CSS to account for changes
cee-chen Apr 11, 2024
a65cc0f
Merge remote-tracking branch 'upstream/main' into eui/v94.1.0
cee-chen Apr 12, 2024
7213048
Update EUI to grab backport with latest table fixes
cee-chen Apr 12, 2024
ede169f
Merge branch 'main' into eui/v94.1.0
cee-chen Apr 16, 2024
8d9b362
[PR feedback] Increase actions column width
cee-chen Apr 16, 2024
4055eff
[PR feedback] Fix custom table cell `className` CSS
cee-chen Apr 16, 2024
7778346
Merge branch 'main' into eui/v94.1.0
cee-chen Apr 18, 2024
c48425e
[Infra][Hosts] Fix truncation on `Command` column
cee-chen Apr 18, 2024
fa99ad8
[APM][Services] Fix overview tables custom CSS
cee-chen Apr 18, 2024
718fc3c
Increase various column widths with text that are now cut off due to …
cee-chen Apr 18, 2024
e8a856b
Update snapshot from updated table
cee-chen Apr 18, 2024
ac4aa7d
[Security][Data Quality] Increase width of column to account for sort…
cee-chen Apr 18, 2024
46006d7
Merge branch 'main' into eui/v94.1.0
cee-chen Apr 18, 2024
061273b
Update test w/ updated column width
cee-chen Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
*/

import React, { Dispatch } from 'react';
import { css } from '@emotion/css';
import { i18n } from '@kbn/i18n';
import { EuiToolTip, EuiButtonIcon } from '@elastic/eui';
import { EuiToolTip, EuiButtonIcon, useEuiTheme, euiCanAnimate } from '@elastic/eui';
import type { Field } from './utils';

interface AddMetadataPinToRowProps {
Expand All @@ -25,6 +26,8 @@ export const AddMetadataPinToRow = ({
pinnedItems,
onPinned,
}: AddMetadataPinToRowProps) => {
const { euiTheme } = useEuiTheme();

const handleAddPin = () => {
onPinned([...pinnedItems, fieldName]);
};
Expand Down Expand Up @@ -58,8 +61,22 @@ export const AddMetadataPinToRow = ({
);
}

// Custom table show on hover CSS, since this button is not technically in an action column
// Potential EUI TODO - multiple action columns and `align`ed actions are not currently supported
const showOnRowHoverCss = css`
opacity: 0;
${euiCanAnimate} {
transition: opacity ${euiTheme.animation.normal} ${euiTheme.animation.resistance};
}

.euiTableRow:hover &,
&:focus-within {
opacity: 1;
}
`;

return (
<span className="euiTableCellContent__hoverItem expandedItemActions__completelyHide">
<span className={showOnRowHoverCss}>
cee-chen marked this conversation as resolved.
Show resolved Hide resolved
<EuiToolTip content={PIN_FIELD}>
<EuiButtonIcon
color="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export const Table = ({ loading, rows, onSearchChange, search, showActionsColumn
align: 'center' as HorizontalAlignment,
width: '5%',
sortable: false,
showOnHover: true,
render: (_name: string, item: Field) => {
return (
<AddMetadataPinToRow
Expand Down Expand Up @@ -158,7 +157,6 @@ export const Table = ({ loading, rows, onSearchChange, search, showActionsColumn
field: 'value',
name: 'Actions',
sortable: false,
showOnHover: true,
align: 'center' as HorizontalAlignment,
render: (_name: string, item: Field) => {
return <AddMetadataFilterButton item={item} />;
Expand All @@ -176,7 +174,6 @@ export const Table = ({ loading, rows, onSearchChange, search, showActionsColumn
responsiveBreakpoint={false}
columns={columns}
items={fieldsWithPins}
rowProps={{ className: 'euiTableRow-hasActions' }}
search={searchBar}
loading={loading}
error={searchError ? `${searchError.message}` : ''}
Expand Down