Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ES|QL] Design changes for the inline editing flyout #28

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/kbn-text-based-editor/src/editor_footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,7 @@ export const EditorFooter = memo(function EditorFooter({
onClick={runQuery}
isDisabled={Boolean(disableSubmitAction)}
data-test-subj="TextBasedLangEditor-run-query-button"
minWidth={hasSmallerSpace ? false : undefined}
>
<EuiFlexGroup
gutterSize="xs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
EuiFlexItem,
EuiFlyoutBody,
EuiFlyoutFooter,
EuiFlyoutHeader,
EuiTitle,
EuiIcon,
EuiToolTip,
Expand All @@ -27,14 +28,60 @@ import type { FlyoutWrapperProps } from './types';
export const FlyoutWrapper = ({
children,
attributesChanged,
isInlineFooterVisible,
isInlineFlyoutVisible,
isScrollable,
displayFlyoutHeader,
onCancel,
navigateToLensEditor,
onApply,
}: FlyoutWrapperProps) => {
return (
<>
{isInlineFlyoutVisible && displayFlyoutHeader && (
<EuiFlyoutHeader
hasBorder
css={css`
pointer-events: auto;
`}
data-test-subj="editFlyoutHeader"
>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center" responsive={false}>
<EuiFlexItem grow={false}>
<EuiFlexGroup alignItems="center" gutterSize="xs">
<EuiFlexItem grow={false}>
<EuiTitle size="xs">
<h2 id="Edit visualization">
{i18n.translate('xpack.lens.config.editVisualizationLabel', {
defaultMessage: 'Edit visualization',
})}
</h2>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip
content={i18n.translate('xpack.lens.config.experimentalLabel', {
defaultMessage:
'Technical preview, ES|QL currently offers limited configuration options',
})}
>
<EuiIcon type="beaker" size="m" />
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
{navigateToLensEditor && (
<EuiFlexItem grow={false}>
<EuiLink onClick={navigateToLensEditor} data-test-subj="navigateToLensEditorLink">
{i18n.translate('xpack.lens.config.editLinkLabel', {
defaultMessage: 'Edit in Lens',
})}
</EuiLink>
</EuiFlexItem>
)}
</EuiFlexGroup>
</EuiFlyoutHeader>
)}

<EuiFlyoutBody
className="lnsEditFlyoutBody"
css={css`
Expand All @@ -52,61 +99,14 @@ export const FlyoutWrapper = ({
}
.euiFlyoutBody__overflowContent {
padding: 0;
block-size: 100%;
overflow: ${isScrollable ? 'visible' : 'hidden'};
}
`}
>
<EuiFlexGroup gutterSize="none" direction="column">
{displayFlyoutHeader && (
<EuiFlexItem
data-test-subj="editFlyoutHeader"
css={css`
padding: ${euiThemeVars.euiSizeL};
border-block-end: 1px solid ${euiThemeVars.euiBorderColor};
`}
>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center" responsive={false}>
<EuiFlexItem grow={false}>
<EuiFlexGroup alignItems="center" gutterSize="xs">
<EuiFlexItem grow={false}>
<EuiTitle size="xs">
<h2 id="Edit visualization">
{i18n.translate('xpack.lens.config.editVisualizationLabel', {
defaultMessage: 'Edit visualization',
})}
</h2>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip
content={i18n.translate('xpack.lens.config.experimentalLabel', {
defaultMessage:
'Technical preview, ES|QL currently offers limited configuration options',
})}
>
<EuiIcon type="beaker" size="m" />
</EuiToolTip>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
{navigateToLensEditor && (
<EuiFlexItem grow={false}>
<EuiLink
onClick={navigateToLensEditor}
data-test-subj="navigateToLensEditorLink"
>
{i18n.translate('xpack.lens.config.editLinkLabel', {
defaultMessage: 'Edit in Lens',
})}
</EuiLink>
</EuiFlexItem>
)}
</EuiFlexGroup>
</EuiFlexItem>
)}
{children}
</EuiFlexGroup>
{children}`
</EuiFlyoutBody>
{isInlineFooterVisible && (
{isInlineFlyoutVisible && (
<EuiFlyoutFooter>
<EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function LayerConfiguration({
datasourceMap,
datasourceId,
framePublicAPI,
setIsInlineFlyoutFooterVisible,
setIsInlineFlyoutVisible,
}: LayerConfigurationProps) {
const dispatch = useLensDispatch();
const { euiTheme } = useEuiTheme();
Expand Down Expand Up @@ -56,7 +56,7 @@ export function LayerConfiguration({
uiActions: startDependencies.uiActions,
hideLayerHeader: datasourceId === 'textBased',
indexPatternService,
setIsInlineFlyoutFooterVisible,
setIsInlineFlyoutVisible,
};
return (
<EuiFlexItem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ describe('LensEditConfigurationFlyout', () => {
const newProps = {
...props,
displayFlyoutHeader: true,
isInlineFlyoutVisible: true,
navigateToLensEditor: navigateToLensEditorSpy,
};
const { instance } = await prepareAndMountComponent(newProps);
Expand Down
Loading
Loading