Add WatchCard (#1465)

Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
Alex 2022-04-20 23:32:37 +07:00 committed by GitHub
parent 55b389f22b
commit fd717a9d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 39 additions and 3 deletions

View File

@ -425,7 +425,7 @@ export function createModel (builder: Builder): void {
label: board.string.Watch,
position: 130,
type: board.cardActionType.Action,
handler: board.cardActionHandler.Watch
component: board.component.WatchCard
},
board.cardAction.Watch
)

View File

@ -33,7 +33,8 @@ export default mergeIds(boardId, board, {
BoardPresenter: '' as AnyComponent,
TemplatesIcon: '' as AnyComponent,
Cards: '' as AnyComponent,
KanbanView: '' as AnyComponent
KanbanView: '' as AnyComponent,
WatchCard: '' as AnyComponent
},
space: {
DefaultBoard: '' as Ref<Space>

View File

@ -51,6 +51,7 @@
"Copy": "Copy",
"MakeTemplate": "Make Template",
"Watch": "Watch",
"Unwatch": "Unwatch",
"Archive": "Archive",
"SendToBoard": "Send to board",
"Delete": "Delete",

View File

@ -51,6 +51,7 @@
"Copy": "Копировать",
"MakeTemplate": "Шаблон",
"Watch": "Отслеживать",
"Unwatch": "Не отслеживать",
"Archive": "Архивировать",
"SendToBoard": "Вернуть",
"Delete": "Удалить",

View File

@ -42,6 +42,7 @@
"@anticrm/task-resources": "~0.6.0",
"@anticrm/core": "~0.6.16",
"@anticrm/notification": "~0.6.0",
"@anticrm/notification-resources": "~0.6.0",
"@anticrm/panel": "~0.6.0",
"@anticrm/platform": "~0.6.5",
"@anticrm/presentation": "~0.6.2",

View File

@ -0,0 +1,29 @@
<script lang="ts">
import type { Card } from '@anticrm/board'
import { Button } from '@anticrm/ui'
import { NotificationClientImpl } from '@anticrm/notification-resources'
import board from '../plugin'
export let object: Card
const notificationClient = NotificationClientImpl.getClient()
const lastViews = notificationClient.getLastViews()
$: lastView = $lastViews.get(object._id)
$: subscribed = lastView !== undefined && lastView !== -1
</script>
{#if subscribed}
<Button
icon={board.icon.Card}
label={board.string.Unwatch}
kind={'no-border'}
justify="left"
on:click={() => { notificationClient.unsubscribe(object._id) }}/>
{:else}
<Button
icon={board.icon.Card}
label={board.string.Watch}
kind={'no-border'}
justify="left"
on:click={() => { notificationClient.updateLastView(object._id, object._class, undefined, true) }}/>
{/if}

View File

@ -36,6 +36,7 @@ import DateRangePicker from './components/popups/DateRangePicker.svelte'
import EditMembersView from './components/popups/EditMembers.svelte'
import CardLabelPresenter from './components/presenters/LabelPresenter.svelte'
import CardDatePresenter from './components/presenters/DatePresenter.svelte'
import WatchCard from './components/WatchCard.svelte'
import {
addCurrentUser,
canAddCurrentUser,
@ -87,7 +88,8 @@ export default async (): Promise<Resources> => ({
CardLabelPresenter,
TemplatesIcon,
KanbanView,
BoardPresenter
BoardPresenter,
WatchCard
},
cardActionHandler: {
Join: addCurrentUser,

View File

@ -72,6 +72,7 @@ export default mergeIds(boardId, board, {
Copy: '' as IntlString,
MakeTemplate: '' as IntlString,
Watch: '' as IntlString,
Unwatch: '' as IntlString,
Archive: '' as IntlString,
SendToBoard: '' as IntlString,
Delete: '' as IntlString,