diff --git a/plugins/board-resources/src/components/KanbanCard.svelte b/plugins/board-resources/src/components/KanbanCard.svelte index 3af9048907..60b3ba6df1 100644 --- a/plugins/board-resources/src/components/KanbanCard.svelte +++ b/plugins/board-resources/src/components/KanbanCard.svelte @@ -20,8 +20,9 @@ import contact, { Employee } from '@anticrm/contact' import type { Ref, WithLookup } from '@anticrm/core' import notification from '@anticrm/notification' + import view from '@anticrm/view' import { getClient, UserBoxList } from '@anticrm/presentation' - import { Button, Component, EditBox, IconEdit, Label, numberToHexColor, showPopup } from '@anticrm/ui' + import { Button, Component, EditBox, Icon, IconEdit, Label, numberToHexColor, showPopup } from '@anticrm/ui' import { ContextMenu } from '@anticrm/view-resources' import board from '../plugin' import CardLabels from './editor/CardLabels.svelte' @@ -29,6 +30,7 @@ import { hasDate, openCardPanel, updateCard, updateCardMembers } from '../utils/CardUtils' import { getElementPopupAlignment } from '../utils/PopupUtils' import CheckListsPresenter from './presenters/ChecklistsPresenter.svelte' + import NotificationPresenter from './presenters/NotificationPresenter.svelte' export let object: WithLookup<Card> @@ -172,11 +174,22 @@ </div> <div class="flex-between mb-1" style:pointer-events={dragoverAttachment ? 'none' : 'all'}> <div class="float-left-box"> + <!-- TODO: adjust icons --> + <div class="float-left"> + <NotificationPresenter {object} /> + </div> {#if object.date && hasDate(object)} - <div class="float-left ml-1"> + <div class="float-left"> <DatePresenter value={object.date} size="x-small" on:update={updateDate} /> </div> {/if} + {#if object.description} + <div class="float-left"> + <div class="sm-tool-icon ml-1 mr-1"> + <span class="icon"><Icon icon={view.icon.Table} size="small" /></span> + </div> + </div> + {/if} {#if (object.attachments ?? 0) > 0} <div class="float-left"> <AttachmentsPresenter value={object.attachments} {object} size="small" /> diff --git a/plugins/board-resources/src/components/presenters/ChecklistsPresenter.svelte b/plugins/board-resources/src/components/presenters/ChecklistsPresenter.svelte index 6ff3324105..19de62bbe6 100644 --- a/plugins/board-resources/src/components/presenters/ChecklistsPresenter.svelte +++ b/plugins/board-resources/src/components/presenters/ChecklistsPresenter.svelte @@ -30,7 +30,7 @@ <Icon icon={board.icon.Card} {size} /> {done}/{total} {#if item.dueTo !== null} - <DatePresenter value={item.dueTo} size="small" icon={getDateIcon(item)} kind="transparent" /> + <DatePresenter value={item.dueTo} size="x-small" icon={getDateIcon(item)} kind="transparent" /> {/if} </div> {/if} diff --git a/plugins/board-resources/src/components/presenters/NotificationPresenter.svelte b/plugins/board-resources/src/components/presenters/NotificationPresenter.svelte new file mode 100644 index 0000000000..1fd043a121 --- /dev/null +++ b/plugins/board-resources/src/components/presenters/NotificationPresenter.svelte @@ -0,0 +1,34 @@ +<!-- +// Copyright © 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 { Doc } from '@anticrm/core' + import notification from '@anticrm/notification' + import { NotificationClientImpl } from '@anticrm/notification-resources' + import { Icon, IconSize } from '@anticrm/ui' + + export let object: Doc + export let size: IconSize = 'small' + + const notificationClient = NotificationClientImpl.getClient() + const lastViews = notificationClient.getLastViews() + $: lastView = $lastViews.get(object._id) + $: subscribed = lastView !== undefined && lastView !== -1 +</script> + +{#if subscribed} + <div class="sm-tool-icon ml-1 mr-1 flex-center"> + <span class="icon"><Icon icon={notification.icon.Notifications} {size} /></span> + </div> +{/if}