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 b3a17ffc7e9d1..81af24ffe6e4c 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 @@ -67,14 +67,19 @@ export const PipelinesList: React.FunctionComponent = ({ } }, [pipelineNameFromLocation, data]); - const editPipeline = (name: string) => { + const goToEditPipeline = (name: string) => { history.push(encodeURI(`${BASE_PATH}/edit/${encodeURIComponent(name)}`)); }; - const clonePipeline = (name: string) => { + const goToClonePipeline = (name: string) => { history.push(encodeURI(`${BASE_PATH}/create/${encodeURIComponent(name)}`)); }; + const goHome = () => { + setShowFlyout(false); + history.push(encodeURI(BASE_PATH)); + }; + let content: React.ReactNode; if (isLoading) { @@ -90,9 +95,9 @@ export const PipelinesList: React.FunctionComponent = ({ content = ( ); @@ -110,10 +115,10 @@ export const PipelinesList: React.FunctionComponent = ({ pipeline={selectedPipeline} onClose={() => { setSelectedPipeline(undefined); - setShowFlyout(false); + goHome(); }} - onEditClick={editPipeline} - onCloneClick={clonePipeline} + onEditClick={goToEditPipeline} + onCloneClick={goToClonePipeline} onDeleteClick={setPipelinesToDelete} /> ); @@ -123,7 +128,7 @@ export const PipelinesList: React.FunctionComponent = ({ return ( { - setShowFlyout(false); + goHome(); }} pipelineName={pipelineNameFromLocation} />