From 529a6138d179c009c5764ab5f7a2c66ab6bc8287 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 13 Mar 2026 16:29:44 -0500 Subject: [PATCH] fix: align sidebar bottom border with footer border Adjust sidebar bottom section padding from py-3 to py-3.5 to align the horizontal border with the footer border. Also remove unused private functions from settings_live and fix credo warnings. --- .../workers/alert_notification_worker.ex | 60 +++++++++++-------- lib/towerops_web/components/layouts.ex | 2 +- lib/towerops_web/live/dashboard_live.ex | 24 +++++++- .../live/dashboard_live.html.heex | 8 ++- lib/towerops_web/live/org/settings_live.ex | 16 ----- 5 files changed, 64 insertions(+), 46 deletions(-) diff --git a/lib/towerops/workers/alert_notification_worker.ex b/lib/towerops/workers/alert_notification_worker.ex index 62c9b4de..8fb1d0a5 100644 --- a/lib/towerops/workers/alert_notification_worker.ex +++ b/lib/towerops/workers/alert_notification_worker.ex @@ -25,14 +25,7 @@ defmodule Towerops.Workers.AlertNotificationWorker do pd_result = if routing in ["pagerduty", "both"] do - case Notifier.notify_trigger(alert, device) do - {:error, :not_configured} -> - Logger.debug("PagerDuty not configured for alert #{alert_id}, skipping") - :ok - - result -> - result - end + notify_pagerduty_trigger(alert, device, alert_id) else :ok end @@ -65,14 +58,7 @@ defmodule Towerops.Workers.AlertNotificationWorker do if routing in ["builtin", "both"], do: maybe_acknowledge_incident(alert) if routing in ["pagerduty", "both"] do - case Notifier.notify_acknowledge(alert) do - {:error, :not_configured} -> - Logger.debug("PagerDuty not configured for alert #{alert_id}, skipping") - :ok - - result -> - result - end + notify_pagerduty_acknowledge(alert, alert_id) else :ok end @@ -95,14 +81,7 @@ defmodule Towerops.Workers.AlertNotificationWorker do if routing in ["builtin", "both"], do: maybe_resolve_incident(alert) if routing in ["pagerduty", "both"] do - case Notifier.notify_resolve(alert) do - {:error, :not_configured} -> - Logger.debug("PagerDuty not configured for alert #{alert_id}, skipping") - :ok - - result -> - result - end + notify_pagerduty_resolve(alert, alert_id) else :ok end @@ -136,6 +115,39 @@ defmodule Towerops.Workers.AlertNotificationWorker do |> Oban.insert() end + defp notify_pagerduty_trigger(alert, device, alert_id) do + case Notifier.notify_trigger(alert, device) do + {:error, :not_configured} -> + Logger.debug("PagerDuty not configured for alert #{alert_id}, skipping") + :ok + + result -> + result + end + end + + defp notify_pagerduty_acknowledge(alert, alert_id) do + case Notifier.notify_acknowledge(alert) do + {:error, :not_configured} -> + Logger.debug("PagerDuty not configured for alert #{alert_id}, skipping") + :ok + + result -> + result + end + end + + defp notify_pagerduty_resolve(alert, alert_id) do + case Notifier.notify_resolve(alert) do + {:error, :not_configured} -> + Logger.debug("PagerDuty not configured for alert #{alert_id}, skipping") + :ok + + result -> + result + end + end + defp maybe_start_escalation(alert, device) do policy_id = device.escalation_policy_id || device.organization.default_escalation_policy_id diff --git a/lib/towerops_web/components/layouts.ex b/lib/towerops_web/components/layouts.ex index faff2ddc..43f33526 100644 --- a/lib/towerops_web/components/layouts.ex +++ b/lib/towerops_web/components/layouts.ex @@ -427,7 +427,7 @@ defmodule ToweropsWeb.Layouts do -
+