mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 11:31:57 +03:00
Support disabled employee presenter (#2758)
* Support disabled employee presenter Signed-off-by: Anton Brechka <anton.brechka@ezthera.com> * Added DocNavLink Signed-off-by: Anton Brechka <anton.brechka@ezthera.com> * Remove unused condition Signed-off-by: Anton Brechka <anton.brechka@ezthera.com> --------- Signed-off-by: Anton Brechka <anton.brechka@ezthera.com>
This commit is contained in:
parent
ae84626521
commit
9460e7a406
@ -20,9 +20,11 @@
|
||||
import { Avatar } from '@hcengineering/presentation'
|
||||
import { showPopup, tooltip } from '@hcengineering/ui'
|
||||
import { EditDoc } from '@hcengineering/view-resources'
|
||||
import DocNavLink from '@hcengineering/view-resources/src/components/DocNavLink.svelte'
|
||||
import { employeeByIdStore } from '../utils'
|
||||
|
||||
export let value: Account
|
||||
export let disabled = false
|
||||
|
||||
$: employee = $employeeByIdStore.get((value as EmployeeAccount).employee)
|
||||
|
||||
@ -35,34 +37,22 @@
|
||||
|
||||
{#if value}
|
||||
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
||||
<div
|
||||
class="flex-row-center"
|
||||
class:user-container={employee !== undefined}
|
||||
on:click={onClick}
|
||||
use:tooltip={{ label: getEmbeddedLabel(employee ? getName(employee) : value.email) }}
|
||||
>
|
||||
<DocNavLink object={value} disableClick={disabled} noUnderline={disabled} {onClick}>
|
||||
<span class="flex-row-center" use:tooltip={{ label: getEmbeddedLabel(employee ? getName(employee) : value.email) }}>
|
||||
{#if employee}
|
||||
<Avatar size={'x-small'} avatar={employee.avatar} />
|
||||
<div class="overflow-label user">{getName(employee)}</div>
|
||||
<span class="overflow-label user">{getName(employee)}</span>
|
||||
{:else}
|
||||
<div class="overflow-label user">{value.email}</div>
|
||||
<span class="overflow-label user">{value.email}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</span>
|
||||
</DocNavLink>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
.user-container {
|
||||
cursor: pointer;
|
||||
|
||||
.user {
|
||||
margin-left: 0.5rem;
|
||||
font-weight: 500;
|
||||
text-align: left;
|
||||
color: var(--accent-color);
|
||||
}
|
||||
&:hover .user {
|
||||
text-decoration: underline;
|
||||
color: var(--caption-color);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -21,6 +21,7 @@
|
||||
import EmployeeAccountPresenter from './EmployeeAccountPresenter.svelte'
|
||||
|
||||
export let value: Ref<EmployeeAccount>
|
||||
export let disabled = false
|
||||
|
||||
let account: EmployeeAccount | undefined
|
||||
|
||||
@ -30,5 +31,5 @@
|
||||
</script>
|
||||
|
||||
{#if account}
|
||||
<EmployeeAccountPresenter value={account} />
|
||||
<EmployeeAccountPresenter value={account} {disabled} />
|
||||
{/if}
|
||||
|
Loading…
Reference in New Issue
Block a user