Fix: #2938 Remove serviceType from service UI route (#2939)

This commit is contained in:
Sachin Chaurasiya 2022-03-01 01:11:26 +05:30 committed by GitHub
parent 00552f6d36
commit 22393c279a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 10 additions and 31 deletions

View File

@ -40,7 +40,6 @@ const PLACEHOLDER_ROUTE_PIPELINE_FQN = ':pipelineFQN';
const PLACEHOLDER_ROUTE_DASHBOARD_FQN = ':dashboardFQN';
const PLACEHOLDER_ROUTE_DATABASE_FQN = ':databaseFQN';
const PLACEHOLDER_ROUTE_SERVICE_FQN = ':serviceFQN';
const PLACEHOLDER_ROUTE_SERVICE_TYPE = ':serviceType';
const PLACEHOLDER_ROUTE_SERVICE_CAT = ':serviceCategory';
const PLACEHOLDER_ROUTE_SEARCHQUERY = ':searchQuery';
const PLACEHOLDER_ROUTE_TAB = ':tab';
@ -132,8 +131,8 @@ export const ROUTES = {
STORE: '/store',
FEEDS: '/feeds',
DUMMY: '/dummy',
SERVICE: `/service/${PLACEHOLDER_ROUTE_SERVICE_CAT}/${PLACEHOLDER_ROUTE_SERVICE_TYPE}/${PLACEHOLDER_ROUTE_SERVICE_FQN}`,
SERVICE_WITH_TAB: `/service/${PLACEHOLDER_ROUTE_SERVICE_CAT}/${PLACEHOLDER_ROUTE_SERVICE_TYPE}/${PLACEHOLDER_ROUTE_SERVICE_FQN}/${PLACEHOLDER_ROUTE_TAB}`,
SERVICE: `/service/${PLACEHOLDER_ROUTE_SERVICE_CAT}/${PLACEHOLDER_ROUTE_SERVICE_FQN}`,
SERVICE_WITH_TAB: `/service/${PLACEHOLDER_ROUTE_SERVICE_CAT}/${PLACEHOLDER_ROUTE_SERVICE_FQN}/${PLACEHOLDER_ROUTE_TAB}`,
SERVICES: '/services',
USERS: '/users',
SCORECARD: '/scorecard',
@ -195,14 +194,12 @@ export const getTableTabPath = (tableFQN: string, tab = 'schema') => {
export const getServiceDetailsPath = (
serviceFQN: string,
serviceType: string,
serviceCat: string,
tab?: string
) => {
let path = tab ? ROUTES.SERVICE_WITH_TAB : ROUTES.SERVICE;
path = path
.replace(PLACEHOLDER_ROUTE_SERVICE_CAT, serviceCat)
.replace(PLACEHOLDER_ROUTE_SERVICE_TYPE, serviceType)
.replace(PLACEHOLDER_ROUTE_SERVICE_FQN, serviceFQN);
if (tab) {

View File

@ -247,7 +247,6 @@ const DashboardDetailsPage = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.DASHBOARD_SERVICES
)
: '',

View File

@ -198,7 +198,6 @@ const DatasetDetailsPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.DATABASE_SERVICES
)
: '',

View File

@ -155,15 +155,14 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.DATABASE_SERVICES
)
: '',
imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
},
{
name: database.name,
url: getDatabaseDetailsPath(database.fullyQualifiedName),
name: getPartialNameFromFQN(database.name, ['database']),
url: getDatabaseDetailsPath(database.name),
},
{
name: name,
@ -208,7 +207,6 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.MESSAGING_SERVICES
)
: '',
@ -258,8 +256,7 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.MESSAGING_SERVICES
ServiceCategory.DASHBOARD_SERVICES
)
: '',
imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
@ -308,8 +305,7 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.MESSAGING_SERVICES
ServiceCategory.PIPELINE_SERVICES
)
: '',
imgSrc: serviceType ? serviceTypeLogo(serviceType) : undefined,
@ -372,7 +368,6 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.DATABASE_SERVICES
)
: '',
@ -381,8 +376,8 @@ const EntityVersionPage: FunctionComponent = () => {
: undefined,
},
{
name: database.name,
url: getDatabaseDetailsPath(database.fullyQualifiedName),
name: getPartialNameFromFQN(database.name, ['database']),
url: getDatabaseDetailsPath(database.name),
},
{
name: name,
@ -429,7 +424,6 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.MESSAGING_SERVICES
)
: '',
@ -481,8 +475,7 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.MESSAGING_SERVICES
ServiceCategory.DASHBOARD_SERVICES
)
: '',
imgSrc: serviceType
@ -533,8 +526,7 @@ const EntityVersionPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.MESSAGING_SERVICES
ServiceCategory.PIPELINE_SERVICES
)
: '',
imgSrc: serviceType

View File

@ -197,7 +197,6 @@ const PipelineDetailsPage = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.PIPELINE_SERVICES
)
: '',

View File

@ -157,7 +157,6 @@ const TopicDetailsPage: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.MESSAGING_SERVICES
)
: '',

View File

@ -181,7 +181,6 @@ const DatabaseDetails: FunctionComponent = () => {
url: service.name
? getServiceDetailsPath(
service.name,
serviceType,
ServiceCategory.DATABASE_SERVICES
)
: '',

View File

@ -209,7 +209,6 @@ const ServicePage: FunctionComponent = () => {
history.push({
pathname: getServiceDetailsPath(
serviceFQN,
serviceType,
serviceCategory,
servicePageTabs(getCountLabel())[currentTabIndex].path
),

View File

@ -535,7 +535,6 @@ const ServicesPage = () => {
<Link
to={getServiceDetailsPath(
service.name,
service.serviceType || '',
serviceName
)}>
<button>

View File

@ -104,7 +104,6 @@ export const getEntityOverview = (
value: service,
url: getServiceDetailsPath(
service,
serviceType,
ServiceCategory.DATABASE_SERVICES
),
isLink: true,
@ -195,7 +194,6 @@ export const getEntityOverview = (
value: service?.name as string,
url: getServiceDetailsPath(
service?.name as string,
serviceType,
ServiceCategory.PIPELINE_SERVICES
),
isLink: true,
@ -238,7 +236,6 @@ export const getEntityOverview = (
value: service?.name as string,
url: getServiceDetailsPath(
service?.name as string,
serviceType,
ServiceCategory.DASHBOARD_SERVICES
),
isLink: true,