mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-23 03:22:19 +03:00
Vacancy presenter (#992)
Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
parent
7867150051
commit
8505d9f9ba
@ -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
|
||||
})
|
||||
|
@ -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,
|
||||
|
@ -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> {value.name}
|
||||
</div>
|
||||
{/if}
|
@ -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)
|
||||
|
@ -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] })
|
||||
|
Loading…
Reference in New Issue
Block a user