fix pulse issues (#10144)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov
2025-10-24 18:47:37 +07:00
committed by GitHub
parent f2e0ca1453
commit c6706903f7
4 changed files with 81 additions and 53 deletions
@@ -15,8 +15,8 @@
<script lang="ts">
import chunter from '@hcengineering/chunter'
import { type Doc, type PersonId, getCurrentAccount } from '@hcengineering/core'
import { getName, getPersonRefsBySocialIds } from '@hcengineering/contact'
import { getPersonsByPersonRefs } from '@hcengineering/contact-resources'
import { getName } from '@hcengineering/contact'
import { getPersonsByPersonIds } from '@hcengineering/contact-resources'
import { IntlString } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation'
import { Label } from '@hcengineering/ui'
@@ -26,7 +26,6 @@
const maxTypingPersons = 3
const acc = getCurrentAccount()
const client = getClient()
const hierarchy = getClient().getHierarchy()
interface TypingGroup {
@@ -58,21 +57,22 @@
const groups: TypingGroup[] = []
for (const [status, personIds] of groupedByStatus.entries()) {
const personRefs = await getPersonRefsBySocialIds(client, personIds)
const persons = await getPersonsByPersonRefs(Object.values(personRefs))
const persons = await getPersonsByPersonIds(personIds)
const names = Array.from(persons.values())
.map((person) => getName(hierarchy, person))
.sort((name1, name2) => name1.localeCompare(name2))
const displayNames = names.slice(0, maxTypingPersons).join(', ')
const moreCount = Math.max(names.length - maxTypingPersons, 0)
if (names.length > 0) {
const displayNames = names.slice(0, maxTypingPersons).join(', ')
const moreCount = Math.max(names.length - maxTypingPersons, 0)
groups.push({
status,
names: displayNames,
count: names.length,
moreCount
})
groups.push({
status,
names: displayNames,
count: names.length,
moreCount
})
}
}
groups.sort((a, b) => a.status.localeCompare(b.status))
@@ -14,8 +14,8 @@
-->
<script lang="ts">
import { type PersonId, getCurrentAccount } from '@hcengineering/core'
import { getName, getPersonRefsBySocialIds } from '@hcengineering/contact'
import { getPersonsByPersonRefs } from '@hcengineering/contact-resources'
import { getName } from '@hcengineering/contact'
import { getPersonsByPersonIds } from '@hcengineering/contact-resources'
import { IntlString } from '@hcengineering/platform'
import { getClient } from '@hcengineering/presentation'
import { Label } from '@hcengineering/ui'
@@ -28,7 +28,6 @@
const maxTypingPersons = 3
const acc = getCurrentAccount()
const client = getClient()
const hierarchy = getClient().getHierarchy()
interface TypingGroup {
@@ -60,21 +59,22 @@
const groups: TypingGroup[] = []
for (const [status, personIds] of groupedByStatus.entries()) {
const personRefs = await getPersonRefsBySocialIds(client, personIds)
const persons = await getPersonsByPersonRefs(Object.values(personRefs))
const persons = await getPersonsByPersonIds(personIds)
const names = Array.from(persons.values())
.map((person) => getName(hierarchy, person))
.sort((name1, name2) => name1.localeCompare(name2))
const displayNames = names.slice(0, maxTypingPersons).join(', ')
const moreCount = Math.max(names.length - maxTypingPersons, 0)
if (names.length > 0) {
const displayNames = names.slice(0, maxTypingPersons).join(', ')
const moreCount = Math.max(names.length - maxTypingPersons, 0)
groups.push({
status,
names: displayNames,
count: names.length,
moreCount
})
groups.push({
status,
names: displayNames,
count: names.length,
moreCount
})
}
}
groups.sort((a, b) => a.status.localeCompare(b.status))