mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 17:15:37 +01:00
Pass start and end dates to filter component. Closes #2646.
This commit is contained in:
parent
09a75ec720
commit
6973b2b760
3 changed files with 10 additions and 3 deletions
|
|
@ -2,7 +2,7 @@ import classNames from 'classnames';
|
|||
import { Button, Icon, Icons, Popup, PopupTrigger, Text } from 'react-basics';
|
||||
import PopupForm from 'app/(main)/reports/[reportId]/PopupForm';
|
||||
import FilterSelectForm from 'app/(main)/reports/[reportId]/FilterSelectForm';
|
||||
import { useFields, useMessages, useNavigation } from 'components/hooks';
|
||||
import { useFields, useMessages, useNavigation, useDateRange } from 'components/hooks';
|
||||
import { OPERATOR_PREFIXES } from 'lib/constants';
|
||||
import styles from './WebsiteFilterButton.module.css';
|
||||
|
||||
|
|
@ -16,6 +16,7 @@ export function WebsiteFilterButton({
|
|||
const { formatMessage, labels } = useMessages();
|
||||
const { renderUrl, router } = useNavigation();
|
||||
const { fields } = useFields();
|
||||
const [{ startDate, endDate }] = useDateRange(websiteId);
|
||||
|
||||
const handleAddFilter = ({ name, operator, value }) => {
|
||||
const prefix = OPERATOR_PREFIXES[operator];
|
||||
|
|
@ -38,6 +39,8 @@ export function WebsiteFilterButton({
|
|||
<FilterSelectForm
|
||||
websiteId={websiteId}
|
||||
fields={fields}
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
onChange={value => {
|
||||
handleAddFilter(value);
|
||||
close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue