From 9e445cda84bb598ffecfea0d3739ca49500eecb7 Mon Sep 17 00:00:00 2001 From: Joel Jacob Stephen <70131076+JoelJacobStephen@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:44:41 +0300 Subject: [PATCH] refactor(sh-admin): updated invite flow for the admin dashboard (#4176) * feat: new success invite link modal introduced * refactor: replaced button with lucide icon * style: vertical padding to lucide icon * feat: new success invite modal component * refactor: hide copy link button when there are no pending invites * refactor: changed copy link button to copy invite link * chore: minor UI update --------- Co-authored-by: nivedin --- packages/hoppscotch-sh-admin/locales/en.json | 5 ++ .../hoppscotch-sh-admin/src/components.d.ts | 9 +++ .../src/components/users/InviteModal.vue | 9 +-- .../components/users/SuccessInviteModal.vue | 60 +++++++++++++++++++ .../src/pages/users/index.vue | 25 +++++--- .../src/pages/users/invited.vue | 7 ++- 6 files changed, 96 insertions(+), 19 deletions(-) create mode 100644 packages/hoppscotch-sh-admin/src/components/users/SuccessInviteModal.vue diff --git a/packages/hoppscotch-sh-admin/locales/en.json b/packages/hoppscotch-sh-admin/locales/en.json index 081fd0b9d..d4aee2637 100644 --- a/packages/hoppscotch-sh-admin/locales/en.json +++ b/packages/hoppscotch-sh-admin/locales/en.json @@ -166,6 +166,8 @@ "link_copied_to_clipboard": "Link copied to clipboard", "logged_out": "Logged out", "login_as_admin": "and login with an admin account.", + "login_using_email": "Please ask the user to check their email or share the link below", + "login_using_link": "Please ask the user to login using the link below", "logout": "Logout", "magic_link_sign_in": "Click on the link to sign in.", "magic_link_success": "We sent a magic link to", @@ -269,10 +271,12 @@ "valid_owner_email": "Please enter a valid owner email" }, "users": { + "add_user": "Add User", "admin": "Admin", "admin_id": "Admin ID", "cancel": "Cancel", "created_on": "Created On", + "copy_invite_link": "Copy Invite Link", "copy_link": "Copy Link", "date": "Date", "delete": "Delete", @@ -296,6 +300,7 @@ "load_list_error": "Unable to Load Users List", "make_admin": "Make Admin", "name": "Name", + "new_user_added": "New User Added", "no_invite": "No pending invites found", "no_shared_requests": "No shared requests created by the user", "no_users": "No users found", diff --git a/packages/hoppscotch-sh-admin/src/components.d.ts b/packages/hoppscotch-sh-admin/src/components.d.ts index bb6cc58f6..383e0a719 100644 --- a/packages/hoppscotch-sh-admin/src/components.d.ts +++ b/packages/hoppscotch-sh-admin/src/components.d.ts @@ -17,21 +17,29 @@ declare module '@vue/runtime-core' { HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary'] HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary'] HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor'] + HoppSmartAutoComplete: typeof import('@hoppscotch/ui')['HoppSmartAutoComplete'] HoppSmartCheckbox: typeof import('@hoppscotch/ui')['HoppSmartCheckbox'] HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal'] HoppSmartInput: typeof import('@hoppscotch/ui')['HoppSmartInput'] + HoppSmartIntersection: typeof import('@hoppscotch/ui')['HoppSmartIntersection'] HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem'] HoppSmartLink: typeof import('@hoppscotch/ui')['HoppSmartLink'] HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal'] HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture'] + HoppSmartPlaceholder: typeof import('@hoppscotch/ui')['HoppSmartPlaceholder'] + HoppSmartSelectWrapper: typeof import('@hoppscotch/ui')['HoppSmartSelectWrapper'] HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner'] HoppSmartTab: typeof import('@hoppscotch/ui')['HoppSmartTab'] HoppSmartTable: typeof import('@hoppscotch/ui')['HoppSmartTable'] HoppSmartTabs: typeof import('@hoppscotch/ui')['HoppSmartTabs'] HoppSmartToggle: typeof import('@hoppscotch/ui')['HoppSmartToggle'] IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default'] + IconLucideCheck: typeof import('~icons/lucide/check')['default'] + IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default'] + IconLucideHelpCircle: typeof import('~icons/lucide/help-circle')['default'] IconLucideInbox: typeof import('~icons/lucide/inbox')['default'] IconLucideSearch: typeof import('~icons/lucide/search')['default'] + IconLucideUser: typeof import('~icons/lucide/user')['default'] SettingsAuthProvider: typeof import('./components/settings/AuthProvider.vue')['default'] SettingsConfigurations: typeof import('./components/settings/Configurations.vue')['default'] SettingsDataSharing: typeof import('./components/settings/DataSharing.vue')['default'] @@ -49,6 +57,7 @@ declare module '@vue/runtime-core' { UsersDetails: typeof import('./components/users/Details.vue')['default'] UsersInviteModal: typeof import('./components/users/InviteModal.vue')['default'] UsersSharedRequests: typeof import('./components/users/SharedRequests.vue')['default'] + UsersSuccessInviteModal: typeof import('./components/users/SuccessInviteModal.vue')['default'] } } diff --git a/packages/hoppscotch-sh-admin/src/components/users/InviteModal.vue b/packages/hoppscotch-sh-admin/src/components/users/InviteModal.vue index 7c23c39ad..49421ad90 100644 --- a/packages/hoppscotch-sh-admin/src/components/users/InviteModal.vue +++ b/packages/hoppscotch-sh-admin/src/components/users/InviteModal.vue @@ -15,8 +15,7 @@ diff --git a/packages/hoppscotch-sh-admin/src/components/users/SuccessInviteModal.vue b/packages/hoppscotch-sh-admin/src/components/users/SuccessInviteModal.vue new file mode 100644 index 000000000..ab969a67e --- /dev/null +++ b/packages/hoppscotch-sh-admin/src/components/users/SuccessInviteModal.vue @@ -0,0 +1,60 @@ + + + diff --git a/packages/hoppscotch-sh-admin/src/pages/users/index.vue b/packages/hoppscotch-sh-admin/src/pages/users/index.vue index 5bc54da9b..200d2331c 100644 --- a/packages/hoppscotch-sh-admin/src/pages/users/index.vue +++ b/packages/hoppscotch-sh-admin/src/pages/users/index.vue @@ -203,6 +203,7 @@ + + -

+
+

{{ t('users.pending_invites') }}