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.

Group move rule bug fix

Marcus Farrell2931fdc2b66b
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/settings/group-move-rules.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/settings/group-move-rules.tsx
index 027523f593..53ac0d9778 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/settings/group-move-rules.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/groups/[groupSlug]/settings/group-move-rules.tsx
@@ -112,8 +112,13 @@ export function GroupMoveRules() {
[metricRuleIndexes],
);
+ const hasIncompleteMetricRule = metricRuleIndexes.some(
+ ({ rule }) => !rule.attribute,
+ );
+
const canAddMetricRule =
- usedMetricAttributes.length < GROUP_MOVE_METRIC_ATTRIBUTE_KEYS.length;
+ !hasIncompleteMetricRule &&
+ metricRuleIndexes.length < GROUP_MOVE_METRIC_ATTRIBUTE_KEYS.length;
// Source group is only an additional condition after a complete metric rule
const canAddPartnerGroupCondition =
@@ -220,7 +225,9 @@ export function GroupMoveRules() {
disabled={!canAddMetricRule && ruleFields.length > 0}
disabledTooltip={
!canAddMetricRule && ruleFields.length > 0
- ? "All rules are in use. Delete existing rules."
+ ? hasIncompleteMetricRule
+ ? "Select an activity before adding another rule"
+ : "All available rules have been added"
: undefined
}
/>