File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ export const REWARD_CONDITIONS: Record<
111111 } ,
112112 {
113113 id : "submitted" ,
114- label : "qualified lead" ,
114+ label : "submitted lead" ,
115115 } ,
116116 {
117117 id : "trial" ,
Original file line number Diff line number Diff line change 22
33import { constructRewardAmount } from "@/lib/api/sales/construct-reward-amount" ;
44import { getPlanCapabilities } from "@/lib/plan-capabilities" ;
5+ import { REFERRAL_ENABLED_PROGRAM_IDS } from "@/lib/referrals/constants" ;
6+ import useProgram from "@/lib/swr/use-program" ;
57import useWorkspace from "@/lib/swr/use-workspace" ;
68import { RECURRING_MAX_DURATIONS } from "@/lib/zod/schemas/misc" ;
79import {
@@ -273,6 +275,7 @@ function ConditionLogic({
273275 conditionIndex : number ;
274276 onRemove ?: ( ) => void ;
275277} ) {
278+ const { program } = useProgram ( ) ;
276279 const modifierKey = `modifiers.${ modifierIndex } ` as const ;
277280 const conditionKey = `${ modifierKey } .conditions.${ conditionIndex } ` as const ;
278281
@@ -511,10 +514,20 @@ function ConditionLogic({
511514 ( condition . value as string [ ] | undefined ) ??
512515 ( isArrayValue ? [ ] : undefined )
513516 }
514- items = { attribute . options . map ( ( { id, label } ) => ( {
515- text : label ,
516- value : id ,
517- } ) ) }
517+ items = { attribute . options
518+ . filter (
519+ ( attribute ) =>
520+ isCustomerSourceCondition &&
521+ ( attribute . id !== "submitted" ||
522+ ( program &&
523+ REFERRAL_ENABLED_PROGRAM_IDS . includes (
524+ program . id ,
525+ ) ) ) ,
526+ )
527+ . map ( ( { id, label } ) => ( {
528+ text : label ,
529+ value : id ,
530+ } ) ) }
518531 onSelect = { ( value ) => {
519532 setValue ( conditionKey , {
520533 ...condition ,
You can’t perform that action at this time.
0 commit comments