From 74ad2e43a4a018d8be0f48ee289c0a1d1676d1a6 Mon Sep 17 00:00:00 2001 From: Joel Jacob Stephen <70131076+JoelJacobStephen@users.noreply.github.com> Date: Thu, 17 Aug 2023 21:53:34 +0530 Subject: [PATCH] feat: ability to conditionally enable auth providers in dashboard (#3225) --- packages/hoppscotch-sh-admin/index.html | 2 +- packages/hoppscotch-sh-admin/locales/en.json | 19 +++++ .../hoppscotch-sh-admin/src/components.d.ts | 69 ++++++++--------- .../src/components/app/Login.vue | 77 +++++++++++++------ 4 files changed, 108 insertions(+), 59 deletions(-) diff --git a/packages/hoppscotch-sh-admin/index.html b/packages/hoppscotch-sh-admin/index.html index 2b4eeb3f..65e692c2 100644 --- a/packages/hoppscotch-sh-admin/index.html +++ b/packages/hoppscotch-sh-admin/index.html @@ -1,5 +1,5 @@ - + diff --git a/packages/hoppscotch-sh-admin/locales/en.json b/packages/hoppscotch-sh-admin/locales/en.json index a955b839..a57b9d64 100644 --- a/packages/hoppscotch-sh-admin/locales/en.json +++ b/packages/hoppscotch-sh-admin/locales/en.json @@ -20,6 +20,7 @@ "viewer": "VIEWER" }, "state": { + "and": "and", "add_user_failure": "Failed to add user to the team!!", "add_user_success": "User is now a member of the team!!", "admin_failure": "Failed to make user an admin!!", @@ -27,20 +28,32 @@ "confirm_logout": "Confirm Logout", "create_team_failure": "Failed to create team!!", "create_team_success": "Team created successfully!!", + "configure_auth": "Check out the documentation to configure auth providers.", "delete_team_failure": "Team deletion failed!!", "delete_team_success": "Team deleted successfully!!", "delete_user_failure": "User deletion failed!!", "delete_user_success": "User deleted successfully!!", + "email":"Email", "email_failure": "Failed to send invitation", "email_success": "Email invitation sent successfully", "enter_team_email": "Please enter email of team owner!!", "error": "Something went wrong", + "continue_github": "Continue with Github", + "continue_google": "Continue with Google", + "continue_microsoft": "Continue with Microsoft", + "continue_email": "Continue with Email", "github_signin_failure": "Failed to login with Github", "google_signin_failure": "Failed to login with Google", "invalid_email": "Please enter a valid email address", + "login_as_admin":"and login with an admin account.", "logged_out": "Logged out", "logout": "Logout", + "magic_link_success": "We sent a magic link to", + "magic_link_sign_in":"Click on the link to sign in.", "non_admin_login": "You are logged in. But you're not an admin", + "non_admin_logged_in": "Logged in as non admin user.", + "privacy_policy": "Privacy Policy", + "reenter_email":"Re-enter email", "remove_admin_failure": "Failed to remove admin status!!", "remove_admin_success": "Admin status removed!!", "remove_admin_to_delete_user": "Remove admin privilege to delete the user!!", @@ -50,8 +63,14 @@ "remove_member_success": "Member removed successfully!!", "rename_team_failure": "Failed to rename team!!", "rename_team_success": "Team renamed successfully!", + "require_auth_provider": "You need to set atleast one authentication provider to log in.", "role_update_failed": "Roles updation has failed!!", "role_update_success": "Roles updated successfully!!", + "send_magic_link": "Send magic link", + "sign_in_agreement": "By signing in, you are agreeing to our", + "sign_in_options": "All sign in option", + "sign_out": "sign out", + "self_host_docs": "Self Host Documentation", "team_name_long": "Team name should be atleast 6 characters long!!", "user_not_found": "User not found in the infra!!" }, diff --git a/packages/hoppscotch-sh-admin/src/components.d.ts b/packages/hoppscotch-sh-admin/src/components.d.ts index 19ca12ff..0ad19898 100644 --- a/packages/hoppscotch-sh-admin/src/components.d.ts +++ b/packages/hoppscotch-sh-admin/src/components.d.ts @@ -1,44 +1,43 @@ // generated by unplugin-vue-components // We suggest you to commit this file into source control // Read more: https://github.com/vuejs/core/pull/3399 -import '@vue/runtime-core' +import '@vue/runtime-core'; -export {} +export {}; declare module '@vue/runtime-core' { export interface GlobalComponents { - AppHeader: typeof import('./components/app/Header.vue')['default'] - AppLogin: typeof import('./components/app/Login.vue')['default'] - AppLogout: typeof import('./components/app/Logout.vue')['default'] - AppModal: typeof import('./components/app/Modal.vue')['default'] - AppSidebar: typeof import('./components/app/Sidebar.vue')['default'] - AppToast: typeof import('./components/app/Toast.vue')['default'] - DashboardMetricsCard: typeof import('./components/dashboard/MetricsCard.vue')['default'] - HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary'] - HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary'] - HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor'] - HoppSmartAutoComplete: typeof import('@hoppscotch/ui')['HoppSmartAutoComplete'] - HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal'] - HoppSmartInput: typeof import('@hoppscotch/ui')['HoppSmartInput'] - HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem'] - HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal'] - HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture'] - HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner'] - HoppSmartTab: typeof import('@hoppscotch/ui')['HoppSmartTab'] - IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default'] - IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default'] - IconLucideHelpCircle: typeof import('~icons/lucide/help-circle')['default'] - IconLucideInbox: typeof import('~icons/lucide/inbox')['default'] - IconLucideUser: typeof import('~icons/lucide/user')['default'] - TeamsAdd: typeof import('./components/teams/Add.vue')['default'] - TeamsDetails: typeof import('./components/teams/Details.vue')['default'] - TeamsInvite: typeof import('./components/teams/Invite.vue')['default'] - TeamsMembers: typeof import('./components/teams/Members.vue')['default'] - TeamsPendingInvites: typeof import('./components/teams/PendingInvites.vue')['default'] - TeamsTable: typeof import('./components/teams/Table.vue')['default'] - Tippy: typeof import('vue-tippy')['Tippy'] - UsersInviteModal: typeof import('./components/users/InviteModal.vue')['default'] - UsersTable: typeof import('./components/users/Table.vue')['default'] + AppHeader: typeof import('./components/app/Header.vue')['default']; + AppLogin: typeof import('./components/app/Login.vue')['default']; + AppLogout: typeof import('./components/app/Logout.vue')['default']; + AppModal: typeof import('./components/app/Modal.vue')['default']; + AppSidebar: typeof import('./components/app/Sidebar.vue')['default']; + AppToast: typeof import('./components/app/Toast.vue')['default']; + DashboardMetricsCard: typeof import('./components/dashboard/MetricsCard.vue')['default']; + HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary']; + HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary']; + HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor']; + HoppSmartAutoComplete: typeof import('@hoppscotch/ui')['HoppSmartAutoComplete']; + HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal']; + HoppSmartInput: typeof import('@hoppscotch/ui')['HoppSmartInput']; + HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']; + HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal']; + HoppSmartPicture: typeof import('@hoppscotch/ui')['HoppSmartPicture']; + HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner']; + HoppSmartTab: typeof import('@hoppscotch/ui')['HoppSmartTab']; + IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default']; + IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default']; + IconLucideHelpCircle: typeof import('~icons/lucide/help-circle')['default']; + IconLucideInbox: typeof import('~icons/lucide/inbox')['default']; + IconLucideUser: typeof import('~icons/lucide/user')['default']; + TeamsAdd: typeof import('./components/teams/Add.vue')['default']; + TeamsDetails: typeof import('./components/teams/Details.vue')['default']; + TeamsInvite: typeof import('./components/teams/Invite.vue')['default']; + TeamsMembers: typeof import('./components/teams/Members.vue')['default']; + TeamsPendingInvites: typeof import('./components/teams/PendingInvites.vue')['default']; + TeamsTable: typeof import('./components/teams/Table.vue')['default']; + Tippy: typeof import('vue-tippy')['Tippy']; + UsersInviteModal: typeof import('./components/users/InviteModal.vue')['default']; + UsersTable: typeof import('./components/users/Table.vue')['default']; } - } diff --git a/packages/hoppscotch-sh-admin/src/components/app/Login.vue b/packages/hoppscotch-sh-admin/src/components/app/Login.vue index ac54ab3e..71ac7a4a 100644 --- a/packages/hoppscotch-sh-admin/src/components/app/Login.vue +++ b/packages/hoppscotch-sh-admin/src/components/app/Login.vue @@ -1,43 +1,50 @@