Pr/1609 extended (#1634)

* Change `Country` to `Location` in the Add filter dropdown

This filter allows to select region and city too

* Rename country filter group to Location

Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com>
pull/1646/head
Uku Taht 5 years ago committed by GitHub
parent d1fe1f7e41
commit e70fa293f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,7 +13,7 @@ import {apiPath, siteBasePath} from '../../util/url'
export const FILTER_GROUPS = {
'page': ['page'],
'source': ['source', 'referrer'],
'country': ['country', 'region', 'city'],
'location': ['country', 'region', 'city'],
'screen': ['screen'],
'browser': ['browser', 'browser_version'],
'os': ['os', 'os_version'],
@ -56,9 +56,11 @@ function withIndefiniteArticle(word) {
export function formatFilterGroup(filterGroup) {
if (filterGroup === 'utm') {
return 'UTM tags'
}
} else if (filterGroup === 'location') {
return 'Location'
} else {
return formattedFilters[filterGroup]
}
}
export function filterGroupForFilter(filter) {
@ -122,7 +124,7 @@ class FilterModal extends React.Component {
}
onSelect(filterName) {
if (this.state.selectedFilterGroup !== 'country') {
if (this.state.selectedFilterGroup !== 'location') {
return () => {}
}
@ -134,7 +136,7 @@ class FilterModal extends React.Component {
}
onInput(filterName) {
if (this.state.selectedFilterGroup === 'country') {
if (this.state.selectedFilterGroup === 'location') {
return () => {}
}

Loading…
Cancel
Save