From 1544dbfe916b6f1c50df3ff0647890df8a6c519a Mon Sep 17 00:00:00 2001 From: "karlo.smid" Date: Mon, 28 Apr 2025 14:40:17 +0200 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20live=20view=201.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and refactor for live view test fix render_component function --- lib/plausible_web/live/flash.ex | 2 +- mix.exs | 4 ++-- mix.lock | 4 ++-- test/support/live_view_test_fix.ex | 4 ---- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/plausible_web/live/flash.ex b/lib/plausible_web/live/flash.ex index 2a9c5c8faeaa..a5cbfcd2cdd2 100644 --- a/lib/plausible_web/live/flash.ex +++ b/lib/plausible_web/live/flash.ex @@ -96,7 +96,7 @@ defmodule PlausibleWeb.Live.Flash do end slot(:icon, required: true) - slot(:title, require: true) + slot(:title, required: true) slot(:message, required: true) attr(:key, :string, default: nil) attr(:on_close, :any, default: "lv:clear-flash") diff --git a/mix.exs b/mix.exs index fd960512f457..2986cab501d0 100644 --- a/mix.exs +++ b/mix.exs @@ -85,7 +85,7 @@ defmodule Plausible.MixProject do {:ex_machina, "~> 2.3", only: [:dev, :test, :ce_dev, :ce_test]}, {:excoveralls, "~> 0.10", only: [:test, :ce_test]}, {:finch, "~> 0.17.0"}, - {:floki, "~> 0.35.0"}, + {:floki, "~> 0.36.0"}, {:fun_with_flags, "~> 1.11.0"}, {:fun_with_flags_ui, "~> 1.0"}, {:locus, "~> 2.3"}, @@ -111,7 +111,7 @@ defmodule Plausible.MixProject do {:phoenix_html, "~> 3.3", override: true}, {:phoenix_live_reload, "~> 1.2", only: [:dev, :ce_dev]}, {:phoenix_pubsub, "~> 2.0"}, - {:phoenix_live_view, "~> 0.18"}, + {:phoenix_live_view, "~> 1.0"}, {:php_serializer, "~> 2.0"}, {:plug, "~> 1.13", override: true}, {:plug_cowboy, "~> 2.3"}, diff --git a/mix.lock b/mix.lock index 1c9a8c781b5e..d5cd3fdb5d4b 100644 --- a/mix.lock +++ b/mix.lock @@ -54,7 +54,7 @@ "expo": {:hex, :expo, "0.5.2", "beba786aab8e3c5431813d7a44b828e7b922bfa431d6bfbada0904535342efe2", [:mix], [], "hexpm", "8c9bfa06ca017c9cb4020fabe980bc7fdb1aaec059fd004c2ab3bff03b1c599c"}, "file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"}, "finch": {:hex, :finch, "0.17.0", "17d06e1d44d891d20dbd437335eebe844e2426a0cd7e3a3e220b461127c73f70", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6 or ~> 1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8d014a661bb6a437263d4b5abf0bcbd3cf0deb26b1e8596f2a271d22e48934c7"}, - "floki": {:hex, :floki, "0.35.2", "87f8c75ed8654b9635b311774308b2760b47e9a579dabf2e4d5f1e1d42c39e0b", [:mix], [], "hexpm", "6b05289a8e9eac475f644f09c2e4ba7e19201fd002b89c28c1293e7bd16773d9"}, + "floki": {:hex, :floki, "0.36.3", "1102f93b16a55bc5383b85ae3ec470f82dee056eaeff9195e8afdf0ef2a43c30", [:mix], [], "hexpm", "fe0158bff509e407735f6d40b3ee0d7deb47f3f3ee7c6c182ad28599f9f6b27a"}, "fun_with_flags": {:hex, :fun_with_flags, "1.11.0", "a9019d0300e9755c53111cf5b2aba640d7f0de2a8a03a0bd0c593e943c3e9ec5", [:mix], [{:ecto_sql, "~> 3.0", [hex: :ecto_sql, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.0", [hex: :phoenix_pubsub, repo: "hexpm", optional: true]}, {:redix, "~> 1.0", [hex: :redix, repo: "hexpm", optional: true]}], "hexpm", "448ec640cd1ade4728979ae5b3e7592b0fc8b0f99cf40785d048515c27d09743"}, "fun_with_flags_ui": {:hex, :fun_with_flags_ui, "1.0.0", "d764a4d1cc1233bdbb18dfb416a6ef96d0ecf4a5dc5a0201f7aa0b13cf2e7802", [:mix], [{:cowboy, ">= 2.0.0", [hex: :cowboy, repo: "hexpm", optional: true]}, {:fun_with_flags, "~> 1.11", [hex: :fun_with_flags, repo: "hexpm", optional: false]}, {:plug, "~> 1.12", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, ">= 2.0.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "b0c145894c00d65d5dc20ee5b1f18457985d1fd0b87866f0b41894d5979e55e0"}, "gen_cycle": {:hex, :gen_cycle, "1.0.4", "2315199f1256116328fad6a9d4371c2fb0bc39c7f5111b88d2de582300c931cc", [:rebar3], [], "hexpm", "67817e31b352bb00715f80a5571b3c069e26e994b2ebafa376acf76a2d0f66d8"}, @@ -114,7 +114,7 @@ "phoenix_ecto": {:hex, :phoenix_ecto, "4.4.3", "86e9878f833829c3f66da03d75254c155d91d72a201eb56ae83482328dc7ca93", [:mix], [{:ecto, "~> 3.5", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:plug, "~> 1.9", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "d36c401206f3011fefd63d04e8ef626ec8791975d9d107f9a0817d426f61ac07"}, "phoenix_html": {:hex, :phoenix_html, "3.3.4", "42a09fc443bbc1da37e372a5c8e6755d046f22b9b11343bf885067357da21cb3", [:mix], [{:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "0249d3abec3714aff3415e7ee3d9786cb325be3151e6c4b3021502c585bf53fb"}, "phoenix_live_reload": {:hex, :phoenix_live_reload, "1.4.1", "2aff698f5e47369decde4357ba91fc9c37c6487a512b41732818f2204a8ef1d3", [:mix], [{:file_system, "~> 0.2.1 or ~> 0.3", [hex: :file_system, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}], "hexpm", "9bffb834e7ddf08467fe54ae58b5785507aaba6255568ae22b4d46e2bb3615ab"}, - "phoenix_live_view": {:hex, :phoenix_live_view, "0.20.3", "8b6406bc0a451f295407d7acff7f234a6314be5bbe0b3f90ed82b07f50049878", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a8e4385e05618b424779f894ed2df97d3c7518b7285fcd11979077ae6226466b"}, + "phoenix_live_view": {:hex, :phoenix_live_view, "1.0.10", "d3d54f751ca538b17313541cabb1ab090a0d26e08ba914b49b6648022fa476f4", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "13f833a39b1368117e0529c0fe5029930a9bf11e2fb805c2263fcc32950f07a2"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"}, "phoenix_view": {:hex, :phoenix_view, "2.0.4", "b45c9d9cf15b3a1af5fb555c674b525391b6a1fe975f040fb4d913397b31abf4", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "4e992022ce14f31fe57335db27a28154afcc94e9983266835bb3040243eb620b"}, diff --git a/test/support/live_view_test_fix.ex b/test/support/live_view_test_fix.ex index 2fba6e185814..977f4e545b5d 100644 --- a/test/support/live_view_test_fix.ex +++ b/test/support/live_view_test_fix.ex @@ -32,10 +32,6 @@ defmodule Plausible.LiveViewTest do end end - def __render_component__(endpoint, component, assigns, opts) when is_atom(component) do - Phoenix.LiveViewTest.__render_component__(endpoint, %{module: component}, assigns, opts) - end - def __render_component__(endpoint, component, assigns, opts) do Phoenix.LiveViewTest.__render_component__(endpoint, component, assigns, opts) end From 05967c32fe847fbb228214ac7bc7ba0f98601552 Mon Sep 17 00:00:00 2001 From: "karlo.smid" Date: Mon, 28 Apr 2025 14:46:35 +0200 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=F0=9F=90=9B=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/plausible_web/live/funnel_settings.ex | 8 +- .../live/funnel_settings/form.ex | 6 +- .../live/funnel_settings/list.ex | 4 +- .../components/billing/billing.ex | 26 +++--- .../components/billing/notice.ex | 8 +- .../components/billing/pageview_slider.ex | 6 +- .../components/billing/plan_benefits.ex | 2 +- .../components/billing/plan_box.ex | 18 ++-- .../first_dashboard_launch_banner.ex | 4 +- lib/plausible_web/components/generic.ex | 24 +++--- lib/plausible_web/components/site/feature.ex | 4 +- lib/plausible_web/components/two_factor.ex | 14 +-- lib/plausible_web/live/choose_plan.ex | 4 +- .../live/components/combo_box.ex | 4 +- lib/plausible_web/live/components/form.ex | 16 ++-- lib/plausible_web/live/components/modal.ex | 2 +- .../live/components/pagination.ex | 2 +- .../live/components/verification.ex | 6 +- lib/plausible_web/live/csv_export.ex | 10 +-- lib/plausible_web/live/csv_import.ex | 12 +-- lib/plausible_web/live/flash.ex | 14 +-- lib/plausible_web/live/goal_settings/form.ex | 12 +-- lib/plausible_web/live/goal_settings/list.ex | 4 +- .../live/imports_exports_settings.ex | 18 ++-- .../live/plugins/api/settings.ex | 10 +-- .../live/plugins/api/token_form.ex | 2 +- lib/plausible_web/live/props_settings.ex | 4 +- lib/plausible_web/live/props_settings/form.ex | 8 +- lib/plausible_web/live/props_settings/list.ex | 2 +- lib/plausible_web/live/register_form.ex | 18 ++-- lib/plausible_web/live/reset_password_form.ex | 4 +- .../live/shields/country_rules.ex | 4 +- .../live/shields/hostname_rules.ex | 8 +- lib/plausible_web/live/shields/ip_rules.ex | 8 +- lib/plausible_web/live/shields/page_rules.ex | 6 +- lib/plausible_web/live/sites.ex | 14 +-- .../auth/_onboarding_steps.html.heex | 6 +- .../templates/auth/activate.html.heex | 34 ++++---- .../generate_2fa_recovery_codes.html.heex | 2 +- .../password_reset_request_success.html.heex | 2 +- .../templates/auth/user_settings.html.heex | 86 +++++++++---------- .../templates/auth/verify_2fa.html.heex | 6 +- .../auth/verify_2fa_recovery_code.html.heex | 4 +- .../templates/billing/choose_plan.html.heex | 4 +- .../upgrade_to_enterprise_plan.html.heex | 18 ++-- ...approaching_accept_traffic_until.html.heex | 4 +- .../templates/email/csv_import.html.heex | 8 +- .../email/google_analytics_import.html.heex | 8 +- .../templates/error/server_error.html.heex | 20 ++--- .../google_analytics/confirm.html.heex | 28 +++--- .../property_or_view_form.html.heex | 16 ++-- .../user_metric_form.html.heex | 4 +- .../templates/layout/_footer.html.heex | 4 +- .../templates/layout/_header.html.heex | 20 ++--- .../templates/layout/_notice.html.heex | 2 +- .../templates/layout/_settings_tab.html.heex | 2 +- .../templates/layout/app.html.heex | 14 +-- .../templates/layout/base_error.html.heex | 10 +-- .../templates/layout/focus.html.heex | 18 ++-- .../templates/layout/site_settings.html.heex | 24 +++--- .../templates/site/change_domain.html.heex | 8 +- .../templates/site/csv_import.html.heex | 4 +- .../membership/invite_member_form.html.heex | 26 +++--- .../templates/site/new.html.heex | 22 ++--- .../site/settings_email_reports.html.heex | 22 ++--- .../templates/site/settings_funnels.html.heex | 4 +- .../templates/site/settings_general.html.heex | 24 +++--- .../templates/site/settings_goals.html.heex | 4 +- .../site/settings_imports_exports.html.heex | 8 +- .../site/settings_integrations.html.heex | 4 +- .../templates/site/settings_people.html.heex | 22 ++--- .../templates/site/settings_props.html.heex | 4 +- .../site/settings_search_console.html.heex | 20 ++--- .../templates/site/settings_shields.html.heex | 16 ++-- .../site/settings_visibility.html.heex | 10 +-- .../templates/site/snippet.html.heex | 10 +-- .../templates/stats/site_locked.html.heex | 4 +- .../stats/waiting_first_pageview.html.heex | 6 +- 78 files changed, 438 insertions(+), 440 deletions(-) diff --git a/extra/lib/plausible_web/live/funnel_settings.ex b/extra/lib/plausible_web/live/funnel_settings.ex index 2a00a028b6b3..1d51ad1bf46b 100644 --- a/extra/lib/plausible_web/live/funnel_settings.ex +++ b/extra/lib/plausible_web/live/funnel_settings.ex @@ -43,7 +43,7 @@ defmodule PlausibleWeb.Live.FunnelSettings do
<.flash_messages flash={@flash} /> <%= if @add_funnel? do %> - <%= live_render( + {live_render( @socket, PlausibleWeb.Live.FunnelSettings.Form, id: "funnels-form", @@ -51,7 +51,7 @@ defmodule PlausibleWeb.Live.FunnelSettings do "current_user_id" => @current_user_id, "domain" => @domain } - ) %> + )} <% else %>
= Funnel.min_steps()}> <.live_component @@ -64,11 +64,11 @@ defmodule PlausibleWeb.Live.FunnelSettings do
- You need to define at least two goals to create a funnel. Go ahead and <%= link( + You need to define at least two goals to create a funnel. Go ahead and {link( "add goals", to: PlausibleWeb.Router.Helpers.site_path(@socket, :settings_goals, @domain), class: "text-indigo-500 w-full text-center" - ) %> to proceed. + )} to proceed.
<% end %> diff --git a/extra/lib/plausible_web/live/funnel_settings/form.ex b/extra/lib/plausible_web/live/funnel_settings/form.ex index e3f5248a5ea9..b3a8639adf47 100644 --- a/extra/lib/plausible_web/live/funnel_settings/form.ex +++ b/extra/lib/plausible_web/live/funnel_settings/form.ex @@ -121,7 +121,7 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do Last month conversion rate: <%= List.last(@evaluation_result.steps).conversion_rate %>% <% else %> - Choose minimum <%= Funnel.min_steps() %> steps to evaluate funnel. + Choose minimum {Funnel.min_steps()} steps to evaluate funnel. <% end %>

@@ -196,11 +196,11 @@ defmodule PlausibleWeb.Live.FunnelSettings.Form do class="border-dotted border-b border-gray-400 " tooltip="Sample calculation for last month" > - Entering Visitors: <%= @result.entering_visitors %> + Entering Visitors: {@result.entering_visitors} 0}> - Dropoff: <%= Map.get(step, :dropoff_percentage) %>% + Dropoff: {Map.get(step, :dropoff_percentage)}% """ diff --git a/extra/lib/plausible_web/live/funnel_settings/list.ex b/extra/lib/plausible_web/live/funnel_settings/list.ex index a1fcc2aec24e..8227543ab411 100644 --- a/extra/lib/plausible_web/live/funnel_settings/list.ex +++ b/extra/lib/plausible_web/live/funnel_settings/list.ex @@ -49,9 +49,9 @@ defmodule PlausibleWeb.Live.FunnelSettings.List do <%= for funnel <- @funnels do %>
- <%= funnel.name %> + {funnel.name} - <%= funnel.steps_count %>-step funnel + {funnel.steps_count}-step funnel
@@ -154,7 +154,7 @@ defmodule PlausibleWeb.Components.Billing do ~H""" - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}
""" @@ -170,11 +170,11 @@ defmodule PlausibleWeb.Components.Billing do ~H""" - <%= @title %> + {@title} - <%= Cldr.Number.to_string!(@usage) %> - <%= if is_number(@limit), do: "/ #{Cldr.Number.to_string!(@limit)}" %> + {Cldr.Number.to_string!(@usage)} + {if is_number(@limit), do: "/ #{Cldr.Number.to_string!(@limit)}"} """ @@ -189,7 +189,7 @@ defmodule PlausibleWeb.Components.Billing do >

Monthly quota

- <%= PlausibleWeb.AuthView.subscription_quota(@subscription, format: :long) %> + {PlausibleWeb.AuthView.subscription_quota(@subscription, format: :long)}
<.styled_link :if={ @@ -198,7 +198,7 @@ defmodule PlausibleWeb.Components.Billing do id="#upgrade-or-change-plan-link" href={Routes.billing_path(PlausibleWeb.Endpoint, :choose_plan)} > - <%= change_plan_or_upgrade_text(@subscription) %> + {change_plan_or_upgrade_text(@subscription)}
""" @@ -208,13 +208,13 @@ defmodule PlausibleWeb.Components.Billing do ~H"""
  • - Up to <%= present_limit(@plan, :monthly_pageview_limit) %> monthly pageviews + Up to {present_limit(@plan, :monthly_pageview_limit)} monthly pageviews
  • - Up to <%= present_limit(@plan, :site_limit) %> sites + Up to {present_limit(@plan, :site_limit)} sites
  • - Up to <%= present_limit(@plan, :hourly_api_request_limit) %> hourly api requests + Up to {present_limit(@plan, :hourly_api_request_limit)} hourly api requests
""" @@ -249,7 +249,7 @@ defmodule PlausibleWeb.Components.Billing do @checkout_disabled && "pointer-events-none bg-gray-400 dark:bg-gray-600" ]} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end diff --git a/lib/plausible_web/components/billing/notice.ex b/lib/plausible_web/components/billing/notice.ex index 4856b87beafc..857ed6d226aa 100644 --- a/lib/plausible_web/components/billing/notice.ex +++ b/lib/plausible_web/components/billing/notice.ex @@ -30,7 +30,7 @@ defmodule PlausibleWeb.Components.Billing.Notice do ~H"""
@@ -79,7 +79,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do id="highlight-pill" class="rounded-full bg-indigo-600/10 px-2.5 py-1 text-xs font-semibold leading-5 text-indigo-600 dark:text-indigo-300 dark:ring-1 dark:ring-indigo-300/50" > - <%= @text %> + {@text}

""" @@ -123,7 +123,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do id={"#{@kind}-price-tag-amount"} class="text-4xl font-bold tracking-tight text-gray-900 dark:text-gray-100" > - <%= @plan_to_render.monthly_cost |> Plausible.Billing.format_price() %> + {@plan_to_render.monthly_cost |> Plausible.Billing.format_price()} - <%= @plan_to_render.monthly_cost |> Money.mult!(12) |> Plausible.Billing.format_price() %> + {@plan_to_render.monthly_cost |> Money.mult!(12) |> Plausible.Billing.format_price()} - <%= @plan_to_render.yearly_cost |> Plausible.Billing.format_price() %> + {@plan_to_render.yearly_cost |> Plausible.Billing.format_price()} /year @@ -218,16 +218,16 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do > <%= if @exceeded_plan_limits != [] do %> - <%= @disabled_message %> + {@disabled_message} <:tooltip_content> Your usage exceeds the following limit(s):

- <%= Phoenix.Naming.humanize(limit) %>
+ {Phoenix.Naming.humanize(limit)}

<% else %> - <%= @disabled_message %> + {@disabled_message} <% end %>

""" @@ -320,7 +320,7 @@ defmodule PlausibleWeb.Components.Billing.PlanBox do @checkout_disabled && "pointer-events-none bg-gray-400 dark:bg-gray-600" ]} > - <%= @change_plan_link_text %> + {@change_plan_link_text} """ end diff --git a/lib/plausible_web/components/first_dashboard_launch_banner.ex b/lib/plausible_web/components/first_dashboard_launch_banner.ex index f4ed01c43c7b..b38ac6039d1b 100644 --- a/lib/plausible_web/components/first_dashboard_launch_banner.ex +++ b/lib/plausible_web/components/first_dashboard_launch_banner.ex @@ -28,10 +28,10 @@ defmodule PlausibleWeb.Components.FirstDashboardLaunchBanner do x-bind:class="! show ? 'hidden' : ''" x-init={x_init(@site)} > - <%= link("Team members, email reports and GA import. Explore more →", + {link("Team members, email reports and GA import. Explore more →", to: "/#{URI.encode_www_form(@site.domain)}/settings/email-reports", class: "py-2 block" - ) %> + )} """ end diff --git a/lib/plausible_web/components/generic.ex b/lib/plausible_web/components/generic.ex index ff1908ad994f..853b24ec03f9 100644 --- a/lib/plausible_web/components/generic.ex +++ b/lib/plausible_web/components/generic.ex @@ -55,7 +55,7 @@ defmodule PlausibleWeb.Components.Generic do ]} {@rest} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end @@ -101,7 +101,7 @@ defmodule PlausibleWeb.Components.Generic do ]} {@rest} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end @@ -154,11 +154,11 @@ defmodule PlausibleWeb.Components.Generic do

- <%= @title %> + {@title}

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

@@ -191,7 +191,7 @@ defmodule PlausibleWeb.Components.Generic do class={"text-indigo-600 hover:text-indigo-700 dark:text-indigo-500 dark:hover:text-indigo-600 " <> @class} {@rest} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end @@ -212,7 +212,7 @@ defmodule PlausibleWeb.Components.Generic do x-on:focusin.window="! $refs.panel.contains($event.target) && close()" > """ @@ -253,7 +253,7 @@ defmodule PlausibleWeb.Components.Generic do ~H""" <.unstyled_link new_tab={@new_tab} href={@href} x-on:click="close()" class={@class} {@rest}> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end @@ -281,14 +281,14 @@ defmodule PlausibleWeb.Components.Generic do rel="noopener noreferrer" {@rest} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ else ~H""" <.link class={@class} href={@href} {@rest}> - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)} """ end @@ -333,14 +333,14 @@ defmodule PlausibleWeb.Components.Generic do x-on:mouseout="hovered = false" class={["cursor-pointer flex align-items-center", @class]} > - <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}

- <%= render_slot(List.first(@tooltip_content)) %> + {render_slot(List.first(@tooltip_content))} """ diff --git a/lib/plausible_web/components/site/feature.ex b/lib/plausible_web/components/site/feature.ex index c751f02bb3f4..943786ba68c4 100644 --- a/lib/plausible_web/components/site/feature.ex +++ b/lib/plausible_web/components/site/feature.ex @@ -34,11 +34,11 @@ defmodule PlausibleWeb.Components.Site.Feature do else: "text-gray-900 dark:text-gray-100" ) ]}> - Show <%= @feature_mod.display_name() %> in the Dashboard + Show {@feature_mod.display_name()} in the Dashboard
- <%= render_slot(@inner_block) %> + {render_slot(@inner_block)}
""" diff --git a/lib/plausible_web/components/two_factor.ex b/lib/plausible_web/components/two_factor.ex index 2233ddd5a89e..1e3367f2307d 100644 --- a/lib/plausible_web/components/two_factor.ex +++ b/lib/plausible_web/components/two_factor.ex @@ -16,7 +16,7 @@ defmodule PlausibleWeb.Components.TwoFactor do assigns = assign(assigns, :code, qr_code) ~H""" - <%= Phoenix.HTML.raw(@code) %> + {Phoenix.HTML.raw(@code)} """ end @@ -28,7 +28,7 @@ defmodule PlausibleWeb.Components.TwoFactor do def verify_2fa_input(assigns) do ~H"""
- <%= Phoenix.HTML.Form.text_input(@form, @field, + {Phoenix.HTML.Form.text_input(@form, @field, autocomplete: "off", class: "font-mono tracking-[0.5em] w-36 pl-5 font-medium shadow-sm focus:ring-indigo-500 focus:border-indigo-500 block border-gray-300 dark:border-gray-500 dark:text-gray-200 dark:bg-gray-900 rounded-l-md", @@ -40,7 +40,7 @@ defmodule PlausibleWeb.Components.TwoFactor do placeholder: "••••••", value: "", required: "required" - ) %> + )}
- <%= render_slot(@icon) %> + {render_slot(@icon)}
- <%= render_slot(@inner_block, f) %> + {render_slot(@inner_block, f)}
- <%= render_slot(@buttons) %> + {render_slot(@buttons)}
@@ -160,8 +160,8 @@ defmodule PlausibleWeb.Live.CSVImport do defp dates(assigns) do ~H""" - <%= @range.first %> - to <%= @range.last %> + {@range.first} + to {@range.last} """ end @@ -191,15 +191,15 @@ defmodule PlausibleWeb.Live.CSVImport do if(@status == :error, do: "text-red-600 dark:text-red-700") ]}> <%= if @upload do %> - <%= @upload.client_name %> + {@upload.client_name} <% else %> - <%= @table %>_YYYYMMDD_YYYYMMDD.csv + {@table}_YYYYMMDD_YYYYMMDD.csv <% end %>

- <%= error_to_string(error) %> + {error_to_string(error)}

""" diff --git a/lib/plausible_web/live/flash.ex b/lib/plausible_web/live/flash.ex index a5cbfcd2cdd2..d9c53a427156 100644 --- a/lib/plausible_web/live/flash.ex +++ b/lib/plausible_web/live/flash.ex @@ -55,10 +55,10 @@ defmodule PlausibleWeb.Live.Flash do <.icon_success /> <:title> - <%= Flash.get(@flash, :success_title) || "Success!" %> + {Flash.get(@flash, :success_title) || "Success!"} <:message> - <%= Flash.get(@flash, :success) %> + {Flash.get(@flash, :success)} <.flash :if={Flash.get(@flash, :error)} key="error"> @@ -66,10 +66,10 @@ defmodule PlausibleWeb.Live.Flash do <.icon_error /> <:title> - <%= Flash.get(@flash, :error_title) || "Error!" %> + {Flash.get(@flash, :error_title) || "Error!"} <:message> - <%= Flash.get(@flash, :error) %> + {Flash.get(@flash, :error)} <.flash @@ -115,13 +115,13 @@ defmodule PlausibleWeb.Live.Flash do
- <%= render_slot(@icon) %> + {render_slot(@icon)}

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

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

diff --git a/lib/plausible_web/live/goal_settings/form.ex b/lib/plausible_web/live/goal_settings/form.ex index 3f140a3938c6..3639323bbb4c 100644 --- a/lib/plausible_web/live/goal_settings/form.ex +++ b/lib/plausible_web/live/goal_settings/form.ex @@ -60,7 +60,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do x-show="tabSelectionInProgress" /> -

Add Goal for <%= @domain %>

+

Add Goal for {@domain}

<.tabs selected_tab={@selected_tab} myself={@myself} /> @@ -99,7 +99,7 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do phx-target={@myself} > 1}> - Already sending custom events? We've found <%= @event_name_options_count %> custom events from the last 6 months that are not yet configured as goals. Click here to add them. + Already sending custom events? We've found {@event_name_options_count} custom events from the last 6 months that are not yet configured as goals. Click here to add them. Already sending custom events? We've found 1 custom event from the last 6 months that is not yet configured as a goal. Click here to add it. @@ -135,9 +135,9 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do /> <.error :for={{msg, opts} <- @f[:page_path].errors}> - <%= Enum.reduce(opts, msg, fn {key, value}, acc -> + {Enum.reduce(opts, msg, fn {key, value}, acc -> String.replace(acc, "%{#{key}}", fn _ -> to_string(value) end) - end) %> + end)}
""" @@ -263,9 +263,9 @@ defmodule PlausibleWeb.Live.GoalSettings.Form do
<.error :for={{msg, opts} <- @f[:event_name].errors}> - <%= Enum.reduce(opts, msg, fn {key, value}, acc -> + {Enum.reduce(opts, msg, fn {key, value}, acc -> String.replace(acc, "%{#{key}}", fn _ -> to_string(value) end) - end) %> + end)}
diff --git a/lib/plausible_web/live/goal_settings/list.ex b/lib/plausible_web/live/goal_settings/list.ex index 8bbb8e723cfd..2eec25d49d57 100644 --- a/lib/plausible_web/live/goal_settings/list.ex +++ b/lib/plausible_web/live/goal_settings/list.ex @@ -63,10 +63,10 @@ defmodule PlausibleWeb.Live.GoalSettings.List do <%= if not @revenue_goals_enabled? && goal.currency do %>
- <%= goal %> + {goal}
<% else %> - <%= goal %> + {goal} <% end %> Pageview diff --git a/lib/plausible_web/live/imports_exports_settings.ex b/lib/plausible_web/live/imports_exports_settings.ex index b1c822ba3394..caf4b0f47bf0 100644 --- a/lib/plausible_web/live/imports_exports_settings.ex +++ b/lib/plausible_web/live/imports_exports_settings.ex @@ -94,7 +94,7 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do

- <%= @import_warning %> + {@import_warning}

@@ -102,7 +102,7 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do Existing Imports

- A maximum of <%= @max_imports %> imports at any time is allowed. + A maximum of {@max_imports} imports at any time is allowed.

@@ -151,30 +151,28 @@ defmodule PlausibleWeb.Live.ImportsExportsSettings do Import failed - <.tooltip :if={@entry.tooltip} wrapper_class={[@label_class, "grow"]} class="justify-left"> - <%= Plausible.Imported.SiteImport.label(@entry.site_import) %> + {Plausible.Imported.SiteImport.label(@entry.site_import)} <:tooltip_content> <.notice_message message_label={@entry.tooltip} />
- <%= Plausible.Imported.SiteImport.label(@entry.site_import) %> + {Plausible.Imported.SiteImport.label(@entry.site_import)}
- (<%= PlausibleWeb.StatsView.large_number_format( + ({PlausibleWeb.StatsView.large_number_format( pageview_count(@entry.site_import, @pageview_counts) - ) %> page views) + )} page views)
- From <%= format_date(@entry.site_import.start_date) %> to <%= format_date( - @entry.site_import.end_date - ) %> + From {format_date(@entry.site_import.start_date)} to {format_date(@entry.site_import.end_date)} <%= if @entry.live_status == SiteImport.completed() do %> (imported <% else %> (started <% end %> - on <%= format_date(@entry.site_import.inserted_at) %>) + on {format_date(@entry.site_import.inserted_at)})
<.button diff --git a/lib/plausible_web/live/plugins/api/settings.ex b/lib/plausible_web/live/plugins/api/settings.ex index c9bbb25c1e9d..8c705dcb9150 100644 --- a/lib/plausible_web/live/plugins/api/settings.ex +++ b/lib/plausible_web/live/plugins/api/settings.ex @@ -37,7 +37,7 @@ defmodule PlausibleWeb.Live.Plugins.API.Settings do <.flash_messages flash={@flash} /> <%= if @add_token? do %> - <%= live_render( + {live_render( @socket, PlausibleWeb.Live.Plugins.API.TokenForm, id: "token-form", @@ -47,7 +47,7 @@ defmodule PlausibleWeb.Live.Plugins.API.Settings do "token_description" => @token_description, "rendered_by" => self() } - ) %> + )} <% end %>
@@ -94,14 +94,14 @@ defmodule PlausibleWeb.Live.Plugins.API.Settings do - <%= token.description %> + {token.description} - **********<%= token.hint %> + **********{token.hint} - <%= Plausible.Plugins.API.Token.last_used_humanize(token) %> + {Plausible.Plugins.API.Token.last_used_humanize(token)}
diff --git a/lib/plausible_web/live/props_settings/list.ex b/lib/plausible_web/live/props_settings/list.ex index 4840d69991b0..b05d4b9d2ef8 100644 --- a/lib/plausible_web/live/props_settings/list.ex +++ b/lib/plausible_web/live/props_settings/list.ex @@ -47,7 +47,7 @@ defmodule PlausibleWeb.Live.PropsSettings.List do
  • - <%= prop %> + {prop}