mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 12:35:02 +02:00
UBERF-11415: Optimise contact UI stores (#9185)
This commit is contained in:
@@ -15,13 +15,21 @@
|
||||
//
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { EmployeePresenter, personByPersonIdStore } from '@hcengineering/contact-resources'
|
||||
import { Person } from '@hcengineering/contact'
|
||||
import { EmployeePresenter, getPersonByPersonIdCb } from '@hcengineering/contact-resources'
|
||||
import { DocumentSnapshot } from '@hcengineering/document'
|
||||
import { TimeSince } from '@hcengineering/ui'
|
||||
|
||||
export let value: DocumentSnapshot
|
||||
|
||||
$: employee = value.createdBy !== undefined ? $personByPersonIdStore.get(value.createdBy) : undefined
|
||||
let employee: Person | undefined
|
||||
$: if (value.createdBy !== undefined) {
|
||||
getPersonByPersonIdCb(value.createdBy, (p) => {
|
||||
employee = p ?? undefined
|
||||
})
|
||||
} else {
|
||||
employee = undefined
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container flex-col flex-gap-2 flex-no-shrink">
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { deepEqual } from 'fast-equals'
|
||||
import { AccountArrayEditor, personRefByAccountUuidStore } from '@hcengineering/contact-resources'
|
||||
import { AccountArrayEditor, employeeRefByAccountUuidStore } from '@hcengineering/contact-resources'
|
||||
import core, {
|
||||
Data,
|
||||
DocumentUpdate,
|
||||
@@ -70,7 +70,7 @@
|
||||
let rolesAssignment: RolesAssignment = {}
|
||||
|
||||
$: isNew = teamspace === undefined
|
||||
$: membersPersons = members.map((m) => $personRefByAccountUuidStore.get(m)).filter(notEmpty)
|
||||
$: membersPersons = members.map((m) => $employeeRefByAccountUuidStore.get(m)).filter(notEmpty)
|
||||
|
||||
let typeId: Ref<SpaceType> | undefined = teamspace?.type ?? document.spaceType.DefaultTeamspaceType
|
||||
let spaceType: WithLookup<SpaceType> | undefined
|
||||
|
||||
Reference in New Issue
Block a user