-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bring back premium feature notices in tiles (#4742)
* Lost tapes: bring back premium feature notices in tiles * Ensure that e-mail CTA is only presented to business/enterprise customers * Format * Fix typespecs * Add t() type to EnterprisePlan * Reduce Plan.t() definition Found no reason for it to be there.
- Loading branch information
Showing
8 changed files
with
58 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,17 +302,24 @@ defmodule PlausibleWeb.Components.Billing.Notice do | |
defp upgrade_call_to_action(assigns) do | ||
billable_user = Plausible.Users.with_subscription(assigns.billable_user) | ||
|
||
plan = | ||
Plans.get_regular_plan(billable_user.subscription, only_non_expired: true) | ||
|
||
trial? = Plausible.Users.on_trial?(assigns.billable_user) | ||
growth? = plan && plan.kind == :growth | ||
upgrade_assistance_required? = | ||
case Plans.get_subscription_plan(billable_user.subscription) do | ||
%Plausible.Billing.Plan{kind: :business} -> true | ||
%Plausible.Billing.EnterprisePlan{} -> true | ||
_ -> false | ||
end | ||
|
||
cond do | ||
assigns.billable_user.id !== assigns.current_user.id -> | ||
~H"please reach out to the site owner to upgrade their subscription" | ||
|
||
growth? || trial? -> | ||
upgrade_assistance_required? -> | ||
~H""" | ||
please contact <a href="mailto:[email protected]" class="underline">[email protected]</a> | ||
to upgrade your subscription | ||
""" | ||
|
||
true -> | ||
~H""" | ||
please | ||
<.link | ||
|
@@ -322,12 +329,6 @@ defmodule PlausibleWeb.Components.Billing.Notice do | |
upgrade your subscription | ||
</.link> | ||
""" | ||
|
||
true -> | ||
~H""" | ||
please contact <a href="mailto:[email protected]" class="underline">[email protected]</a> | ||
to upgrade your subscription | ||
""" | ||
end | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters