Skip to content

Commit

Permalink
fix: improve reactions tooltip (#7470)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <[email protected]>
  • Loading branch information
aonnikov authored Dec 13, 2024
1 parent a122f86 commit 9994ffe
Showing 1 changed file with 7 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
<script lang="ts">
import { Person, PersonAccount, getName } from '@hcengineering/contact'
import { personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
import { Account, IdMap, Ref } from '@hcengineering/core'
import { getClient } from '@hcengineering/presentation'
import core, { Account, Ref } from '@hcengineering/core'
import { ObjectPresenter } from '@hcengineering/view-resources'
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>

{#each reactionAccounts as acc}
<div>
{getAccName(acc, $personAccountByIdStore, $personByIdStore)}
</div>
{/each}
<div class="m-2 flex-col flex-gap-2">
{#each reactionAccounts as acc}
<ObjectPresenter objectId={acc} _class={core.class.Account} disabled />
{/each}
</div>

0 comments on commit 9994ffe

Please sign in to comment.