mirror of
https://github.com/kremalicious/umami.git
synced 2024-06-30 13:41:50 +02:00
Merge branch 'dev' into feat/um-285-report-schema
This commit is contained in:
commit
53a5312c22
|
@ -52,6 +52,8 @@ export function BarChart({
|
||||||
return dateFormat(d, 'MMM d', locale);
|
return dateFormat(d, 'MMM d', locale);
|
||||||
case 'month':
|
case 'month':
|
||||||
return dateFormat(d, 'MMM', locale);
|
return dateFormat(d, 'MMM', locale);
|
||||||
|
case 'year':
|
||||||
|
return dateFormat(d, 'YYY', locale);
|
||||||
default:
|
default:
|
||||||
return label;
|
return label;
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,16 +73,27 @@ export function MetricsTable({
|
||||||
|
|
||||||
const filteredData = useMemo(() => {
|
const filteredData = useMemo(() => {
|
||||||
if (data) {
|
if (data) {
|
||||||
const dataWithoutNullValues = data.filter(val => val.x !== null);
|
let items;
|
||||||
let items = percentFilter(
|
|
||||||
dataFilter ? dataFilter(dataWithoutNullValues, filterOptions) : dataWithoutNullValues,
|
if (dataFilter) {
|
||||||
);
|
if (Array.isArray(dataFilter)) {
|
||||||
|
items = dataFilter.reduce((arr, filter) => {
|
||||||
|
return filter(arr);
|
||||||
|
}, data);
|
||||||
|
} else {
|
||||||
|
items = dataFilter(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
items = percentFilter(items);
|
||||||
|
|
||||||
if (limit) {
|
if (limit) {
|
||||||
items = items.filter((e, i) => i < limit);
|
items = items.filter((e, i) => i < limit);
|
||||||
}
|
}
|
||||||
if (filterOptions?.sort === false) {
|
if (filterOptions?.sort === false) {
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
return items.sort(firstBy('y', -1).thenBy('x'));
|
return items.sort(firstBy('y', -1).thenBy('x'));
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
|
|
|
@ -9,7 +9,7 @@ import styles from './QueryParametersTable.module.css';
|
||||||
|
|
||||||
const filters = {
|
const filters = {
|
||||||
[FILTER_RAW]: emptyFilter,
|
[FILTER_RAW]: emptyFilter,
|
||||||
[FILTER_COMBINED]: paramFilter,
|
[FILTER_COMBINED]: [emptyFilter, paramFilter],
|
||||||
};
|
};
|
||||||
|
|
||||||
export function QueryParametersTable({ websiteId, showFilters, ...props }) {
|
export function QueryParametersTable({ websiteId, showFilters, ...props }) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user