From c7de640e76a6d22edb74c1087d9d2657add537ea Mon Sep 17 00:00:00 2001 From: Massedil Date: Tue, 4 Nov 2025 21:18:30 +0100 Subject: [PATCH] Add frontend for group invitations For #887 --- src/graphql/invitations.ts | 37 ++++ src/i18n/en_US.json | 10 ++ src/i18n/fr_FR.json | 12 +- src/router/groups.ts | 9 + src/types/actor/invitation.model.ts | 4 + src/views/Group/GroupInvitations.vue | 260 +++++++++++++++++++++++++++ src/views/Group/SettingsView.vue | 4 + 7 files changed, 335 insertions(+), 1 deletion(-) create mode 100644 src/graphql/invitations.ts create mode 100644 src/types/actor/invitation.model.ts create mode 100644 src/views/Group/GroupInvitations.vue diff --git a/src/graphql/invitations.ts b/src/graphql/invitations.ts new file mode 100644 index 000000000..8f4d3067e --- /dev/null +++ b/src/graphql/invitations.ts @@ -0,0 +1,37 @@ +import gql from "graphql-tag"; + +export const GROUP_INVITATIONS_LIST = gql` + query ListInvitation($groupId: ID!) { + listInvitations(groupId: $groupId) { + label + token + } + } +`; + +export const GROUP_INVITATIONS_CREATE = gql` + mutation CreateInvitation($groupId: ID!, $label: String) { + createInvitation(groupId: $groupId, label: $label) { + label + token + } + } +`; + +export const GROUP_INVITATIONS_UPDATE = gql` + mutation UpdateInvitation($groupId: ID!, $token: String!, $label: String) { + updateInvitation(groupId: $groupId, token: $token, label: $label) { + label + token + } + } +`; + +export const GROUP_INVITATIONS_DELETE = gql` + mutation DeleteInvitation($groupId: ID!, $token: String!) { + deleteInvitation(groupId: $groupId, token: $token) { + label + token + } + } +`; diff --git a/src/i18n/en_US.json b/src/i18n/en_US.json index 5f53b7b9f..430027d81 100644 --- a/src/i18n/en_US.json +++ b/src/i18n/en_US.json @@ -209,6 +209,7 @@ "Cancel my participation request\u2026": "Cancel my participation request\u2026", "Cancel my participation\u2026": "Cancel my participation\u2026", "Cancel participation": "Cancel participation", + "Cancel update":"Cancel update", "Cancelled": "Cancelled", "Cancelled: Won't happen": "Cancelled: Won't happen", "Categories": "Categories", @@ -303,6 +304,7 @@ "Create token": "Create token", "Created by {name}": "Created by {name}", "Created by {username}": "Created by {username}", + "Creation date":"Creation date", "Current identity has been changed to {identityName} in order to manage this event.": "Current identity has been changed to {identityName} in order to manage this event.", "Current page": "Current page", "Custom": "Custom", @@ -338,6 +340,7 @@ "Delete events": "Delete events", "Delete everything": "Delete everything", "Delete feed tokens": "Delete feed tokens", + "Delete invitation":"Delete invitation", "Delete group": "Delete group", "Delete group discussions": "Delete group discussions", "Delete group posts": "Delete group posts", @@ -385,6 +388,7 @@ "Due on": "Due on", "Duplicate": "Duplicate", "Edit": "Edit", + "Edit invitation": "Edit invitation", "Edit post": "Edit post", "Edit profile {profile}": "Edit profile {profile}", "Edit user email": "Edit user email", @@ -524,6 +528,7 @@ "Google Meet": "Google Meet", "Group": "Group", "Group Followers": "Group Followers", + "Group invitations": "Group invitations", "Group Members": "Group Members", "Group URL": "Group URL", "Group activity": "Group activity", @@ -616,6 +621,8 @@ "Integrate this event with 3rd-party tools and show metadata for the event.": "Integrate this event with 3rd-party tools and show metadata for the event.", "Interact": "Interact", "Interact with a remote content": "Interact with a remote content", + "Invitation links": "Invitation links", + "Invitations": "Invitations", "Invite a new member": "Invite a new member", "Invite member": "Invite member", "Invited": "Invited", @@ -742,6 +749,7 @@ "New discussion": "New discussion", "New email": "New email", "New folder": "New folder", + "New invitation": "New invitation", "New link": "New link", "New members": "New members", "New note": "New note", @@ -1305,6 +1313,7 @@ "Timezone detected as {timezone}.": "Timezone detected as {timezone}.", "Timezone parameters": "Timezone parameters", "Title": "Title", + "Token":"Token", "To activate more notifications, head over to the notification settings.": "To activate more notifications, head over to the notification settings.", "To confirm, type your event title \"{eventTitle}\"": "To confirm, type your event title \"{eventTitle}\"", "To confirm, type your identity username \"{preferredUsername}\"": "To confirm, type your identity username \"{preferredUsername}\"", @@ -1365,6 +1374,7 @@ "Update group discussions": "Update group discussions", "Update group posts": "Update group posts", "Update group resources": "Update group resources", + "Update invitation":"Update invitation", "Update my event": "Update my event", "Update my profile": "Update my profile", "Update post": "Update post", diff --git a/src/i18n/fr_FR.json b/src/i18n/fr_FR.json index 1447d6565..de005f597 100644 --- a/src/i18n/fr_FR.json +++ b/src/i18n/fr_FR.json @@ -1718,5 +1718,15 @@ "{username} was invited to {group}": "{username} a \u00e9t\u00e9 invit\u00e9 \u00e0 {group}", "{user}'s follow request was accepted": "La demande de suivi de {user} a \u00e9t\u00e9 accept\u00e9e", "{user}'s follow request was rejected": "La demande de suivi de {user} a \u00e9t\u00e9 rejet\u00e9e", - "\u00a9 The OpenStreetMap Contributors": "\u00a9 Les Contributeur\u00b7ices OpenStreetMap" + "\u00a9 The OpenStreetMap Contributors": "\u00a9 Les Contributeur\u00b7ices OpenStreetMap", + "Cancel update":"Annuler la mise à jour", + "Creation date":"Date de création", + "Delete invitation":"Supprimer l'invitation", + "Edit invitation": "Modifier l'invitation", + "Group invitations":"Invitations de groupe", + "Invitation links": "Liens d'invitation", + "Invitations" : "Invitations", + "New invitation": "Nouvelle invitation", + "Token": "Jeton", + "Update invitation" : "Mettre à jour l'invitation" } diff --git a/src/router/groups.ts b/src/router/groups.ts index 3a7824311..e88bc023a 100644 --- a/src/router/groups.ts +++ b/src/router/groups.ts @@ -8,6 +8,7 @@ export enum GroupsRouteName { GROUP_PUBLIC_SETTINGS = "GROUP_PUBLIC_SETTINGS", GROUP_MEMBERS_SETTINGS = "GROUP_MEMBERS_SETTINGS", GROUP_FOLLOWERS_SETTINGS = "GROUP_FOLLOWERS_SETTINGS", + GROUP_INVITATIONS_SETTINGS = "GROUP_INVITATIONS_SETTINGS", RESOURCES = "RESOURCES", RESOURCE_FOLDER_ROOT = "RESOURCE_FOLDER_ROOT", RESOURCE_FOLDER = "RESOURCE_FOLDER", @@ -96,6 +97,14 @@ export const groupsRoutes: RouteRecordRaw[] = [ props: true, meta: { announcer: { skip: true } }, }, + { + path: "invitations", + name: GroupsRouteName.GROUP_INVITATIONS_SETTINGS, + component: (): Promise => + import("../views/Group/GroupInvitations.vue"), + props: true, + meta: { announcer: { skip: true } }, + }, ], }, { diff --git a/src/types/actor/invitation.model.ts b/src/types/actor/invitation.model.ts new file mode 100644 index 000000000..1f5a812ad --- /dev/null +++ b/src/types/actor/invitation.model.ts @@ -0,0 +1,4 @@ +export interface IInvitation { + label: string; + token: string; +} diff --git a/src/views/Group/GroupInvitations.vue b/src/views/Group/GroupInvitations.vue new file mode 100644 index 000000000..5f08c3706 --- /dev/null +++ b/src/views/Group/GroupInvitations.vue @@ -0,0 +1,260 @@ + + + diff --git a/src/views/Group/SettingsView.vue b/src/views/Group/SettingsView.vue index 1df8dd575..31d9cd512 100644 --- a/src/views/Group/SettingsView.vue +++ b/src/views/Group/SettingsView.vue @@ -20,6 +20,10 @@ :title="t('Followers')" :to="{ name: RouteName.GROUP_FOLLOWERS_SETTINGS }" /> +