mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-28 04:25:03 +02:00
add first/last to EmployeeAccount
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
+216
-214
File diff suppressed because it is too large
Load Diff
@@ -118,7 +118,9 @@ program
|
||||
console.log('create account in target workspace...')
|
||||
await txop.createDoc(contact.class.EmployeeAccount, core.space.Model, {
|
||||
email,
|
||||
employee
|
||||
employee,
|
||||
firstName: account.first,
|
||||
lastName: account.last
|
||||
})
|
||||
|
||||
contrib.close()
|
||||
|
||||
+216
-214
File diff suppressed because it is too large
Load Diff
@@ -80,6 +80,8 @@ export class TEmployee extends TPerson implements Employee {
|
||||
@Model(contact.class.EmployeeAccount, core.class.Account)
|
||||
export class TEmployeeAccount extends TAccount implements EmployeeAccount {
|
||||
employee!: Ref<Employee>
|
||||
firstName!: string
|
||||
lastName!: string
|
||||
}
|
||||
|
||||
export function createModel (builder: Builder): void {
|
||||
|
||||
@@ -32,7 +32,9 @@ export function createDemo (builder: Builder): void {
|
||||
|
||||
builder.createDoc(contact.class.EmployeeAccount, core.space.Model, {
|
||||
email: 'rosamund@hc.engineering',
|
||||
employee: rosamund as any
|
||||
employee: rosamund as any,
|
||||
firstName: 'Rosamund',
|
||||
lastName: 'Chen'
|
||||
})
|
||||
|
||||
builder.createDoc(recruit.class.Candidate, recruit.space.CandidatesPublic, {
|
||||
|
||||
@@ -25,24 +25,19 @@
|
||||
|
||||
export let comment: Comment
|
||||
|
||||
let employee: Employee | undefined
|
||||
let employee: EmployeeAccount | undefined
|
||||
|
||||
console.log('comment modified by', comment.modifiedBy)
|
||||
|
||||
const client = getClient()
|
||||
client.findOne(contact.class.EmployeeAccount, { _id: comment.modifiedBy as Ref<EmployeeAccount> })
|
||||
.then(account => client.findOne(contact.class.Employee, { _id: account?.employee }))
|
||||
.then(result => {
|
||||
console.log('comment', result)
|
||||
employee = result
|
||||
})
|
||||
client.findOne(contact.class.EmployeeAccount, { _id: comment.modifiedBy as Ref<EmployeeAccount> }).then(account => {employee = account})
|
||||
|
||||
</script>
|
||||
|
||||
<div class="flex-nowrap">
|
||||
<div class="avatar"><Avatar size={'medium'} /></div>
|
||||
<div class="flex-col-stretch message">
|
||||
<div class="header">{#if employee}{employee.firstName} {employee.lastName}{/if}<span>July 28th</span></div>
|
||||
<div class="header">{#if employee}{employee.firstName} {employee.lastName}{/if}<span>{comment.modifiedOn}</span></div>
|
||||
<div class="text"><MessageViewer message={comment.message} /></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -68,6 +68,8 @@ export interface Employee extends Person {
|
||||
*/
|
||||
export interface EmployeeAccount extends Account {
|
||||
employee: Ref<Employee>
|
||||
firstName: string
|
||||
lastName: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+216
-214
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user