The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
rename
Kiran Ka1c072b2804b
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty-sheet.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty-sheet.tsxindex 7d0ba3d214..f4619f2641 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty-sheet.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/bounties/add-edit-bounty-sheet.tsx@@ -8,7 +8,7 @@ import {} from "@/lib/types";import { createBountySchema } from "@/lib/zod/schemas/bounties";import {- WORKFLOW_CONDITION_ATTRIBUTES_LABELS,+ WORKFLOW_ATTRIBUTE_LABELS,workflowConditionSchema,} from "@/lib/zod/schemas/workflows";import { BountyLogic } from "@/ui/partners/bounties/bounty-logic";@@ -213,7 +213,7 @@ function BountySheetContent({ setIsOpen, bounty }: BountySheetProps) {data.name =`Earn ${currencyFormatter(data.rewardAmount / 100)} after generating ` +`${isCurrency ? `${currencyFormatter(condition.value / 100)} in` : condition.value} ` +- WORKFLOW_CONDITION_ATTRIBUTES_LABELS[condition.attribute];+ WORKFLOW_ATTRIBUTE_LABELS[condition.attribute];} else if (type === "submission") {data.performanceCondition = null;}diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.tsindex 7ff7a742f6..8ebeb03446 100644--- a/apps/web/lib/types.ts+++ b/apps/web/lib/types.ts@@ -98,7 +98,7 @@ import {} from "./zod/schemas/webhooks";import {WORKFLOW_COMPARISON_OPERATORS,- WORKFLOW_CONDITION_ATTRIBUTES,+ WORKFLOW_ATTRIBUTES,workflowActionSchema,workflowConditionSchema,} from "./zod/schemas/workflows";@@ -543,7 +543,7 @@ export type BountyStats = z.infer<typeof bountyStatsSchema>;export type WorkflowCondition = z.infer<typeof workflowConditionSchema>;export type WorkflowConditionAttribute =- (typeof WORKFLOW_CONDITION_ATTRIBUTES)[number];+ (typeof WORKFLOW_ATTRIBUTES)[number];export type WorkflowComparisonOperator =(typeof WORKFLOW_COMPARISON_OPERATORS)[number];diff --git a/apps/web/lib/zod/schemas/workflows.ts b/apps/web/lib/zod/schemas/workflows.tsindex d4ec74f7db..5ed02d7b05 100644--- a/apps/web/lib/zod/schemas/workflows.ts+++ b/apps/web/lib/zod/schemas/workflows.ts@@ -6,14 +6,14 @@ import {import { WorkflowTrigger } from "@dub/prisma/client";import { z } from "zod";-export const WORKFLOW_CONDITION_ATTRIBUTES = [+export const WORKFLOW_ATTRIBUTES = ["totalLeads","totalConversions","totalSaleAmount","totalCommission",] as const;-export const WORKFLOW_CONDITION_ATTRIBUTES_LABELS: Record<+export const WORKFLOW_ATTRIBUTE_LABELS: Record<WorkflowConditionAttribute,string> = {@@ -60,7 +60,7 @@ export const WORKFLOW_LOGICAL_OPERATORS = ["AND"] as const;// Individual conditionexport const workflowConditionSchema = z.object({- attribute: z.enum(WORKFLOW_CONDITION_ATTRIBUTES),+ attribute: z.enum(WORKFLOW_ATTRIBUTES),operator: z.enum(WORKFLOW_COMPARISON_OPERATORS),value: z.number(),});diff --git a/apps/web/ui/partners/bounties/bounty-logic.tsx b/apps/web/ui/partners/bounties/bounty-logic.tsxindex 71950fbac5..30c8db95cf 100644--- a/apps/web/ui/partners/bounties/bounty-logic.tsx+++ b/apps/web/ui/partners/bounties/bounty-logic.tsx@@ -1,8 +1,8 @@import { isCurrencyAttribute } from "@/lib/api/workflows/utils";import { handleMoneyInputChange, handleMoneyKeyDown } from "@/lib/form-utils";import {- WORKFLOW_CONDITION_ATTRIBUTES,- WORKFLOW_CONDITION_ATTRIBUTES_LABELS,+ WORKFLOW_ATTRIBUTES,+ WORKFLOW_ATTRIBUTE_LABELS,} from "@/lib/zod/schemas/workflows";import {InlineBadgePopover,@@ -42,7 +42,7 @@ export function BountyLogic({ className }: { className?: string }) {<InlineBadgePopovertext={field.value- ? WORKFLOW_CONDITION_ATTRIBUTES_LABELS[field.value]+ ? WORKFLOW_ATTRIBUTE_LABELS[field.value]: "activity"}invalid={!field.value}@@ -50,8 +50,8 @@ export function BountyLogic({ className }: { className?: string }) {<InlineBadgePopoverMenuselectedValue={field.value}onSelect={field.onChange}- items={WORKFLOW_CONDITION_ATTRIBUTES.map((attribute) => ({- text: WORKFLOW_CONDITION_ATTRIBUTES_LABELS[attribute],+ items={WORKFLOW_ATTRIBUTES.map((attribute) => ({+ text: WORKFLOW_ATTRIBUTE_LABELS[attribute],value: attribute,}))}/>