forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Logs Explorer] Add customisation point and 1st column tooltip for co…
…ntent virtual co… (elastic#174924) ## Summary Closes - elastic#173615 This PR adds a customisation point where it exposes the whole column which is of type `EuiDataGridColumn` to be customised. As of the current scope we only intend to customise the `display` property for the column which is responsible for rendering the column header. Idea is to add custom tooltips for Virtual Columns ## Demo ![Content Tooltip](https://github.com/elastic/kibana/assets/7416358/59d6f1f2-68fc-4f31-82cd-b8525071706e) ## Why is this change being done Please refer to the [Figma](https://www.figma.com/file/g2uboVjdzylHDyrIUrI4cU/Virtual-columns?type=design&node-id=3277-320484&mode=design&t=t15IO9jmfitMSHuH-0) file for details. <img width="1031" alt="image" src="https://github.com/elastic/kibana/assets/7416358/d1fa4a04-3a56-443f-9798-1062133d6887"> ## Want to run this PR locally ``` // Checkout this PR gh pr checkout 174924 // Start Kibana locally yarn start // Start ES locally yarn es snapshot // Generate dummy data node scripts/synthtrace simple_logs.ts --clean ``` --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
32f8811
commit 86a762b
Showing
19 changed files
with
460 additions
and
69 deletions.
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
...ages/kbn-unified-data-table/src/components/__snapshots__/data_table_columns.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
packages/kbn-unified-data-table/src/components/column_header_truncate_container.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiTextBlockTruncate } from '@elastic/eui'; | ||
import { css } from '@emotion/react'; | ||
import { euiThemeVars } from '@kbn/ui-theme'; | ||
|
||
const ColumnHeaderTruncateContainer = ({ | ||
headerRowHeight = 1, | ||
children, | ||
}: { | ||
headerRowHeight: number; | ||
children: React.ReactNode; | ||
}) => { | ||
return ( | ||
<EuiTextBlockTruncate | ||
lines={headerRowHeight} | ||
css={css` | ||
overflow-wrap: anywhere; | ||
white-space: normal; | ||
word-break: break-all; | ||
line-height: ${euiThemeVars.euiSize}; | ||
text-align: left; | ||
.euiDataGridHeaderCell--numeric & { | ||
float: right; | ||
} | ||
`} | ||
> | ||
{children} | ||
</EuiTextBlockTruncate> | ||
); | ||
}; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default ColumnHeaderTruncateContainer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.