diff --git a/packages/kbn-unified-data-table/src/components/data_table.scss b/packages/kbn-unified-data-table/src/components/data_table.scss index 8b0f8719a450f..9e51777742e81 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.scss +++ b/packages/kbn-unified-data-table/src/components/data_table.scss @@ -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 { @@ -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 { @@ -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; } @@ -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; diff --git a/packages/kbn-unified-data-table/src/components/data_table_columns.tsx b/packages/kbn-unified-data-table/src/components/data_table_columns.tsx index 4b66f2a2bd6cf..4b4ac622e78f6 100644 --- a/packages/kbn-unified-data-table/src/components/data_table_columns.tsx +++ b/packages/kbn-unified-data-table/src/components/data_table_columns.tsx @@ -30,7 +30,7 @@ import { buildEditFieldButton } from './build_edit_field_button'; const openDetails = { id: 'openDetails', - width: 24, + width: 26, headerCellRender: () => ( diff --git a/packages/kbn-unified-data-table/src/constants.ts b/packages/kbn-unified-data-table/src/constants.ts index 1fb391ddc7f70..90302c310e88e 100644 --- a/packages/kbn-unified-data-table/src/constants.ts +++ b/packages/kbn-unified-data-table/src/constants.ts @@ -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: { diff --git a/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx b/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx index 941dccabf2474..0f6624a120b9c 100644 --- a/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx +++ b/packages/kbn-unified-data-table/src/utils/get_render_cell_value.test.tsx @@ -212,7 +212,9 @@ describe('Unified data table cell rendering', function () { compressed={true} type="inline" > - + extension - + bytesDisplayName - + _index - + _score - + extension - + bytesDisplayName - + _index - + _score - + extension - + bytesDisplayName - + _index - + _score - + object.value - + object.value {pairs.map(([key, value]) => ( - {key} + + {key} + {!isSuccessor && showWarning && } {!isSuccessor && showWarning && } - {!isSuccessor && } + ); } diff --git a/src/plugins/discover/public/application/context/context_app.tsx b/src/plugins/discover/public/application/context/context_app.tsx index 19a5058638392..8232b3020fbee 100644 --- a/src/plugins/discover/public/application/context/context_app.tsx +++ b/src/plugins/discover/public/application/context/context_app.tsx @@ -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'; @@ -215,6 +216,8 @@ export const ContextApp = ({ dataView, anchorId, referrer }: ContextAppProps) => }; }; + const titlePadding = useEuiPaddingSize('m'); + return ( {fetchedState.anchorStatus.value === LoadingStatus.FAILED ? ( @@ -235,12 +238,17 @@ export const ContextApp = ({ dataView, anchorId, referrer }: ContextAppProps) => - + - {!!interceptedWarnings?.length && ( - <> - - - - )} - - {loadingFeedback()} - + + {!!interceptedWarnings?.length && ( + <> + + + + )} + + {loadingFeedback()} + {isLegacy && rows && rows.length !== 0 && ( )} - - + + + ); } + +const WrapperWithPadding: React.FC = ({ children }) => { + const padding = useEuiPaddingSize('s'); + + return ( +
+ {children} +
+ ); +}; diff --git a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx index b897ea278ebab..6de74fd508ab8 100644 --- a/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx +++ b/src/plugins/discover/public/components/view_mode_toggle/view_mode_toggle.tsx @@ -36,7 +36,7 @@ export const DocumentViewModeToggle = ({ } return ( - + setDiscoverViewMode(VIEW_MODE.DOCUMENT_LEVEL)} diff --git a/test/functional/apps/discover/group1/_date_nanos_mixed.ts b/test/functional/apps/discover/group1/_date_nanos_mixed.ts index dab0003a63f07..df45356a69789 100644 --- a/test/functional/apps/discover/group1/_date_nanos_mixed.ts +++ b/test/functional/apps/discover/group1/_date_nanos_mixed.ts @@ -15,6 +15,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { const PageObjects = getPageObjects(['common', 'timePicker', 'discover']); const kibanaServer = getService('kibanaServer'); const security = getService('security'); + const browser = getService('browser'); const from = 'Jan 1, 2019 @ 00:00:00.000'; const to = 'Jan 1, 2019 @ 23:59:59.999'; @@ -25,7 +26,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) { await kibanaServer.importExport.load( 'test/functional/fixtures/kbn_archiver/date_nanos_mixed' ); - await kibanaServer.uiSettings.replace({ defaultIndex: 'timestamp-*' }); + await kibanaServer.uiSettings.replace({ + defaultIndex: 'timestamp-*', + hideAnnouncements: true, // should be enough vertical space to render rows + }); + await browser.setWindowSize(1200, 900); await security.testUser.setRoles(['kibana_admin', 'kibana_date_nanos_mixed']); await PageObjects.common.setTime({ from, to }); await PageObjects.common.navigateToApp('discover');