mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
Filter domain from referrers.
This commit is contained in:
parent
00e232fee8
commit
0a411a9ad6
@ -77,7 +77,7 @@ export default function WebsiteDetails({ websiteId, defaultDateRange = '7day' })
|
||||
websiteId={websiteId}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
dataFilter={refFilter}
|
||||
dataFilter={refFilter(data.domain)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,7 +47,7 @@ export default function UserButton() {
|
||||
return (
|
||||
<div ref={ref} className={styles.container}>
|
||||
<div onClick={() => setShowMenu(state => !state)}>
|
||||
<Icon icon={<User />} size="L" className={styles.icon} />
|
||||
<Icon icon={<User />} size="L" />
|
||||
<Icon icon={<Chevron />} size="S" />
|
||||
</div>
|
||||
{showMenu && <Menu options={menuOptions} onSelect={handleSelect} align="right" />}
|
||||
|
@ -4,10 +4,6 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.icon {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.username {
|
||||
border-bottom: 1px solid var(--gray500);
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
import escape from 'escape-string-regexp';
|
||||
import { BROWSERS, ISO_COUNTRIES, DEVICES } from './constants';
|
||||
|
||||
export const browserFilter = data =>
|
||||
@ -5,8 +6,12 @@ export const browserFilter = data =>
|
||||
|
||||
export const urlFilter = data => data.filter(({ x }) => x !== '' && !x.startsWith('#'));
|
||||
|
||||
export const refFilter = data =>
|
||||
data.filter(({ x }) => x !== '' && !x.startsWith('/') && !x.startsWith('#'));
|
||||
export const refFilter = domain => data => {
|
||||
const regex = new RegExp(escape(domain));
|
||||
return data.filter(
|
||||
({ x }) => x !== '' && !x.startsWith('/') && !x.startsWith('#') && !regex.test(x),
|
||||
);
|
||||
};
|
||||
|
||||
export const deviceFilter = data =>
|
||||
data.map(({ x, ...props }) => ({ x: DEVICES[x] || x, ...props }));
|
||||
|
@ -50,6 +50,7 @@
|
||||
"date-fns-tz": "^1.0.10",
|
||||
"detect-browser": "^5.1.1",
|
||||
"dotenv": "^8.2.0",
|
||||
"escape-string-regexp": "^4.0.0",
|
||||
"formik": "^2.1.5",
|
||||
"geolite2-redist": "^1.0.7",
|
||||
"is-localhost-ip": "^1.4.0",
|
||||
|
@ -3605,6 +3605,11 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
|
||||
escape-string-regexp@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
|
||||
integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==
|
||||
|
||||
eslint-config-prettier@^6.11.0:
|
||||
version "6.11.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz#f6d2238c1290d01c859a8b5c1f7d352a0b0da8b1"
|
||||
|
Loading…
Reference in New Issue
Block a user