From 6db16bb11a1e1e85012fb2d55ac745aadac4af1b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 8 Aug 2024 19:05:28 -0700 Subject: [PATCH] Use smaller and compressed varients of buttons and form components (#421) (#424) * Use EuiSmallButton * Use EuiSmallButtonIcon * Use EuiSmallButtonEmpty * Use EuiCompressedFormRow * Use EuiCompressedField* * Use EuiCompressedSelect and EuiCompressedSuperSelect * Use EuiCompressedComboBox * Update snapshots and tests --------- (cherry picked from commit 1a3157b633311fbe357baec958f0bcc5504f28e2) Signed-off-by: Miki Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- .../result_component.test.tsx.snap | 1520 +++++++++-------- .../__snapshots__/result_grid.test.tsx.snap | 720 ++++---- .../result_components/result_grid.tsx | 4 +- .../__snapshots__/search_bar.test.tsx.snap | 90 +- .../__snapshots__/search_config.test.tsx.snap | 462 ++--- .../search_configs.test.tsx.snap | 924 +++++----- .../__tests__/search_config.test.tsx | 8 +- .../search_components/search_bar.tsx | 8 +- .../search_configs/search_config.tsx | 38 +- 9 files changed, 2047 insertions(+), 1727 deletions(-) diff --git a/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_component.test.tsx.snap b/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_component.test.tsx.snap index 3c6442e5..3dcf6d2e 100644 --- a/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_component.test.tsx.snap +++ b/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_component.test.tsx.snap @@ -1692,7 +1692,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -2182,7 +2190,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -2649,7 +2665,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -3093,7 +3117,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -3537,7 +3569,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -3981,7 +4021,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -4448,7 +4496,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -4892,7 +4948,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -5359,7 +5423,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -5803,7 +5875,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -6753,7 +6833,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -7243,7 +7331,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -7710,7 +7806,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -8154,7 +8258,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -8598,7 +8710,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -9042,7 +9162,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -9509,7 +9637,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -9953,7 +10089,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -10420,7 +10564,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + @@ -10864,7 +11016,7 @@ exports[`Result component Renders result component 1`] = ` - - - + + + + + + + + diff --git a/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_grid.test.tsx.snap b/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_grid.test.tsx.snap index 14134e7d..276f8faf 100644 --- a/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_grid.test.tsx.snap +++ b/public/components/query_compare/search_result/result_components/__test__/__snapshots__/result_grid.test.tsx.snap @@ -546,7 +546,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -975,7 +983,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -1381,7 +1397,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -1764,7 +1788,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -2208,7 +2240,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -2652,7 +2692,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -3119,7 +3167,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -3563,7 +3619,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -4030,7 +4094,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + @@ -4474,7 +4546,7 @@ exports[`Result grid component Renders result grid component 1`] = ` - - - + + + + + + + + diff --git a/public/components/query_compare/search_result/result_components/result_grid.tsx b/public/components/query_compare/search_result/result_components/result_grid.tsx index 588e139b..946ed49c 100644 --- a/public/components/query_compare/search_result/result_components/result_grid.tsx +++ b/public/components/query_compare/search_result/result_components/result_grid.tsx @@ -5,7 +5,7 @@ import { - EuiButtonIcon, + EuiSmallButtonIcon, EuiDescriptionList, EuiDescriptionListDescription, EuiDescriptionListTitle, @@ -53,7 +53,7 @@ export const ResultGridComponent = ({ -
@@ -79,7 +79,7 @@ exports[`Search bar component Renders search bar component 1`] = ` className="euiFormControlLayoutIcons" >
-
+ - - - - - + + + + + diff --git a/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_config.test.tsx.snap b/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_config.test.tsx.snap index 75498187..165a0668 100644 --- a/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_config.test.tsx.snap +++ b/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_config.test.tsx.snap @@ -82,9 +82,9 @@ exports[`Flyout component Renders flyout component 1`] = `
-
- - -
- - -   - - - -
+ +
-
- - + + +
- +
-
-
- +
- +
-
-
+ `; @@ -875,9 +887,9 @@ exports[`Flyout component Renders flyout component when multi-datasource is enab
-
- - -
- - -   - - - -
+ +
-
- - + + +
- +
-
-
- +
- +
-
-
+ `; diff --git a/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_configs.test.tsx.snap b/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_configs.test.tsx.snap index f3b0d024..c9ca2c85 100644 --- a/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_configs.test.tsx.snap +++ b/public/components/query_compare/search_result/search_components/__tests__/__snapshots__/search_configs.test.tsx.snap @@ -116,9 +116,9 @@ exports[`Flyout component Renders flyout component 1`] = `
-
- - -
- - -   - - - -
+ +
-
- - + + +
- +
-
-
- +
- +
-
-
+
@@ -883,9 +895,9 @@ exports[`Flyout component Renders flyout component 1`] = `
-
- - -
- - -   - - - -
+ +
-
- - + + +
- +
-
-
- +
- +
-
-
+
@@ -1697,9 +1721,9 @@ exports[`Flyout component Renders flyout component when multi dataSource enabled
-
- - -
- - -   - - - -
+ +
-
- - + + +
- +
-
-
- +
- +
-
-
+
@@ -2460,9 +2496,9 @@ exports[`Flyout component Renders flyout component when multi dataSource enabled
-
- - -
- - -   - - - -
+ +
-
- - + + +
- +
-
-
- +
- +
-
-
+
diff --git a/public/components/query_compare/search_result/search_components/__tests__/search_config.test.tsx b/public/components/query_compare/search_result/search_components/__tests__/search_config.test.tsx index 76d47451..a5359ab2 100644 --- a/public/components/query_compare/search_result/search_components/__tests__/search_config.test.tsx +++ b/public/components/query_compare/search_result/search_components/__tests__/search_config.test.tsx @@ -44,8 +44,8 @@ describe('Flyout component', () => { wrapper.find('EuiCodeEditor').prop('onChange')?.({ target: { value: '' } }); wrapper.find('EuiSelect').prop('onChange')?.({ target: {} }); wrapper.find('EuiSelect').prop('onBlur')?.({ target: {} }); - wrapper.find('EuiComboBox').prop('onChange')?.({ target: { selectedPipelineOptions: [] } }); - wrapper.find('EuiComboBox').prop('onChange')?.({ + wrapper.find('EuiCompressedComboBox').prop('onChange')?.({ target: { selectedPipelineOptions: [] } }); + wrapper.find('EuiCompressedComboBox').prop('onChange')?.({ target: { selectedPipelineOptions: [{ label: '_none' }] }, }); }); @@ -84,8 +84,8 @@ describe('Flyout component', () => { wrapper.find('EuiCodeEditor').prop('onChange')?.({ target: { value: '' } }); wrapper.find('EuiSelect').prop('onChange')?.({ target: {} }); wrapper.find('EuiSelect').prop('onBlur')?.({ target: {} }); - wrapper.find('EuiComboBox').prop('onChange')?.({ target: { selectedPipelineOptions: [] } }); - wrapper.find('EuiComboBox').prop('onChange')?.({ + wrapper.find('EuiCompressedComboBox').prop('onChange')?.({ target: { selectedPipelineOptions: [] } }); + wrapper.find('EuiCompressedComboBox').prop('onChange')?.({ target: { selectedPipelineOptions: [{ label: '_none' }] }, }); }); diff --git a/public/components/query_compare/search_result/search_components/search_bar.tsx b/public/components/query_compare/search_result/search_components/search_bar.tsx index 60b510d5..126e04b6 100644 --- a/public/components/query_compare/search_result/search_components/search_bar.tsx +++ b/public/components/query_compare/search_result/search_components/search_bar.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { EuiButton, EuiFieldSearch, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; +import { EuiSmallButton, EuiCompressedFieldSearch, EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui'; import React from 'react'; interface SearchBarProps { @@ -22,7 +22,7 @@ export const SearchInputBar = ({ - - + Search - + diff --git a/public/components/query_compare/search_result/search_components/search_configs/search_config.tsx b/public/components/query_compare/search_result/search_components/search_configs/search_config.tsx index a3766e5b..77b6c456 100644 --- a/public/components/query_compare/search_result/search_components/search_configs/search_config.tsx +++ b/public/components/query_compare/search_result/search_components/search_configs/search_config.tsx @@ -6,11 +6,11 @@ import { EuiButtonEmpty, EuiCodeEditor, - EuiComboBox, + EuiCompressedComboBox, EuiFlexGroup, EuiFlexItem, - EuiFormRow, - EuiSelect, + EuiCompressedFormRow, + EuiCompressedSelect, EuiSpacer, EuiText, EuiTitle, @@ -53,7 +53,7 @@ interface SearchConfigProps { dataSourceManagement: DataSourceManagementPluginSetup; navigation: NavigationPublicPluginStart; setActionMenu: (menuMount: MountPoint | undefined) => void; - dataSourceOptions: DataSourceOption[] + dataSourceOptions: DataSourceOption[] } export const SearchConfig: FunctionComponent = ({ @@ -84,7 +84,7 @@ export const SearchConfig: FunctionComponent = ({ selectIndex: '', })); }; - + const documentIndex = queryNumber === 1? documentsIndexes1: documentsIndexes2 console.log(fetchedPipelines1) const pipelines = queryNumber === 1? fetchedPipelines1: fetchedPipelines2 @@ -143,7 +143,7 @@ export const SearchConfig: FunctionComponent = ({ } else{ setDataSource2(dataConnectionId) - } + } setPipeline('') } useEffect(() => { @@ -155,7 +155,7 @@ export const SearchConfig: FunctionComponent = ({ if (dataSourceEnabled) { DataSourceSelector = dataSourceManagement.ui.DataSourceSelector; - } + } return ( <> @@ -165,29 +165,29 @@ export const SearchConfig: FunctionComponent = ({ {dataSourceEnabled && ( - - + )} - {queryError.selectIndex}} isInvalid={!!queryError.selectIndex.length} > - ({ value: index, @@ -198,21 +198,21 @@ export const SearchConfig: FunctionComponent = ({ value={selectedIndex} onBlur={selectIndexOnBlur} /> - + - - + - + - {queryError.queryString}} @@ -249,7 +249,7 @@ export const SearchConfig: FunctionComponent = ({ onBlur={codeEditorOnBlur} tabSize={2} /> - + ); };