mirror of
https://github.com/umami-software/umami.git
synced 2026-02-13 09:05:36 +01:00
only show bounce filter on overview
This commit is contained in:
parent
f232ce2643
commit
f84b9f041d
1 changed files with 10 additions and 5 deletions
|
|
@ -14,8 +14,9 @@ export function WebsiteFilterButton({
|
||||||
alignment?: 'end' | 'center' | 'start';
|
alignment?: 'end' | 'center' | 'start';
|
||||||
}) {
|
}) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { updateParams, router, query } = useNavigation();
|
const { updateParams, pathname, router, query } = useNavigation();
|
||||||
const [excludeBounce, setExcludeBounce] = useState(!!query.excludeBounce);
|
const [excludeBounce, setExcludeBounce] = useState(!!query.excludeBounce);
|
||||||
|
const isOverview = /^\/teams\/[^/]+\/websites\/[^/]+$/.test(pathname);
|
||||||
|
|
||||||
const handleChange = ({ filters, segment, cohort }: any) => {
|
const handleChange = ({ filters, segment, cohort }: any) => {
|
||||||
const params = filtersArrayToObject(filters);
|
const params = filtersArrayToObject(filters);
|
||||||
|
|
@ -35,13 +36,17 @@ export function WebsiteFilterButton({
|
||||||
{({ close }) => {
|
{({ close }) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Row position="absolute" top="30px" right="30px">
|
{isOverview && (
|
||||||
<Row alignItems="center" gap>
|
<Row position="absolute" top="30px" right="30px">
|
||||||
<Checkbox value={excludeBounce ? 'true' : ''} onChange={setExcludeBounce}>
|
<Checkbox
|
||||||
|
value={excludeBounce ? 'true' : ''}
|
||||||
|
onChange={setExcludeBounce}
|
||||||
|
style={{ marginTop: '3px' }}
|
||||||
|
>
|
||||||
{formatMessage(labels.excludeBounce)}
|
{formatMessage(labels.excludeBounce)}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
</Row>
|
</Row>
|
||||||
</Row>
|
)}
|
||||||
<FilterEditForm websiteId={websiteId} onChange={handleChange} onClose={close} />
|
<FilterEditForm websiteId={websiteId} onChange={handleChange} onClose={close} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue