fix: improve reactions tooltip (#7470)
Some checks failed
CI / build (push) Has been cancelled
CI / uitest (push) Has been cancelled
CI / uitest-pg (push) Has been cancelled
CI / uitest-qms (push) Has been cancelled
CI / svelte-check (push) Has been cancelled
CI / formatting (push) Has been cancelled
CI / test (push) Has been cancelled
CI / docker-build (push) Has been cancelled
CI / dist-build (push) Has been cancelled

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2024-12-14 01:20:23 +07:00 committed by GitHub
parent a122f866e8
commit 9994ffedc2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,24 +1,12 @@
<script lang="ts"> <script lang="ts">
import { Person, PersonAccount, getName } from '@hcengineering/contact' import core, { Account, Ref } from '@hcengineering/core'
import { personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources' import { ObjectPresenter } from '@hcengineering/view-resources'
import { Account, IdMap, Ref } from '@hcengineering/core'
import { getClient } from '@hcengineering/presentation'
export let reactionAccounts: Ref<Account>[] export let reactionAccounts: Ref<Account>[]
const client = getClient()
function getAccName (acc: Ref<Account>, accounts: IdMap<PersonAccount>, employees: IdMap<Person>): string {
const account = accounts.get(acc as Ref<PersonAccount>)
if (account !== undefined) {
const emp = employees.get(account.person)
return emp ? getName(client.getHierarchy(), emp) : ''
}
return ''
}
</script> </script>
{#each reactionAccounts as acc} <div class="m-2 flex-col flex-gap-2">
<div> {#each reactionAccounts as acc}
{getAccName(acc, $personAccountByIdStore, $personByIdStore)} <ObjectPresenter objectId={acc} _class={core.class.Account} disabled />
</div> {/each}
{/each} </div>