Browse Source

fix: generaic prop

pull/6486/head
sreehari jayaraj 1 year ago
parent
commit
5efa3c74d4
  1. 10
      packages/nc-gui/components/general/UserIcon.vue
  2. 2
      packages/nc-gui/components/smartsheet/expanded-form/Comments.vue

10
packages/nc-gui/components/general/UserIcon.vue

@ -3,21 +3,21 @@ const props = withDefaults(
defineProps<{
size?: 'small' | 'medium' | 'base' | 'large' | 'xlarge'
name?: string
commentOwner?: string
email?: string
}>(),
{
commentOwner: '',
email: '',
},
)
const { user } = useGlobal()
const commentOwner = toRef(props, 'commentOwner')
const emailProp = toRef(props, 'email')
const backgroundColor = computed(() => {
// in comments we need to generate user icon from email
if (commentOwner.value.length) {
return stringToColour(commentOwner.value)
if (emailProp.value.length) {
return stringToColour(emailProp.value)
}
return user.value?.email ? stringToColour(user.value?.email) : '#FFFFFF'

2
packages/nc-gui/components/smartsheet/expanded-form/Comments.vue

@ -163,7 +163,7 @@ const processedAudit = (log: string) => {
<div class="flex flex-col p-4 gap-3">
<div class="flex justify-between">
<div class="flex items-center gap-2">
<GeneralUserIcon size="base" :name="log.display_name ?? log.user" :comment-owner="log.user" />
<GeneralUserIcon size="base" :name="log.display_name ?? log.user" :email="log.user" />
<div class="flex flex-col">
<span class="truncate font-bold max-w-42">

Loading…
Cancel
Save