mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Lens][Datatable] Ellipsis truncation is not visible in cells. Letters are just cut off. (#134065)
* [Lens][Datatable] Ellipsis truncation is not visible in cells. Letters are just cut off. Closes: #133902 * remove extra arguments Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
3819bf12ce
commit
1a702ab45f
3 changed files with 6 additions and 32 deletions
|
@ -6,9 +6,8 @@
|
|||
*/
|
||||
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import { EuiDataGridCellValueElementProps } from '@elastic/eui';
|
||||
import { IUiSettingsClient } from '@kbn/core/public';
|
||||
import classNames from 'classnames';
|
||||
import type { EuiDataGridCellValueElementProps } from '@elastic/eui';
|
||||
import type { IUiSettingsClient } from '@kbn/core/public';
|
||||
import type { FormatFactory } from '../../../common';
|
||||
import { getOriginalId } from '../../../common/expressions';
|
||||
import type { ColumnConfig } from '../../../common/expressions';
|
||||
|
@ -19,9 +18,7 @@ export const createGridCell = (
|
|||
formatters: Record<string, ReturnType<FormatFactory>>,
|
||||
columnConfig: ColumnConfig,
|
||||
DataContext: React.Context<DataContextType>,
|
||||
uiSettings: IUiSettingsClient,
|
||||
fitRowToContent?: boolean,
|
||||
rowHeight?: number
|
||||
uiSettings: IUiSettingsClient
|
||||
) => {
|
||||
// Changing theme requires a full reload of the page, so we can cache here
|
||||
const IS_DARK_THEME = uiSettings.get('theme:darkMode');
|
||||
|
@ -30,10 +27,6 @@ export const createGridCell = (
|
|||
const rowValue = table?.rows[rowIndex]?.[columnId];
|
||||
const content = formatters[columnId]?.convert(rowValue, 'html');
|
||||
const currentAlignment = alignments && alignments[columnId];
|
||||
const alignmentClassName = `lnsTableCell--${currentAlignment}`;
|
||||
const className = classNames(alignmentClassName, {
|
||||
lnsTableCell: !fitRowToContent && rowHeight === 1,
|
||||
});
|
||||
|
||||
const { colorMode, palette } =
|
||||
columnConfig.columns.find(({ columnId: id }) => id === columnId) || {};
|
||||
|
@ -81,7 +74,7 @@ export const createGridCell = (
|
|||
*/
|
||||
dangerouslySetInnerHTML={{ __html: content }} // eslint-disable-line react/no-danger
|
||||
data-test-subj="lnsTableCellContent"
|
||||
className={className}
|
||||
className={`lnsTableCell--${currentAlignment}`}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -2,11 +2,6 @@
|
|||
height: 100%;
|
||||
}
|
||||
|
||||
// only apply truncation inside of a table cell (not within popover)
|
||||
.lnsDataTableContainer .lnsTableCell {
|
||||
@include euiTextTruncate;
|
||||
}
|
||||
|
||||
.lnsTableCell--left {
|
||||
text-align: left;
|
||||
}
|
||||
|
|
|
@ -337,22 +337,8 @@ export const DatatableComponent = (props: DatatableRenderProps) => {
|
|||
]);
|
||||
|
||||
const renderCellValue = useMemo(
|
||||
() =>
|
||||
createGridCell(
|
||||
formatters,
|
||||
columnConfig,
|
||||
DataContext,
|
||||
props.uiSettings,
|
||||
props.args.fitRowToContent,
|
||||
props.args.rowHeightLines
|
||||
),
|
||||
[
|
||||
formatters,
|
||||
columnConfig,
|
||||
props.uiSettings,
|
||||
props.args.fitRowToContent,
|
||||
props.args.rowHeightLines,
|
||||
]
|
||||
() => createGridCell(formatters, columnConfig, DataContext, props.uiSettings),
|
||||
[formatters, columnConfig, props.uiSettings]
|
||||
);
|
||||
|
||||
const columnVisibility = useMemo(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue