From 93f2b6a83302ceef5c98be4fb696840608ad3bc3 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 23 Sep 2016 12:29:54 -0400 Subject: Updating ESLint (#4085) --- webapp/components/activity_log_modal.jsx | 2 +- .../admin_console/admin_navbar_dropdown.jsx | 4 +-- webapp/components/admin_console/admin_sidebar.jsx | 2 +- webapp/components/admin_console/audits.jsx | 2 +- .../components/admin_console/cluster_settings.jsx | 4 +-- webapp/components/admin_console/cluster_table.jsx | 2 +- .../admin_console/compliance_reports.jsx | 4 +-- .../admin_console/email_connection_test.jsx | 4 +-- .../components/admin_console/ldap_test_button.jsx | 2 +- webapp/components/admin_console/recycle_db.jsx | 6 ++-- webapp/components/admin_console/reload_config.jsx | 6 ++-- .../components/admin_console/sync_now_button.jsx | 4 +-- webapp/components/admin_console/user_item.jsx | 2 +- webapp/components/audit_table.jsx | 2 +- .../backstage/components/backstage_header.jsx | 2 +- .../backstage/components/backstage_list.jsx | 2 +- webapp/components/channel_header.jsx | 2 +- webapp/components/channel_switch_modal.jsx | 2 +- webapp/components/code_preview.jsx | 2 +- .../create_team/components/display_name.jsx | 2 +- webapp/components/emoji/components/emoji_list.jsx | 4 +-- .../emoji/components/emoji_list_item.jsx | 2 +- webapp/components/file_upload_overlay.jsx | 2 +- webapp/components/filtered_channel_list.jsx | 2 +- webapp/components/get_link_modal.jsx | 2 +- webapp/components/header_footer_template.jsx | 4 +-- .../components/installed_outgoing_webhook.jsx | 2 +- webapp/components/invite_member_modal.jsx | 2 +- webapp/components/loading_screen.jsx | 6 ++-- webapp/components/navbar.jsx | 14 +++++----- webapp/components/navbar_dropdown.jsx | 8 +++--- webapp/components/permalink_view.jsx | 2 +- .../post_view/components/post_attachment.jsx | 15 ++++------ .../post_view/components/post_attachment_list.jsx | 2 +- .../components/post_view/components/post_body.jsx | 2 +- .../components/post_body_additional_content.jsx | 2 +- webapp/components/post_view/post_view_cache.jsx | 2 +- webapp/components/rename_channel_modal.jsx | 2 +- webapp/components/rhs_comment.jsx | 2 +- webapp/components/rhs_header_post.jsx | 2 +- webapp/components/rhs_thread.jsx | 2 +- webapp/components/search_bar.jsx | 4 +-- webapp/components/search_results_item.jsx | 2 +- webapp/components/setting_item_max.jsx | 3 +- webapp/components/settings_sidebar.jsx | 4 +-- webapp/components/sidebar.jsx | 4 +-- webapp/components/sidebar_right.jsx | 6 ++-- webapp/components/sidebar_right_menu.jsx | 32 +++++++++++----------- .../suggestion/channel_mention_provider.jsx | 2 +- .../suggestion/search_channel_provider.jsx | 2 +- .../components/suggestion/search_user_provider.jsx | 2 +- .../suggestion/switch_channel_provider.jsx | 8 +++--- webapp/components/team_general_tab.jsx | 5 ++-- webapp/components/team_import_tab.jsx | 4 +-- webapp/components/team_members_dropdown.jsx | 6 ++-- webapp/components/textbox.jsx | 3 +- webapp/components/tutorial/tutorial_tip.jsx | 2 +- webapp/components/user_profile.jsx | 2 +- .../user_settings/custom_theme_chooser.jsx | 18 ++++++------ .../desktop_notification_settings.jsx | 2 +- .../user_settings/user_settings_notifications.jsx | 32 +++++++++------------- .../user_settings/user_settings_security.jsx | 8 +++--- .../user_settings/user_settings_theme.jsx | 2 +- .../webrtc/components/webrtc_sidebar.jsx | 2 +- 64 files changed, 141 insertions(+), 153 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/activity_log_modal.jsx b/webapp/components/activity_log_modal.jsx index 7560cf5d9..2c093e1d2 100644 --- a/webapp/components/activity_log_modal.jsx +++ b/webapp/components/activity_log_modal.jsx @@ -90,7 +90,7 @@ export default class ActivityLogModal extends React.Component { this.setState({moreInfo: newMoreInfo}); } render() { - let activityList = []; + const activityList = []; for (let i = 0; i < this.state.sessions.length; i++) { const currentSession = this.state.sessions[i]; diff --git a/webapp/components/admin_console/admin_navbar_dropdown.jsx b/webapp/components/admin_console/admin_navbar_dropdown.jsx index 0bac263ef..f57635a11 100644 --- a/webapp/components/admin_console/admin_navbar_dropdown.jsx +++ b/webapp/components/admin_console/admin_navbar_dropdown.jsx @@ -77,7 +77,7 @@ export default class AdminNavbarDropdown extends React.Component {
  • + /> ); } @@ -118,7 +118,7 @@ export default class AdminNavbarDropdown extends React.Component {
  • + />
  • + /> diff --git a/webapp/components/admin_console/audits.jsx b/webapp/components/admin_console/audits.jsx index cb500f29c..5e0e03607 100644 --- a/webapp/components/admin_console/audits.jsx +++ b/webapp/components/admin_console/audits.jsx @@ -86,7 +86,7 @@ export default class Audits extends React.Component { className='btn btn-link pull-right' onClick={this.reload} > - + - + - + - + - + - + - + - + ; + return
    ; } let testMessage = null; if (this.state.fail) { testMessage = (
    - +
    ; + return
    ; } let testMessage = null; if (this.state.fail) { testMessage = (
    - + - + {currentRoles} - +
      {auditInfo.sessionId}; } - let descStyle = {}; + const descStyle = {}; if (auditInfo.desc.toLowerCase().indexOf('fail') !== -1) { descStyle.color = 'red'; } diff --git a/webapp/components/backstage/components/backstage_header.jsx b/webapp/components/backstage/components/backstage_header.jsx index 37b4be349..c2dc187b7 100644 --- a/webapp/components/backstage/components/backstage_header.jsx +++ b/webapp/components/backstage/components/backstage_header.jsx @@ -20,7 +20,7 @@ export default class BackstageHeader extends React.Component { key={'divider' + index} className='backstage-header__divider' > - + ); } diff --git a/webapp/components/backstage/components/backstage_list.jsx b/webapp/components/backstage/components/backstage_list.jsx index ecb8783b7..974a55239 100644 --- a/webapp/components/backstage/components/backstage_list.jsx +++ b/webapp/components/backstage/components/backstage_list.jsx @@ -89,7 +89,7 @@ export default class BackstageList extends React.Component {
    - + + />
    diff --git a/webapp/components/emoji/components/emoji_list.jsx b/webapp/components/emoji/components/emoji_list.jsx index 273fc8a25..340fc6afc 100644 --- a/webapp/components/emoji/components/emoji_list.jsx +++ b/webapp/components/emoji/components/emoji_list.jsx @@ -69,7 +69,7 @@ export default class EmojiList extends React.Component { const filter = this.state.filter.toLowerCase(); const isSystemAdmin = Utils.isSystemAdmin(this.props.user.roles); - let emojis = []; + const emojis = []; if (this.state.loading) { emojis.push( @@ -129,7 +129,7 @@ export default class EmojiList extends React.Component {
    - + - {deleteButton} + {deleteButton} ); diff --git a/webapp/components/file_upload_overlay.jsx b/webapp/components/file_upload_overlay.jsx index 25fafddf1..86697cd62 100644 --- a/webapp/components/file_upload_overlay.jsx +++ b/webapp/components/file_upload_overlay.jsx @@ -26,7 +26,7 @@ export default class FileUploadOverlay extends React.Component { src={fileOverlayImage} alt='Files' /> - + { const filter = this.state.filter.toLowerCase(); - return !!((chan.name.toLowerCase().indexOf(filter) !== -1 || chan.display_name.toLowerCase().indexOf(filter) !== -1) && chan.delete_at === 0); + return Boolean((chan.name.toLowerCase().indexOf(filter) !== -1 || chan.display_name.toLowerCase().indexOf(filter) !== -1) && chan.delete_at === 0); }); } diff --git a/webapp/components/get_link_modal.jsx b/webapp/components/get_link_modal.jsx index 0f41b3b29..5363ad217 100644 --- a/webapp/components/get_link_modal.jsx +++ b/webapp/components/get_link_modal.jsx @@ -97,7 +97,7 @@ export default class GetLinkModal extends React.Component { if (this.state.copiedLink) { copyLinkConfirm = (

    - +

    {this.props.children} -
    +
    diff --git a/webapp/components/integrations/components/installed_outgoing_webhook.jsx b/webapp/components/integrations/components/installed_outgoing_webhook.jsx index 4b478255c..664439843 100644 --- a/webapp/components/integrations/components/installed_outgoing_webhook.jsx +++ b/webapp/components/integrations/components/installed_outgoing_webhook.jsx @@ -115,7 +115,7 @@ export default class InstalledOutgoingWebhook extends React.Component { ); } - let urls = ( + const urls = (
    - +
    ); diff --git a/webapp/components/loading_screen.jsx b/webapp/components/loading_screen.jsx index 288eda389..fe2cd6b11 100644 --- a/webapp/components/loading_screen.jsx +++ b/webapp/components/loading_screen.jsx @@ -31,9 +31,9 @@ export default class LoadingScreen extends React.Component {

    {message}

    -
    -
    -
    +
    +
    +
    ); diff --git a/webapp/components/navbar.jsx b/webapp/components/navbar.jsx index 1e7711d2c..d55c2723b 100644 --- a/webapp/components/navbar.jsx +++ b/webapp/components/navbar.jsx @@ -446,7 +446,7 @@ export default class Navbar extends React.Component { aria-expanded='true' > {channelTitle} - +
      - - - + + + ); } else { @@ -517,9 +517,9 @@ export default class Navbar extends React.Component { defaultMessage='Toggle sidebar' /> - - - + + + ); diff --git a/webapp/components/navbar_dropdown.jsx b/webapp/components/navbar_dropdown.jsx index c29bf61c3..60be47767 100644 --- a/webapp/components/navbar_dropdown.jsx +++ b/webapp/components/navbar_dropdown.jsx @@ -278,7 +278,7 @@ export default class NavbarDropdown extends React.Component {
    • + /> ); for (var index in this.state.teamMembers) { @@ -409,15 +409,15 @@ export default class NavbarDropdown extends React.Component { /> -
    • +
    • {integrationsLink} {this.renderCustomEmojiLink()} -
    • +
    • {teamSettings} {manageLink} {sysAdminLink} {teams} -
    • +
    • {helpLink} {reportLink}
    • diff --git a/webapp/components/permalink_view.jsx b/webapp/components/permalink_view.jsx index 55e250d04..5cd2d0fff 100644 --- a/webapp/components/permalink_view.jsx +++ b/webapp/components/permalink_view.jsx @@ -81,7 +81,7 @@ export default class PermalinkView extends React.Component { id='center_panel.recent' defaultMessage='Click here to jump to recent messages. ' /> - +
    diff --git a/webapp/components/post_view/components/post_attachment.jsx b/webapp/components/post_view/components/post_attachment.jsx index 4442b735a..57335b94a 100644 --- a/webapp/components/post_view/components/post_attachment.jsx +++ b/webapp/components/post_view/components/post_attachment.jsx @@ -87,7 +87,7 @@ class PostAttachment extends React.Component { return ''; } - let fieldTables = []; + const fieldTables = []; let headerCols = []; let bodyCols = []; @@ -104,7 +104,7 @@ class PostAttachment extends React.Component { > - {headerCols} + {headerCols} @@ -134,8 +134,7 @@ class PostAttachment extends React.Component { className='attachment-field' key={'attachment__field-' + i + '__' + nrTables} dangerouslySetInnerHTML={{__html: TextFormatting.formatText(field.value || '')}} - > - + /> ); rowPos += 1; lastWasLong = !(field.short === true); @@ -175,8 +174,7 @@ class PostAttachment extends React.Component {
    -
    + /> ); } @@ -250,8 +248,7 @@ class PostAttachment extends React.Component {
    -
    + /> ); } @@ -307,7 +304,7 @@ class PostAttachment extends React.Component { {fields}
    {thumb} -
    +
    diff --git a/webapp/components/post_view/components/post_attachment_list.jsx b/webapp/components/post_view/components/post_attachment_list.jsx index 7da9efbee..7e9d7980d 100644 --- a/webapp/components/post_view/components/post_attachment_list.jsx +++ b/webapp/components/post_view/components/post_attachment_list.jsx @@ -7,7 +7,7 @@ import React from 'react'; export default class PostAttachmentList extends React.Component { render() { - let content = []; + const content = []; this.props.attachments.forEach((attachment, i) => { content.push( - + ); diff --git a/webapp/components/rhs_thread.jsx b/webapp/components/rhs_thread.jsx index 73c2fb9dc..7d0de8590 100644 --- a/webapp/components/rhs_thread.jsx +++ b/webapp/components/rhs_thread.jsx @@ -247,7 +247,7 @@ export default class RhsThread extends React.Component { if (postsArray == null || selected == null) { return ( -
    +
    ); } diff --git a/webapp/components/search_bar.jsx b/webapp/components/search_bar.jsx index 970da7925..dc00095ed 100644 --- a/webapp/components/search_bar.jsx +++ b/webapp/components/search_bar.jsx @@ -148,7 +148,7 @@ export default class SearchBar extends React.Component { render() { var isSearching = null; if (this.state.isSearching) { - isSearching = ; + isSearching = ; } let helpClass = 'search-help-popover'; @@ -162,7 +162,7 @@ export default class SearchBar extends React.Component { className='sidebar__collapse' onClick={this.handleClose} > - +
    {Constants.BOT_NAME}
  • ; } - let profilePic = ( + const profilePic = ( - + /> ); } diff --git a/webapp/components/settings_sidebar.jsx b/webapp/components/settings_sidebar.jsx index 3ccd372f7..d537b6d10 100644 --- a/webapp/components/settings_sidebar.jsx +++ b/webapp/components/settings_sidebar.jsx @@ -23,8 +23,8 @@ export default class SettingsSidebar extends React.Component { } } render() { - let tabList = this.props.tabs.map((tab) => { - let key = `${tab.name}_li`; + const tabList = this.props.tabs.map((tab) => { + const key = `${tab.name}_li`; let className = ''; if (this.props.activeTab === tab.name) { className = 'active'; diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index df1df22a8..712d75548 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -529,9 +529,9 @@ export default class Sidebar extends React.Component { var icon = null; if (channel.type === 'O') { - icon =
    ; + icon =
    ; } else if (channel.type === 'P') { - icon =
    ; + icon =
    ; } else { // set up status icon for direct message channels (status is null for other channel types) icon = ; diff --git a/webapp/components/sidebar_right.jsx b/webapp/components/sidebar_right.jsx index 7d9934919..ffafb9434 100644 --- a/webapp/components/sidebar_right.jsx +++ b/webapp/components/sidebar_right.jsx @@ -37,7 +37,7 @@ export default class SidebarRight extends React.Component { this.state = { searchVisible: SearchStore.getSearchResults() !== null, isMentionSearch: SearchStore.getIsMentionSearch(), - postRightVisible: !!PostStore.getSelectedPost(), + postRightVisible: Boolean(PostStore.getSelectedPost()), expanded: false, fromSearch: false, currentUser: UserStore.getCurrentUser(), @@ -88,7 +88,7 @@ export default class SidebarRight extends React.Component { $('.app__body .inner-wrap').removeClass('move--left').removeClass('move--right'); $('.app__body .sidebar--right').removeClass('move--left'); return ( -
    +
    ); } @@ -118,7 +118,7 @@ export default class SidebarRight extends React.Component { onSelectedChange(fromSearch, fromFlaggedPosts) { this.setState({ - postRightVisible: !!PostStore.getSelectedPost(), + postRightVisible: Boolean(PostStore.getSelectedPost()), fromSearch, fromFlaggedPosts }); diff --git a/webapp/components/sidebar_right_menu.jsx b/webapp/components/sidebar_right_menu.jsx index a28125264..6f6a32a5e 100644 --- a/webapp/components/sidebar_right_menu.jsx +++ b/webapp/components/sidebar_right_menu.jsx @@ -177,7 +177,7 @@ export default class SidebarRightMenu extends React.Component { href='#' onClick={GlobalActions.showInviteMemberModal} > - + - + - + - + - + - + - + - + - + - + this.setState({showUserSettingsModal: true})} > - + - + -
  • +
  • - +
  • -
  • +
  • {helpLink} {reportLink}
  • @@ -436,7 +436,7 @@ export default class SidebarRightMenu extends React.Component { href='#' onClick={this.handleAboutModal} > - + - {item.name} + {item.name}
  • ); } diff --git a/webapp/components/suggestion/search_user_provider.jsx b/webapp/components/suggestion/search_user_provider.jsx index e33c206a7..b5466cf39 100644 --- a/webapp/components/suggestion/search_user_provider.jsx +++ b/webapp/components/suggestion/search_user_provider.jsx @@ -27,7 +27,7 @@ class SearchUserSuggestion extends Suggestion { className='profile-img rounded' src={Client.getUsersRoute() + '/' + item.id + '/image?time=' + item.update_at} /> - {item.username} + {item.username} ); } diff --git a/webapp/components/suggestion/switch_channel_provider.jsx b/webapp/components/suggestion/switch_channel_provider.jsx index e0c862e7e..70e95b9b1 100644 --- a/webapp/components/suggestion/switch_channel_provider.jsx +++ b/webapp/components/suggestion/switch_channel_provider.jsx @@ -29,9 +29,9 @@ class SwitchChannelSuggestion extends Suggestion { let icon = null; if (item.type === Constants.OPEN_CHANNEL) { - icon =
    ; + icon =
    ; } else if (item.type === Constants.PRIVATE_CHANNEL) { - icon =
    ; + icon =
    ; } else { icon = ; } @@ -41,8 +41,8 @@ class SwitchChannelSuggestion extends Suggestion { onClick={this.handleClick} className={className} > - {icon} - {displayName} + {icon} + {displayName} ); } diff --git a/webapp/components/team_general_tab.jsx b/webapp/components/team_general_tab.jsx index 4d1860de3..0d7acb0ca 100644 --- a/webapp/components/team_general_tab.jsx +++ b/webapp/components/team_general_tab.jsx @@ -354,8 +354,7 @@ class GeneralTab extends React.Component { inputs.push(
    - +
    ); @@ -370,8 +370,8 @@ class CustomThemeChooser extends React.Component { defaultMessage='Sidebar Styles' />
    - - + +
    @@ -388,8 +388,8 @@ class CustomThemeChooser extends React.Component { defaultMessage='Center Channel Styles' />
    - - + +
    @@ -406,8 +406,8 @@ class CustomThemeChooser extends React.Component { defaultMessage='Link and Button Styles' />
    - - + +
    diff --git a/webapp/components/user_settings/desktop_notification_settings.jsx b/webapp/components/user_settings/desktop_notification_settings.jsx index e5376c7ee..109212049 100644 --- a/webapp/components/user_settings/desktop_notification_settings.jsx +++ b/webapp/components/user_settings/desktop_notification_settings.jsx @@ -21,7 +21,7 @@ export default class DesktopNotificationSettings extends React.Component { } buildMaximizedSetting() { - let inputs = []; + const inputs = []; let extraInfo = null; const activityRadio = [false, false, false]; diff --git a/webapp/components/user_settings/user_settings_notifications.jsx b/webapp/components/user_settings/user_settings_notifications.jsx index 05881dcf9..35df53e0e 100644 --- a/webapp/components/user_settings/user_settings_notifications.jsx +++ b/webapp/components/user_settings/user_settings_notifications.jsx @@ -260,9 +260,8 @@ export default class NotificationsTab extends React.Component { } createPushNotificationSection() { - let handleUpdatePushSection; if (this.props.activeSection === 'push') { - let inputs = []; + const inputs = []; let extraInfo = null; let submit = null; @@ -508,9 +507,9 @@ export default class NotificationsTab extends React.Component { } } - handleUpdatePushSection = function updateDesktopSection() { + const handleUpdatePushSection = () => { this.props.updateSection('push'); - }.bind(this); + }; return ( { this.updateFirstNameKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -561,9 +555,9 @@ export default class NotificationsTab extends React.Component { ); } - handleUpdateUsernameKey = function handleUsernameKeyChange(e) { + const handleUpdateUsernameKey = (e) => { this.updateUsernameKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -585,9 +579,9 @@ export default class NotificationsTab extends React.Component {
    ); - handleUpdateMentionKey = function handleMentionKeyChange(e) { + const handleUpdateMentionKey = (e) => { this.updateMentionKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -609,9 +603,9 @@ export default class NotificationsTab extends React.Component {
    ); - handleUpdateChannelKey = function handleChannelKeyChange(e) { + const handleUpdateChannelKey = (e) => { this.updateChannelKey(e.target.checked); - }.bind(this); + }; inputs.push(
    @@ -728,7 +722,7 @@ export default class NotificationsTab extends React.Component { commentsActive[0] = true; } - let inputs = []; + const inputs = []; inputs.push(
    diff --git a/webapp/components/user_settings/user_settings_security.jsx b/webapp/components/user_settings/user_settings_security.jsx index 5bc29e0df..3cff93a0f 100644 --- a/webapp/components/user_settings/user_settings_security.jsx +++ b/webapp/components/user_settings/user_settings_security.jsx @@ -971,23 +971,23 @@ export default class SecurityTab extends React.Component {
    {signInSection}
    -

    +
    - + - + - +
    +
    ); } return null; -- cgit v1.2.3-1-g7c22