Skip to content

Commit

Permalink
Add on failure JSON to flyout if it is available
Browse files Browse the repository at this point in the history
  • Loading branch information
jloleysens committed Apr 9, 2020
1 parent 9ec9e1c commit f710083
Showing 1 changed file with 27 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ import {
EuiFlyoutBody,
EuiTitle,
EuiDescriptionList,
EuiText,
EuiSpacer,
EuiCodeBlock,
EuiFlyoutFooter,
EuiFlexGroup,
EuiFlexItem,
EuiButtonEmpty,
} from '@elastic/eui';
import { Pipeline } from '../../../../common/types';

import { PipelineDetailsJsonBlock } from './details_json_block';

export interface Props {
pipeline: Pipeline;
onEditClick: () => void;
Expand Down Expand Up @@ -71,23 +71,31 @@ export const PipelineDetails: FunctionComponent<Props> = ({

<EuiSpacer size="m" />

<EuiText size="s">
<label htmlFor="piplineDetailsProcessorsJson">
<b>
{i18n.translate('xpack.ingestPipelines.list.pipelineDetails.processorsTitle', {
defaultMessage: 'Processors JSON',
})}
</b>
</label>
</EuiText>
<EuiCodeBlock
id="piplineDetailsProcessorsJson"
language="json"
overflowHeight={500}
isCopyable
>
{JSON.stringify(pipeline.processors, null, 2)}
</EuiCodeBlock>
<PipelineDetailsJsonBlock
htmlForId="pipelineDetailsProcessorsJson"
label={i18n.translate('xpack.ingestPipelines.list.pipelineDetails.processorsTitle', {
defaultMessage: 'Processors JSON',
})}
json={pipeline.processors}
/>

{/* On Failure Processor JSON */}
{pipeline.onFailure?.length && (
<>
<EuiSpacer size="m" />
<PipelineDetailsJsonBlock
htmlForId="pipelineDetailsOnFailureProcessorsJson"
label={i18n.translate(
'xpack.ingestPipelines.list.pipelineDetails.failureProcessorsTitle',
{
defaultMessage: 'On failure processors JSON',
}
)}
json={pipeline.onFailure}
/>
</>
)}
{/* End On Failure Processor JSON */}
</EuiFlyoutBody>

<EuiFlyoutFooter>
Expand Down

0 comments on commit f710083

Please sign in to comment.