mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-25 17:37:57 +00:00
Fix: issue 5645: UI feedback 0.11 (#5853)
This commit is contained in:
parent
111106312d
commit
152f757384
@ -40,6 +40,7 @@ import { useAuth } from '../../hooks/authHooks';
|
|||||||
import jsonData from '../../jsons/en';
|
import jsonData from '../../jsons/en';
|
||||||
import {
|
import {
|
||||||
addToRecentSearched,
|
addToRecentSearched,
|
||||||
|
getEntityName,
|
||||||
getNonDeletedTeams,
|
getNonDeletedTeams,
|
||||||
} from '../../utils/CommonUtils';
|
} from '../../utils/CommonUtils';
|
||||||
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
import SVGIcons, { Icons } from '../../utils/SvgUtils';
|
||||||
@ -145,6 +146,20 @@ const Appbar: React.FC = (): JSX.Element => {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const getUsersRoles = (userRoleArr: string[], name: string) => {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<div className="tw-text-grey-muted tw-text-xs">{name}</div>
|
||||||
|
{userRoleArr.map((userRole, i) => (
|
||||||
|
<p className="tw-font-medium" key={i}>
|
||||||
|
{userRole}
|
||||||
|
</p>
|
||||||
|
))}
|
||||||
|
<hr className="tw-my-1.5" />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const getUserName = () => {
|
const getUserName = () => {
|
||||||
const currentUser = isAuthDisabled
|
const currentUser = isAuthDisabled
|
||||||
? appState.nonSecureUserDetails
|
? appState.nonSecureUserDetails
|
||||||
@ -175,9 +190,9 @@ const Appbar: React.FC = (): JSX.Element => {
|
|||||||
|
|
||||||
const name = currentUser?.displayName || currentUser?.name || TERM_USER;
|
const name = currentUser?.displayName || currentUser?.name || TERM_USER;
|
||||||
|
|
||||||
const roles = currentUser?.roles?.map((r) => r.displayName) || [];
|
const roles = currentUser?.roles?.map((r) => getEntityName(r)) || [];
|
||||||
const inheritedRoles =
|
const inheritedRoles =
|
||||||
currentUser?.inheritedRoles?.map((r) => r.displayName) || [];
|
currentUser?.inheritedRoles?.map((r) => getEntityName(r)) || [];
|
||||||
|
|
||||||
currentUser?.isAdmin && roles.unshift(TERM_ADMIN);
|
currentUser?.isAdmin && roles.unshift(TERM_ADMIN);
|
||||||
|
|
||||||
@ -190,31 +205,13 @@ const Appbar: React.FC = (): JSX.Element => {
|
|||||||
<span className="tw-font-medium tw-cursor-pointer">{name}</span>
|
<span className="tw-font-medium tw-cursor-pointer">{name}</span>
|
||||||
</Link>
|
</Link>
|
||||||
<hr className="tw-my-1.5" />
|
<hr className="tw-my-1.5" />
|
||||||
{roles.length > 0 ? (
|
{roles.length > 0 ? getUsersRoles(roles, 'Roles') : null}
|
||||||
<div>
|
{inheritedRoles.length > 0
|
||||||
<div className="tw-font-medium tw-text-xs">Roles</div>
|
? getUsersRoles(inheritedRoles, 'Inherited Roles')
|
||||||
{roles.map((r, i) => (
|
: null}
|
||||||
<p className="tw-text-grey-muted" key={i}>
|
|
||||||
{r}
|
|
||||||
</p>
|
|
||||||
))}
|
|
||||||
<hr className="tw-my-1.5" />
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
{inheritedRoles.length > 0 ? (
|
|
||||||
<div>
|
|
||||||
<div className="tw-font-medium tw-text-xs">Inherited Roles</div>
|
|
||||||
{inheritedRoles.map((inheritedRole, i) => (
|
|
||||||
<p className="tw-text-grey-muted" key={i}>
|
|
||||||
{inheritedRole}
|
|
||||||
</p>
|
|
||||||
))}
|
|
||||||
<hr className="tw-my-1.5" />
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
{teams.length > 0 ? (
|
{teams.length > 0 ? (
|
||||||
<div>
|
<div>
|
||||||
<span className="tw-font-medium tw-text-xs">Teams</span>
|
<span className="tw-text-grey-muted tw-text-xs">Teams</span>
|
||||||
{teams.map((t, i) => (
|
{teams.map((t, i) => (
|
||||||
<p key={i}>
|
<p key={i}>
|
||||||
<Link to={getTeamAndUserDetailsPath(t.name as string)}>
|
<Link to={getTeamAndUserDetailsPath(t.name as string)}>
|
||||||
|
@ -200,7 +200,7 @@ const EntityPageInfo = ({
|
|||||||
)}>
|
)}>
|
||||||
<button
|
<button
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'tw-text-xs tw-border-r tw-font-medium tw-py-1 tw-px-2 tw-rounded-l focus:tw-outline-none tw-self-center',
|
'tw-text-xs tw-border-r tw-font-medium tw-py-1 tw-px-2 tw-rounded-l focus:tw-outline-none tw-self-center tw-h-full tw-flex tw-items-center',
|
||||||
!isUndefined(isVersionSelected)
|
!isUndefined(isVersionSelected)
|
||||||
? 'tw-border-white'
|
? 'tw-border-white'
|
||||||
: 'tw-border-primary'
|
: 'tw-border-primary'
|
||||||
@ -214,7 +214,7 @@ const EntityPageInfo = ({
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<span
|
<span
|
||||||
className="tw-text-xs tw-border-l-0 tw-font-medium tw-py-1 tw-px-2 tw-rounded-r tw-cursor-pointer hover:tw-underline"
|
className="tw-text-xs tw-border-l-0 tw-font-medium tw-p-2 tw-rounded-r tw-cursor-pointer hover:tw-underline tw-flex tw-self-center"
|
||||||
data-testid="version-value">
|
data-testid="version-value">
|
||||||
{parseFloat(version).toFixed(1)}
|
{parseFloat(version).toFixed(1)}
|
||||||
</span>
|
</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user