Skip to content

Commit

Permalink
Remove obsolete feature flags (#4026)
Browse files Browse the repository at this point in the history
  • Loading branch information
aerosol committed Apr 18, 2024
1 parent 1b06bb5 commit 8364345
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
5 changes: 1 addition & 4 deletions assets/js/dashboard/util/filters.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const flags = JSON.parse(document.getElementById('stats-react-container').dataset.flags)

export const FILTER_GROUPS = {
'page': ['page', 'entry_page', 'exit_page'],
'source': ['source', 'referrer'],
Expand All @@ -10,8 +8,7 @@ export const FILTER_GROUPS = {
'utm': ['utm_medium', 'utm_source', 'utm_campaign', 'utm_term', 'utm_content'],
'goal': ['goal'],
'props': ['prop_key', 'prop_value'],
...(flags.hostname_filter ? { 'hostname': ['hostname'] } : {})

'hostname': ['hostname']
}

export const NO_CONTAINS_OPERATOR = new Set(['goal', 'screen'].concat(FILTER_GROUPS['location']))
Expand Down
8 changes: 1 addition & 7 deletions lib/plausible_web/controllers/stats_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,7 @@ defmodule PlausibleWeb.StatsController do

defp shared_link_cookie_name(slug), do: "shared-link-" <> slug

defp get_flags(user, site) do
%{
hostname_filter:
FunWithFlags.enabled?(:hostname_filter, for: user) ||
FunWithFlags.enabled?(:hostname_filter, for: site)
}
end
defp get_flags(_user, _site), do: %{}

defp is_dbip() do
on_full_build do
Expand Down
4 changes: 1 addition & 3 deletions lib/plausible_web/views/layout_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ defmodule PlausibleWeb.LayoutView do
%{key: "IP Addresses", value: "shields/ip_addresses"},
%{key: "Countries", value: "shields/countries"},
%{key: "Pages", value: "shields/pages"},
if FunWithFlags.enabled?(:shield_hostnames, for: conn.assigns[:site]) do
%{key: "Hostnames", value: "shields/hostnames"}
end
%{key: "Hostnames", value: "shields/hostnames"}
]
|> Enum.reject(&is_nil/1)
},
Expand Down
2 changes: 0 additions & 2 deletions priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@

FunWithFlags.enable(:imports_exports)
FunWithFlags.enable(:csv_imports_exports)
FunWithFlags.enable(:hostname_filter)
FunWithFlags.enable(:shield_hostnames)

user = Plausible.Factory.insert(:user, email: "[email protected]", password: "plausible")

Expand Down

0 comments on commit 8364345

Please sign in to comment.