From 4e30efd7377f3dadaefef37a5876d7c7d33aa9b5 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Mon, 18 Oct 2021 21:43:13 +0530 Subject: [PATCH] fix: invitation acceptance flow --- .../helpers/backend/GQLClient.ts | 4 +- .../gql/queries/GetInviteDetails.graphql | 15 ++ packages/hoppscotch-app/locales/en.json | 2 + packages/hoppscotch-app/pages/join-team.vue | 185 ++++++++++++++++++ packages/hoppscotch-app/pages/team-invite.vue | 94 --------- 5 files changed, 205 insertions(+), 95 deletions(-) create mode 100644 packages/hoppscotch-app/helpers/backend/gql/queries/GetInviteDetails.graphql create mode 100644 packages/hoppscotch-app/pages/join-team.vue delete mode 100644 packages/hoppscotch-app/pages/team-invite.vue diff --git a/packages/hoppscotch-app/helpers/backend/GQLClient.ts b/packages/hoppscotch-app/helpers/backend/GQLClient.ts index e1c38cf8e..7ca2d450c 100644 --- a/packages/hoppscotch-app/helpers/backend/GQLClient.ts +++ b/packages/hoppscotch-app/helpers/backend/GQLClient.ts @@ -6,6 +6,7 @@ import { watchEffect, watchSyncEffect, WatchStopHandle, + set, } from "@nuxtjs/composition-api" import { createClient, @@ -222,7 +223,8 @@ export const useGQLQuery = ( const execute = (updatedVars?: DocVarType) => { if (updatedVars) { - args.variables = updatedVars as any + set(args, "variables", updatedVars) + // args.variables = updatedVars as any } isPaused.value = false diff --git a/packages/hoppscotch-app/helpers/backend/gql/queries/GetInviteDetails.graphql b/packages/hoppscotch-app/helpers/backend/gql/queries/GetInviteDetails.graphql new file mode 100644 index 000000000..69847b5d3 --- /dev/null +++ b/packages/hoppscotch-app/helpers/backend/gql/queries/GetInviteDetails.graphql @@ -0,0 +1,15 @@ +query GetInviteDetails($inviteID: ID!) { + teamInvitation(inviteID: $inviteID) { + id + inviteeEmail + inviteeRole + team { + id + name + } + creator { + uid + displayName + } + } +} diff --git a/packages/hoppscotch-app/locales/en.json b/packages/hoppscotch-app/locales/en.json index 6c50397ab..4a7cc91d4 100644 --- a/packages/hoppscotch-app/locales/en.json +++ b/packages/hoppscotch-app/locales/en.json @@ -481,6 +481,8 @@ "invalid_invite_link": "Invalid invite link", "invalid_invite_link_description": "The link you followed is invalid. Contact your team owner.", "invite": "Invite", + "login_to_continue": "Login to continue", + "login_to_continue_description": "You need to be logged in to join a team.", "invite_more": "Invite more", "invite_tooltip": "Invite people to this workspace", "invited_to_team": "{owner} invited you to join {team}", diff --git a/packages/hoppscotch-app/pages/join-team.vue b/packages/hoppscotch-app/pages/join-team.vue new file mode 100644 index 000000000..8f4fc450a --- /dev/null +++ b/packages/hoppscotch-app/pages/join-team.vue @@ -0,0 +1,185 @@ + + + diff --git a/packages/hoppscotch-app/pages/team-invite.vue b/packages/hoppscotch-app/pages/team-invite.vue deleted file mode 100644 index bd0ff95f7..000000000 --- a/packages/hoppscotch-app/pages/team-invite.vue +++ /dev/null @@ -1,94 +0,0 @@ - - -