Skip to content

Commit 2bf9a84

Browse files
committed
Replaced the generic Projects component with the new TeamLinkedProjects component
remove project list api call and implemnt on `TeamLinkedProjects` Pass `viewAllEndpoint` and `canUserEditTeam` value as a prop
1 parent f41b716 commit 2bf9a84

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

frontend/src/views/teams.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
TeamSideBar,
3636
} from '../components/teamsAndOrgs/teams';
3737
import { MessageMembers } from '../components/teamsAndOrgs/messageMembers';
38-
import { Projects } from '../components/teamsAndOrgs/projects';
3938
import { LeaveTeamConfirmationAlert } from '../components/teamsAndOrgs/leaveTeamConfirmationAlert';
4039
import { FormSubmitButton, CustomButton } from '../components/button';
4140
import { DeleteModal } from '../components/deleteModal';
@@ -44,6 +43,7 @@ import { PaginatorLine } from '../components/paginator';
4443
import { updateEntity } from '../utils/management';
4544
import { EntityError } from '../components/alert';
4645
import { useTeamsQuery } from '../api/teams';
46+
import { TeamLinkedProjects } from '../components/teamsAndOrgs/TeamLinkedProjects';
4747

4848
export function ManageTeams() {
4949
useSetTitleTag('Manage teams');
@@ -427,15 +427,12 @@ export function TeamDetail() {
427427
const userDetails = useSelector((state) => state.auth.userDetails);
428428
const token = useSelector((state) => state.auth.token);
429429
const [error, loading, team] = useFetch(`teams/${id}/`);
430-
// eslint-disable-next-line
431-
const [projectsError, projectsLoading, projects] = useFetch(
432-
`projects/?teamId=${id}&omitMapResults=true&projectStatuses=PUBLISHED`,
433-
id,
434-
);
435430
const [isMember, setIsMember] = useState(false);
436431
const [managers, setManagers] = useState([]);
437432
const [members, setMembers] = useState([]);
438433

434+
const [canUserEditTeam] = useEditTeamAllowed(team);
435+
439436
useEffect(() => {
440437
if (!token) {
441438
navigate('/login', {
@@ -498,11 +495,9 @@ export function TeamDetail() {
498495
/>
499496
</div>
500497
<div className="w-60-l w-100 mt2 pl5-l pl0 fl">
501-
<Projects
502-
projects={projects}
498+
<TeamLinkedProjects
503499
viewAllEndpoint={`/explore/?team=${id}`}
504-
ownerEntity="team"
505-
showManageButtons={false}
500+
canUserEditTeam={canUserEditTeam}
506501
/>
507502
</div>
508503
</div>

0 commit comments

Comments
 (0)