mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-13 00:22:23 +00:00
Fix(UI): Loader not shown while fetching permissions on teams page (#7882)
* Fixed issue with no permissions placeholder showing before the data is displayed on teams page * Fixed failing cypress tests for teams page
This commit is contained in:
parent
ba37fda0f1
commit
1e00d0d487
@ -67,9 +67,12 @@ describe('Teams flow should work properly', () => {
|
||||
});
|
||||
|
||||
it('Add user to created team', () => {
|
||||
interceptURL('GET', '/api/v1/users*', 'getUsers');
|
||||
|
||||
//Click on created team
|
||||
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
||||
|
||||
verifyResponseStatusCode('@getUsers', 200);
|
||||
//Clicking on users tab
|
||||
cy.get('[data-testid="Users"]')
|
||||
.should('exist')
|
||||
@ -140,9 +143,12 @@ describe('Teams flow should work properly', () => {
|
||||
});
|
||||
|
||||
it('Join team should work properly', () => {
|
||||
interceptURL('GET', '/api/v1/users*', 'getUsers');
|
||||
//Click on created team
|
||||
cy.get('table').find('.ant-table-row').contains(TEAM_DETAILS.name).click();
|
||||
|
||||
verifyResponseStatusCode('@getUsers', 200);
|
||||
|
||||
//Click on join teams button
|
||||
cy.get('[data-testid="join-teams"]').should('be.visible').click();
|
||||
|
||||
|
||||
@ -163,6 +163,7 @@ const TeamDetailsV1 = ({
|
||||
TitleBreadcrumbProps['titleLinks']
|
||||
>([]);
|
||||
const [addAttribute, setAddAttribute] = useState<AddAttribute>();
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
const [selectedEntity, setEntity] = useState<{
|
||||
attribute: 'defaultRoles' | 'policies';
|
||||
record: EntityReference;
|
||||
@ -491,6 +492,7 @@ const TeamDetailsV1 = ({
|
||||
};
|
||||
|
||||
const fetchPermissions = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const perms = await getEntityPermission(
|
||||
ResourceEntity.TEAM,
|
||||
@ -502,6 +504,8 @@ const TeamDetailsV1 = ({
|
||||
error as AxiosError,
|
||||
jsonData['api-error-messages']['fetch-user-permission-error']
|
||||
);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
@ -859,6 +863,10 @@ const TeamDetailsV1 = ({
|
||||
const viewPermission =
|
||||
entityPermissions.ViewAll || entityPermissions.ViewBasic;
|
||||
|
||||
if (loading) {
|
||||
return <Loader />;
|
||||
}
|
||||
|
||||
return viewPermission ? (
|
||||
<div
|
||||
className="tw-h-full tw-flex tw-flex-col tw-flex-grow"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user