diff --git a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx index 2826de13546..e162945e5fb 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/AddIngestion/AddIngestion.component.tsx @@ -11,7 +11,7 @@ * limitations under the License. */ -import { isUndefined } from 'lodash'; +import { isEmpty, isUndefined } from 'lodash'; import React, { useState } from 'react'; import { INGESTION_SCHEDULER_INITIAL_VALUE, @@ -214,19 +214,23 @@ const AddIngestion = ({ const getFilterPatternData = (data: FilterPattern) => { const { includes, excludes } = data; - return isUndefined(includes) && isUndefined(excludes) - ? undefined - : { - includes: includes && includes.length > 0 ? includes : undefined, - excludes: excludes && excludes.length > 0 ? excludes : undefined, - }; + const filterPattern = + (!isUndefined(includes) && includes.length) || + (!isUndefined(excludes) && excludes.length) + ? { + includes: includes && includes.length > 0 ? includes : undefined, + excludes: excludes && excludes.length > 0 ? excludes : undefined, + } + : undefined; + + return filterPattern; }; const createNewIngestion = () => { const ingestionDetails: CreateIngestionPipeline = { airflowConfig: { startDate: startDate as unknown as Date, - endDate: endDate as unknown as Date, + endDate: isEmpty(endDate) ? undefined : (endDate as unknown as Date), scheduleInterval: repeatFrequency, forceDeploy: true, }, diff --git a/openmetadata-ui/src/main/resources/ui/src/jsons/en.ts b/openmetadata-ui/src/main/resources/ui/src/jsons/en.ts index c74c1d6df59..c3dde87eb10 100644 --- a/openmetadata-ui/src/main/resources/ui/src/jsons/en.ts +++ b/openmetadata-ui/src/main/resources/ui/src/jsons/en.ts @@ -55,6 +55,8 @@ const jsonData = { 'triggering-ingestion-error': 'Error while triggering ingestion workflow', + 'deploy-ingestion-error': 'Error while deploying ingestion workflow!', + 'fetch-auth-config-error': 'Error occurred while fetching auth configs!', 'fetch-chart-error': 'Error while fetching charts!', 'fetch-dashboard-details-error': 'Error while fetching dashboard details!', @@ -142,6 +144,7 @@ const jsonData = { }, message: { 'no-services': 'No services', + 'fail-to-deploy-pipeline': 'Failed to deploy Ingestion Pipeline', }, }; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx index fea97ea4970..f7ab9e0fa77 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/AddServicePage/AddServicePage.component.tsx @@ -22,6 +22,7 @@ import { ServiceCategory } from '../../enums/service.enum'; import { CreateIngestionPipeline } from '../../generated/api/services/ingestionPipelines/createIngestionPipeline'; import { DataObj } from '../../interface/service.interface'; import jsonData from '../../jsons/en'; +import { getErrorText } from '../../utils/StringsUtils'; import { showErrorToast } from '../../utils/ToastUtils'; const AddServicePage = () => { @@ -66,11 +67,25 @@ const AddServicePage = () => { } }) .catch((err: AxiosError) => { - showErrorToast( + const errMessage = getErrorText( err, jsonData['api-error-messages']['create-ingestion-error'] ); - reject(); + if ( + errMessage.includes(jsonData['message']['fail-to-deploy-pipeline']) + ) { + showErrorToast( + errMessage, + jsonData['api-error-messages']['deploy-ingestion-error'] + ); + resolve(); + } else { + showErrorToast( + err, + jsonData['api-error-messages']['create-ingestion-error'] + ); + reject(); + } }); }); }; diff --git a/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx b/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx index 0cea3d810dd..939885406da 100644 --- a/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/pages/service/index.tsx @@ -420,10 +420,18 @@ const ServicePage: FunctionComponent = () => { ); if (message.includes('Connection refused')) { setConnectionAvailable(false); + } else if ( + message.includes(jsonData['message']['fail-to-deploy-pipeline']) + ) { + showErrorToast( + message, + jsonData['api-error-messages']['deploy-ingestion-error'] + ); + resolve(); } else { showErrorToast(message); + reject(); } - reject(); }); }); };