diff --git a/lib/filters/filter_keys.json b/lib/filters/filter_keys.json index 6c284d1b5..5b2b63c69 100644 --- a/lib/filters/filter_keys.json +++ b/lib/filters/filter_keys.json @@ -79,54 +79,47 @@ } }, "contacts": { - "assignee_id": { - "attribute_name": "Assignee Name", + "name": { + "attribute_name": "Name", "input_type": "search_box with name tags/plain text", "data_type": "text", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "is_present", "is_not_present" ], + "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain" ], "attribute_type": "standard" }, - "contact_id": { - "attribute_name": "Contact Name", - "input_type": "plain_text", + "phone_number": { + "attribute_name": "Phone Number", + "input_type": "search_box with name tags/plain text", "data_type": "text", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "is_present", "is_not_present" ], + "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain" ], "attribute_type": "standard" }, - "inbox_id": { - "attribute_name": "Inbox Name", - "input_type": "search_box", + "email": { + "attribute_name": "Email", + "input_type": "search_box with name tags/plain text", "data_type": "text", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "is_present", "is_not_present" ], + "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain" ], "attribute_type": "standard" }, - "team_id": { - "attribute_name": "Team Name", - "input_type": "search_box", - "data_type": "number", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "is_present", "is_not_present" ], + "contact_identifier": { + "attribute_name": "Contact Identifier", + "input_type": "search_box with name tags/plain text", + "data_type": "text", + "filter_operators": [ "equal_to", "not_equal_to" ], "attribute_type": "standard" }, - "id": { - "attribute_name": "Conversation Identifier", + "country_code": { + "attribute_name": "Country", "input_type": "textbox", - "data_type": "Number", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "is_present", "is_not_present" ], - "attribute_type": "standard" - }, - "campaign_id": { - "attribute_name": "Campaign Name", - "input_type": "textbox", - "data_type": "Number", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "is_present", "is_not_present" ], - "attribute_type": "standard" - }, - "labels": { - "attribute_name": "Labels", - "input_type": "tags", "data_type": "text", - "filter_operators": ["exactly_equal_to", "contains", "does_not_contain" ], - "attribute_type": "standard" + "filter_operators": [ "equal_to", "not_equal_to" ], + "attribute_type": "additional_attributes" + }, + "city": { + "attribute_name": "City", + "input_type": "textbox", + "data_type": "text", + "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain" ], + "attribute_type": "additional_attributes" }, "browser_language": { "attribute_name": "Browser Language", @@ -135,19 +128,12 @@ "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain" ], "attribute_type": "additional_attributes" }, - "country_code": { - "attribute_name": "Country Name", - "input_type": "textbox", + "labels": { + "attribute_name": "Labels", + "input_type": "tags", "data_type": "text", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "present", "is_not_present" ], - "attribute_type": "additional_attributes" - }, - "referer": { - "attribute_name": "Referer link", - "input_type": "textbox", - "data_type": "link", - "filter_operators": [ "equal_to", "not_equal_to", "contains", "does_not_contain", "present", "is_not_present" ], - "attribute_type": "additional_attributes" + "filter_operators": ["exactly_equal_to", "contains", "does_not_contain" ], + "attribute_type": "standard" } } } diff --git a/spec/services/contacts/filter_service_spec.rb b/spec/services/contacts/filter_service_spec.rb index 0ba1d1f7e..8275d0d52 100644 --- a/spec/services/contacts/filter_service_spec.rb +++ b/spec/services/contacts/filter_service_spec.rb @@ -26,6 +26,12 @@ describe ::Contacts::FilterService do attribute_key: 'browser_language', filter_operator: 'equal_to', values: ['en'], + query_operator: 'AND' + }.with_indifferent_access, + { + attribute_key: 'name', + filter_operator: 'equal_to', + values: [contact.name], query_operator: nil }.with_indifferent_access ] @@ -37,7 +43,7 @@ describe ::Contacts::FilterService do expect(result.length).to be 2 end - it 'filter conversations by tags' do + it 'filter contact by tags' do Contact.last.update_labels('support') params[:payload] = [ {