mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-18 20:30:48 +00:00
fix(ui): hide email if not present in the data (#15927)
This commit is contained in:
parent
6c44308ba4
commit
f4ebfbbfc6
@ -223,19 +223,25 @@ const UserProfileDetails = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const userEmailRender = useMemo(
|
const userEmailRender = useMemo(
|
||||||
() => (
|
() =>
|
||||||
<Space align="center">
|
userData.email && (
|
||||||
<Typography.Text
|
<>
|
||||||
className="text-grey-muted"
|
<Space align="center">
|
||||||
data-testid="user-email-label">{`${t(
|
<Typography.Text
|
||||||
'label.email'
|
className="text-grey-muted"
|
||||||
)} :`}</Typography.Text>
|
data-testid="user-email-label">{`${t(
|
||||||
|
'label.email'
|
||||||
|
)} :`}</Typography.Text>
|
||||||
|
|
||||||
<Typography.Paragraph className="m-b-0" data-testid="user-email-value">
|
<Typography.Paragraph
|
||||||
{userData.email}
|
className="m-b-0"
|
||||||
</Typography.Paragraph>
|
data-testid="user-email-value">
|
||||||
</Space>
|
{userData.email}
|
||||||
),
|
</Typography.Paragraph>
|
||||||
|
</Space>
|
||||||
|
<Divider type="vertical" />
|
||||||
|
</>
|
||||||
|
),
|
||||||
[userData.email]
|
[userData.email]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -263,4 +263,20 @@ describe('Test User Profile Details Component', () => {
|
|||||||
'defaultPersona'
|
'defaultPersona'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not render if not present', async () => {
|
||||||
|
render(
|
||||||
|
<UserProfileDetails
|
||||||
|
{...mockPropsData}
|
||||||
|
userData={{ ...USER_DATA, email: '' }}
|
||||||
|
/>,
|
||||||
|
{
|
||||||
|
wrapper: MemoryRouter,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// user email
|
||||||
|
expect(screen.queryByTestId('user-email-label')).not.toBeInTheDocument();
|
||||||
|
expect(screen.queryByTestId('user-email-value')).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user