From 4baf9e4a22c714d0365630b63b07d41f58d91c8e Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 16 Jan 2021 17:02:48 +0100 Subject: [PATCH] web: fix unread count, use white-space pre --- authentik/policies/process.py | 4 ++-- .../elements/notifications/NotificationDrawer.ts | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/authentik/policies/process.py b/authentik/policies/process.py index cb9558d9c..225fb2b6f 100644 --- a/authentik/policies/process.py +++ b/authentik/policies/process.py @@ -93,8 +93,8 @@ class PolicyProcess(Process): ) # Create policy exception event self.create_event(EventAction.POLICY_EXCEPTION, message=error_string) - LOGGER.debug("P_ENG(proc): error", exc=exc) - policy_result = PolicyResult(False, str(exc)) + LOGGER.debug("P_ENG(proc): error", exc=src_exc) + policy_result = PolicyResult(False, str(src_exc)) policy_result.source_policy = self.binding.policy # Invert result if policy.negate is set if self.binding.negate: diff --git a/web/src/elements/notifications/NotificationDrawer.ts b/web/src/elements/notifications/NotificationDrawer.ts index 0a61b2931..bb3105ece 100644 --- a/web/src/elements/notifications/NotificationDrawer.ts +++ b/web/src/elements/notifications/NotificationDrawer.ts @@ -22,6 +22,9 @@ export class NotificationDrawer extends LitElement { display: flex; flex-direction: column; } + .pf-c-notification-drawer__list-item-description { + white-space: pre; + } ` ); } @@ -29,7 +32,7 @@ export class NotificationDrawer extends LitElement { firstUpdated(): void { Notification.list().then(r => { this.notifications = r; - this.unread = r.results.filter((n) => n.seen).length; + this.unread = r.results.filter((n) => !n.seen).length; }); } @@ -60,12 +63,8 @@ export class NotificationDrawer extends LitElement { ${item.event?.action} -
- ${item.body} -
-
- ${age} -
+

${item.body}

+ ${age} `; }