Skip to content

Commit

Permalink
Fix create agent config flyout being covered by bottom bar (#71502) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang authored Jul 13, 2020
1 parent 4fd8ae9 commit 71f9dda
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const StepSelectConfig: React.FunctionComponent<{
setSelectedConfigId(newAgentConfig.id);
}
}}
ownFocus={true}
/>
</EuiPortal>
) : null}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* you may not use this file except in compliance with the Elastic License.
*/
import React, { useState } from 'react';
import styled from 'styled-components';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import {
Expand All @@ -17,16 +18,24 @@ import {
EuiButtonEmpty,
EuiButton,
EuiText,
EuiFlyoutProps,
} from '@elastic/eui';
import { NewAgentConfig, AgentConfig } from '../../../../types';
import { useCapabilities, useCore, sendCreateAgentConfig } from '../../../../hooks';
import { AgentConfigForm, agentConfigFormValidation } from '../../components';

interface Props {
const FlyoutWithHigherZIndex = styled(EuiFlyout)`
z-index: ${(props) => props.theme.eui.euiZLevel5};
`;

interface Props extends EuiFlyoutProps {
onClose: (createdAgentConfig?: AgentConfig) => void;
}

export const CreateAgentConfigFlyout: React.FunctionComponent<Props> = ({ onClose }) => {
export const CreateAgentConfigFlyout: React.FunctionComponent<Props> = ({
onClose,
...restOfProps
}) => {
const { notifications } = useCore();
const hasWriteCapabilites = useCapabilities().write;
const [agentConfig, setAgentConfig] = useState<NewAgentConfig>({
Expand Down Expand Up @@ -147,10 +156,10 @@ export const CreateAgentConfigFlyout: React.FunctionComponent<Props> = ({ onClos
);

return (
<EuiFlyout onClose={onClose} size="l" maxWidth={400}>
<FlyoutWithHigherZIndex onClose={onClose} size="l" maxWidth={400} {...restOfProps}>
{header}
{body}
{footer}
</EuiFlyout>
</FlyoutWithHigherZIndex>
);
};

0 comments on commit 71f9dda

Please sign in to comment.