diff --git a/app/containers/message/index.tsx b/app/containers/message/index.tsx index 4facaf9e5..c3b544622 100644 --- a/app/containers/message/index.tsx +++ b/app/containers/message/index.tsx @@ -5,7 +5,7 @@ import { Subscription } from 'rxjs'; import Message from './Message'; import MessageContext from './Context'; import debounce from '../../utils/debounce'; -import { SYSTEM_MESSAGES, getMessageTranslation } from './utils'; +import { getMessageTranslation } from './utils'; import { TSupportedThemes, withTheme } from '../../theme'; import openLink from '../../utils/openLink'; import { TGetCustomEmoji } from '../../definitions/IEmoji'; @@ -31,6 +31,7 @@ interface IMessageContainerProps { Message_GroupingPeriod?: number; isReadReceiptEnabled?: boolean; isThreadRoom: boolean; + isSystemMessage?: boolean; useRealName?: boolean; autoTranslateRoom?: boolean; autoTranslateLanguage?: string; @@ -254,9 +255,12 @@ class MessageContainer extends React.Component { const { username } = author; + if (type === 'rm') { return I18n.t('Message_removed'); } @@ -198,13 +231,37 @@ export const getInfoMessage = ({ type, role, msg, author, comment }: TInfoMessag if (type === 'user-removed-room-from-team') { return I18n.t('Removed__roomName__from_this_team', { roomName: msg }); } + if (type === 'room-disallowed-reacting') { + return I18n.t('Room_disallowed_reacting', { userBy: username }); + } + if (type === 'room-allowed-reacting') { + return I18n.t('Room_allowed_reacting', { userBy: username }); + } + if (type === 'room-set-read-only') { + return I18n.t('Room_set_read_only', { userBy: username }); + } + if (type === 'room-removed-read-only') { + return I18n.t('Room_removed_read_only', { userBy: username }); + } if (type === 'omnichannel_placed_chat_on_hold') { return I18n.t('Omnichannel_placed_chat_on_hold', { comment }); } if (type === 'omnichannel_on_hold_chat_resumed') { return I18n.t('Omnichannel_on_hold_chat_resumed', { comment }); } - return ''; + if (type === 'command') { + return I18n.t('Livechat_transfer_return_to_the_queue'); + } + if (type === 'livechat-started') { + return I18n.t('Chat_started'); + } + if (type === 'livechat-close') { + return I18n.t('Conversation_closed'); + } + if (type === 'livechat_transfer_history') { + return I18n.t('New_chat_transfer', { agent: username }); + } + return I18n.t('Unsupported_system_message'); }; export const getMessageTranslation = (message: TMessageModel, autoTranslateLanguage: string) => { diff --git a/app/i18n/locales/en.json b/app/i18n/locales/en.json index c06a4ef00..a89c45e31 100644 --- a/app/i18n/locales/en.json +++ b/app/i18n/locales/en.json @@ -132,6 +132,7 @@ "Channel_Name": "Channel Name", "Channels": "Channels", "Chats": "Chats", + "Chat_started": "Chat started", "Call_already_ended": "Call already ended!", "Clear_cookies_alert": "Do you want to clear all cookies?", "Clear_cookies_desc": "This action will clear all login cookies, allowing you to login into other accounts.", @@ -149,6 +150,7 @@ "Choose_where_you_want_links_be_opened": "Choose where you want links be opened", "Code": "Code", "Code_or_password_invalid": "Code or password invalid", + "Conversation_closed": "Conversation closed", "Collaborative": "Collaborative", "Confirm": "Confirm", "Connect": "Connect", @@ -301,6 +303,7 @@ "License": "License", "Livechat": "Livechat", "Livechat_edit": "Livechat edit", + "Livechat_transfer_return_to_the_queue": "returned the chat to the queue", "Login": "Login", "Login_error": "Your credentials were rejected! Please try again.", "Login_with": "Login with", @@ -334,6 +337,7 @@ "N_channels": "{{n}} channels", "Name": "Name", "Never": "Never", + "New_chat_transfer": "New Chat Transfer: {{agent}} returned the chat to the queue", "New_Message": "New Message", "New_Password": "New Password", "New_Server": "New Server", @@ -449,6 +453,10 @@ "Room_Info": "Room Info", "Room_Members": "Room Members", "Room_name_changed": "Room name changed to: {{name}} by {{userBy}}", + "Room_disallowed_reacting": "Room disallowed reacting by {{userBy}}", + "Room_allowed_reacting": "Room allowed reacting by {{userBy}}", + "Room_set_read_only": "Room set read only by {{userBy}}", + "Room_removed_read_only": "Room removed read only by {{userBy}}", "SAVE": "SAVE", "Save_Changes": "Save Changes", "Save": "Save", @@ -547,6 +555,7 @@ "Unread": "Unread", "Unread_on_top": "Unread on top", "Unstar": "Unstar", + "Unsupported_system_message": "Unsupported system message", "Updating": "Updating...", "Uploading": "Uploading", "Upload_file_question_mark": "Upload file?", diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index fcf047ee6..3f64e2eca 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -161,7 +161,9 @@ interface IRoomViewProps extends IBaseScreen { interface IRoomViewState { [key: string]: any; joined: boolean; - room: TSubscriptionModel | { rid: string; t: string; name?: string; fname?: string; prid?: string; joinCodeRequired?: boolean }; + room: + | TSubscriptionModel + | { rid: string; t: string; name?: string; fname?: string; prid?: string; joinCodeRequired?: boolean; sysMes?: boolean }; roomUpdate: { [K in TRoomUpdate]?: any; }; @@ -1231,6 +1233,7 @@ class RoomView extends React.Component { reactionInit={this.onReactionInit} replyBroadcast={this.replyBroadcast} errorActionsShow={this.errorActionsShow} + isSystemMessage={room.sysMes as boolean} baseUrl={baseUrl} Message_GroupingPeriod={Message_GroupingPeriod} timeFormat={Message_TimeFormat}