From 131c99c69e387aed700a510ec658f4b59137fe1c Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Wed, 7 Jun 2023 16:02:36 +0800 Subject: [PATCH] remove custom_dimension_filter feature and views_per_visit_metric flags (#2996) * remove custom_dimension_filter feature flag * add changelog entry * fix shouldLinkToFilterModal removal * remove views_per_visit_metric flag --- CHANGELOG.md | 1 + assets/js/dashboard/filters.js | 47 +++++-------------- .../controllers/stats_controller.ex | 7 +-- 3 files changed, 15 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7f4df102..680196652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,6 +43,7 @@ All notable changes to this project will be documented in this file. ### Removed - Remove Firewall plug and `IP_BLOCKLIST` environment variable - Remove the ability to collapse the main graph plausible/analytics#2627 +- Remove `custom_dimension_filter` feature flag plausible/analytics#2996 ## v1.5.1 - 2022-12-06 diff --git a/assets/js/dashboard/filters.js b/assets/js/dashboard/filters.js index 97f98bc4b..781200803 100644 --- a/assets/js/dashboard/filters.js +++ b/assets/js/dashboard/filters.js @@ -55,26 +55,15 @@ function renderDropdownFilter(site, history, [key, value], query) { return (
- {shouldLinkToFilterModal(site, key) && - - {filterText(key, value, query)} - - - } - {!shouldLinkToFilterModal(site, key) && -
{e.preventDefault()}} - className="group flex w-full justify-between items-center" - style={{ width: 'calc(100% - 1.5rem)' }} - > - {filterText(key, value, query)} -
- } + + {filterText(key, value, query)} + + removeFilter(key, history, query)}> @@ -83,10 +72,6 @@ function renderDropdownFilter(site, history, [key, value], query) { ) } -function shouldLinkToFilterModal(site, key) { - return key !== 'props' || site.flags.custom_dimension_filter -} - function filterDropdownOption(site, option) { return ( @@ -110,7 +95,6 @@ function DropdownContent({ history, site, query, wrapped }) { if (wrapped === 0 || addingFilter) { return Object.keys(FILTER_GROUPS) - .filter((option) => option === 'props' ? site.flags.custom_dimension_filter : true) .map((option) => filterDropdownOption(site, option)) } @@ -219,16 +203,9 @@ class Filters extends React.Component { renderListFilter(history, [key, value], query) { return ( - {shouldLinkToFilterModal(this.props.site, key) && - - {filterText(key, value, query)} - - } - {!shouldLinkToFilterModal(this.props.site, key) && -
- {filterText(key, value, query)} -
- } + + {filterText(key, value, query)} + removeFilter(key, history, query)}> diff --git a/lib/plausible_web/controllers/stats_controller.ex b/lib/plausible_web/controllers/stats_controller.ex index b23a9b1b4..ad93738fb 100644 --- a/lib/plausible_web/controllers/stats_controller.ex +++ b/lib/plausible_web/controllers/stats_controller.ex @@ -324,11 +324,8 @@ defmodule PlausibleWeb.StatsController do defp shared_link_cookie_name(slug), do: "shared-link-" <> slug - defp get_flags(user) do - %{ - custom_dimension_filter: FunWithFlags.enabled?(:custom_dimension_filter, for: user), - views_per_visit_metric: FunWithFlags.enabled?(:views_per_visit_metric, for: user) - } + defp get_flags(_user) do + %{} end defp is_dbip() do