Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Improve the error messages on the change teams screen (#5332)

Marko Saric472b7bfb1d08
diff --git a/lib/plausible_web/controllers/site/membership_controller.ex b/lib/plausible_web/controllers/site/membership_controller.ex
index 984b7423ec..03b2d63850 100644
--- a/lib/plausible_web/controllers/site/membership_controller.ex
+++ b/lib/plausible_web/controllers/site/membership_controller.ex
@@ -182,13 +182,17 @@ defmodule PlausibleWeb.Site.MembershipController do
{:error, :no_plan} ->
conn
|> render_change_team_form(conn.assigns.current_user, site,
- error: "This team has no subscription"
+ error:
+ "This team doesn't have a subscription. Please start a subscription for " <>
+ "the team first and then try moving the site again"
)
{:error, {:over_plan_limits, _}} ->
conn
|> render_change_team_form(conn.assigns.current_user, site,
- error: "This team's subscription outgrows site usage"
+ error:
+ "This site's usage is over the limits of the team's subscription. " <>
+ "Please upgrade the team to an appropriate subscription and then try moving the site again"
)
{:error, _} ->
diff --git a/test/plausible_web/controllers/site_controller_test.exs b/test/plausible_web/controllers/site_controller_test.exs
index f1c41a7266..e5d7e1a335 100644
--- a/test/plausible_web/controllers/site_controller_test.exs
+++ b/test/plausible_web/controllers/site_controller_test.exs
@@ -1946,7 +1946,7 @@ defmodule PlausibleWeb.SiteControllerTest do
)
html = html_response(conn, 200)
- assert html =~ "This team has no subscription"
+ assert text(html) =~ "This team doesn't have a subscription"
end
@tag :ee_only
@@ -1969,7 +1969,7 @@ defmodule PlausibleWeb.SiteControllerTest do
)
html = html_response(conn, 200)
- assert text(html) =~ "This team's subscription outgrows site usage"
+ assert text(html) =~ "This site's usage is over the limits of the team's subscription"
end
test "change team form error: unknown team identifier", %{