From ca992f1fd17544573c6813c6fd4421b36c6558c6 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Wed, 8 Jul 2026 11:10:41 -0500 Subject: [PATCH] fix: add unique form IDs for LiveView 1.2 compatibility, add type attr to button component --- lib/towerops_web/components/core_components.ex | 2 +- .../live/activity_feed_live.html.heex | 2 +- .../live/admin/org_live/index.html.heex | 1 + .../live/admin/security_live/index.html.heex | 1 + lib/towerops_web/live/device_live/index.html.heex | 2 +- .../live/escalation_policy_live/form.html.heex | 8 +++++++- .../live/escalation_policy_live/show.html.heex | 8 ++++++-- lib/towerops_web/live/onboarding_live.html.heex | 5 +++-- .../live/org/gaiia_reconciliation_live.html.heex | 12 ++++++++++-- lib/towerops_web/live/org/settings_live.html.heex | 6 +++++- lib/towerops_web/live/reports_live.html.heex | 2 +- .../live/schedule_live/form.html.heex | 8 +++++++- .../live/schedule_live/index.html.heex | 4 ++-- .../live/schedule_live/show.html.heex | 15 +++++++++++++-- lib/towerops_web/live/trace_live/index.html.heex | 7 ++++++- .../live/user_settings_live.html.heex | 9 +++++++-- 16 files changed, 72 insertions(+), 20 deletions(-) diff --git a/lib/towerops_web/components/core_components.ex b/lib/towerops_web/components/core_components.ex index 58f9a518..9f8699df 100644 --- a/lib/towerops_web/components/core_components.ex +++ b/lib/towerops_web/components/core_components.ex @@ -132,7 +132,7 @@ defmodule ToweropsWeb.CoreComponents do <.button phx-click="go" variant="primary">Send! <.button navigate={~p"/"}>Home """ - attr :rest, :global, include: ~w(href navigate patch method download name value disabled) + attr :rest, :global, include: ~w(href navigate patch method download name value disabled type) attr :class, :any attr :variant, :string, values: ~w(primary secondary danger ghost) attr :size, :string, default: "md", values: ~w(sm md lg) diff --git a/lib/towerops_web/live/activity_feed_live.html.heex b/lib/towerops_web/live/activity_feed_live.html.heex index 1c027b25..a7d18ae2 100644 --- a/lib/towerops_web/live/activity_feed_live.html.heex +++ b/lib/towerops_web/live/activity_feed_live.html.heex @@ -19,7 +19,7 @@ <%!-- Search Bar --%>
-
+
<.icon name="hero-magnifying-glass" diff --git a/lib/towerops_web/live/admin/org_live/index.html.heex b/lib/towerops_web/live/admin/org_live/index.html.heex index 53b176ff..d2f6181f 100644 --- a/lib/towerops_web/live/admin/org_live/index.html.heex +++ b/lib/towerops_web/live/admin/org_live/index.html.heex @@ -198,6 +198,7 @@ <.form + id="global-pricing-form" for={@global_form} phx-change="validate_global_pricing" phx-submit="save_global_pricing" diff --git a/lib/towerops_web/live/admin/security_live/index.html.heex b/lib/towerops_web/live/admin/security_live/index.html.heex index 7462d3c4..1792f16b 100644 --- a/lib/towerops_web/live/admin/security_live/index.html.heex +++ b/lib/towerops_web/live/admin/security_live/index.html.heex @@ -59,6 +59,7 @@ <%= if @show_whitelist_form do %>
<.form + id="whitelist-form" for={@whitelist_form} phx-submit="add_whitelist" class="space-y-4" diff --git a/lib/towerops_web/live/device_live/index.html.heex b/lib/towerops_web/live/device_live/index.html.heex index 1dfb7366..4e50672d 100644 --- a/lib/towerops_web/live/device_live/index.html.heex +++ b/lib/towerops_web/live/device_live/index.html.heex @@ -165,7 +165,7 @@
<%!-- Search --%> - +
<.icon name="hero-magnifying-glass" diff --git a/lib/towerops_web/live/escalation_policy_live/form.html.heex b/lib/towerops_web/live/escalation_policy_live/form.html.heex index 460489b9..3a0a8f01 100644 --- a/lib/towerops_web/live/escalation_policy_live/form.html.heex +++ b/lib/towerops_web/live/escalation_policy_live/form.html.heex @@ -15,7 +15,13 @@
- <.form for={@form} phx-change="validate" phx-submit="save" class="space-y-6"> + <.form + id="escalation-policy-form" + for={@form} + phx-change="validate" + phx-submit="save" + class="space-y-6" + >
<.input field={@form[:name]} type="text" label={t("Name")} required />
diff --git a/lib/towerops_web/live/escalation_policy_live/show.html.heex b/lib/towerops_web/live/escalation_policy_live/show.html.heex index 2cabd9a8..7e9b1e67 100644 --- a/lib/towerops_web/live/escalation_policy_live/show.html.heex +++ b/lib/towerops_web/live/escalation_policy_live/show.html.heex @@ -149,7 +149,11 @@ <% end %> <%!-- Add target form --%> - + <%= if @selected_manufacturer do %> @@ -266,7 +270,11 @@
<% @open_link_for == entry.device.id -> %>
- + <%= if member.role != :owner do %>
- +
- <.form for={@layer_form} phx-change="validate_layer" phx-submit="save_layer"> + <.form + id="layer-form" + for={@layer_form} + phx-change="validate_layer" + phx-submit="save_layer" + >
<.input field={@layer_form[:name]} @@ -457,6 +462,7 @@ {t("Restrict on-call shifts")}

- <.form for={@override_form} phx-change="validate_override" phx-submit="save_override"> + <.form + id="override-form" + for={@override_form} + phx-change="validate_override" + phx-submit="save_override" + >
<.input field={@override_form[:user_id]} diff --git a/lib/towerops_web/live/trace_live/index.html.heex b/lib/towerops_web/live/trace_live/index.html.heex index bce9fddc..96345faf 100644 --- a/lib/towerops_web/live/trace_live/index.html.heex +++ b/lib/towerops_web/live/trace_live/index.html.heex @@ -25,7 +25,12 @@
<.icon name="hero-magnifying-glass" class="h-6 w-6 text-gray-400 flex-shrink-0" /> - +
- <.form for={%{}} as={:device} phx-submit="create_device"> + <.form id="create-device-form" for={%{}} as={:device} phx-submit="create_device">
<.icon @@ -1756,7 +1756,12 @@

{t("Enter the 6-digit code from your app to verify")}

- <.form for={%{}} as={:verification} phx-submit="verify_new_device"> + <.form + id="verify-device-form" + for={%{}} + as={:verification} + phx-submit="verify_new_device" + >