mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-21 07:46:24 +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/ui": "~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">
|
||||
import { onMount } from 'svelte'
|
||||
import type { IntlString } from '@anticrm/platform'
|
||||
import { getClient } from '../utils'
|
||||
|
||||
import { Label, showPopup } from '@anticrm/ui'
|
||||
import Avatar from './Avatar.svelte'
|
||||
@ -25,6 +26,8 @@
|
||||
import type { Ref, Class } from '@anticrm/core'
|
||||
import type { Person } from '@anticrm/contact'
|
||||
|
||||
import contact from '@anticrm/contact'
|
||||
|
||||
export let _class: Ref<Class<Person>>
|
||||
export let title: IntlString
|
||||
export let caption: IntlString
|
||||
@ -34,6 +37,14 @@
|
||||
let selected: Person | undefined
|
||||
let btn: HTMLElement
|
||||
|
||||
const client = getClient()
|
||||
|
||||
async function updateSelected(value: Ref<Person>) {
|
||||
selected = await client.findOne(contact.class.Person, { _id: value })
|
||||
}
|
||||
|
||||
$: updateSelected(value)
|
||||
|
||||
onMount(() => {
|
||||
if (btn && show) {
|
||||
btn.click()
|
||||
@ -50,7 +61,6 @@
|
||||
on:click|preventDefault={(ev) => {
|
||||
showPopup(UsersPopup, { _class, title, caption }, ev.target, (result) => {
|
||||
if (result) {
|
||||
selected = result
|
||||
value = result._id
|
||||
}
|
||||
})
|
||||
|
@ -32,6 +32,8 @@
|
||||
export let candidate: Ref<Person>
|
||||
export let employee: Ref<Employee>
|
||||
|
||||
export let preserveCandidate = false
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
const client = getClient()
|
||||
|
||||
@ -55,7 +57,9 @@
|
||||
canSave={candidate !== undefined}
|
||||
on:close={() => { dispatch('close') }}>
|
||||
<Grid column={1} rowGap={1.75}>
|
||||
<UserBox _class={recruit.class.Candidate} title='Candidate' caption='Candidates' bind:value={candidate} />
|
||||
{#if !preserveCandidate}
|
||||
<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} />
|
||||
</Grid>
|
||||
</Card>
|
||||
|
@ -27,7 +27,7 @@
|
||||
</script>
|
||||
|
||||
<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" />
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user