Skip to content

Commit

Permalink
Fix create agent config flyout being covered by bottom bar (elastic#7…
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Jul 13, 2020
1 parent 3e9c3dc commit d6eae51
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 d6eae51

Please sign in to comment.