diff --git a/js/src/components/Event/EventListCard.vue b/js/src/components/Event/EventListCard.vue index c14945a71..46115a553 100644 --- a/js/src/components/Event/EventListCard.vue +++ b/js/src/components/Event/EventListCard.vue @@ -14,7 +14,7 @@ export default { data() { return { participation: { - event: { + event: { title: 'Vue Styleguidist first meetup: learn the basics!', id: 5, uuid: 'some uuid', @@ -31,7 +31,7 @@ export default { }, participantStats: { approved: 1, - unapproved: 2 + notApproved: 2 } }, actor: { @@ -75,20 +75,20 @@ export default { - {{ $t('{approved} / {total} seats', {approved: participation.event.participantStats.participants, total: participation.event.options.maximumAttendeeCapacity }) }} + {{ $t('{approved} / {total} seats', {approved: participation.event.participantStats.participant, total: participation.event.options.maximumAttendeeCapacity }) }} - + - {{ $tc('{count} participants', participation.event.participantStats.participants, { count: participation.event.participantStats.participants })}} + {{ $tc('{count} participants', participation.event.participantStats.participant, { count: participation.event.participantStats.participant })}} + v-if="participation.event.participantStats.notApproved > 0"> - {{ $tc('{count} requests waiting', participation.event.participantStats.unapproved, { count: participation.event.participantStats.unapproved })}} + {{ $tc('{count} requests waiting', participation.event.participantStats.notApproved, { count: participation.event.participantStats.notApproved })}} diff --git a/js/src/graphql/actor.ts b/js/src/graphql/actor.ts index 6bb8d88eb..68e8c29b4 100644 --- a/js/src/graphql/actor.ts +++ b/js/src/graphql/actor.ts @@ -113,9 +113,8 @@ query LoggedUserParticipations($afterDateTime: DateTime, $beforeDateTime: DateTi } }, participantStats { - approved, - unapproved, - participants + notApproved + participant }, options { maximumAttendeeCapacity @@ -161,8 +160,8 @@ export const LOGGED_USER_DRAFTS = gql` } }, participantStats { - approved, - unapproved + going, + notApproved }, options { maximumAttendeeCapacity diff --git a/js/src/graphql/event.ts b/js/src/graphql/event.ts index 3dc947bea..d4620d5ed 100644 --- a/js/src/graphql/event.ts +++ b/js/src/graphql/event.ts @@ -102,9 +102,9 @@ export const FETCH_EVENT = gql` # name, # }, participantStats { - approved, - unapproved, - participants + going, + notApproved, + participant }, tags { ${tagsQuery} @@ -259,9 +259,9 @@ export const CREATE_EVENT = gql` id, }, participantStats { - approved, - unapproved, - participants + going, + notApproved, + participant }, tags { ${tagsQuery} @@ -344,9 +344,9 @@ export const EDIT_EVENT = gql` id, }, participantStats { - approved, - unapproved, - participants + going, + notApproved, + participant }, tags { ${tagsQuery} @@ -410,10 +410,10 @@ export const PARTICIPANTS = gql` ${participantQuery} }, participantStats { - approved, - unapproved, + going, + notApproved, rejected, - participants + participant } } } diff --git a/js/src/mixins/event.ts b/js/src/mixins/event.ts index 5aefb7a6c..f35c3aeac 100644 --- a/js/src/mixins/event.ts +++ b/js/src/mixins/event.ts @@ -8,10 +8,10 @@ import { IPerson } from '@/types/actor'; @Component export default class EventMixin extends mixins(Vue) { async openDeleteEventModal (event: IEvent, currentActor: IPerson) { - const participantsLength = event.participantStats.approved; + const participantsLength = event.participantStats.participant; const prefix = participantsLength - ? this.$tc('There are {participants} participants.', event.participantStats.approved, { - participants: event.participantStats.approved, + ? this.$tc('There are {participants} participants.', event.participantStats.participant, { + participants: event.participantStats.participant, }) : ''; diff --git a/js/src/types/event.model.ts b/js/src/types/event.model.ts index 05bb1577f..494dbb45d 100644 --- a/js/src/types/event.model.ts +++ b/js/src/types/event.model.ts @@ -94,10 +94,13 @@ export enum CommentModeration { } export interface IEventParticipantStats { - approved: number; - unapproved: number; + notApproved: number; rejected: number; - participants: number; + participant: number; + creator: number; + moderator: number; + administrator: number; + going: number; } export interface IEvent { @@ -192,7 +195,7 @@ export class EventModel implements IEvent { publishAt = new Date(); - participantStats = { approved: 0, unapproved: 0, rejected: 0, participants: 0 }; + participantStats = { notApproved: 0, rejected: 0, participant: 0, moderator: 0, administrator: 0, creator: 0, going: 0 }; participants: IParticipant[] = []; relatedEvents: IEvent[] = []; diff --git a/js/src/views/Event/Event.vue b/js/src/views/Event/Event.vue index be089a1df..7819e9d48 100644 --- a/js/src/views/Event/Event.vue +++ b/js/src/views/Event/Event.vue @@ -16,18 +16,18 @@ import {ParticipantRole} from "@/types/event.model";

{{ event.title }}

- - {{ $tc('One person is going', event.participantStats.approved, {approved: event.participantStats.approved}) }} + + {{ $tc('One person is going', event.participantStats.going, {approved: event.participantStats.going}) }} - - {{ $tc('You and one other person are going to this event', event.participantStats.participants, { approved: event.participantStats.participants }) }} + + {{ $tc('You and one other person are going to this event', event.participantStats.participant, { approved: event.participantStats.participant }) }} - - {{ $tc('One person is going', event.participantStats.approved, {approved: event.participantStats.approved}) }} + + {{ $tc('One person is going', event.participantStats.going, {approved: event.participantStats.going}) }} - - {{ $tc('You and one other person are going to this event', event.participantStats.participants, { approved: event.participantStats.participants }) }} + + {{ $tc('You and one other person are going to this event', event.participantStats.participant, { approved: event.participantStats.participant }) }} {{ $tc('All the places have already been taken', numberOfPlacesStillAvailable, { places: numberOfPlacesStillAvailable}) }} @@ -443,10 +443,10 @@ export default class Event extends EventMixin { } if (data.joinEvent.role === ParticipantRole.NOT_APPROVED) { - event.participantStats.unapproved = event.participantStats.unapproved + 1; + event.participantStats.notApproved = event.participantStats.notApproved + 1; } else { - event.participantStats.approved = event.participantStats.approved + 1; - event.participantStats.participants = event.participantStats.participants + 1; + event.participantStats.going = event.participantStats.going + 1; + event.participantStats.participant = event.participantStats.participant + 1; } store.writeQuery({ query: FETCH_EVENT, variables: { uuid: this.uuid }, data: { event } }); @@ -514,10 +514,10 @@ export default class Event extends EventMixin { return; } if (participation.role === ParticipantRole.NOT_APPROVED) { - event.participantStats.unapproved = event.participantStats.unapproved - 1; + event.participantStats.notApproved = event.participantStats.notApproved - 1; } else { - event.participantStats.approved = event.participantStats.approved - 1; - event.participantStats.participants = event.participantStats.participants - 1; + event.participantStats.going = event.participantStats.going - 1; + event.participantStats.participant = event.participantStats.participant - 1; } store.writeQuery({ query: FETCH_EVENT, variables: { uuid: this.uuid }, data: { event } }); }, @@ -591,11 +591,11 @@ export default class Event extends EventMixin { get eventCapacityOK(): boolean { if (!this.event.options.maximumAttendeeCapacity) return true; - return this.event.options.maximumAttendeeCapacity > this.event.participantStats.participants; + return this.event.options.maximumAttendeeCapacity > this.event.participantStats.participant; } get numberOfPlacesStillAvailable(): number { - return this.event.options.maximumAttendeeCapacity - this.event.participantStats.participants; + return this.event.options.maximumAttendeeCapacity - this.event.participantStats.participant; } urlToHostname(url: string): string|null { diff --git a/js/src/views/Event/Participants.vue b/js/src/views/Event/Participants.vue index 3d5998add..9d66fe66f 100644 --- a/js/src/views/Event/Participants.vue +++ b/js/src/views/Event/Participants.vue @@ -4,7 +4,7 @@ - +