diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Ingestion/Ingestion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Ingestion/Ingestion.component.tsx index a2f365dbb5a..5c136b5b150 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Ingestion/Ingestion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Ingestion/Ingestion.component.tsx @@ -52,6 +52,7 @@ const Ingestion: React.FC = ({ isRequiredDetailsAvailable, deleteIngestion, triggerIngestion, + deployIngestion, paging, pagingHandler, currrentPage, @@ -61,6 +62,7 @@ const Ingestion: React.FC = ({ const { isAuthDisabled } = useAuthContext(); const [searchText, setSearchText] = useState(''); const [currTriggerId, setCurrTriggerId] = useState({ id: '', state: '' }); + const [currDeployId, setCurrDeployId] = useState({ id: '', state: '' }); const [isConfirmationModalOpen, setIsConfirmationModalOpen] = useState(false); const [deleteSelection, setDeleteSelection] = useState({ id: '', @@ -105,6 +107,16 @@ const Ingestion: React.FC = ({ .catch(() => setCurrTriggerId({ id: '', state: '' })); }; + const handleDeployIngestion = (id: string, ingestion: IngestionPipeline) => { + setCurrDeployId({ id, state: 'waiting' }); + deployIngestion(ingestion) + .then(() => { + setCurrDeployId({ id, state: 'success' }); + setTimeout(() => setCurrDeployId({ id: '', state: '' }), 1500); + }) + .catch(() => setCurrDeployId({ id: '', state: '' })); + }; + const handleCancelConfirmationModal = () => { setIsConfirmationModalOpen(false); setDeleteSelection({ @@ -257,6 +269,48 @@ const Ingestion: React.FC = ({ }); }; + const getTriggerDeployButton = (ingestion: IngestionPipeline) => { + if (ingestion.deployed) { + return ( + + ); + } else { + return ( + + ); + } + }; + const getIngestionTab = () => { return (
= ({ Type Schedule Recent Runs - Airflow DAG Actions @@ -308,7 +361,30 @@ const Ingestion: React.FC = ({ !isEven(index + 1) ? 'odd-row' : null )} key={index}> - {ingestion.name} + + {airflowEndpoint ? ( + + + {ingestion.name} + + + + ) : ( + ingestion.name + )} + {ingestion.pipelineType} {ingestion.airflowConfig?.scheduleInterval ? ( @@ -338,54 +414,12 @@ const Ingestion: React.FC = ({
{getStatuses(ingestion)}
- - {airflowEndpoint ? ( - - - View - - - - ) : ( - No endpoint - )} -
- + {getTriggerDeployButton(ingestion)}