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);
|
||||
case 'month':
|
||||
return dateFormat(d, 'MMM', locale);
|
||||
case 'year':
|
||||
return dateFormat(d, 'YYY', locale);
|
||||
default:
|
||||
return label;
|
||||
}
|
||||
|
|
|
@ -73,16 +73,27 @@ export function MetricsTable({
|
|||
|
||||
const filteredData = useMemo(() => {
|
||||
if (data) {
|
||||
const dataWithoutNullValues = data.filter(val => val.x !== null);
|
||||
let items = percentFilter(
|
||||
dataFilter ? dataFilter(dataWithoutNullValues, filterOptions) : dataWithoutNullValues,
|
||||
);
|
||||
let items;
|
||||
|
||||
if (dataFilter) {
|
||||
if (Array.isArray(dataFilter)) {
|
||||
items = dataFilter.reduce((arr, filter) => {
|
||||
return filter(arr);
|
||||
}, data);
|
||||
} else {
|
||||
items = dataFilter(data);
|
||||
}
|
||||
}
|
||||
|
||||
items = percentFilter(items);
|
||||
|
||||
if (limit) {
|
||||
items = items.filter((e, i) => i < limit);
|
||||
}
|
||||
if (filterOptions?.sort === false) {
|
||||
return items;
|
||||
}
|
||||
|
||||
return items.sort(firstBy('y', -1).thenBy('x'));
|
||||
}
|
||||
return [];
|
||||
|
|
|
@ -9,7 +9,7 @@ import styles from './QueryParametersTable.module.css';
|
|||
|
||||
const filters = {
|
||||
[FILTER_RAW]: emptyFilter,
|
||||
[FILTER_COMBINED]: paramFilter,
|
||||
[FILTER_COMBINED]: [emptyFilter, paramFilter],
|
||||
};
|
||||
|
||||
export function QueryParametersTable({ websiteId, showFilters, ...props }) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user