From e27dc1f7a202253827ca11515ef4b7111953be5f Mon Sep 17 00:00:00 2001 From: Joel Jacob Stephen <70131076+JoelJacobStephen@users.noreply.github.com> Date: Tue, 4 Apr 2023 13:48:02 +0530 Subject: [PATCH] refactor: polishing of admin dashboard teams module (#64) Co-authored-by: Anwarul Islam --- .../hoppscotch-sh-admin/src/components.d.ts | 16 +- .../src/components/teams/AddMembers.vue | 66 --- .../src/components/teams/Details.vue | 483 ----------------- .../src/components/teams/Invite.vue | 230 +++----- .../src/components/teams/Members.vue | 507 +++++++++--------- .../src/components/teams/PendingInvites.vue | 82 ++- .../mutations/AddUserToTeamByAdmin.graphql | 13 + .../ChangeUserRoleInTeamByAdmin.graphql | 14 + .../backend/gql/mutations/CreateTeam.graphql | 1 - .../gql/mutations/RemoveTeamMember.graphql | 3 - .../RemoveUserFromTeamByAdmin.graphql | 3 + .../mutations/UpdateTeamMemberRole.graphql | 10 - .../backend/gql/queries/TeamInfo.graphql | 51 +- .../backend/gql/queries/TeamList.graphql | 4 +- .../src/pages/teams/AddTeam.vue | 80 --- .../src/pages/teams/_id.vue | 276 +++++++++- .../src/pages/teams/index.vue | 342 +++++++----- packages/hoppscotch-ui/package.json | 1 + .../src/components/smart/AutoComplete.vue | 303 +++++------ pnpm-lock.yaml | 59 +- 20 files changed, 1097 insertions(+), 1447 deletions(-) delete mode 100644 packages/hoppscotch-sh-admin/src/components/teams/AddMembers.vue delete mode 100644 packages/hoppscotch-sh-admin/src/components/teams/Details.vue create mode 100644 packages/hoppscotch-sh-admin/src/helpers/backend/gql/mutations/AddUserToTeamByAdmin.graphql create mode 100644 packages/hoppscotch-sh-admin/src/helpers/backend/gql/mutations/ChangeUserRoleInTeamByAdmin.graphql delete mode 100644 packages/hoppscotch-sh-admin/src/helpers/backend/gql/mutations/RemoveTeamMember.graphql create mode 100644 packages/hoppscotch-sh-admin/src/helpers/backend/gql/mutations/RemoveUserFromTeamByAdmin.graphql delete mode 100644 packages/hoppscotch-sh-admin/src/helpers/backend/gql/mutations/UpdateTeamMemberRole.graphql delete mode 100644 packages/hoppscotch-sh-admin/src/pages/teams/AddTeam.vue diff --git a/packages/hoppscotch-sh-admin/src/components.d.ts b/packages/hoppscotch-sh-admin/src/components.d.ts index 4a3626af7..2c4d4ba24 100644 --- a/packages/hoppscotch-sh-admin/src/components.d.ts +++ b/packages/hoppscotch-sh-admin/src/components.d.ts @@ -17,32 +17,18 @@ 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'] HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal'] HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem'] - HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner'] - IconLucideInbox: typeof import('~icons/lucide/inbox')['default'] - IconLucideUser: typeof import('~icons/lucide/user')['default'] HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal'] HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner'] IconLucideArrowLeft: typeof import('~icons/lucide/arrow-left')['default'] IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default'] - IconLucideChevronLeft: typeof import('~icons/lucide/chevron-left')['default'] - IconLucideChevronRight: typeof import('~icons/lucide/chevron-right')['default'] - IconLucideEdit: typeof import('~icons/lucide/edit')['default'] - IconLucideFolderTree: typeof import('~icons/lucide/folder-tree')['default'] IconLucideInbox: typeof import('~icons/lucide/inbox')['default'] - IconLucideLayoutDashboard: typeof import('~icons/lucide/layout-dashboard')['default'] - IconLucideLineChart: typeof import('~icons/lucide/line-chart')['default'] - IconLucideMenu: typeof import('~icons/lucide/menu')['default'] IconLucideMoreHorizontal: typeof import('~icons/lucide/more-horizontal')['default'] - IconLucideSidebarClose: typeof import('~icons/lucide/sidebar-close')['default'] - IconLucideSidebarOpen: typeof import('~icons/lucide/sidebar-open')['default'] IconLucideUser: typeof import('~icons/lucide/user')['default'] - IconLucideUserCog: typeof import('~icons/lucide/user-cog')['default'] IconLucideUsers: typeof import('~icons/lucide/users')['default'] ProfilePicture: typeof import('./components/profile/Picture.vue')['default'] - TeamsAddMembers: typeof import('./components/teams/AddMembers.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'] diff --git a/packages/hoppscotch-sh-admin/src/components/teams/AddMembers.vue b/packages/hoppscotch-sh-admin/src/components/teams/AddMembers.vue deleted file mode 100644 index cc7deb28d..000000000 --- a/packages/hoppscotch-sh-admin/src/components/teams/AddMembers.vue +++ /dev/null @@ -1,66 +0,0 @@ - - - diff --git a/packages/hoppscotch-sh-admin/src/components/teams/Details.vue b/packages/hoppscotch-sh-admin/src/components/teams/Details.vue deleted file mode 100644 index 79f0e3329..000000000 --- a/packages/hoppscotch-sh-admin/src/components/teams/Details.vue +++ /dev/null @@ -1,483 +0,0 @@ - - - diff --git a/packages/hoppscotch-sh-admin/src/components/teams/Invite.vue b/packages/hoppscotch-sh-admin/src/components/teams/Invite.vue index 9081f637c..7d08ad372 100644 --- a/packages/hoppscotch-sh-admin/src/components/teams/Invite.vue +++ b/packages/hoppscotch-sh-admin/src/components/teams/Invite.vue @@ -1,45 +1,7 @@