From 9f73aba90073f748b4a5dc0e621ab17da9caaa8e Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 13 Dec 2023 00:02:54 -0800 Subject: [PATCH 1/2] Added external links for pages. --- src/app/(main)/websites/[id]/WebsiteDetails.tsx | 4 ++-- .../(main)/websites/[id]/WebsiteExpandedView.tsx | 6 +++--- src/app/(main)/websites/[id]/WebsiteTableView.tsx | 9 ++++++++- src/components/metrics/MetricsTable.tsx | 1 + src/components/metrics/PagesTable.tsx | 14 +++++++++++--- 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/app/(main)/websites/[id]/WebsiteDetails.tsx b/src/app/(main)/websites/[id]/WebsiteDetails.tsx index 7d8d2d999..b234ea0a1 100644 --- a/src/app/(main)/websites/[id]/WebsiteDetails.tsx +++ b/src/app/(main)/websites/[id]/WebsiteDetails.tsx @@ -33,8 +33,8 @@ export default function WebsiteDetails({ websiteId }: { websiteId: string }) { {!website && } {website && ( <> - {!view && } - {view && } + {!view && } + {view && } )} diff --git a/src/app/(main)/websites/[id]/WebsiteExpandedView.tsx b/src/app/(main)/websites/[id]/WebsiteExpandedView.tsx index 9fb1b3f6f..f01d93633 100644 --- a/src/app/(main)/websites/[id]/WebsiteExpandedView.tsx +++ b/src/app/(main)/websites/[id]/WebsiteExpandedView.tsx @@ -35,10 +35,10 @@ const views = { export default function WebsiteExpandedView({ websiteId, - websiteDomain, + domainName, }: { websiteId: string; - websiteDomain?: string; + domainName?: string; }) { const { formatMessage, labels } = useMessages(); const { @@ -143,7 +143,7 @@ export default function WebsiteExpandedView({
any; diff --git a/src/components/metrics/PagesTable.tsx b/src/components/metrics/PagesTable.tsx index 11379a2e8..042af9c06 100644 --- a/src/components/metrics/PagesTable.tsx +++ b/src/components/metrics/PagesTable.tsx @@ -9,7 +9,7 @@ export interface PagesTableProps extends MetricsTableProps { allowFilter?: boolean; } -export function PagesTable({ allowFilter, ...props }: PagesTableProps) { +export function PagesTable({ allowFilter, domainName, ...props }: PagesTableProps) { const { router, makeUrl, @@ -17,7 +17,7 @@ export function PagesTable({ allowFilter, ...props }: PagesTableProps) { } = useNavigation(); const { formatMessage, labels } = useMessages(); - const handleSelect = key => { + const handleSelect = (key: any) => { router.push(makeUrl({ view: key }), { scroll: true }); }; @@ -33,12 +33,20 @@ export function PagesTable({ allowFilter, ...props }: PagesTableProps) { ]; const renderLink = ({ x }) => { - return ; + return ( + + ); }; return ( Date: Wed, 13 Dec 2023 00:59:19 -0800 Subject: [PATCH 2/2] Fixed clear all filters button. --- src/components/metrics/FilterTags.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/metrics/FilterTags.tsx b/src/components/metrics/FilterTags.tsx index 140385f5c..1b168a283 100644 --- a/src/components/metrics/FilterTags.tsx +++ b/src/components/metrics/FilterTags.tsx @@ -19,11 +19,11 @@ export function FilterTags({ params }) { } function handleCloseFilter(param?: string) { - if (!param) { - router.push(makeUrl({ view }, true)); - } else { - router.push(makeUrl({ [param]: undefined })); - } + router.push(makeUrl({ [param]: undefined })); + } + + function handleResetFilter() { + router.push(makeUrl({ view }, true)); } return ( @@ -44,7 +44,7 @@ export function FilterTags({ params }) {
); })} -