Skip to content

Commit

Permalink
[ML] Add border to text editor for ES|QL data visualizer (#192726)
Browse files Browse the repository at this point in the history
## Summary

This PR adds border to text editor for ES|QL data visualizer so make it
more clear where the boundaries for the editor is.

<img width="1505" alt="image"
src="https://github.com/user-attachments/assets/264f4892-f361-4013-b49f-55fa5b90aa8f">

Also fixes the content of the top values overflowing.


https://github.com/user-attachments/assets/19c90cb3-2d35-41df-aea4-889a00e6ebdb


Fixes #192788
Fixes #192637

---------

Co-authored-by: Elastic Machine <[email protected]>
  • Loading branch information
qn895 and elasticmachine authored Sep 20, 2024
1 parent 0b1bf27 commit 486b16e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {
EuiText,
EuiButtonIcon,
EuiSpacer,
useEuiTheme,
euiScrollBarStyles,
} from '@elastic/eui';

import { FormattedMessage } from '@kbn/i18n-react';
Expand Down Expand Up @@ -69,6 +71,7 @@ export const TopValues: FC<Props> = ({
data: { fieldFormats },
},
} = useDataVisualizerKibana();
const euiTheme = useEuiTheme();

if (stats === undefined || !stats.topValues) return null;
const { fieldName, sampleCount, approximate } = stats;
Expand Down Expand Up @@ -169,6 +172,10 @@ export const TopValues: FC<Props> = ({
<ExpandedRowPanel
dataTestSubj={'dataVisualizerFieldDataTopValues'}
className={classNames('dvPanel__wrapper', compressed ? 'dvPanel--compressed' : undefined)}
css={css`
overflow-x: auto;
${euiScrollBarStyles(euiTheme)}
`}
>
<ExpandedRowFieldHeader>
{showSampledValues ? (
Expand Down Expand Up @@ -215,6 +222,7 @@ export const TopValues: FC<Props> = ({
onAddFilter !== undefined ? (
<div
css={css`
position: static;
width: 48px;
`}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,25 @@ export const IndexDataVisualizerESQL: FC<IndexDataVisualizerESQLProps> = (dataVi
</EuiFlexGroup>
</EuiPageTemplate.Header>
<EuiSpacer size="m" />
<TextBasedLangEditor
query={localQuery}
onTextLangQueryChange={onTextLangQueryChange}
onTextLangQuerySubmit={onTextLangQuerySubmit}
detectedTimestamp={currentDataView?.timeFieldName}
hideRunQueryText={false}
isLoading={queryHistoryStatus ?? false}
displayDocumentationAsFlyout
/>
<EuiFlexItem
grow={false}
data-test-subj="DataVisualizerESQLEditor"
css={css({
borderTop: euiTheme.euiBorderThin,
borderLeft: euiTheme.euiBorderThin,
borderRight: euiTheme.euiBorderThin,
})}
>
<TextBasedLangEditor
query={localQuery}
onTextLangQueryChange={onTextLangQueryChange}
onTextLangQuerySubmit={onTextLangQuerySubmit}
detectedTimestamp={currentDataView?.timeFieldName}
hideRunQueryText={false}
isLoading={queryHistoryStatus ?? false}
displayDocumentationAsFlyout
/>
</EuiFlexItem>

<EuiFlexGroup gutterSize="m" direction={isWithinLargeBreakpoint ? 'column' : 'row'}>
<EuiFlexItem>
Expand Down

0 comments on commit 486b16e

Please sign in to comment.