mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 19:11:33 +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,
|
label: board.string.Watch,
|
||||||
position: 130,
|
position: 130,
|
||||||
type: board.cardActionType.Action,
|
type: board.cardActionType.Action,
|
||||||
handler: board.cardActionHandler.Watch
|
component: board.component.WatchCard
|
||||||
},
|
},
|
||||||
board.cardAction.Watch
|
board.cardAction.Watch
|
||||||
)
|
)
|
||||||
|
@ -33,7 +33,8 @@ export default mergeIds(boardId, board, {
|
|||||||
BoardPresenter: '' as AnyComponent,
|
BoardPresenter: '' as AnyComponent,
|
||||||
TemplatesIcon: '' as AnyComponent,
|
TemplatesIcon: '' as AnyComponent,
|
||||||
Cards: '' as AnyComponent,
|
Cards: '' as AnyComponent,
|
||||||
KanbanView: '' as AnyComponent
|
KanbanView: '' as AnyComponent,
|
||||||
|
WatchCard: '' as AnyComponent
|
||||||
},
|
},
|
||||||
space: {
|
space: {
|
||||||
DefaultBoard: '' as Ref<Space>
|
DefaultBoard: '' as Ref<Space>
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
"Copy": "Copy",
|
"Copy": "Copy",
|
||||||
"MakeTemplate": "Make Template",
|
"MakeTemplate": "Make Template",
|
||||||
"Watch": "Watch",
|
"Watch": "Watch",
|
||||||
|
"Unwatch": "Unwatch",
|
||||||
"Archive": "Archive",
|
"Archive": "Archive",
|
||||||
"SendToBoard": "Send to board",
|
"SendToBoard": "Send to board",
|
||||||
"Delete": "Delete",
|
"Delete": "Delete",
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
"Copy": "Копировать",
|
"Copy": "Копировать",
|
||||||
"MakeTemplate": "Шаблон",
|
"MakeTemplate": "Шаблон",
|
||||||
"Watch": "Отслеживать",
|
"Watch": "Отслеживать",
|
||||||
|
"Unwatch": "Не отслеживать",
|
||||||
"Archive": "Архивировать",
|
"Archive": "Архивировать",
|
||||||
"SendToBoard": "Вернуть",
|
"SendToBoard": "Вернуть",
|
||||||
"Delete": "Удалить",
|
"Delete": "Удалить",
|
||||||
|
@ -42,6 +42,7 @@
|
|||||||
"@anticrm/task-resources": "~0.6.0",
|
"@anticrm/task-resources": "~0.6.0",
|
||||||
"@anticrm/core": "~0.6.16",
|
"@anticrm/core": "~0.6.16",
|
||||||
"@anticrm/notification": "~0.6.0",
|
"@anticrm/notification": "~0.6.0",
|
||||||
|
"@anticrm/notification-resources": "~0.6.0",
|
||||||
"@anticrm/panel": "~0.6.0",
|
"@anticrm/panel": "~0.6.0",
|
||||||
"@anticrm/platform": "~0.6.5",
|
"@anticrm/platform": "~0.6.5",
|
||||||
"@anticrm/presentation": "~0.6.2",
|
"@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 EditMembersView from './components/popups/EditMembers.svelte'
|
||||||
import CardLabelPresenter from './components/presenters/LabelPresenter.svelte'
|
import CardLabelPresenter from './components/presenters/LabelPresenter.svelte'
|
||||||
import CardDatePresenter from './components/presenters/DatePresenter.svelte'
|
import CardDatePresenter from './components/presenters/DatePresenter.svelte'
|
||||||
|
import WatchCard from './components/WatchCard.svelte'
|
||||||
import {
|
import {
|
||||||
addCurrentUser,
|
addCurrentUser,
|
||||||
canAddCurrentUser,
|
canAddCurrentUser,
|
||||||
@ -87,7 +88,8 @@ export default async (): Promise<Resources> => ({
|
|||||||
CardLabelPresenter,
|
CardLabelPresenter,
|
||||||
TemplatesIcon,
|
TemplatesIcon,
|
||||||
KanbanView,
|
KanbanView,
|
||||||
BoardPresenter
|
BoardPresenter,
|
||||||
|
WatchCard
|
||||||
},
|
},
|
||||||
cardActionHandler: {
|
cardActionHandler: {
|
||||||
Join: addCurrentUser,
|
Join: addCurrentUser,
|
||||||
|
@ -72,6 +72,7 @@ export default mergeIds(boardId, board, {
|
|||||||
Copy: '' as IntlString,
|
Copy: '' as IntlString,
|
||||||
MakeTemplate: '' as IntlString,
|
MakeTemplate: '' as IntlString,
|
||||||
Watch: '' as IntlString,
|
Watch: '' as IntlString,
|
||||||
|
Unwatch: '' as IntlString,
|
||||||
Archive: '' as IntlString,
|
Archive: '' as IntlString,
|
||||||
SendToBoard: '' as IntlString,
|
SendToBoard: '' as IntlString,
|
||||||
Delete: '' as IntlString,
|
Delete: '' as IntlString,
|
||||||
|
Loading…
Reference in New Issue
Block a user