mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
Add WatchCard (#1465)
Signed-off-by: Dvinyanin Alexandr <dvinyanin.alexandr@gmail.com>
This commit is contained in:
parent
55b389f22b
commit
fd717a9d59
@ -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
|
||||
)
|
||||
|
@ -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>
|
||||
|
@ -51,6 +51,7 @@
|
||||
"Copy": "Copy",
|
||||
"MakeTemplate": "Make Template",
|
||||
"Watch": "Watch",
|
||||
"Unwatch": "Unwatch",
|
||||
"Archive": "Archive",
|
||||
"SendToBoard": "Send to board",
|
||||
"Delete": "Delete",
|
||||
|
@ -51,6 +51,7 @@
|
||||
"Copy": "Копировать",
|
||||
"MakeTemplate": "Шаблон",
|
||||
"Watch": "Отслеживать",
|
||||
"Unwatch": "Не отслеживать",
|
||||
"Archive": "Архивировать",
|
||||
"SendToBoard": "Вернуть",
|
||||
"Delete": "Удалить",
|
||||
|
@ -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",
|
||||
|
29
plugins/board-resources/src/components/WatchCard.svelte
Normal file
29
plugins/board-resources/src/components/WatchCard.svelte
Normal 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}
|
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user