Fix(uI) : Removed collapse button from teams page (#21306)

* removed collapse button from teams page

* removed unwated spacing

* addressed comment

* fixed playwright tests

---------

Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com>
This commit is contained in:
Dhruv Parmar 2025-05-21 20:08:12 +05:30 committed by GitHub
parent d5d9a146af
commit f9f438fa09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 22 additions and 44 deletions

View File

@ -283,8 +283,6 @@ test.describe('Teams Page', () => {
teamDetails.updatedName
);
await page.locator('[role="tablist"] [data-icon="right"]').click();
// Click on edit description button
await page.locator('[data-testid="edit-description"]').click();
await page.waitForLoadState('domcontentloaded');

View File

@ -11,12 +11,11 @@
* limitations under the License.
*/
import { DownOutlined, PlusOutlined, RightOutlined } from '@ant-design/icons';
import { PlusOutlined } from '@ant-design/icons';
import {
Avatar,
Button,
Col,
Collapse,
Modal,
Row,
Space,
@ -911,6 +910,12 @@ const TeamDetailsV1 = ({
]
);
const editDescriptionPermission = useMemo(
() =>
(entityPermissions.EditAll || entityPermissions.EditDescription) &&
!isTeamDeleted,
[entityPermissions, isTeamDeleted]
);
const teamsCollapseHeader = useMemo(
() => (
<>
@ -983,6 +988,17 @@ const TeamDetailsV1 = ({
updateTeamHandler={updateTeamHandler}
/>
</div>
<div className="m-t-md">
<DescriptionV1
wrapInCard
description={currentTeam.description ?? ''}
entityName={getEntityName(currentTeam)}
entityType={EntityType.TEAM}
hasEditAccess={editDescriptionPermission}
showCommentsIcon={false}
onDescriptionUpdate={onDescriptionUpdate}
/>
</div>
</>
),
[
@ -999,6 +1015,8 @@ const TeamDetailsV1 = ({
updateTeamHandler,
afterDeleteAction,
getDeleteMessagePostFix,
editDescriptionPermission,
onDescriptionUpdate,
]
);
@ -1077,13 +1095,6 @@ const TeamDetailsV1 = ({
]
);
const editDescriptionPermission = useMemo(
() =>
(entityPermissions.EditDescription || entityPermissions.EditAll) &&
!isTeamDeleted,
[entityPermissions, isTeamDeleted]
);
if (isTeamMemberLoading > 0) {
return <Loader />;
}
@ -1108,39 +1119,9 @@ const TeamDetailsV1 = ({
<Col
className="teams-profile-container"
data-testid="team-detail-header"
data-testid="team-details-collapse"
span={24}>
<Collapse
accordion
bordered={false}
className="header-collapse-custom-collapse"
expandIcon={({ isActive }) => (
<span
className={classNames('ant-collapse-arrow', {
'arrow-icon-non-organization': !isOrganization,
})}>
{isActive ? <DownOutlined /> : <RightOutlined />}
</span>
)}
expandIconPosition="end">
<Collapse.Panel
className={classNames('collapse-panel-container', {
'm-t-sm': !isOrganization,
})}
data-testid="team-details-collapse"
header={teamsCollapseHeader}
key="1">
<DescriptionV1
wrapInCard
description={currentTeam.description ?? ''}
entityName={getEntityName(currentTeam)}
entityType={EntityType.TEAM}
hasEditAccess={editDescriptionPermission}
showCommentsIcon={false}
onDescriptionUpdate={onDescriptionUpdate}
/>
</Collapse.Panel>
</Collapse>
{teamsCollapseHeader}
</Col>
<Col className="m-t-sm" span={24}>

View File

@ -85,7 +85,6 @@
}
.teams-profile-container {
background: @user-profile-background;
.collapse-panel-container {
padding: 20px;
}