Skip to content

Commit

Permalink
Disable policy delete button for default policy
Browse files Browse the repository at this point in the history
  • Loading branch information
jen-huang committed Jan 8, 2020
1 parent 05d2de7 commit 75ef54d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
EuiEmptyPrompt,
} from '@elastic/eui';
import { RouteComponentProps, Redirect } from 'react-router-dom';
import { DEFAULT_POLICY_ID } from '../../../common/constants';
import { Loading, ConnectedLink, PolicyDeleteProvider } from '../../components';
import { useLibs, sendRequest } from '../../hooks';
import {
Expand Down Expand Up @@ -140,7 +141,7 @@ export const PolicyDetailsPage: React.FC<Props> = ({
<Layout>
<FormattedMessage
id="xpack.fleet.policyDetails.policyNotFoundErrorTitle"
defaultMessage="Policy ID '{id}' not found"
defaultMessage="Policy '{id}' not found"
values={{
id: policyId,
}}
Expand Down Expand Up @@ -214,6 +215,7 @@ export const PolicyDetailsPage: React.FC<Props> = ({
setRedirectToPoliciesList(true);
});
}}
disabled={policyId === DEFAULT_POLICY_ID}
>
<FormattedMessage
id="xpack.fleet.policyDetails.deletePolicyButtonLabel"
Expand Down

0 comments on commit 75ef54d

Please sign in to comment.