diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx index 9fe75a6427d..d7d08734e87 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddDataQualityTest/TestSuiteIngestion.tsx @@ -12,7 +12,6 @@ */ import { Col, Row, Typography } from 'antd'; import { AxiosError } from 'axios'; -import { compare } from 'fast-json-patch'; import { camelCase, isEmpty } from 'lodash'; import React, { useEffect, useMemo, useState } from 'react'; import { useHistory, useParams } from 'react-router-dom'; @@ -20,7 +19,7 @@ import { addIngestionPipeline, checkAirflowStatus, deployIngestionPipelineById, - patchIngestionPipeline, + updateIngestionPipeline as putIngestionPipeline, } from '../../axiosAPIs/ingestionPipelineAPI'; import { DEPLOYED_PROGRESS_VAL, @@ -137,32 +136,45 @@ const TestSuiteIngestion: React.FC = ({ }; const updateIngestionPipeline = async (repeatFrequency: string) => { - const updatedPipeline = { - ...ingestionPipeline, + const { + airflowConfig, + description, + displayName, + loggerLevel, + name, + owner, + pipelineType, + service, + sourceConfig, + } = ingestionPipeline as IngestionPipeline; + + const updatedPipelineData = { airflowConfig: { - ...ingestionPipeline?.airflowConfig, + ...airflowConfig, scheduleInterval: isEmpty(repeatFrequency) ? undefined : repeatFrequency, }, + description, + displayName, + loggerLevel, + name, + owner, + pipelineType, + service, + sourceConfig, }; - const jsonPatch = compare( - ingestionPipeline as IngestionPipeline, - updatedPipeline - ); - if (jsonPatch.length) { - try { - const response = await patchIngestionPipeline( - ingestionPipeline?.id || '', - jsonPatch - ); - handleIngestionDeploy(response.id); - } catch (error) { - showErrorToast( - error as AxiosError, - jsonData['api-error-messages']['update-ingestion-error'] - ); - } + + try { + const response = await putIngestionPipeline( + updatedPipelineData as CreateIngestionPipeline + ); + handleIngestionDeploy(response.id); + } catch (error) { + showErrorToast( + error as AxiosError, + jsonData['api-error-messages']['update-ingestion-error'] + ); } }; diff --git a/openmetadata-ui/src/main/resources/ui/src/components/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx index 0a53afacb1d..f616ce4cf42 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/TestSuitePipelineTab/TestSuitePipelineTab.component.tsx @@ -203,13 +203,16 @@ const TestSuitePipelineTab = () => { } }; - const handleDeployIngestion = async (id: string) => { + const handleDeployIngestion = async (id: string, reDeployed: boolean) => { setCurrDeployId({ id, state: 'waiting' }); try { await deployIngestionPipelineById(id); setCurrDeployId({ id, state: 'success' }); setTimeout(() => setCurrDeployId({ id: '', state: '' }), 1500); + showSuccessToast( + `Pipeline ${reDeployed ? 'Re Deployed' : 'Deployed'} successfully` + ); } catch (error) { setCurrDeployId({ id: '', state: '' }); showErrorToast( @@ -222,25 +225,48 @@ const TestSuitePipelineTab = () => { const getTriggerDeployButton = (ingestion: IngestionPipeline) => { if (ingestion.deployed) { return ( - - - + 'Run' + )} + + + {separator} + + + + ); } else { return ( @@ -249,7 +275,9 @@ const TestSuitePipelineTab = () => { data-testid="deploy" disabled={!editPermission} type="link" - onClick={() => handleDeployIngestion(ingestion.id as string)}> + onClick={() => + handleDeployIngestion(ingestion.id as string, false) + }> {currDeployId.id === ingestion.id ? ( currDeployId.state === 'success' ? ( @@ -507,7 +535,14 @@ const TestSuitePipelineTab = () => { ]; return column; - }, [airFlowEndPoint, isKillModalOpen, isLogsModalOpen, selectedPipeline]); + }, [ + airFlowEndPoint, + isKillModalOpen, + isLogsModalOpen, + selectedPipeline, + currDeployId, + currTriggerId, + ]); if (isLoading) { return ;