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.

final changes, reuse E2E_PARTNER

Steven Teyf8ca9b123277
diff --git a/apps/web/tests/utils/resource.ts b/apps/web/tests/utils/resource.ts
index 2492f65373..72c670dbad 100644
--- a/apps/web/tests/utils/resource.ts
+++ b/apps/web/tests/utils/resource.ts
@@ -257,7 +257,3 @@ export const E2E_FRAUD_PARTNER = {
export const E2E_FRAUD_REFERRAL_SOURCE_BANNED_DOMAIN =
"test-hostname-for-referral-source-banned-do-not-delete.com";
-
-export const E2E_GROUP_MOVE_DISABLED_PARTNER = {
- id: "pn_1K2J9DRWPPJ2F1RX53N92TSGG", // TODO: Update this
-} as const;
diff --git a/apps/web/tests/workflows/move-group-workflow.test.ts b/apps/web/tests/workflows/move-group-workflow.test.ts
index e6b8451091..1a49ed0001 100644
--- a/apps/web/tests/workflows/move-group-workflow.test.ts
+++ b/apps/web/tests/workflows/move-group-workflow.test.ts
@@ -2,7 +2,7 @@ import { EnrolledPartnerProps } from "@/lib/types";
import { RESOURCE_COLORS } from "@/ui/colors";
import { PartnerGroup } from "@dub/prisma/client";
import { randomValue } from "@dub/utils";
-import { E2E_GROUP_MOVE_DISABLED_PARTNER } from "tests/utils/resource";
+import { E2E_PARTNER } from "tests/utils/resource";
import { describe, expect, onTestFinished, test } from "vitest";
import { randomEmail } from "../utils/helpers";
import { IntegrationHarness } from "../utils/integration";
@@ -493,10 +493,10 @@ describe.sequential("Workflow - MoveGroup", async () => {
test("Workflow skips partner with groupMoveDisabledAt set", async () => {
const slug = "e2e-target-skip-partner-move";
- // Get the current group of E2E_GROUP_MOVE_DISABLED_PARTNER
+ // Get the current group of E2E_PARTNER
const { data: partner, status: partnerStatus } =
await http.get<EnrolledPartnerProps>({
- path: `/partners/${E2E_GROUP_MOVE_DISABLED_PARTNER.id}`,
+ path: `/partners/${E2E_PARTNER.id}`,
});
expect(partnerStatus).toEqual(200);
@@ -530,8 +530,8 @@ describe.sequential("Workflow - MoveGroup", async () => {
moveRules: [
{
attribute: "totalLeads",
- operator: "between",
- value: { min: 1, max: 2 },
+ operator: "gte",
+ value: 1000,
},
],
},
diff --git a/apps/web/ui/modals/change-group-modal.tsx b/apps/web/ui/modals/change-group-modal.tsx
index eca10308b7..08c1871e44 100644
--- a/apps/web/ui/modals/change-group-modal.tsx
+++ b/apps/web/ui/modals/change-group-modal.tsx
@@ -2,8 +2,8 @@ import { mutatePrefix } from "@/lib/swr/mutate";
import { useApiMutation } from "@/lib/swr/use-api-mutation";
import useWorkspace from "@/lib/swr/use-workspace";
import { EnrolledPartnerProps } from "@/lib/types";
-import { Button, Modal, Switch } from "@dub/ui";
-import { cn, OG_AVATAR_URL, pluralize } from "@dub/utils";
+import { Button, InfoTooltip, Modal, Switch } from "@dub/ui";
+import { cn, OG_AVATAR_URL } from "@dub/utils";
import {
Dispatch,
SetStateAction,
@@ -143,30 +143,23 @@ function ChangeGroupModal({
</div>
</div>
- <div className="flex items-start gap-4">
- <Switch
- fn={setGroupMoveDisabled}
- checked={groupMoveDisabled}
- disabled={!isSinglePartner}
- disabledTooltip={
- !isSinglePartner
- ? "Not available for bulk group changes"
- : undefined
- }
- trackDimensions="w-8 h-4"
- thumbDimensions="w-3 h-3"
- thumbTranslate="translate-x-4"
- />
- <h3
- className={cn(
- "text-sm font-medium leading-none",
- isSinglePartner ? "text-neutral-700" : "text-neutral-400",
- )}
- >
- Disable future group move rules for{" "}
- {pluralize("partner", partners.length)}
- </h3>
- </div>
+ {isSinglePartner && (
+ <div className="flex items-center gap-3">
+ <Switch
+ fn={setGroupMoveDisabled}
+ checked={groupMoveDisabled}
+ trackDimensions="w-8 h-4"
+ thumbDimensions="w-3 h-3"
+ thumbTranslate="translate-x-4"
+ />
+ <div className="flex gap-1.5">
+ <h3 className="text-sm font-medium leading-none text-neutral-700">
+ Disable automatic group moves
+ </h3>
+ <InfoTooltip content="When disabled, this partner will not be automatically moved between groups by [group move rules](https://dub.co/help/article/partner-groups#group-move-rules)." />
+ </div>
+ </div>
+ )}
</div>
<div className="flex items-center justify-end gap-2 bg-neutral-50 px-4 pb-5 sm:px-6">
diff --git a/apps/web/ui/partners/partner-advanced-settings-modal.tsx b/apps/web/ui/partners/partner-advanced-settings-modal.tsx
index b21f08e66f..9528a568e4 100644
--- a/apps/web/ui/partners/partner-advanced-settings-modal.tsx
+++ b/apps/web/ui/partners/partner-advanced-settings-modal.tsx
@@ -18,6 +18,7 @@ import {
} from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
+import { MarkdownDescription } from "../shared/markdown-description";
type FormData = {
tenantId: string | null;
@@ -178,12 +179,13 @@ function PartnerAdvancedSettingsModal({
/>
<div className="flex flex-col gap-1.5">
<h3 className="text-sm font-medium leading-none text-neutral-700">
- Disable future group move rules for partner
+ Disable automatic group moves
</h3>
- <p className="text-xs text-neutral-500">
- Prevent this partner from being automatically moved between
- groups
- </p>
+ <MarkdownDescription className="text-xs text-neutral-500">
+ When disabled, this partner will not be automatically moved
+ between groups by [group move
+ rules](https://dub.co/help/article/partner-groups#group-move-rules).
+ </MarkdownDescription>
</div>
</div>
</div>