Skip to content

Commit

Permalink
updating typo on settings labels and conflicts resolution with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cabaceira committed Oct 27, 2023
1 parent a0965f2 commit f8c1960
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import CloseChatModalData from '../../../../../../components/Omnichannel/modals/
import ForwardChatModal from '../../../../../../components/Omnichannel/modals/ForwardChatModal';
import ReturnChatQueueModal from '../../../../../../components/Omnichannel/modals/ReturnChatQueueModal';
import TranscriptModal from '../../../../../../components/Omnichannel/modals/TranscriptModal';
import { useIsRoomOverMacLimit } from '../../../../../../hooks/omnichannel/useIsRoomOverMacLimit';
import { useOmnichannelRouteConfig } from '../../../../../../hooks/omnichannel/useOmnichannelRouteConfig';
import { quickActionHooks } from '../../../../../../ui';
import { useOmnichannelRoom } from '../../../../contexts/RoomContext';
Expand Down Expand Up @@ -296,9 +297,13 @@ export const useQuickActions = (): {
});

const omnichannelRouteConfig = useOmnichannelRouteConfig();

const manualOnHoldAllowed = useSetting('Livechat_allow_manual_on_hold');

const hasManagerRole = useRole('livechat-manager');
const roomOpen = room?.open && (room.u?._id === uid || hasManagerRole) && room?.lastMessage?.t !== 'livechat-close';
const hasMonitorRole = useRole('livechat-monitor');

const roomOpen = room?.open && (room.u?._id === uid || hasManagerRole || hasMonitorRole) && room?.lastMessage?.t !== 'livechat-close';
const canMoveQueue = !!omnichannelRouteConfig?.returnQueue && room?.u !== undefined;
const canForwardGuest = usePermission('transfer-livechat-guest');
const canSendTranscriptEmail = usePermission('send-omnichannel-chat-transcript');
Expand All @@ -311,18 +316,20 @@ export const useQuickActions = (): {
const canAgentPlaceOnHold = !room.lastMessage?.token;
const canPlaceChatOnHold = Boolean(manualOnHoldAllowed && canRoomBePlacedOnHold && (!restrictedOnHold || canAgentPlaceOnHold));

const isRoomOverMacLimit = useIsRoomOverMacLimit(room);

const hasPermissionButtons = (id: string): boolean => {
switch (id) {
case QuickActionsEnum.MoveQueue:
return !!roomOpen && canMoveQueue;
return !isRoomOverMacLimit && !!roomOpen && canMoveQueue;
case QuickActionsEnum.ChatForward:
return !!roomOpen && canForwardGuest;
return !isRoomOverMacLimit && !!roomOpen && canForwardGuest;
case QuickActionsEnum.Transcript:
return canSendTranscriptEmail || (hasLicense && canSendTranscriptPDF);
return !isRoomOverMacLimit && (canSendTranscriptEmail || (hasLicense && canSendTranscriptPDF));
case QuickActionsEnum.TranscriptEmail:
return canSendTranscriptEmail;
return !isRoomOverMacLimit && canSendTranscriptEmail;
case QuickActionsEnum.TranscriptPDF:
return hasLicense && canSendTranscriptPDF;
return hasLicense && !isRoomOverMacLimit && canSendTranscriptPDF;
case QuickActionsEnum.CloseChat:
return !!roomOpen && (canCloseRoom || canCloseOthersRoom);
case QuickActionsEnum.OnHoldChat:
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -3077,7 +3077,7 @@
"Livechat_allow_manual_on_hold": "Allow agents to manually place chat On Hold",
"Livechat_allow_manual_on_hold_Description": "If enabled, the agent will get the option to place a chat On Hold",
"Livechat_allow_manual_on_hold_upon_agent_engagement_only": "Allow agents to manually place chat On Hold, provided the agent has sent the last message",
"Livechat_allow_manual_on_hold_upon_agent_engagement_only_Description": "If enabled, the agent will get a new option to place a chat On Hold, provided the agent has sent the last message, otherwise Agents are able to place chats onHold irrespective",
"Livechat_allow_manual_on_hold_upon_agent_engagement_only_Description": "If enabled, the agent will get a new option to place a chat On Hold, provided the agent has sent the last message, otherwise agents are able to place chats on Hold irrespective",
"Livechat_AllowedDomainsList": "Livechat Allowed Domains",
"Livechat_Appearance": "Livechat Appearance",
"Livechat_auto_close_on_hold_chats_custom_message": "Custom message for closed chats in On Hold queue",
Expand Down

0 comments on commit f8c1960

Please sign in to comment.