Create global inbox actions (#4903)

Signed-off-by: Kristina Fefelova <kristin.fefelova@gmail.com>
This commit is contained in:
Kristina
2024-03-08 14:59:20 +07:00
committed by GitHub
parent 0483e2ac0d
commit 5ce079cf3d
11 changed files with 172 additions and 43 deletions
+61
View File
@@ -634,6 +634,67 @@ export function createModel (builder: Builder): void {
},
notification.ids.MentionCommonNotificationType
)
createAction(
builder,
{
action: notification.actionImpl.ArchiveAll,
label: notification.string.ArchiveAll,
icon: view.icon.Archive,
keyBinding: [],
input: 'none',
category: notification.category.Notification,
target: core.class.Doc,
context: {
mode: ['browser'],
group: 'edit'
}
},
notification.action.ArchiveAll
)
createAction(
builder,
{
action: notification.actionImpl.ReadAll,
label: notification.string.MarkReadAll,
icon: notification.icon.ReadAll,
keyBinding: [],
input: 'none',
category: notification.category.Notification,
target: core.class.Doc,
context: {
mode: ['browser'],
group: 'edit'
}
},
notification.action.ReadAll
)
createAction(
builder,
{
action: notification.actionImpl.UnreadAll,
label: notification.string.MarkUnreadAll,
icon: notification.icon.UnreadAll,
keyBinding: [],
input: 'none',
category: notification.category.Notification,
target: core.class.Doc,
context: {
mode: ['browser'],
group: 'edit'
}
},
notification.action.UnreadAll
)
builder.createDoc(
view.class.ActionCategory,
core.space.Model,
{ label: notification.string.Inbox, visible: true },
notification.category.Notification
)
}
export function generateClassNotificationTypes (
+8 -2
View File
@@ -64,7 +64,10 @@ export default mergeIds(notificationId, notification, {
},
groups: {},
action: {
Unsubscribe: '' as Ref<Action>
Unsubscribe: '' as Ref<Action>,
ArchiveAll: '' as Ref<Action>,
ReadAll: '' as Ref<Action>,
UnreadAll: '' as Ref<Action>
},
actionImpl: {
Unsubscribe: '' as ViewAction,
@@ -77,6 +80,9 @@ export default mergeIds(notificationId, notification, {
UnHideDocNotifyContext: '' as ViewAction,
UnReadNotifyContext: '' as ViewAction,
ReadNotifyContext: '' as ViewAction,
DeleteContextNotifications: '' as ViewAction
DeleteContextNotifications: '' as ViewAction,
ArchiveAll: '' as ViewAction,
ReadAll: '' as ViewAction,
UnreadAll: '' as ViewAction
}
})