ISSUE : fix teams page breaking issue (#17268)

* fix teams page breaking issue

* minor changes

* unpushed file

---------

Co-authored-by: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com>
This commit is contained in:
Ashish Gupta 2024-08-02 22:46:51 +05:30 committed by GitHub
parent 84083aef4a
commit dd8158552c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 16 additions and 23 deletions

View File

@ -15,7 +15,7 @@ import { uuid } from './common';
export const createTeam = async (page: Page, isPublic?: boolean) => { export const createTeam = async (page: Page, isPublic?: boolean) => {
const teamData = { const teamData = {
name: `pwteam-${uuid()}`, name: `pw%team-${uuid()}`,
displayName: `PW ${uuid()}`, displayName: `PW ${uuid()}`,
email: `pwteam${uuid()}@example.com`, email: `pwteam${uuid()}@example.com`,
description: 'This is a PW team', description: 'This is a PW team',

View File

@ -207,7 +207,6 @@ const TeamsInfo = ({
className="toolbar-button align-middle" className="toolbar-button align-middle"
component={EditIcon} component={EditIcon}
data-testid="edit-email" data-testid="edit-email"
style={{ fontSize: '16px' }}
onClick={(e) => { onClick={(e) => {
// Used to stop click propagation event to parent TeamDetailV1 collapsible panel // Used to stop click propagation event to parent TeamDetailV1 collapsible panel
e.stopPropagation(); e.stopPropagation();
@ -252,21 +251,18 @@ const TeamsInfo = ({
{hasEditPermission && ( {hasEditPermission && (
<Tooltip <Tooltip
title={t('label.edit-entity', { title={
entity: t('label.team-type'), isGroupType
})}> ? t('message.group-team-type-change-message')
: t('label.edit-entity', {
entity: t('label.team-type'),
})
}>
<Icon <Icon
className={classNames('vertical-middle m-l-xs', { className={classNames('align-middle m-l-xss', {
'opacity-50': isGroupType, 'opacity-30': isGroupType,
})} })}
data-testid="edit-team-type-icon" data-testid="edit-team-type-icon"
title={
isGroupType
? t('message.group-team-type-change-message')
: t('label.edit-entity', {
entity: t('label.team-type'),
})
}
onClick={(e) => { onClick={(e) => {
// Used to stop click propagation event to parent TeamDetailV1 collapsible panel // Used to stop click propagation event to parent TeamDetailV1 collapsible panel
e.stopPropagation(); e.stopPropagation();

View File

@ -49,7 +49,6 @@ import { getUsers } from '../../../../../rest/userAPI';
import { formatUsersResponse } from '../../../../../utils/APIUtils'; import { formatUsersResponse } from '../../../../../utils/APIUtils';
import { getEntityName } from '../../../../../utils/EntityUtils'; import { getEntityName } from '../../../../../utils/EntityUtils';
import { getSettingsPathWithFqn } from '../../../../../utils/RouterUtils'; import { getSettingsPathWithFqn } from '../../../../../utils/RouterUtils';
import { getDecodedFqn } from '../../../../../utils/StringsUtils';
import { commonUserDetailColumns } from '../../../../../utils/Users.util'; import { commonUserDetailColumns } from '../../../../../utils/Users.util';
import ManageButton from '../../../../common/EntityPageInfos/ManageButton/ManageButton'; import ManageButton from '../../../../common/EntityPageInfos/ManageButton/ManageButton';
import ErrorPlaceHolder from '../../../../common/ErrorWithPlaceholder/ErrorPlaceHolder'; import ErrorPlaceHolder from '../../../../common/ErrorWithPlaceholder/ErrorPlaceHolder';
@ -99,7 +98,7 @@ export const UserTab = ({
getUsers({ getUsers({
fields: `${TabSpecificField.TEAMS},${TabSpecificField.ROLES}`, fields: `${TabSpecificField.TEAMS},${TabSpecificField.ROLES}`,
limit: pageSize, limit: pageSize,
team: getDecodedFqn(team), team,
...paging, ...paging,
}) })
.then((res) => { .then((res) => {

View File

@ -68,10 +68,6 @@ jest.mock('../../utils/ToastUtils', () => ({
showErrorToast: jest.fn(), showErrorToast: jest.fn(),
})); }));
jest.mock('../../utils/StringsUtils', () => ({
getDecodedFqn: jest.fn(),
}));
jest.mock('../../utils/RouterUtils', () => ({ jest.mock('../../utils/RouterUtils', () => ({
getTeamsWithFqnPath: jest.fn(), getTeamsWithFqnPath: jest.fn(),
})); }));

View File

@ -48,7 +48,6 @@ import { updateUserDetail } from '../../rest/userAPI';
import { getEntityReferenceFromEntity } from '../../utils/EntityUtils'; import { getEntityReferenceFromEntity } from '../../utils/EntityUtils';
import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils'; import { DEFAULT_ENTITY_PERMISSION } from '../../utils/PermissionsUtils';
import { getTeamsWithFqnPath } from '../../utils/RouterUtils'; import { getTeamsWithFqnPath } from '../../utils/RouterUtils';
import { getDecodedFqn } from '../../utils/StringsUtils';
import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils'; import { showErrorToast, showSuccessToast } from '../../utils/ToastUtils';
import AddTeamForm from './AddTeamForm'; import AddTeamForm from './AddTeamForm';
@ -112,7 +111,7 @@ const TeamsPage = () => {
const fetchAllTeamsBasicDetails = async (parentTeam?: string) => { const fetchAllTeamsBasicDetails = async (parentTeam?: string) => {
try { try {
const { data } = await getTeams({ const { data } = await getTeams({
parentTeam: getDecodedFqn(parentTeam ?? '') ?? 'organization', parentTeam: parentTeam ?? 'organization',
include: Include.All, include: Include.All,
}); });
@ -138,7 +137,7 @@ const TeamsPage = () => {
try { try {
const { data } = await getTeams({ const { data } = await getTeams({
parentTeam: getDecodedFqn(parentTeam ?? '') ?? 'organization', parentTeam: parentTeam ?? 'organization',
include: Include.All, include: Include.All,
fields: [ fields: [
TabSpecificField.USER_COUNT, TabSpecificField.USER_COUNT,

View File

@ -413,6 +413,9 @@ a[href].link-text-grey,
.opacity-0 { .opacity-0 {
opacity: 0; opacity: 0;
} }
.opacity-30 {
opacity: 0.3;
}
.opacity-50 { .opacity-50 {
opacity: 0.5; opacity: 0.5;
} }