File tree Expand file tree Collapse file tree 6 files changed +25
-13
lines changed
Expand file tree Collapse file tree 6 files changed +25
-13
lines changed Original file line number Diff line number Diff line change 2020 "@websitebeaver/vue-magnifier" : " ^1.1.0" ,
2121 "dayjs" : " ^1.11.13" ,
2222 "exifr" : " ^7.1.3" ,
23- "mosquito-alert" : " github:mosquito-alert/mosquito-alert-typescript-sdk#0.1.18 " ,
23+ "mosquito-alert" : " github:mosquito-alert/mosquito-alert-typescript-sdk#0.1.19 " ,
2424 "pinia" : " ^3.0.1" ,
2525 "primeicons" : " ^7.0.0" ,
2626 "primevue" : " ^4.3.3" ,
Original file line number Diff line number Diff line change 2828 <Column header =" Assignations" >
2929 <template #body =" slotProps " >
3030 <AvatarGroup >
31- <Avatar v-for =" assignment, index in slotProps.data.assignments" :key =" index" icon =" pi pi-user" shape =" circle"
32- :label =" getInitials(assignment.user.full_name)"
33- v-tooltip.top =" assignment.annotation_id === null ? `${assignment.user.full_name} (Pending)` : assignment.user.full_name"
31+ <UserAvatar v-for =" assignment, index in slotProps.data.assignments" :key =" index" :user =" assignment.user"
32+ v-tooltip.top =" assignment.annotation_id === null ? `${assignment.user.full_name || assignment.user.username} (Pending)` : assignment.user.full_name || assignment.user.username"
3433 :class =" assignment.annotation_id ? '' : 'border-(--p-tag-warn-color)! bg-(--p-tag-warn-background)! text-(--p-tag-warn-color)!'" />
3534 </AvatarGroup >
3635 </template >
@@ -78,9 +77,10 @@ import type { DataTableRowClickEvent } from 'primevue';
7877
7978import type { IdentificationTask } from ' mosquito-alert' ;
8079
80+ import UserAvatar from ' ./users/UserAvatar.vue' ;
81+
8182import { getStatusSeverity } from ' @/utils/IdentificationTaskUtils' ;
8283import { formatLocalDateTime } from ' @/utils/DateUtils' ;
83- import { getInitials } from ' @/utils/Utils' ;
8484
8585defineProps <{
8686 tasks: IdentificationTask [],
Original file line number Diff line number Diff line change 22 <Panel toggleable :collapsed =" collapsed" >
33 <template #header >
44 <div class =" flex items-center gap-2" >
5- <Avatar icon = " pi pi- user" shape = " circle " :label = " getInitials( annotation?.user.full_name || '') " />
6- <span class =" font-bold" >{{ annotation?.user.full_name }}</span >
5+ <UserAvatar : user= " annotation?.user" />
6+ <span class =" font-bold" >{{ annotation?.user.full_name || annotation?.user.username }}</span >
77 <AnnotationTypeTag v-if =" annotation.type === AnnotationType.Long" :type =" annotation.type" />
88 <Tag v-if =" annotation?.is_flagged" icon =" pi pi-flag" severity =" danger" value =" Flagged" rounded />
99 <Tag v-if =" annotation?.is_decisive" severity =" contrast" value =" Executive" rounded
5454import type { Annotation } from ' mosquito-alert' ;
5555import { AnnotationType } from ' mosquito-alert' ;
5656import TaxonClassificationTag from ' ../taxa/TaxonClassificationTag.vue' ;
57+ import UserAvatar from ' ../users/UserAvatar.vue' ;
5758import AnnotationTypeTag from ' ./AnnotationTypeTag.vue' ;
5859
59- import { getInitials } from ' @/utils/Utils' ;
6060import { formatLocalDateTime } from ' @/utils/DateUtils' ;
6161
6262withDefaults (defineProps <{
Original file line number Diff line number Diff line change 1+ <template >
2+ <Avatar icon =" pi pi-user" shape =" circle" :label =" getInitials(user?.full_name || user?.username || '')" />
3+ </template >
4+
5+ <script setup lang="ts">
6+ import { getInitials } from ' @/utils/Utils' ;
7+ import type { User , SimpleAnnotatorUser } from ' mosquito-alert' ;
8+
9+ defineProps <{
10+ user: User | SimpleAnnotatorUser | null
11+ }>();
12+ </script >
Original file line number Diff line number Diff line change 3535 <Button class =" p-2!" icon =" pi pi-user" :label =" username" rounded variant =" outlined" severity =" secondary"
3636 @click =" profileMenuToggle" >
3737 <template #icon >
38- <Avatar icon = " pi pi- user" shape = " circle " :label = " getInitials(username || '') " />
38+ <UserAvatar : user= " userStore.user " />
3939 </template >
4040 </Button >
4141 <Menu ref =" profileMenu" id =" overlay_menu" :model =" profileMenuItems" :popup =" true" />
@@ -51,7 +51,7 @@ import { ref } from 'vue';
5151import { useRouter } from ' vue-router' ;
5252
5353import { useLayout } from ' ./composables/layout' ;
54- import { getInitials } from ' @/utils/Utils ' ;
54+ import UserAvatar from ' @/components/users/UserAvatar.vue ' ;
5555import { useAuthStore } from ' @/stores/authStore' ;
5656import { useUserStore } from ' @/stores/userStore' ;
5757
You can’t perform that action at this time.
0 commit comments