Improve wording in billing notices

bt-bugs
Vinicius Brasil 3 years ago
parent 0534397c32
commit ab714bb4b8

@ -50,7 +50,7 @@ defmodule PlausibleWeb.Components.Billing do
not has_access? ->
~H"""
<.notice class="rounded-t-md rounded-b-none" size={@size} {@rest}>
This account does not have access to <%= assigns.feature_mod.display_name() %>. To get access to this feature,
<%= account_label(@current_user, @billable_user) %> does not have access to <%= assigns.feature_mod.display_name() %>. To get access to this feature,
<.upgrade_call_to_action current_user={@current_user} billable_user={@billable_user} />.
</.notice>
"""
@ -82,7 +82,7 @@ defmodule PlausibleWeb.Components.Billing do
def limit_exceeded_notice(assigns) do
~H"""
<.notice {@rest}>
This account is limited to <%= @limit %> <%= @resource %>. To increase this limit,
<%= account_label(@current_user, @billable_user) %> is limited to <%= @limit %> <%= @resource %>. To increase this limit,
<.upgrade_call_to_action current_user={@current_user} billable_user={@billable_user} />.
</.notice>
"""
@ -90,7 +90,6 @@ defmodule PlausibleWeb.Components.Billing do
attr(:current_user, :map)
attr(:billable_user, :map)
attr(:plan, :atom)
defp upgrade_call_to_action(assigns) do
billable_user = Plausible.Users.with_subscription(assigns.billable_user)
@ -103,9 +102,7 @@ defmodule PlausibleWeb.Components.Billing do
cond do
assigns.billable_user.id !== assigns.current_user.id ->
~H"""
please reach out to the site owner to upgrade their subscription
"""
~H"please reach out to the site owner to upgrade their subscription"
growth? || trial? ->
~H"""
@ -116,9 +113,15 @@ defmodule PlausibleWeb.Components.Billing do
"""
true ->
~H"""
please contact support@plausible.io about the Enterprise plan
"""
~H"please contact support@plausible.io about the Enterprise plan"
end
end
defp account_label(current_user, billable_user) do
if current_user.id == billable_user.id do
"Your account"
else
"The owner of this site"
end
end

@ -24,7 +24,7 @@ defmodule PlausibleWeb.Components.BillingTest do
feature_mod: Plausible.Billing.Feature.Props
)
assert rendered =~ "This account does not have access to Custom Properties"
assert rendered =~ "Your account does not have access to Custom Properties"
assert rendered =~ "upgrade your subscription"
assert rendered =~ "/billing/choose-plan"
end
@ -40,7 +40,7 @@ defmodule PlausibleWeb.Components.BillingTest do
feature_mod: Plausible.Billing.Feature.Funnels
)
assert rendered =~ "This account does not have access to Funnels"
assert rendered =~ "The owner of this site does not have access to Funnels"
assert rendered =~ "please reach out to the site owner to upgrade their subscription"
end
@ -68,7 +68,7 @@ defmodule PlausibleWeb.Components.BillingTest do
resource: "users"
)
assert rendered =~ "This account is limited to 10 users. To increase this limit"
assert rendered =~ "Your account is limited to 10 users. To increase this limit"
assert rendered =~ "upgrade your subscription"
assert rendered =~ "/billing/choose-plan"
end
@ -84,7 +84,7 @@ defmodule PlausibleWeb.Components.BillingTest do
resource: "users"
)
assert rendered =~ "This account is limited to 10 users"
assert rendered =~ "The owner of this site is limited to 10 users"
assert rendered =~ "please reach out to the site owner to upgrade their subscription"
end
@ -99,7 +99,7 @@ defmodule PlausibleWeb.Components.BillingTest do
resource: "users"
)
assert rendered =~ "This account is limited to 10 users"
assert rendered =~ "Your account is limited to 10 users"
assert rendered =~ "upgrade your subscription"
assert rendered =~ "/billing/choose-plan"
end
@ -119,8 +119,8 @@ defmodule PlausibleWeb.Components.BillingTest do
resource: "users"
)
assert rendered =~
"This account is limited to 10 users. To increase this limit, please contact support@plausible.io about the Enterprise plan"
assert rendered =~ "Your account is limited to 10 users."
assert rendered =~ "please contact support@plausible.io about the Enterprise plan"
end
test "limit_exceeded_notice/1 when billable user is on a business plan displays support email" do
@ -134,7 +134,7 @@ defmodule PlausibleWeb.Components.BillingTest do
resource: "users"
)
assert rendered =~
"This account is limited to 10 users. To increase this limit, please contact support@plausible.io about the Enterprise plan"
assert rendered =~ "Your account is limited to 10 users."
assert rendered =~ "please contact support@plausible.io about the Enterprise plan"
end
end

@ -286,7 +286,7 @@ defmodule PlausibleWeb.SiteControllerTest do
})
assert html = html_response(conn, 200)
assert html =~ "This account is limited to 10 sites"
assert html =~ "Your account is limited to 10 sites"
refute Repo.get_by(Plausible.Site, domain: "over-limit.example.com")
end

Loading…
Cancel
Save