mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-22 08:20:39 +00:00
userbox fixes and preserve candidate
Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
parent
6dd4084b61
commit
c265bf64cf
@ -24,6 +24,7 @@
|
|||||||
"@anticrm/query": "~0.6.1",
|
"@anticrm/query": "~0.6.1",
|
||||||
"@anticrm/ui": "~0.6.0",
|
"@anticrm/ui": "~0.6.0",
|
||||||
"@anticrm/view": "~0.6.0",
|
"@anticrm/view": "~0.6.0",
|
||||||
"svelte": "^3.37.0"
|
"svelte": "^3.37.0",
|
||||||
|
"@anticrm/contact": "~0.6.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte'
|
import { onMount } from 'svelte'
|
||||||
import type { IntlString } from '@anticrm/platform'
|
import type { IntlString } from '@anticrm/platform'
|
||||||
|
import { getClient } from '../utils'
|
||||||
|
|
||||||
import { Label, showPopup } from '@anticrm/ui'
|
import { Label, showPopup } from '@anticrm/ui'
|
||||||
import Avatar from './Avatar.svelte'
|
import Avatar from './Avatar.svelte'
|
||||||
@ -25,6 +26,8 @@
|
|||||||
import type { Ref, Class } from '@anticrm/core'
|
import type { Ref, Class } from '@anticrm/core'
|
||||||
import type { Person } from '@anticrm/contact'
|
import type { Person } from '@anticrm/contact'
|
||||||
|
|
||||||
|
import contact from '@anticrm/contact'
|
||||||
|
|
||||||
export let _class: Ref<Class<Person>>
|
export let _class: Ref<Class<Person>>
|
||||||
export let title: IntlString
|
export let title: IntlString
|
||||||
export let caption: IntlString
|
export let caption: IntlString
|
||||||
@ -34,6 +37,14 @@
|
|||||||
let selected: Person | undefined
|
let selected: Person | undefined
|
||||||
let btn: HTMLElement
|
let btn: HTMLElement
|
||||||
|
|
||||||
|
const client = getClient()
|
||||||
|
|
||||||
|
async function updateSelected(value: Ref<Person>) {
|
||||||
|
selected = await client.findOne(contact.class.Person, { _id: value })
|
||||||
|
}
|
||||||
|
|
||||||
|
$: updateSelected(value)
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
if (btn && show) {
|
if (btn && show) {
|
||||||
btn.click()
|
btn.click()
|
||||||
@ -50,7 +61,6 @@
|
|||||||
on:click|preventDefault={(ev) => {
|
on:click|preventDefault={(ev) => {
|
||||||
showPopup(UsersPopup, { _class, title, caption }, ev.target, (result) => {
|
showPopup(UsersPopup, { _class, title, caption }, ev.target, (result) => {
|
||||||
if (result) {
|
if (result) {
|
||||||
selected = result
|
|
||||||
value = result._id
|
value = result._id
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
export let candidate: Ref<Person>
|
export let candidate: Ref<Person>
|
||||||
export let employee: Ref<Employee>
|
export let employee: Ref<Employee>
|
||||||
|
|
||||||
|
export let preserveCandidate = false
|
||||||
|
|
||||||
const dispatch = createEventDispatcher()
|
const dispatch = createEventDispatcher()
|
||||||
const client = getClient()
|
const client = getClient()
|
||||||
|
|
||||||
@ -55,7 +57,9 @@
|
|||||||
canSave={candidate !== undefined}
|
canSave={candidate !== undefined}
|
||||||
on:close={() => { dispatch('close') }}>
|
on:close={() => { dispatch('close') }}>
|
||||||
<Grid column={1} rowGap={1.75}>
|
<Grid column={1} rowGap={1.75}>
|
||||||
|
{#if !preserveCandidate}
|
||||||
<UserBox _class={recruit.class.Candidate} title='Candidate' caption='Candidates' bind:value={candidate} />
|
<UserBox _class={recruit.class.Candidate} title='Candidate' caption='Candidates' bind:value={candidate} />
|
||||||
|
{/if}
|
||||||
<UserBox _class={contact.class.Employee} title='Assigned recruiter' caption='Recruiters' bind:value={employee} />
|
<UserBox _class={contact.class.Employee} title='Assigned recruiter' caption='Recruiters' bind:value={employee} />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="flex-center presenter-container" bind:this={button}
|
<div class="flex-center presenter-container" bind:this={button}
|
||||||
on:click={() => { showPopup(CreateApplication, { candidate: object._id }, button) }}
|
on:click={() => { showPopup(CreateApplication, { candidate: object._id, preserveCandidate: true }, button) }}
|
||||||
>
|
>
|
||||||
<Label label="Create Application" />
|
<Label label="Create Application" />
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user