Open CrimsonSunrise opened 1 month ago
The changes in ChatList.vue
focus on modifying the logic for displaying and filtering conversations based on user roles and permissions. A new condition, hideAllChatsForAgents
, determines whether agents can view conversations, resulting in an empty list if true. The computed properties assigneeTabItems
, conversationList
, and conversationFilters
have been updated to reflect this logic. Additionally, the mounted
lifecycle hook and the resetAndFetchData
method have been adjusted to ensure the UI accurately represents the current filter state.
File Path | Change Summary |
---|---|
app/javascript/dashboard/components/ChatList.vue | Updated assigneeTabItems , conversationList , and conversationFilters computed properties to include hideAllChatsForAgents logic. Modified mounted lifecycle hook to set chat list filters and adjusted resetAndFetchData method for new filtering logic. |
In the land of chats so bright,
A new rule brings a clearer sight.
Agents now see, or not at all,
Conversations fade, like shadows tall.
With filters set and roles defined,
A smoother chat list, perfectly aligned! 🐰✨
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?
nice one, test are okay? i have a question why not "this.currentRole !== 'administrator' ? 0"
nice one, test are okay? i have a question why not "this.currentRole !== 'administrator' ? 0"
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) 24cpu 32g ram 400 NVME Localhost
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