mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-30 21:45:01 +02:00
UBER-665: Rename EmployeeAccount->PersonAccount (#3550)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
@@ -13,15 +13,15 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { Employee, EmployeeAccount } from '@hcengineering/contact'
|
||||
import { AssigneeBox, employeeAccountByIdStore } from '@hcengineering/contact-resources'
|
||||
import { Employee, PersonAccount, Person } from '@hcengineering/contact'
|
||||
import { AssigneeBox, personAccountByIdStore } from '@hcengineering/contact-resources'
|
||||
import { Doc, DocumentQuery, Ref } from '@hcengineering/core'
|
||||
import { createQuery, getClient } from '@hcengineering/presentation'
|
||||
import { Issue, Project } from '@hcengineering/tracker'
|
||||
import { ButtonKind, ButtonSize, IconSize, TooltipAlignment } from '@hcengineering/ui'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { getPreviousAssignees } from '../../utils'
|
||||
import tracker from '../../plugin'
|
||||
import { getPreviousAssignees } from '../../utils'
|
||||
|
||||
type Object = (Doc | {}) & Pick<Issue, 'space' | 'component' | 'assignee'>
|
||||
|
||||
@@ -40,10 +40,10 @@
|
||||
const projectQuery = createQuery()
|
||||
|
||||
let project: Project | undefined
|
||||
let prevAssigned: Ref<Employee>[] = []
|
||||
let prevAssigned: Ref<Person>[] = []
|
||||
let componentLead: Ref<Employee> | undefined = undefined
|
||||
let members: Ref<Employee>[] = []
|
||||
let docQuery: DocumentQuery<Employee> = { active: true }
|
||||
let docQuery: DocumentQuery<Employee> = {}
|
||||
|
||||
$: '_class' in object &&
|
||||
getPreviousAssignees(object._id).then((res) => {
|
||||
@@ -59,17 +59,17 @@
|
||||
}
|
||||
if (project !== undefined) {
|
||||
const accounts = project.members
|
||||
.map((p) => $employeeAccountByIdStore.get(p as Ref<EmployeeAccount>))
|
||||
.filter((p) => p !== undefined) as EmployeeAccount[]
|
||||
members = accounts.map((p) => p.employee)
|
||||
.map((p) => $personAccountByIdStore.get(p as Ref<PersonAccount>))
|
||||
.filter((p) => p !== undefined) as PersonAccount[]
|
||||
members = accounts.map((p) => p.person as Ref<Employee>)
|
||||
} else {
|
||||
members = []
|
||||
}
|
||||
|
||||
docQuery = project?.private ? { _id: { $in: members }, active: true } : { active: true }
|
||||
docQuery = project?.private ? { _id: { $in: members } } : { active: true }
|
||||
}
|
||||
|
||||
const handleAssigneeChanged = async (newAssignee: Ref<Employee> | undefined) => {
|
||||
const handleAssigneeChanged = async (newAssignee: Ref<Person> | undefined) => {
|
||||
if (newAssignee === undefined || object.assignee === newAssignee) {
|
||||
return
|
||||
}
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
$: projectQuery.query(tracker.class.Project, { _id: object.space }, (res) => ([project] = res))
|
||||
$: project && updateComponentMembers(project, object)
|
||||
$: docQuery = project?.private ? { _id: { $in: members }, active: true } : { active: true }
|
||||
$: docQuery = project?.private ? { _id: { $in: members } } : {}
|
||||
</script>
|
||||
|
||||
{#if object}
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { EmployeeAccount } from '@hcengineering/contact'
|
||||
import { EmployeeBox, employeeAccountByIdStore, employeeByIdStore } from '@hcengineering/contact-resources'
|
||||
import { PersonAccount } from '@hcengineering/contact'
|
||||
import { EmployeeBox, personAccountByIdStore, personByIdStore } from '@hcengineering/contact-resources'
|
||||
import core, { ClassifierKind, Doc, Mixin, Ref } from '@hcengineering/core'
|
||||
import { AttributeBarEditor, KeyedAttribute, createQuery, getClient } from '@hcengineering/presentation'
|
||||
|
||||
@@ -87,10 +87,10 @@
|
||||
'blockedBy'
|
||||
])
|
||||
|
||||
let account: EmployeeAccount | undefined
|
||||
$: employee = account && $employeeByIdStore.get(account.employee)
|
||||
let account: PersonAccount | undefined
|
||||
|
||||
$: account = $employeeAccountByIdStore.get(issue.createdBy as Ref<EmployeeAccount>)
|
||||
$: account = $personAccountByIdStore.get(issue.createdBy as Ref<PersonAccount>)
|
||||
$: employee = account && $personByIdStore.get(account.person)
|
||||
</script>
|
||||
|
||||
<div class="popupPanel-body__aside-grid">
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@
|
||||
width={'100%'}
|
||||
kind={'ghost'}
|
||||
label={tracker.string.Assignee}
|
||||
_class={contact.class.Employee}
|
||||
_class={contact.mixin.Employee}
|
||||
value={issue.assignee}
|
||||
readonly
|
||||
showNavigate={false}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
const options: FindOptions<TimeSpendReport> = {
|
||||
lookup: {
|
||||
attachedTo: tracker.class.Issue,
|
||||
employee: contact.class.Employee
|
||||
employee: contact.mixin.Employee
|
||||
}
|
||||
}
|
||||
function addReport (event: MouseEvent): void {
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@
|
||||
export let issueId: Ref<Issue> | undefined = issue?._id
|
||||
export let issueClass: Ref<Class<Issue>> = issue?._class ?? tracker.class.Issue
|
||||
export let space: Ref<Space> | undefined = issue?.space
|
||||
export let assignee: Ref<Employee> | null | undefined = issue?.assignee
|
||||
export let assignee: Ref<Employee> | null | undefined = issue?.assignee as Ref<Employee>
|
||||
|
||||
export let value: TimeSpendReport | undefined
|
||||
export let placeholder: IntlString = tracker.string.TimeSpendReportValue
|
||||
@@ -131,7 +131,7 @@
|
||||
<EditBox bind:value={data.description} placeholder={tracker.string.TimeSpendReportDescription} kind={'editbox'} />
|
||||
<svelte:fragment slot="pool">
|
||||
<UserBox
|
||||
_class={contact.class.Employee}
|
||||
_class={contact.mixin.Employee}
|
||||
label={contact.string.Employee}
|
||||
kind={'regular'}
|
||||
size={'large'}
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@
|
||||
width={'100%'}
|
||||
kind={'ghost'}
|
||||
label={tracker.string.Assignee}
|
||||
_class={contact.class.Employee}
|
||||
_class={contact.mixin.Employee}
|
||||
value={report.employee}
|
||||
readonly
|
||||
showNavigate={false}
|
||||
|
||||
Reference in New Issue
Block a user