mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-11 00:11:05 +00:00
parent
205f965f19
commit
228a508f03
@ -113,10 +113,6 @@ jest.mock(
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
jest.mock('../../components/FeedEditor/FeedEditor', () => {
|
|
||||||
return jest.fn().mockReturnValue(<p>FeedEditor</p>);
|
|
||||||
});
|
|
||||||
|
|
||||||
jest.mock('react-router-dom', () => ({
|
jest.mock('react-router-dom', () => ({
|
||||||
Link: jest
|
Link: jest
|
||||||
.fn()
|
.fn()
|
||||||
@ -145,9 +141,9 @@ jest.mock('../../utils/ServiceUtils', () => ({
|
|||||||
getIsIngestionEnable: jest.fn().mockReturnValue(true),
|
getIsIngestionEnable: jest.fn().mockReturnValue(true),
|
||||||
servicePageTabs: jest.fn().mockReturnValue([
|
servicePageTabs: jest.fn().mockReturnValue([
|
||||||
{
|
{
|
||||||
name: 'Activity Feed',
|
name: 'Databases',
|
||||||
path: 'activity_feed',
|
path: 'databases',
|
||||||
field: 'activity_feed',
|
field: 'databases',
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
getServiceCategoryFromType: jest.fn().mockReturnValue('databaseServices'),
|
getServiceCategoryFromType: jest.fn().mockReturnValue('databaseServices'),
|
||||||
|
|||||||
@ -15,24 +15,12 @@ import { AxiosError, AxiosResponse } from 'axios';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { compare } from 'fast-json-patch';
|
import { compare } from 'fast-json-patch';
|
||||||
import { isNil, isUndefined } from 'lodash';
|
import { isNil, isUndefined } from 'lodash';
|
||||||
import {
|
import { ExtraInfo, ServicesData } from 'Models';
|
||||||
EntityFieldThreadCount,
|
|
||||||
EntityThread,
|
|
||||||
ExtraInfo,
|
|
||||||
ServicesData,
|
|
||||||
} from 'Models';
|
|
||||||
import React, { Fragment, FunctionComponent, useEffect, useState } from 'react';
|
import React, { Fragment, FunctionComponent, useEffect, useState } from 'react';
|
||||||
import { Link, useHistory, useParams } from 'react-router-dom';
|
import { Link, useHistory, useParams } from 'react-router-dom';
|
||||||
import AppState from '../../AppState';
|
|
||||||
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
|
import { useAuthContext } from '../../authentication/auth-provider/AuthProvider';
|
||||||
import { getDashboards } from '../../axiosAPIs/dashboardAPI';
|
import { getDashboards } from '../../axiosAPIs/dashboardAPI';
|
||||||
import { getDatabases } from '../../axiosAPIs/databaseAPI';
|
import { getDatabases } from '../../axiosAPIs/databaseAPI';
|
||||||
import {
|
|
||||||
getAllFeeds,
|
|
||||||
getFeedCount,
|
|
||||||
postFeedById,
|
|
||||||
postThread,
|
|
||||||
} from '../../axiosAPIs/feedsAPI';
|
|
||||||
import {
|
import {
|
||||||
addIngestionPipeline,
|
addIngestionPipeline,
|
||||||
deleteIngestionPipelineById,
|
deleteIngestionPipelineById,
|
||||||
@ -43,8 +31,6 @@ import {
|
|||||||
import { getPipelines } from '../../axiosAPIs/pipelineAPI';
|
import { getPipelines } from '../../axiosAPIs/pipelineAPI';
|
||||||
import { getServiceByFQN, updateService } from '../../axiosAPIs/serviceAPI';
|
import { getServiceByFQN, updateService } from '../../axiosAPIs/serviceAPI';
|
||||||
import { getTopics } from '../../axiosAPIs/topicsAPI';
|
import { getTopics } from '../../axiosAPIs/topicsAPI';
|
||||||
import ActivityFeedList from '../../components/ActivityFeed/ActivityFeedList/ActivityFeedList';
|
|
||||||
import ActivityThreadPanel from '../../components/ActivityFeed/ActivityThreadPanel/ActivityThreadPanel';
|
|
||||||
import Description from '../../components/common/description/Description';
|
import Description from '../../components/common/description/Description';
|
||||||
import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder';
|
import ErrorPlaceHolder from '../../components/common/error-with-placeholder/ErrorPlaceHolder';
|
||||||
import IngestionError from '../../components/common/error/IngestionError';
|
import IngestionError from '../../components/common/error/IngestionError';
|
||||||
@ -57,7 +43,6 @@ import PageContainer from '../../components/containers/PageContainer';
|
|||||||
import Ingestion from '../../components/Ingestion/Ingestion.component';
|
import Ingestion from '../../components/Ingestion/Ingestion.component';
|
||||||
import Loader from '../../components/Loader/Loader';
|
import Loader from '../../components/Loader/Loader';
|
||||||
import ManageTabComponent from '../../components/ManageTab/ManageTab.component';
|
import ManageTabComponent from '../../components/ManageTab/ManageTab.component';
|
||||||
import RequestDescriptionModal from '../../components/Modals/RequestDescriptionModal/RequestDescriptionModal';
|
|
||||||
import ServiceConfig from '../../components/ServiceConfig/ServiceConfig';
|
import ServiceConfig from '../../components/ServiceConfig/ServiceConfig';
|
||||||
import TagsViewer from '../../components/tags-viewer/tags-viewer';
|
import TagsViewer from '../../components/tags-viewer/tags-viewer';
|
||||||
import {
|
import {
|
||||||
@ -66,10 +51,8 @@ import {
|
|||||||
PAGE_SIZE,
|
PAGE_SIZE,
|
||||||
pagingObject,
|
pagingObject,
|
||||||
} from '../../constants/constants';
|
} from '../../constants/constants';
|
||||||
import { TabSpecificField } from '../../enums/entity.enum';
|
|
||||||
import { SearchIndex } from '../../enums/search.enum';
|
import { SearchIndex } from '../../enums/search.enum';
|
||||||
import { ServiceCategory } from '../../enums/service.enum';
|
import { ServiceCategory } from '../../enums/service.enum';
|
||||||
import { CreateThread } from '../../generated/api/feed/createThread';
|
|
||||||
import { CreateIngestionPipeline } from '../../generated/api/services/ingestionPipelines/createIngestionPipeline';
|
import { CreateIngestionPipeline } from '../../generated/api/services/ingestionPipelines/createIngestionPipeline';
|
||||||
import { Dashboard } from '../../generated/entity/data/dashboard';
|
import { Dashboard } from '../../generated/entity/data/dashboard';
|
||||||
import { Database } from '../../generated/entity/data/database';
|
import { Database } from '../../generated/entity/data/database';
|
||||||
@ -77,7 +60,6 @@ import { Pipeline } from '../../generated/entity/data/pipeline';
|
|||||||
import { Topic } from '../../generated/entity/data/topic';
|
import { Topic } from '../../generated/entity/data/topic';
|
||||||
import { DatabaseService } from '../../generated/entity/services/databaseService';
|
import { DatabaseService } from '../../generated/entity/services/databaseService';
|
||||||
import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
import { IngestionPipeline } from '../../generated/entity/services/ingestionPipelines/ingestionPipeline';
|
||||||
import { EntityReference } from '../../generated/type/entityReference';
|
|
||||||
import { Paging } from '../../generated/type/paging';
|
import { Paging } from '../../generated/type/paging';
|
||||||
import { useAuth } from '../../hooks/authHooks';
|
import { useAuth } from '../../hooks/authHooks';
|
||||||
import { DataObj, ServiceDataObj } from '../../interface/service.interface';
|
import { DataObj, ServiceDataObj } from '../../interface/service.interface';
|
||||||
@ -88,13 +70,7 @@ import {
|
|||||||
hasEditAccess,
|
hasEditAccess,
|
||||||
isEven,
|
isEven,
|
||||||
} from '../../utils/CommonUtils';
|
} from '../../utils/CommonUtils';
|
||||||
import { getEntityFeedLink, getInfoElements } from '../../utils/EntityUtils';
|
import { getInfoElements } from '../../utils/EntityUtils';
|
||||||
import { getDefaultValue } from '../../utils/FeedElementUtils';
|
|
||||||
import {
|
|
||||||
deletePost,
|
|
||||||
getEntityFieldThreadCounts,
|
|
||||||
getUpdatedThread,
|
|
||||||
} from '../../utils/FeedUtils';
|
|
||||||
import {
|
import {
|
||||||
getCurrentServiceTab,
|
getCurrentServiceTab,
|
||||||
getIsIngestionEnable,
|
getIsIngestionEnable,
|
||||||
@ -104,7 +80,7 @@ import {
|
|||||||
} from '../../utils/ServiceUtils';
|
} from '../../utils/ServiceUtils';
|
||||||
import { getErrorText } from '../../utils/StringsUtils';
|
import { getErrorText } from '../../utils/StringsUtils';
|
||||||
import { getEntityLink, getUsagePercentile } from '../../utils/TableUtils';
|
import { getEntityLink, getUsagePercentile } from '../../utils/TableUtils';
|
||||||
import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils';
|
import { showErrorToast } from '../../utils/ToastUtils';
|
||||||
|
|
||||||
type Data = Database & Topic & Dashboard;
|
type Data = Database & Topic & Dashboard;
|
||||||
|
|
||||||
@ -137,27 +113,10 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
const [ingestions, setIngestions] = useState<IngestionPipeline[]>([]);
|
const [ingestions, setIngestions] = useState<IngestionPipeline[]>([]);
|
||||||
const [serviceList] = useState<Array<DatabaseService>>([]);
|
const [serviceList] = useState<Array<DatabaseService>>([]);
|
||||||
const [ingestionPaging, setIngestionPaging] = useState<Paging>({} as Paging);
|
const [ingestionPaging, setIngestionPaging] = useState<Paging>({} as Paging);
|
||||||
const [entityThread, setEntityThread] = useState<EntityThread[]>([]);
|
|
||||||
const [isentityThreadLoading, setIsentityThreadLoading] =
|
|
||||||
useState<boolean>(false);
|
|
||||||
const [feedCount, setFeedCount] = useState<number>(0);
|
|
||||||
const [entityFieldThreadCount, setEntityFieldThreadCount] = useState<
|
|
||||||
EntityFieldThreadCount[]
|
|
||||||
>([]);
|
|
||||||
|
|
||||||
const [threadLink, setThreadLink] = useState<string>('');
|
|
||||||
const [selectedField, setSelectedField] = useState<string>('');
|
|
||||||
|
|
||||||
const [currentPage, setCurrentPage] = useState(1);
|
const [currentPage, setCurrentPage] = useState(1);
|
||||||
const [ingestionCurrentPage, setIngestionCurrentPage] = useState(1);
|
const [ingestionCurrentPage, setIngestionCurrentPage] = useState(1);
|
||||||
|
|
||||||
const onEntityFieldSelect = (value: string) => {
|
|
||||||
setSelectedField(value);
|
|
||||||
};
|
|
||||||
const closeRequestModal = () => {
|
|
||||||
setSelectedField('');
|
|
||||||
};
|
|
||||||
|
|
||||||
const getCountLabel = () => {
|
const getCountLabel = () => {
|
||||||
switch (serviceName) {
|
switch (serviceName) {
|
||||||
case ServiceCategory.DASHBOARD_SERVICES:
|
case ServiceCategory.DASHBOARD_SERVICES:
|
||||||
@ -185,18 +144,6 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
position: 1,
|
position: 1,
|
||||||
count: instanceCount,
|
count: instanceCount,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Activity Feed',
|
|
||||||
icon: {
|
|
||||||
alt: 'activity_feed',
|
|
||||||
name: 'activity_feed',
|
|
||||||
title: 'Activity Feed',
|
|
||||||
selectedName: 'activity-feed-color',
|
|
||||||
},
|
|
||||||
isProtected: false,
|
|
||||||
position: 2,
|
|
||||||
count: feedCount,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'Ingestions',
|
name: 'Ingestions',
|
||||||
icon: {
|
icon: {
|
||||||
@ -207,11 +154,11 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
},
|
},
|
||||||
isHidden: !isIngestionEnable,
|
isHidden: !isIngestionEnable,
|
||||||
isProtected: false,
|
isProtected: false,
|
||||||
position: 3,
|
position: 2,
|
||||||
count: ingestions.length,
|
count: ingestions.length,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Connection Config',
|
name: 'Connection',
|
||||||
icon: {
|
icon: {
|
||||||
alt: 'sample_data',
|
alt: 'sample_data',
|
||||||
name: 'sample-data',
|
name: 'sample-data',
|
||||||
@ -220,7 +167,7 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
},
|
},
|
||||||
|
|
||||||
isProtected: !isAdminUser && !isAuthDisabled,
|
isProtected: !isAdminUser && !isAuthDisabled,
|
||||||
position: 4,
|
position: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Manage',
|
name: 'Manage',
|
||||||
@ -231,7 +178,7 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
selectedName: 'icon-managecolor',
|
selectedName: 'icon-managecolor',
|
||||||
},
|
},
|
||||||
isProtected: false,
|
isProtected: false,
|
||||||
position: 5,
|
position: 4,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -267,34 +214,6 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onThreadLinkSelect = (link: string) => {
|
|
||||||
setThreadLink(link);
|
|
||||||
};
|
|
||||||
|
|
||||||
const onThreadPanelClose = () => {
|
|
||||||
setThreadLink('');
|
|
||||||
};
|
|
||||||
|
|
||||||
const getEntityFeedCount = () => {
|
|
||||||
getFeedCount(getEntityFeedLink(serviceCategory.slice(0, -1), serviceFQN))
|
|
||||||
.then((res: AxiosResponse) => {
|
|
||||||
if (res.data) {
|
|
||||||
setFeedCount(res.data.totalCount);
|
|
||||||
setEntityFieldThreadCount(res.data.counts);
|
|
||||||
} else {
|
|
||||||
showErrorToast(
|
|
||||||
jsonData['api-error-messages']['fetch-entity-feed-count-error']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error: AxiosError) => {
|
|
||||||
showErrorToast(
|
|
||||||
error,
|
|
||||||
jsonData['api-error-messages']['fetch-entity-feed-count-error']
|
|
||||||
);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const getAllIngestionWorkflows = (paging?: string) => {
|
const getAllIngestionWorkflows = (paging?: string) => {
|
||||||
setIsloading(true);
|
setIsloading(true);
|
||||||
getIngestionPipelines(['owner'], serviceFQN, paging)
|
getIngestionPipelines(['owner'], serviceFQN, paging)
|
||||||
@ -824,7 +743,6 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
owner: serviceDetails?.owner,
|
owner: serviceDetails?.owner,
|
||||||
});
|
});
|
||||||
setIsEdit(false);
|
setIsEdit(false);
|
||||||
getEntityFeedCount();
|
|
||||||
})
|
})
|
||||||
.catch((error: AxiosError) => {
|
.catch((error: AxiosError) => {
|
||||||
showErrorToast(
|
showErrorToast(
|
||||||
@ -890,138 +808,8 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
getAllIngestionWorkflows(pagingString);
|
getAllIngestionWorkflows(pagingString);
|
||||||
setIngestionCurrentPage(activePage ?? 1);
|
setIngestionCurrentPage(activePage ?? 1);
|
||||||
};
|
};
|
||||||
const fetchActivityFeed = () => {
|
|
||||||
setIsentityThreadLoading(true);
|
|
||||||
getAllFeeds(getEntityFeedLink(serviceCategory.slice(0, -1), serviceFQN))
|
|
||||||
.then((res: AxiosResponse) => {
|
|
||||||
if (res.data) {
|
|
||||||
const { data } = res.data;
|
|
||||||
setEntityThread(data);
|
|
||||||
} else {
|
|
||||||
showErrorToast(
|
|
||||||
jsonData['api-error-messages']['fetch-entity-feed-error']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error: AxiosError) => {
|
|
||||||
showErrorToast(
|
|
||||||
error,
|
|
||||||
jsonData['api-error-messages']['fetch-entity-feed-error']
|
|
||||||
);
|
|
||||||
})
|
|
||||||
.finally(() => setIsentityThreadLoading(false));
|
|
||||||
};
|
|
||||||
|
|
||||||
const postFeedHandler = (value: string, id: string) => {
|
|
||||||
const currentUser = AppState.userDetails?.name ?? AppState.users[0]?.name;
|
|
||||||
|
|
||||||
const data = {
|
|
||||||
message: value,
|
|
||||||
from: currentUser,
|
|
||||||
};
|
|
||||||
postFeedById(id, data)
|
|
||||||
.then((res: AxiosResponse) => {
|
|
||||||
if (res.data) {
|
|
||||||
const { id, posts } = res.data;
|
|
||||||
setEntityThread((pre) => {
|
|
||||||
return pre.map((thread) => {
|
|
||||||
if (thread.id === id) {
|
|
||||||
return { ...res.data, posts: posts.slice(-3) };
|
|
||||||
} else {
|
|
||||||
return thread;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
showErrorToast(
|
|
||||||
jsonData['api-error-messages']['create-message-error']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error: AxiosError) => {
|
|
||||||
showErrorToast(
|
|
||||||
error,
|
|
||||||
jsonData['api-error-messages']['create-message-error']
|
|
||||||
);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const createThread = (data: CreateThread) => {
|
|
||||||
postThread(data)
|
|
||||||
.then((res: AxiosResponse) => {
|
|
||||||
if (res.data) {
|
|
||||||
setEntityThread((pre) => [...pre, res.data]);
|
|
||||||
getEntityFeedCount();
|
|
||||||
|
|
||||||
showSuccessToast(
|
|
||||||
jsonData['api-success-messages']['create-conversation']
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
showErrorToast(
|
|
||||||
jsonData['api-error-messages']['create-conversation-error']
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error: AxiosError) => {
|
|
||||||
showErrorToast(
|
|
||||||
error,
|
|
||||||
jsonData['api-error-messages']['create-conversation-error']
|
|
||||||
);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const deletePostHandler = (threadId: string, postId: string) => {
|
|
||||||
deletePost(threadId, postId)
|
|
||||||
.then(() => {
|
|
||||||
getUpdatedThread(threadId)
|
|
||||||
.then((data) => {
|
|
||||||
if (data) {
|
|
||||||
setEntityThread((pre) => {
|
|
||||||
return pre.map((thread) => {
|
|
||||||
if (thread.id === data.id) {
|
|
||||||
return {
|
|
||||||
...thread,
|
|
||||||
posts: data.posts.slice(-3),
|
|
||||||
postsCount: data.postsCount,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return thread;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
showErrorToast(
|
|
||||||
jsonData['api-error-messages'][
|
|
||||||
'fetch-updated-conversation-error'
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error: AxiosError) => {
|
|
||||||
showErrorToast(
|
|
||||||
error,
|
|
||||||
jsonData['api-error-messages']['fetch-updated-conversation-error']
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
showSuccessToast(jsonData['api-success-messages']['delete-message']);
|
|
||||||
})
|
|
||||||
.catch((error: AxiosError) => {
|
|
||||||
showErrorToast(
|
|
||||||
error,
|
|
||||||
jsonData['api-error-messages']['delete-message-error']
|
|
||||||
);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
getEntityFeedCount();
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (TabSpecificField.ACTIVITY_FEED === tab) {
|
|
||||||
fetchActivityFeed();
|
|
||||||
}
|
|
||||||
if (servicePageTabs(getCountLabel())[activeTab - 1].path !== tab) {
|
if (servicePageTabs(getCountLabel())[activeTab - 1].path !== tab) {
|
||||||
setActiveTab(getCurrentServiceTab(tab));
|
setActiveTab(getCurrentServiceTab(tab));
|
||||||
}
|
}
|
||||||
@ -1061,10 +849,6 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
<Description
|
<Description
|
||||||
blurWithBodyBG
|
blurWithBodyBG
|
||||||
description={description || ''}
|
description={description || ''}
|
||||||
entityFieldThreads={getEntityFieldThreadCounts(
|
|
||||||
'description',
|
|
||||||
entityFieldThreadCount
|
|
||||||
)}
|
|
||||||
entityFqn={serviceFQN}
|
entityFqn={serviceFQN}
|
||||||
entityName={serviceFQN}
|
entityName={serviceFQN}
|
||||||
entityType={serviceCategory.slice(0, -1)}
|
entityType={serviceCategory.slice(0, -1)}
|
||||||
@ -1072,8 +856,6 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
onCancel={onCancel}
|
onCancel={onCancel}
|
||||||
onDescriptionEdit={onDescriptionEdit}
|
onDescriptionEdit={onDescriptionEdit}
|
||||||
onDescriptionUpdate={onDescriptionUpdate}
|
onDescriptionUpdate={onDescriptionUpdate}
|
||||||
onEntityFieldSelect={onEntityFieldSelect}
|
|
||||||
onThreadLinkSelect={onThreadLinkSelect}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1158,26 +940,8 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
)}
|
)}
|
||||||
</Fragment>
|
</Fragment>
|
||||||
)}
|
)}
|
||||||
{activeTab === 2 && (
|
|
||||||
<div
|
|
||||||
className="tw-py-4 tw-px-7 tw-grid tw-grid-cols-3 entity-feed-list tw-bg-body-main tw--mx-7 tw-h-screen"
|
|
||||||
id="activityfeed">
|
|
||||||
<div />
|
|
||||||
<ActivityFeedList
|
|
||||||
isEntityFeed
|
|
||||||
withSidePanel
|
|
||||||
className=""
|
|
||||||
deletePostHandler={deletePostHandler}
|
|
||||||
entityName={serviceFQN}
|
|
||||||
feedList={entityThread}
|
|
||||||
isLoading={isentityThreadLoading}
|
|
||||||
postFeedHandler={postFeedHandler}
|
|
||||||
/>
|
|
||||||
<div />
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{activeTab === 3 && (
|
{activeTab === 2 && (
|
||||||
<div data-testid="ingestion-container">
|
<div data-testid="ingestion-container">
|
||||||
{isConnectionAvailable ? (
|
{isConnectionAvailable ? (
|
||||||
<Ingestion
|
<Ingestion
|
||||||
@ -1201,7 +965,7 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{activeTab === 4 && (isAdminUser || isAuthDisabled) && (
|
{activeTab === 3 && (isAdminUser || isAuthDisabled) && (
|
||||||
<ServiceConfig
|
<ServiceConfig
|
||||||
data={serviceDetails as ServicesData}
|
data={serviceDetails as ServicesData}
|
||||||
handleUpdate={handleConfigUpdate}
|
handleUpdate={handleConfigUpdate}
|
||||||
@ -1209,7 +973,7 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{activeTab === 5 && (
|
{activeTab === 4 && (
|
||||||
<div className="tw-bg-white tw-h-full tw-pt-4 tw-pb-6">
|
<div className="tw-bg-white tw-h-full tw-pt-4 tw-pb-6">
|
||||||
<ManageTabComponent
|
<ManageTabComponent
|
||||||
allowDelete
|
allowDelete
|
||||||
@ -1228,31 +992,6 @@ const ServicePage: FunctionComponent = () => {
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{threadLink ? (
|
|
||||||
<ActivityThreadPanel
|
|
||||||
createThread={createThread}
|
|
||||||
deletePostHandler={deletePostHandler}
|
|
||||||
open={Boolean(threadLink)}
|
|
||||||
postFeedHandler={postFeedHandler}
|
|
||||||
threadLink={threadLink}
|
|
||||||
onCancel={onThreadPanelClose}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
{selectedField ? (
|
|
||||||
<RequestDescriptionModal
|
|
||||||
createThread={createThread}
|
|
||||||
defaultValue={getDefaultValue(
|
|
||||||
serviceDetails?.owner as EntityReference
|
|
||||||
)}
|
|
||||||
header="Request description"
|
|
||||||
threadLink={getEntityFeedLink(
|
|
||||||
serviceCategory.slice(0, -1),
|
|
||||||
serviceFQN,
|
|
||||||
selectedField
|
|
||||||
)}
|
|
||||||
onCancel={closeRequestModal}
|
|
||||||
/>
|
|
||||||
) : null}
|
|
||||||
</div>
|
</div>
|
||||||
</PageContainer>
|
</PageContainer>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@ -61,7 +61,6 @@ import {
|
|||||||
TRINO,
|
TRINO,
|
||||||
VERTICA,
|
VERTICA,
|
||||||
} from '../constants/services.const';
|
} from '../constants/services.const';
|
||||||
import { TabSpecificField } from '../enums/entity.enum';
|
|
||||||
import { ServiceCategory } from '../enums/service.enum';
|
import { ServiceCategory } from '../enums/service.enum';
|
||||||
import { DashboardServiceType } from '../generated/entity/services/dashboardService';
|
import { DashboardServiceType } from '../generated/entity/services/dashboardService';
|
||||||
import { DatabaseServiceType } from '../generated/entity/services/databaseService';
|
import { DatabaseServiceType } from '../generated/entity/services/databaseService';
|
||||||
@ -428,18 +427,13 @@ export const servicePageTabs = (entity: string) => [
|
|||||||
name: entity,
|
name: entity,
|
||||||
path: entity.toLowerCase(),
|
path: entity.toLowerCase(),
|
||||||
},
|
},
|
||||||
{
|
|
||||||
name: 'Activity Feed',
|
|
||||||
path: 'activity_feed',
|
|
||||||
field: TabSpecificField.ACTIVITY_FEED,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'Ingestions',
|
name: 'Ingestions',
|
||||||
path: 'ingestions',
|
path: 'ingestions',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Connection Config',
|
name: 'Connection',
|
||||||
path: 'connection_config',
|
path: 'connection',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'Manage',
|
name: 'Manage',
|
||||||
@ -450,22 +444,18 @@ export const servicePageTabs = (entity: string) => [
|
|||||||
export const getCurrentServiceTab = (tab: string) => {
|
export const getCurrentServiceTab = (tab: string) => {
|
||||||
let currentTab = 1;
|
let currentTab = 1;
|
||||||
switch (tab) {
|
switch (tab) {
|
||||||
case 'activity_feed':
|
case 'ingestions':
|
||||||
currentTab = 2;
|
currentTab = 2;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 'ingestions':
|
|
||||||
|
case 'connection':
|
||||||
currentTab = 3;
|
currentTab = 3;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'connection_config':
|
|
||||||
currentTab = 4;
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'manage':
|
case 'manage':
|
||||||
currentTab = 5;
|
currentTab = 4;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user