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

[Discover] Update data table grid styles #164187

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
64 changes: 30 additions & 34 deletions packages/kbn-unified-data-table/src/components/data_table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,6 @@
max-width: 100%;
height: 100%;
overflow: hidden;
border-radius: $euiBorderRadius;

.euiDataGrid__controls {
border: none;
border-bottom: $euiBorderThin;
}

.euiDataGridRowCell.euiDataGridRowCell--firstColumn {
border-left: none;
padding: 0;
}

.euiDataGridRowCell.euiDataGridRowCell--lastColumn {
border-right: none;
}

.unifiedDataTable__table .euiDataGridRowCell:first-of-type,
.unifiedDataTable__table .euiDataGrid--headerShade.euiDataGrid--bordersAll .euiDataGridHeaderCell:first-of-type {
border-left: none;
border-right: none;
}

.euiDataGridRowCell:last-of-type,
.euiDataGridHeaderCell:last-of-type {
border-right: none;
}
}

.unifiedDataTable__cellValue {
Expand Down Expand Up @@ -57,6 +31,27 @@
flex-direction: column;
flex-wrap: nowrap;
height: 100%;

.euiDataGrid__controls {
border-top: $euiBorderThin;
}

.euiDataGrid--headerUnderline .euiDataGridHeaderCell {
border-bottom: $euiBorderThin;
}

.euiDataGridRowCell.euiDataGridRowCell--controlColumn[data-gridcell-column-id='select'] {
padding: $euiSizeS+2 0 0 $euiSizeXS;
}

.euiDataGridRowCell.euiDataGridRowCell--controlColumn[data-gridcell-column-id='openDetails'] {
padding: $euiSizeXS+1 0 0 0;
}

.euiDataGrid--rowHoverHighlight .euiDataGridRow:hover,
.euiDataGrid--rowHoverHighlight .euiDataGridRow:hover .euiDataGridRowCell__contentByHeight + .euiDataGridRowCell__expandActions {
background-color: tintOrShade($euiColorLightShade, 50%, 0);
}
}

.unifiedDataTable__table {
Expand All @@ -65,14 +60,6 @@
min-height: 0;
}

.unifiedDataTable__footer {
flex-shrink: 0;
background-color: $euiColorLightShade;
padding: $euiSize / 2 $euiSize;
margin-top: $euiSize / 4;
text-align: center;
}

.unifiedDataTable__flyoutHeader {
white-space: nowrap;
}
Expand Down Expand Up @@ -118,7 +105,16 @@
@include euiTextTruncate;
}

.unifiedDataTable__descriptionListTitle {
margin-inline: 0 0;
padding-inline: 0;
background: transparent;
font-weight: $euiFontWeightBold;
}

.unifiedDataTable__descriptionListDescription {
margin-inline: $euiSizeS $euiSizeS;
padding-inline: 0;
word-break: break-all;
white-space: normal;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { buildEditFieldButton } from './build_edit_field_button';

const openDetails = {
id: 'openDetails',
width: 24,
width: 26,
headerCellRender: () => (
<EuiScreenReaderOnly>
<span>
Expand Down
12 changes: 7 additions & 5 deletions packages/kbn-unified-data-table/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ export const defaultMonacoEditorWidth = 370;
export const defaultTimeColumnWidth = 210;
export const kibanaJSON = 'kibana-json';

export const GRID_STYLE = {
border: 'all',
export const GRID_STYLE: EuiDataGridStyle = {
border: 'horizontal',
fontSize: 's',
cellPadding: 's',
rowHover: 'none',
} as EuiDataGridStyle;
cellPadding: 'l',
rowHover: 'highlight',
header: 'underline',
stripes: true,
};

export const toolbarVisibility = {
showColumnSelector: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,9 @@ describe('Unified data table cell rendering', function () {
compressed={true}
type="inline"
>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
extension
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -223,7 +225,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
bytesDisplayName
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -234,7 +238,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
_index
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -245,7 +251,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
_score
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand Down Expand Up @@ -363,7 +371,9 @@ describe('Unified data table cell rendering', function () {
compressed={true}
type="inline"
>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
extension
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -376,7 +386,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
bytesDisplayName
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -389,7 +401,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
_index
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -400,7 +414,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
_score
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand Down Expand Up @@ -443,7 +459,9 @@ describe('Unified data table cell rendering', function () {
compressed={true}
type="inline"
>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
extension
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -456,7 +474,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
bytesDisplayName
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -469,7 +489,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
_index
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand All @@ -480,7 +502,9 @@ describe('Unified data table cell rendering', function () {
}
}
/>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
_score
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand Down Expand Up @@ -603,7 +627,9 @@ describe('Unified data table cell rendering', function () {
compressed={true}
type="inline"
>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
object.value
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand Down Expand Up @@ -646,7 +672,9 @@ describe('Unified data table cell rendering', function () {
compressed={true}
type="inline"
>
<EuiDescriptionListTitle>
<EuiDescriptionListTitle
className="unifiedDataTable__descriptionListTitle"
>
object.value
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ export const getRenderCellValueFn =
>
{pairs.map(([key, value]) => (
<Fragment key={key}>
<EuiDescriptionListTitle>{key}</EuiDescriptionListTitle>
<EuiDescriptionListTitle className="unifiedDataTable__descriptionListTitle">
{key}
</EuiDescriptionListTitle>
<EuiDescriptionListDescription
className="unifiedDataTable__descriptionListDescription"
dangerouslySetInnerHTML={{ __html: value }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function ActionBar({
</EuiFlexGroup>
{!isSuccessor && showWarning && <EuiSpacer size="s" />}
{!isSuccessor && showWarning && <ActionBarWarning docCount={docCountAvailable} type={type} />}
{!isSuccessor && <EuiSpacer size="s" />}
<EuiSpacer size="s" />
</form>
);
}
14 changes: 11 additions & 3 deletions src/plugins/discover/public/application/context/context_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import React, { Fragment, memo, useEffect, useRef, useMemo, useCallback } from '
import './context_app.scss';
import classNames from 'classnames';
import { FormattedMessage } from '@kbn/i18n-react';
import { EuiText, EuiPage, EuiPageBody, EuiSpacer } from '@elastic/eui';
import { EuiText, EuiPage, EuiPageBody, EuiSpacer, useEuiPaddingSize } from '@elastic/eui';
import { css } from '@emotion/react';
import { cloneDeep } from 'lodash';
import { DataView, DataViewField } from '@kbn/data-views-plugin/public';
import { useExecutionContext } from '@kbn/kibana-react-plugin/public';
Expand Down Expand Up @@ -215,6 +216,8 @@ export const ContextApp = ({ dataView, anchorId, referrer }: ContextAppProps) =>
};
};

const titlePadding = useEuiPaddingSize('m');

return (
<Fragment>
{fetchedState.anchorStatus.value === LoadingStatus.FAILED ? (
Expand All @@ -235,12 +238,17 @@ export const ContextApp = ({ dataView, anchorId, referrer }: ContextAppProps) =>
<EuiPage className={classNames({ dscDocsPage: !isLegacy })}>
<EuiPageBody
panelled
paddingSize="s"
paddingSize="none"
className="dscDocsContent"
panelProps={{ role: 'main' }}
>
<EuiSpacer size="s" />
<EuiText data-test-subj="contextDocumentSurroundingHeader">
<EuiText
data-test-subj="contextDocumentSurroundingHeader"
css={css`
padding: ${titlePadding} ${titlePadding} 0;
`}
>
<strong>
<FormattedMessage
id="discover.context.contextOfTitle"
Expand Down
Loading