Added filters for notifications

Added notifications for tasks
This commit is contained in:
Isaac Abadi
2022-12-31 03:38:03 -05:00
parent bfcc6a0697
commit 4f26e9ac3a
9 changed files with 83 additions and 9 deletions

View File

@@ -15,31 +15,36 @@ export class NotificationsListComponent {
NOTIFICATION_PREFIX: { [key in NotificationType]: string } = {
download_complete: $localize`Finished downloading`,
download_error: $localize`Download failed`
download_error: $localize`Download failed`,
task_finished: $localize`Task finished`
}
// Attaches string to the end of the notification text
NOTIFICATION_SUFFIX_KEY: { [key in NotificationType]: string } = {
download_complete: 'file_title',
download_error: 'download_url'
download_error: 'download_url',
task_finished: 'task_title'
}
NOTIFICATION_ACTION_TO_STRING: { [key in NotificationAction]: string } = {
play: $localize`Play`,
retry_download: $localize`Retry download`,
view_download_error: $localize`View error`
view_download_error: $localize`View error`,
view_tasks: $localize`View task`
}
NOTIFICATION_COLOR: { [key in NotificationAction]: string } = {
play: 'primary',
retry_download: 'primary',
view_download_error: 'warn'
view_download_error: 'warn',
view_tasks: 'primary'
}
NOTIFICATION_ICON: { [key in NotificationAction]: string } = {
play: 'smart_display',
retry_download: 'restart_alt',
view_download_error: 'warning'
view_download_error: 'warning',
view_tasks: 'task'
}
emitNotificationAction(notification: Notification, action: NotificationAction): void {