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

2 changes: 1 addition & 1 deletion src/core/server/core_app/assets/legacy_dark_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@
width: 100%;
max-width: 100%;
margin-bottom: 20px;
font-size: 14px;
font-size: 12px;
}
.table thead {
font-size: 12px;
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/core_app/assets/legacy_light_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@
width: 100%;
max-width: 100%;
margin-bottom: 20px;
font-size: 14px;
font-size: 12px;
}
.table thead {
font-size: 12px;
Expand Down
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
// Unlike most inputs within layout control groups, the text area still needs a border.
// These adjusts help it sit above the control groups shadow to line up correctly.
padding: $euiSizeS;
padding-top: $euiSizeS + 3px;
transform: translateY(-1px) translateX(-1px);
padding-top: $euiSizeS + 2px;
transform: translateY(-2px) translateX(-1px);

&:not(:focus):not(:invalid) {
@include euiYScrollWithShadows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export function fetchSourceTypeDataCell(
const keys = Object.keys(formattedRow);

return (
<EuiDescriptionList type="inline" compressed>
<EuiDescriptionList type="inline" compressed className="source">
{keys.map((key, index) => (
<Fragment key={key}>
<EuiDescriptionListTitle className="osdDescriptionListFieldTitle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,23 @@ doc-table {
}
}

.osdDiscoverTable {
@include ouiCodeFont;

& > tbody > tr:not(.osdDiscoverInViewRow):not(.osdDiscoverExpandedRow) {
visibility: hidden;
}
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved

.osdDiscoverExpandedRow {
background: $euiColorEmptyShade;
border-top: none !important;

& > td {
padding: 2em;
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

.osdDocTable__row {
td {
position: relative;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
.osdDocTable_expandedRow {
border-top: none !important;
}

.osdDocTableCell__toggleDetails {
padding: 4px 0 0 !important;
}

.osdDocTableCell__filter { // TODO: make them appear at top right corner
padding: 3px 0 0 !important;
}

/**
Expand All @@ -16,9 +9,18 @@
*/

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

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

&__filterButton,
&__filter {
opacity: 0;
transition: opacity $euiAnimSpeedFast;

Expand All @@ -28,7 +30,40 @@
}

&:hover &__filterButton,
&:focus &__filterButton {
&:focus &__filterButton,
&:hover &__filter,
&: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;
max-height: 10em;
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
overflow: hidden;
}

.osdDocTableCell__source {
.osdDocTable__limitedHeight {
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
transform: translateY(-3px);
max-height: calc(10em - 3px);
}

dd,
dl,
dt {
font-size: inherit !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { DocViewFilterFn } from '../../doc_views/doc_views_types';

export interface TableCellProps {
columnId: string;
columnType?: string;
onFilter: DocViewFilterFn;
filterable?: boolean;
fieldMapping?: any;
Expand All @@ -26,16 +27,14 @@ export interface TableCellProps {

export const TableCell = ({
columnId,
columnType,
onFilter,
fieldMapping,
sanitizedCellValue,
}: TableCellProps) => {
return (
// eslint-disable-next-line react/no-danger
<td
data-test-subj="docTableField"
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
const content = (
<>
{/* eslint-disable-next-line react/no-danger */}
<span dangerouslySetInnerHTML={{ __html: sanitizedCellValue }} />
<span className="osdDocTableCell__filter">
<EuiToolTip
Expand Down Expand Up @@ -69,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>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const TableRow = ({
const flattened = indexPattern.flattenHit(row);
const [isExpanded, setIsExpanded] = useState(false);
const tableRow = (
<tr>
<tr key={row._id}>
<td data-test-subj="docTableExpandToggleColumn" className="osdDocTableCell__toggleDetails">
<EuiButtonIcon
color="text"
Expand All @@ -61,6 +61,7 @@ export const TableRow = ({
if (typeof row === 'undefined') {
return (
<td
key={columnId}
data-test-subj="docTableField"
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
Expand All @@ -71,8 +72,14 @@ export const TableRow = ({

if (fieldInfo?.type === '_source') {
return (
<td className="eui-textBreakAll eui-textBreakWord" data-test-subj="docTableField">
{fetchSourceTypeDataCell(indexPattern, row, columnId, false)}
<td
key={columnId}
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
className="osdDocTableCell eui-textBreakAll eui-textBreakWord osdDocTableCell__source"
data-test-subj="docTableField"
>
<div className="osdDocTable__limitedHeight">
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
{fetchSourceTypeDataCell(indexPattern, row, columnId, false)}
</div>
</td>
);
}
Expand All @@ -82,6 +89,7 @@ export const TableRow = ({
if (typeof formattedValue === 'undefined') {
return (
<td
key={columnId}
data-test-subj="docTableField"
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
Expand All @@ -95,6 +103,7 @@ export const TableRow = ({
if (!fieldInfo?.filterable) {
return (
<td
key={columnId}
data-test-subj="docTableField"
className="osdDocTableCell eui-textBreakAll eui-textBreakWord"
>
Expand All @@ -106,7 +115,9 @@ export const TableRow = ({

return (
<TableCell
key={columnId}
columnId={columnId}
columnType={fieldInfo?.type}
onFilter={onFilter}
fieldMapping={fieldMapping}
sanitizedCellValue={sanitizedCellValue}
Expand All @@ -117,9 +128,9 @@ export const TableRow = ({
);

const expandedTableRow = (
<tr>
<td className="osdDocTable_expandedRow" colSpan={columnIds.length + 1}>
<EuiFlexGroup justifyContent="center" alignItems="center">
<tr className="osdDiscoverExpandedRow" key={'x' + row._id}>
<td colSpan={columnIds.length + 2}>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
<EuiIcon type="folderOpen" />
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,14 @@

import { i18n } from '@osd/i18n';
import { EuiBreadcrumb } from '@elastic/eui';
import { getServices } from '../../opensearch_dashboards_services';

export function getRootBreadcrumbs(): EuiBreadcrumb[] {
const { core } = getServices();
return [
{
text: i18n.translate('discover.rootBreadcrumb', {
defaultMessage: 'Discover',
}),
onClick: () => core.application.navigateToApp('discover'),
href: '#/',
AMoo-Miki marked this conversation as resolved.
Show resolved Hide resolved
},
];
}
Loading