From 494ffbd62222e4ab4aa04606edb9fc0d193dcfc2 Mon Sep 17 00:00:00 2001 From: hq1 Date: Mon, 12 Feb 2024 15:22:06 +0100 Subject: [PATCH] Shields behind a FF (#3780) --- lib/plausible_web/views/layout_view.ex | 4 +++- test/test_helper.exs | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/plausible_web/views/layout_view.ex b/lib/plausible_web/views/layout_view.ex index 57307a5bf..f12204417 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 30f0ebbd5..7cbd300df 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