= ({ return ( } - hasBorder + hasBorder={false} title={

Date: Tue, 5 Sep 2023 14:23:42 +0200 Subject: [PATCH 13/55] [Discover] Update field list styles --- .../kbn-unified-data-table/src/components/data_table.scss | 4 ++++ .../src/components/field_item_button/field_item_button.scss | 4 ++++ .../src/components/field_list_filters/field_name_search.tsx | 1 + 3 files changed, 9 insertions(+) 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..6ce913040f5dc 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.scss +++ b/packages/kbn-unified-data-table/src/components/data_table.scss @@ -57,6 +57,10 @@ flex-direction: column; flex-wrap: nowrap; height: 100%; + + .euiDataGrid__content { + background: transparent; + } } .unifiedDataTable__table { diff --git a/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss b/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss index 70073c37ea31c..b6d04b6a79699 100644 --- a/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss +++ b/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss @@ -64,6 +64,10 @@ opacity: 1; } } + + &.domDragDrop-isDraggable { + box-shadow: none; + } } .unifiedFieldListItemButton--missing { diff --git a/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx b/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx index 91d78850e4453..67eb85b4b7849 100644 --- a/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx +++ b/packages/kbn-unified-field-list/src/components/field_list_filters/field_name_search.tsx @@ -52,6 +52,7 @@ export const FieldNameSearch: React.FC = ({ placeholder={searchPlaceholder} value={nameFilter} append={append} + compressed /> ); }; From f5d1996dcf20c36b82cb5a70c8242120d443376d Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Tue, 5 Sep 2023 14:36:14 +0200 Subject: [PATCH 14/55] [Discover] Update Add Field button --- .../field_list_sidebar.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/kbn-unified-field-list/src/containers/unified_field_list_sidebar/field_list_sidebar.tsx b/packages/kbn-unified-field-list/src/containers/unified_field_list_sidebar/field_list_sidebar.tsx index 12eb7209cd05a..d0fe5b9bd88a4 100644 --- a/packages/kbn-unified-field-list/src/containers/unified_field_list_sidebar/field_list_sidebar.tsx +++ b/packages/kbn-unified-field-list/src/containers/unified_field_list_sidebar/field_list_sidebar.tsx @@ -9,7 +9,8 @@ import './field_list_sidebar.scss'; import React, { memo, useCallback, useEffect, useMemo, useState } from 'react'; import { i18n } from '@kbn/i18n'; -import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiPageSidebar } from '@elastic/eui'; +import { EuiFlexGroup, EuiFlexItem, EuiPageSidebar } from '@elastic/eui'; +import { ToolbarButton } from '@kbn/shared-ux-button-toolbar'; import { type DataViewField } from '@kbn/data-views-plugin/public'; import { getDataViewFieldSubtypeMulti } from '@kbn/es-query/src/utils'; import { FIELDS_LIMIT_SETTING, SEARCH_FIELDS_FROM_SOURCE } from '@kbn/discover-utils'; @@ -295,19 +296,18 @@ export const UnifiedFieldListSidebarComponent: React.FC - onEditField()} size="s" - > - {i18n.translate('unifiedFieldList.fieldListSidebar.addFieldButtonLabel', { - defaultMessage: 'Add a field', - })} - + /> )} From 9a139e35e3e580f5173f1b0a0276cffef0ca875d Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Tue, 5 Sep 2023 14:45:45 +0200 Subject: [PATCH 15/55] [Discover] Remove tabs background --- .../public/components/view_mode_toggle/view_mode_toggle.tsx | 2 -- 1 file changed, 2 deletions(-) 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..475d65d20f056 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 @@ -10,7 +10,6 @@ import { EuiTabs, EuiTab, useEuiPaddingSize } from '@elastic/eui'; import React from 'react'; import { FormattedMessage } from '@kbn/i18n-react'; import { css } from '@emotion/react'; -import { euiThemeVars } from '@kbn/ui-theme'; import { SHOW_FIELD_STATISTICS } from '@kbn/discover-utils'; import { VIEW_MODE } from '../../../common/constants'; import { useDiscoverServices } from '../../hooks/use_discover_services'; @@ -26,7 +25,6 @@ export const DocumentViewModeToggle = ({ const tabsCss = css` padding: 0 ${useEuiPaddingSize('s')}; - background-color: ${euiThemeVars.euiPageBackgroundColor}; `; const showViewModeToggle = uiSettings.get(SHOW_FIELD_STATISTICS) ?? false; From 2eddea685327fd3d124749c95b7572ce84e12330 Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Tue, 5 Sep 2023 14:52:32 +0200 Subject: [PATCH 16/55] [Discover] Apply item shadow changes only for discover --- .../src/components/field_item_button/field_item_button.scss | 2 +- .../src/components/field_item_button/field_item_button.tsx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss b/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss index b6d04b6a79699..e792c3e9b96fc 100644 --- a/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss +++ b/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.scss @@ -65,7 +65,7 @@ } } - &.domDragDrop-isDraggable { + &--size-xs.domDragDrop-isDraggable { box-shadow: none; } } diff --git a/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.tsx b/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.tsx index 13860a0e4f155..3d788e92572b0 100644 --- a/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.tsx +++ b/packages/kbn-unified-field-list/src/components/field_item_button/field_item_button.tsx @@ -105,6 +105,7 @@ export function FieldItemButton({ [`unifiedFieldListItemButton--${type}`]: type, [`unifiedFieldListItemButton--exists`]: !isEmpty, [`unifiedFieldListItemButton--missing`]: isEmpty, + [`unifiedFieldListItemButton--size-${size}`]: true, }, className ); From 15693c960ec0cd9fa59621ec6ac43ad3dbba97a4 Mon Sep 17 00:00:00 2001 From: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 5 Sep 2023 13:02:03 +0000 Subject: [PATCH 17/55] [CI] Auto-commit changed files from 'node scripts/lint_ts_projects --fix' --- packages/kbn-unified-field-list/tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/kbn-unified-field-list/tsconfig.json b/packages/kbn-unified-field-list/tsconfig.json index 78ea71ca44344..f60d203786439 100644 --- a/packages/kbn-unified-field-list/tsconfig.json +++ b/packages/kbn-unified-field-list/tsconfig.json @@ -29,6 +29,7 @@ "@kbn/shared-ux-utility", "@kbn/discover-utils", "@kbn/ebt-tools", + "@kbn/shared-ux-button-toolbar", ], "exclude": ["target/**/*"] } From 604d7223261c084539919a7174b8d07fbdecf937 Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Tue, 5 Sep 2023 15:46:00 +0200 Subject: [PATCH 18/55] [Discover] Swap checkbox and arrow back --- .../kbn-unified-data-table/src/components/data_table.scss | 4 ++-- .../src/components/data_table_columns.tsx | 6 +++--- test/functional/services/data_grid.ts | 7 ++----- 3 files changed, 7 insertions(+), 10 deletions(-) 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 a27f220700c04..7bcfae7c3ed4f 100644 --- a/packages/kbn-unified-data-table/src/components/data_table.scss +++ b/packages/kbn-unified-data-table/src/components/data_table.scss @@ -38,11 +38,11 @@ } .euiDataGridRowCell.euiDataGridRowCell--controlColumn[data-gridcell-column-id='select'] { - padding: $euiSizeS 0 0 $euiSizeS; + padding: $euiSizeS+2 0 0 $euiSizeXS; } .euiDataGridRowCell.euiDataGridRowCell--controlColumn[data-gridcell-column-id='openDetails'] { - padding: $euiSizeXS 0 0 $euiSizeXS; + padding: $euiSizeXS+1 0 0 0; } .euiDataGrid--rowHoverHighlight .euiDataGridRow:hover, 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 97f28354905e2..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: 32, + width: 26, headerCellRender: () => ( @@ -45,7 +45,7 @@ const openDetails = { const select = { id: 'select', - width: 26, + width: 24, rowCellRender: SelectButton, headerCellRender: () => ( @@ -62,7 +62,7 @@ export function getLeadControlColumns(canSetExpandedDoc: boolean) { if (!canSetExpandedDoc) { return [select]; } - return [select, openDetails]; + return [openDetails, select]; } function buildEuiGridColumn({ diff --git a/test/functional/services/data_grid.ts b/test/functional/services/data_grid.ts index a625f6c58efc0..8c5910d38c85c 100644 --- a/test/functional/services/data_grid.ts +++ b/test/functional/services/data_grid.ts @@ -206,12 +206,9 @@ export class DataGridService extends FtrService { const testSubj = options.isAnchorRow ? '~docTableExpandToggleColumnAnchor' : '~docTableExpandToggleColumn'; - // can be in the second column (Discover page) and in the first column (Surrounding Documents page) - const firstCell = row[0]; + // can be as the second column (Discover page) and the first column (Surrounding Documents page) const toggle = - (await firstCell.getAttribute('data-gridcell-column-id')) === 'openDetails' - ? await firstCell.findByTestSubject(testSubj) - : await row[1].findByTestSubject(testSubj); + (await row[1].findByTestSubject(testSubj)) || (await row[0].findByTestSubject(testSubj)); await toggle.scrollIntoViewIfNecessary(); await toggle.click(); From 7e59c76f16ec3feeb72562e37a96fe0e8edf16db Mon Sep 17 00:00:00 2001 From: Julia Rechkunova Date: Tue, 5 Sep 2023 16:09:41 +0200 Subject: [PATCH 19/55] [Discover] Update context app layout to remove extra horizontal margin --- .../components/action_bar/action_bar.tsx | 1 + .../application/context/context_app.tsx | 14 +++- .../context/context_app_content.tsx | 79 ++++++++++++------- 3 files changed, 61 insertions(+), 33 deletions(-) diff --git a/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx b/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx index 65a0a8bfe3c5b..747cd68837545 100644 --- a/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx +++ b/src/plugins/discover/public/application/context/components/action_bar/action_bar.tsx @@ -156,6 +156,7 @@ export function ActionBar({ {!isSuccessor && showWarning && } {!isSuccessor && showWarning && } + ); } 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 && (