Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

fix bounce checkbox for share page

Francis Cao8f15741b68ed
diff --git a/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsx b/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsx
index 49721f1e5..6aaa585d9 100644
--- a/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsx
+++ b/src/app/(main)/websites/[websiteId]/settings/WebsiteShareForm.tsx
@@ -1,4 +1,5 @@
import { Column, Heading, Row, Text } from '@umami/react-zen';
+import { LoadingPanel } from 'dist';
import { Plus } from 'lucide-react';
import { useMessages, useWebsiteSharesQuery } from '@/components/hooks';
import { DialogButton } from '@/components/input/DialogButton';
@@ -11,33 +12,36 @@ export interface WebsiteShareFormProps {
export function WebsiteShareForm({ websiteId }: WebsiteShareFormProps) {
const { formatMessage, labels, messages } = useMessages();
- const { data } = useWebsiteSharesQuery({ websiteId });
+ const { data, error, isLoading } = useWebsiteSharesQuery({ websiteId });
const shares = data?.data || [];
const hasShares = shares.length > 0;
return (
- <Column gap="4">
- <Row justifyContent="space-between" alignItems="center">
- <Heading>{formatMessage(labels.share)}</Heading>
- <DialogButton
- icon={<Plus size={16} />}
- label={formatMessage(labels.add)}
- title={formatMessage(labels.share)}
- variant="primary"
- width="600px"
- >
- {({ close }) => <ShareEditForm websiteId={websiteId} onClose={close} />}
- </DialogButton>
- </Row>
- {hasShares ? (
- <>
- <Text>{formatMessage(messages.shareUrl)}</Text>
- <SharesTable data={shares} />
- </>
- ) : (
- <Text color="muted">{formatMessage(messages.noDataAvailable)}</Text>
- )}
- </Column>
+ <LoadingPanel data={data} isLoading={isLoading} error={error}>
+ <Column gap="4">
+ <Row justifyContent="space-between" alignItems="center">
+ <Heading>{formatMessage(labels.share)}</Heading>
+ <DialogButton
+ icon={<Plus size={16} />}
+ label={formatMessage(labels.add)}
+ title={formatMessage(labels.share)}
+ variant="primary"
+ width="600px"
+ >
+ {({ close }) => <ShareEditForm websiteId={websiteId} onClose={close} />}
+ </DialogButton>
+ </Row>
+ {hasShares ? (
+ <>
+ <Text>{formatMessage(messages.shareUrl)}</Text>
+
+ <SharesTable data={shares} />
+ </>
+ ) : (
+ <Text color="muted">{formatMessage(messages.noDataAvailable)}</Text>
+ )}
+ </Column>
+ </LoadingPanel>
);
}
diff --git a/src/components/input/WebsiteFilterButton.tsx b/src/components/input/WebsiteFilterButton.tsx
index 8e4a940fc..d00c27865 100644
--- a/src/components/input/WebsiteFilterButton.tsx
+++ b/src/components/input/WebsiteFilterButton.tsx
@@ -16,7 +16,8 @@ export function WebsiteFilterButton({
const { formatMessage, labels } = useMessages();
const { updateParams, pathname, router, query } = useNavigation();
const [excludeBounce, setExcludeBounce] = useState(!!query.excludeBounce);
- const isOverview = /^\/teams\/[^/]+\/websites\/[^/]+$/.test(pathname);
+ const isOverview =
+ /^\/teams\/[^/]+\/websites\/[^/]+$/.test(pathname) || /^\/share\/[^/]+$/.test(pathname);
const handleChange = ({ filters, segment, cohort }: any) => {
const params = filtersArrayToObject(filters);