[Fleet] Wrap package policy editor errors in EuiErrorBoundary (#112263)
This commit is contained in:
parent
a4229399f6
commit
584f92cc06
|
@ -20,6 +20,7 @@ import {
|
|||
EuiFlexItem,
|
||||
EuiSpacer,
|
||||
EuiLink,
|
||||
EuiErrorBoundary,
|
||||
} from '@elastic/eui';
|
||||
import type { EuiStepProps } from '@elastic/eui/src/components/steps/step';
|
||||
import type { ApplicationStart } from 'kibana/public';
|
||||
|
@ -503,6 +504,7 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => {
|
|||
|
||||
return (
|
||||
<CreatePackagePolicyPageLayout {...layoutProps} data-test-subj="createPackagePolicy">
|
||||
<EuiErrorBoundary>
|
||||
{formState === 'CONFIRM' && agentPolicy && (
|
||||
<ConfirmDeployAgentPolicyModal
|
||||
agentCount={agentCount}
|
||||
|
@ -524,7 +526,10 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => {
|
|||
<CustomEuiBottomBar data-test-subj="integrationsBottomBar">
|
||||
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
|
||||
<EuiFlexItem grow={false}>
|
||||
{!isLoadingAgentPolicyStep && agentPolicy && packageInfo && formState === 'INVALID' ? (
|
||||
{!isLoadingAgentPolicyStep &&
|
||||
agentPolicy &&
|
||||
packageInfo &&
|
||||
formState === 'INVALID' ? (
|
||||
<FormattedMessage
|
||||
id="xpack.fleet.createPackagePolicy.errorOnSaveText"
|
||||
defaultMessage="Your integration policy has errors. Please fix them before saving."
|
||||
|
@ -567,6 +572,7 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => {
|
|||
</EuiFlexItem>
|
||||
</EuiFlexGroup>
|
||||
</CustomEuiBottomBar>
|
||||
</EuiErrorBoundary>
|
||||
</CreatePackagePolicyPageLayout>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -25,6 +25,7 @@ import {
|
|||
EuiFlyoutBody,
|
||||
EuiFlyoutHeader,
|
||||
EuiTitle,
|
||||
EuiErrorBoundary,
|
||||
} from '@elastic/eui';
|
||||
import styled from 'styled-components';
|
||||
|
||||
|
@ -510,6 +511,7 @@ export const EditPackagePolicyForm = memo<{
|
|||
|
||||
return (
|
||||
<CreatePackagePolicyPageLayout {...layoutProps} data-test-subj="editPackagePolicy">
|
||||
<EuiErrorBoundary>
|
||||
{isLoadingData ? (
|
||||
<Loading />
|
||||
) : loadingError || !agentPolicy || !packageInfo ? (
|
||||
|
@ -597,6 +599,7 @@ export const EditPackagePolicyForm = memo<{
|
|||
</EuiBottomBar>
|
||||
</>
|
||||
)}
|
||||
</EuiErrorBoundary>
|
||||
</CreatePackagePolicyPageLayout>
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue