From 2917d50c6afe5f52fdcbb284514099d8423eca79 Mon Sep 17 00:00:00 2001 From: Akash K <57758277+amk-dev@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:18:10 +0530 Subject: [PATCH] feat: copyable invite links (#4153) Co-authored-by: Andrew Bastin Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> --- packages/hoppscotch-common/locales/en.json | 3 + .../src/components/teams/Invite.vue | 85 ++++++++++++++++++- .../hoppscotch-common/src/platform/index.ts | 2 + .../hoppscotch-common/src/platform/infra.ts | 5 ++ .../src/api/queries/GetSMTPStatus.graphql | 3 + packages/hoppscotch-selfhost-web/src/main.ts | 2 + .../src/platform/infra/infra.platform.ts | 23 +++++ 7 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 packages/hoppscotch-common/src/platform/infra.ts create mode 100644 packages/hoppscotch-selfhost-web/src/api/queries/GetSMTPStatus.graphql create mode 100644 packages/hoppscotch-selfhost-web/src/platform/infra/infra.platform.ts diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index a964afb3a8..fb4e05e7e2 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -1009,7 +1009,10 @@ "success_invites": "Success invites", "title": "Workspaces", "we_sent_invite_link": "We sent an invite link to all invitees!", + "invite_sent_smtp_disabled": "Invite links generated", "we_sent_invite_link_description": "Ask all invitees to check their inbox. Click on the link to join the workspace.", + "invite_sent_smtp_disabled_description": "Sending invite emails is disabled for this instance of Hoppscotch. Please use the Copy link button to copy and share the invite link manually.", + "copy_invite_link": "Copy Invite Link", "search_title": "Team Requests" }, "team_environment": { diff --git a/packages/hoppscotch-common/src/components/teams/Invite.vue b/packages/hoppscotch-common/src/components/teams/Invite.vue index 8f9705d758..b98e50da07 100644 --- a/packages/hoppscotch-common/src/components/teams/Invite.vue +++ b/packages/hoppscotch-common/src/components/teams/Invite.vue @@ -10,10 +10,18 @@

- {{ t("team.we_sent_invite_link") }} + {{ + inviteMethod === "email" + ? t("team.we_sent_invite_link") + : t("team.invite_sent_smtp_disabled") + }}

- {{ t("team.we_sent_invite_link_description") }} + {{ + inviteMethod === "email" + ? t("team.we_sent_invite_link_description") + : t("team.invite_sent_smtp_disabled_description") + }}

@@ -33,6 +41,20 @@ class="svg-icons mr-4 text-green-500" /> {{ invitee.email }} + + +

@@ -107,6 +129,20 @@ :value="invitee.inviteeRole" readonly /> +
+ +