-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improve reactions tooltip (#7470)
Signed-off-by: Alexander Onnikov <[email protected]>
- Loading branch information
Showing
1 changed file
with
7 additions
and
19 deletions.
There are no files selected for viewing
26 changes: 7 additions & 19 deletions
26
plugins/activity-resources/src/components/reactions/ReactionsTooltip.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |