From abaa3f68b81fa2d8b1b3eb834879f078bad72057 Mon Sep 17 00:00:00 2001 From: Gavin Henry Date: Tue, 14 Jan 2025 17:26:33 +0000 Subject: [PATCH] Upgrade to LiveView 1.0.0 --- .../emails/templates/emails/layout.html.heex | 6 +- .../components/core_components.ex | 74 +++++++++---------- .../components/home_page_components.ex | 2 +- .../components/layouts/app.html.heex | 2 +- .../layouts/liveview_root.html.heex | 4 +- .../components/layouts/root.html.heex | 4 +- .../components/navigation_components.ex | 4 +- .../email_verify_html/error.html.heex | 6 +- .../email_verify_html/verify_email.html.heex | 2 +- .../controllers/page_html/about.html.heex | 4 +- .../page_html/acceptable_use_policy.html.heex | 4 +- .../page_html/advanced_users.html.heex | 4 +- .../controllers/page_html/changelog.html.heex | 4 +- .../page_html/cookie_policy.html.heex | 4 +- .../page_html/cybersecurity.html.heex | 4 +- .../controllers/page_html/itsps.html.heex | 4 +- .../controllers/page_html/jobs.html.heex | 4 +- .../controllers/page_html/partners.html.heex | 4 +- .../page_html/privacy_policy.html.heex | 4 +- .../page_html/telecom_resellers.html.heex | 4 +- .../page_html/terms_and_conditions.html.heex | 4 +- .../controllers/pricing_html/index.html.heex | 4 +- .../live/api_client_form_component.ex | 6 +- .../live/contact_live/form_component.ex | 2 +- .../live/contact_live/index.html.heex | 4 +- .../customer_analytics_live/index.html.heex | 34 ++++----- .../customer_billing_live/index.html.heex | 50 ++++++------- .../customer_dashboard_live/index.html.heex | 20 ++--- .../customer_insights_live/index.html.heex | 14 ++-- .../form_component.ex | 4 +- .../index.html.heex | 14 ++-- .../live/customer_nodes_live/index.html.heex | 18 ++--- .../customer_nodes_live/overview.html.heex | 40 +++++----- .../customer_settings_live/index.html.heex | 18 ++--- .../customer_settings_live/overview.html.heex | 24 +++--- .../live/customer_team_live/index.html.heex | 18 ++--- .../live/home_live/index.html.heex | 14 ++-- .../live/user_profile_live/index.html.heex | 12 +-- .../live/user_settings_live/index.html.heex | 14 ++-- 39 files changed, 231 insertions(+), 231 deletions(-) diff --git a/lib/sentrypeer/emails/templates/emails/layout.html.heex b/lib/sentrypeer/emails/templates/emails/layout.html.heex index e6424694..4298eb5a 100644 --- a/lib/sentrypeer/emails/templates/emails/layout.html.heex +++ b/lib/sentrypeer/emails/templates/emails/layout.html.heex @@ -3,7 +3,7 @@ - <%= assigns[:title] %> + {assigns[:title]} @@ -17,7 +17,7 @@
- <%= @inner_content %> + {@inner_content}
@@ -25,7 +25,7 @@
- Copyright <%= DateTime.utc_now().year %>. All rights reserved.
+ Copyright {DateTime.utc_now().year}. All rights reserved.
diff --git a/lib/sentrypeer_web/components/core_components.ex b/lib/sentrypeer_web/components/core_components.ex index 1a398fb5..1da71bd7 100644 --- a/lib/sentrypeer_web/components/core_components.ex +++ b/lib/sentrypeer_web/components/core_components.ex @@ -111,18 +111,18 @@ defmodule SentrypeerWeb.CoreComponents do id={"#{@id}-title"} class="text-lg font-medium leading-6 dark:text-white text-gray-900" > - <%= render_slot(@title) %> + {render_slot(@title)}

- <%= render_slot(@subtitle) %> + {render_slot(@subtitle)}

- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

@@ -140,14 +140,14 @@ defmodule SentrypeerWeb.CoreComponents do phx-disable-with class="inline-flex w-full justify-center rounded-md border border-transparent bg-red-600 px-4 py-2 text-base font-medium text-white shadow-sm hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm" > - <%= render_slot(confirm) %> + {render_slot(confirm)} <.link :for={cancel <- @cancel} phx-click={hide_modal(@on_cancel, @id)} class="mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white dark:hover:bg-slate-500 dark:bg-slate-400 px-4 py-2 text-base font-medium dark:text-slate-800 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm" > - <%= render_slot(cancel) %> + {render_slot(cancel)} @@ -235,17 +235,17 @@ defmodule SentrypeerWeb.CoreComponents do id={"#{@id}-title"} class="text-lg font-semibold leading-8 text-zinc-800 dark:text-white" > - <%= render_slot(@title) %> + {render_slot(@title)}

- <%= render_slot(@subtitle) %> + {render_slot(@subtitle)}

- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}
<.button :for={confirm <- @confirm} @@ -254,14 +254,14 @@ defmodule SentrypeerWeb.CoreComponents do phx-disable-with class="py-2 px-3" > - <%= render_slot(confirm) %> + {render_slot(confirm)} <.link :for={cancel <- @cancel} phx-click={hide_modal(@on_cancel, @id)} class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700" > - <%= render_slot(cancel) %> + {render_slot(cancel)}
@@ -309,9 +309,9 @@ defmodule SentrypeerWeb.CoreComponents do

<.icon :if={@kind == :info} name="hero-information-circle" class="w-6 h-6" /> <.icon :if={@kind == :error} name="hero-exclamation-circle" class="w-6 h-6" /> - <%= @title %> + {@title}

-

<%= msg %>

+

{msg}

""" end @@ -476,9 +476,9 @@ defmodule SentrypeerWeb.CoreComponents do class="rounded border-zinc-300 text-zinc-900 dark:text-slate-400 focus:ring-zinc-900" {@rest} /> - <%= @label %> + {@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg} """ end @@ -486,7 +486,7 @@ defmodule SentrypeerWeb.CoreComponents do def input(%{type: "select"} = assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -505,7 +505,7 @@ defmodule SentrypeerWeb.CoreComponents do def input(%{type: "textarea"} = assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -526,7 +526,7 @@ defmodule SentrypeerWeb.CoreComponents do def input(assigns) do ~H"""
- <.label for={@id}><%= @label %> + <.label for={@id}>{@label} - <.error :for={msg <- @errors}><%= msg %> + <.error :for={msg <- @errors}>{msg}
""" end @@ -555,7 +555,7 @@ defmodule SentrypeerWeb.CoreComponents do def label(assigns) do ~H""" """ end @@ -569,7 +569,7 @@ defmodule SentrypeerWeb.CoreComponents do ~H"""

<.icon name="hero-exclamation-circle-mini" class="mt-0.5 w-5 h-5 flex-none" /> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

""" end @@ -588,13 +588,13 @@ defmodule SentrypeerWeb.CoreComponents do

- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

- <%= render_slot(@subtitle) %> + {render_slot(@subtitle)}

-
<%= render_slot(@actions) %>
+
{render_slot(@actions)}
""" end @@ -635,8 +635,8 @@ defmodule SentrypeerWeb.CoreComponents do - - + + - <%= render_slot(col, @row_item.(row)) %> + {render_slot(col, @row_item.(row))} @@ -664,7 +664,7 @@ defmodule SentrypeerWeb.CoreComponents do :for={action <- @action} class="relative ml-4 font-semibold leading-6 text-zinc-900 hover:text-zinc-700" > - <%= render_slot(action, @row_item.(row)) %> + {render_slot(action, @row_item.(row))} @@ -694,8 +694,8 @@ defmodule SentrypeerWeb.CoreComponents do
-
<%= item.title %>
-
<%= render_slot(item) %>
+
{item.title}
+
{render_slot(item)}
@@ -720,7 +720,7 @@ defmodule SentrypeerWeb.CoreComponents do class="text-sm font-semibold leading-6 text-zinc-900 hover:text-zinc-700" > <.icon name="hero-arrow-left-solid" class="w-3 h-3" /> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ diff --git a/lib/sentrypeer_web/components/home_page_components.ex b/lib/sentrypeer_web/components/home_page_components.ex index e723ffd9..d87fe1cc 100644 --- a/lib/sentrypeer_web/components/home_page_components.ex +++ b/lib/sentrypeer_web/components/home_page_components.ex @@ -648,7 +648,7 @@ defmodule SentrypeerWeb.HomePageComponents do > Ant Networks Ltd. - <%= DateTime.utc_now().year %>. SentryPeer is a trading name of + {DateTime.utc_now().year}. SentryPeer is a trading name of -<%= @inner_content %> +{@inner_content} diff --git a/lib/sentrypeer_web/components/layouts/liveview_root.html.heex b/lib/sentrypeer_web/components/layouts/liveview_root.html.heex index 34b93fce..113cbd6c 100644 --- a/lib/sentrypeer_web/components/layouts/liveview_root.html.heex +++ b/lib/sentrypeer_web/components/layouts/liveview_root.html.heex @@ -8,7 +8,7 @@ <.live_title> - <%= assigns[:page_title] <> " · SentryPeer" %> + {assigns[:page_title] <> " · SentryPeer"} @@ -29,7 +29,7 @@ - <%= @inner_content %> + {@inner_content} @@ -234,7 +234,7 @@ Subtotal @@ -252,7 +252,7 @@ Tax @@ -270,7 +270,7 @@ Total @@ -312,9 +312,9 @@

- <%= to_month_day(List.first(invoice.lines.data).period.start) %> - <%= to_month_day( + {to_month_day(List.first(invoice.lines.data).period.start)} - {to_month_day( List.first(invoice.lines.data).period.end - ) %>, <%= to_year(List.first(invoice.lines.data).period.end) %> + )}, {to_year(List.first(invoice.lines.data).period.end)}

- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -59,7 +59,7 @@

- Live data from our honeypots for <%= Date.utc_today() |> Calendar.strftime("%B") %> + Live data from our honeypots for {Date.utc_today() |> Calendar.strftime("%B")}

@@ -68,7 +68,7 @@
- <%= Sentrypeer.Cldr.Number.to_string!(@total_events) %> + {Sentrypeer.Cldr.Number.to_string!(@total_events)}
@@ -78,7 +78,7 @@
- <%= Sentrypeer.Cldr.Number.to_string!(@total_unique_phone_numbers) %> + {Sentrypeer.Cldr.Number.to_string!(@total_unique_phone_numbers)}
@@ -88,7 +88,7 @@
- <%= Sentrypeer.Cldr.Number.to_string!(@total_unique_ip_addresses) %> + {Sentrypeer.Cldr.Number.to_string!(@total_unique_ip_addresses)}
diff --git a/lib/sentrypeer_web/live/customer_insights_live/index.html.heex b/lib/sentrypeer_web/live/customer_insights_live/index.html.heex index 7c735fc1..daeb68c6 100644 --- a/lib/sentrypeer_web/live/customer_insights_live/index.html.heex +++ b/lib/sentrypeer_web/live/customer_insights_live/index.html.heex @@ -3,8 +3,8 @@
- <%= nav_top_menu(assigns) %> - <%= breadcrumbs(assigns) %> + {nav_top_menu(assigns)} + {breadcrumbs(assigns)}
@@ -27,10 +27,10 @@
- <%= @current_user.name %> + {@current_user.name}
- v<%= @app_version %> + v{@app_version} - <%= @git_rev %> + {@git_rev}
@@ -46,7 +46,7 @@
- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -76,7 +76,7 @@ - <%= being_worked_on(assigns) %> + {being_worked_on(assigns)}
diff --git a/lib/sentrypeer_web/live/customer_integrations_live/form_component.ex b/lib/sentrypeer_web/live/customer_integrations_live/form_component.ex index c1365274..658b230b 100644 --- a/lib/sentrypeer_web/live/customer_integrations_live/form_component.ex +++ b/lib/sentrypeer_web/live/customer_integrations_live/form_component.ex @@ -14,9 +14,9 @@ defmodule SentrypeerWeb.CustomerIntegrationsLive.FormComponent do ~H"""
<.header> - <%= @title %> + {@title} <:subtitle> - <%= @subtitle %> + {@subtitle}
diff --git a/lib/sentrypeer_web/live/customer_integrations_live/index.html.heex b/lib/sentrypeer_web/live/customer_integrations_live/index.html.heex index dd76d1a7..7f16c9e3 100644 --- a/lib/sentrypeer_web/live/customer_integrations_live/index.html.heex +++ b/lib/sentrypeer_web/live/customer_integrations_live/index.html.heex @@ -3,8 +3,8 @@
- <%= nav_top_menu(assigns) %> - <%= breadcrumbs(assigns) %> + {nav_top_menu(assigns)} + {breadcrumbs(assigns)}
@@ -27,10 +27,10 @@
- <%= @current_user.name %> + {@current_user.name}
- v<%= @app_version %> + v{@app_version} - <%= @git_rev %> + {@git_rev}
@@ -46,7 +46,7 @@
- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -58,7 +58,7 @@

Integrations

- <%= being_worked_on(assigns) %> + {being_worked_on(assigns)}
diff --git a/lib/sentrypeer_web/live/customer_nodes_live/index.html.heex b/lib/sentrypeer_web/live/customer_nodes_live/index.html.heex index b442de00..3c3c99c1 100644 --- a/lib/sentrypeer_web/live/customer_nodes_live/index.html.heex +++ b/lib/sentrypeer_web/live/customer_nodes_live/index.html.heex @@ -3,8 +3,8 @@
- <%= nav_top_menu(assigns) %> - <%= breadcrumbs(assigns) %> + {nav_top_menu(assigns)} + {breadcrumbs(assigns)}
@@ -27,10 +27,10 @@
- <%= @current_user.name %> + {@current_user.name}
- v<%= @app_version %> + v{@app_version} - <%= @git_rev %> + {@git_rev}
@@ -73,7 +73,7 @@
- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -238,7 +238,7 @@ title="View all details about this node" > - <%= client.client_name %> Running + {client.client_name} Running
@@ -249,7 +249,7 @@ > - <%= client.client_description %> + {client.client_description}
@@ -298,7 +298,7 @@

- <%= time_ago(client.client_created_at) %> + {time_ago(client.client_created_at)} diff --git a/lib/sentrypeer_web/live/customer_nodes_live/overview.html.heex b/lib/sentrypeer_web/live/customer_nodes_live/overview.html.heex index ead1fe39..a44166de 100644 --- a/lib/sentrypeer_web/live/customer_nodes_live/overview.html.heex +++ b/lib/sentrypeer_web/live/customer_nodes_live/overview.html.heex @@ -3,15 +3,15 @@

- <%= nav_top_menu(assigns) %> - <%= breadcrumbs(assigns) %> + {nav_top_menu(assigns)} + {breadcrumbs(assigns)}
- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -34,12 +34,12 @@ >

- <%= event.probe.event_timestamp %> - <%= event.probe.transport_type %> - <%= event.probe.source_ip %> - <%= event.probe.called_number %> - <%= event.probe.sip_method %> - <%= event.probe.sip_user_agent %> + {event.probe.event_timestamp} + {event.probe.transport_type} + {event.probe.source_ip} + {event.probe.called_number} + {event.probe.sip_method} + {event.probe.sip_user_agent}

@@ -54,7 +54,7 @@
Phone Numbers
- <%= @total_unique_phone_numbers %> + {@total_unique_phone_numbers}
@@ -63,7 +63,7 @@
IP Addresses
- <%= @total_unique_ip_addresses %> + {@total_unique_ip_addresses}
@@ -72,7 +72,7 @@
Total Events
- <%= @total_events %> + {@total_events}
@@ -86,7 +86,7 @@ id="node-title" class="text-lg font-medium leading-6 text-gray-900 dark:text-white" > - <%= @client.client_name %> + {@client.client_name} <.link patch={~p"/nodes/#{@client.client_id}/edit"} title="Edit the Name and Description of this node" @@ -96,7 +96,7 @@

- <%= @client.client_description %> + {@client.client_description}

@@ -104,7 +104,7 @@
Client ID
- <%= @client.client_id %> + {@client.client_id}
@@ -169,7 +169,7 @@ rel="noopener noreferrer" title="URL where you POST your client_id and client_secret to get a JWT bearer token" > - <%= @token_url %> + {@token_url}
@@ -177,18 +177,18 @@
Created
- <%= @client.client_created_at %> + {@client.client_created_at} - <%= time_ago(@client.client_created_at) %> + {time_ago(@client.client_created_at)}
Updated
- <%= @client.client_updated_at %> + {@client.client_updated_at} - <%= time_ago(@client.client_updated_at) %> + {time_ago(@client.client_updated_at)}
diff --git a/lib/sentrypeer_web/live/customer_settings_live/index.html.heex b/lib/sentrypeer_web/live/customer_settings_live/index.html.heex index 3d176039..560d8e17 100644 --- a/lib/sentrypeer_web/live/customer_settings_live/index.html.heex +++ b/lib/sentrypeer_web/live/customer_settings_live/index.html.heex @@ -3,8 +3,8 @@
- <%= nav_top_menu(assigns) %> - <%= breadcrumbs(assigns) %> + {nav_top_menu(assigns)} + {breadcrumbs(assigns)}
@@ -27,10 +27,10 @@
- <%= @current_user.name %> + {@current_user.name}
- v<%= @app_version %> + v{@app_version} - <%= @git_rev %> + {@git_rev}
@@ -106,7 +106,7 @@
- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -175,7 +175,7 @@ title="View all details about this API client" > - <%= api_client.client_name %> Running + {api_client.client_name} Running @@ -186,7 +186,7 @@ > - <%= api_client.client_description %> + {api_client.client_description} @@ -235,7 +235,7 @@

- <%= time_ago(api_client.client_created_at) %> + {time_ago(api_client.client_created_at)} diff --git a/lib/sentrypeer_web/live/customer_settings_live/overview.html.heex b/lib/sentrypeer_web/live/customer_settings_live/overview.html.heex index 1af15904..cd9d3d07 100644 --- a/lib/sentrypeer_web/live/customer_settings_live/overview.html.heex +++ b/lib/sentrypeer_web/live/customer_settings_live/overview.html.heex @@ -3,15 +3,15 @@

- <%= nav_top_menu(assigns) %> - <%= breadcrumbs(assigns) %> + {nav_top_menu(assigns)} + {breadcrumbs(assigns)}
- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -34,7 +34,7 @@ >

- Remote IP: <%= query.conn.remote_ip |> Tuple.to_list() |> Enum.join(".") %> Searched for: <%= query.query %> + Remote IP: {query.conn.remote_ip |> Tuple.to_list() |> Enum.join(".")} Searched for: {query.query}

@@ -48,7 +48,7 @@ id="node-title" class="text-lg font-medium leading-6 text-gray-900 dark:text-white" > - <%= @client.client_name %> + {@client.client_name} <.link patch={~p"/settings/#{@client.client_id}/edit"} title="Edit the Name and Description of this API client" @@ -58,7 +58,7 @@

- <%= @client.client_description %> + {@client.client_description}

@@ -66,7 +66,7 @@
Client ID
- <%= @client.client_id %> + {@client.client_id}
@@ -131,7 +131,7 @@ rel="noopener noreferrer" title="URL where you POST your client_id and client_secret to get a JWT bearer token" > - <%= @token_url %> + {@token_url}
@@ -139,18 +139,18 @@
Created
- <%= @client.client_created_at %> + {@client.client_created_at} - <%= time_ago(@client.client_created_at) %> + {time_ago(@client.client_created_at)}
Updated
- <%= @client.client_updated_at %> + {@client.client_updated_at} - <%= time_ago(@client.client_updated_at) %> + {time_ago(@client.client_updated_at)}
diff --git a/lib/sentrypeer_web/live/customer_team_live/index.html.heex b/lib/sentrypeer_web/live/customer_team_live/index.html.heex index 589cb3d0..a6a0da71 100644 --- a/lib/sentrypeer_web/live/customer_team_live/index.html.heex +++ b/lib/sentrypeer_web/live/customer_team_live/index.html.heex @@ -3,8 +3,8 @@
- <%= nav_top_menu(assigns) %> - <%= breadcrumbs(assigns) %> + {nav_top_menu(assigns)} + {breadcrumbs(assigns)}
@@ -27,10 +27,10 @@
- <%= @current_user.name %> + {@current_user.name}
- v<%= @app_version %> + v{@app_version} - <%= @git_rev %> + {@git_rev}
@@ -46,7 +46,7 @@
- <%= in_app_menu(assigns) %> + {in_app_menu(assigns)}
@@ -58,7 +58,7 @@

Team

- <%= being_worked_on(assigns) %> + {being_worked_on(assigns)}
<%= col[:label] %><%= gettext("Actions") %>{col[:label]}{gettext("Actions")}
- <%= List.first(@upcoming_invoice.lines.data).description %> + {List.first(@upcoming_invoice.lines.data).description}
- <%= List.first(@upcoming_invoice.lines.data).price.unit_amount / 100 %> + {List.first(@upcoming_invoice.lines.data).price.unit_amount / 100}
- <%= @upcoming_invoice.subtotal / 100 %> + {@upcoming_invoice.subtotal / 100}
- <%= @upcoming_invoice.tax %> + {@upcoming_invoice.tax}
- <%= @upcoming_invoice.amount_due / 100 %> + {@upcoming_invoice.amount_due / 100}