Allow disabling notifications per user and disabling specific notifications per user (#1991)

* Allow disabling notifications per user and disabling specific notifications per use

closes #1974

* Add disable notifs for all users

* fix term generator for notifications

* sow checkboxes instead of multiselect when js is enabled

* remove js dependency

* fix notif conditions
This commit is contained in:
Andrew Camilleri
2020-10-20 13:09:09 +02:00
committed by GitHub
parent 933e0c30bf
commit 4d0b402e8b
20 changed files with 315 additions and 64 deletions

View File

@@ -3,11 +3,20 @@ using BTCPayServer.Models.NotificationViewModels;
namespace BTCPayServer.Services.Notifications.Blobs
{
internal class NewVersionNotification
internal class NewVersionNotification:BaseNotification
{
private const string TYPE = "newversion";
internal class Handler : NotificationHandler<NewVersionNotification>
{
public override string NotificationType => "newversion";
public override string NotificationType => TYPE;
public override (string identifier, string name)[] Meta
{
get
{
return new (string identifier, string name)[] {(TYPE, "New version")};
}
}
protected override void FillViewModel(NewVersionNotification notification, NotificationViewModel vm)
{
vm.Body = $"New version {notification.Version} released!";
@@ -23,5 +32,7 @@ namespace BTCPayServer.Services.Notifications.Blobs
Version = version;
}
public string Version { get; set; }
public override string Identifier => TYPE;
public override string NotificationType => TYPE;
}
}