Fix #1567 Remove Service Where ever API call is being with fields parameter having service. (#1568)

This commit is contained in:
Sachin Chaurasiya 2021-12-06 15:22:31 +05:30 committed by GitHub
parent 8b44de52cb
commit 672041bbb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 155 additions and 208 deletions

View File

@ -48,7 +48,7 @@ const RecentlyViewed: FunctionComponent = () => {
case EntityType.DATASET: { case EntityType.DATASET: {
const res = await getTableDetailsByFQN( const res = await getTableDetailsByFQN(
oData.fqn, oData.fqn,
'database, usageSummary, tags, owner,columns' 'usageSummary, tags, owner,columns'
); );
const { const {
@ -79,7 +79,7 @@ const RecentlyViewed: FunctionComponent = () => {
break; break;
} }
case EntityType.TOPIC: { case EntityType.TOPIC: {
const res = await getTopicByFqn(oData.fqn, 'owner, service, tags'); const res = await getTopicByFqn(oData.fqn, 'owner, tags');
const { description, id, name, tags, owner, fullyQualifiedName } = const { description, id, name, tags, owner, fullyQualifiedName } =
res.data; res.data;
@ -100,7 +100,7 @@ const RecentlyViewed: FunctionComponent = () => {
case EntityType.DASHBOARD: { case EntityType.DASHBOARD: {
const res = await getDashboardByFqn( const res = await getDashboardByFqn(
oData.fqn, oData.fqn,
'owner, service, tags, usageSummary' 'owner, tags, usageSummary'
); );
const { const {
@ -129,7 +129,7 @@ const RecentlyViewed: FunctionComponent = () => {
case EntityType.PIPELINE: { case EntityType.PIPELINE: {
const res = await getPipelineByFqn( const res = await getPipelineByFqn(
oData.fqn, oData.fqn,
'owner, service, tags, usageSummary' 'owner, tags, usageSummary'
); );
const { const {

View File

@ -188,7 +188,7 @@ const DBTModelDetailsPage: FunctionComponent = () => {
setOwner(getOwnerFromId(owner?.id)); setOwner(getOwnerFromId(owner?.id));
setTier(getTierTags(tags)); setTier(getTierTags(tags));
setFollowers(followers); setFollowers(followers);
getDatabase(database.id, 'service').then((resDB: AxiosResponse) => { getDatabase(database.id).then((resDB: AxiosResponse) => {
getServiceById('databaseServices', resDB.data.service?.id).then( getServiceById('databaseServices', resDB.data.service?.id).then(
(resService: AxiosResponse) => { (resService: AxiosResponse) => {
setSlashedDBTModelName([ setSlashedDBTModelName([

View File

@ -24,7 +24,6 @@ import {
patchDashboardDetails, patchDashboardDetails,
removeFollower, removeFollower,
} from '../../axiosAPIs/dashboardAPI'; } from '../../axiosAPIs/dashboardAPI';
import { getServiceById } from '../../axiosAPIs/serviceAPI';
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface'; import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
import DashboardDetails from '../../components/DashboardDetails/DashboardDetails.component'; import DashboardDetails from '../../components/DashboardDetails/DashboardDetails.component';
import Loader from '../../components/Loader/Loader'; import Loader from '../../components/Loader/Loader';
@ -125,9 +124,7 @@ const DashboardDetailsPage = () => {
let chartsData: ChartType[] = []; let chartsData: ChartType[] = [];
let promiseArr: Array<AxiosPromise> = []; let promiseArr: Array<AxiosPromise> = [];
if (charts?.length) { if (charts?.length) {
promiseArr = charts.map((chart) => promiseArr = charts.map((chart) => getChartById(chart.id, ['tags']));
getChartById(chart.id, ['service', 'tags'])
);
await Promise.allSettled(promiseArr).then( await Promise.allSettled(promiseArr).then(
(res: PromiseSettledResult<AxiosResponse>[]) => { (res: PromiseSettledResult<AxiosResponse>[]) => {
if (res.length) { if (res.length) {
@ -149,7 +146,6 @@ const DashboardDetailsPage = () => {
setLoading(true); setLoading(true);
getDashboardByFqn(dashboardFQN, [ getDashboardByFqn(dashboardFQN, [
'owner', 'owner',
'service',
'followers', 'followers',
'tags', 'tags',
'usageSummary', 'usageSummary',
@ -166,6 +162,7 @@ const DashboardDetailsPage = () => {
displayName, displayName,
charts, charts,
dashboardUrl, dashboardUrl,
serviceType,
} = res.data; } = res.data;
setDisplayName(displayName); setDisplayName(displayName);
setDashboardDetails(res.data); setDashboardDetails(res.data);
@ -175,22 +172,18 @@ const DashboardDetailsPage = () => {
setOwner(getOwnerFromId(owner?.id)); setOwner(getOwnerFromId(owner?.id));
setTier(getTierTags(tags)); setTier(getTierTags(tags));
setTags(getTagsWithoutTier(tags)); setTags(getTagsWithoutTier(tags));
getServiceById('dashboardServices', service?.id).then( setServiceType(serviceType);
(serviceRes: AxiosResponse) => {
setServiceType(serviceRes.data.serviceType);
setSlashedDashboardName([ setSlashedDashboardName([
{ {
name: serviceRes.data.name, name: service.name,
url: serviceRes.data.name url: service.name
? getServiceDetailsPath( ? getServiceDetailsPath(
serviceRes.data.name, service.name,
serviceRes.data.serviceType, serviceType,
ServiceCategory.DASHBOARD_SERVICES ServiceCategory.DASHBOARD_SERVICES
) )
: '', : '',
imgSrc: serviceRes.data.serviceType imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
? serviceTypeLogo(serviceRes.data.serviceType)
: undefined,
}, },
{ {
name: displayName, name: displayName,
@ -202,11 +195,10 @@ const DashboardDetailsPage = () => {
addToRecentViewed({ addToRecentViewed({
entityType: EntityType.DASHBOARD, entityType: EntityType.DASHBOARD,
fqn: fullyQualifiedName, fqn: fullyQualifiedName,
serviceType: serviceRes.data.serviceType, serviceType: serviceType,
timestamp: 0, timestamp: 0,
}); });
}
);
setDashboardUrl(dashboardUrl); setDashboardUrl(dashboardUrl);
fetchCharts(charts).then((charts) => setCharts(charts)); fetchCharts(charts).then((charts) => setCharts(charts));
setLoading(false); setLoading(false);

View File

@ -18,9 +18,7 @@ import { EntityTags, LeafNodes, LineagePos, LoadingNodeState } from 'Models';
import React, { FunctionComponent, useEffect, useState } from 'react'; import React, { FunctionComponent, useEffect, useState } from 'react';
import { useHistory, useParams } from 'react-router-dom'; import { useHistory, useParams } from 'react-router-dom';
import AppState from '../../AppState'; import AppState from '../../AppState';
import { getDatabase } from '../../axiosAPIs/databaseAPI';
import { getLineageByFQN } from '../../axiosAPIs/lineageAPI'; import { getLineageByFQN } from '../../axiosAPIs/lineageAPI';
import { getServiceById } from '../../axiosAPIs/serviceAPI';
import { import {
addFollower, addFollower,
getTableDetailsByFQN, getTableDetailsByFQN,
@ -226,7 +224,7 @@ const DatasetDetailsPage: FunctionComponent = () => {
setIsLoading(true); setIsLoading(true);
getTableDetailsByFQN( getTableDetailsByFQN(
getPartialNameFromFQN(tableFQN, ['service', 'database', 'table'], '.'), getPartialNameFromFQN(tableFQN, ['service', 'database', 'table'], '.'),
'columns, database, usageSummary, followers, joins, tags, owner, sampleData, tableProfile' 'columns, usageSummary, followers, joins, tags, owner, sampleData, tableProfile'
) )
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
const { const {
@ -245,6 +243,8 @@ const DatasetDetailsPage: FunctionComponent = () => {
tableProfile, tableProfile,
version, version,
changeDescription, changeDescription,
service,
serviceType,
} = res.data; } = res.data;
setTableDetails(res.data); setTableDetails(res.data);
setTableId(id); setTableId(id);
@ -253,26 +253,21 @@ const DatasetDetailsPage: FunctionComponent = () => {
setTier(getTierTags(tags)); setTier(getTierTags(tags));
setOwner(getOwnerFromId(owner?.id)); setOwner(getOwnerFromId(owner?.id));
setFollowers(followers); setFollowers(followers);
getDatabase(database.id, 'service').then((resDB: AxiosResponse) => {
getServiceById('databaseServices', resDB.data.service?.id).then(
(resService: AxiosResponse) => {
setSlashedTableName([ setSlashedTableName([
{ {
name: resService.data.name, name: service.name,
url: resService.data.name url: service.name
? getServiceDetailsPath( ? getServiceDetailsPath(
resService.data.name, service.name,
resService.data.serviceType, serviceType,
ServiceCategory.DATABASE_SERVICES ServiceCategory.DATABASE_SERVICES
) )
: '', : '',
imgSrc: resService.data.serviceType imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
? serviceTypeLogo(resService.data.serviceType)
: undefined,
}, },
{ {
name: resDB.data.name, name: getPartialNameFromFQN(database.name, ['database']),
url: getDatabaseDetailsPath(resDB.data.fullyQualifiedName), url: getDatabaseDetailsPath(database.name),
}, },
{ {
name: name, name: name,
@ -284,12 +279,9 @@ const DatasetDetailsPage: FunctionComponent = () => {
addToRecentViewed({ addToRecentViewed({
entityType: EntityType.DATASET, entityType: EntityType.DATASET,
fqn: fullyQualifiedName, fqn: fullyQualifiedName,
serviceType: resService.data.serviceType, serviceType: serviceType,
timestamp: 0, timestamp: 0,
}); });
}
);
});
setName(name); setName(name);
setDescription(description); setDescription(description);

View File

@ -53,7 +53,7 @@ const IngestionPage = () => {
}; };
const getAllIngestionWorkflows = (paging?: string) => { const getAllIngestionWorkflows = (paging?: string) => {
getIngestionWorkflows(['owner, service, tags, status'], paging) getIngestionWorkflows(['owner, tags, status'], paging)
.then((res) => { .then((res) => {
if (res.data.data) { if (res.data.data) {
setIngestions(res.data.data); setIngestions(res.data.data);

View File

@ -68,7 +68,7 @@ const MyDataPage = () => {
getAllServices() getAllServices()
.then((res) => setCountServices(res.length)) .then((res) => setCountServices(res.length))
.catch(() => setCountServices(0)); .catch(() => setCountServices(0));
getIngestionWorkflows(['owner, service, tags, status']) getIngestionWorkflows(['owner,tags, status'])
.then((res) => setIngestionCount(res.data.data.length)) .then((res) => setIngestionCount(res.data.data.length))
.catch(() => setIngestionCount(0)); .catch(() => setIngestionCount(0));
} }

View File

@ -31,7 +31,6 @@ import {
patchPipelineDetails, patchPipelineDetails,
removeFollower, removeFollower,
} from '../../axiosAPIs/pipelineAPI'; } from '../../axiosAPIs/pipelineAPI';
import { getServiceById } from '../../axiosAPIs/serviceAPI';
import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface'; import { TitleBreadcrumbProps } from '../../components/common/title-breadcrumb/title-breadcrumb.interface';
import Loader from '../../components/Loader/Loader'; import Loader from '../../components/Loader/Loader';
import PipelineDetails from '../../components/PipelineDetails/PipelineDetails.component'; import PipelineDetails from '../../components/PipelineDetails/PipelineDetails.component';
@ -141,13 +140,7 @@ const PipelineDetailsPage = () => {
const fetchPipelineDetail = (pipelineFQN: string) => { const fetchPipelineDetail = (pipelineFQN: string) => {
setLoading(true); setLoading(true);
getPipelineByFqn(pipelineFQN, [ getPipelineByFqn(pipelineFQN, ['owner', 'followers', 'tags', 'tasks'])
'owner',
'service',
'followers',
'tags',
'tasks',
])
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
const { const {
id, id,
@ -155,6 +148,7 @@ const PipelineDetailsPage = () => {
followers, followers,
fullyQualifiedName, fullyQualifiedName,
service, service,
serviceType,
tags, tags,
owner, owner,
displayName, displayName,
@ -169,22 +163,18 @@ const PipelineDetailsPage = () => {
setOwner(getOwnerFromId(owner?.id)); setOwner(getOwnerFromId(owner?.id));
setTier(getTierTags(tags)); setTier(getTierTags(tags));
setTags(getTagsWithoutTier(tags)); setTags(getTagsWithoutTier(tags));
getServiceById('pipelineServices', service?.id).then( setServiceType(serviceType);
(serviceRes: AxiosResponse) => {
setServiceType(serviceRes.data.serviceType);
setSlashedPipelineName([ setSlashedPipelineName([
{ {
name: serviceRes.data.name, name: service.name,
url: serviceRes.data.name url: service.name
? getServiceDetailsPath( ? getServiceDetailsPath(
serviceRes.data.name, service.name,
serviceRes.data.serviceType, serviceType,
ServiceCategory.PIPELINE_SERVICES ServiceCategory.PIPELINE_SERVICES
) )
: '', : '',
imgSrc: serviceRes.data.serviceType imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
? serviceTypeLogo(serviceRes.data.serviceType)
: undefined,
}, },
{ {
name: displayName, name: displayName,
@ -196,11 +186,9 @@ const PipelineDetailsPage = () => {
addToRecentViewed({ addToRecentViewed({
entityType: EntityType.PIPELINE, entityType: EntityType.PIPELINE,
fqn: fullyQualifiedName, fqn: fullyQualifiedName,
serviceType: serviceRes.data.serviceType, serviceType: serviceType,
timestamp: 0, timestamp: 0,
}); });
}
);
setPipelineUrl(pipelineUrl); setPipelineUrl(pipelineUrl);
setTasks(tasks); setTasks(tasks);
}) })

View File

@ -18,7 +18,6 @@ import { EntityTags, TableDetail } from 'Models';
import React, { FunctionComponent, useEffect, useState } from 'react'; import React, { FunctionComponent, useEffect, useState } from 'react';
import { useHistory, useParams } from 'react-router-dom'; import { useHistory, useParams } from 'react-router-dom';
import AppState from '../../AppState'; import AppState from '../../AppState';
import { getServiceById } from '../../axiosAPIs/serviceAPI';
import { import {
addFollower, addFollower,
getTopicByFqn, getTopicByFqn,
@ -116,7 +115,7 @@ const TopicDetailsPage: FunctionComponent = () => {
const fetchTopicDetail = (topicFQN: string) => { const fetchTopicDetail = (topicFQN: string) => {
setLoading(true); setLoading(true);
getTopicByFqn(topicFQN, ['owner', 'service', 'followers', 'tags']) getTopicByFqn(topicFQN, ['owner', 'followers', 'tags'])
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
const { const {
id, id,
@ -134,6 +133,7 @@ const TopicDetailsPage: FunctionComponent = () => {
maximumMessageSize, maximumMessageSize,
replicationFactor, replicationFactor,
retentionSize, retentionSize,
serviceType,
} = res.data; } = res.data;
setName(name); setName(name);
setTopicDetails(res.data); setTopicDetails(res.data);
@ -150,21 +150,17 @@ const TopicDetailsPage: FunctionComponent = () => {
setMaximumMessageSize(maximumMessageSize); setMaximumMessageSize(maximumMessageSize);
setReplicationFactor(replicationFactor); setReplicationFactor(replicationFactor);
setRetentionSize(retentionSize); setRetentionSize(retentionSize);
getServiceById('messagingServices', service?.id)
.then((serviceRes: AxiosResponse) => {
setSlashedTopicName([ setSlashedTopicName([
{ {
name: serviceRes.data.name, name: service.name,
url: serviceRes.data.name url: service.name
? getServiceDetailsPath( ? getServiceDetailsPath(
serviceRes.data.name, service.name,
serviceRes.data.serviceType, serviceType,
ServiceCategory.MESSAGING_SERVICES ServiceCategory.MESSAGING_SERVICES
) )
: '', : '',
imgSrc: serviceRes.data.serviceType imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
? serviceTypeLogo(serviceRes.data.serviceType)
: undefined,
}, },
{ {
name: name, name: name,
@ -176,19 +172,10 @@ const TopicDetailsPage: FunctionComponent = () => {
addToRecentViewed({ addToRecentViewed({
entityType: EntityType.TOPIC, entityType: EntityType.TOPIC,
fqn: fullyQualifiedName, fqn: fullyQualifiedName,
serviceType: serviceRes.data.serviceType, serviceType: serviceType,
timestamp: 0, timestamp: 0,
}); });
}) setLoading(false);
.catch((err: AxiosError) => {
const errMsg =
err.message || `Error while fetching service for ${name}`;
showToast({
variant: 'error',
body: errMsg,
});
})
.finally(() => setLoading(false));
}) })
.catch((err: AxiosError) => { .catch((err: AxiosError) => {
const errMsg = err.message || 'Error while fetching topic details'; const errMsg = err.message || 'Error while fetching topic details';

View File

@ -168,8 +168,7 @@ const DatabaseDetails: FunctionComponent = () => {
}; };
const getDetailsByFQN = () => { const getDetailsByFQN = () => {
getDatabaseDetailsByFQN(databaseFQN, 'service').then( getDatabaseDetailsByFQN(databaseFQN).then((res: AxiosResponse) => {
(res: AxiosResponse) => {
const { description, id, name, service } = res.data; const { description, id, name, service } = res.data;
setDatabase(res.data); setDatabase(res.data);
setDescription(description); setDescription(description);
@ -201,8 +200,7 @@ const DatabaseDetails: FunctionComponent = () => {
]); ]);
} }
); );
} });
);
fetchDatabaseTablesAndDBTModels(); fetchDatabaseTablesAndDBTModels();
}; };

View File

@ -87,7 +87,7 @@ const ServicePage: FunctionComponent = () => {
const fetchDatabases = (paging?: string) => { const fetchDatabases = (paging?: string) => {
setIsloading(true); setIsloading(true);
getDatabases(serviceFQN, paging, ['owner', 'usageSummary', 'service']) getDatabases(serviceFQN, paging, ['owner', 'usageSummary'])
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
if (res.data.data) { if (res.data.data) {
setData(res.data.data); setData(res.data.data);
@ -107,7 +107,7 @@ const ServicePage: FunctionComponent = () => {
const fetchTopics = (paging?: string) => { const fetchTopics = (paging?: string) => {
setIsloading(true); setIsloading(true);
getTopics(serviceFQN, paging, ['owner', 'service', 'tags']) getTopics(serviceFQN, paging, ['owner', 'tags'])
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
if (res.data.data) { if (res.data.data) {
setData(res.data.data); setData(res.data.data);
@ -127,12 +127,7 @@ const ServicePage: FunctionComponent = () => {
const fetchDashboards = (paging?: string) => { const fetchDashboards = (paging?: string) => {
setIsloading(true); setIsloading(true);
getDashboards(serviceFQN, paging, [ getDashboards(serviceFQN, paging, ['owner', 'usageSummary', 'tags'])
'owner',
'service',
'usageSummary',
'tags',
])
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
if (res.data.data) { if (res.data.data) {
setData(res.data.data); setData(res.data.data);
@ -152,12 +147,7 @@ const ServicePage: FunctionComponent = () => {
const fetchPipeLines = (paging?: string) => { const fetchPipeLines = (paging?: string) => {
setIsloading(true); setIsloading(true);
getPipelines(serviceFQN, paging, [ getPipelines(serviceFQN, paging, ['owner', 'usageSummary', 'tags'])
'owner',
'service',
'usageSummary',
'tags',
])
.then((res: AxiosResponse) => { .then((res: AxiosResponse) => {
if (res.data.data) { if (res.data.data) {
setData(res.data.data); setData(res.data.data);