Vacancy presenter (#992)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-02-11 15:19:21 +06:00 committed by GitHub
parent 7867150051
commit 8505d9f9ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 49 additions and 4 deletions

View File

@ -256,6 +256,10 @@ export function createModel (builder: Builder): void {
presenter: recruit.component.ApplicationPresenter
})
builder.mixin(recruit.class.Vacancy, core.class.Class, view.mixin.AttributePresenter, {
presenter: recruit.component.VacancyPresenter
})
builder.mixin(recruit.class.Applicant, core.class.Class, view.mixin.ObjectValidator, {
validator: recruit.validator.ApplicantValidator
})

View File

@ -51,6 +51,7 @@ export default mergeIds(recruitId, recruit, {
KanbanCard: '' as AnyComponent,
ApplicationPresenter: '' as AnyComponent,
ApplicationsPresenter: '' as AnyComponent,
VacancyPresenter: '' as AnyComponent,
EditApplication: '' as AnyComponent,
TemplatesIcon: '' as AnyComponent,
Applications: '' as AnyComponent,

View File

@ -0,0 +1,38 @@
<!--
// Copyright © 2020, 2021 Anticrm Platform Contributors.
// Copyright © 2021, 2022 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 { Vacancy } from '@anticrm/recruit'
import recruit from '../plugin'
import { closeTooltip, Icon } from '@anticrm/ui'
import { showPanel } from '@anticrm/ui/src/panelup'
import { createEventDispatcher } from 'svelte'
export let value: Vacancy
const dispatch = createEventDispatcher()
function show () {
dispatch('click')
closeTooltip()
showPanel(recruit.component.EditVacancy, value._id, value._class, 'right')
}
</script>
{#if value}
<div class="sm-tool-icon" on:click={show}>
<span class="icon"><Icon icon={recruit.icon.Vacancy} size={'small'} /></span>&nbsp;{value.name}
</div>
{/if}

View File

@ -32,6 +32,7 @@ import recruit from './plugin'
import { ObjectSearchResult } from '@anticrm/presentation'
import task from '@anticrm/task'
import ApplicationItem from './components/ApplicationItem.svelte'
import VacancyPresenter from './components/VacancyPresenter.svelte'
async function createApplication (object: Doc): Promise<void> {
showPopup(CreateApplication, { candidate: object._id, preserveCandidate: true })
@ -106,7 +107,8 @@ export default async (): Promise<Resources> => ({
TemplatesIcon,
Applications,
Candidates,
CreateCandidate
CreateCandidate,
VacancyPresenter
},
completion: {
ApplicationQuery: async (client: Client, query: string) => await queryApplication(client, query)

View File

@ -23,7 +23,7 @@
import { createEventDispatcher } from 'svelte'
export let _id: Ref<Space>
export let spaceClass: Ref<Class<Space>>
export let _class: Ref<Class<Space>>
let space: Space
@ -33,7 +33,7 @@
const dispatch = createEventDispatcher()
const client = getClient()
const clazz = client.getHierarchy().getClass(spaceClass)
const clazz = client.getHierarchy().getClass(_class)
const query = createQuery()
$: query.query(core.class.Space, { _id }, result => { space = result[0] })
@ -44,7 +44,7 @@
function onNameChange (ev: Event) {
const value = (ev.target as HTMLInputElement).value
if (value.trim().length > 0) {
client.updateDoc(spaceClass, space.space, space._id, { name: value })
client.updateDoc(_class, space.space, space._id, { name: value })
} else {
// Just refresh value
query.query(core.class.Space, { _id }, result => { space = result[0] })