Skip to content

Commit

Permalink
Missed one in e12a8ad
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Mar 12, 2020
1 parent e12a8ad commit 352e5f6
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ import {
EuiText,
} from '@elastic/eui';
import { NewAgentConfig } from '../../../../types';
import { useCore, sendCreateAgentConfig } from '../../../../hooks';
import { useCapabilities, useCore, sendCreateAgentConfig } from '../../../../hooks';
import { AgentConfigForm, agentConfigFormValidation } from '../../components';

interface Props {
onClose: () => void;
}

export const CreateAgentConfigFlyout: React.FunctionComponent<Props> = ({ onClose }) => {
const { application, notifications } = useCore();

const { notifications } = useCore();
const hasWriteCapabilites = useCapabilities().write;
const [agentConfig, setAgentConfig] = useState<NewAgentConfig>({
name: '',
description: '',
Expand Down Expand Up @@ -93,11 +93,7 @@ export const CreateAgentConfigFlyout: React.FunctionComponent<Props> = ({ onClos
<EuiButton
fill
isLoading={isLoading}
isDisabled={
!application.capabilities.ingestManager.write ||
isLoading ||
Object.keys(validation).length > 0
}
isDisabled={!hasWriteCapabilites || isLoading || Object.keys(validation).length > 0}
onClick={async () => {
setIsLoading(true);
try {
Expand Down

0 comments on commit 352e5f6

Please sign in to comment.