From dcf31502c27722223157085f37dac965c33c3fc0 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Mon, 13 Dec 2021 14:45:19 +0200 Subject: [PATCH] Show regions when filtering by country etc --- assets/js/dashboard/stats/locations/index.js | 20 ++++++++++++++++---- assets/js/dashboard/stats/reports/list.js | 3 ++- mix.lock | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/assets/js/dashboard/stats/locations/index.js b/assets/js/dashboard/stats/locations/index.js index 2327d9507..d8a277ee6 100644 --- a/assets/js/dashboard/stats/locations/index.js +++ b/assets/js/dashboard/stats/locations/index.js @@ -7,7 +7,7 @@ import * as api from '../../api' import {apiPath, sitePath} from '../../util/url' import ListReport from '../reports/list' -function Countries({query, site}) { +function Countries({query, site, onClick}) { function fetchData() { return api.get(apiPath(site, '/countries'), query, {limit: 9}).then((res) => { return res.map(row => Object.assign({}, row, {percentage: undefined})) @@ -22,6 +22,7 @@ function Countries({query, site}) { case "regions": - return + return case "countries": - return + return case "map": default: return diff --git a/assets/js/dashboard/stats/reports/list.js b/assets/js/dashboard/stats/reports/list.js index 63de8c737..b52194fd1 100644 --- a/assets/js/dashboard/stats/reports/list.js +++ b/assets/js/dashboard/stats/reports/list.js @@ -81,6 +81,7 @@ export default class ListReport extends React.Component { const maxWidthDeduction = this.showConversionRate() ? "10rem" : "5rem" const lightBackground = this.props.color || 'bg-green-50' + const noop = () => {} return (
@@ -92,7 +93,7 @@ export default class ListReport extends React.Component { plot={this.valueKey()} > - + {this.props.renderIcon && this.props.renderIcon(listItem)} {this.props.renderIcon && ' '} {listItem.name} diff --git a/mix.lock b/mix.lock index 9251ccf20..9ce499c13 100644 --- a/mix.lock +++ b/mix.lock @@ -54,7 +54,7 @@ "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"}, "jumper": {:hex, :jumper, "1.0.1", "3c00542ef1a83532b72269fab9f0f0c82bf23a35e27d278bfd9ed0865cecabff", [:mix], [], "hexpm", "318c59078ac220e966d27af3646026db9b5a5e6703cb2aa3e26bcfaba65b7433"}, "kaffy": {:hex, :kaffy, "0.9.0", "bef34c9729f6a3af4d0dea8eede8bcb9e11371a83ac9a8b393991bce81839517", [:mix], [{:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:phoenix, "~> 1.4", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 2.11", [hex: :phoenix_html, repo: "hexpm", optional: false]}], "hexpm", "d18ff57b8e68feb433aed11e71510cd357abc7034e75358af5deff7d0d4c6ed3"}, - "location": {:git, "https://github.com/plausible/location.git", "898e918d7094605b781a140001a746164691967c", []}, + "location": {:git, "https://github.com/plausible/location.git", "fe8b43d9dc52fb2bbc2dc79319b6888adada8d4c", []}, "metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"}, "mime": {:hex, :mime, "1.6.0", "dabde576a497cef4bbdd60aceee8160e02a6c89250d6c0b29e56c0dfb00db3d2", [:mix], [], "hexpm", "31a1a8613f8321143dde1dafc36006a17d28d02bdfecb9e95a880fa7aabd19a7"}, "mimerl": {:hex, :mimerl, "1.2.0", "67e2d3f571088d5cfd3e550c383094b47159f3eee8ffa08e64106cdf5e981be3", [:rebar3], [], "hexpm", "f278585650aa581986264638ebf698f8bb19df297f66ad91b18910dfc6e19323"},