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
@@ -10,6 +10,7 @@ import {
AUTOMATION_NOTIFY_CHANNEL_LABELS,
AUTOMATION_TRIGGER_LABELS,
MAX_AUTOMATION_STEPS,
formConditionValues,
isAutomationCondition,
splitAutomationBranches,
type AutomationAction,
@@ -174,7 +175,8 @@ function stepHint(step: AutomationStep) {
const opLabel = AUTOMATION_CONDITION_OP_LABELS[op];
if (step.conditionField === 'form_field') {
if (op === 'is_set' || op === 'is_empty') return opLabel;
return `${opLabel} «${step.conditionValue ?? ''}»`;
const joiner = op === 'contains_any' || op === 'not_contains' ? ' یا ' : ' و ';
return `${opLabel} ${formConditionValues(step).map((v) => `«${v}»`).join(joiner) || '«»'}`;
}
if (step.conditionField === 'deal_amount' && step.conditionValue != null) {
return `${opLabel} ${toFaDigits(Number(step.conditionValue))}`;