diff --git a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx index 6b8de10cf88..5f454063cd6 100644 --- a/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx +++ b/webapp/channels/src/components/admin_console/reset_password_modal/reset_password_modal.test.tsx @@ -19,6 +19,7 @@ describe('components/admin_console/reset_password_modal/reset_password_modal.tsx desktop: 'default', desktop_sound: 'true', calls_desktop_sound: 'true', + calls_mobile_sound: 'true', email: 'true', first_name: 'true', mark_unread: 'all', diff --git a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx index 74eb42b3073..bd9fd29e1c1 100644 --- a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx +++ b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.tsx @@ -60,8 +60,10 @@ type State = { pushStatus: UserNotifyProps['push_status']; desktopSound: UserNotifyProps['desktop_sound']; callsDesktopSound: UserNotifyProps['calls_desktop_sound']; + callsMobileSound: UserNotifyProps['calls_mobile_sound']; desktopNotificationSound: UserNotifyProps['desktop_notification_sound']; callsNotificationSound: UserNotifyProps['calls_notification_sound']; + callsMobileNotificationSound: UserNotifyProps['calls_mobile_notification_sound']; usernameKey: boolean; isCustomKeysWithNotificationInputChecked: boolean; customKeysWithNotification: MultiInputValue[]; @@ -85,8 +87,10 @@ function getDefaultStateFromProps(props: Props): State { let emailThreads: UserNotifyProps['email_threads'] = NotificationLevels.ALL; let sound: UserNotifyProps['desktop_sound'] = 'true'; let callsSound: UserNotifyProps['calls_desktop_sound'] = 'true'; + let callsMobileSound: UserNotifyProps['calls_mobile_sound'] = 'true'; let desktopNotificationSound: UserNotifyProps['desktop_notification_sound'] = 'Bing'; let callsNotificationSound: UserNotifyProps['calls_notification_sound'] = 'Calm'; + let callsMobileNotificationSound: UserNotifyProps['calls_mobile_notification_sound'] = 'Calm'; let comments: UserNotifyProps['comments'] = 'never'; let enableEmail: UserNotifyProps['email'] = 'true'; let pushActivity: UserNotifyProps['push'] = NotificationLevels.MENTION; @@ -117,12 +121,18 @@ function getDefaultStateFromProps(props: Props): State { if (props.user.notify_props.calls_desktop_sound) { callsSound = props.user.notify_props.calls_desktop_sound; } + if (props.user.notify_props.calls_mobile_sound) { + callsMobileSound = props.user.notify_props.calls_mobile_sound; + } if (props.user.notify_props.desktop_notification_sound) { desktopNotificationSound = props.user.notify_props.desktop_notification_sound; } if (props.user.notify_props.calls_notification_sound) { callsNotificationSound = props.user.notify_props.calls_notification_sound; } + if (props.user.notify_props.calls_mobile_notification_sound) { + callsMobileNotificationSound = props.user.notify_props.calls_mobile_notification_sound; + } if (props.user.notify_props.comments) { comments = props.user.notify_props.comments; } @@ -200,8 +210,10 @@ function getDefaultStateFromProps(props: Props): State { pushStatus, desktopSound: sound, callsDesktopSound: callsSound, + callsMobileSound, desktopNotificationSound, callsNotificationSound, + callsMobileNotificationSound, usernameKey, customKeysWithNotification, isCustomKeysWithNotificationInputChecked, @@ -235,8 +247,10 @@ class NotificationsTab extends React.PureComponent { data.email = this.state.enableEmail; data.desktop_sound = this.state.desktopSound; data.calls_desktop_sound = this.state.callsDesktopSound; + data.calls_mobile_sound = this.state.callsMobileSound; data.desktop_notification_sound = this.state.desktopNotificationSound; data.calls_notification_sound = this.state.callsNotificationSound; + data.calls_mobile_notification_sound = this.state.callsMobileNotificationSound; data.desktop = this.state.desktopActivity; data.desktop_threads = this.state.desktopThreads; data.email_threads = this.state.emailThreads; diff --git a/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts b/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts index 53b98662524..01a4ee289bd 100644 --- a/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts +++ b/webapp/channels/src/packages/mattermost-redux/test/test_helper.ts @@ -101,6 +101,7 @@ class TestHelper { desktop: 'default', desktop_sound: 'false', calls_desktop_sound: 'true', + calls_mobile_sound: 'true', email: 'false', first_name: 'false', mark_unread: 'mention', @@ -143,6 +144,7 @@ class TestHelper { desktop: 'default', desktop_sound: 'false', calls_desktop_sound: 'true', + calls_mobile_sound: 'true', email: 'false', first_name: 'false', mark_unread: 'mention', @@ -470,6 +472,7 @@ class TestHelper { desktop: 'default', desktop_sound: 'true', calls_desktop_sound: 'true', + calls_mobile_sound: 'true', email: 'true', mark_unread: 'all', push: 'default', diff --git a/webapp/channels/src/utils/route.test.ts b/webapp/channels/src/utils/route.test.ts index 0761e9e2131..1fea5ed8e78 100644 --- a/webapp/channels/src/utils/route.test.ts +++ b/webapp/channels/src/utils/route.test.ts @@ -28,6 +28,7 @@ describe('Utils.Route', () => { notify_props: {desktop: 'default', desktop_sound: 'false', calls_desktop_sound: 'true', + calls_mobile_sound: 'true', email: 'true', mark_unread: 'all', push: 'default', @@ -89,6 +90,7 @@ describe('Utils.Route', () => { desktop: 'default', desktop_sound: 'false', calls_desktop_sound: 'true', + calls_mobile_sound: 'true', email: 'true', mark_unread: 'all', push: 'default', diff --git a/webapp/channels/src/utils/test_helper.ts b/webapp/channels/src/utils/test_helper.ts index 153eeb729b7..266382dfe43 100644 --- a/webapp/channels/src/utils/test_helper.ts +++ b/webapp/channels/src/utils/test_helper.ts @@ -65,6 +65,7 @@ export class TestHelper { desktop: 'default', desktop_sound: 'false', calls_desktop_sound: 'true', + calls_mobile_sound: 'true', email: 'false', first_name: 'false', mark_unread: 'mention', diff --git a/webapp/platform/types/src/users.ts b/webapp/platform/types/src/users.ts index ef60cc8ea2b..89b47e2461f 100644 --- a/webapp/platform/types/src/users.ts +++ b/webapp/platform/types/src/users.ts @@ -12,6 +12,7 @@ export type UserNotifyProps = { desktop: 'default' | 'all' | 'mention' | 'none'; desktop_sound: 'true' | 'false'; calls_desktop_sound: 'true' | 'false'; + calls_mobile_sound: 'true' | 'false'; email: 'true' | 'false'; mark_unread: 'all' | 'mention'; push: 'default' | 'all' | 'mention' | 'none'; @@ -23,6 +24,7 @@ export type UserNotifyProps = { highlight_keys: string; desktop_notification_sound?: 'Bing' | 'Crackle' | 'Down' | 'Hello' | 'Ripple' | 'Upstairs'; calls_notification_sound?: 'Dynamic' | 'Calm' | 'Urgent' | 'Cheerful'; + calls_mobile_notification_sound?: 'Dynamic' | 'Calm' | 'Urgent' | 'Cheerful'; desktop_threads?: 'default' | 'all' | 'mention' | 'none'; email_threads?: 'default' | 'all' | 'mention' | 'none'; push_threads?: 'default' | 'all' | 'mention' | 'none';