From 73a0255ae82fff59a3303de8a09ee7254f5f3e1a Mon Sep 17 00:00:00 2001 From: Joel Jacob Stephen <70131076+JoelJacobStephen@users.noreply.github.com> Date: Mon, 20 Mar 2023 19:18:03 +0530 Subject: [PATCH] refactor: polish UI of admin dashboard users module (#48) Co-authored-by: Andrew Bastin --- .../hoppscotch-sh-admin/src/components.d.ts | 58 +++--- .../src/components/app/Header.vue | 12 -- .../src/components/app/Sidebar.vue | 19 +- .../src/composables/usePagedQuery.ts | 41 ++-- .../RemoveUserAccountByAdmin.graphql | 0 .../gql/mutations/RemoveUserAsAdmin.graphql | 3 + .../backend/gql/mutations/UserInfo.graphql | 1 + .../src/pages/dashboard.vue | 8 +- .../src/pages/users/_id.vue | 166 +++++++++++++-- .../src/pages/users/index.vue | 194 ++++++++++++------ .../src/pages/users/invited.vue | 47 +++-- pnpm-lock.yaml | 16 +- 12 files changed, 372 insertions(+), 193 deletions(-) rename packages/hoppscotch-sh-admin/src/helpers/backend/gql/{queries => mutations}/RemoveUserAccountByAdmin.graphql (100%) create mode 100644 packages/hoppscotch-sh-admin/src/helpers/backend/gql/mutations/RemoveUserAsAdmin.graphql diff --git a/packages/hoppscotch-sh-admin/src/components.d.ts b/packages/hoppscotch-sh-admin/src/components.d.ts index e04de87a2..963c86ccd 100644 --- a/packages/hoppscotch-sh-admin/src/components.d.ts +++ b/packages/hoppscotch-sh-admin/src/components.d.ts @@ -1,38 +1,38 @@ // 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']; - HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary']; - HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary']; - HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor']; - HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal']; - HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem']; - IconLucideBell: typeof import('~icons/lucide/bell')['default']; - IconLucideInbox: typeof import('~icons/lucide/inbox')['default']; - IconLucideLayoutDashboard: typeof import('~icons/lucide/layout-dashboard')['default']; - IconLucideLineChart: typeof import('~icons/lucide/line-chart')['default']; - IconLucideLock: typeof import('~icons/lucide/lock')['default']; - IconLucideMenu: typeof import('~icons/lucide/menu')['default']; - IconLucideSettings: typeof import('~icons/lucide/settings')['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']; - RouterLink: typeof import('vue-router')['RouterLink']; - RouterView: typeof import('vue-router')['RouterView']; - TeamsAddMembers: typeof import('./components/teams/AddMembers.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'] + HoppButtonPrimary: typeof import('@hoppscotch/ui')['HoppButtonPrimary'] + HoppButtonSecondary: typeof import('@hoppscotch/ui')['HoppButtonSecondary'] + HoppSmartAnchor: typeof import('@hoppscotch/ui')['HoppSmartAnchor'] + HoppSmartConfirmModal: typeof import('@hoppscotch/ui')['HoppSmartConfirmModal'] + HoppSmartItem: typeof import('@hoppscotch/ui')['HoppSmartItem'] + HoppSmartModal: typeof import('@hoppscotch/ui')['HoppSmartModal'] + HoppSmartSpinner: typeof import('@hoppscotch/ui')['HoppSmartSpinner'] + IconLucideChevronDown: typeof import('~icons/lucide/chevron-down')['default'] + IconLucideInbox: typeof import('~icons/lucide/inbox')['default'] + IconLucideLayoutDashboard: typeof import('~icons/lucide/layout-dashboard')['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'] + IconLucideUsers: typeof import('~icons/lucide/users')['default'] + ProfilePicture: typeof import('./components/profile/Picture.vue')['default'] + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + TeamsAddMembers: typeof import('./components/teams/AddMembers.vue')['default'] } + } diff --git a/packages/hoppscotch-sh-admin/src/components/app/Header.vue b/packages/hoppscotch-sh-admin/src/components/app/Header.vue index a2aa98fa9..53a3c7218 100644 --- a/packages/hoppscotch-sh-admin/src/components/app/Header.vue +++ b/packages/hoppscotch-sh-admin/src/components/app/Header.vue @@ -22,10 +22,6 @@
- -
@@ -81,8 +71,6 @@ diff --git a/packages/hoppscotch-sh-admin/src/pages/users/index.vue b/packages/hoppscotch-sh-admin/src/pages/users/index.vue index 66a36871e..eca585dd6 100644 --- a/packages/hoppscotch-sh-admin/src/pages/users/index.vue +++ b/packages/hoppscotch-sh-admin/src/pages/users/index.vue @@ -1,23 +1,23 @@ diff --git a/packages/hoppscotch-sh-admin/src/pages/users/invited.vue b/packages/hoppscotch-sh-admin/src/pages/users/invited.vue index 03960cdde..3c87a6f7a 100644 --- a/packages/hoppscotch-sh-admin/src/pages/users/invited.vue +++ b/packages/hoppscotch-sh-admin/src/pages/users/invited.vue @@ -1,6 +1,14 @@