feat(automations): multi-option form-field conditions (all / any / none / exact)

This commit is contained in:
2026-10-11 17:26:17 +03:30
parent f4398cdb3e
commit b43ed68e82
6 changed files with 93 additions and 16 deletions
@@ -112,7 +112,7 @@ function conditionDefaults(field: AutomationConditionField): Partial<AutomationS
return { conditionOp: 'eq', conditionValue: 'normal', conditionKey: null };
}
if (field === 'form_field') {
return { conditionOp: 'contains', conditionValue: '', conditionKey: null };
return { conditionOp: 'contains', conditionValue: '', conditionValues: [], conditionKey: null };
}
return { conditionOp: 'is_set', conditionValue: undefined, conditionKey: null };
}
@@ -197,6 +197,7 @@ function hydrate(row?: AutomationRuleDto | null) {
dueOffsetMinutes: s.dueOffsetMinutes ?? null,
activityTypeDefId: s.activityTypeDefId ?? null,
conditionKey: s.conditionKey ?? null,
conditionValues: s.conditionValues ?? [],
}));
if (!steps.value.length) steps.value = [makeStep('create_activity')];
selected.value = 'trigger';