You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The project detail page renders proposed teams read-only. Users with the ManageProjects role should be able to confirm or reject each proposed team directly from this page.
Backend behaviour (already implemented):
PUT /api/projects/{projectId}/teams/{teamId}/confirm — marks the team Confirmed and, if the project is currently Open, transitions it to TeamConfirmed. Requires CanManageProjects policy.
PUT /api/projects/{projectId}/teams/{teamId}/reject — marks the team Rejected; no side-effect on the project or other teams. Requires CanManageProjects policy.
Confirming one team does not auto-reject other proposed teams.
Both actions return the updated TeamDto.
Both return 409 Conflict if the team is not in Proposed status.
Auth: Buttons should only render when currentUser.role === "ManageProjects".
Frontend pattern to follow:InvitationCard.tsx + app/invitations/actions.ts — server actions that call the API, then revalidatePath, consumed by a client component using useTransition for pending state.
Tasks
Add confirmTeam(projectId, teamId, token) and rejectTeam(projectId, teamId, token) to frontend/lib/api/projects.ts (return Team type via apiRequest)
Add confirmTeamAction(projectId, teamId) and rejectTeamAction(projectId, teamId) server actions to frontend/app/projects/[projectId]/actions.ts; revalidate /projects/${projectId} on success
Extract team rendering into a new client component frontend/app/projects/[projectId]/_TeamCard.tsx; show confirm/reject buttons only when canManage && team.status === "Proposed"; mirror InvitationCard pattern (useTransition, disabled during pending, error display)
Update frontend/app/projects/[projectId]/page.tsx to fetch currentUser in parallel with project, derive canManage = currentUser.role === "ManageProjects", and pass it to <TeamCard>
Description
The project detail page renders proposed teams read-only. Users with the
ManageProjectsrole should be able to confirm or reject each proposed team directly from this page.Backend behaviour (already implemented):
PUT /api/projects/{projectId}/teams/{teamId}/confirm— marks the team Confirmed and, if the project is currentlyOpen, transitions it toTeamConfirmed. RequiresCanManageProjectspolicy.PUT /api/projects/{projectId}/teams/{teamId}/reject— marks the team Rejected; no side-effect on the project or other teams. RequiresCanManageProjectspolicy.TeamDto.409 Conflictif the team is not inProposedstatus.Auth: Buttons should only render when
currentUser.role === "ManageProjects".Frontend pattern to follow:
InvitationCard.tsx+app/invitations/actions.ts— server actions that call the API, thenrevalidatePath, consumed by a client component usinguseTransitionfor pending state.Tasks
confirmTeam(projectId, teamId, token)andrejectTeam(projectId, teamId, token)tofrontend/lib/api/projects.ts(returnTeamtype viaapiRequest)confirmTeamAction(projectId, teamId)andrejectTeamAction(projectId, teamId)server actions tofrontend/app/projects/[projectId]/actions.ts; revalidate/projects/${projectId}on successfrontend/app/projects/[projectId]/_TeamCard.tsx; show confirm/reject buttons only whencanManage && team.status === "Proposed"; mirrorInvitationCardpattern (useTransition, disabled during pending, error display)frontend/app/projects/[projectId]/page.tsxto fetchcurrentUserin parallel withproject, derivecanManage = currentUser.role === "ManageProjects", and pass it to<TeamCard>