-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Chats shown for agents even with 'hide_all_chats_for_agent' enabled. #166
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughThe changes in Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
app/javascript/dashboard/components/ChatList.vue (1)
Line range hint
290-390
: Consider adding unit tests forhideAllChatsForAgents
logicTo ensure the new
hideAllChatsForAgents
functionality works as expected and to prevent future regressions, consider adding unit tests that verify:
- Agents see zero conversation counts when
hideAllChatsForAgents
is true.- Agents receive an empty conversation list when
hideAllChatsForAgents
is true.This will help maintain the correctness of the feature over time.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- app/javascript/dashboard/components/ChatList.vue (2 hunks)
🧰 Additional context used
🔇 Additional comments (2)
app/javascript/dashboard/components/ChatList.vue (2)
290-290
: Ensuring chat counts are zero when 'hideAllChatsForAgents' is trueThe modification at line 290 correctly sets the conversation tab counts to zero for agents when
hideAllChatsForAgents
is enabled. This ensures agents do not see any chat counts, aligning with the intended functionality.
388-390
: Returning empty conversation list when 'hideAllChatsForAgents' is trueThe addition at lines 388-390 effectively returns an empty conversation list for agents when
hideAllChatsForAgents
is enabled. This change prevents any chats from being rendered for agent users under the specified conditions, as described in the PR objectives.
nice one, test are okay? i have a question |
Hey! Because the function hideAllChatsForAgents already has a check for admin role. |
But!.. understand that the logic for "role" admin is that the admin has already been created and identifies it, a bug is formed in a clean installation (direct installation environment outside of docker) where there is a "creation of account", a small modal, where you get stuck in it, after trying to access your "super_admin" login on the "dashboard" test environment (. /setup --install) |
…nt' enabled. sendingtk#166" This reverts commit a0d0740.
The ChatList.vue component didn't had a function to verify if the current user wasn't an 'administrator' and if the current company had the flag 'hide_all_chats_for_agent' set to true to prevend rendering chats for agent users.
Two changes were made to make it work as intended:
The value of count which is responsible to show the chat counts on the tabs now displays always 0 if the user isn't 'administrator' and the current account has the flag 'hide_all_chats_for_agent' set to true.
The function that creates the chat list now returns an empty array if the user isn't 'administrator' and the current account has the flag 'hide_all_chats_for_agent' set to true.
Summary by CodeRabbit
New Features
Bug Fixes