From 80ee45ae4f23d020fb87ce9dc221fb490595a3d4 Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 5 Apr 2020 19:30:02 -0400 Subject: [PATCH] feat: admin edit user - activity panel --- client/components/admin/admin-users-edit.vue | 50 +++++++++++++++++-- client/components/profile.vue | 21 ++++---- client/components/profile/pages.vue | 8 +-- client/components/profile/profile.vue | 28 ++++++++--- .../graph/admin/users/users-query-single.gql | 23 --------- server/graph/schemas/user.graphql | 1 + 6 files changed, 82 insertions(+), 49 deletions(-) delete mode 100644 client/graph/admin/users/users-query-single.gql diff --git a/client/components/admin/admin-users-edit.vue b/client/components/admin/admin-users-edit.vue index 73b373c3..8da7556b 100644 --- a/client/components/admin/admin-users-edit.vue +++ b/client/components/admin/admin-users-edit.vue @@ -148,7 +148,7 @@ v-tooltip(top) template(v-slot:activator='{ on: tooltip }') v-btn(icon, color='grey', x-small, v-on='{ ...menu, ...tooltip }', @click='focusField(`iptNewPassword`)') - v-icon mdi-cached + v-icon mdi-pencil span {{$t('admin:users.changePassword')}} v-card v-text-field( @@ -267,7 +267,7 @@ v-divider v-list-item v-list-item-avatar(size='32') - v-icon mdi-account-badge-horizontal-outline + v-icon mdi-briefcase v-list-item-content v-list-item-title {{$t('admin:users.jobTitle')}} v-list-item-subtitle {{ user.jobTitle }} @@ -324,8 +324,21 @@ @keydown.enter='editPop.timezone = false' @keydown.esc='editPop.timezone = false' ) + v-card.mt-3.animated.fadeInUp.wait-p4s - v-toolbar(color='primary', dense, dark, flat) + v-toolbar(color='teal', dark, dense, flat) + v-toolbar-title + .subtitle-1 {{$t('profile:activity.title')}} + v-card-text.grey--text.text--darken-2 + .caption.grey--text {{$t('profile:activity.joinedOn')}} + .body-2: strong {{ user.createdAt | moment('LLLL') }} + .caption.grey--text.mt-3 {{$t('profile:activity.lastUpdatedOn')}} + .body-2: strong {{ user.updatedAt | moment('LLLL') }} + .caption.grey--text.mt-3 {{$t('profile:activity.lastLoginOn')}} + .body-2: strong {{ user.lastLoginAt | moment('LLLL') }} + + v-card.mt-3.animated.fadeInUp.wait-p6s + v-toolbar(color='teal', dense, dark, flat) v-icon.mr-2 mdi-file-document-box-multiple-outline span Content v-card-text @@ -351,10 +364,12 @@ import gql from 'graphql-tag' import { StatusIndicator } from 'vue-status-indicator' -import userQuery from 'gql/admin/users/users-query-single.gql' import groupsQuery from 'gql/admin/users/users-query-groups.gql' export default { + i18nOptions: { + namespaces: ['admin', 'profile'] + }, components: { StatusIndicator }, @@ -884,7 +899,32 @@ export default { }, apollo: { user: { - query: userQuery, + query: gql` + query ($id: Int!) { + users { + single(id: $id) { + id + name + email + providerKey + providerId + location + jobTitle + timezone + isSystem + isActive + isVerified + createdAt + updatedAt + lastLoginAt + groups { + id + name + } + } + } + } + `, variables() { return { id: _.toSafeInteger(this.$route.params.id) diff --git a/client/components/profile.vue b/client/components/profile.vue index efd55e24..ab407bda 100644 --- a/client/components/profile.vue +++ b/client/components/profile.vue @@ -3,25 +3,24 @@ nav-header v-navigation-drawer.pb-0(v-model='profileDrawerShown', app, fixed, clipped, left, permanent) v-list(dense, nav) - v-list-item(to='/profile') + v-list-item(to='/profile', color='primary') v-list-item-action: v-icon mdi-face-profile v-list-item-content - v-list-item-title Profile + v-list-item-title {{$t('profile:title')}} //- v-list-item(to='/preferences', disabled) //- v-list-item-action: v-icon(color='grey lighten-1') mdi-cog-outline //- v-list-item-content //- v-list-item-title Preferences //- v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon - v-list-item(to='/pages', disabled) - v-list-item-action: v-icon(color='grey lighten-1') mdi-file-document + v-list-item(to='/pages', color='primary') + v-list-item-action: v-icon mdi-file-document-outline v-list-item-content - v-list-item-title Pages - v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon - v-list-item(to='/comments', disabled) - v-list-item-action: v-icon(color='grey lighten-1') mdi-message-reply-text - v-list-item-content - v-list-item-title Comments - v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon + v-list-item-title {{$t('profile:pages.title')}} + //- v-list-item(to='/comments', disabled) + //- v-list-item-action: v-icon(color='grey lighten-1') mdi-message-reply-text + //- v-list-item-content + //- v-list-item-title {{$t('profile:comments.title')}} + //- v-list-item-subtitle.caption.grey--text.text--lighten-1 Coming soon v-content transition(name='profile-router') diff --git a/client/components/profile/pages.vue b/client/components/profile/pages.vue index 07a331e3..2f9804fa 100644 --- a/client/components/profile/pages.vue +++ b/client/components/profile/pages.vue @@ -2,9 +2,11 @@ v-container(fluid, fill-height, grid-list-lg) v-layout(row wrap) v-flex(xs12) - .headline.primary--text Pages - .subheading.grey--text List of pages I created or contributed - + .profile-header + img.animated.fadeInUp(src='/svg/icon-file.svg', alt='Users', style='width: 80px;') + .profile-header-title + .headline.primary--text.animated.fadeInLeft {{$t('profile:pages.title')}} + .subheading.grey--text.animated.fadeInLeft {{$t('profile:pages.subtitle')}}