mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Merge branch 'dev' of https://github.com/umami-software/umami into dev
This commit is contained in:
commit
03eeb6a022
27 changed files with 430 additions and 300 deletions
|
|
@ -1,5 +1,5 @@
|
|||
.bar {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
color: var(--base600);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export function useFilterQuery<T = any>({
|
|||
queryKey,
|
||||
queryFn,
|
||||
...options
|
||||
}: UseQueryOptions): FilterQueryResult<T> {
|
||||
}: Omit<UseQueryOptions, 'queryFn'> & { queryFn: (params?: object) => any }): FilterQueryResult<T> {
|
||||
const [params, setParams] = useState<T | SearchFilter>({
|
||||
query: '',
|
||||
page: 1,
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ export function useFilters() {
|
|||
};
|
||||
|
||||
const typeFilters = {
|
||||
string: [OPERATORS.equals, OPERATORS.notEquals],
|
||||
string: [OPERATORS.equals, OPERATORS.notEquals, OPERATORS.contains, OPERATORS.doesNotContain],
|
||||
array: [OPERATORS.contains, OPERATORS.doesNotContain],
|
||||
boolean: [OPERATORS.true, OPERATORS.false],
|
||||
number: [
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { useMemo } from 'react';
|
||||
import { usePathname, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { buildUrl } from 'next-basics';
|
||||
import { buildUrl, safeDecodeURIComponent } from 'next-basics';
|
||||
|
||||
export function useNavigation(): {
|
||||
pathname: string;
|
||||
|
|
@ -16,7 +16,7 @@ export function useNavigation(): {
|
|||
const obj = {};
|
||||
|
||||
for (const [key, value] of params.entries()) {
|
||||
obj[key] = decodeURIComponent(value);
|
||||
obj[key] = safeDecodeURIComponent(value);
|
||||
}
|
||||
|
||||
return obj;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,15 @@ export function DateFilter({
|
|||
label: formatMessage(labels.lastDays, { x: 90 }),
|
||||
value: '90day',
|
||||
},
|
||||
{ label: formatMessage(labels.thisYear), value: '0year' },
|
||||
{ label: formatMessage(labels.thisYear), value: '0year', divider: true },
|
||||
{
|
||||
label: formatMessage(labels.lastMonths, { x: 6 }),
|
||||
value: '6month',
|
||||
},
|
||||
{
|
||||
label: formatMessage(labels.lastMonths, { x: 12 }),
|
||||
value: '12month',
|
||||
},
|
||||
showAllTime && {
|
||||
label: formatMessage(labels.allTime),
|
||||
value: 'all',
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ export const labels = defineMessages({
|
|||
yesterday: { id: 'label.yesterday', defaultMessage: 'Yesterday' },
|
||||
thisWeek: { id: 'label.this-week', defaultMessage: 'This week' },
|
||||
lastDays: { id: 'label.last-days', defaultMessage: 'Last {x} days' },
|
||||
lastMonths: { id: 'label.last-months', defaultMessage: 'Last {x} months' },
|
||||
thisMonth: { id: 'label.this-month', defaultMessage: 'This month' },
|
||||
thisYear: { id: 'label.this-year', defaultMessage: 'This year' },
|
||||
allTime: { id: 'label.all-time', defaultMessage: 'All time' },
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { StatusLight } from 'react-basics';
|
||||
import { safeDecodeURIComponent } from 'next-basics';
|
||||
import { colord } from 'colord';
|
||||
import classNames from 'classnames';
|
||||
import { LegendItem } from 'chart.js/auto';
|
||||
|
|
@ -31,7 +32,7 @@ export function Legend({
|
|||
onClick={() => onClick(item)}
|
||||
>
|
||||
<StatusLight color={color.alpha(color.alpha() + 0.2).toHex()}>
|
||||
<span className={locale}>{text}</span>
|
||||
<span className={locale}>{safeDecodeURIComponent(text)}</span>
|
||||
</StatusLight>
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue