Skip to content

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

Shields behind a FF (#3780)

hq1494ffbd62222
diff --git a/lib/plausible_web/views/layout_view.ex b/lib/plausible_web/views/layout_view.ex
index 57307a5bf3..f122044178 100644
--- a/lib/plausible_web/views/layout_view.ex
+++ b/lib/plausible_web/views/layout_view.ex
@@ -51,7 +51,9 @@ defmodule PlausibleWeb.LayoutView do
end,
[key: "Custom Properties", value: "properties", icon: :document_text],
[key: "Integrations", value: "integrations", icon: :arrow_path_rounded_square],
- [key: "Shields", value: "shields", icon: :shield_exclamation],
+ if FunWithFlags.enabled?(:shields, for: conn.assigns[:current_user]) do
+ [key: "Shields", value: "shields", icon: :shield_exclamation]
+ end,
[key: "Email Reports", value: "email-reports", icon: :envelope],
if conn.assigns[:current_user_role] == :owner do
[key: "Danger Zone", value: "danger-zone", icon: :exclamation_triangle]
diff --git a/test/test_helper.exs b/test/test_helper.exs
index 30f0ebbd59..7cbd300df1 100644
--- a/test/test_helper.exs
+++ b/test/test_helper.exs
@@ -2,6 +2,7 @@
Mox.defmock(Plausible.HTTPClient.Mock, for: Plausible.HTTPClient.Interface)
Application.ensure_all_started(:double)
FunWithFlags.enable(:window_time_on_page)
+FunWithFlags.enable(:shields)
Ecto.Adapters.SQL.Sandbox.mode(Plausible.Repo, :manual)
if Mix.env() == :small_test do