UBERF-6464: update activity mentions display (#5339)

This commit is contained in:
Kristina
2024-04-16 21:13:18 +07:00
committed by GitHub
parent fb0194af3e
commit de6e0739c2
34 changed files with 300 additions and 194 deletions
@@ -15,9 +15,9 @@
-->
<script lang="ts">
import { getClient } from '@hcengineering/presentation'
import type { Applicant } from '@hcengineering/recruit'
import recruit from '@hcengineering/recruit'
import { Icon } from '@hcengineering/ui'
import recruit, { Applicant } from '@hcengineering/recruit'
import { Icon, tooltip } from '@hcengineering/ui'
import { ObjectPresenterType } from '@hcengineering/view'
import { DocNavLink, ObjectMention } from '@hcengineering/view-resources'
export let value: Applicant
@@ -26,15 +26,17 @@
export let noUnderline: boolean = false
export let accent: boolean = false
export let shouldShowAvatar: boolean = true
export let type: ObjectPresenterType = 'link'
const client = getClient()
const shortLabel = value && client.getHierarchy().getClass(value._class).shortLabel
const clazz = value && client.getHierarchy().getClass(value._class)
const shortLabel = clazz?.shortLabel
</script>
{#if value && shortLabel}
{#if inline}
<ObjectMention object={value} {disabled} {noUnderline} {accent} />
{:else}
{:else if type === 'link'}
<DocNavLink object={value} {disabled} {noUnderline} {accent}>
<div class="flex-presenter">
{#if shouldShowAvatar}
@@ -47,5 +49,9 @@
</span>
</div>
</DocNavLink>
{:else if type === 'text'}
<span class="overflow-label" use:tooltip={{ label: clazz.label }}>
{#if shortLabel}{shortLabel}-{/if}{value.number}
</span>
{/if}
{/if}
@@ -19,6 +19,7 @@
import { Icon, getPlatformAvatarColorForTextDef, themeStore, tooltip } from '@hcengineering/ui'
import { DocNavLink, ObjectMention } from '@hcengineering/view-resources'
import { createEventDispatcher, onMount } from 'svelte'
import { ObjectPresenterType } from '@hcengineering/view'
import recruit from '../plugin'
@@ -27,6 +28,7 @@
export let disabled: boolean = false
export let accent: boolean = false
export let noUnderline: boolean = false
export let type: ObjectPresenterType = 'link'
const dispatch = createEventDispatcher()
$: accentColor = getPlatformAvatarColorForTextDef(value.name, $themeStore.dark)
@@ -40,7 +42,7 @@
{#if value}
{#if inline}
<ObjectMention object={value} {disabled} {accent} {noUnderline} component={recruit.component.EditVacancy} />
{:else}
{:else if type === 'link'}
<DocNavLink {disabled} object={value} {accent} {noUnderline} component={recruit.component.EditVacancy}>
<div class="flex-presenter" use:tooltip={{ label: getEmbeddedLabel(value.name) }}>
<div class="icon"><Icon icon={recruit.icon.Vacancy} size={'small'} /></div>
@@ -49,5 +51,9 @@
</span>
</div>
</DocNavLink>
{:else if type === 'text'}
<span class="overflow-label" use:tooltip={{ label: getEmbeddedLabel(value.name) }}>
{value.name}
</span>
{/if}
{/if}