From cabce84dd945b60898baddd2800b136e7668097b Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Wed, 8 Apr 2020 12:28:41 +0200 Subject: [PATCH] Finish first version of flyout --- .../sections/pipelines_list/details.tsx | 85 ++++++++++++++++++- .../sections/pipelines_list/main.tsx | 2 + 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details.tsx index 8d59f77b301eb..66353d81d9314 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/details.tsx @@ -5,16 +5,60 @@ */ import React, { FunctionComponent } from 'react'; -import { i18n } from '@kbn/118n'; -import { EuiFlyout, EuiFlyoutHeader, EuiFlyoutBody, EuiTitle } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { + EuiFlyout, + EuiFlyoutHeader, + EuiFlyoutBody, + EuiTitle, + EuiDescriptionList, + EuiCodeBlock, + EuiFlyoutFooter, + EuiFlexGroup, + EuiFlexItem, + EuiButtonEmpty, +} from '@elastic/eui'; import { Pipeline } from '../../../../common/types'; export interface Props { pipeline: Pipeline; + onEditClick: () => void; + onDeleteClick: () => void; onClose: () => void; } -export const PipelineDetails: FunctionComponent = ({ pipeline, onClose }) => { +export const PipelineDetails: FunctionComponent = ({ + pipeline, + onClose, + onEditClick, + onDeleteClick, +}) => { + const descriptionListItems = [ + { + title: i18n.translate('xpack.ingestPipelines.list.pipelineDetails.descriptionTitle', { + defaultMessage: 'Description', + }), + description: pipeline.description ?? '', + }, + ]; + + if (pipeline.version) { + descriptionListItems.push({ + title: i18n.translate('xpack.ingestPipelines.list.pipelineDetails.versionTitle', { + defaultMessage: 'Version', + }), + description: String(pipeline.version), + }); + } + + descriptionListItems.push({ + title: i18n.translate('xpack.ingestPipelines.list.pipelineDetails.processorsTitle', { + defaultMessage: 'Processors', + }), + // We use this title from the description list and display the processors in a code block underneath + description: '', + }); + return ( = ({ pipeline, onClose })

{pipeline.name}

+ + + + + {JSON.stringify(pipeline.processors, null, 2)} + + + + + + + + {i18n.translate('xpack.ingestPipelines.list.pipelineDetails.closeButtonLabel', { + defaultMessage: 'Close', + })} + + + + + + {i18n.translate('xpack.ingestPipelines.list.pipelineDetails.deleteButtonLabel', { + defaultMessage: 'Edit', + })} + + + + + {i18n.translate('xpack.ingestPipelines.list.pipelineDetails.deleteButtonLabel', { + defaultMessage: 'Delete', + })} + + + + +
); }; diff --git a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx index 643e037b0e99b..823b30dde11bf 100644 --- a/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx +++ b/x-pack/plugins/ingest_pipelines/public/application/sections/pipelines_list/main.tsx @@ -123,6 +123,8 @@ export const PipelinesList: React.FunctionComponent = () => { setSelectedPipeline(undefined)} + onDeleteClick={() => {}} + onEditClick={() => {}} /> )}