#13767: Remove ingestion pipeline action buttons and ingestion button if pipelineService is disabled (#14847)

* Remove ingestion pipeline action buttons and ingestion button if pipelineService is disabled

* pending localization keys

* changes as per comments
This commit is contained in:
Ashish Gupta 2024-01-25 11:12:03 +05:30 committed by GitHub
parent e30ffd71ce
commit f311d8d6b7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
18 changed files with 280 additions and 41 deletions

View File

@ -18,7 +18,9 @@ import { isEmpty, isUndefined, lowerCase } from 'lodash';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import ErrorPlaceHolderIngestion from '../../components/common/ErrorWithPlaceholder/ErrorPlaceHolderIngestion';
import { DISABLED } from '../../constants/constants';
import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
import { useAirflowStatus } from '../../hooks/useAirflowStatus';
import { showErrorToast } from '../../utils/ToastUtils';
import Searchbar from '../common/SearchBarComponent/SearchBar.component';
import EntityDeleteModal from '../Modals/EntityDeleteModal/EntityDeleteModal';
@ -27,6 +29,7 @@ import {
IngestionServicePermission,
ResourceEntity,
} from '../PermissionProvider/PermissionProvider.interface';
import ButtonSkeleton from '../Skeleton/CommonSkeletons/ControlElements/ControlElements.component';
import AddIngestionButton from './AddIngestionButton.component';
import { IngestionProps, SelectedRowDetails } from './ingestion.interface';
import IngestionListTable from './IngestionListTable.component';
@ -55,6 +58,7 @@ const Ingestion: React.FC<IngestionProps> = ({
}: IngestionProps) => {
const { t } = useTranslation();
const { getEntityPermissionByFqn } = usePermissionProvider();
const { isFetchingStatus, platform } = useAirflowStatus();
const [searchText, setSearchText] = useState('');
const [isConfirmationModalOpen, setIsConfirmationModalOpen] = useState(false);
const [deleteSelection, setDeleteSelection] = useState<SelectedRowDetails>({
@ -144,10 +148,48 @@ const Ingestion: React.FC<IngestionProps> = ({
() =>
isRequiredDetailsAvailable &&
permissions.EditAll &&
displayAddIngestionButton &&
platform !== DISABLED,
[
isRequiredDetailsAvailable,
permissions,
displayAddIngestionButton,
[isRequiredDetailsAvailable, permissions, displayAddIngestionButton]
platform,
]
);
const renderAddIngestionButton = useMemo(() => {
if (isFetchingStatus) {
return <ButtonSkeleton size="default" />;
}
if (showAddIngestionButton) {
return (
<AddIngestionButton
ingestionData={ingestionData}
ingestionList={ingestionList}
permissions={permissions}
pipelineType={pipelineType}
serviceCategory={serviceCategory}
serviceDetails={serviceDetails}
serviceName={serviceName}
/>
);
}
return null;
}, [
isFetchingStatus,
showAddIngestionButton,
ingestionData,
ingestionList,
permissions,
pipelineType,
serviceCategory,
serviceDetails,
serviceName,
]);
useEffect(() => {
getSearchedIngestions();
}, [searchText, ingestionList]);
@ -184,19 +226,7 @@ const Ingestion: React.FC<IngestionProps> = ({
/>
) : null}
</div>
<div className="relative">
{showAddIngestionButton && (
<AddIngestionButton
ingestionData={ingestionData}
ingestionList={ingestionList}
permissions={permissions}
pipelineType={pipelineType}
serviceCategory={serviceCategory}
serviceDetails={serviceDetails}
serviceName={serviceName}
/>
)}
</div>
<div className="relative">{renderAddIngestionButton}</div>
</Col>
<Col span={24}>
<IngestionListTable

View File

@ -16,6 +16,7 @@ import {
findByTestId,
findByText,
fireEvent,
getAllByText,
queryByTestId,
render,
} from '@testing-library/react';
@ -23,6 +24,7 @@ import React from 'react';
import { MemoryRouter } from 'react-router';
import { ServiceCategory } from '../../enums/service.enum';
import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
import { useAirflowStatus } from '../../hooks/useAirflowStatus';
import { OperationPermission } from '../PermissionProvider/PermissionProvider.interface';
import Ingestion from './Ingestion.component';
import { mockIngestionWorkFlow, mockService } from './Ingestion.mock';
@ -88,6 +90,11 @@ jest.mock('./IngestionRecentRun/IngestionRecentRuns.component', () => ({
.mockImplementation(() => <p>IngestionRecentRuns</p>),
}));
jest.mock(
'../Skeleton/CommonSkeletons/ControlElements/ControlElements.component',
() => jest.fn().mockImplementation(() => <div>ButtonSkeleton</div>)
);
jest.mock('../../components/PermissionProvider/PermissionProvider', () => ({
usePermissionProvider: jest.fn().mockReturnValue({
getEntityPermissionByFqn: jest.fn().mockReturnValue({
@ -102,6 +109,15 @@ jest.mock('../../components/PermissionProvider/PermissionProvider', () => ({
}),
}));
jest.mock('../../hooks/useAirflowStatus', () => ({
useAirflowStatus: jest.fn(() => {
return {
isFetchingStatus: false,
platform: 'airflow',
};
}),
}));
describe('Test Ingestion page', () => {
it('Page Should render', async () => {
const { container } = render(
@ -414,4 +430,82 @@ describe('Test Ingestion page', () => {
await findByText(container, /KillIngestionModal/i)
).toBeInTheDocument();
});
it('should render button skeleton if airflow status is loading', async () => {
(useAirflowStatus as jest.Mock).mockImplementation(() => ({
isFetchingStatus: true,
platform: 'airflow',
}));
const { container } = render(
<Ingestion
isRequiredDetailsAvailable
airflowEndpoint=""
deleteIngestion={mockDeleteIngestion}
deployIngestion={mockDeployIngestion}
handleEnableDisableIngestion={handleEnableDisableIngestion}
ingestionList={
mockIngestionWorkFlow.data.data as unknown as IngestionPipeline[]
}
paging={mockPaging}
permissions={mockPermissions}
serviceCategory={ServiceCategory.DASHBOARD_SERVICES}
serviceDetails={mockService}
serviceName=""
triggerIngestion={mockTriggerIngestion}
onIngestionWorkflowsUpdate={mockUpdateWorkflows}
/>,
{
wrapper: MemoryRouter,
}
);
const addIngestionButton = queryByTestId(
container,
'add-new-ingestion-button'
);
const loadingButton = getAllByText(container, 'ButtonSkeleton');
expect(loadingButton).toHaveLength(2);
expect(addIngestionButton).not.toBeInTheDocument();
});
it('should not render add ingestion button if platform is disabled', async () => {
(useAirflowStatus as jest.Mock).mockImplementation(() => ({
isFetchingStatus: false,
platform: 'disabled',
}));
const { container } = render(
<Ingestion
isRequiredDetailsAvailable
airflowEndpoint=""
deleteIngestion={mockDeleteIngestion}
deployIngestion={mockDeployIngestion}
handleEnableDisableIngestion={handleEnableDisableIngestion}
ingestionList={
mockIngestionWorkFlow.data.data as unknown as IngestionPipeline[]
}
paging={mockPaging}
permissions={mockPermissions}
serviceCategory={ServiceCategory.DASHBOARD_SERVICES}
serviceDetails={mockService}
serviceName=""
triggerIngestion={mockTriggerIngestion}
onIngestionWorkflowsUpdate={mockUpdateWorkflows}
/>,
{
wrapper: MemoryRouter,
}
);
const addIngestionButton = queryByTestId(
container,
'add-new-ingestion-button'
);
expect(addIngestionButton).not.toBeInTheDocument();
});
});

View File

@ -17,12 +17,15 @@ import cronstrue from 'cronstrue';
import React, { useCallback, useEffect, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import Table from '../../components/common/Table/Table';
import { DISABLED, NO_DATA_PLACEHOLDER } from '../../constants/constants';
import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
import { usePaging } from '../../hooks/paging/usePaging';
import { useAirflowStatus } from '../../hooks/useAirflowStatus';
import { getEntityName } from '../../utils/EntityUtils';
import { getErrorPlaceHolder } from '../../utils/IngestionUtils';
import NextPrevious from '../common/NextPrevious/NextPrevious';
import { PagingHandlerParams } from '../common/NextPrevious/NextPrevious.interface';
import ButtonSkeleton from '../Skeleton/CommonSkeletons/ControlElements/ControlElements.component';
import { IngestionListTableProps } from './IngestionListTable.interface';
import { IngestionRecentRuns } from './IngestionRecentRun/IngestionRecentRuns.component';
import PipelineActions from './PipelineActions.component';
@ -47,6 +50,7 @@ function IngestionListTable({
isLoading = false,
}: IngestionListTableProps) {
const { t } = useTranslation();
const { isFetchingStatus, platform } = useAirflowStatus();
const {
currentPage,
@ -61,6 +65,8 @@ function IngestionListTable({
handlePagingChange(paging);
}, [paging]);
const isPlatFormDisabled = useMemo(() => platform === DISABLED, [platform]);
const ingestionPagingHandler = useCallback(
({ cursorType, currentPage }: PagingHandlerParams) => {
if (cursorType) {
@ -99,6 +105,14 @@ function IngestionListTable({
};
const renderActionsField = (_: string, record: IngestionPipeline) => {
if (isFetchingStatus) {
return <ButtonSkeleton size="default" />;
}
if (isPlatFormDisabled) {
return NO_DATA_PLACEHOLDER;
}
return (
<PipelineActions
deleteSelection={deleteSelection}
@ -168,6 +182,8 @@ function IngestionListTable({
handleIsConfirmationModalOpen,
onIngestionWorkflowsUpdate,
ingestionData,
isFetchingStatus,
isPlatFormDisabled,
]
);
@ -187,6 +203,7 @@ function IngestionListTable({
emptyText: getErrorPlaceHolder(
isRequiredDetailsAvailable,
ingestionData.length,
isPlatFormDisabled,
pipelineType
),
}}

View File

@ -13,6 +13,8 @@
import { render, screen } from '@testing-library/react';
import React from 'react';
import { NO_DATA_PLACEHOLDER } from '../../constants/constants';
import { useAirflowStatus } from '../../hooks/useAirflowStatus';
import { mockIngestionListTableProps } from '../../mocks/IngestionListTable.mock';
import IngestionListTable from './IngestionListTable.component';
@ -22,6 +24,12 @@ jest.mock('../../components/common/NextPrevious/NextPrevious', () =>
jest.mock('../../components/Loader/Loader', () =>
jest.fn().mockImplementation(() => <div>loader</div>)
);
jest.mock(
'../Skeleton/CommonSkeletons/ControlElements/ControlElements.component',
() => jest.fn().mockImplementation(() => <div>ButtonSkeleton</div>)
);
jest.mock('./PipelineActions.component', () =>
jest.fn().mockImplementation(() => <div>pipelineActions</div>)
);
@ -31,6 +39,15 @@ jest.mock('./IngestionRecentRun/IngestionRecentRuns.component', () => ({
.mockImplementation(() => <div>ingestionRecentRuns</div>),
}));
jest.mock('../../hooks/useAirflowStatus', () => ({
useAirflowStatus: jest.fn(() => {
return {
isFetchingStatus: false,
platform: 'airflow',
};
}),
}));
describe('IngestionListTable tests', () => {
it('Should display the loader if the isLoading is true', async () => {
render(<IngestionListTable {...mockIngestionListTableProps} isLoading />);
@ -107,4 +124,38 @@ describe('IngestionListTable tests', () => {
expect(ingestionDagName).toBeInTheDocument();
});
it('Should render pipeline action component if airflow platform is not disabled', () => {
render(<IngestionListTable {...mockIngestionListTableProps} />);
const actionButtons = screen.getByText('pipelineActions');
expect(actionButtons).toBeInTheDocument();
});
it('Should render noDataPlaceholder in ingestion table is airflow platform is disabled', () => {
(useAirflowStatus as jest.Mock).mockImplementation(() => ({
isFetchingStatus: false,
platform: 'disabled',
}));
render(<IngestionListTable {...mockIngestionListTableProps} />);
const noData = screen.getByText(NO_DATA_PLACEHOLDER);
expect(noData).toBeInTheDocument();
});
it('Should render loader in ingestion table is airflow status is fetching', () => {
(useAirflowStatus as jest.Mock).mockImplementation(() => ({
isFetchingStatus: true,
platform: 'disabled',
}));
render(<IngestionListTable {...mockIngestionListTableProps} />);
const loader = screen.getByText('ButtonSkeleton');
expect(loader).toBeInTheDocument();
});
});

View File

@ -23,7 +23,11 @@ import { OwnerLabel } from '../../components/common/OwnerLabel/OwnerLabel.compon
import RichTextEditorPreviewer from '../../components/common/RichTextEditor/RichTextEditorPreviewer';
import { ListView } from '../../components/ListView/ListView.component';
import { ColumnFilter } from '../../components/Table/ColumnFilter/ColumnFilter.component';
import { getServiceDetailsPath, pagingObject } from '../../constants/constants';
import {
DISABLED,
getServiceDetailsPath,
pagingObject,
} from '../../constants/constants';
import { CONNECTORS_DOCS } from '../../constants/docs.constants';
import { NO_PERMISSION_FOR_ACTION } from '../../constants/HelperTextUtil';
import { PAGE_HEADERS } from '../../constants/PageHeaders.constant';
@ -38,6 +42,7 @@ import { Operation } from '../../generated/entity/policies/policy';
import { EntityReference } from '../../generated/entity/type';
import { Include } from '../../generated/type/include';
import { usePaging } from '../../hooks/paging/usePaging';
import { useAirflowStatus } from '../../hooks/useAirflowStatus';
import { DatabaseServiceSearchSource } from '../../interface/search.interface';
import { ServicesType } from '../../interface/service.interface';
import { getServices, searchService } from '../../rest/serviceAPI';
@ -57,6 +62,7 @@ import NextPrevious from '../common/NextPrevious/NextPrevious';
import { PagingHandlerParams } from '../common/NextPrevious/NextPrevious.interface';
import PageHeader from '../PageHeader/PageHeader.component';
import { usePermissionProvider } from '../PermissionProvider/PermissionProvider';
import ButtonSkeleton from '../Skeleton/CommonSkeletons/ControlElements/ControlElements.component';
interface ServicesProps {
serviceName: ServiceCategory;
@ -64,6 +70,8 @@ interface ServicesProps {
const Services = ({ serviceName }: ServicesProps) => {
const { t } = useTranslation();
const { isFetchingStatus, platform } = useAirflowStatus();
const history = useHistory();
const handleAddServiceClick = () => {
history.push(getAddServicePath(serviceName));
@ -86,6 +94,8 @@ const Services = ({ serviceName }: ServicesProps) => {
const [deleted, setDeleted] = useState<boolean>(false);
const { permissions } = usePermissionProvider();
const isPlatFormDisabled = useMemo(() => platform === DISABLED, [platform]);
const searchIndex = useMemo(() => {
setSearchTerm('');
setServiceTypeFilter([]);
@ -430,28 +440,32 @@ const Services = ({ serviceName }: ServicesProps) => {
<Col span={24}>
<Space className="w-full justify-between m-b-lg" data-testid="header">
<PageHeader data={getServicePageHeader()} />
<Tooltip
placement="left"
title={
addServicePermission
? t('label.add-entity', {
{isFetchingStatus ? (
<ButtonSkeleton size="default" />
) : (
<Tooltip
placement="left"
title={
addServicePermission
? t('label.add-entity', {
entity: t('label.service'),
})
: NO_PERMISSION_FOR_ACTION
}>
{addServicePermission && !isPlatFormDisabled && (
<Button
className="m-b-xs"
data-testid="add-service-button"
size="middle"
type="primary"
onClick={handleAddServiceClick}>
{t('label.add-new-entity', {
entity: t('label.service'),
})
: NO_PERMISSION_FOR_ACTION
}>
{addServicePermission && (
<Button
className="m-b-xs"
data-testid="add-service-button"
size="middle"
type="primary"
onClick={handleAddServiceClick}>
{t('label.add-new-entity', {
entity: t('label.service'),
})}
</Button>
)}
</Tooltip>
})}
</Button>
)}
</Tooltip>
)}
</Space>
</Col>
<Col span={24}>

View File

@ -75,6 +75,7 @@ export const refreshTokenKey = 'refreshToken';
export const REDIRECT_PATHNAME = 'redirectUrlPath';
export const TERM_ADMIN = 'Admin';
export const TERM_USER = 'User';
export const DISABLED = 'disabled';
export const imageTypes = {
image: 's96-c',
image192: 's192-c',

View File

@ -27,6 +27,9 @@ export const CONNECTORS_DOCS = 'https://docs.open-metadata.org/connectors';
export const WORKFLOWS_METADATA_DOCS =
'https://docs.open-metadata.org/connectors/ingestion/workflows/metadata';
export const INGESTION_FRAMEWORK_DEPLOYMENT_DOCS =
'https://docs.open-metadata.org/deployment/ingestion';
export const BOTS_DOCS =
'https://docs.open-metadata.org/main-concepts/metadata-standard/schemas/entity/bot';

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "Das dauerhafte Löschen dieses {{entityName}} entfernt seine Metadaten sowie die Metadaten von {{dependents}} dauerhaft aus OpenMetadata.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "Beschreibung der Pipeline.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "Der Ingestion Scheduler kann nicht antworten. Bitte wende dich an den Collate-Support. Vielen Dank.",
"pipeline-trigger-failed-message": "Auslösen der Pipeline fehlgeschlagen!",
"pipeline-trigger-success-message": "Pipeline erfolgreich ausgelöst!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "Permanently deleting this {{entityName}} will remove its metadata, as well as the metadata of {{dependents}} from OpenMetadata permanently.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "Description of the pipeline.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "The Ingestion Scheduler is unable to respond. Please reach out to Collate support. Thank you.",
"pipeline-trigger-failed-message": "Failed to trigger the pipeline!",
"pipeline-trigger-success-message": "Pipeline triggered successfully!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "Al eliminar permanentemente este {{entityName}}, se eliminaran sus metadatos, así como los metadatos de {{dependents}} de OpenMetadata permanentemente.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "Descripción del pipeline.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "The Ingestion Scheduler is unable to respond. Please reach out to Collate support. Thank you.",
"pipeline-trigger-failed-message": "Failed to trigger the pipeline!",
"pipeline-trigger-success-message": "¡Pipeline activado correctamente!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "La suppression permanente de cette {{entityName}} supprimera ses métadonnées ainsi que les métadonnées de {{dependents}} de façon permanente d'OpenMetadata.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "Description du pipeline.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "Le planificateur d'ingestion ne peut pas répondre. Veuillez contacter le support Collate. Merci.",
"pipeline-trigger-failed-message": "Échec de la déclenchement du pipeline !",
"pipeline-trigger-success-message": "Déclenchement du pipeline réussi",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "מחיקה של {{entityName}} תסיר את המטה-דאטה שלו, כמו גם את המטה-דאטה של {{dependents}} מ-OpenMetadata לצמיתות.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "תיאור תהליך הטעינה.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "מתזמן השקת המעבד לא מסוגל להגיב. יש לפנות לתמיכת Collate. תודה.",
"pipeline-trigger-failed-message": "נכשל להפעיל את תהליכי הטעינה!",
"pipeline-trigger-success-message": "תהליך הטעינה הופעל בהצלחה!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "Permanently deleting this {{entityName}} will remove its metadata, as well as the metadata of {{dependents}} from OpenMetadata permanently.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "パイプラインの説明",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "The Ingestion Scheduler is unable to respond. Please reach out to Collate support. Thank you.",
"pipeline-trigger-failed-message": "Failed to trigger the pipeline!",
"pipeline-trigger-success-message": "パイプラインは正常に起動しました!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "Het permanent verwijderen van deze {{entityName}} verwijdert de metadata ervan, evenals de metadata van {{dependents}} permanent uit OpenMetadata.",
"personal-access-token": "Persoonlijke toegangstoken",
"pipeline-description-message": "Beschrijving van de pipeline.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "De Ingestion Scheduler kan niet reageren. Neem contact op met Collate-ondersteuning. Dank je.",
"pipeline-trigger-failed-message": "Mislukt om de pipeline te activeren!",
"pipeline-trigger-success-message": "Pipeline succesvol geactiveerd!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "Excluir permanentemente este(a) {{entityName}} removerá seus metadados, bem como os metadados de {{dependents}} do OpenMetadata permanentemente.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "Descrição do pipeline.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "O Agendador de Ingestão não está respondendo. Entre em contato com o suporte da Collate. Obrigado.",
"pipeline-trigger-failed-message": "Falha ao acionar o pipeline!",
"pipeline-trigger-success-message": "Pipeline acionado com sucesso!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "Безвозвратное удаление этого {{entityName}} удалит его метаданные, а также метаданные {{dependers}} из OpenMetadata навсегда.",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "Описание пайплайна.",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "Планировщик загрузки не может ответить. Обратитесь в службу поддержки. Спасибо.",
"pipeline-trigger-failed-message": "Не удалось запустить пайплайн!",
"pipeline-trigger-success-message": "Пайплайн запущен успешно!",

View File

@ -1571,6 +1571,7 @@
"permanently-delete-metadata-and-dependents": "永久删除此{{entityName}}将永久从 OpenMetadata 中删除其元数据以及{{dependents}}的元数据",
"personal-access-token": "Personal Access Token",
"pipeline-description-message": "工作流的描述信息",
"pipeline-disabled-ingestion-deployment": "To view Ingestion Data, run the metadata ingestion on your own environment following these <0>{{link}}</0>",
"pipeline-scheduler-message": "元数据提取编排器无回复,请联系系统管理员",
"pipeline-trigger-failed-message": "触发工作流失败!",
"pipeline-trigger-success-message": "触发工作流成功",

View File

@ -21,6 +21,7 @@ import { getServiceDetailsPath } from '../constants/constants';
import {
DATA_INSIGHTS_PIPELINE_DOCS,
ELASTIC_SEARCH_RE_INDEX_PIPELINE_DOCS,
INGESTION_FRAMEWORK_DEPLOYMENT_DOCS,
WORKFLOWS_METADATA_DOCS,
} from '../constants/docs.constants';
import {
@ -191,7 +192,10 @@ export const getIngestionTypes = (
];
};
const getPipelineExtraInfo = (pipelineType?: PipelineType) => {
const getPipelineExtraInfo = (
isPlatFormDisabled: boolean,
pipelineType?: PipelineType
) => {
switch (pipelineType) {
case PipelineType.DataInsight:
return (
@ -239,17 +243,31 @@ const getPipelineExtraInfo = (pipelineType?: PipelineType) => {
return (
<Typography.Paragraph className="w-max-500">
<Transi18next
i18nKey="message.no-ingestion-description"
i18nKey={
isPlatFormDisabled
? 'message.pipeline-disabled-ingestion-deployment'
: 'message.no-ingestion-description'
}
renderElement={
<a
href={WORKFLOWS_METADATA_DOCS}
href={
isPlatFormDisabled
? INGESTION_FRAMEWORK_DEPLOYMENT_DOCS
: WORKFLOWS_METADATA_DOCS
}
rel="noreferrer"
style={{ color: '#1890ff' }}
target="_blank"
/>
}
values={{
link: t('label.metadata-ingestion'),
link: t(
`label.${
isPlatFormDisabled
? 'documentation-lowercase'
: 'metadata-ingestion'
}`
),
}}
/>
</Typography.Paragraph>
@ -260,12 +278,13 @@ const getPipelineExtraInfo = (pipelineType?: PipelineType) => {
export const getErrorPlaceHolder = (
isRequiredDetailsAvailable: boolean,
ingestionDataLength: number,
isPlatFormDisabled: boolean,
pipelineType?: PipelineType
) => {
if (isRequiredDetailsAvailable && ingestionDataLength === 0) {
return (
<ErrorPlaceHolder className="p-y-lg" type={ERROR_PLACEHOLDER_TYPE.CUSTOM}>
{getPipelineExtraInfo(pipelineType)}
{getPipelineExtraInfo(isPlatFormDisabled, pipelineType)}
</ErrorPlaceHolder>
);
}