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

[Ingest Manager] Fix create agent config flyout being covered by bottom bar #71502

Merged
merged 1 commit into from
Jul 13, 2020
Merged
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
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>
);
};