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.

show source but exclude option

Steven Teye18316887338
diff --git a/apps/web/ui/partners/rewards/rewards-logic.tsx b/apps/web/ui/partners/rewards/rewards-logic.tsx
index c3b31ca4fc..5ce0598972 100644
--- a/apps/web/ui/partners/rewards/rewards-logic.tsx
+++ b/apps/web/ui/partners/rewards/rewards-logic.tsx
@@ -556,19 +556,10 @@ function ConditionLogic({
},
)
}
- items={entity.attributes
- .filter(
- (attribute) =>
- attribute.id !== "source" ||
- (program &&
- SUBMITTED_LEADS_ENABLED_PROGRAM_IDS.includes(
- program.id,
- )),
- )
- .map((attribute) => ({
- text: attribute.label,
- value: attribute.id,
- }))}
+ items={entity.attributes.map((attribute) => ({
+ text: attribute.label,
+ value: attribute.id,
+ }))}
/>
</InlineBadgePopover>{" "}
{isMetadataCondition && (
@@ -772,10 +763,25 @@ function ConditionLogic({
condition.value,
isArrayValue,
)}
- items={attribute.options.map(({ id, label }) => ({
- text: label,
- value: id,
- }))}
+ items={attribute.options
+ .filter(({ id }) => {
+ if (
+ isCustomerSourceCondition &&
+ id === "submitted"
+ ) {
+ return (
+ program &&
+ SUBMITTED_LEADS_ENABLED_PROGRAM_IDS.includes(
+ program.id,
+ )
+ );
+ }
+ return true;
+ })
+ .map(({ id, label }) => ({
+ text: label,
+ value: id,
+ }))}
onSelect={(value) => {
setValue(conditionKey, {
...condition,