platform/plugins/recruit-resources/src/components/EditApplication.svelte
Alexander Platov b05e230246
Update Application layout (#738)
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
2021-12-28 10:12:47 +01:00

65 lines
2.0 KiB
Svelte

<!--
// 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 { createEventDispatcher, onMount } from 'svelte'
import { createQuery } from '@anticrm/presentation'
import type { Candidate, Applicant, Vacancy } from '@anticrm/recruit'
import CandidateCard from './CandidateCard.svelte'
import VacancyCard from './VacancyCard.svelte'
import ExpandRightDouble from './icons/ExpandRightDouble.svelte'
import recruit from '../plugin'
export let object: Applicant
let candidate: Candidate
let vacancy: Vacancy
const candidateQuery = createQuery()
$: if (object !== undefined)
{candidateQuery.query(recruit.class.Candidate, { _id: object.attachedTo }, (result) => {
candidate = result[0]
})}
const vacancyQuery = createQuery()
$: if (object !== undefined)
{vacancyQuery.query(recruit.class.Vacancy, { _id: object.space }, (result) => {
vacancy = result[0]
})}
const dispatch = createEventDispatcher()
onMount(() => {
dispatch('open', { ignoreKeys: ['comments', 'number'] })
})
</script>
{#if object !== undefined && candidate !== undefined}
<div class="grid-cards">
<CandidateCard {candidate} />
<ExpandRightDouble />
<VacancyCard {vacancy} />
</div>
{/if}
<style lang="scss">
.grid-cards {
display: grid;
grid-template-columns: 1fr 4rem 1fr;
column-gap: 1.5rem;
align-items: center;
}
</style>