mirror of
https://github.com/lingble/chatwoot.git
synced 2025-10-29 18:22:53 +00:00
fix: add priority in filter keys [CW-3177] (#9179)
* fix: ConditionValidationService fails on conversation priority * fix: custom attribute clash in spec
This commit is contained in:
@@ -44,6 +44,12 @@ conversations:
|
|||||||
- "not_equal_to"
|
- "not_equal_to"
|
||||||
- "is_present"
|
- "is_present"
|
||||||
- "is_not_present"
|
- "is_not_present"
|
||||||
|
priority:
|
||||||
|
attribute_type: "standard"
|
||||||
|
data_type: "text"
|
||||||
|
filter_operators:
|
||||||
|
- "equal_to"
|
||||||
|
- "not_equal_to"
|
||||||
display_id:
|
display_id:
|
||||||
attribute_type: "standard"
|
attribute_type: "standard"
|
||||||
data_type: "Number"
|
data_type: "Number"
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ describe AutomationRuleListener do
|
|||||||
attribute_display_type: 'list',
|
attribute_display_type: 'list',
|
||||||
attribute_values: %w[regular platinum gold])
|
attribute_values: %w[regular platinum gold])
|
||||||
create(:custom_attribute_definition,
|
create(:custom_attribute_definition,
|
||||||
attribute_key: 'priority',
|
attribute_key: 'priority_level',
|
||||||
account: account,
|
account: account,
|
||||||
attribute_model: 'conversation_attribute',
|
attribute_model: 'conversation_attribute',
|
||||||
attribute_display_type: 'list',
|
attribute_display_type: 'list',
|
||||||
@@ -267,7 +267,7 @@ describe AutomationRuleListener do
|
|||||||
|
|
||||||
context 'when rule matches based on custom_attributes' do
|
context 'when rule matches based on custom_attributes' do
|
||||||
before do
|
before do
|
||||||
conversation.update!(custom_attributes: { priority: 'P2' })
|
conversation.update!(custom_attributes: { priority_level: 'P2' })
|
||||||
conversation.contact.update!(custom_attributes: { cloud_customer: false })
|
conversation.contact.update!(custom_attributes: { cloud_customer: false })
|
||||||
|
|
||||||
automation_rule.update!(
|
automation_rule.update!(
|
||||||
@@ -276,7 +276,7 @@ describe AutomationRuleListener do
|
|||||||
description: 'Add labels, assign team after conversation updated',
|
description: 'Add labels, assign team after conversation updated',
|
||||||
conditions: [
|
conditions: [
|
||||||
{
|
{
|
||||||
attribute_key: 'priority',
|
attribute_key: 'priority_level',
|
||||||
filter_operator: 'equal_to',
|
filter_operator: 'equal_to',
|
||||||
values: ['P2'],
|
values: ['P2'],
|
||||||
custom_attribute_type: 'conversation_attribute',
|
custom_attribute_type: 'conversation_attribute',
|
||||||
|
|||||||
Reference in New Issue
Block a user