Skip to content

Commit

Permalink
Remove team column in team details page
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish8689 committed Aug 11, 2024
1 parent eb3cdda commit 08cb809
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const UserTab = ({
const getCurrentTeamUsers = (team: string, paging: Partial<Paging> = {}) => {
setIsLoading(true);
getUsers({
fields: `${TabSpecificField.TEAMS},${TabSpecificField.ROLES}`,
fields: `${TabSpecificField.ROLES}`,
limit: pageSize,
team,
...paging,
Expand Down Expand Up @@ -182,7 +182,8 @@ export const UserTab = ({

const columns: ColumnsType<User> = useMemo(() => {
const tabColumns: ColumnsType<User> = [
...commonUserDetailColumns(),
// will not show teams column in the Team Page
...commonUserDetailColumns().filter((item) => item.key !== 'teams'),
{
title: t('label.action-plural'),
dataIndex: 'actions',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ jest.mock(
);

jest.mock('../../../../../utils/Users.util', () => ({
commonUserDetailColumns: jest.fn().mockImplementation(() => []),
commonUserDetailColumns: jest.fn().mockImplementation(() => [
{ title: 'label.users', dataIndex: 'users' },
{
title: 'label.team-plural',
dataIndex: 'teams',
key: 'teams',
},
]),
}));

jest.mock('../../../../../rest/userAPI', () => ({
Expand All @@ -75,8 +82,11 @@ describe('UserTab', () => {
</BrowserRouter>
);

expect(getUsers).toHaveBeenCalled();
// expect(await screen.findByRole('table')).toBeInTheDocument();
expect(getUsers).toHaveBeenCalledWith({
fields: 'roles',
limit: 25,
team: 'Marketing',
});
expect(
await screen.findByTestId('user-selectable-list')
).toBeInTheDocument();
Expand Down Expand Up @@ -107,6 +117,8 @@ describe('UserTab', () => {
);

expect(screen.queryByRole('table')).toBeInTheDocument();
expect(screen.getByText('label.users')).toBeInTheDocument();
expect(screen.queryByText('label.team-plural')).not.toBeInTheDocument();
expect(
await screen.findByTestId('user-selectable-list')
).toBeInTheDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import { getRoleWithFqnPath, getTeamsWithFqnPath } from './RouterUtils';

export const userCellRenderer = (user: EntityReference | User) => {
return user.name ? (
<UserPopOverCard showUserName profileWidth={16} userName={user.name} />
<div className="w-fit-content">
<UserPopOverCard showUserName profileWidth={16} userName={user.name} />
</div>
) : (
getEntityName(user)
);
Expand Down

0 comments on commit 08cb809

Please sign in to comment.