Fixed : UI: rename "dataset" in URL to "table" (#2208)

This commit is contained in:
Sachin Chaurasiya 2022-01-14 14:05:36 +05:30 committed by GitHub
parent afcf725491
commit a6548bf669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 32 additions and 39 deletions

View File

@ -17,7 +17,7 @@ import { EntityTags } from 'Models';
import React, { Fragment, useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import { useExpanded, useTable } from 'react-table';
import { getDatasetDetailsPath } from '../../constants/constants';
import { getTableDetailsPath } from '../../constants/constants';
import {
Column,
ColumnJoins,
@ -536,7 +536,7 @@ const EntityTable = ({
)}
<Link
className="link-text"
to={getDatasetDetailsPath(
to={getTableDetailsPath(
getTableFQNFromColumnFQN(
columnJoin?.fullyQualifiedName as string
),
@ -568,7 +568,7 @@ const EntityTable = ({
<Fragment key={index}>
<a
className="link-text tw-block tw-py-1"
href={getDatasetDetailsPath(
href={getTableDetailsPath(
getTableFQNFromColumnFQN(
columnJoin?.fullyQualifiedName as string
),

View File

@ -13,7 +13,7 @@
import React, { FunctionComponent, useEffect, useState } from 'react';
import { Link, useHistory } from 'react-router-dom';
import { getDatasetDetailsPath } from '../../constants/constants';
import { getTableDetailsPath } from '../../constants/constants';
import { JoinedWith } from '../../generated/entity/data/table';
import { getCountBadge } from '../../utils/CommonUtils';
import PopOver from '../common/popover/PopOver';
@ -53,7 +53,7 @@ const FrequentlyJoinedTables: FunctionComponent<Props> = ({
const [joinedTables, setJoinedTables] = useState<Props['tableList']>([]);
const handleTableClick = (fqn: string) => {
history.push(getDatasetDetailsPath(fqn));
history.push(getTableDetailsPath(fqn));
};
useEffect(() => {
@ -106,7 +106,7 @@ const FrequentlyJoinedTables: FunctionComponent<Props> = ({
key={index}>
<Link
className="link-text"
to={getDatasetDetailsPath(table.fullyQualifiedName as string)}>
to={getTableDetailsPath(table.fullyQualifiedName as string)}>
{table.name}
</Link>
{getCountBadge(table.joinCount, '', false)}

View File

@ -22,7 +22,7 @@ import React, {
useState,
} from 'react';
import { Link } from 'react-router-dom';
import { getDatasetDetailsPath } from '../../constants/constants';
import { getTableDetailsPath } from '../../constants/constants';
import {
Column,
ColumnJoins,
@ -318,7 +318,7 @@ const SchemaTable: FunctionComponent<Props> = ({
)}
<Link
className="link-text"
to={getDatasetDetailsPath(
to={getTableDetailsPath(
getTableFQNFromColumnFQN(
columnJoin?.fullyQualifiedName as string
),
@ -345,7 +345,7 @@ const SchemaTable: FunctionComponent<Props> = ({
<Fragment key={index}>
<a
className="link-text tw-block tw-py-1"
href={getDatasetDetailsPath(
href={getTableDetailsPath(
getTableFQNFromColumnFQN(
columnJoin?.fullyQualifiedName as string
),

View File

@ -43,7 +43,7 @@ const RecentlyViewed: FunctionComponent = () => {
// const oData = recentlyViewedData[i];
try {
switch (oData.entityType) {
case EntityType.DATASET: {
case EntityType.TABLE: {
const res = await getTableDetailsByFQN(
oData.fqn,
'usageSummary, tags, owner,columns'

View File

@ -33,7 +33,7 @@ export const imageTypes = {
export const TOUR_SEARCH_TERM = 'dim_a';
export const ERROR404 = 'No data found';
export const ERROR500 = 'Something went wrong';
const PLACEHOLDER_ROUTE_DATASET_FQN = ':datasetFQN';
const PLACEHOLDER_ROUTE_TABLE_FQN = ':datasetFQN';
const PLACEHOLDER_ROUTE_TOPIC_FQN = ':topicFQN';
const PLACEHOLDER_ROUTE_PIPELINE_FQN = ':pipelineFQN';
const PLACEHOLDER_ROUTE_DASHBOARD_FQN = ':dashboardFQN';
@ -136,8 +136,8 @@ export const ROUTES = {
TAGS: '/tags',
SIGNUP: '/signup',
SIGNIN: '/signin',
DATASET_DETAILS: `/dataset/${PLACEHOLDER_ROUTE_DATASET_FQN}`,
DATASET_DETAILS_WITH_TAB: `/dataset/${PLACEHOLDER_ROUTE_DATASET_FQN}/${PLACEHOLDER_ROUTE_TAB}`,
TABLE_DETAILS: `/table/${PLACEHOLDER_ROUTE_TABLE_FQN}`,
TABLE_DETAILS_WITH_TAB: `/table/${PLACEHOLDER_ROUTE_TABLE_FQN}/${PLACEHOLDER_ROUTE_TAB}`,
ENTITY_VERSION: `/${PLACEHOLDER_ROUTE_ENTITY_TYPE}/${PLACEHOLDER_ROUTE_ENTITY_FQN}/versions/${PLAEHOLDER_ROUTE_VERSION}`,
TOPIC_DETAILS: `/topic/${PLACEHOLDER_ROUTE_TOPIC_FQN}`,
TOPIC_DETAILS_WITH_TAB: `/topic/${PLACEHOLDER_ROUTE_TOPIC_FQN}/${PLACEHOLDER_ROUTE_TAB}`,
@ -155,12 +155,9 @@ export const IN_PAGE_SEARCH_ROUTES: Record<string, Array<string>> = {
'/database/': ['In this Database'],
};
export const getDatasetDetailsPath = (
datasetFQN: string,
columnName?: string
) => {
let path = ROUTES.DATASET_DETAILS;
path = path.replace(PLACEHOLDER_ROUTE_DATASET_FQN, datasetFQN);
export const getTableDetailsPath = (tableFQN: string, columnName?: string) => {
let path = ROUTES.TABLE_DETAILS;
path = path.replace(PLACEHOLDER_ROUTE_TABLE_FQN, tableFQN);
return `${path}${columnName ? `.${columnName}` : ''}`;
};
@ -179,10 +176,10 @@ export const getVersionPath = (
return path;
};
export const getDatasetTabPath = (datasetFQN: string, tab = 'schema') => {
let path = ROUTES.DATASET_DETAILS_WITH_TAB;
export const getTableTabPath = (tableFQN: string, tab = 'schema') => {
let path = ROUTES.TABLE_DETAILS_WITH_TAB;
path = path
.replace(PLACEHOLDER_ROUTE_DATASET_FQN, datasetFQN)
.replace(PLACEHOLDER_ROUTE_TABLE_FQN, tableFQN)
.replace(PLACEHOLDER_ROUTE_TAB, tab);
return path;

View File

@ -386,7 +386,7 @@ declare module 'Models' {
// topic interface end
interface RecentlyViewedData {
entityType: 'dataset' | 'topic' | 'dashboard' | 'pipeline';
entityType: 'table' | 'topic' | 'dashboard' | 'pipeline';
fqn: string;
serviceType?: string;
timestamp: number;

View File

@ -30,9 +30,9 @@ import DatasetDetails from '../../components/DatasetDetails/DatasetDetails.compo
import Loader from '../../components/Loader/Loader';
import {
getDatabaseDetailsPath,
getDatasetTabPath,
getVersionPath,
getServiceDetailsPath,
getTableTabPath,
getVersionPath,
} from '../../constants/constants';
import { EntityType } from '../../enums/entity.enum';
import { ServiceCategory } from '../../enums/service.enum';
@ -115,7 +115,7 @@ const DatasetDetailsPage: FunctionComponent = () => {
getCurrentDatasetTab(datasetTableTabs[currentTabIndex].path)
);
history.push({
pathname: getDatasetTabPath(
pathname: getTableTabPath(
tableFQN,
datasetTableTabs[currentTabIndex].path
),
@ -276,7 +276,7 @@ const DatasetDetailsPage: FunctionComponent = () => {
]);
addToRecentViewed({
entityType: EntityType.DATASET,
entityType: EntityType.TABLE,
fqn: fullyQualifiedName,
serviceType: serviceType,
timestamp: 0,

View File

@ -43,9 +43,9 @@ import TopicVersion from '../../components/TopicVersion/TopicVersion.component';
import {
getDashboardDetailsPath,
getDatabaseDetailsPath,
getDatasetDetailsPath,
getPipelineDetailsPath,
getServiceDetailsPath,
getTableDetailsPath,
getTopicDetailsPath,
getVersionPath,
} from '../../constants/constants';
@ -94,7 +94,7 @@ const EntityVersionPage: FunctionComponent = () => {
const backHandler = () => {
switch (entityType) {
case EntityType.TABLE:
history.push(getDatasetDetailsPath(entityFQN));
history.push(getTableDetailsPath(entityFQN));
break;

View File

@ -36,9 +36,9 @@ import PageContainer from '../../components/containers/PageContainer';
import Loader from '../../components/Loader/Loader';
import Tags from '../../components/tags/tags';
import {
getDatasetDetailsPath,
getExplorePathWithSearch,
getServiceDetailsPath,
getTableDetailsPath,
pagingObject,
} from '../../constants/constants';
import { ServiceCategory } from '../../enums/service.enum';
@ -305,7 +305,7 @@ const DatabaseDetails: FunctionComponent = () => {
<Link
to={
table.fullyQualifiedName
? getDatasetDetailsPath(
? getTableDetailsPath(
table.fullyQualifiedName
)
: ''

View File

@ -54,15 +54,11 @@ const AuthenticatedAppRouter: FunctionComponent = () => {
<Route exact component={SwaggerPage} path={ROUTES.SWAGGER} />
<Route exact component={TagsPage} path={ROUTES.TAGS} />
<Route component={DatabaseDetails} path={ROUTES.DATABASE_DETAILS} />
<Route exact component={DatasetDetailsPage} path={ROUTES.TABLE_DETAILS} />
<Route
exact
component={DatasetDetailsPage}
path={ROUTES.DATASET_DETAILS}
/>
<Route
exact
component={DatasetDetailsPage}
path={ROUTES.DATASET_DETAILS_WITH_TAB}
path={ROUTES.TABLE_DETAILS_WITH_TAB}
/>
<Route exact component={TopicDetailsPage} path={ROUTES.TOPIC_DETAILS} />
<Route

View File

@ -18,8 +18,8 @@ import AppState from '../AppState';
import PopOver from '../components/common/popover/PopOver';
import {
getDashboardDetailsPath,
getDatasetDetailsPath,
getPipelineDetailsPath,
getTableDetailsPath,
getTopicDetailsPath,
} from '../constants/constants';
import { EntityType } from '../enums/entity.enum';
@ -206,7 +206,7 @@ export const getEntityLink = (
case SearchIndex.TABLE:
case EntityType.TABLE:
default:
return getDatasetDetailsPath(fullyQualifiedName);
return getTableDetailsPath(fullyQualifiedName);
}
};