TSK-1062: Work on Employee and EmployeeAccount migration (#2986)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev
2023-04-15 00:18:23 +07:00
committed by GitHub
parent 3ef19ed8d0
commit 62b18e1ce8
37 changed files with 267 additions and 472 deletions
@@ -13,15 +13,15 @@
// limitations under the License.
-->
<script lang="ts">
import contact, { EmployeeAccount } from '@hcengineering/contact'
import { employeeByIdStore, EmployeeBox } from '@hcengineering/contact-resources'
import { EmployeeAccount } from '@hcengineering/contact'
import { EmployeeBox, employeeAccountByIdStore, employeeByIdStore } from '@hcengineering/contact-resources'
import core, { ClassifierKind, Doc, Mixin, Ref } from '@hcengineering/core'
import { AttributeBarEditor, createQuery, getClient, KeyedAttribute } from '@hcengineering/presentation'
import { AttributeBarEditor, KeyedAttribute, createQuery, getClient } from '@hcengineering/presentation'
import tags from '@hcengineering/tags'
import type { Issue } from '@hcengineering/tracker'
import { Component, Label } from '@hcengineering/ui'
import { getFiltredKeys, isCollectionAttr, ObjectBox } from '@hcengineering/view-resources'
import { ObjectBox, getFiltredKeys, isCollectionAttr } from '@hcengineering/view-resources'
import tracker from '../../../plugin'
import ComponentEditor from '../../components/ComponentEditor.svelte'
import SprintEditor from '../../sprints/SprintEditor.svelte'
@@ -87,19 +87,10 @@
'blockedBy'
])
const employeeAccountQuery = createQuery()
let account: EmployeeAccount | undefined
$: employee = account && $employeeByIdStore.get(account.employee)
$: employeeAccountQuery.query(
contact.class.EmployeeAccount,
{ _id: issue.createdBy as Ref<EmployeeAccount> },
(res) => {
;[account] = res
},
{ limit: 1 }
)
$: account = $employeeAccountByIdStore.get(issue.createdBy as Ref<EmployeeAccount>)
</script>
<div class="content">