mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 15:47:13 +01:00
Domain validation. Filter domain from referrers.
This commit is contained in:
parent
a9765c7ea7
commit
5a4cde854a
13 changed files with 51 additions and 23 deletions
|
|
@ -65,9 +65,9 @@ export default function WebsiteDetails({ websiteId, defaultDateRange = '7day' })
|
|||
|
||||
const tableProps = {
|
||||
...dataProps,
|
||||
websiteDomain: data?.domain,
|
||||
limit: 10,
|
||||
onExpand: handleExpand,
|
||||
websiteDomain: data?.domain,
|
||||
};
|
||||
|
||||
const DetailsComponent = expand?.component;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@ import FormLayout, {
|
|||
FormMessage,
|
||||
FormRow,
|
||||
} from 'components/layout/FormLayout';
|
||||
import Checkbox from '../common/Checkbox';
|
||||
import Checkbox from 'components/common/Checkbox';
|
||||
import { DOMAIN_REGEX } from 'lib/constants';
|
||||
|
||||
const initialValues = {
|
||||
name: '',
|
||||
|
|
@ -24,6 +25,8 @@ const validate = ({ name, domain }) => {
|
|||
}
|
||||
if (!domain) {
|
||||
errors.domain = 'Required';
|
||||
} else if (!DOMAIN_REGEX.test(domain)) {
|
||||
errors.domain = 'Invalid domain';
|
||||
}
|
||||
|
||||
return errors;
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export default function MetricsTable({
|
|||
title,
|
||||
metric,
|
||||
websiteId,
|
||||
websiteDomain,
|
||||
startDate,
|
||||
endDate,
|
||||
type,
|
||||
|
|
@ -47,6 +48,7 @@ export default function MetricsTable({
|
|||
type,
|
||||
start_at: +startDate,
|
||||
end_at: +endDate,
|
||||
domain: websiteDomain,
|
||||
});
|
||||
|
||||
setData(data);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ export default function Referrers({
|
|||
metric="Views"
|
||||
headerComponent={limit ? null : <FilterButtons selected={filter} onClick={setFilter} />}
|
||||
websiteId={websiteId}
|
||||
websiteDomain={websiteDomain}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
limit={limit}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue