mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-03 03:59:12 +00:00
Adding feed data for column changes. (#1929)
* Adding feed data for column changes. * Fixed FQN issue for lineage API call. * Minor fix.
This commit is contained in:
parent
431f47fb3c
commit
5f479fb1c6
@ -69,6 +69,7 @@ const MyData: React.FC<MyDataProps> = ({
|
|||||||
className="tw-underline"
|
className="tw-underline"
|
||||||
data-testid="feeds"
|
data-testid="feeds"
|
||||||
size="custom"
|
size="custom"
|
||||||
|
tag="button"
|
||||||
theme="primary"
|
theme="primary"
|
||||||
variant="link"
|
variant="link"
|
||||||
onClick={() => setFieldListVisible((visible) => !visible)}>
|
onClick={() => setFieldListVisible((visible) => !visible)}>
|
||||||
@ -171,7 +172,7 @@ const MyData: React.FC<MyDataProps> = ({
|
|||||||
.map((d) => {
|
.map((d) => {
|
||||||
return (
|
return (
|
||||||
d.changeDescriptions
|
d.changeDescriptions
|
||||||
.filter(
|
?.filter(
|
||||||
(c) =>
|
(c) =>
|
||||||
c.fieldsAdded?.length ||
|
c.fieldsAdded?.length ||
|
||||||
c.fieldsDeleted?.length ||
|
c.fieldsDeleted?.length ||
|
||||||
|
|||||||
@ -89,7 +89,7 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
});
|
});
|
||||||
const [tableProfile, setTableProfile] = useState<Table['tableProfile']>([]);
|
const [tableProfile, setTableProfile] = useState<Table['tableProfile']>([]);
|
||||||
const [tableDetails, setTableDetails] = useState<Table>({} as Table);
|
const [tableDetails, setTableDetails] = useState<Table>({} as Table);
|
||||||
const { datasetFQN: tableFQN, tab } = useParams() as Record<string, string>;
|
const { datasetFQN, tab } = useParams() as Record<string, string>;
|
||||||
const [activeTab, setActiveTab] = useState<number>(getCurrentDatasetTab(tab));
|
const [activeTab, setActiveTab] = useState<number>(getCurrentDatasetTab(tab));
|
||||||
const [entityLineage, setEntityLineage] = useState<EntityLineage>(
|
const [entityLineage, setEntityLineage] = useState<EntityLineage>(
|
||||||
{} as EntityLineage
|
{} as EntityLineage
|
||||||
@ -104,6 +104,9 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
id: undefined,
|
id: undefined,
|
||||||
state: false,
|
state: false,
|
||||||
});
|
});
|
||||||
|
const [tableFQN, setTableFQN] = useState<string>(
|
||||||
|
getPartialNameFromFQN(datasetFQN, ['service', 'database', 'table'], '.')
|
||||||
|
);
|
||||||
|
|
||||||
const activeTabHandler = (tabValue: number) => {
|
const activeTabHandler = (tabValue: number) => {
|
||||||
const currentTabIndex = tabValue - 1;
|
const currentTabIndex = tabValue - 1;
|
||||||
@ -221,7 +224,7 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
getTableDetailsByFQN(
|
getTableDetailsByFQN(
|
||||||
getPartialNameFromFQN(tableFQN, ['service', 'database', 'table'], '.'),
|
tableFQN,
|
||||||
'columns, usageSummary, followers, joins, tags, owner, sampleData, tableProfile, dataModel'
|
'columns, usageSummary, followers, joins, tags, owner, sampleData, tableProfile, dataModel'
|
||||||
)
|
)
|
||||||
.then((res: AxiosResponse) => {
|
.then((res: AxiosResponse) => {
|
||||||
@ -302,6 +305,12 @@ const DatasetDetailsPage: FunctionComponent = () => {
|
|||||||
setActiveTab(getCurrentDatasetTab(tab));
|
setActiveTab(getCurrentDatasetTab(tab));
|
||||||
}, [tableFQN]);
|
}, [tableFQN]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setTableFQN(
|
||||||
|
getPartialNameFromFQN(datasetFQN, ['service', 'database', 'table'], '.')
|
||||||
|
);
|
||||||
|
}, [datasetFQN]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isLoading || isLineageLoading ? (
|
{isLoading || isLineageLoading ? (
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import rehypeRaw from 'rehype-raw';
|
|||||||
import gfm from 'remark-gfm';
|
import gfm from 'remark-gfm';
|
||||||
import { DESCRIPTIONLENGTH, getTeamDetailsPath } from '../constants/constants';
|
import { DESCRIPTIONLENGTH, getTeamDetailsPath } from '../constants/constants';
|
||||||
import { ChangeType } from '../enums/entity.enum';
|
import { ChangeType } from '../enums/entity.enum';
|
||||||
|
import { Column } from '../generated/entity/data/table';
|
||||||
import {
|
import {
|
||||||
ChangeDescription,
|
ChangeDescription,
|
||||||
FieldChange,
|
FieldChange,
|
||||||
@ -192,17 +193,17 @@ export const getPreposition = (type: ChangeType) => {
|
|||||||
|
|
||||||
const getColumnName = (column: string) => {
|
const getColumnName = (column: string) => {
|
||||||
const name = column.split('.');
|
const name = column.split('.');
|
||||||
return name.slice(1, name.length - 1).join('.');
|
const length = name.length;
|
||||||
|
return name
|
||||||
|
.slice(length > 1 ? 1 : 0, length > 1 ? length - 1 : length)
|
||||||
|
.join('.');
|
||||||
};
|
};
|
||||||
|
|
||||||
const getLinkWithColumn = (column: string, eFqn: string, eType: string) => {
|
const getLinkWithColumn = (column: string, eFqn: string, eType: string) => {
|
||||||
const name = column.split('.');
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
className="tw-pl-1"
|
className="tw-pl-1"
|
||||||
to={`${getEntityLink(eType, eFqn)}.${name
|
to={`${getEntityLink(eType, eFqn)}.${getColumnName(column)}`}>
|
||||||
.slice(1, name.length - 1)
|
|
||||||
.join('.')}`}>
|
|
||||||
{getColumnName(column)}
|
{getColumnName(column)}
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
@ -301,6 +302,21 @@ export const feedSummaryFromatter = (
|
|||||||
</p>
|
</p>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else if (fieldChange?.name === 'columns') {
|
||||||
|
const length = value?.length ?? 0;
|
||||||
|
summary = (
|
||||||
|
<p key={uniqueId()}>
|
||||||
|
{`${type} ${fieldChange?.name}`}{' '}
|
||||||
|
{value?.map((column: Column, i: number) => (
|
||||||
|
<span key={uniqueId()}>
|
||||||
|
{getLinkWithColumn(column.name, entityFQN, entityType)}{' '}
|
||||||
|
{i !== length - 1 ? ', ' : ''}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
</p>
|
||||||
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
summary = (
|
summary = (
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user