Add a dropdown on participate menu, disallow listing participations

Now requires quering the person endpoint to know if an actor
participates in an event, organizers can make authenticated requests to
event { participants { } } to see the pending / approved participants.

Also closes #174

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-09-26 16:38:58 +02:00
parent 8a3e606c15
commit 757d2cabec
34 changed files with 655 additions and 439 deletions

View File

@@ -10,6 +10,9 @@ const participantQuery = `
},
name,
id
},
event {
id
}
`;
@@ -52,7 +55,7 @@ const optionsQuery = `
`;
export const FETCH_EVENT = gql`
query($uuid:UUID!, $roles: String) {
query($uuid:UUID!) {
event(uuid: $uuid) {
id,
uuid,
@@ -95,9 +98,6 @@ export const FETCH_EVENT = gql`
# preferredUsername,
# name,
# },
participants (roles: $roles) {
${participantQuery}
},
participantStats {
approved,
unapproved
@@ -363,9 +363,10 @@ export const DELETE_EVENT = gql`
`;
export const PARTICIPANTS = gql`
query($uuid: UUID!, $page: Int, $limit: Int, $roles: String) {
query($uuid: UUID!, $page: Int, $limit: Int, $roles: String, $actorId: ID!) {
event(uuid: $uuid) {
participants(page: $page, limit: $limit, roles: $roles) {
id,
participants(page: $page, limit: $limit, roles: $roles, actorId: $actorId) {
${participantQuery}
},
participantStats {
@@ -375,3 +376,21 @@ export const PARTICIPANTS = gql`
}
}
`;
export const EVENT_PERSON_PARTICIPATION = gql`
query($name: String!, $eventId: ID!) {
person(preferredUsername: $name) {
id,
participations(eventId: $eventId) {
id,
role,
actor {
id
},
event {
id
}
}
}
}
`;