analytics/lib/plausible_web/templates/layout/_notice.html.heex
RobertJoonas d3094ffdb7
Prevent upgrades that would leave the customer locked (#3683)
* Remove allowance_required field from grace_period

Since we are now preventing customers from subscribing to a plan that
does not accommodate their pageview usage, there is no need for an extra
check on removing the grace period after a successful upgrade.

This extra check is the reason why the automatic unlocks have recently
failed in several cases.

* refactor outgrown subscription notices

* make a test actually test the described functionality

* Apply greater pageview allowance margin only for trial upgrades

...in order to prevent cancelled or paused subscriptions from subscribing
to plans that would still leave their account locked.

* Mark the entire ChoosePlanTest module full build only

* remove account locking guide

This is irrelevant for self-hosters, and the internal knowledge base is
a better place for this document. Moved it there.

* refactor Keyword get clause

* add a pattern matching assertion in code
2024-01-15 14:59:56 +00:00

28 lines
877 B
Plaintext

<%= if assigns[:flash] do %>
<%= render("_flash.html", assigns) %>
<% end %>
<%= if @conn.assigns[:current_user] do %>
<div class="flex flex-col gap-y-2">
<Notice.active_grace_period
:if={Plausible.Auth.GracePeriod.active?(@conn.assigns.current_user)}
enterprise?={Plausible.Auth.enterprise_configured?(@conn.assigns.current_user)}
grace_period_end={grace_period_end(@conn.assigns.current_user)}
/>
<Notice.dashboard_locked :if={Plausible.Auth.GracePeriod.expired?(@conn.assigns.current_user)} />
<Notice.subscription_cancelled user={@conn.assigns.current_user} />
<Notice.subscription_past_due
subscription={@conn.assigns.current_user.subscription}
class="container"
/>
<Notice.subscription_paused
subscription={@conn.assigns.current_user.subscription}
class="container"
/>
</div>
<% end %>