diff --git a/webapp/channels/src/components/__snapshots__/user_list.test.tsx.snap b/webapp/channels/src/components/__snapshots__/user_list.test.tsx.snap index c91991bd81..fad4aa9cce 100644 --- a/webapp/channels/src/components/__snapshots__/user_list.test.tsx.snap +++ b/webapp/channels/src/components/__snapshots__/user_list.test.tsx.snap @@ -55,6 +55,7 @@ exports[`components/UserList should match default snapshot when there are users "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -114,6 +115,7 @@ exports[`components/UserList should match default snapshot when there are users "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/add_users_to_team_modal/__snapshots__/add_users_to_team_modal.test.tsx.snap b/webapp/channels/src/components/add_users_to_team_modal/__snapshots__/add_users_to_team_modal.test.tsx.snap index 8bb89b248b..edb3d80bfa 100644 --- a/webapp/channels/src/components/add_users_to_team_modal/__snapshots__/add_users_to_team_modal.test.tsx.snap +++ b/webapp/channels/src/components/add_users_to_team_modal/__snapshots__/add_users_to_team_modal.test.tsx.snap @@ -104,6 +104,7 @@ exports[`components/admin_console/add_users_to_team_modal/AddUsersToTeamModal sh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -143,6 +144,7 @@ exports[`components/admin_console/add_users_to_team_modal/AddUsersToTeamModal sh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -288,6 +290,7 @@ exports[`components/admin_console/add_users_to_team_modal/AddUsersToTeamModal sh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -327,6 +330,7 @@ exports[`components/admin_console/add_users_to_team_modal/AddUsersToTeamModal sh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/admin_console/member_list_group/__snapshots__/member_list_group.test.tsx.snap b/webapp/channels/src/components/admin_console/member_list_group/__snapshots__/member_list_group.test.tsx.snap index c313acea5e..38ce131ccb 100644 --- a/webapp/channels/src/components/admin_console/member_list_group/__snapshots__/member_list_group.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/member_list_group/__snapshots__/member_list_group.test.tsx.snap @@ -52,6 +52,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -98,6 +99,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -144,6 +146,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -190,6 +193,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -236,6 +240,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -282,6 +287,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -328,6 +334,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -374,6 +381,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -420,6 +428,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -466,6 +475,7 @@ exports[`admin_console/team_channel_settings/group/GroupList should match snapsh "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", 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 8d1e45cedd..c4359cce6c 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 @@ -20,6 +20,7 @@ describe('components/admin_console/reset_password_modal/reset_password_modal.tsx comments: 'never', desktop: 'default', desktop_sound: 'true', + calls_desktop_sound: 'true', email: 'true', first_name: 'true', mark_unread: 'all', diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/__snapshots__/add_users_to_role_modal.test.tsx.snap b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/__snapshots__/add_users_to_role_modal.test.tsx.snap index 4161c0b2d2..cc70fb74ce 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/__snapshots__/add_users_to_role_modal.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/add_users_to_role_modal/__snapshots__/add_users_to_role_modal.test.tsx.snap @@ -107,6 +107,7 @@ exports[`admin_console/add_users_to_role_modal should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -146,6 +147,7 @@ exports[`admin_console/add_users_to_role_modal should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/__snapshots__/system_role_users.test.tsx.snap b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/__snapshots__/system_role_users.test.tsx.snap index b32dbecb6b..19bbe32c4d 100644 --- a/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/__snapshots__/system_role_users.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/system_roles/system_role/system_role_users/__snapshots__/system_role_users.test.tsx.snap @@ -25,6 +25,7 @@ exports[`admin_console/system_role_users should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -64,6 +65,7 @@ exports[`admin_console/system_role_users should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -182,6 +184,7 @@ exports[`admin_console/system_role_users should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -226,6 +229,7 @@ exports[`admin_console/system_role_users should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -272,6 +276,7 @@ exports[`admin_console/system_role_users should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -316,6 +321,7 @@ exports[`admin_console/system_role_users should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -375,6 +381,7 @@ exports[`admin_console/system_role_users should match snapshot with readOnly tru "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -414,6 +421,7 @@ exports[`admin_console/system_role_users should match snapshot with readOnly tru "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -532,6 +540,7 @@ exports[`admin_console/system_role_users should match snapshot with readOnly tru "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -576,6 +585,7 @@ exports[`admin_console/system_role_users should match snapshot with readOnly tru "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -622,6 +632,7 @@ exports[`admin_console/system_role_users should match snapshot with readOnly tru "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -666,6 +677,7 @@ exports[`admin_console/system_role_users should match snapshot with readOnly tru "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/__snapshots__/channel_members.test.tsx.snap b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/__snapshots__/channel_members.test.tsx.snap index 337301c12b..5691dedfa9 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/__snapshots__/channel_members.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/team_channel_settings/channel/details/channel_members/__snapshots__/channel_members.test.tsx.snap @@ -208,6 +208,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelMembers should match "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -245,6 +246,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelMembers should match "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -282,6 +284,7 @@ exports[`admin_console/team_channel_settings/channel/ChannelMembers should match "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/__snapshots__/users_to_remove_role.test.tsx.snap b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/__snapshots__/users_to_remove_role.test.tsx.snap index 18a77631df..1f921ca58f 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/__snapshots__/users_to_remove_role.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/team_channel_settings/group/group_users/__snapshots__/users_to_remove_role.test.tsx.snap @@ -53,6 +53,7 @@ exports[`components/admin_console/team_channel_settings/group/UsersToRemoveRole "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -145,6 +146,7 @@ exports[`components/admin_console/team_channel_settings/group/UsersToRemoveRole "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -237,6 +239,7 @@ exports[`components/admin_console/team_channel_settings/group/UsersToRemoveRole "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -329,6 +332,7 @@ exports[`components/admin_console/team_channel_settings/group/UsersToRemoveRole "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -412,6 +416,7 @@ exports[`components/admin_console/team_channel_settings/group/UsersToRemoveRole "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -495,6 +500,7 @@ exports[`components/admin_console/team_channel_settings/group/UsersToRemoveRole "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/__snapshots__/team_members.test.tsx.snap b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/__snapshots__/team_members.test.tsx.snap index 148c10605c..a2bee43b1e 100644 --- a/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/__snapshots__/team_members.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/team_channel_settings/team/details/team_members/__snapshots__/team_members.test.tsx.snap @@ -180,6 +180,7 @@ exports[`admin_console/team_channel_settings/team/TeamMembers should match snaps "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -217,6 +218,7 @@ exports[`admin_console/team_channel_settings/team/TeamMembers should match snaps "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -254,6 +256,7 @@ exports[`admin_console/team_channel_settings/team/TeamMembers should match snaps "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/admin_console/user_grid/__snapshots__/user_grid.test.tsx.snap b/webapp/channels/src/components/admin_console/user_grid/__snapshots__/user_grid.test.tsx.snap index e357fcbab1..7a0a2071a9 100644 --- a/webapp/channels/src/components/admin_console/user_grid/__snapshots__/user_grid.test.tsx.snap +++ b/webapp/channels/src/components/admin_console/user_grid/__snapshots__/user_grid.test.tsx.snap @@ -77,6 +77,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -120,6 +121,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -178,6 +180,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -224,6 +227,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -267,6 +271,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -325,6 +330,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -440,6 +446,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -491,6 +498,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -541,6 +549,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -587,6 +596,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -630,6 +640,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -688,6 +699,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -734,6 +746,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -777,6 +790,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -835,6 +849,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -950,6 +965,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -993,6 +1009,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1051,6 +1068,7 @@ exports[`components/admin_console/user_grid/UserGrid should match snapshot with "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/channel_header_dropdown/__snapshots__/channel_header_dropdown.test.tsx.snap b/webapp/channels/src/components/channel_header_dropdown/__snapshots__/channel_header_dropdown.test.tsx.snap index 69ed3ea654..537af08b17 100644 --- a/webapp/channels/src/components/channel_header_dropdown/__snapshots__/channel_header_dropdown.test.tsx.snap +++ b/webapp/channels/src/components/channel_header_dropdown/__snapshots__/channel_header_dropdown.test.tsx.snap @@ -130,6 +130,7 @@ exports[`components/ChannelHeaderDropdown should match snapshot with no plugin i "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -205,6 +206,7 @@ exports[`components/ChannelHeaderDropdown should match snapshot with no plugin i "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -711,6 +713,7 @@ exports[`components/ChannelHeaderDropdown should match snapshot with no plugin i "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -919,6 +922,7 @@ exports[`components/ChannelHeaderDropdown should match snapshot with plugins 1`] "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -994,6 +998,7 @@ exports[`components/ChannelHeaderDropdown should match snapshot with plugins 1`] "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1500,6 +1505,7 @@ exports[`components/ChannelHeaderDropdown should match snapshot with plugins 1`] "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/integrations/installed_outgoing_webhooks/__snapshots__/installed_outgoing_webhooks.test.tsx.snap b/webapp/channels/src/components/integrations/installed_outgoing_webhooks/__snapshots__/installed_outgoing_webhooks.test.tsx.snap index fdceb9ebcd..d96a9e7f12 100644 --- a/webapp/channels/src/components/integrations/installed_outgoing_webhooks/__snapshots__/installed_outgoing_webhooks.test.tsx.snap +++ b/webapp/channels/src/components/integrations/installed_outgoing_webhooks/__snapshots__/installed_outgoing_webhooks.test.tsx.snap @@ -41,6 +41,7 @@ exports[`components/integrations/InstalledOutgoingWebhooks should match snapshot "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -147,6 +148,7 @@ exports[`components/integrations/InstalledOutgoingWebhooks should match snapshot "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.test.tsx b/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.test.tsx index 0edbbaccb1..e602a900cf 100644 --- a/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.test.tsx +++ b/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.test.tsx @@ -37,6 +37,7 @@ describe('components/KeyboardShortcutsModal', () => { ...initialState.plugins.plugins, [suitePluginIds.calls]: { id: suitePluginIds.calls, + version: '0.15.0', }, }, }, diff --git a/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.tsx b/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.tsx index 3d0c891136..5b8b80f4a4 100644 --- a/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.tsx +++ b/webapp/channels/src/components/keyboard_shortcuts/keyboard_shortcuts_modal/keyboard_shortcuts_modal.tsx @@ -6,9 +6,6 @@ import {Modal} from 'react-bootstrap'; import {defineMessages, useIntl} from 'react-intl'; import {useSelector} from 'react-redux'; -import {GlobalState} from 'types/store'; - -import {suitePluginIds} from 'utils/constants'; import * as UserAgent from 'utils/user_agent'; import KeyboardShortcutSequence, { @@ -17,6 +14,7 @@ import KeyboardShortcutSequence, { } from 'components/keyboard_shortcuts/keyboard_shortcuts_sequence'; import './keyboard_shortcuts_modal.scss'; +import {isCallsEnabled} from 'selectors/calls'; const modalMessages = defineMessages({ msgHeader: { @@ -91,9 +89,7 @@ const KeyboardShortcutsModal = ({onExited}: Props): JSX.Element => { const isLinux = UserAgent.isLinux(); - const isCallsEnabled = useSelector((state: GlobalState) => { - return Boolean(state.plugins.plugins[suitePluginIds.calls]); - }); + const callsEnabled = useSelector(isCallsEnabled); const renderShortcutSequences = (shortcuts: {[key: string]: KeyboardShortcutDescriptor}) => { return Object.entries(shortcuts).map(([key, shortcut]) => { @@ -203,7 +199,7 @@ const KeyboardShortcutsModal = ({onExited}: Props): JSX.Element => { - { isCallsEnabled && + { callsEnabled &&
diff --git a/webapp/channels/src/components/more_direct_channels/__snapshots__/more_direct_channels.test.tsx.snap b/webapp/channels/src/components/more_direct_channels/__snapshots__/more_direct_channels.test.tsx.snap index f9bf246b38..82bf3e070d 100644 --- a/webapp/channels/src/components/more_direct_channels/__snapshots__/more_direct_channels.test.tsx.snap +++ b/webapp/channels/src/components/more_direct_channels/__snapshots__/more_direct_channels.test.tsx.snap @@ -88,6 +88,7 @@ exports[`components/MoreDirectChannels should exclude deleted users if there is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -125,6 +126,7 @@ exports[`components/MoreDirectChannels should exclude deleted users if there is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -162,6 +164,7 @@ exports[`components/MoreDirectChannels should exclude deleted users if there is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -199,6 +202,7 @@ exports[`components/MoreDirectChannels should exclude deleted users if there is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -236,6 +240,7 @@ exports[`components/MoreDirectChannels should exclude deleted users if there is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -368,6 +373,7 @@ exports[`components/MoreDirectChannels should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -405,6 +411,7 @@ exports[`components/MoreDirectChannels should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -442,6 +449,7 @@ exports[`components/MoreDirectChannels should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -484,6 +492,7 @@ exports[`components/MoreDirectChannels should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -523,6 +532,7 @@ exports[`components/MoreDirectChannels should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/profile_popover/__snapshots__/profile_popover.test.tsx.snap b/webapp/channels/src/components/profile_popover/__snapshots__/profile_popover.test.tsx.snap index 3f98bb1301..d6a92da00c 100644 --- a/webapp/channels/src/components/profile_popover/__snapshots__/profile_popover.test.tsx.snap +++ b/webapp/channels/src/components/profile_popover/__snapshots__/profile_popover.test.tsx.snap @@ -132,6 +132,7 @@ exports[`components/ProfilePopover should disable start call button when user is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -219,6 +220,7 @@ exports[`components/ProfilePopover should disable start call button when user is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -315,6 +317,7 @@ exports[`components/ProfilePopover should disable start call button when user is "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -477,6 +480,7 @@ exports[`components/ProfilePopover should hide add-to-channel option if not on t "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -581,6 +585,7 @@ exports[`components/ProfilePopover should hide add-to-channel option if not on t "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -743,6 +748,7 @@ exports[`components/ProfilePopover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -830,6 +836,7 @@ exports[`components/ProfilePopover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -930,6 +937,7 @@ exports[`components/ProfilePopover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1107,6 +1115,7 @@ exports[`components/ProfilePopover should match snapshot for shared user 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1195,6 +1204,7 @@ exports[`components/ProfilePopover should match snapshot for shared user 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1296,6 +1306,7 @@ exports[`components/ProfilePopover should match snapshot for shared user 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1459,6 +1470,7 @@ exports[`components/ProfilePopover should match snapshot when calls are disabled "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1546,6 +1558,7 @@ exports[`components/ProfilePopover should match snapshot when calls are disabled "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1612,6 +1625,7 @@ exports[`components/ProfilePopover should match snapshot when calls are disabled "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1781,6 +1795,7 @@ exports[`components/ProfilePopover should match snapshot with custom status 1`] "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -1906,6 +1921,7 @@ exports[`components/ProfilePopover should match snapshot with custom status 1`] "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2006,6 +2022,7 @@ exports[`components/ProfilePopover should match snapshot with custom status 1`] "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2175,6 +2192,7 @@ exports[`components/ProfilePopover should match snapshot with custom status expi "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2262,6 +2280,7 @@ exports[`components/ProfilePopover should match snapshot with custom status expi "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2362,6 +2381,7 @@ exports[`components/ProfilePopover should match snapshot with custom status expi "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2524,6 +2544,7 @@ exports[`components/ProfilePopover should match snapshot with custom status not "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2648,6 +2669,7 @@ exports[`components/ProfilePopover should match snapshot with custom status not "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2810,6 +2832,7 @@ exports[`components/ProfilePopover should match snapshot with last active displa "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2897,6 +2920,7 @@ exports[`components/ProfilePopover should match snapshot with last active displa "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -2997,6 +3021,7 @@ exports[`components/ProfilePopover should match snapshot with last active displa "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -3134,6 +3159,7 @@ exports[`components/ProfilePopover should match snapshot with no last active dis "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -3221,6 +3247,7 @@ exports[`components/ProfilePopover should match snapshot with no last active dis "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -3321,6 +3348,7 @@ exports[`components/ProfilePopover should match snapshot with no last active dis "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -3434,6 +3462,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -3569,6 +3598,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -3912,6 +3942,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -3992,6 +4023,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -4161,6 +4193,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -4223,6 +4256,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -4392,6 +4426,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -4472,6 +4507,7 @@ exports[`components/ProfilePopover should show the start call button when isCall "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/profile_popover/index.ts b/webapp/channels/src/components/profile_popover/index.ts index da6c5cde5c..43908a7afd 100644 --- a/webapp/channels/src/components/profile_popover/index.ts +++ b/webapp/channels/src/components/profile_popover/index.ts @@ -35,10 +35,10 @@ import {GlobalState} from 'types/store'; import {ServerError} from '@mattermost/types/errors'; -import {suitePluginIds} from 'utils/constants'; import {getDirectChannelName} from 'utils/utils'; import ProfilePopover from './profile_popover'; +import {isCallsEnabled} from 'selectors/calls'; type OwnProps = { userId: string; @@ -91,9 +91,9 @@ function makeMapStateToProps() { const enableLastActiveTime = displayLastActiveLabel(state, userId); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore - const isCallsEnabled = Boolean(state.plugins.plugins[suitePluginIds.calls]) && Boolean(state['plugins-' + suitePluginIds.calls]); + const callsEnabled = isCallsEnabled(state); const currentUserId = getCurrentUserId(state); - const callsConfig = isCallsEnabled ? getCallsConfig(state) : undefined; + const callsConfig = callsEnabled ? getCallsConfig(state) : undefined; return { currentTeamId: team.id, @@ -116,9 +116,9 @@ function makeMapStateToProps() { enableLastActiveTime, timestampUnits, isMobileView: getIsMobileView(state), - isCallsEnabled, - isUserInCall: isCallsEnabled ? checkUserInCall(state, userId) : undefined, - isCurrentUserInCall: isCallsEnabled ? checkUserInCall(state, currentUserId) : undefined, + isCallsEnabled: callsEnabled, + isUserInCall: callsEnabled ? checkUserInCall(state, userId) : undefined, + isCurrentUserInCall: callsEnabled ? checkUserInCall(state, currentUserId) : undefined, isCallsDefaultEnabledOnAllChannels: callsConfig?.DefaultEnabled, isCallsCanBeDisabledOnSpecificChannels: callsConfig?.AllowEnableCalls, dMChannel: getChannelByName(state, getDirectChannelName(currentUserId, userId)), diff --git a/webapp/channels/src/components/user_group_popover/__snapshots__/user_group_popover.test.tsx.snap b/webapp/channels/src/components/user_group_popover/__snapshots__/user_group_popover.test.tsx.snap index bb7813eb26..572dc83d79 100644 --- a/webapp/channels/src/components/user_group_popover/__snapshots__/user_group_popover.test.tsx.snap +++ b/webapp/channels/src/components/user_group_popover/__snapshots__/user_group_popover.test.tsx.snap @@ -404,6 +404,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -444,6 +445,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -484,6 +486,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -524,6 +527,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -564,6 +568,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -604,6 +609,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -644,6 +650,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -684,6 +691,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -724,6 +732,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -764,6 +773,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -804,6 +814,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -844,6 +855,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -884,6 +896,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -924,6 +937,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -964,6 +978,7 @@ exports[`component/user_group_popover should match snapshot 1`] = ` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/user_group_popover/group_member_list/__snapshots__/group_member_list.test.tsx.snap b/webapp/channels/src/components/user_group_popover/group_member_list/__snapshots__/group_member_list.test.tsx.snap index 5b176b147b..19389c7762 100644 --- a/webapp/channels/src/components/user_group_popover/group_member_list/__snapshots__/group_member_list.test.tsx.snap +++ b/webapp/channels/src/components/user_group_popover/group_member_list/__snapshots__/group_member_list.test.tsx.snap @@ -84,6 +84,7 @@ exports[`component/user_group_popover/group_member_list should match snapshot 1` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -124,6 +125,7 @@ exports[`component/user_group_popover/group_member_list should match snapshot 1` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -164,6 +166,7 @@ exports[`component/user_group_popover/group_member_list should match snapshot 1` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -204,6 +207,7 @@ exports[`component/user_group_popover/group_member_list should match snapshot 1` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", @@ -244,6 +248,7 @@ exports[`component/user_group_popover/group_member_list should match snapshot 1` "mfa_active": false, "nickname": "", "notify_props": Object { + "calls_desktop_sound": "true", "channel": "false", "comments": "never", "desktop": "default", diff --git a/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx b/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx index e3295d6100..067d02ad32 100644 --- a/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx +++ b/webapp/channels/src/components/user_settings/modal/user_settings_modal.tsx @@ -20,6 +20,7 @@ import * as Keyboard from 'utils/keyboard'; import * as Utils from 'utils/utils'; import ConfirmModal from 'components/confirm_modal'; +import * as NotificationSounds from 'utils/notification_sounds'; const UserSettings = React.lazy(() => import(/* webpackPrefetch: true */ 'components/user_settings')); const SettingsSidebar = React.lazy(() => import(/* webpackPrefetch: true */ '../../settings_sidebar')); @@ -161,6 +162,9 @@ class UserSettingsModal extends React.PureComponent { return; } + // Cancel any ongoing notification sound, if any (from DesktopNotificationSettings) + NotificationSounds.stopTryNotificationRing(); + this.setState({ show: false, }); diff --git a/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/__snapshots__/desktop_notification_settings.test.tsx.snap b/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/__snapshots__/desktop_notification_settings.test.tsx.snap index 56da664bc8..b3f23c10e2 100644 --- a/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/__snapshots__/desktop_notification_settings.test.tsx.snap +++ b/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/__snapshots__/desktop_notification_settings.test.tsx.snap @@ -435,6 +435,463 @@ exports[`components/user_settings/notifications/DesktopNotificationSettings shou /> `; +exports[`components/user_settings/notifications/DesktopNotificationSettings should match snapshot, on max setting with Calls enabled 1`] = ` + +
+ + + +
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+ + + +
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ + + +
+ +
+
+
+ +
+
+
+
+
, + ] + } + saving={false} + section="" + serverError="" + submit={[MockFunction]} + title="Desktop Notifications" + updateSection={[Function]} +/> +`; + +exports[`components/user_settings/notifications/DesktopNotificationSettings should match snapshot, on max setting with Calls enabled, calls sound true 1`] = ` + +
+ + + +
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+ + + +
+ +
+
+
+ +
+
+
+ +
+
+ +
+
+ + + +
+ +
+
+
+ +
+
+
+ +
+
+
+
, + ] + } + saving={false} + section="" + serverError="" + submit={[MockFunction]} + title="Desktop Notifications" + updateSection={[Function]} +/> +`; + exports[`components/user_settings/notifications/DesktopNotificationSettings should match snapshot, on max setting with sound enabled 1`] = ` { @@ -50,6 +53,24 @@ describe('components/user_settings/notifications/DesktopNotificationSettings', ( expect(wrapper).toMatchSnapshot(); }); + test('should match snapshot, on max setting with Calls enabled', () => { + const props = {...baseProps, isCallsEnabled: true}; + const wrapper = shallow( + , + ); + + expect(wrapper).toMatchSnapshot(); + }); + + test('should match snapshot, on max setting with Calls enabled, calls sound true', () => { + const props = {...baseProps, isCallsEnabled: true, callsSound: 'true'}; + const wrapper = shallow( + , + ); + + expect(wrapper).toMatchSnapshot(); + }); + test('should match snapshot, on min setting', () => { const props = {...baseProps, active: false}; const wrapper = shallow( diff --git a/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx b/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx index 781337a20f..248dd27ec3 100644 --- a/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx +++ b/webapp/channels/src/components/user_settings/notifications/desktop_notification_setting/desktop_notification_settings.tsx @@ -23,6 +23,7 @@ type Props = { activity: string; threads?: string; sound: string; + callsSound: string; updateSection: (section: string) => void; setParentState: (key: string, value: string | boolean) => void; submit: () => void; @@ -32,26 +33,33 @@ type Props = { areAllSectionsInactive: boolean; saving: boolean; selectedSound: string; + callsSelectedSound: string; isCollapsedThreadsEnabled: boolean; + isCallsEnabled: boolean; }; type State = { selectedOption: SelectedOption; + callsSelectedOption: SelectedOption; blurDropdown: boolean; }; export default class DesktopNotificationSettings extends React.PureComponent { dropdownSoundRef: RefObject; + callsDropdownRef: RefObject; minRef: RefObject; constructor(props: Props) { super(props); const selectedOption = {value: props.selectedSound, label: props.selectedSound}; + const callsSelectedOption = {value: props.callsSelectedSound, label: props.callsSelectedSound}; this.state = { selectedOption, + callsSelectedOption, blurDropdown: false, }; this.dropdownSoundRef = React.createRef(); + this.callsDropdownRef = React.createRef(); this.minRef = React.createRef(); } @@ -73,6 +81,9 @@ export default class DesktopNotificationSettings extends React.PureComponent): void => { @@ -88,12 +99,23 @@ export default class DesktopNotificationSettings extends React.PureComponent): void => { + if (selectedOption && 'value' in selectedOption) { + this.props.setParentState('callsNotificationSound', selectedOption.value); + this.setState({callsSelectedOption: selectedOption}); + NotificationSounds.tryNotificationRing(selectedOption.value); + } + }; + blurDropdown(): void { if (!this.state.blurDropdown) { this.setState({blurDropdown: true}); if (this.dropdownSoundRef.current) { this.dropdownSoundRef.current.blur(); } + if (this.callsDropdownRef.current) { + this.callsDropdownRef.current.blur(); + } } } @@ -112,6 +134,8 @@ export default class DesktopNotificationSettings extends React.PureComponent
); } + if (this.props.isCallsEnabled) { + const callsSoundRadio = [false, false]; + if (this.props.callsSound === 'false') { + callsSoundRadio[1] = true; + } else { + callsSoundRadio[0] = true; + } + + if (this.props.callsSound === 'true') { + const callsSounds = Array.from(NotificationSounds.callsNotificationSounds.keys()); + const callsOptions = callsSounds.map((sound) => { + return {value: sound, label: sound}; + }); + + callsNotificationSelection = (
+
); + } + + callsSection = ( + <> +
+
+ + + +
+ +
+
+
+ +
+
+ {callsNotificationSelection} +
+ + ); + } + if (NotificationSounds.hasSoundOptions()) { soundSection = (
@@ -323,6 +427,7 @@ export default class DesktopNotificationSettings extends React.PureComponent {threadsNotificationSelection} {soundSection} + {callsSection} , ); diff --git a/webapp/channels/src/components/user_settings/notifications/index.ts b/webapp/channels/src/components/user_settings/notifications/index.ts index a4cba95629..f03f00059b 100644 --- a/webapp/channels/src/components/user_settings/notifications/index.ts +++ b/webapp/channels/src/components/user_settings/notifications/index.ts @@ -12,6 +12,7 @@ import {ActionFunc} from 'mattermost-redux/types/actions'; import {GlobalState} from 'types/store'; import UserSettingsNotifications, {Props} from './user_settings_notifications'; +import {isCallsEnabled} from 'selectors/calls'; function mapStateToProps(state: GlobalState) { const config = getConfig(state); @@ -23,6 +24,7 @@ function mapStateToProps(state: GlobalState) { sendPushNotifications, enableAutoResponder, isCollapsedThreadsEnabled: isCollapsedThreadsEnabled(state), + isCallsEnabled: isCallsEnabled(state, '0.17.0'), }; } diff --git a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.test.tsx b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.test.tsx index ba95c724a7..5307a4b2d8 100644 --- a/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.test.tsx +++ b/webapp/channels/src/components/user_settings/notifications/user_settings_notifications.test.tsx @@ -27,6 +27,7 @@ describe('components/user_settings/display/UserSettingsDisplay', () => { isCollapsedThreadsEnabled: false, sendPushNotifications: false, enableAutoResponder: false, + isCallsEnabled: true, }; test('should have called handleSubmit', async () => { 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 9b8d2b113f..22a548f224 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 @@ -9,6 +9,7 @@ import {FormattedMessage} from 'react-intl'; import {ActionResult} from 'mattermost-redux/types/actions'; import Constants, {NotificationLevels} from 'utils/constants'; +import * as NotificationSounds from 'utils/notification_sounds'; import {a11yFocus, localizeMessage, moveCursorToEnd} from 'utils/utils'; import {t} from 'utils/i18n'; @@ -35,6 +36,7 @@ export type Props = { updateMe: (user: UserProfile) => Promise; }; isCollapsedThreadsEnabled: boolean; + isCallsEnabled: boolean; } type State = { @@ -46,7 +48,9 @@ type State = { pushActivity: UserNotifyProps['push']; pushStatus: UserNotifyProps['push_status']; desktopSound: UserNotifyProps['desktop_sound']; + callsDesktopSound: UserNotifyProps['calls_desktop_sound']; desktopNotificationSound: UserNotifyProps['desktop_notification_sound']; + callsNotificationSound: UserNotifyProps['calls_notification_sound']; usernameKey: boolean; customKeys: string; customKeysChecked: boolean; @@ -67,7 +71,9 @@ function getNotificationsStateFromProps(props: Props): State { let pushThreads: UserNotifyProps['push_threads'] = NotificationLevels.ALL; let emailThreads: UserNotifyProps['email_threads'] = NotificationLevels.ALL; let sound: UserNotifyProps['desktop_sound'] = 'true'; + let callsSound: UserNotifyProps['calls_desktop_sound'] = 'true'; let desktopNotificationSound: UserNotifyProps['desktop_notification_sound'] = 'Bing'; + let callsNotificationSound: UserNotifyProps['calls_notification_sound'] = 'Dynamic'; let comments: UserNotifyProps['comments'] = 'never'; let enableEmail: UserNotifyProps['email'] = 'true'; let pushActivity: UserNotifyProps['push'] = NotificationLevels.MENTION; @@ -94,9 +100,15 @@ function getNotificationsStateFromProps(props: Props): State { if (user.notify_props.desktop_sound) { sound = user.notify_props.desktop_sound; } + if (user.notify_props.calls_desktop_sound) { + callsSound = user.notify_props.calls_desktop_sound; + } if (user.notify_props.desktop_notification_sound) { desktopNotificationSound = user.notify_props.desktop_notification_sound; } + if (user.notify_props.calls_notification_sound) { + callsNotificationSound = user.notify_props.calls_notification_sound; + } if (user.notify_props.comments) { comments = user.notify_props.comments; } @@ -159,7 +171,9 @@ function getNotificationsStateFromProps(props: Props): State { pushActivity, pushStatus, desktopSound: sound, + callsDesktopSound: callsSound, desktopNotificationSound, + callsNotificationSound, usernameKey, customKeys, customKeysChecked: customKeys.length > 0, @@ -197,7 +211,9 @@ export default class NotificationsTab extends React.PureComponent const data: UserNotifyProps = {} as UserNotifyProps; data.email = this.state.enableEmail; data.desktop_sound = this.state.desktopSound; + data.calls_desktop_sound = this.state.callsDesktopSound; data.desktop_notification_sound = this.state.desktopNotificationSound; + data.calls_notification_sound = this.state.callsNotificationSound; data.desktop = this.state.desktopActivity; data.desktop_threads = this.state.desktopThreads; data.email_threads = this.state.emailThreads; @@ -230,6 +246,7 @@ export default class NotificationsTab extends React.PureComponent data.channel = this.state.channelKey.toString() as UserNotifyProps['channel']; this.setState({isSaving: true}); + NotificationSounds.stopTryNotificationRing(); this.props.actions.updateMe({notify_props: data} as UserProfile). then(({data: result, error: err}) => { @@ -242,7 +259,10 @@ export default class NotificationsTab extends React.PureComponent }); }; - handleCancel = (): void => this.setState(getNotificationsStateFromProps(this.props)); + handleCancel = (): void => { + this.setState(getNotificationsStateFromProps(this.props)); + NotificationSounds.stopTryNotificationRing(); + }; handleUpdateSection = (section: string): void => { if (section) { @@ -1026,6 +1046,7 @@ export default class NotificationsTab extends React.PureComponent activity={this.state.desktopActivity} threads={this.state.desktopThreads} sound={this.state.desktopSound} + callsSound={this.state.callsDesktopSound} updateSection={this.handleUpdateSection} setParentState={this.setStateValue} submit={this.handleSubmit} @@ -1034,8 +1055,10 @@ export default class NotificationsTab extends React.PureComponent error={this.state.serverError} active={this.props.activeSection === 'desktop'} selectedSound={this.state.desktopNotificationSound || 'default'} + callsSelectedSound={this.state.callsNotificationSound || 'default'} isCollapsedThreadsEnabled={this.props.isCollapsedThreadsEnabled} areAllSectionsInactive={this.props.activeSection === ''} + isCallsEnabled={this.props.isCallsEnabled} />
getHistory(), diff --git a/webapp/channels/src/selectors/calls.ts b/webapp/channels/src/selectors/calls.ts new file mode 100644 index 0000000000..8cf199a30c --- /dev/null +++ b/webapp/channels/src/selectors/calls.ts @@ -0,0 +1,11 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +import {GlobalState} from 'types/store'; +import {suitePluginIds} from 'utils/constants'; +import semver from 'semver'; + +export function isCallsEnabled(state: GlobalState, minVersion = '0.4.2') { + return state.plugins.plugins[suitePluginIds.calls] && + semver.gte(state.plugins.plugins[suitePluginIds.calls].version || '0.0.0', minVersion); +} diff --git a/webapp/channels/src/sounds/calls_calm.mp3 b/webapp/channels/src/sounds/calls_calm.mp3 new file mode 100644 index 0000000000..913a0036ae Binary files /dev/null and b/webapp/channels/src/sounds/calls_calm.mp3 differ diff --git a/webapp/channels/src/sounds/calls_cheerful.mp3 b/webapp/channels/src/sounds/calls_cheerful.mp3 new file mode 100644 index 0000000000..58884405df Binary files /dev/null and b/webapp/channels/src/sounds/calls_cheerful.mp3 differ diff --git a/webapp/channels/src/sounds/calls_dynamic.mp3 b/webapp/channels/src/sounds/calls_dynamic.mp3 new file mode 100644 index 0000000000..0640b8d43f Binary files /dev/null and b/webapp/channels/src/sounds/calls_dynamic.mp3 differ diff --git a/webapp/channels/src/sounds/calls_urgent.mp3 b/webapp/channels/src/sounds/calls_urgent.mp3 new file mode 100644 index 0000000000..396cd1a929 Binary files /dev/null and b/webapp/channels/src/sounds/calls_urgent.mp3 differ diff --git a/webapp/channels/src/types/sounds.d.ts b/webapp/channels/src/types/sounds.d.ts index 79c99e4ae7..3614e7d6ba 100644 --- a/webapp/channels/src/types/sounds.d.ts +++ b/webapp/channels/src/types/sounds.d.ts @@ -7,3 +7,7 @@ declare module 'sounds/down.mp3'; declare module 'sounds/hello.mp3'; declare module 'sounds/ripple.mp3'; declare module 'sounds/upstairs.mp3'; +declare module 'sounds/calls_dynamic.mp3'; +declare module 'sounds/calls_calm.mp3'; +declare module 'sounds/calls_urgent.mp3'; +declare module 'sounds/calls_cheerful.mp3'; diff --git a/webapp/channels/src/utils/notification_sounds.ts b/webapp/channels/src/utils/notification_sounds.ts index b2f8cf0e24..5611076c1b 100644 --- a/webapp/channels/src/utils/notification_sounds.ts +++ b/webapp/channels/src/utils/notification_sounds.ts @@ -7,6 +7,10 @@ import down from 'sounds/down.mp3'; import hello from 'sounds/hello.mp3'; import ripple from 'sounds/ripple.mp3'; import upstairs from 'sounds/upstairs.mp3'; +import calls_dynamic from 'sounds/calls_dynamic.mp3'; +import calls_calm from 'sounds/calls_calm.mp3'; +import calls_urgent from 'sounds/calls_urgent.mp3'; +import calls_cheerful from 'sounds/calls_cheerful.mp3'; import * as UserAgent from 'utils/user_agent'; @@ -19,6 +23,13 @@ export const notificationSounds = new Map([ ['Upstairs', upstairs], ]); +export const callsNotificationSounds = new Map([ + ['Dynamic', calls_dynamic], + ['Calm', calls_calm], + ['Urgent', calls_urgent], + ['Cheerful', calls_cheerful], +]); + let canDing = true; export function ding(name: string) { if (hasSoundOptions() && canDing) { @@ -35,6 +46,48 @@ export function tryNotificationSound(name: string) { audio.play(); } +let currentRing: HTMLAudioElement | null = null; +export function ring(name: string) { + if (!hasSoundOptions()) { + return; + } + stopRing(); + + currentRing = loopNotificationRing(name); +} + +export function stopRing() { + currentRing?.pause(); + currentRing = null; +} + +let currentTryRing: HTMLAudioElement | null = null; +let currentTimer: NodeJS.Timeout; +export function tryNotificationRing(name: string) { + if (!hasSoundOptions()) { + return; + } + stopTryNotificationRing(); + clearTimeout(currentTimer); + + currentTryRing = loopNotificationRing(name); + currentTimer = setTimeout(() => { + stopTryNotificationRing(); + }, 5000); +} + +export function stopTryNotificationRing() { + currentTryRing?.pause(); + currentTryRing = null; +} + +export function loopNotificationRing(name: string) { + const audio = new Audio(callsNotificationSounds.get(name) ?? callsNotificationSounds.get('Dynamic')); + audio.loop = true; + audio.play(); + return audio; +} + export function hasSoundOptions() { return (!UserAgent.isEdge()); } diff --git a/webapp/channels/src/utils/route.test.ts b/webapp/channels/src/utils/route.test.ts index 5194853833..71d6819524 100644 --- a/webapp/channels/src/utils/route.test.ts +++ b/webapp/channels/src/utils/route.test.ts @@ -27,6 +27,7 @@ describe('Utils.Route', () => { props: {userid: '121'}, notify_props: {desktop: 'default', desktop_sound: 'false', + calls_desktop_sound: 'true', email: 'true', mark_unread: 'all', push: 'default', @@ -84,6 +85,7 @@ describe('Utils.Route', () => { props: {userid: '121'}, notify_props: {desktop: 'default', desktop_sound: 'false', + calls_desktop_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 f421a089c3..5d48cb4a1e 100644 --- a/webapp/channels/src/utils/test_helper.ts +++ b/webapp/channels/src/utils/test_helper.ts @@ -47,6 +47,7 @@ export class TestHelper { comments: 'never', desktop: 'default', desktop_sound: 'false', + calls_desktop_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 67195202ec..7d3e47ff6e 100644 --- a/webapp/platform/types/src/users.ts +++ b/webapp/platform/types/src/users.ts @@ -11,6 +11,7 @@ import {IDMappedObjects, RelationOneToMany, RelationOneToManyUnique, RelationOne export type UserNotifyProps = { desktop: 'default' | 'all' | 'mention' | 'none'; desktop_sound: 'true' | 'false'; + calls_desktop_sound: 'true' | 'false'; email: 'true' | 'false'; mark_unread: 'all' | 'mention'; push: 'default' | 'all' | 'mention' | 'none'; @@ -20,6 +21,7 @@ export type UserNotifyProps = { channel: 'true' | 'false'; mention_keys: string; desktop_notification_sound?: 'Bing' | 'Crackle' | 'Down' | 'Hello' | 'Ripple' | 'Upstairs'; + calls_notification_sound?: 'Dynamic' | 'Calm' | 'Urgent' | 'Cheerful'; desktop_threads?: 'default' | 'all' | 'mention' | 'none'; email_threads?: 'default' | 'all' | 'mention' | 'none'; push_threads?: 'default' | 'all' | 'mention' | 'none';