-
-
Save shricodev/5f52c2ae2274a734d0eed68fccfffc15 to your computer and use it in GitHub Desktop.
Chatwoot - Kombai
This file contains hidden or 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
| From 5f3e3ce27d9c83e1ab412eef609ebbdea09a07d1 Mon Sep 17 00:00:00 2001 | |
| From: Shrijal Acharya <shrijal.acharya@gmail.com> | |
| Date: Sat, 21 Mar 2026 14:07:23 +0545 | |
| Subject: [PATCH] kombai | |
| --- | |
| .env.example | 6 +++--- | |
| app/finders/conversation_finder.rb | 5 ++++- | |
| .../dashboard/components-next/sidebar/Sidebar.vue | 6 ++++++ | |
| app/javascript/dashboard/components/ChatList.vue | 3 +++ | |
| app/javascript/dashboard/helper/URLHelper.js | 1 + | |
| .../modules/conversations/helpers/actionHelpers.js | 8 ++++++++ | |
| docker-compose.yaml | 10 +++++----- | |
| 7 files changed, 30 insertions(+), 9 deletions(-) | |
| diff --git a/.env.example b/.env.example | |
| index bc7380a29..e68a430c0 100644 | |
| --- a/.env.example | |
| +++ b/.env.example | |
| @@ -42,7 +42,7 @@ REDIS_URL=redis://redis:6379 | |
| # If you are using docker-compose, set this variable's value to be any string, | |
| # which will be the password for the redis service running inside the docker-compose | |
| # to make it secure | |
| -REDIS_PASSWORD= | |
| +REDIS_PASSWORD=redispass | |
| # Redis Sentinel can be used by passing list of sentinel host and ports e,g. sentinel_host1:port1,sentinel_host2:port2 | |
| REDIS_SENTINELS= | |
| # Redis sentinel master name is required when using sentinel, default value is "mymaster". | |
| @@ -65,7 +65,7 @@ REDIS_SENTINEL_MASTER_NAME= | |
| # POSTGRES_DATABASE= | |
| POSTGRES_HOST=postgres | |
| POSTGRES_USERNAME=postgres | |
| -POSTGRES_PASSWORD= | |
| +POSTGRES_PASSWORD=chatwootpass | |
| RAILS_ENV=development | |
| # Changes the Postgres query timeout limit. The default is 14 seconds. Modify only when required. | |
| # POSTGRES_STATEMENT_TIMEOUT=14s | |
| @@ -80,7 +80,7 @@ SMTP_DOMAIN=chatwoot.com | |
| # Set the value to "mailhog" if using docker-compose for development environments, | |
| # Set the value as "localhost" or your SMTP address in other environments | |
| # If SMTP_ADDRESS is empty, Chatwoot would try to use sendmail(postfix) | |
| -SMTP_ADDRESS= | |
| +SMTP_ADDRESS=mailhog | |
| SMTP_PORT=1025 | |
| SMTP_USERNAME= | |
| SMTP_PASSWORD= | |
| diff --git a/app/finders/conversation_finder.rb b/app/finders/conversation_finder.rb | |
| index fa437327d..19bce9cca 100644 | |
| --- a/app/finders/conversation_finder.rb | |
| +++ b/app/finders/conversation_finder.rb | |
| @@ -141,7 +141,10 @@ class ConversationFinder | |
| conversation_ids = current_account.mentions.where(user: current_user).pluck(:conversation_id) | |
| @conversations = @conversations.where(id: conversation_ids) | |
| when 'participating' | |
| - @conversations = current_user.participating_conversations.where(account_id: current_account.id) | |
| + @conversations = @conversations | |
| + .joins(:messages) | |
| + .where(messages: { sender_type: 'User', sender_id: current_user.id, message_type: Message.message_types[:outgoing] }) | |
| + .distinct | |
| when 'unattended' | |
| @conversations = @conversations.unattended | |
| end | |
| diff --git a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue | |
| index d08147739..9fd25c481 100644 | |
| --- a/app/javascript/dashboard/components-next/sidebar/Sidebar.vue | |
| +++ b/app/javascript/dashboard/components-next/sidebar/Sidebar.vue | |
| @@ -250,6 +250,12 @@ const menuItems = computed(() => { | |
| activeOn: ['conversation_through_mentions'], | |
| to: accountScopedRoute('conversation_mentions'), | |
| }, | |
| + { | |
| + name: 'Participating', | |
| + label: t('SIDEBAR.PARTICIPATING_CONVERSATIONS'), | |
| + activeOn: ['conversation_through_participating'], | |
| + to: accountScopedRoute('conversation_participating'), | |
| + }, | |
| { | |
| name: 'Unattended', | |
| activeOn: ['conversation_through_unattended'], | |
| diff --git a/app/javascript/dashboard/components/ChatList.vue b/app/javascript/dashboard/components/ChatList.vue | |
| index eeb2ad6e7..e17babd13 100644 | |
| --- a/app/javascript/dashboard/components/ChatList.vue | |
| +++ b/app/javascript/dashboard/components/ChatList.vue | |
| @@ -57,6 +57,7 @@ import { conversationListPageURL } from '../helper/URLHelper'; | |
| import { | |
| isOnMentionsView, | |
| isOnUnattendedView, | |
| + isOnParticipatingView, | |
| } from '../store/modules/conversations/helpers/actionHelpers'; | |
| import { | |
| getUserPermissions, | |
| @@ -638,6 +639,8 @@ function redirectToConversationList() { | |
| let conversationType = ''; | |
| if (isOnMentionsView({ route: { name } })) { | |
| conversationType = 'mention'; | |
| + } else if (isOnParticipatingView({ route: { name } })) { | |
| + conversationType = 'participating'; | |
| } else if (isOnUnattendedView({ route: { name } })) { | |
| conversationType = 'unattended'; | |
| } | |
| diff --git a/app/javascript/dashboard/helper/URLHelper.js b/app/javascript/dashboard/helper/URLHelper.js | |
| index a4b3f32b4..76a5d8bd4 100644 | |
| --- a/app/javascript/dashboard/helper/URLHelper.js | |
| +++ b/app/javascript/dashboard/helper/URLHelper.js | |
| @@ -51,6 +51,7 @@ export const conversationListPageURL = ({ | |
| } else if (conversationType) { | |
| const urlMap = { | |
| mention: 'mentions/conversations', | |
| + participating: 'participating/conversations', | |
| unattended: 'unattended/conversations', | |
| }; | |
| url = `accounts/${accountId}/${urlMap[conversationType]}`; | |
| diff --git a/app/javascript/dashboard/store/modules/conversations/helpers/actionHelpers.js b/app/javascript/dashboard/store/modules/conversations/helpers/actionHelpers.js | |
| index f1c594b26..8c5575c3a 100644 | |
| --- a/app/javascript/dashboard/store/modules/conversations/helpers/actionHelpers.js | |
| +++ b/app/javascript/dashboard/store/modules/conversations/helpers/actionHelpers.js | |
| @@ -30,6 +30,14 @@ export const isOnUnattendedView = ({ route: { name: routeName } }) => { | |
| return UNATTENDED_ROUTES.includes(routeName); | |
| }; | |
| +export const isOnParticipatingView = ({ route: { name: routeName } }) => { | |
| + const PARTICIPATING_ROUTES = [ | |
| + 'conversation_participating', | |
| + 'conversation_through_participating', | |
| + ]; | |
| + return PARTICIPATING_ROUTES.includes(routeName); | |
| +}; | |
| + | |
| export const isOnFoldersView = ({ route: { name: routeName } }) => { | |
| const FOLDER_ROUTES = [ | |
| 'folder_conversations', | |
| diff --git a/docker-compose.yaml b/docker-compose.yaml | |
| index facac830f..9ea7ff85c 100644 | |
| --- a/docker-compose.yaml | |
| +++ b/docker-compose.yaml | |
| @@ -41,7 +41,7 @@ services: | |
| - NODE_ENV=development | |
| - RAILS_ENV=development | |
| entrypoint: docker/entrypoints/rails.sh | |
| - command: ["bundle", "exec", "rails", "s", "-p", "3000", "-b", "0.0.0.0"] | |
| + command: ['bundle', 'exec', 'rails', 's', '-p', '3000', '-b', '0.0.0.0'] | |
| sidekiq: | |
| <<: *base | |
| @@ -59,7 +59,7 @@ services: | |
| environment: | |
| - NODE_ENV=development | |
| - RAILS_ENV=development | |
| - command: ["bundle", "exec", "sidekiq", "-C", "config/sidekiq.yml"] | |
| + command: ['bundle', 'exec', 'sidekiq', '-C', 'config/sidekiq.yml'] | |
| vite: | |
| <<: *base | |
| @@ -74,7 +74,7 @@ services: | |
| - cache:/app/tmp/cache | |
| - bundle:/usr/local/bundle | |
| ports: | |
| - - "3036:3036" # Vite dev server | |
| + - '3036:3036' # Vite dev server | |
| environment: | |
| - VITE_DEV_SERVER_HOST=0.0.0.0 | |
| - NODE_ENV=development | |
| @@ -92,12 +92,12 @@ services: | |
| environment: | |
| - POSTGRES_DB=chatwoot | |
| - POSTGRES_USER=postgres | |
| - - POSTGRES_PASSWORD= | |
| + - POSTGRES_PASSWORD=chatwootpass | |
| redis: | |
| image: redis:alpine | |
| restart: always | |
| - command: ["sh", "-c", "redis-server --requirepass \"$REDIS_PASSWORD\""] | |
| + command: ['sh', '-c', 'redis-server --requirepass "$REDIS_PASSWORD"'] | |
| env_file: .env | |
| volumes: | |
| - redis:/data/redis | |
| -- | |
| 2.53.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment