diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityVersionTimeLine/EntityVersionTimeLine.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityVersionTimeLine/EntityVersionTimeLine.tsx index f133798bfa44..8157416dcbf5 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityVersionTimeLine/EntityVersionTimeLine.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Entity/EntityVersionTimeLine/EntityVersionTimeLine.tsx @@ -17,6 +17,8 @@ import { capitalize, isEmpty, toString } from 'lodash'; import React, { Fragment, useMemo, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { EntityHistory } from '../../../generated/type/entityHistory'; +import { getUserById } from '../../../rest/userAPI'; +import { getEntityName } from '../../../utils/EntityUtils'; import { getSummary, isMajorVersion } from '../../../utils/EntityVersionUtils'; import CloseIcon from '../../Modals/CloseIcon.component'; @@ -36,6 +38,18 @@ const EntityVersionTimeLine: React.FC = ({ }: Props) => { const { t } = useTranslation(); const [versionType] = useState('all'); + const [uname, setUname] = useState(''); + + const fetchUserName = async (id: string) => { + try { + const userData = await getUserById(id, 'displayName'); + + const name: string = getEntityName(userData); + setUname(name); + } catch (err) { + setUname(id); + } + }; const versions = useMemo(() => { let versionTypeList = []; @@ -78,6 +92,11 @@ const EntityVersionTimeLine: React.FC = ({ return versionTypeList.length ? ( versionTypeList.map((v, i) => { const currV = JSON.parse(v); + const userId: string = currV?.updatedBy; + fetchUserName(userId); + { + userId === 'admin' ? setUname('admin') : ' '; + } const majorVersionChecks = () => { return ( isMajorVersion( @@ -142,7 +161,7 @@ const EntityVersionTimeLine: React.FC = ({ })}

- {currV?.updatedBy} + {uname} {' '} {t('label.updated-on')}{' '}