Skip to content

Commit 22259a0

Browse files
authored
updated debate view, changed stats to show scanned stats (#29)
1 parent b2d4ce9 commit 22259a0

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

backend/app/graphql/resolvers/season.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,22 @@ export class SeasonFieldResolver {
291291
},
292292
});
293293
}
294+
295+
@FieldResolver(() => Int)
296+
companyScannedQRs(
297+
@Root() season: Season,
298+
@Ctx() ctx: Context,
299+
): GQLField<number> {
300+
if (!ctx.user) {
301+
return 0;
302+
}
303+
304+
return ctx.prisma.companyScannedUser.count({
305+
where: {
306+
seasonId: season.id,
307+
},
308+
});
309+
}
294310
}
295311

296312
export const transformSelect = transformSelectFor<SeasonFieldResolver>({
@@ -372,6 +388,13 @@ export const transformSelect = transformSelectFor<SeasonFieldResolver>({
372388

373389
return select;
374390
},
391+
392+
companyScannedQRs(select) {
393+
select.id = true;
394+
delete select.companyScannedQRs;
395+
396+
return select;
397+
},
375398
});
376399

377400
@InputType()

graphql/client/graphql.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,6 +2961,7 @@ export type Season = {
29612961
calendar: Array<CalendarItem>;
29622962
companyComponentAverageRatings: Array<UserCompanyComponentRatingComponentAverage>;
29632963
companyScannedCvs: Scalars['Int']['output'];
2964+
companyScannedQRs: Scalars['Int']['output'];
29642965
endsAt: Scalars['DateTimeISO']['output'];
29652966
entryCount: Scalars['Int']['output'];
29662967
eventFrom: Scalars['DateTimeISO']['output'];

graphql/schema.graphql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,6 +2044,7 @@ type Season {
20442044
calendar: [CalendarItem!]!
20452045
companyComponentAverageRatings: [UserCompanyComponentRatingComponentAverage!]!
20462046
companyScannedCvs: Int!
2047+
companyScannedQRs: Int!
20472048
endsAt: DateTimeISO!
20482049
entryCount: Int!
20492050
eventFrom: DateTimeISO!

graphql/schema.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,6 +2963,7 @@ export type ISeason = {
29632963
calendar: Array<ICalendarItem>;
29642964
companyComponentAverageRatings: Array<IUserCompanyComponentRatingComponentAverage>;
29652965
companyScannedCvs: Scalars['Int']['output'];
2966+
companyScannedQRs: Scalars['Int']['output'];
29662967
endsAt: Scalars['DateTimeISO']['output'];
29672968
entryCount: Scalars['Int']['output'];
29682969
eventFrom: Scalars['DateTimeISO']['output'];
@@ -6786,6 +6787,7 @@ export type ISeasonResolvers<ContextType = any, ParentType extends IResolversPar
67866787
calendar?: Resolver<Array<IResolversTypes['CalendarItem']>, ParentType, ContextType>;
67876788
companyComponentAverageRatings?: Resolver<Array<IResolversTypes['UserCompanyComponentRatingComponentAverage']>, ParentType, ContextType>;
67886789
companyScannedCvs?: Resolver<IResolversTypes['Int'], ParentType, ContextType>;
6790+
companyScannedQRs?: Resolver<IResolversTypes['Int'], ParentType, ContextType>;
67896791
endsAt?: Resolver<IResolversTypes['DateTimeISO'], ParentType, ContextType>;
67906792
entryCount?: Resolver<IResolversTypes['Int'], ParentType, ContextType>;
67916793
eventFrom?: Resolver<IResolversTypes['DateTimeISO'], ParentType, ContextType>;

pages/admin/season/[season]/stats.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<strong>Ulaza</strong>: <em v-text="resp.season.entryCount" />
1111
</li>
1212
<li>
13-
<strong>Skeniranih životopisa</strong>: <em v-text="resp.season.companyScannedCvs" />
13+
<strong>Firme skenirani QR</strong>: <em v-text="resp.season.companyScannedQRs" />
1414
</li>
1515
</ul>
1616
</app-max-width-container>
@@ -54,6 +54,7 @@
5454
season(uid: $season) {
5555
entryCount
5656
companyScannedCvs
57+
companyScannedQRs
5758
}
5859
}
5960
`,

pages/live-vote/[season]/view-live-vote-results.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
105105
.container {
106106
display: grid;
107-
min-height: 70vh;
107+
min-height: 100vh;
108108
background-color: $fer-black;
109109
}
110110

0 commit comments

Comments
 (0)