Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Remove cities feature flag
Uku Taht880ea45cd9d6
diff --git a/assets/js/dashboard/mount.js b/assets/js/dashboard/mount.jsindex 3044447349..635d2e5c40 100644--- a/assets/js/dashboard/mount.js+++ b/assets/js/dashboard/mount.js@@ -16,8 +16,7 @@ if (container) {insertedAt: container.dataset.insertedAt,embedded: container.dataset.embedded,background: container.dataset.background,- selfhosted: container.dataset.selfhosted === 'true',- cities: container.dataset.cities === 'true'+ selfhosted: container.dataset.selfhosted === 'true'}const loggedIn = container.dataset.loggedIn === 'true'diff --git a/assets/js/dashboard/router.js b/assets/js/dashboard/router.jsindex f96df0a580..b6d7694352 100644--- a/assets/js/dashboard/router.js+++ b/assets/js/dashboard/router.js@@ -49,7 +49,7 @@ export default function Router({site, loggedIn, currentUserRole}) {<ExitPagesModal site={site} /></Route><Route path="/:domain/countries">- <ModalTable title="Top countries" site={site} endpoint={`/api/stats/${encodeURIComponent(site.domain)}/countries`} filter={{country: 'code', country_name: 'name'}} keyLabel="Country" renderIcon={(row) => site.cities && renderCountryIcon(row)} />+ <ModalTable title="Top countries" site={site} endpoint={`/api/stats/${encodeURIComponent(site.domain)}/countries`} filter={{country: 'code', country_name: 'name'}} keyLabel="Country" renderIcon={renderCountryIcon} /></Route><Route path="/:domain/regions"><ModalTable title="Top regions" site={site} endpoint={`/api/stats/${encodeURIComponent(site.domain)}/regions`} filter={{region: 'code', region_name: 'name'}} keyLabel="Region" renderIcon={renderRegionIcon} />diff --git a/assets/js/dashboard/stats/locations/index.js b/assets/js/dashboard/stats/locations/index.jsindex 31b3cc0cb7..97a7e04c79 100644--- a/assets/js/dashboard/stats/locations/index.js+++ b/assets/js/dashboard/stats/locations/index.js@@ -15,7 +15,7 @@ function Countries({query, site, onClick}) {}function renderIcon(country) {- return site.cities && <span className="mr-1">{country.flag}</span>+ return <span className="mr-1">{country.flag}</span>}return (@@ -61,7 +61,7 @@ function Cities({query, site}) {}function renderIcon(city) {- return site.cities && <span className="mr-1">{city.country_flag}</span>+ return <span className="mr-1">{city.country_flag}</span>}return (@@ -180,8 +180,8 @@ export default class Locations extends React.Component {<ul className="flex font-medium text-xs text-gray-500 dark:text-gray-400 space-x-2">{ this.renderPill('Map', 'map') }{ this.renderPill('Countries', 'countries') }- { this.props.site.cities && this.renderPill('Regions', 'regions') }- { this.props.site.cities && this.renderPill('Cities', 'cities') }+ { this.renderPill('Regions', 'regions') }+ { this.renderPill('Cities', 'cities') }</ul></div>{ this.renderContent() }diff --git a/assets/js/dashboard/stats/modals/filter.js b/assets/js/dashboard/stats/modals/filter.jsindex 4ac02f1bf7..27dbcb7b29 100644--- a/assets/js/dashboard/stats/modals/filter.js+++ b/assets/js/dashboard/stats/modals/filter.js@@ -187,12 +187,7 @@ class FilterModal extends React.Component {}renderFilterInputs() {- const groups = FILTER_GROUPS[this.state.selectedFilterGroup].filter((filterName) => {- if (['city', 'region'].includes(filterName)) {- return this.props.site.cities- }- return true- })+ const groups = FILTER_GROUPS[this.state.selectedFilterGroup]return groups.map((filter) => {return (diff --git a/config/runtime.exs b/config/runtime.exsindex dbd15e877d..01337b8318 100644--- a/config/runtime.exs+++ b/config/runtime.exs@@ -140,11 +140,6 @@ is_selfhost =|> get_var_from_path_or_env("SELFHOST", "true")|> String.to_existing_atom()-show_cities =- config_dir- |> get_var_from_path_or_env("SHOW_CITIES", "false")- |> String.to_existing_atom()-custom_script_name =config_dir|> get_var_from_path_or_env("CUSTOM_SCRIPT_NAME", "script")@@ -185,7 +180,6 @@ config :plausible,site_limit: site_limit,site_limit_exempt: site_limit_exempt,is_selfhost: is_selfhost,- show_cities: show_cities,custom_script_name: custom_script_name,domain_blacklist: domain_blacklistdiff --git a/lib/plausible_web/templates/stats/stats.html.eex b/lib/plausible_web/templates/stats/stats.html.eexindex 25c7d3548a..58c4e108b7 100644--- a/lib/plausible_web/templates/stats/stats.html.eex+++ b/lib/plausible_web/templates/stats/stats.html.eex@@ -5,7 +5,7 @@</div><% end %><div class="pt-6"></div>- <div id="stats-react-container" style="overflow-anchor: none;" data-domain="<%= @site.domain %>" data-offset="<%= Timex.Timezone.total_offset(Timex.Timezone.get(@site.timezone)) %>" data-has-goals="<%= @has_goals %>" data-logged-in="<%= [email protected][:current_user] %>" data-inserted-at="<%= @site.inserted_at %>" data-shared-link-auth="<%= assigns[:shared_link_auth] %>" data-embedded="<%= @conn.assigns[:embedded] %>" data-background="<%= @conn.assigns[:background] %>" data-selfhosted="<%= Application.get_env(:plausible, :is_selfhost) %>" data-cities="<%= Application.get_env(:plausible, :show_cities) %>" data-current-user-role="<%= @conn.assigns[:current_user_role] %>"></div>+ <div id="stats-react-container" style="overflow-anchor: none;" data-domain="<%= @site.domain %>" data-offset="<%= Timex.Timezone.total_offset(Timex.Timezone.get(@site.timezone)) %>" data-has-goals="<%= @has_goals %>" data-logged-in="<%= [email protected][:current_user] %>" data-inserted-at="<%= @site.inserted_at %>" data-shared-link-auth="<%= assigns[:shared_link_auth] %>" data-embedded="<%= @conn.assigns[:embedded] %>" data-background="<%= @conn.assigns[:background] %>" data-selfhosted="<%= Application.get_env(:plausible, :is_selfhost) %>" data-current-user-role="<%= @conn.assigns[:current_user_role] %>"></div><div id="modal_root"></div><%= if [email protected][:current_user] && @conn.assigns[:demo] do %><div class="bg-gray-50 dark:bg-gray-850">