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

@@ -89,11 +89,11 @@ namespace BTCPayServer.Controllers
}
#if DEBUG
[HttpGet]
public async Task<IActionResult> GenerateJunk(int x = 100)
public async Task<IActionResult> GenerateJunk(int x = 100, bool admin=true)
{
for (int i = 0; i < x; i++)
{
await _notificationSender.SendNotification(new AdminScope(), new JunkNotification());
await _notificationSender.SendNotification(admin? (NotificationScope) new AdminScope(): new UserScope(_userManager.GetUserId(User)), new JunkNotification());
}
return RedirectToAction("Index");