mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
9d3f5ad0fd
6 changed files with 9 additions and 7 deletions
|
|
@ -31,9 +31,11 @@ export function WebsiteDateFilter({
|
|||
const showCompare = allowCompare && !isAllTime;
|
||||
|
||||
const websiteDateRange = useDateRangeQuery(websiteId);
|
||||
const { startDate, endDate } = websiteDateRange;
|
||||
const hasData = startDate && endDate;
|
||||
|
||||
const handleChange = (date: string) => {
|
||||
if (date === 'all') {
|
||||
if (date === 'all' && hasData) {
|
||||
router.push(
|
||||
updateParams({
|
||||
date: `${getDateRangeValue(websiteDateRange.startDate, websiteDateRange.endDate)}:all`,
|
||||
|
|
@ -78,7 +80,7 @@ export function WebsiteDateFilter({
|
|||
<DateFilter
|
||||
value={dateValue}
|
||||
onChange={handleChange}
|
||||
showAllTime={showAllTime}
|
||||
showAllTime={hasData && showAllTime}
|
||||
renderDate={+offset !== 0}
|
||||
/>
|
||||
</Row>
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ function getFilterQuery(filters: Record<string, any>, options: QueryOptions = {}
|
|||
|
||||
if (name === 'referrer') {
|
||||
arr.push(
|
||||
`and (website_event.referrer_domain != website_event.hostname or website_event.referrer_domain is null)`,
|
||||
`and (website_event.referrer_domain != regexp_replace(website_event.hostname, '^www.', '') or website_event.referrer_domain is null)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ async function relationalQuery(websiteId: string, column: string, filters: Query
|
|||
let excludeDomain = '';
|
||||
|
||||
if (column === 'referrer_domain') {
|
||||
excludeDomain = `and website_event.referrer_domain != website_event.hostname
|
||||
excludeDomain = `and website_event.referrer_domain != regexp_replace(website_event.hostname, '^www.', '')
|
||||
and website_event.referrer_domain != ''`;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ async function relationalQuery(
|
|||
let excludeDomain = '';
|
||||
|
||||
if (column === 'referrer_domain') {
|
||||
excludeDomain = `and website_event.referrer_domain != website_event.hostname
|
||||
excludeDomain = `and website_event.referrer_domain != regexp_replace(website_event.hostname, '^www.', '')
|
||||
and website_event.referrer_domain != ''`;
|
||||
if (type === 'domain') {
|
||||
column = toPostgresGroupedReferrer(GROUPED_DOMAINS);
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ async function relationalQuery(
|
|||
let excludeDomain = '';
|
||||
|
||||
if (column === 'referrer_domain') {
|
||||
excludeDomain = `and website_event.referrer_domain != website_event.hostname
|
||||
excludeDomain = `and website_event.referrer_domain != regexp_replace(website_event.hostname, '^www.', '')
|
||||
and website_event.referrer_domain != ''`;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ async function relationalQuery(
|
|||
${
|
||||
currency
|
||||
? ''
|
||||
: `and we.referrer_domain != hostname
|
||||
: `and we.referrer_domain != regexp_replace(we.hostname, '^www.', '')
|
||||
and we.referrer_domain != ''`
|
||||
}
|
||||
group by 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue