sort_by_created_at_desc.diff
: sort bycreated_at_asc
instead oflast_activity_at_desc
. See https://github.com/orgs/chatwoot/discussions/10668search_in_email_subjects.diff
: make the search engine work with email subjects
Last active
January 15, 2025 16:15
-
-
Save bfontaine/f40029f0a2eec9dd28b354d84b5f424e to your computer and use it in GitHub Desktop.
Patch files for Chatwoot -- https://github.com/orgs/chatwoot/discussions/10668
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git app/services/search_service.rb app/services/search_service.rb | |
index add7938a0..f2b87591a 100644 | |
--- app/services/search_service.rb | |
+++ app/services/search_service.rb | |
@@ -27,8 +27,13 @@ class SearchService | |
def filter_conversations | |
@conversations = current_account.conversations.where(inbox_id: accessable_inbox_ids) | |
.joins('INNER JOIN contacts ON conversations.contact_id = contacts.id') | |
- .where("cast(conversations.display_id as text) ILIKE :search OR contacts.name ILIKE :search OR contacts.email | |
- ILIKE :search OR contacts.phone_number ILIKE :search OR contacts.identifier ILIKE :search", search: "%#{search_query}%") | |
+ .where("cast(conversations.display_id as text) ILIKE :search | |
+ OR contacts.name ILIKE :search | |
+ OR contacts.email ILIKE :search | |
+ OR contacts.phone_number ILIKE :search | |
+ OR contacts.identifier ILIKE :search | |
+ OR conversations.additional_attributes->>'mail_subject' ILIKE :search", | |
+ search: "%#{search_query}%") | |
.order('conversations.created_at DESC') | |
.limit(10) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git app/javascript/dashboard/components/ChatList.vue app/javascript/dashboard/components/ChatList.vue | |
index 0438d24af..0548f24d3 100644 | |
--- app/javascript/dashboard/components/ChatList.vue | |
+++ app/javascript/dashboard/components/ChatList.vue | |
@@ -87,7 +87,7 @@ const conversationDynamicScroller = ref(null); | |
const activeAssigneeTab = ref(wootConstants.ASSIGNEE_TYPE.ME); | |
const activeStatus = ref(wootConstants.STATUS_TYPE.OPEN); | |
-const activeSortBy = ref(wootConstants.SORT_BY_TYPE.LAST_ACTIVITY_AT_DESC); | |
+const activeSortBy = ref(wootConstants.SORT_BY_TYPE.CREATED_AT_ASC); | |
const showAdvancedFilters = ref(false); | |
// chatsOnView is to store the chats that are currently visible on the screen, | |
// which mirrors the conversationList. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment