From 3174c9a07d780eb8f6e2fce8266013f393de40dd Mon Sep 17 00:00:00 2001 From: Alex White Date: Thu, 3 Aug 2017 09:03:51 -0500 Subject: PLT-6823 Removes option to set notification sound in Edge (#6883) * Remove sound notification support for Edge * Move the sound test to utils and also stop the dings for Edge along with firefox * Fix some styling issues * Remove sound notification support for Edge Move the sound test to utils and also stop the dings for Edge along with firefox Fix some styling issues * Reversing soundOptions util method. Fixing some string IDs for clarity * Fixing a syntax error * Restructure HasSoundOptions blocks to not begin with negative statement * Fixing paranthesis --- .../desktop_notification_settings.jsx | 83 +++++++++++----------- webapp/i18n/en.json | 10 +-- webapp/utils/utils.jsx | 6 +- 3 files changed, 51 insertions(+), 48 deletions(-) diff --git a/webapp/components/user_settings/desktop_notification_settings.jsx b/webapp/components/user_settings/desktop_notification_settings.jsx index 79d500c88..abdbff512 100644 --- a/webapp/components/user_settings/desktop_notification_settings.jsx +++ b/webapp/components/user_settings/desktop_notification_settings.jsx @@ -5,7 +5,6 @@ import SettingItemMin from 'components/setting_item_min.jsx'; import SettingItemMax from 'components/setting_item_max.jsx'; import * as Utils from 'utils/utils.jsx'; -import * as UserAgent from 'utils/user_agent.jsx'; import PropTypes from 'prop-types'; @@ -45,24 +44,7 @@ export default class DesktopNotificationSettings extends React.Component { soundRadio[0] = true; } - if (UserAgent.isFirefox()) { - soundSection = ( -
-
- -
- -
- ); - } else { + if (Utils.hasSoundOptions()) { soundSection = (

@@ -109,11 +91,28 @@ export default class DesktopNotificationSettings extends React.Component {
); + } else { + soundSection = ( +
+
+ +
+ +
+ ); } const durationRadio = [false, false, false, false]; @@ -304,26 +303,26 @@ export default class DesktopNotificationSettings extends React.Component { buildMinimizedSetting() { let describe = ''; if (this.props.activity === 'mention') { - if (UserAgent.isFirefox()) { - if (this.props.duration === '0') { + if (Utils.hasSoundOptions() && this.props.sound !== 'false') { + if (this.props.duration === '0') { //eslint-disable-line no-lonely-if describe = ( ); } else { describe = ( ); } - } else if (this.props.sound === 'false') { + } else if (Utils.hasSoundOptions() && this.props.sound === 'false') { if (this.props.duration === '0') { describe = ( ); } else { describe = ( ); } else { - if (UserAgent.isFirefox()) { //eslint-disable-line no-lonely-if - if (this.props.duration === '0') { + if (Utils.hasSoundOptions() && this.props.sound !== 'false') { //eslint-disable-line no-lonely-if + if (this.props.duration === '0') { //eslint-disable-line no-lonely-if describe = ( ); } else { describe = ( ); } - } else if (this.props.sound === 'false') { + } else if (Utils.hasSoundOptions() && this.props.sound === 'false') { if (this.props.duration === '0') { describe = ( ); } else { describe = (