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

Look and feel enhancements - Batch 1 #5766

Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
padding: 4px 0 0 !important;
}

.osdDocTableCell__filter {
position: absolute;
white-space: nowrap;
right: 0;
background: $ouiPageBackgroundColor;
}

/**
* 1. Align icon with text in cell.
* 2. Use opacity to make this element accessible to screen readers and keyboard.
* 3. Show on focus to enable keyboard accessibility.
*/

.osdDocTableCell {
white-space: pre-wrap;
position: relative;

&__filter {
position: absolute;
white-space: nowrap;
right: 0;
top: 0.5em;
background: $ouiPageBackgroundColor;
}

&__filterButton,
&__filter {
opacity: 0;
Expand All @@ -35,6 +35,24 @@
&:focus &__filter {
opacity: 1;
}

.osdDescriptionListFieldTitle {
margin: 0 4px 0 0 !important;
}

/* stylelint-disable-next-line @osd/stylelint/no_modifying_global_selectors */
&.eui-textNoWrap {
width: 1%;
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
}
}

.osdDocTable__limitedHeight {
/* stylelint-disable-next-line value-no-vendor-prefix */
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 5;
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
max-height: 10em;
overflow: hidden;
}

.osdDocTableCell__source {
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,8 @@ export const TableCell = ({
fieldMapping,
sanitizedCellValue,
}: TableCellProps) => {
const tdClassNames =
columnType === 'date'
? 'osdDocTableCell eui-textNoWrap'
: 'osdDocTableCell eui-textBreakAll eui-textBreakWord';
return (
<td data-test-subj="docTableField" className={tdClassNames}>
const content = (
<>
{/* eslint-disable-next-line react/no-danger */}
<span dangerouslySetInnerHTML={{ __html: sanitizedCellValue }} />
<span className="osdDocTableCell__filter">
Expand Down Expand Up @@ -72,6 +68,19 @@ export const TableCell = ({
/>
</EuiToolTip>
</span>
</>
);

return columnType === 'date' ? (
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
<td data-test-subj="docTableField" className="osdDocTableCell eui-textNoWrap">
{content}
</td>
) : (
<td
data-test-subj="docTableField"
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
<div className="osdDocTable__limitedHeight">{content}</div>
</td>
);
};