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">
|
2021-12-07 09:05:52 +00:00
|
|
|
import { AttachmentsPresenter } from '@anticrm/attachment-resources'
|
2022-02-04 09:03:24 +00:00
|
|
|
import { CommentsPresenter } from '@anticrm/chunter-resources'
|
2021-10-01 12:28:52 +00:00
|
|
|
import { formatName } from '@anticrm/contact'
|
2022-02-04 09:03:24 +00:00
|
|
|
import type { WithLookup } from '@anticrm/core'
|
2022-03-28 08:04:41 +00:00
|
|
|
import notification from '@anticrm/notification'
|
2022-02-04 09:03:24 +00:00
|
|
|
import { Avatar } from '@anticrm/presentation'
|
|
|
|
import type { Applicant } from '@anticrm/recruit'
|
2022-03-28 08:04:41 +00:00
|
|
|
import task, { TodoItem } from '@anticrm/task'
|
|
|
|
import { ActionIcon, Component, IconMoreH, showPanel, Tooltip } from '@anticrm/ui'
|
2022-02-04 09:03:24 +00:00
|
|
|
import view from '@anticrm/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-02-04 09:03:24 +00:00
|
|
|
showPanel(view.component.EditDoc, object.attachedTo, object.attachedToClass, 'full')
|
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)
|
2021-08-07 17:03:06 +00:00
|
|
|
</script>
|
|
|
|
|
2022-04-08 03:01:44 +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">
|
|
|
|
<div class="fs-title over-underline lines-limit-2" on:click={showCandidate}>
|
|
|
|
{formatName(object.$lookup?.attachedTo?.name ?? '')}
|
2022-02-25 09:04:57 +00:00
|
|
|
</div>
|
2022-04-08 03:01:44 +00:00
|
|
|
<div class="text-sm lines-limit-2">{object.$lookup?.attachedTo?.title ?? ''}</div>
|
2022-02-25 09:04:57 +00:00
|
|
|
</div>
|
2022-04-08 03:01:44 +00:00
|
|
|
</div>
|
|
|
|
<div class="tool mr-1 flex-row-center">
|
|
|
|
{#if !dragged}
|
2022-02-25 09:04:57 +00:00
|
|
|
<div class="mr-2">
|
|
|
|
<Component is={notification.component.NotificationPresenter} props={{ value: object }} />
|
2022-01-18 10:21:32 +00:00
|
|
|
</div>
|
2022-04-08 03:01:44 +00:00
|
|
|
<ActionIcon label={undefined} icon={IconMoreH} size={'small'} />
|
|
|
|
{/if}
|
2021-09-07 08:36:50 +00:00
|
|
|
</div>
|
2022-04-08 03:01:44 +00:00
|
|
|
</div>
|
|
|
|
<div class="flex-between">
|
|
|
|
<div class="flex-row-center">
|
|
|
|
<div class="sm-tool-icon step-lr75">
|
|
|
|
<ApplicationPresenter value={object} />
|
|
|
|
{#if todoItems.length > 0}
|
|
|
|
<Tooltip label={task.string.TodoItems} component={task.component.TodoItemsPopup} props={{ value: object }}>
|
|
|
|
<div class="ml-2">
|
|
|
|
( {doneTasks?.length}/ {todoItems.length} )
|
|
|
|
</div>
|
|
|
|
</Tooltip>
|
2021-11-30 11:14:30 +00:00
|
|
|
{/if}
|
2021-08-07 17:03:06 +00:00
|
|
|
</div>
|
2022-04-08 03:01:44 +00:00
|
|
|
{#if (object.attachments ?? 0) > 0}
|
|
|
|
<div class="step-lr75"><AttachmentsPresenter value={object} /></div>
|
|
|
|
{/if}
|
|
|
|
{#if (object.comments ?? 0) > 0}
|
|
|
|
<div class="step-lr75"><CommentsPresenter value={object} /></div>
|
|
|
|
{/if}
|
2021-08-07 17:03:06 +00:00
|
|
|
</div>
|
2022-04-08 03:01:44 +00:00
|
|
|
<Avatar avatar={object.$lookup?.assignee?.avatar} size={'x-small'} />
|
2021-08-07 17:03:06 +00:00
|
|
|
</div>
|