feat: show awards on jury dashboard and add project details to award voting
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m27s
All checks were successful
Build and Push Docker Image / build (push) Successful in 7m27s
- Jury dashboard now shows active award voting banners with project count, deadline countdown, and direct link to vote - Award voting page shows full project details: description, team members, tags, and downloadable files in expandable cards - Award jurors can now download files for eligible projects (added awardJuror access check to file.getDownloadUrl) - Backend query enhanced to include files and team members Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -39,7 +39,7 @@ export const fileRouter = router({
|
||||
})
|
||||
}
|
||||
|
||||
const [juryAssignment, mentorAssignment, teamMembership] = await Promise.all([
|
||||
const [juryAssignment, mentorAssignment, teamMembership, awardJurorAccess] = await Promise.all([
|
||||
ctx.prisma.assignment.findFirst({
|
||||
where: { userId: ctx.user.id, projectId: file.projectId },
|
||||
select: { id: true, roundId: true },
|
||||
@@ -58,16 +58,29 @@ export const fileRouter = router({
|
||||
},
|
||||
select: { id: true },
|
||||
}),
|
||||
// Award jurors can access files for projects eligible in their awards
|
||||
ctx.prisma.awardJuror.findFirst({
|
||||
where: {
|
||||
userId: ctx.user.id,
|
||||
award: {
|
||||
status: { in: ['VOTING_OPEN', 'NOMINATIONS_OPEN'] },
|
||||
eligibilities: {
|
||||
some: { projectId: file.projectId, eligible: true },
|
||||
},
|
||||
},
|
||||
},
|
||||
select: { id: true },
|
||||
}),
|
||||
])
|
||||
|
||||
if (!juryAssignment && !mentorAssignment && !teamMembership) {
|
||||
if (!juryAssignment && !mentorAssignment && !teamMembership && !awardJurorAccess) {
|
||||
throw new TRPCError({
|
||||
code: 'FORBIDDEN',
|
||||
message: 'You do not have access to this file',
|
||||
})
|
||||
}
|
||||
|
||||
if (juryAssignment && !mentorAssignment && !teamMembership) {
|
||||
if (juryAssignment && !mentorAssignment && !teamMembership && !awardJurorAccess) {
|
||||
const assignedRound = await ctx.prisma.round.findUnique({
|
||||
where: { id: juryAssignment.roundId },
|
||||
select: { competitionId: true, sortOrder: true },
|
||||
|
||||
@@ -740,6 +740,25 @@ export const specialAwardRouter = router({
|
||||
competitionCategory: true,
|
||||
country: true,
|
||||
tags: true,
|
||||
files: {
|
||||
where: { replacedById: null },
|
||||
select: {
|
||||
id: true,
|
||||
fileName: true,
|
||||
fileType: true,
|
||||
bucket: true,
|
||||
objectKey: true,
|
||||
createdAt: true,
|
||||
},
|
||||
orderBy: { createdAt: 'desc' },
|
||||
},
|
||||
teamMembers: {
|
||||
select: {
|
||||
id: true,
|
||||
role: true,
|
||||
user: { select: { name: true, email: true } },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user