From 082c048abc67b5db3a0d8d06b6ce65d5b229dae3 Mon Sep 17 00:00:00 2001 From: Hugo Costa Date: Thu, 9 Feb 2023 14:01:22 -0300 Subject: [PATCH] [BREAK] Remove message view mode from User Preferences (#27867) Co-authored-by: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> --- .../meteor/app/lib/server/startup/settings.ts | 20 --------------- .../preferences/AccountPreferencesPage.tsx | 1 - .../PreferencesMessagesSection.tsx | 25 ------------------- .../views/room/components/body/RoomBody.tsx | 11 +------- .../rocketchat-i18n/i18n/af.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ar.i18n.json | 9 ------- .../rocketchat-i18n/i18n/az.i18n.json | 8 ------ .../rocketchat-i18n/i18n/be-BY.i18n.json | 8 ------ .../rocketchat-i18n/i18n/bg.i18n.json | 8 ------ .../rocketchat-i18n/i18n/bs.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ca.i18n.json | 9 ------- .../rocketchat-i18n/i18n/cs.i18n.json | 9 ------- .../rocketchat-i18n/i18n/cy.i18n.json | 8 ------ .../rocketchat-i18n/i18n/da.i18n.json | 9 ------- .../rocketchat-i18n/i18n/de-AT.i18n.json | 8 ------ .../rocketchat-i18n/i18n/de-IN.i18n.json | 8 ------ .../rocketchat-i18n/i18n/de.i18n.json | 9 ------- .../rocketchat-i18n/i18n/el.i18n.json | 8 ------ .../rocketchat-i18n/i18n/en.i18n.json | 6 ----- .../rocketchat-i18n/i18n/eo.i18n.json | 8 ------ .../rocketchat-i18n/i18n/es.i18n.json | 9 ------- .../rocketchat-i18n/i18n/fa.i18n.json | 8 ------ .../rocketchat-i18n/i18n/fi.i18n.json | 7 +----- .../rocketchat-i18n/i18n/fr.i18n.json | 9 ------- .../rocketchat-i18n/i18n/he.i18n.json | 6 ----- .../rocketchat-i18n/i18n/hr.i18n.json | 8 ------ .../rocketchat-i18n/i18n/hu.i18n.json | 9 ------- .../rocketchat-i18n/i18n/id.i18n.json | 8 ------ .../rocketchat-i18n/i18n/it.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ja.i18n.json | 9 ------- .../rocketchat-i18n/i18n/ka-GE.i18n.json | 9 ------- .../rocketchat-i18n/i18n/km.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ko.i18n.json | 9 ------- .../rocketchat-i18n/i18n/ku.i18n.json | 8 ------ .../rocketchat-i18n/i18n/lo.i18n.json | 8 ------ .../rocketchat-i18n/i18n/lt.i18n.json | 8 ------ .../rocketchat-i18n/i18n/lv.i18n.json | 8 ------ .../rocketchat-i18n/i18n/mn.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ms-MY.i18n.json | 8 ------ .../rocketchat-i18n/i18n/nl.i18n.json | 9 ------- .../rocketchat-i18n/i18n/no.i18n.json | 8 ------ .../rocketchat-i18n/i18n/pl.i18n.json | 9 ------- .../rocketchat-i18n/i18n/pt-BR.i18n.json | 9 ------- .../rocketchat-i18n/i18n/pt.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ro.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ru.i18n.json | 9 ------- .../rocketchat-i18n/i18n/sk-SK.i18n.json | 8 ------ .../rocketchat-i18n/i18n/sl-SI.i18n.json | 8 ------ .../rocketchat-i18n/i18n/sq.i18n.json | 8 ------ .../rocketchat-i18n/i18n/sr.i18n.json | 8 ------ .../rocketchat-i18n/i18n/sv.i18n.json | 9 ------- .../rocketchat-i18n/i18n/ta-IN.i18n.json | 8 ------ .../rocketchat-i18n/i18n/th-TH.i18n.json | 8 ------ .../rocketchat-i18n/i18n/tr.i18n.json | 8 ------ .../rocketchat-i18n/i18n/ug.i18n.json | 5 ---- .../rocketchat-i18n/i18n/uk.i18n.json | 8 ------ .../rocketchat-i18n/i18n/vi-VN.i18n.json | 8 ------ .../rocketchat-i18n/i18n/zh-HK.i18n.json | 8 ------ .../rocketchat-i18n/i18n/zh-TW.i18n.json | 9 ------- .../rocketchat-i18n/i18n/zh.i18n.json | 9 ------- .../server/methods/saveUserPreferences.js | 1 - .../meteor/server/startup/migrations/index.ts | 1 + apps/meteor/server/startup/migrations/v285.ts | 10 ++++++++ apps/meteor/tests/data/user.js | 1 - .../tests/end-to-end/api/00-miscellaneous.js | 1 - .../v1/users/UsersSetPreferenceParamsPOST.ts | 5 ---- .../methods/saveUserPreferences.ts | 1 - 67 files changed, 13 insertions(+), 522 deletions(-) create mode 100644 apps/meteor/server/startup/migrations/v285.ts diff --git a/apps/meteor/app/lib/server/startup/settings.ts b/apps/meteor/app/lib/server/startup/settings.ts index c914d280519..eb0f8c4e01d 100644 --- a/apps/meteor/app/lib/server/startup/settings.ts +++ b/apps/meteor/app/lib/server/startup/settings.ts @@ -467,26 +467,6 @@ settingsRegistry.addGroup('Accounts', function () { public: true, i18nLabel: 'Enter_Behaviour', }); - - this.add('Accounts_Default_User_Preferences_messageViewMode', 0, { - type: 'select', - values: [ - { - key: 0, - i18nLabel: 'Normal', - }, - { - key: 1, - i18nLabel: 'Cozy', - }, - { - key: 2, - i18nLabel: 'Compact', - }, - ], - public: true, - i18nLabel: 'MessageBox_view_mode', - }); this.add('Accounts_Default_User_Preferences_emailNotificationMode', 'mentions', { type: 'select', values: [ diff --git a/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx b/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx index b4228b1f86b..115b32ebc57 100644 --- a/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx +++ b/apps/meteor/client/views/account/preferences/AccountPreferencesPage.tsx @@ -31,7 +31,6 @@ type CurrentData = { pushNotifications: string; enableAutoAway: boolean; highlights: string; - messageViewMode: number; hideUsernames: boolean; hideRoles: boolean; displayAvatars: boolean; diff --git a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx index 4d7358bba32..a9b2996e319 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx @@ -21,7 +21,6 @@ type Values = { displayAvatars: boolean; clockMode: 0 | 1 | 2; sendOnEnter: 'normal' | 'alternative' | 'desktop'; - messageViewMode: 0 | 1 | 2; }; const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSectionProps): ReactElement => { @@ -42,7 +41,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti hideFlexTab: useUserPreference('hideFlexTab'), clockMode: useUserPreference('clockMode') ?? 0, sendOnEnter: useUserPreference('sendOnEnter'), - messageViewMode: useUserPreference('messageViewMode'), displayAvatars: useUserPreference('displayAvatars'), }; @@ -62,7 +60,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti displayAvatars, clockMode, sendOnEnter, - messageViewMode, } = values as Values; const { @@ -79,7 +76,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti handleDisplayAvatars, handleClockMode, handleSendOnEnter, - handleMessageViewMode, } = handlers; const alsoSendThreadMessageToChannelOptions = useMemo( @@ -109,15 +105,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti [t], ); - const messageViewModeOptions = useMemo( - (): SelectOption[] => [ - [0 as any, t('Normal')], // TO DO: update SelectOption type to accept number as first item - [1, t('Cozy')], - [2, t('Compact')], - ], - [t], - ); - commitRef.current.messages = commit; // TODO: Weird behaviour when saving clock mode, and then changing it. @@ -275,18 +262,6 @@ const PreferencesMessagesSection = ({ onChange, commitRef, ...props }: FormSecti ), [handleSendOnEnter, sendOnEnter, sendOnEnterOptions, t], )} - {useMemo( - () => ( - - {t('View_mode')} - -