Skip to content

Commit

Permalink
Added Admin debug button to raise a test exception
Browse files Browse the repository at this point in the history
  • Loading branch information
mellelieuwes committed Nov 21, 2024
1 parent e0cf5f1 commit 3432168
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion core/systems/admin/actions_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,24 @@ defmodule Systems.Admin.ActionsView do
}
}

crash_button = %{
action: %{
type: :send,
event: "crash"
},
face: %{
type: :primary,
bg_color: "bg-delete",
label: "Raise a test exception"
}
}

socket
|> assign(
rollback_expired_deposits_button: rollback_expired_deposits_button,
expire_button: expire_button,
expire_force_button: expire_force_button
expire_force_button: expire_force_button,
crash_button: crash_button
)
end

Expand Down Expand Up @@ -85,6 +98,12 @@ defmodule Systems.Admin.ActionsView do
{:noreply, socket}
end

@impl true
def handle_event("crash", _, socket) do
raise "Test exception"
{:noreply, socket}
end

@impl true
def render(assigns) do
~H"""
Expand All @@ -106,6 +125,14 @@ defmodule Systems.Admin.ActionsView do
<Button.dynamic {@expire_button} />
<.spacing value="S" />
</.wrap>
<.spacing value="XL" />
<Text.title3 margin="">Monitoring</Text.title3>
<.spacing value="S" />
<.wrap>
<Button.dynamic {@crash_button} />
<.spacing value="S" />
</.wrap>
<%= if feature_enabled?(:debug_expire_force) do %>
<.wrap>
<Button.dynamic {@expire_force_button} />
Expand Down

0 comments on commit 3432168

Please sign in to comment.