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.

Remove webhook flags

Steven Tey6db4a572e1ba
diff --git a/apps/web/app/api/webhooks/[webhookId]/events/route.ts b/apps/web/app/api/webhooks/[webhookId]/events/route.ts
index 488a10d574..7c7c289c1f 100644
--- a/apps/web/app/api/webhooks/[webhookId]/events/route.ts
+++ b/apps/web/app/api/webhooks/[webhookId]/events/route.ts
@@ -28,7 +28,6 @@ export const GET = withWorkspace(
},
{
requiredPermissions: ["webhooks.read"],
- featureFlag: "webhooks",
requiredPlan: [
"business",
"business plus",
diff --git a/apps/web/app/api/webhooks/[webhookId]/route.ts b/apps/web/app/api/webhooks/[webhookId]/route.ts
index 1595969352..bb8dcd76fb 100644
--- a/apps/web/app/api/webhooks/[webhookId]/route.ts
+++ b/apps/web/app/api/webhooks/[webhookId]/route.ts
@@ -37,7 +37,6 @@ export const GET = withWorkspace(
},
{
requiredPermissions: ["webhooks.read"],
- featureFlag: "webhooks",
requiredPlan: [
"business",
"business plus",
@@ -226,7 +225,6 @@ export const PATCH = withWorkspace(
},
{
requiredPermissions: ["webhooks.write"],
- featureFlag: "webhooks",
requiredPlan: [
"business",
"business plus",
@@ -306,7 +304,6 @@ export const DELETE = withWorkspace(
},
{
requiredPermissions: ["webhooks.write"],
- featureFlag: "webhooks",
requiredPlan: [
"business",
"business plus",
diff --git a/apps/web/app/api/webhooks/route.ts b/apps/web/app/api/webhooks/route.ts
index 6d74283fa6..d3e365e26f 100644
--- a/apps/web/app/api/webhooks/route.ts
+++ b/apps/web/app/api/webhooks/route.ts
@@ -52,7 +52,6 @@ export const GET = withWorkspace(
},
{
requiredPermissions: ["webhooks.read"],
- featureFlag: "webhooks",
requiredPlan: [
"business",
"business plus",
@@ -176,7 +175,6 @@ export const POST = withWorkspace(
},
{
requiredPermissions: ["webhooks.write"],
- featureFlag: "webhooks",
requiredPlan: [
"business",
"business plus",
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/edit/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/edit/page-client.tsx
index 2e1bc084b5..6c528a7589 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/edit/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/edit/page-client.tsx
@@ -5,7 +5,7 @@ import { WebhookProps } from "@/lib/types";
import AddEditWebhookForm from "@/ui/webhooks/add-edit-webhook-form";
import { MaxWidthWrapper } from "@dub/ui";
import { fetcher } from "@dub/utils";
-import { notFound, redirect } from "next/navigation";
+import { notFound } from "next/navigation";
import useSWR from "swr";
export default function UpdateWebhookPageClient({
@@ -13,11 +13,7 @@ export default function UpdateWebhookPageClient({
}: {
webhookId: string;
}) {
- const { slug, flags, id: workspaceId } = useWorkspace();
-
- if (!flags?.webhooks) {
- redirect(`/${slug}/settings`);
- }
+ const { id: workspaceId } = useWorkspace();
const { data: webhook, isLoading } = useSWR<WebhookProps>(
`/api/webhooks/${webhookId}?workspaceId=${workspaceId}`,
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/page-client.tsx
index d8317c7bd5..36d17a42eb 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/[webhookId]/page-client.tsx
@@ -16,14 +16,14 @@ export default function WebhookLogsPageClient({
}: {
webhookId: string;
}) {
- const { slug, flags, role, id: workspaceId } = useWorkspace();
+ const { slug, role, id: workspaceId } = useWorkspace();
const { error: permissionsError } = clientAccessCheck({
action: "webhooks.read",
role,
});
- if (!flags?.webhooks || permissionsError) {
+ if (permissionsError) {
redirect(`/${slug}/settings`);
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/new/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/new/page-client.tsx
index b736354af2..12906d5d50 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/new/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/new/page-client.tsx
@@ -12,15 +12,11 @@ export default function NewWebhookPageClient({
}: {
newSecret: string;
}) {
- const { slug, flags, plan, conversionEnabled } = useWorkspace();
+ const { slug, plan, conversionEnabled } = useWorkspace();
const needsHigherPlan =
(plan === "free" || plan === "pro") && !conversionEnabled;
- if (!flags?.webhooks) {
- redirect(`/${slug}/settings`);
- }
-
if (needsHigherPlan) {
redirect(`/${slug}/settings/webhooks`);
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/page-client.tsx
index 219e0c249f..bbc12bd42b 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/webhooks/page-client.tsx
@@ -8,15 +8,11 @@ import WebhookCard from "@/ui/webhooks/webhook-card";
import WebhookPlaceholder from "@/ui/webhooks/webhook-placeholder";
import { Button, InfoTooltip, TooltipContent } from "@dub/ui";
import { Webhook } from "lucide-react";
-import { redirect, useRouter } from "next/navigation";
+import { useRouter } from "next/navigation";
export default function WebhooksPageClient() {
const router = useRouter();
- const { slug, plan, role, conversionEnabled, flags } = useWorkspace();
-
- if (!flags?.webhooks) {
- redirect(`/${slug}/settings`);
- }
+ const { slug, plan, role, conversionEnabled } = useWorkspace();
const { webhooks, isLoading } = useWebhooks();
diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/domain-selector.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/domain-selector.tsx
index 48ddbf9264..e3fbf706c3 100644
--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/domain-selector.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/domain-selector.tsx
@@ -12,7 +12,7 @@ import { LaterButton } from "../../later-button";
import { useOnboardingProgress } from "../../use-onboarding-progress";
export function DomainSelector() {
- const { loading: isWorkspaceLoading, flags } = useWorkspace();
+ const { loading: isWorkspaceLoading } = useWorkspace();
const { continueTo, isLoading, isSuccessful } = useOnboardingProgress();
const [selectedOption, setSelectedOption] = useState<"custom" | "register">(
diff --git a/apps/web/lib/edge-config/get-feature-flags.ts b/apps/web/lib/edge-config/get-feature-flags.ts
index d9470ebf0d..07c5e74816 100644
--- a/apps/web/lib/edge-config/get-feature-flags.ts
+++ b/apps/web/lib/edge-config/get-feature-flags.ts
@@ -17,7 +17,6 @@ export const getFeatureFlags = async ({
}
const workspaceFeatures: Record<BetaFeatures, boolean> = {
- webhooks: false,
noDubLink: false,
};
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index 9d39776afa..0bff380804 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -115,7 +115,7 @@ export type PlanProps = (typeof plans)[number];
export type RoleProps = (typeof roles)[number];
-export type BetaFeatures = "webhooks" | "noDubLink";
+export type BetaFeatures = "noDubLink";
export type AddOns = "conversion" | "sso";
diff --git a/apps/web/ui/modals/link-builder/index.tsx b/apps/web/ui/modals/link-builder/index.tsx
index 3e3b5ae0a5..79c6921306 100644
--- a/apps/web/ui/modals/link-builder/index.tsx
+++ b/apps/web/ui/modals/link-builder/index.tsx
@@ -490,7 +490,7 @@ function LinkBuilderInner({
<TargetingButton />
<PasswordButton />
</div>
- {flags?.webhooks && <WebhookSelect />}
+ <WebhookSelect />
<MoreDropdown />
</div>
{homepageDemo ? (
diff --git a/apps/web/ui/webhooks/add-edit-webhook-form.tsx b/apps/web/ui/webhooks/add-edit-webhook-form.tsx
index 260f2bad75..2d0922ddbe 100644
--- a/apps/web/ui/webhooks/add-edit-webhook-form.tsx
+++ b/apps/web/ui/webhooks/add-edit-webhook-form.tsx
@@ -10,7 +10,7 @@ import {
} from "@/lib/webhook/constants";
import { Button, Checkbox, CopyButton, InfoTooltip } from "@dub/ui";
import { cn } from "@dub/utils";
-import { redirect, useRouter } from "next/navigation";
+import { useRouter } from "next/navigation";
import { FormEvent, useMemo, useState } from "react";
import { toast } from "sonner";
import { mutate } from "swr";
@@ -33,11 +33,7 @@ export default function AddEditWebhookForm({
}) {
const router = useRouter();
const [saving, setSaving] = useState(false);
- const { slug: workspaceSlug, id: workspaceId, flags, role } = useWorkspace();
-
- if (!flags?.webhooks) {
- redirect(`/${workspaceSlug}`);
- }
+ const { slug: workspaceSlug, id: workspaceId, role } = useWorkspace();
const [data, setData] = useState<NewWebhook | WebhookProps>(
webhook || {