Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

small fixes, remove filter for base_urls subtab

Steven Teyc36bca1a2ebf
diff --git a/apps/web/ui/analytics/top-links.tsx b/apps/web/ui/analytics/top-links.tsx
index ea4315e27b..c06776981f 100644
--- a/apps/web/ui/analytics/top-links.tsx
+++ b/apps/web/ui/analytics/top-links.tsx
@@ -53,7 +53,7 @@ const TAB_CONFIG: Record<
},
};
-export function TopLinks({ filterLinks = true }: { filterLinks?: boolean }) {
+export function TopLinks() {
const { queryParams, searchParams } = useRouterStuff();
const { selectedTab, saleUnit, adminPage, partnerPage, dashboardProps } =
@@ -172,58 +172,56 @@ export function TopLinks({ filterLinks = true }: { filterLinks?: boolean }) {
// Determine href
let href: string | undefined;
- if (filterLinks) {
- if (isLinksSubtab) {
- const hasLinkFilter =
- searchParams.has("domain") && searchParams.has("key");
- href = queryParams({
- ...(hasLinkFilter
- ? { del: ["domain", "key"] }
- : {
- set: {
- domain: d.domain,
- key: d.key || "_root",
- },
- }),
- getNewPath: true,
- }) as string;
- } else if (isUrlsTab) {
- const hasUrlFilter = searchParams.has("url");
- href = queryParams({
- ...(hasUrlFilter
- ? { del: "url" }
- : {
- set: {
- url: d.url,
- },
- }),
- getNewPath: true,
- }) as string;
- } else if (isFoldersSubtab) {
- const hasFolderFilter = searchParams.has("folderId");
- href = queryParams({
- ...(hasFolderFilter
- ? { del: "folderId" }
- : {
- set: {
- folderId: d.folderId,
- },
- }),
- getNewPath: true,
- }) as string;
- } else if (isTagsSubtab) {
- const hasTagFilter = searchParams.has("tagIds");
- href = queryParams({
- ...(hasTagFilter
- ? { del: "tagIds" }
- : {
- set: {
- tagIds: d.tagId,
- },
- }),
- getNewPath: true,
- }) as string;
- }
+ if (isLinksSubtab) {
+ const hasLinkFilter =
+ searchParams.has("domain") && searchParams.has("key");
+ href = queryParams({
+ ...(hasLinkFilter
+ ? { del: ["domain", "key"] }
+ : {
+ set: {
+ domain: d.domain,
+ key: d.key || "_root",
+ },
+ }),
+ getNewPath: true,
+ }) as string;
+ } else if (isUrlsTab && subtab === "base_urls") {
+ const hasUrlFilter = searchParams.has("url");
+ href = queryParams({
+ ...(hasUrlFilter
+ ? { del: "url" }
+ : {
+ set: {
+ url: d.url,
+ },
+ }),
+ getNewPath: true,
+ }) as string;
+ } else if (isFoldersSubtab) {
+ const hasFolderFilter = searchParams.has("folderId");
+ href = queryParams({
+ ...(hasFolderFilter
+ ? { del: "folderId" }
+ : {
+ set: {
+ folderId: d.folderId,
+ },
+ }),
+ getNewPath: true,
+ }) as string;
+ } else if (isTagsSubtab) {
+ const hasTagFilter = searchParams.has("tagIds");
+ href = queryParams({
+ ...(hasTagFilter
+ ? { del: "tagIds" }
+ : {
+ set: {
+ tagIds: d.tagId,
+ },
+ }),
+ getNewPath: true,
+ }) as string;
}
return {
diff --git a/apps/web/ui/links/link-tests.tsx b/apps/web/ui/links/link-tests.tsx
index c111b7a6d1..2de9fa49e4 100644
--- a/apps/web/ui/links/link-tests.tsx
+++ b/apps/web/ui/links/link-tests.tsx
@@ -1,6 +1,6 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { ABTestVariantsSchema } from "@/lib/zod/schemas/links";
-import { fetcher } from "@dub/utils";
+import { fetcher, getPrettyUrl } from "@dub/utils";
import { motion } from "motion/react";
import { memo, useMemo } from "react";
import useSWR from "swr";
@@ -82,7 +82,7 @@ export const LinkTests = memo(({ link }: { link: ResponseLink }) => {
{/* Test name */}
<span className="truncate text-sm font-medium text-neutral-800">
- {test.url}
+ {getPrettyUrl(test.url)}
</span>
</div>