mirror of
https://github.com/hcengineering/platform.git
synced 2026-09-12 12:47:45 +02:00
Create global inbox actions (#4903)
Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
@@ -38,8 +38,8 @@ import notification, {
|
||||
type DocNotifyContext,
|
||||
type InboxNotification
|
||||
} from '@hcengineering/notification'
|
||||
import { getClient } from '@hcengineering/presentation'
|
||||
import { getLocation, navigate, type Location, type ResolvedLocation } from '@hcengineering/ui'
|
||||
import { getClient, MessageBox } from '@hcengineering/presentation'
|
||||
import { getLocation, navigate, type Location, type ResolvedLocation, showPopup } from '@hcengineering/ui'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
import { InboxNotificationsClientImpl } from './inboxNotificationsClient'
|
||||
@@ -412,6 +412,36 @@ export async function unpinDocNotifyContext (object: DocNotifyContext): Promise<
|
||||
})
|
||||
}
|
||||
|
||||
export async function archiveAll (): Promise<void> {
|
||||
const client = InboxNotificationsClientImpl.getClient()
|
||||
|
||||
showPopup(
|
||||
MessageBox,
|
||||
{
|
||||
label: notification.string.ArchiveAllConfirmationTitle,
|
||||
message: notification.string.ArchiveAllConfirmationMessage
|
||||
},
|
||||
'top',
|
||||
(result?: boolean) => {
|
||||
if (result === true) {
|
||||
void client.deleteAllNotifications()
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
export async function readAll (): Promise<void> {
|
||||
const client = InboxNotificationsClientImpl.getClient()
|
||||
|
||||
await client.readAllNotifications()
|
||||
}
|
||||
|
||||
export async function unreadAll (): Promise<void> {
|
||||
const client = InboxNotificationsClientImpl.getClient()
|
||||
|
||||
await client.unreadAllNotifications()
|
||||
}
|
||||
|
||||
export async function getDisplayInboxNotifications (
|
||||
notificationsByContext: Map<Ref<DocNotifyContext>, InboxNotification[]>,
|
||||
filter: InboxNotificationsFilter = 'all',
|
||||
|
||||
Reference in New Issue
Block a user