From f8a98f2ac6f6ef1d5acd8a6f531a823cfb45fc0c Mon Sep 17 00:00:00 2001 From: Danish Ahmed Mirza Date: Sun, 9 Jan 2022 19:27:25 +0530 Subject: [PATCH 1/4] [FIX] Joining and leaving messages in teams --- app/containers/message/utils.ts | 16 ++++++++++++++-- app/i18n/locales/en.json | 2 ++ app/utils/messageTypes.js | 8 ++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/containers/message/utils.ts b/app/containers/message/utils.ts index d82fe25f129..27d904a5d34 100644 --- a/app/containers/message/utils.ts +++ b/app/containers/message/utils.ts @@ -26,7 +26,9 @@ export const SYSTEM_MESSAGES = [ 'au', 'ru', 'ul', + 'ult', 'uj', + 'ujt', 'ut', 'rm', 'user-muted', @@ -50,8 +52,10 @@ export const SYSTEM_MESSAGE_TYPES = { MESSAGE_PINNED: 'message_pinned', MESSAGE_SNIPPETED: 'message_snippeted', USER_JOINED_CHANNEL: 'uj', + USER_JOINED_TEAM: 'ujt', USER_JOINED_DISCUSSION: 'ut', - USER_LEFT_CHANNEL: 'ul' + USER_LEFT_CHANNEL: 'ul', + USER_LEFT_TEAM: 'ult' }; export const SYSTEM_MESSAGE_TYPES_WITH_AUTHOR_NAME = [ @@ -59,8 +63,10 @@ export const SYSTEM_MESSAGE_TYPES_WITH_AUTHOR_NAME = [ SYSTEM_MESSAGE_TYPES.MESSAGE_PINNED, SYSTEM_MESSAGE_TYPES.MESSAGE_SNIPPETED, SYSTEM_MESSAGE_TYPES.USER_JOINED_CHANNEL, + SYSTEM_MESSAGE_TYPES.USER_JOINED_TEAM, SYSTEM_MESSAGE_TYPES.USER_JOINED_DISCUSSION, - SYSTEM_MESSAGE_TYPES.USER_LEFT_CHANNEL + SYSTEM_MESSAGE_TYPES.USER_LEFT_CHANNEL, + SYSTEM_MESSAGE_TYPES.USER_LEFT_TEAM ]; type TInfoMessage = { @@ -77,6 +83,9 @@ export const getInfoMessage = ({ type, role, msg, author }: TInfoMessage) => { if (type === 'uj') { return I18n.t('Has_joined_the_channel'); } + if (type === 'ujt') { + return I18n.t('Has_joined_the_team'); + } if (type === 'ut') { return I18n.t('Has_joined_the_conversation'); } @@ -92,6 +101,9 @@ export const getInfoMessage = ({ type, role, msg, author }: TInfoMessage) => { if (type === 'ul') { return I18n.t('Has_left_the_channel'); } + if (type === 'ult') { + return I18n.t('Has_left_the_team'); + } if (type === 'ru') { return I18n.t('User_removed_by', { userRemoved: msg, userBy: username }); } diff --git a/app/i18n/locales/en.json b/app/i18n/locales/en.json index f7e5a5493fb..32a0ba147c7 100644 --- a/app/i18n/locales/en.json +++ b/app/i18n/locales/en.json @@ -249,8 +249,10 @@ "Full_table": "Click to see full table", "Generate_New_Link": "Generate New Link", "Has_joined_the_channel": "has joined the channel", + "Has_joined_the_team":"has joined the team", "Has_joined_the_conversation": "has joined the conversation", "Has_left_the_channel": "has left the channel", + "Has_left_the_team": "has left the team", "Hide_System_Messages": "Hide System Messages", "Hide_type_messages": "Hide \"{{type}}\" messages", "How_It_Works": "How It Works", diff --git a/app/utils/messageTypes.js b/app/utils/messageTypes.js index d1f6fbf6913..4eefa614fe7 100644 --- a/app/utils/messageTypes.js +++ b/app/utils/messageTypes.js @@ -3,10 +3,18 @@ export const MessageTypeValues = [ value: 'uj', text: 'Message_HideType_uj' }, + { + value: 'ujt', + text: 'Message_HideType_ujt' + }, { value: 'ul', text: 'Message_HideType_ul' }, + { + value: 'ult', + text: 'Message_HideType_ult' + }, { value: 'ru', text: 'Message_HideType_ru' From 49b8e2acaf97b98a2139337e921166ac70074ffd Mon Sep 17 00:00:00 2001 From: Danish Ahmed Mirza Date: Thu, 13 Jan 2022 12:24:16 +0530 Subject: [PATCH 2/4] Change messageTypes.js to messageTypes.ts --- app/utils/messageTypes.ts | 62 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 app/utils/messageTypes.ts diff --git a/app/utils/messageTypes.ts b/app/utils/messageTypes.ts new file mode 100644 index 00000000000..4eefa614fe7 --- /dev/null +++ b/app/utils/messageTypes.ts @@ -0,0 +1,62 @@ +export const MessageTypeValues = [ + { + value: 'uj', + text: 'Message_HideType_uj' + }, + { + value: 'ujt', + text: 'Message_HideType_ujt' + }, + { + value: 'ul', + text: 'Message_HideType_ul' + }, + { + value: 'ult', + text: 'Message_HideType_ult' + }, + { + value: 'ru', + text: 'Message_HideType_ru' + }, + { + value: 'au', + text: 'Message_HideType_au' + }, + { + value: 'mute_unmute', + text: 'Message_HideType_mute_unmute' + }, + { + value: 'r', + text: 'Message_HideType_r' + }, + { + value: 'ut', + text: 'Message_HideType_ut' + }, + { + value: 'wm', + text: 'Message_HideType_wm' + }, + { + value: 'rm', + text: 'Message_HideType_rm' + }, + { + value: 'subscription-role-added', + text: 'Message_HideType_subscription_role_added' + }, + { + value: 'subscription-role-removed', + text: 'Message_HideType_subscription_role_removed' + }, + { + value: 'room_archived', + text: 'Message_HideType_room_archived' + }, + { + value: 'room_unarchived', + text: 'Message_HideType_room_unarchived' + } +]; From 9a90721cdd7bf856de31428f428057f0dadd5a20 Mon Sep 17 00:00:00 2001 From: Danish Ahmed Mirza <77742477+try-catch-stack@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:26:34 +0530 Subject: [PATCH 3/4] Delete messageTypes.js --- app/utils/messageTypes.js | 62 --------------------------------------- 1 file changed, 62 deletions(-) delete mode 100644 app/utils/messageTypes.js diff --git a/app/utils/messageTypes.js b/app/utils/messageTypes.js deleted file mode 100644 index 4eefa614fe7..00000000000 --- a/app/utils/messageTypes.js +++ /dev/null @@ -1,62 +0,0 @@ -export const MessageTypeValues = [ - { - value: 'uj', - text: 'Message_HideType_uj' - }, - { - value: 'ujt', - text: 'Message_HideType_ujt' - }, - { - value: 'ul', - text: 'Message_HideType_ul' - }, - { - value: 'ult', - text: 'Message_HideType_ult' - }, - { - value: 'ru', - text: 'Message_HideType_ru' - }, - { - value: 'au', - text: 'Message_HideType_au' - }, - { - value: 'mute_unmute', - text: 'Message_HideType_mute_unmute' - }, - { - value: 'r', - text: 'Message_HideType_r' - }, - { - value: 'ut', - text: 'Message_HideType_ut' - }, - { - value: 'wm', - text: 'Message_HideType_wm' - }, - { - value: 'rm', - text: 'Message_HideType_rm' - }, - { - value: 'subscription-role-added', - text: 'Message_HideType_subscription_role_added' - }, - { - value: 'subscription-role-removed', - text: 'Message_HideType_subscription_role_removed' - }, - { - value: 'room_archived', - text: 'Message_HideType_room_archived' - }, - { - value: 'room_unarchived', - text: 'Message_HideType_room_unarchived' - } -]; From 6dae7ae4cbda906dca432e9b54e7d4a306d043ce Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 17 Jan 2022 11:27:10 -0300 Subject: [PATCH 4/4] empty space added --- app/i18n/locales/en.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/i18n/locales/en.json b/app/i18n/locales/en.json index 32a0ba147c7..499a50e7a0f 100644 --- a/app/i18n/locales/en.json +++ b/app/i18n/locales/en.json @@ -249,7 +249,7 @@ "Full_table": "Click to see full table", "Generate_New_Link": "Generate New Link", "Has_joined_the_channel": "has joined the channel", - "Has_joined_the_team":"has joined the team", + "Has_joined_the_team": "has joined the team", "Has_joined_the_conversation": "has joined the conversation", "Has_left_the_channel": "has left the channel", "Has_left_the_team": "has left the team",