2021-08-07 17:03:06 +00:00
|
|
|
<!--
|
|
|
|
// Copyright © 2020, 2021 Anticrm Platform Contributors.
|
|
|
|
//
|
|
|
|
// 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">
|
2022-09-21 08:08:25 +00:00
|
|
|
import { AttachmentsPresenter } from '@hcengineering/attachment-resources'
|
|
|
|
import { CommentsPresenter } from '@hcengineering/chunter-resources'
|
|
|
|
import contact, { formatName } from '@hcengineering/contact'
|
|
|
|
import type { WithLookup } from '@hcengineering/core'
|
|
|
|
import notification from '@hcengineering/notification'
|
|
|
|
import { Avatar } from '@hcengineering/presentation'
|
|
|
|
import type { Applicant, Candidate } from '@hcengineering/recruit'
|
|
|
|
import task, { TodoItem } from '@hcengineering/task'
|
|
|
|
import { AssigneePresenter } from '@hcengineering/task-resources'
|
|
|
|
import { Component, showPanel, tooltip } from '@hcengineering/ui'
|
|
|
|
import view from '@hcengineering/view'
|
2021-11-19 15:05:20 +00:00
|
|
|
import ApplicationPresenter from './ApplicationPresenter.svelte'
|
2021-09-27 17:24:15 +00:00
|
|
|
|
2021-09-07 08:36:50 +00:00
|
|
|
export let object: WithLookup<Applicant>
|
2022-04-06 05:36:06 +00:00
|
|
|
export let dragged: boolean
|
2021-08-07 17:03:06 +00:00
|
|
|
|
2022-01-11 09:05:53 +00:00
|
|
|
function showCandidate () {
|
2022-06-27 06:36:27 +00:00
|
|
|
showPanel(view.component.EditDoc, object._id, object._class, 'content')
|
2021-09-27 16:44:09 +00:00
|
|
|
}
|
2022-03-28 08:04:41 +00:00
|
|
|
|
|
|
|
$: todoItems = (object.$lookup?.todoItems as TodoItem[]) ?? []
|
|
|
|
$: doneTasks = todoItems.filter((it) => it.done)
|
2022-06-27 06:36:27 +00:00
|
|
|
|
|
|
|
$: channels = (object.$lookup?.attachedTo as WithLookup<Candidate>)?.$lookup?.channels
|
2021-08-07 17:03:06 +00:00
|
|
|
</script>
|
|
|
|
|
2022-06-27 06:36:27 +00:00
|
|
|
<div class="flex-col pt-2 pb-2 pr-4 pl-4 cursor-pointer" on:click={showCandidate}>
|
2022-04-13 06:44:56 +00:00
|
|
|
<div class="flex-between mb-3">
|
|
|
|
<div class="flex-row-center">
|
|
|
|
<Avatar avatar={object.$lookup?.attachedTo?.avatar} size={'medium'} />
|
|
|
|
<div class="flex-grow flex-col min-w-0 ml-2">
|
2022-06-27 06:36:27 +00:00
|
|
|
<div class="fs-title over-underline lines-limit-2">
|
2022-04-13 06:44:56 +00:00
|
|
|
{formatName(object.$lookup?.attachedTo?.name ?? '')}
|
|
|
|
</div>
|
|
|
|
<div class="text-sm lines-limit-2">{object.$lookup?.attachedTo?.title ?? ''}</div>
|
2022-02-25 09:04:57 +00:00
|
|
|
</div>
|
2022-04-13 06:44:56 +00:00
|
|
|
</div>
|
|
|
|
<div class="tool mr-1 flex-row-center">
|
|
|
|
{#if !dragged}
|
|
|
|
<div class="mr-2">
|
|
|
|
<Component is={notification.component.NotificationPresenter} props={{ value: object }} />
|
|
|
|
</div>
|
|
|
|
{/if}
|
2022-02-25 09:04:57 +00:00
|
|
|
</div>
|
2022-06-27 06:36:27 +00:00
|
|
|
{#if channels && channels.length > 0}
|
|
|
|
<div class="tool mr-1 flex-row-center">
|
|
|
|
<div class="step-lr75">
|
|
|
|
<Component
|
|
|
|
is={contact.component.ChannelsPresenter}
|
|
|
|
props={{ value: channels, object: object.$lookup?.attachedTo, length: 'tiny' }}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{/if}
|
2022-04-08 03:01:44 +00:00
|
|
|
</div>
|
2022-04-13 06:44:56 +00:00
|
|
|
<div class="flex-between">
|
|
|
|
<div class="flex-row-center">
|
|
|
|
<div class="sm-tool-icon step-lr75">
|
|
|
|
<ApplicationPresenter value={object} />
|
|
|
|
{#if todoItems.length > 0}
|
2022-06-30 03:41:46 +00:00
|
|
|
<div
|
|
|
|
class="ml-2"
|
|
|
|
use:tooltip={{
|
|
|
|
label: task.string.TodoItems,
|
|
|
|
component: task.component.TodoItemsPopup,
|
|
|
|
props: { value: object }
|
|
|
|
}}
|
|
|
|
>
|
|
|
|
({doneTasks?.length}/{todoItems.length})
|
|
|
|
</div>
|
2022-04-13 06:44:56 +00:00
|
|
|
{/if}
|
2022-01-18 10:21:32 +00:00
|
|
|
</div>
|
2022-04-13 06:44:56 +00:00
|
|
|
{#if (object.attachments ?? 0) > 0}
|
|
|
|
<div class="step-lr75">
|
2022-05-19 07:14:05 +00:00
|
|
|
<AttachmentsPresenter value={object.attachments} {object} />
|
2022-04-13 06:44:56 +00:00
|
|
|
</div>
|
|
|
|
{/if}
|
|
|
|
{#if (object.comments ?? 0) > 0}
|
|
|
|
<div class="step-lr75">
|
2022-05-19 07:14:05 +00:00
|
|
|
<CommentsPresenter value={object.comments} {object} />
|
2022-04-13 06:44:56 +00:00
|
|
|
</div>
|
2021-11-30 11:14:30 +00:00
|
|
|
{/if}
|
2021-08-07 17:03:06 +00:00
|
|
|
</div>
|
2022-06-27 06:36:27 +00:00
|
|
|
<AssigneePresenter
|
|
|
|
value={object.$lookup?.assignee}
|
|
|
|
issueId={object._id}
|
|
|
|
defaultClass={contact.class.Employee}
|
|
|
|
currentSpace={object.space}
|
|
|
|
/>
|
2021-08-07 17:03:06 +00:00
|
|
|
</div>
|
|
|
|
</div>
|