From 90d11cd1f6076dc75494d7688598a2936008655b Mon Sep 17 00:00:00 2001 From: Dzmitry Tamashevich Date: Fri, 20 Aug 2021 13:03:27 +0300 Subject: [PATCH 1/2] [Discover] fix discover footer width --- .../main/components/doc_table/_doc_table.scss | 1 + .../doc_table/doc_table_infinite.tsx | 55 +++++++++++-------- .../doc_table/doc_table_wrapper.tsx | 6 ++ 3 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/_doc_table.scss b/src/plugins/discover/public/application/apps/main/components/doc_table/_doc_table.scss index add2d4e753c60..d19a1fd042069 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/_doc_table.scss +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/_doc_table.scss @@ -5,6 +5,7 @@ .kbnDocTableWrapper { @include euiScrollBar; overflow: auto; + display: flex; flex: 1 1 100%; flex-direction: column; /* 1 */ diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx index 8e9066151b368..778c6c1abe274 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_infinite.tsx @@ -14,6 +14,8 @@ import { EuiButtonEmpty } from '@elastic/eui'; import { DocTableProps, DocTableRenderProps, DocTableWrapper } from './doc_table_wrapper'; import { SkipBottomButton } from '../skip_bottom_button'; +const FOOTER_PADDING = { padding: 0 }; + const DocTableInfiniteContent = (props: DocTableRenderProps) => { const [limit, setLimit] = useState(props.minimumVisibleRows); @@ -74,29 +76,38 @@ const DocTableInfiniteContent = (props: DocTableRenderProps) => { {props.renderHeader()}{props.renderRows(props.rows.slice(0, limit))} -
- {props.rows.length === props.sampleSize ? ( -
- + - - - -
- ) : ( - - ​ - - )} + values={{ sampleSize: props.sampleSize }} + /> + + + + + ) : ( + + ​ + + )} + + + + ); }; diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx index c875bf155bd79..7d12cabaded61 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx @@ -58,6 +58,10 @@ export interface DocTableProps { * Loading state */ isLoading: boolean; + /** + * Number of table columns + */ + columnLength: number; /** * Filter callback */ @@ -81,6 +85,7 @@ export interface DocTableProps { } export interface DocTableRenderProps { + columnLength: number; rows: DocTableRow[]; minimumVisibleRows: number; sampleSize: number; @@ -219,6 +224,7 @@ export const DocTableWrapper = ({ > {rows.length !== 0 && render({ + columnLength: columns.length, rows, minimumVisibleRows, sampleSize, From 375021226210e53d349a81079d0fa98b8187e6bb Mon Sep 17 00:00:00 2001 From: Dzmitry Tamashevich Date: Fri, 20 Aug 2021 13:29:38 +0300 Subject: [PATCH 2/2] [Discover] fix types --- .../apps/main/components/doc_table/doc_table_wrapper.tsx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx index 7d12cabaded61..4c832d3f6a02c 100644 --- a/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx +++ b/src/plugins/discover/public/application/apps/main/components/doc_table/doc_table_wrapper.tsx @@ -58,10 +58,6 @@ export interface DocTableProps { * Loading state */ isLoading: boolean; - /** - * Number of table columns - */ - columnLength: number; /** * Filter callback */