initial create application button in candidates pool

Signed-off-by: Andrey Platov <andrey@hardcoreeng.com>
This commit is contained in:
Andrey Platov 2021-09-08 13:24:49 +02:00
parent 3ab72eb819
commit 4f33365b25
No known key found for this signature in database
GPG Key ID: C8787EFEB4B64AF0
9 changed files with 474 additions and 435 deletions

File diff suppressed because it is too large Load Diff

View File

@ -108,7 +108,7 @@ export function createModel (builder: Builder): void {
resume: chunter.class.Attachment
}
} as FindOptions<Doc>, // TODO: fix
config: ['', 'city', '$lookup.resume', 'channels']
config: ['', '#' + recruit.component.CreateApplicationPresenter, 'city', '$lookup.resume', 'channels']
})
builder.createDoc(view.class.Viewlet, core.space.Model, {

View File

@ -33,7 +33,8 @@ export default mergeIds(recruitId, recruit, {
CreateCandidate: '' as AnyComponent,
CreateApplication: '' as AnyComponent,
EditCandidate: '' as AnyComponent,
KanbanCard: '' as AnyComponent
KanbanCard: '' as AnyComponent,
CreateApplicationPresenter: '' as AnyComponent
},
space: {
CandidatesPublic: '' as Ref<Space>

View File

@ -29,12 +29,10 @@
import contact from '@anticrm/contact'
export let space: Ref<Space>
export let candidate: Ref<Person>
export let employee: Ref<Employee>
const dispatch = createEventDispatcher()
let candidate: Ref<Person>
let employee: Ref<Employee>
const client = getClient()
async function createApplication() {

View File

@ -0,0 +1,29 @@
<!--
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import type { Doc } from '@anticrm/core'
import { Button, showPopup } from '@anticrm/ui'
import CreateApplication from './CreateApplication.svelte'
export let object: Doc
let button: HTMLElement
</script>
<div bind:this={button}><Button label="Create Application" size="small" on:click={ () => { showPopup(CreateApplication, { candidate: object._id }, button) } }/></div>

View File

@ -21,6 +21,7 @@ import EditCandidate from './components/EditCandidate.svelte'
import CandidateGeneral from './components/CandidateGeneral.svelte'
import Attachments from './components/Attachments.svelte'
import KanbanCard from './components/KanbanCard.svelte'
import CreateApplicationPresenter from './components/CreateApplicationPresenter.svelte'
export default async () => ({
component: {
@ -31,6 +32,7 @@ export default async () => ({
EditCandidate,
CandidateGeneral,
Attachments,
KanbanCard
KanbanCard,
CreateApplicationPresenter
},
})

View File

@ -72,7 +72,7 @@
{#each objects as object (object._id)}
<tr class="tr-body" on:click={() => onClick(object)}>
{#each model as attribute}
<td><svelte:component this={attribute.presenter} value={getValue(object, attribute.key)}/></td>
<td><svelte:component this={attribute.presenter} {object} value={getValue(object, attribute.key)}/></td>
{/each}
</tr>
{/each}

View File

@ -17,7 +17,7 @@
import type { IntlString } from '@anticrm/platform'
import { getResource } from '@anticrm/platform'
import type { Ref, Class, Obj, FindOptions, Doc, Client } from '@anticrm/core'
import type { AnySvelteComponent } from '@anticrm/ui'
import type { AnyComponent, AnySvelteComponent } from '@anticrm/ui'
import view from '@anticrm/view'
@ -64,6 +64,13 @@ async function getPresenter(client: Client, _class: Ref<Class<Obj>>, key: string
if (key.length === 0) {
return getObjectPresenter(client, _class, preserveKey)
} else {
if (key.startsWith('#')) {
return {
key: '',
label: '' as IntlString,
presenter: await getResource(key.substring(1) as AnyComponent)
}
}
const split = key.split('.')
if (split[0] === '$lookup') {
const lookupClass = (options?.lookup as any)[split[1]] as Ref<Class<Obj>>

File diff suppressed because it is too large Load Diff