diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-05-12 07:50:53 -0400 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2016-05-12 07:50:53 -0400 |
commit | 4b260b761a78ea1a0dd6b02df7d25e93b496b6ff (patch) | |
tree | f82ff05a4692a52807260df326b9b12698ebf7f2 | |
parent | a3cfdf04836bb5cef2c34626c07ce04349178792 (diff) | |
download | chat-4b260b761a78ea1a0dd6b02df7d25e93b496b6ff.tar.gz chat-4b260b761a78ea1a0dd6b02df7d25e93b496b6ff.tar.bz2 chat-4b260b761a78ea1a0dd6b02df7d25e93b496b6ff.zip |
Updating client dependancies and ESLint (#2954)
* Updating client dependancies
* Fixing eslint errors with updates
* Updating eslint
69 files changed, 762 insertions, 791 deletions
diff --git a/webapp/.eslintrc.json b/webapp/.eslintrc.json index 3eb02cc40..0597f13b9 100644 --- a/webapp/.eslintrc.json +++ b/webapp/.eslintrc.json @@ -1,224 +1,228 @@ { - "extends": "eslint:recommended", - "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module", - "ecmaFeatures": { - "jsx": true, - "impliedStrict": true, - "modules": true - } - }, - "parser": "babel-eslint", - "plugins": [ - "react" - ], - "env": { - "browser": true, - "node": true, - "jquery": true, - "es6": true - }, - "globals": { + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module", + "ecmaFeatures": { + "jsx": true, + "impliedStrict": true, + "modules": true + } + }, + "parser": "babel-eslint", + "plugins": [ + "react" + ], + "env": { + "browser": true, + "node": true, + "jquery": true, + "es6": true + }, + "globals": { "jest": true, "describe": true, "it": true, "expect": true, "before": true }, - "rules": { - "comma-dangle": [2, "never"], - "array-callback-return": 2, - "prefer-rest-params": 2, - "no-unmodified-loop-condition": 2, - "sort-imports": 0, - "no-new-symbol": 2, - "no-empty-function": 2, - "no-whitespace-before-property": 2, - "no-useless-constructor": 2, - "id-blacklist": 0, - "one-var-declaration-per-line": 0, - "no-extra-label": 2, - "template-curly-spacing": [2, "never"], - "no-self-assign": 2, - "newline-per-chained-call": 0, - "no-confusing-arrow": 2, - "no-case-declarations": 2, - "no-cond-assign": [2, "except-parens"], - "no-console": 2, - "no-constant-condition": 2, - "no-debugger": 2, - "no-dupe-args": 2, - "no-dupe-keys": 2, - "no-duplicate-case": 2, - "no-empty": 2, - "no-empty-pattern": 2, - "no-ex-assign": 2, - "no-extra-semi": 2, - "no-fallthrough": 2, - "no-func-assign": 2, - "no-inner-declarations": 0, - "no-invalid-regexp": 2, - "no-irregular-whitespace": 2, - "no-unexpected-multiline": 2, - "no-unreachable": 2, - "no-magic-numbers": [1, { "ignore": [-1, 0, 1, 2], "enforceConst": true, "detectObjects": true } ], - "valid-typeof": 2, - - "block-scoped-var": 2, - "complexity": [0, 8], - "consistent-return": 2, - "curly": [2, "all"], - "dot-location": [2, "object"], - "dot-notation": 2, - "eqeqeq": [2, "smart"], - "global-require": 2, - "guard-for-in": 2, - "no-alert": 2, - "no-array-constructor": 2, - "no-caller": 2, - "no-div-regex": 2, - "no-else-return": 2, - "no-eval": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-floating-decimal": 2, - "no-implied-eval": 2, - "no-implicit-globals": 0, - "no-iterator": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-loop-func": 2, - "no-multi-spaces": [2, { "exceptions": { "Property": false } }], - "no-multi-str": 0, - "no-native-reassign": 2, - "no-new": 2, - "no-new-func": 2, - "no-new-object": 2, - "no-new-wrappers": 2, - "no-octal-escape": 2, - "no-param-reassign": 2, - "no-process-env": 2, - "no-process-exit": 2, - "no-proto": 2, - "no-redeclare": 2, - "no-return-assign": [2, "always"], - "no-script-url": 2, - "no-self-compare": 2, - "no-sequences": 2, - "no-throw-literal": 2, - "no-undef-init": 2, - "no-unused-expressions": 2, - "no-useless-concat": 1, - "no-void": 2, - "no-warning-comments": 1, - "no-with": 2, - "radix": 2, - "vars-on-top": 0, - "wrap-iife": [2, "outside"], - "yoda": [2, "never", {"exceptRange": false, "onlyEquality": false}], - - "no-undefined": 2, - "no-shadow": [2, {"hoist": "functions"}], - "no-shadow-restricted-names": 2, - "no-unused-vars": [2, {"vars": "all", "args": "after-used"}], - "no-use-before-define": [2, "nofunc"], - - // Style - "array-bracket-spacing": [2, "never"], - "brace-style": [2, "1tbs", { "allowSingleLine": false }], - "camelcase": [2, {"properties": "never"}], - "comma-spacing": [2, {"before": false, "after": true}], - "comma-style": [2, "last"], - "computed-property-spacing": [2, "never"], - "consistent-this": [2, "self"], - "func-names": 2, - "func-style": [2, "declaration"], - "indent": [2, 4, {"SwitchCase": 0}], - "jsx-quotes": [2, "prefer-single"], - "key-spacing": [2, {"beforeColon": false, "afterColon": true}], - "linebreak-style": 2, - "lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }], - "new-cap": 2, - "new-parens": 2, - "no-lonely-if": 2, - "no-mixed-spaces-and-tabs": 2, - "no-multiple-empty-lines": [2, {"max": 1}], - "no-negated-condition": 2, - "no-nested-ternary": 2, - "no-spaced-func": 2, - "no-ternary": 0, - "no-trailing-spaces": [2, { "skipBlankLines": false }], - "no-underscore-dangle": 2, - "no-unneeded-ternary": [2, {"defaultAssignment": false}], - "object-curly-spacing": [2, "never"], - "one-var": [2, "never"], - "operator-linebreak": [2, "after"], - "padded-blocks": [2, "never"], - "quote-props": [2, "as-needed"], - "quotes": [2, "single", "avoid-escape"], - "semi": [2, "always"], - "semi-spacing": [2, {"before": false, "after": true}], - "keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}], - "space-before-blocks": [2, "always"], - "space-before-function-paren": [2, "never"], - "space-in-parens": [2, "never"], - "space-infix-ops": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "wrap-regex": 2, - - // ES6 stuff - "arrow-parens": [2, "always"], - "arrow-body-style": 0, - "arrow-spacing": [2, { "before": true, "after": true }], - "constructor-super": 2, - "generator-star-spacing": [2, {"before": false, "after": true}], - "no-class-assign": 2, - "no-const-assign": 2, - "no-dupe-class-members": 2, - "no-this-before-super": 2, - "no-var": 0, - "object-shorthand": [1, "always"], - "prefer-arrow-callback": 1, - "prefer-const": 1, - "prefer-spread": 2, - "prefer-reflect": 1, - "prefer-template": 0, - "require-yield": 2, - - // React Specific - "react/display-name": [2, { "ignoreTranspilerName": false }], - "react/no-deprecated": 2, - "react/no-is-mounted": 2, - "react/no-string-refs": 0, - "react/jsx-pascal-case": 2, - "react/jsx-indent": [1, 4], - "react/jsx-equals-spacing": [2, "never"], - "react/jsx-handler-names": 0, - "react/jsx-boolean-value": [2, "always"], - "react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }], - "react/jsx-curly-spacing": [2, "never"], - "react/jsx-indent-props": [2, 4], - "react/jsx-key": 2, - "react/jsx-max-props-per-line": [2, { "maximum": 1 }], - "react/jsx-no-bind": 1, - "react/jsx-space-before-closing": [2, "never"], - "react/jsx-no-duplicate-props": [2, { "ignoreCase": false }], - "react/jsx-no-literals": 1, - "react/jsx-no-undef": 2, - "react/jsx-uses-react": 2, - "react/jsx-uses-vars": 2, - "react/no-danger": 0, - "react/no-did-mount-set-state": 2, - "react/no-did-update-set-state": 2, - "react/no-direct-mutation-state": 2, - "react/no-multi-comp": [2, { "ignoreStateless": true }], - "react/no-set-state": 0, - "react/no-unknown-property": 2, - "react/prefer-es6-class": 2, - "react/prop-types": 2, - "react/self-closing-comp": 2, - "react/sort-comp": 0, - "react/wrap-multilines": 2 - } + "rules": { + "array-bracket-spacing": [2, "never"], + "array-callback-return": 2, + "arrow-body-style": 0, + "arrow-parens": [2, "always"], + "arrow-spacing": [2, { "before": true, "after": true }], + "block-scoped-var": 2, + "brace-style": [2, "1tbs", { "allowSingleLine": false }], + "camelcase": [2, {"properties": "never"}], + "comma-dangle": [2, "never"], + "comma-spacing": [2, {"before": false, "after": true}], + "comma-style": [2, "last"], + "complexity": [1, 10], + "computed-property-spacing": [2, "never"], + "consistent-return": 2, + "consistent-this": [2, "self"], + "constructor-super": 2, + "curly": [2, "all"], + "dot-location": [2, "object"], + "dot-notation": 2, + "eqeqeq": [2, "smart"], + "func-names": 2, + "func-style": [2, "declaration"], + "generator-star-spacing": [2, {"before": false, "after": true}], + "global-require": 2, + "guard-for-in": 2, + "id-blacklist": 0, + "indent": [2, 4, {"SwitchCase": 0}], + "jsx-quotes": [2, "prefer-single"], + "key-spacing": [2, {"beforeColon": false, "afterColon": true}], + "keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}], + "linebreak-style": 2, + "lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }], + "max-nested-callbacks": [1, {"max":1}], + "max-nested-callbacks": [2, {"max":2}], + "max-statements-per-line": [2, {"max": 1}], + "new-cap": 2, + "new-parens": 2, + "newline-before-return": 0, + "newline-per-chained-call": 0, + "no-alert": 2, + "no-array-constructor": 2, + "no-caller": 2, + "no-case-declarations": 2, + "no-class-assign": 2, + "no-cond-assign": [2, "except-parens"], + "no-confusing-arrow": 2, + "no-console": 2, + "no-const-assign": 2, + "no-constant-condition": 2, + "no-debugger": 2, + "no-div-regex": 2, + "no-dupe-args": 2, + "no-dupe-class-members": 2, + "no-dupe-keys": 2, + "no-duplicate-case": 2, + "no-duplicate-imports": [2, {"includeExports": true}], + "no-else-return": 2, + "no-empty": 2, + "no-empty-function": 2, + "no-empty-pattern": 2, + "no-eval": 2, + "no-ex-assign": 2, + "no-extend-native": 2, + "no-extra-bind": 2, + "no-extra-label": 2, + "no-extra-semi": 2, + "no-fallthrough": 2, + "no-floating-decimal": 2, + "no-func-assign": 2, + "no-implicit-globals": 0, + "no-implied-eval": 2, + "no-inner-declarations": 0, + "no-invalid-regexp": 2, + "no-irregular-whitespace": 2, + "no-iterator": 2, + "no-labels": 2, + "no-lone-blocks": 2, + "no-lonely-if": 2, + "no-loop-func": 2, + "no-magic-numbers": [1, { "ignore": [-1, 0, 1, 2], "enforceConst": true, "detectObjects": true } ], + "no-mixed-spaces-and-tabs": 2, + "no-multi-spaces": [2, { "exceptions": { "Property": false } }], + "no-multi-str": 0, + "no-multiple-empty-lines": [2, {"max": 1}], + "no-native-reassign": 2, + "no-negated-condition": 2, + "no-nested-ternary": 2, + "no-new": 2, + "no-new-func": 2, + "no-new-object": 2, + "no-new-symbol": 2, + "no-new-wrappers": 2, + "no-octal-escape": 2, + "no-param-reassign": 2, + "no-process-env": 2, + "no-process-exit": 2, + "no-proto": 2, + "no-redeclare": 2, + "no-return-assign": [2, "always"], + "no-script-url": 2, + "no-self-assign": 2, + "no-self-compare": 2, + "no-sequences": 2, + "no-shadow": [2, {"hoist": "functions"}], + "no-shadow-restricted-names": 2, + "no-spaced-func": 2, + "no-ternary": 0, + "no-this-before-super": 2, + "no-throw-literal": 2, + "no-trailing-spaces": [2, { "skipBlankLines": false }], + "no-undef-init": 2, + "no-undefined": 2, + "no-underscore-dangle": 2, + "no-unexpected-multiline": 2, + "no-unmodified-loop-condition": 2, + "no-unneeded-ternary": [2, {"defaultAssignment": false}], + "no-unreachable": 2, + "no-unsafe-finally": 2, + "no-unused-expressions": 2, + "no-unused-vars": [2, {"vars": "all", "args": "after-used"}], + "no-use-before-define": [2, "nofunc"], + "no-useless-computed-key": 2, + "no-useless-concat": 2, + "no-useless-constructor": 2, + "no-useless-escape": 2, + "no-var": 0, + "no-void": 2, + "no-warning-comments": 1, + "no-whitespace-before-property": 2, + "no-with": 2, + "object-curly-spacing": [2, "never"], + "object-shorthand": [1, "always"], + "one-var": [2, "never"], + "one-var-declaration-per-line": 0, + "operator-linebreak": [2, "after"], + "padded-blocks": [2, "never"], + "prefer-arrow-callback": 2, + "prefer-const": 2, + "prefer-reflect": 2, + "prefer-rest-params": 2, + "prefer-spread": 2, + "prefer-template": 0, + "quote-props": [2, "as-needed"], + "quotes": [2, "single", "avoid-escape"], + "radix": 2, + "react/display-name": [2, { "ignoreTranspilerName": false }], + "react/jsx-boolean-value": [2, "always"], + "react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }], + "react/jsx-curly-spacing": [2, "never"], + "react/jsx-equals-spacing": [2, "never"], + "react/jsx-first-prop-new-line": [2, "multiline"], + "react/jsx-handler-names": 0, + "react/jsx-indent": [2, 4], + "react/jsx-indent-props": [2, 4], + "react/jsx-key": 2, + "react/jsx-max-props-per-line": [2, { "maximum": 1 }], + "react/jsx-no-bind": 1, + "react/jsx-no-duplicate-props": [2, { "ignoreCase": false }], + "react/jsx-no-literals": 2, + "react/jsx-no-target-blank": 2, + "react/jsx-no-undef": 2, + "react/jsx-pascal-case": 2, + "react/jsx-space-before-closing": [2, "never"], + "react/jsx-uses-react": 2, + "react/jsx-uses-vars": 2, + "react/no-danger": 0, + "react/no-deprecated": 2, + "react/no-did-mount-set-state": 2, + "react/no-did-update-set-state": 2, + "react/no-direct-mutation-state": 2, + "react/no-is-mounted": 2, + "react/no-multi-comp": [2, { "ignoreStateless": true }], + "react/no-set-state": 0, + "react/no-string-refs": 0, + "react/no-unknown-property": 2, + "react/prefer-es6-class": 2, + "react/prefer-stateless-function": 0, + "react/prop-types": 2, + "react/require-render-return": 2, + "react/self-closing-comp": 2, + "react/sort-comp": 0, + "react/wrap-multilines": 2, + "require-yield": 2, + "semi": [2, "always"], + "semi-spacing": [2, {"before": false, "after": true}], + "sort-imports": 0, + "space-before-blocks": [2, "always"], + "space-before-function-paren": [2, "never"], + "space-in-parens": [2, "never"], + "space-infix-ops": 2, + "space-unary-ops": [2, { "words": true, "nonwords": false }], + "template-curly-spacing": [2, "never"], + "valid-typeof": 2, + "vars-on-top": 0, + "wrap-iife": [2, "outside"], + "wrap-regex": 2, + "yoda": [2, "never", {"exceptRange": false, "onlyEquality": false}] + } } diff --git a/webapp/components/about_build_modal.jsx b/webapp/components/about_build_modal.jsx index 4fd946401..22354d80e 100644 --- a/webapp/components/about_build_modal.jsx +++ b/webapp/components/about_build_modal.jsx @@ -45,6 +45,7 @@ export default class AboutBuildModal extends React.Component { /> <a target='_blank' + rel='noopener noreferrer' href='http://www.mattermost.org/' > {'mattermost.org'} @@ -76,6 +77,7 @@ export default class AboutBuildModal extends React.Component { /> <a target='_blank' + rel='noopener noreferrer' href='http://about.mattermost.com/' > {'about.mattermost.com'} @@ -133,7 +135,7 @@ export default class AboutBuildModal extends React.Component { id='about.version' defaultMessage='Version:' /> - {config.Version} ({config.BuildNumber}) + {'\u00a0' + config.Version + '\u00a0' + config.BuildNumber} </div> </div> {licensee} diff --git a/webapp/components/activity_log_modal.jsx b/webapp/components/activity_log_modal.jsx index d3e5ce66d..ab6224906 100644 --- a/webapp/components/activity_log_modal.jsx +++ b/webapp/components/activity_log_modal.jsx @@ -23,7 +23,7 @@ export default class ActivityLogModal extends React.Component { this.onHide = this.onHide.bind(this); this.onShow = this.onShow.bind(this); - let state = this.getStateFromStores(); + const state = this.getStateFromStores(); state.moreInfo = []; this.state = state; @@ -43,14 +43,14 @@ export default class ActivityLogModal extends React.Component { modalContent.removeClass('animation--highlight'); }, 1500); Client.revokeSession(altId, - function handleRevokeSuccess() { + () => { AsyncClient.getSessions(); }, - function handleRevokeError(err) { - let state = this.getStateFromStores(); + (err) => { + const state = this.getStateFromStores(); state.serverError = err; this.setState(state); - }.bind(this) + } ); } onShow() { @@ -85,7 +85,7 @@ export default class ActivityLogModal extends React.Component { } } handleMoreInfo(index) { - let newMoreInfo = this.state.moreInfo; + const newMoreInfo = this.state.moreInfo; newMoreInfo[index] = true; this.setState({moreInfo: newMoreInfo}); } diff --git a/webapp/components/admin_console/admin_sidebar.jsx b/webapp/components/admin_console/admin_sidebar.jsx index da406e647..4ffc31815 100644 --- a/webapp/components/admin_console/admin_sidebar.jsx +++ b/webapp/components/admin_console/admin_sidebar.jsx @@ -134,13 +134,13 @@ export default class AdminSidebar extends React.Component { placement='top' overlay={removeTooltip} > - <span - className='menu-icon--right menu__close' - onClick={this.removeTeam.bind(this, team.id)} - style={{cursor: 'pointer'}} - > - {'×'} - </span> + <span + className='menu-icon--right menu__close' + onClick={this.removeTeam.bind(this, team.id)} + style={{cursor: 'pointer'}} + > + {'×'} + </span> </OverlayTrigger> </a> </li> @@ -424,7 +424,7 @@ export default class AdminSidebar extends React.Component { </li> </ul> <ul className='nav nav__sub-menu'> - <li> + <li> <h4> <span className='icon fa fa-gear'></span> <span> @@ -442,14 +442,14 @@ export default class AdminSidebar extends React.Component { placement='top' overlay={addTeamTooltip} > - <a - href='#' - onClick={this.showTeamSelect} - > - <i - className='fa fa-plus' - ></i> - </a> + <a + href='#' + onClick={this.showTeamSelect} + > + <i + className='fa fa-plus' + ></i> + </a> </OverlayTrigger> </span> </h4> diff --git a/webapp/components/admin_console/compliance_reports.jsx b/webapp/components/admin_console/compliance_reports.jsx index 04b2c4deb..41d8ce32c 100644 --- a/webapp/components/admin_console/compliance_reports.jsx +++ b/webapp/components/admin_console/compliance_reports.jsx @@ -277,7 +277,8 @@ export default class ComplianceReports extends React.Component { <table> <tbody> <tr> - <td colSpan='5' + <td + colSpan='5' style={{paddingBottom: '6px'}} > <FormattedMessage diff --git a/webapp/components/admin_console/email_settings.jsx b/webapp/components/admin_console/email_settings.jsx index dcdf52486..71add9983 100644 --- a/webapp/components/admin_console/email_settings.jsx +++ b/webapp/components/admin_console/email_settings.jsx @@ -285,12 +285,12 @@ class EmailSettings extends React.Component { var emailSuccess = ''; if (this.state.emailSuccess) { emailSuccess = ( - <div className='alert alert-success'> + <div className='alert alert-success'> <i className='fa fa-check'></i> - <FormattedMessage - id='admin.email.emailSuccess' - defaultMessage='No errors were reported while sending an email. Please check your inbox to make sure.' - /> + <FormattedMessage + id='admin.email.emailSuccess' + defaultMessage='No errors were reported while sending an email. Please check your inbox to make sure.' + /> </div> ); } @@ -298,15 +298,15 @@ class EmailSettings extends React.Component { var emailFail = ''; if (this.state.emailFail) { emailSuccess = ( - <div className='alert alert-warning'> + <div className='alert alert-warning'> <i className='fa fa-warning'></i> - <FormattedMessage - id='admin.email.emailFail' - defaultMessage='Connection unsuccessful: {error}' - values={{ - error: this.state.emailFail - }} - /> + <FormattedMessage + id='admin.email.emailFail' + defaultMessage='Connection unsuccessful: {error}' + values={{ + error: this.state.emailFail + }} + /> </div> ); } @@ -507,10 +507,10 @@ class EmailSettings extends React.Component { defaultChecked={this.props.config.EmailSettings.EnableSignUpWithEmail} onChange={this.handleChange.bind(this, 'allowSignUpWithEmail_true')} /> - <FormattedMessage - id='admin.email.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.email.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -520,10 +520,10 @@ class EmailSettings extends React.Component { defaultChecked={!this.props.config.EmailSettings.EnableSignUpWithEmail} onChange={this.handleChange.bind(this, 'allowSignUpWithEmail_false')} /> - <FormattedMessage - id='admin.email.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.email.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -648,10 +648,10 @@ class EmailSettings extends React.Component { defaultChecked={this.props.config.EmailSettings.SendEmailNotifications} onChange={this.handleChange.bind(this, 'sendEmailNotifications_true')} /> - <FormattedMessage - id='admin.email.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.email.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -661,10 +661,10 @@ class EmailSettings extends React.Component { defaultChecked={!this.props.config.EmailSettings.SendEmailNotifications} onChange={this.handleChange.bind(this, 'sendEmailNotifications_false')} /> - <FormattedMessage - id='admin.email.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.email.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedHTMLMessage @@ -696,10 +696,10 @@ class EmailSettings extends React.Component { onChange={this.handleChange.bind(this, 'requireEmailVerification_true')} disabled={!this.state.sendEmailNotifications} /> - <FormattedMessage - id='admin.email.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.email.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -710,10 +710,10 @@ class EmailSettings extends React.Component { onChange={this.handleChange.bind(this, 'requireEmailVerification_false')} disabled={!this.state.sendEmailNotifications} /> - <FormattedMessage - id='admin.email.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.email.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage diff --git a/webapp/components/admin_console/gitlab_settings.jsx b/webapp/components/admin_console/gitlab_settings.jsx index 747905ac6..510fd0887 100644 --- a/webapp/components/admin_console/gitlab_settings.jsx +++ b/webapp/components/admin_console/gitlab_settings.jsx @@ -122,7 +122,6 @@ class GitLabSettings extends React.Component { className='form-horizontal' role='form' > - <div className='form-group'> <label className='control-label col-sm-4' @@ -143,10 +142,10 @@ class GitLabSettings extends React.Component { defaultChecked={this.props.config.GitLabSettings.Enable} onChange={this.handleChange.bind(this, 'EnableTrue')} /> - <FormattedMessage - id='admin.gitlab.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.gitlab.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -156,10 +155,10 @@ class GitLabSettings extends React.Component { defaultChecked={!this.props.config.GitLabSettings.Enable} onChange={this.handleChange.bind(this, 'EnableFalse')} /> - <FormattedMessage - id='admin.gitlab.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.gitlab.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage diff --git a/webapp/components/admin_console/image_settings.jsx b/webapp/components/admin_console/image_settings.jsx index 023e9af3b..64a7663c6 100644 --- a/webapp/components/admin_console/image_settings.jsx +++ b/webapp/components/admin_console/image_settings.jsx @@ -592,10 +592,10 @@ class FileSettings extends React.Component { defaultChecked={this.props.config.FileSettings.EnablePublicLink} onChange={this.handleChange} /> - <FormattedMessage - id='admin.image.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.image.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -605,10 +605,10 @@ class FileSettings extends React.Component { defaultChecked={!this.props.config.FileSettings.EnablePublicLink} onChange={this.handleChange} /> - <FormattedMessage - id='admin.image.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.image.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -689,4 +689,4 @@ FileSettings.propTypes = { config: React.PropTypes.object }; -export default injectIntl(FileSettings);
\ No newline at end of file +export default injectIntl(FileSettings); diff --git a/webapp/components/admin_console/license_settings.jsx b/webapp/components/admin_console/license_settings.jsx index f2c511e44..14934a3e5 100644 --- a/webapp/components/admin_console/license_settings.jsx +++ b/webapp/components/admin_console/license_settings.jsx @@ -152,6 +152,7 @@ class LicenseSettings extends React.Component { {'Mattermost Enterprise Edition. Unlock enterprise features in this software through the purchase of a subscription from '} <a target='_blank' + rel='noopener noreferrer' href='https://mattermost.com/' > {'https://mattermost.com/'} diff --git a/webapp/components/admin_console/log_settings.jsx b/webapp/components/admin_console/log_settings.jsx index 061c2b6e3..9229c62bc 100644 --- a/webapp/components/admin_console/log_settings.jsx +++ b/webapp/components/admin_console/log_settings.jsx @@ -143,10 +143,10 @@ class LogSettings extends React.Component { defaultChecked={this.props.config.LogSettings.EnableConsole} onChange={this.handleChange.bind(this, 'console_true')} /> - <FormattedMessage - id='admin.log.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.log.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -156,10 +156,10 @@ class LogSettings extends React.Component { defaultChecked={!this.props.config.LogSettings.EnableConsole} onChange={this.handleChange.bind(this, 'console_false')} /> - <FormattedMessage - id='admin.log.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.log.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -221,10 +221,10 @@ class LogSettings extends React.Component { defaultChecked={this.props.config.LogSettings.EnableFile} onChange={this.handleChange.bind(this, 'file_true')} /> - <FormattedMessage - id='admin.log.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.log.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -234,10 +234,10 @@ class LogSettings extends React.Component { defaultChecked={!this.props.config.LogSettings.EnableFile} onChange={this.handleChange.bind(this, 'file_false')} /> - <FormattedMessage - id='admin.log.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.log.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -415,4 +415,4 @@ LogSettings.propTypes = { config: React.PropTypes.object }; -export default injectIntl(LogSettings);
\ No newline at end of file +export default injectIntl(LogSettings); diff --git a/webapp/components/admin_console/privacy_settings.jsx b/webapp/components/admin_console/privacy_settings.jsx index 5045a6d31..8759472a2 100644 --- a/webapp/components/admin_console/privacy_settings.jsx +++ b/webapp/components/admin_console/privacy_settings.jsx @@ -108,10 +108,10 @@ class PrivacySettings extends React.Component { defaultChecked={this.props.config.PrivacySettings.ShowEmailAddress} onChange={this.handleChange} /> - <FormattedMessage - id='admin.privacy.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.privacy.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -121,10 +121,10 @@ class PrivacySettings extends React.Component { defaultChecked={!this.props.config.PrivacySettings.ShowEmailAddress} onChange={this.handleChange} /> - <FormattedMessage - id='admin.privacy.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.privacy.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -155,10 +155,10 @@ class PrivacySettings extends React.Component { defaultChecked={this.props.config.PrivacySettings.ShowFullName} onChange={this.handleChange} /> - <FormattedMessage - id='admin.privacy.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.privacy.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -168,10 +168,10 @@ class PrivacySettings extends React.Component { defaultChecked={!this.props.config.PrivacySettings.ShowFullName} onChange={this.handleChange} /> - <FormattedMessage - id='admin.privacy.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.privacy.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -212,4 +212,4 @@ PrivacySettings.propTypes = { config: React.PropTypes.object }; -export default injectIntl(PrivacySettings);
\ No newline at end of file +export default injectIntl(PrivacySettings); diff --git a/webapp/components/admin_console/rate_settings.jsx b/webapp/components/admin_console/rate_settings.jsx index de7a40e6b..5eb099b8a 100644 --- a/webapp/components/admin_console/rate_settings.jsx +++ b/webapp/components/admin_console/rate_settings.jsx @@ -172,10 +172,10 @@ class RateSettings extends React.Component { defaultChecked={this.props.config.RateLimitSettings.EnableRateLimiter} onChange={this.handleChange.bind(this, 'EnableRateLimiterTrue')} /> - <FormattedMessage - id='admin.rate.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.rate.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -185,10 +185,10 @@ class RateSettings extends React.Component { defaultChecked={!this.props.config.RateLimitSettings.EnableRateLimiter} onChange={this.handleChange.bind(this, 'EnableRateLimiterFalse')} /> - <FormattedMessage - id='admin.rate.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.rate.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -280,10 +280,10 @@ class RateSettings extends React.Component { onChange={this.handleChange.bind(this, 'VaryByRemoteAddrTrue')} disabled={!this.state.EnableRateLimiter} /> - <FormattedMessage - id='admin.rate.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.rate.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -294,10 +294,10 @@ class RateSettings extends React.Component { onChange={this.handleChange.bind(this, 'VaryByRemoteAddrFalse')} disabled={!this.state.EnableRateLimiter} /> - <FormattedMessage - id='admin.rate.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.rate.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -368,4 +368,4 @@ RateSettings.propTypes = { config: React.PropTypes.object }; -export default injectIntl(RateSettings);
\ No newline at end of file +export default injectIntl(RateSettings); diff --git a/webapp/components/admin_console/service_settings.jsx b/webapp/components/admin_console/service_settings.jsx index 90b6a39b4..dfd19d057 100644 --- a/webapp/components/admin_console/service_settings.jsx +++ b/webapp/components/admin_console/service_settings.jsx @@ -379,10 +379,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableIncomingWebhooks} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -392,10 +392,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableIncomingWebhooks} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -426,10 +426,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableOutgoingWebhooks} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -439,10 +439,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableOutgoingWebhooks} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -473,10 +473,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableCommands} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -486,10 +486,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableCommands} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -520,10 +520,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableOnlyAdminIntegrations} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -533,10 +533,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableOnlyAdminIntegrations} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -567,10 +567,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnablePostUsernameOverride} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -580,10 +580,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnablePostUsernameOverride} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -594,7 +594,7 @@ class ServiceSettings extends React.Component { </div> </div> - <div className='form-group'> + <div className='form-group'> <label className='control-label col-sm-4' htmlFor='EnablePostIconOverride' @@ -614,10 +614,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnablePostIconOverride} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -627,10 +627,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnablePostIconOverride} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -661,10 +661,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableTesting} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -674,10 +674,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableTesting} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -708,10 +708,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableDeveloper} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -721,10 +721,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableDeveloper} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -755,10 +755,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableSecurityFixAlert} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -768,10 +768,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableSecurityFixAlert} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -802,10 +802,10 @@ class ServiceSettings extends React.Component { defaultChecked={this.props.config.ServiceSettings.EnableInsecureOutgoingConnections} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.service.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -815,10 +815,10 @@ class ServiceSettings extends React.Component { defaultChecked={!this.props.config.ServiceSettings.EnableInsecureOutgoingConnections} onChange={this.handleChange} /> - <FormattedMessage - id='admin.service.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.service.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage diff --git a/webapp/components/admin_console/sql_settings.jsx b/webapp/components/admin_console/sql_settings.jsx index f2e005b83..a6e09b4a0 100644 --- a/webapp/components/admin_console/sql_settings.jsx +++ b/webapp/components/admin_console/sql_settings.jsx @@ -330,10 +330,10 @@ class SqlSettings extends React.Component { defaultChecked={this.props.config.SqlSettings.Trace} onChange={this.handleChange} /> - <FormattedMessage - id='admin.sql.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.sql.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -343,10 +343,10 @@ class SqlSettings extends React.Component { defaultChecked={!this.props.config.SqlSettings.Trace} onChange={this.handleChange} /> - <FormattedMessage - id='admin.sql.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.sql.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -387,4 +387,4 @@ SqlSettings.propTypes = { config: React.PropTypes.object }; -export default injectIntl(SqlSettings);
\ No newline at end of file +export default injectIntl(SqlSettings); diff --git a/webapp/components/admin_console/team_settings.jsx b/webapp/components/admin_console/team_settings.jsx index e7bfcd74a..e3d7914a6 100644 --- a/webapp/components/admin_console/team_settings.jsx +++ b/webapp/components/admin_console/team_settings.jsx @@ -473,10 +473,10 @@ class TeamSettings extends React.Component { defaultChecked={this.props.config.TeamSettings.EnableTeamCreation} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.team.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -486,10 +486,10 @@ class TeamSettings extends React.Component { defaultChecked={!this.props.config.TeamSettings.EnableTeamCreation} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.team.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -520,10 +520,10 @@ class TeamSettings extends React.Component { defaultChecked={this.props.config.TeamSettings.EnableUserCreation} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.team.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -533,10 +533,10 @@ class TeamSettings extends React.Component { defaultChecked={!this.props.config.TeamSettings.EnableUserCreation} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.team.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -567,10 +567,10 @@ class TeamSettings extends React.Component { defaultChecked={this.props.config.TeamSettings.EnableOpenServer} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.team.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -580,10 +580,10 @@ class TeamSettings extends React.Component { defaultChecked={!this.props.config.TeamSettings.EnableOpenServer} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.team.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage @@ -643,10 +643,10 @@ class TeamSettings extends React.Component { defaultChecked={this.props.config.TeamSettings.RestrictTeamNames} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.true' - defaultMessage='true' - /> + <FormattedMessage + id='admin.team.true' + defaultMessage='true' + /> </label> <label className='radio-inline'> <input @@ -656,10 +656,10 @@ class TeamSettings extends React.Component { defaultChecked={!this.props.config.TeamSettings.RestrictTeamNames} onChange={this.handleChange} /> - <FormattedMessage - id='admin.team.false' - defaultMessage='false' - /> + <FormattedMessage + id='admin.team.false' + defaultMessage='false' + /> </label> <p className='help-text'> <FormattedMessage diff --git a/webapp/components/admin_console/user_item.jsx b/webapp/components/admin_console/user_item.jsx index ef6bd9f45..affd4b5a4 100644 --- a/webapp/components/admin_console/user_item.jsx +++ b/webapp/components/admin_console/user_item.jsx @@ -224,8 +224,8 @@ export default class UserItem extends React.Component { let showMakeSystemAdmin = user.roles === '' || user.roles === 'admin'; let showMakeActive = false; let showMakeNotActive = user.roles !== 'system_admin'; - let mfaEnabled = global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.MFA === 'true' && global.window.mm_config.EnableMultifactorAuthentication === 'true'; - let showMfaReset = mfaEnabled && user.mfa_active; + const mfaEnabled = global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.MFA === 'true' && global.window.mm_config.EnableMultifactorAuthentication === 'true'; + const showMfaReset = mfaEnabled && user.mfa_active; if (user.delete_at > 0) { currentRoles = ( diff --git a/webapp/components/analytics/statistic_count.jsx b/webapp/components/analytics/statistic_count.jsx index cbb8935dd..89e0cc8df 100644 --- a/webapp/components/analytics/statistic_count.jsx +++ b/webapp/components/analytics/statistic_count.jsx @@ -7,7 +7,7 @@ import React from 'react'; export default class StatisticCount extends React.Component { render() { - let loading = ( + const loading = ( <FormattedMessage id='analytics.chart.loading' defaultMessage='Loading...' diff --git a/webapp/components/backstage/add_command.jsx b/webapp/components/backstage/add_command.jsx index ba9ac4e79..f3208bc5f 100644 --- a/webapp/components/backstage/add_command.jsx +++ b/webapp/components/backstage/add_command.jsx @@ -4,13 +4,12 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; -import {browserHistory} from 'react-router'; import * as Utils from 'utils/utils.jsx'; import BackstageHeader from './backstage_header.jsx'; import {FormattedMessage} from 'react-intl'; import FormError from 'components/form_error.jsx'; -import {Link} from 'react-router'; +import {browserHistory, Link} from 'react-router'; import SpinnerButton from 'components/spinner_button.jsx'; const REQUEST_POST = 'P'; diff --git a/webapp/components/backstage/add_incoming_webhook.jsx b/webapp/components/backstage/add_incoming_webhook.jsx index 445d370b5..3d86fe7c0 100644 --- a/webapp/components/backstage/add_incoming_webhook.jsx +++ b/webapp/components/backstage/add_incoming_webhook.jsx @@ -4,14 +4,13 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; -import {browserHistory} from 'react-router'; import * as Utils from 'utils/utils.jsx'; import BackstageHeader from './backstage_header.jsx'; import ChannelSelect from 'components/channel_select.jsx'; import {FormattedMessage} from 'react-intl'; import FormError from 'components/form_error.jsx'; -import {Link} from 'react-router'; +import {browserHistory, Link} from 'react-router'; import SpinnerButton from 'components/spinner_button.jsx'; export default class AddIncomingWebhook extends React.Component { diff --git a/webapp/components/backstage/add_outgoing_webhook.jsx b/webapp/components/backstage/add_outgoing_webhook.jsx index 245df1604..5f07217ab 100644 --- a/webapp/components/backstage/add_outgoing_webhook.jsx +++ b/webapp/components/backstage/add_outgoing_webhook.jsx @@ -4,14 +4,13 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; -import {browserHistory} from 'react-router'; import * as Utils from 'utils/utils.jsx'; import BackstageHeader from './backstage_header.jsx'; import ChannelSelect from 'components/channel_select.jsx'; import {FormattedMessage} from 'react-intl'; import FormError from 'components/form_error.jsx'; -import {Link} from 'react-router'; +import {browserHistory, Link} from 'react-router'; import SpinnerButton from 'components/spinner_button.jsx'; export default class AddOutgoingWebhook extends React.Component { diff --git a/webapp/components/channel_header.jsx b/webapp/components/channel_header.jsx index 65d5a282a..922f8b21c 100644 --- a/webapp/components/channel_header.jsx +++ b/webapp/components/channel_header.jsx @@ -478,11 +478,11 @@ export default class ChannelHeader extends React.Component { overlay={popoverContent} ref='headerOverlay' > - <div - onClick={TextFormatting.handleClick} - className='description' - dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false})}} - /> + <div + onClick={TextFormatting.handleClick} + className='description' + dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false})}} + /> </OverlayTrigger> </div> </th> diff --git a/webapp/components/channel_notifications_modal.jsx b/webapp/components/channel_notifications_modal.jsx index 112c07ad0..6d2b4c284 100644 --- a/webapp/components/channel_notifications_modal.jsx +++ b/webapp/components/channel_notifications_modal.jsx @@ -289,10 +289,10 @@ export default class ChannelNotificationsModal extends React.Component { checked={this.state.unreadLevel === 'all'} onChange={this.handleUpdateMarkUnreadLevel.bind(this, 'all')} /> - <FormattedMessage - id='channel_notifications.allUnread' - defaultMessage='For all unread messages' - /> + <FormattedMessage + id='channel_notifications.allUnread' + defaultMessage='For all unread messages' + /> </label> <br/> </div> diff --git a/webapp/components/create_comment.jsx b/webapp/components/create_comment.jsx index 42e5dd336..c25be8716 100644 --- a/webapp/components/create_comment.jsx +++ b/webapp/components/create_comment.jsx @@ -112,7 +112,7 @@ class CreateComment extends React.Component { return; } - let post = {}; + const post = {}; post.filenames = []; post.message = this.state.messageText; @@ -145,7 +145,7 @@ class CreateComment extends React.Component { AsyncClient.getPosts(this.props.channelId); const channel = ChannelStore.get(this.props.channelId); - let member = ChannelStore.getMember(this.props.channelId); + const member = ChannelStore.getMember(this.props.channelId); member.msg_count = channel.total_msg_count; member.last_viewed_at = Date.now(); ChannelStore.setChannelMember(member); @@ -192,7 +192,7 @@ class CreateComment extends React.Component { GlobalActions.emitLocalUserTypingEvent(this.props.channelId, this.props.rootId); } handleUserInput(messageText) { - let draft = PostStore.getCommentDraft(this.props.rootId); + const draft = PostStore.getCommentDraft(this.props.rootId); draft.message = messageText; PostStore.storeCommentDraft(this.props.rootId, draft); @@ -240,7 +240,7 @@ class CreateComment extends React.Component { this.focusTextbox(); } handleUploadStart(clientIds) { - let draft = PostStore.getCommentDraft(this.props.rootId); + const draft = PostStore.getCommentDraft(this.props.rootId); draft.uploadsInProgress = draft.uploadsInProgress.concat(clientIds); PostStore.storeCommentDraft(this.props.rootId, draft); @@ -252,7 +252,7 @@ class CreateComment extends React.Component { this.focusTextbox(); } handleFileUploadComplete(filenames, clientIds) { - let draft = PostStore.getCommentDraft(this.props.rootId); + const draft = PostStore.getCommentDraft(this.props.rootId); // remove each finished file from uploads for (let i = 0; i < clientIds.length; i++) { @@ -272,7 +272,7 @@ class CreateComment extends React.Component { if (clientId === -1) { this.setState({serverError: err}); } else { - let draft = PostStore.getCommentDraft(this.props.rootId); + const draft = PostStore.getCommentDraft(this.props.rootId); const index = draft.uploadsInProgress.indexOf(clientId); if (index !== -1) { @@ -285,8 +285,8 @@ class CreateComment extends React.Component { } } removePreview(id) { - let previews = this.state.previews; - let uploadsInProgress = this.state.uploadsInProgress; + const previews = this.state.previews; + const uploadsInProgress = this.state.uploadsInProgress; // id can either be the path of an uploaded file or the client id of an in progress upload let index = previews.indexOf(id); @@ -301,7 +301,7 @@ class CreateComment extends React.Component { previews.splice(index, 1); } - let draft = PostStore.getCommentDraft(this.props.rootId); + const draft = PostStore.getCommentDraft(this.props.rootId); draft.previews = previews; draft.uploadsInProgress = uploadsInProgress; PostStore.storeCommentDraft(this.props.rootId, draft); diff --git a/webapp/components/error_bar.jsx b/webapp/components/error_bar.jsx index d28be671d..a3ed337f1 100644 --- a/webapp/components/error_bar.jsx +++ b/webapp/components/error_bar.jsx @@ -81,7 +81,7 @@ export default class ErrorBar extends React.Component { className='error-bar__close' onClick={this.handleClose} > - × + {'×'} </a> </div> ); diff --git a/webapp/components/file_attachment.jsx b/webapp/components/file_attachment.jsx index 4a040a35b..c909b9afb 100644 --- a/webapp/components/file_attachment.jsx +++ b/webapp/components/file_attachment.jsx @@ -149,12 +149,12 @@ class FileAttachment extends React.Component { if (this.state.fileSize < 0) { Client.getFileInfo( filename, - function success(data) { + (data) => { if (this.canSetState) { this.setState({fileSize: parseInt(data.size, 10)}); } - }.bind(this), - function error() { + }, + () => { // Do nothing } ); @@ -175,7 +175,8 @@ class FileAttachment extends React.Component { className='post-image__column' key={filename} > - <a className='post-image__thumbnail' + <a + className='post-image__thumbnail' href='#' onClick={() => this.props.handleImageClick(this.props.index)} > @@ -186,9 +187,10 @@ class FileAttachment extends React.Component { href={fileUrl} download={filenameString} data-toggle='tooltip' - title={this.props.intl.formatMessage(holders.download) + ' \"' + filenameString + '\"'} + title={this.props.intl.formatMessage(holders.download) + ' "' + filenameString + '"'} className='post-image__name' target='_blank' + rel='noopener noreferrer' > {trimmedFilename} </a> @@ -198,6 +200,7 @@ class FileAttachment extends React.Component { download={filenameString} className='post-image__download' target='_blank' + rel='noopener noreferrer' > <span className='fa fa-download' diff --git a/webapp/components/file_info_preview.jsx b/webapp/components/file_info_preview.jsx index d5dcd75eb..fe4e76f91 100644 --- a/webapp/components/file_info_preview.jsx +++ b/webapp/components/file_info_preview.jsx @@ -38,6 +38,7 @@ export default function FileInfoPreview({filename, fileUrl, fileInfo, formatMess className={'file-details__preview'} to={fileUrl} target='_blank' + rel='noopener noreferrer' > <span className='file-details__preview-helper'/> <img src={Utils.getPreviewImagePath(filename)}/> diff --git a/webapp/components/header_footer_template.jsx b/webapp/components/header_footer_template.jsx index 71716c4fb..d153a5719 100644 --- a/webapp/components/header_footer_template.jsx +++ b/webapp/components/header_footer_template.jsx @@ -33,8 +33,8 @@ export default class NotLoggedIn extends React.Component { id='help_link' className='pull-right footer-link' target='_blank' + rel='noopener noreferrer' href={global.window.mm_config.HelpLink} - rel='noreferrer' > <FormattedMessage id='web.footer.help'/> </a> @@ -42,8 +42,8 @@ export default class NotLoggedIn extends React.Component { id='terms_link' className='pull-right footer-link' target='_blank' + rel='noopener noreferrer' href={global.window.mm_config.TermsOfServiceLink} - rel='noreferrer' > <FormattedMessage id='web.footer.terms'/> </a> @@ -51,8 +51,8 @@ export default class NotLoggedIn extends React.Component { id='privacy_link' className='pull-right footer-link' target='_blank' + rel='noopener noreferrer' href={global.window.mm_config.PrivacyPolicyLink} - rel='noreferrer' > <FormattedMessage id='web.footer.privacy'/> </a> @@ -60,8 +60,8 @@ export default class NotLoggedIn extends React.Component { id='about_link' className='pull-right footer-link' target='_blank' + rel='noopener noreferrer' href={global.window.mm_config.AboutLink} - rel='noreferrer' > <FormattedMessage id='web.footer.about'/> </a> diff --git a/webapp/components/invite_member_modal.jsx b/webapp/components/invite_member_modal.jsx index 4ac620f08..205988dc8 100644 --- a/webapp/components/invite_member_modal.jsx +++ b/webapp/components/invite_member_modal.jsx @@ -258,15 +258,17 @@ class InviteMemberModal extends React.Component { var removeButton = null; if (index) { - removeButton = (<div> - <button - type='button' - className='btn btn-link remove__member' - onClick={this.removeInviteFields.bind(this, index)} - > - <span className='fa fa-trash'></span> - </button> - </div>); + removeButton = ( + <div> + <button + type='button' + className='btn btn-link remove__member' + onClick={this.removeInviteFields.bind(this, index)} + > + <span className='fa fa-trash'></span> + </button> + </div> + ); } var emailClass = 'form-group invite'; if (emailError) { @@ -283,54 +285,56 @@ class InviteMemberModal extends React.Component { if (lastNameError) { lastNameClass += ' has-error'; } - nameFields = (<div className='row--invite'> - <div className='col-sm-6'> - <div className={firstNameClass}> - <input - type='text' - className='form-control' - ref={'first_name' + index} - placeholder={formatMessage(holders.firstname)} - maxLength='64' - disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} - spellCheck='false' - /> - {firstNameError} - </div> - </div> - <div className='col-sm-6'> - <div className={lastNameClass}> - <input - type='text' - className='form-control' - ref={'last_name' + index} - placeholder={formatMessage(holders.lastname)} - maxLength='64' - disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} - spellCheck='false' - /> - {lastNameError} - </div> - </div> - </div>); + nameFields = ( + <div className='row--invite'> + <div className='col-sm-6'> + <div className={firstNameClass}> + <input + type='text' + className='form-control' + ref={'first_name' + index} + placeholder={formatMessage(holders.firstname)} + maxLength='64' + disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} + spellCheck='false' + /> + {firstNameError} + </div> + </div> + <div className='col-sm-6'> + <div className={lastNameClass}> + <input + type='text' + className='form-control' + ref={'last_name' + index} + placeholder={formatMessage(holders.lastname)} + maxLength='64' + disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} + spellCheck='false' + /> + {lastNameError} + </div> + </div> + </div> + ); inviteSections[index] = ( <div key={'key' + index}> - {removeButton} - <div className={emailClass}> - <input - onKeyUp={this.displayNameKeyUp} - type='text' - ref={'email' + index} - className='form-control' - placeholder='email@domain.com' - maxLength='64' - disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} - spellCheck='false' - /> - {emailError} - </div> - {nameFields} + {removeButton} + <div className={emailClass}> + <input + onKeyUp={this.displayNameKeyUp} + type='text' + ref={'email' + index} + className='form-control' + placeholder='email@domain.com' + maxLength='64' + disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} + spellCheck='false' + /> + {emailError} + </div> + {nameFields} </div> ); } diff --git a/webapp/components/navbar_dropdown.jsx b/webapp/components/navbar_dropdown.jsx index 32ac8f430..162841f32 100644 --- a/webapp/components/navbar_dropdown.jsx +++ b/webapp/components/navbar_dropdown.jsx @@ -235,8 +235,8 @@ export default class NavbarDropdown extends React.Component { <li> <Link target='_blank' + rel='noopener noreferrer' to={global.window.mm_config.HelpLink} - rel='noreferrer' > <FormattedMessage id='navbar_dropdown.help' @@ -253,8 +253,8 @@ export default class NavbarDropdown extends React.Component { <li> <Link target='_blank' + rel='noopener noreferrer' to={global.window.mm_config.ReportAProblemLink} - rel='noreferrer' > <FormattedMessage id='navbar_dropdown.report' diff --git a/webapp/components/post_attachment.jsx b/webapp/components/post_attachment.jsx index 1c3df6ea2..8b5ff91f2 100644 --- a/webapp/components/post_attachment.jsx +++ b/webapp/components/post_attachment.jsx @@ -59,7 +59,7 @@ class PostAttachment extends React.Component { toggleCollapseState(e) { e.preventDefault(); - let state = this.state; + const state = this.state; state.text = state.collapsed ? state.uncollapsedText : state.collapsedText; state.collapsed = !state.collapsed; this.setState(state); @@ -142,22 +142,22 @@ class PostAttachment extends React.Component { }); if (headerCols.length > 0) { // Flush last fields fieldTables.push( - <table - className='attachment___fields' - key={'attachment__table__' + nrTables} - > - <thead> - <tr> + <table + className='attachment___fields' + key={'attachment__table__' + nrTables} + > + <thead> + <tr> {headerCols} - </tr> - </thead> - <tbody> - <tr> - {bodyCols} - </tr> - </tbody> - </table> - ); + </tr> + </thead> + <tbody> + <tr> + {bodyCols} + </tr> + </tbody> + </table> + ); } return ( <div> @@ -209,6 +209,7 @@ class PostAttachment extends React.Component { <a href={data.author_link} target='_blank' + rel='noopener noreferrer' > {author} </a> @@ -226,6 +227,7 @@ class PostAttachment extends React.Component { className='attachment__title-link' href={data.title_link} target='_blank' + rel='noopener noreferrer' > {data.title} </a> diff --git a/webapp/components/post_attachment_oembed.jsx b/webapp/components/post_attachment_oembed.jsx index a4e4ce001..359c7cc35 100644 --- a/webapp/components/post_attachment_oembed.jsx +++ b/webapp/components/post_attachment_oembed.jsx @@ -72,30 +72,31 @@ export default class PostAttachmentOEmbed extends React.Component { className='attachment attachment--oembed' ref='attachment' > - <div className='attachment__content'> - <div - className={'clearfix attachment__container'} + <div className='attachment__content'> + <div + className={'clearfix attachment__container'} + > + <h1 + className='attachment__title' > - <h1 - className='attachment__title' + <a + className='attachment__title-link' + href={data.url} + target='_blank' + rel='noopener noreferrer' > - <a - className='attachment__title-link' - href={data.url} - target='_blank' - > - {data.title} - </a> - </h1> - <div > - <div - className={'attachment__body attachment__body--no_thumb'} - > - {content} - </div> + {data.title} + </a> + </h1> + <div > + <div + className={'attachment__body attachment__body--no_thumb'} + > + {content} </div> </div> </div> + </div> </div> ); } diff --git a/webapp/components/post_body_additional_content.jsx b/webapp/components/post_body_additional_content.jsx index 452597dde..cdb735b47 100644 --- a/webapp/components/post_body_additional_content.jsx +++ b/webapp/components/post_body_additional_content.jsx @@ -120,7 +120,8 @@ export default class PostBodyAdditionalContent extends React.Component { let toggle; if (Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMBED_TOGGLE)) { toggle = ( - <a className='post__embed-visibility' + <a + className='post__embed-visibility' data-expanded={this.state.embedVisible} aria-label='Toggle Embed Visibility' onClick={this.toggleEmbedVisibility} @@ -131,7 +132,8 @@ export default class PostBodyAdditionalContent extends React.Component { return ( <div> {toggle} - <div className='post__embed-container' + <div + className='post__embed-container' hidden={!this.state.embedVisible} > {generateEmbed} diff --git a/webapp/components/removed_from_channel_modal.jsx b/webapp/components/removed_from_channel_modal.jsx index d037c089d..2199dbbec 100644 --- a/webapp/components/removed_from_channel_modal.jsx +++ b/webapp/components/removed_from_channel_modal.jsx @@ -98,7 +98,11 @@ export default class RemovedFromChannelModal extends React.Component { className='close' data-dismiss='modal' aria-label='Close' - ><span aria-hidden='true'>×</span></button> + > + <span aria-hidden='true'> + {'×'} + </span> + </button> <h4 className='modal-title'> <FormattedMessage id='removed_channel.from' @@ -107,16 +111,16 @@ export default class RemovedFromChannelModal extends React.Component { <span className='name'>{channelName}</span></h4> </div> <div className='modal-body'> - <p> - <FormattedMessage - id='removed_channel.remover' - defaultMessage='{remover} removed you from {channel}' - values={{ - remover: (remover), - channel: (channelName) - }} - /> - </p> + <p> + <FormattedMessage + id='removed_channel.remover' + defaultMessage='{remover} removed you from {channel}' + values={{ + remover: (remover), + channel: (channelName) + }} + /> + </p> </div> <div className='modal-footer'> <button diff --git a/webapp/components/settings_sidebar.jsx b/webapp/components/settings_sidebar.jsx index d55eb5366..dc59409a0 100644 --- a/webapp/components/settings_sidebar.jsx +++ b/webapp/components/settings_sidebar.jsx @@ -23,7 +23,7 @@ export default class SettingsSidebar extends React.Component { } } render() { - let tabList = this.props.tabs.map(function makeTab(tab) { + let tabList = this.props.tabs.map((tab) => { let key = `${tab.name}_li`; let className = ''; if (this.props.activeTab === tab.name) { @@ -44,7 +44,7 @@ export default class SettingsSidebar extends React.Component { </a> </li> ); - }.bind(this)); + }); return ( <div> diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 3bfe47393..8325478f3 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -640,13 +640,13 @@ export default class Sidebar extends React.Component { placement='top' overlay={createChannelTootlip} > - <a - className='add-channel-btn' - href='#' - onClick={this.showNewChannelModal.bind(this, 'O')} - > - {'+'} - </a> + <a + className='add-channel-btn' + href='#' + onClick={this.showNewChannelModal.bind(this, 'O')} + > + {'+'} + </a> </OverlayTrigger> </h4> </li> @@ -677,13 +677,13 @@ export default class Sidebar extends React.Component { placement='top' overlay={createGroupTootlip} > - <a - className='add-channel-btn' - href='#' - onClick={this.showNewChannelModal.bind(this, 'P')} - > - {'+'} - </a> + <a + className='add-channel-btn' + href='#' + onClick={this.showNewChannelModal.bind(this, 'P')} + > + {'+'} + </a> </OverlayTrigger> </h4> </li> diff --git a/webapp/components/sidebar_header.jsx b/webapp/components/sidebar_header.jsx index 143a3458a..76d9cf214 100644 --- a/webapp/components/sidebar_header.jsx +++ b/webapp/components/sidebar_header.jsx @@ -89,7 +89,7 @@ export default class SidebarHeader extends React.Component { overlay={<Tooltip id='team-name__tooltip'>{this.props.teamDisplayName}</Tooltip>} ref='descriptionOverlay' > - <div className='team__name'>{this.props.teamDisplayName}</div> + <div className='team__name'>{this.props.teamDisplayName}</div> </OverlayTrigger> </div> </a> diff --git a/webapp/components/sidebar_right_menu.jsx b/webapp/components/sidebar_right_menu.jsx index b36d84b79..218a3b164 100644 --- a/webapp/components/sidebar_right_menu.jsx +++ b/webapp/components/sidebar_right_menu.jsx @@ -174,8 +174,8 @@ export default class SidebarRightMenu extends React.Component { <li> <Link target='_blank' + rel='noopener noreferrer' to={global.window.mm_config.HelpLink} - rel='noreferrer' > <i className='fa fa-question'></i> <FormattedMessage @@ -193,8 +193,8 @@ export default class SidebarRightMenu extends React.Component { <li> <Link target='_blank' + rel='noopener noreferrer' to={global.window.mm_config.ReportAProblemLink} - rel='noreferrer' > <i className='fa fa-phone'></i> <FormattedMessage diff --git a/webapp/components/signup_user_complete.jsx b/webapp/components/signup_user_complete.jsx index 5c06cefed..b7d5e5156 100644 --- a/webapp/components/signup_user_complete.jsx +++ b/webapp/components/signup_user_complete.jsx @@ -198,6 +198,33 @@ export default class SignupUserComplete extends React.Component { ); } + handleUserCreated(user, data) { + Client.track('signup', 'signup_user_02_complete'); + Client.loginById( + data.id, + user.password, + '', + () => { + if (this.state.hash > 0) { + BrowserStore.setGlobalItem(this.state.hash, JSON.stringify({usedBefore: true})); + } + + GlobalActions.emitInitialLoad( + () => { + browserHistory.push('/select_team'); + } + ); + }, + (err) => { + if (err.id === 'api.user.login.not_verified.app_error') { + browserHistory.push('/should_verify_email?email=' + encodeURIComponent(user.email) + '&teamname=' + encodeURIComponent(this.state.teamName)); + } else { + this.setState({serverError: err.message}); + } + } + ); + } + handleSubmit(e) { e.preventDefault(); @@ -296,32 +323,7 @@ export default class SignupUserComplete extends React.Component { this.state.data, this.state.hash, this.state.inviteId, - (data) => { - Client.track('signup', 'signup_user_02_complete'); - Client.loginById( - data.id, - user.password, - '', - () => { - if (this.state.hash > 0) { - BrowserStore.setGlobalItem(this.state.hash, JSON.stringify({usedBefore: true})); - } - - GlobalActions.emitInitialLoad( - () => { - browserHistory.push('/select_team'); - } - ); - }, - (err) => { - if (err.id === 'api.user.login.not_verified.app_error') { - browserHistory.push('/should_verify_email?email=' + encodeURIComponent(user.email) + '&teamname=' + encodeURIComponent(this.state.teamName)); - } else { - this.setState({serverError: err.message}); - } - } - ); - }, + this.handleUserCreated.bind(this, user), (err) => { this.setState({serverError: err.message}); } diff --git a/webapp/components/team_general_tab.jsx b/webapp/components/team_general_tab.jsx index 1f783fe9f..9242fc03d 100644 --- a/webapp/components/team_general_tab.jsx +++ b/webapp/components/team_general_tab.jsx @@ -473,7 +473,9 @@ class GeneralTab extends React.Component { data-dismiss='modal' aria-label='Close' > - <span aria-hidden='true'>×</span> + <span aria-hidden='true'> + {'×'} + </span> </button> <h4 className='modal-title' @@ -518,4 +520,4 @@ GeneralTab.propTypes = { activeSection: React.PropTypes.string.isRequired }; -export default injectIntl(GeneralTab);
\ No newline at end of file +export default injectIntl(GeneralTab); diff --git a/webapp/components/team_import_tab.jsx b/webapp/components/team_import_tab.jsx index 782273c5a..f724a789a 100644 --- a/webapp/components/team_import_tab.jsx +++ b/webapp/components/team_import_tab.jsx @@ -123,7 +123,8 @@ class TeamImportTab extends React.Component { return ( <div> <div className='modal-header'> - <button type='button' + <button + type='button' className='close' data-dismiss='modal' aria-label='Close' diff --git a/webapp/components/team_settings_modal.jsx b/webapp/components/team_settings_modal.jsx index 657643367..fedf34ab5 100644 --- a/webapp/components/team_settings_modal.jsx +++ b/webapp/components/team_settings_modal.jsx @@ -92,7 +92,9 @@ class TeamSettingsModal extends React.Component { data-dismiss='modal' aria-label='Close' > - <span aria-hidden='true'>×</span> + <span aria-hidden='true'> + {'×'} + </span> </button> <h4 className='modal-title' @@ -133,4 +135,4 @@ TeamSettingsModal.propTypes = { intl: intlShape.isRequired }; -export default injectIntl(TeamSettingsModal);
\ No newline at end of file +export default injectIntl(TeamSettingsModal); diff --git a/webapp/components/textbox.jsx b/webapp/components/textbox.jsx index 4aa88d267..7f5ecea09 100644 --- a/webapp/components/textbox.jsx +++ b/webapp/components/textbox.jsx @@ -211,6 +211,7 @@ export default class Textbox extends React.Component { {previewLink} <a target='_blank' + rel='noopener noreferrer' href='http://docs.mattermost.com/help/getting-started/messaging-basics.html' className='textbox-help-link' > diff --git a/webapp/components/toggle_modal_button.jsx b/webapp/components/toggle_modal_button.jsx index 69bdbbda0..6082901de 100644 --- a/webapp/components/toggle_modal_button.jsx +++ b/webapp/components/toggle_modal_button.jsx @@ -25,7 +25,7 @@ export default class ModalToggleButton extends React.Component { } render() { - const {children, dialogType, dialogProps, onClick, ...props} = this.props; // eslint-disable-line no-use-before-define + const {children, dialogType, dialogProps, onClick, ...props} = this.props; // allow callers to provide an onClick which will be called before the modal is shown let clickHandler = this.show; @@ -38,7 +38,7 @@ export default class ModalToggleButton extends React.Component { } // this assumes that all modals will have a show property and an onHide event - const dialog = React.createElement(this.props.dialogType, Object.assign({}, dialogProps, { + const dialog = React.createElement(dialogType, Object.assign({}, dialogProps, { show: this.state.show, onHide: () => { this.hide(); diff --git a/webapp/components/tutorial/tutorial_intro_screens.jsx b/webapp/components/tutorial/tutorial_intro_screens.jsx index 95c26edca..a4928f9cb 100644 --- a/webapp/components/tutorial/tutorial_intro_screens.jsx +++ b/webapp/components/tutorial/tutorial_intro_screens.jsx @@ -149,6 +149,7 @@ export default class TutorialIntroScreens extends React.Component { <a href={'mailto:' + global.window.mm_config.SupportEmail} target='_blank' + rel='noopener noreferrer' > {global.window.mm_config.SupportEmail} </a> diff --git a/webapp/components/user_settings/custom_theme_chooser.jsx b/webapp/components/user_settings/custom_theme_chooser.jsx index 9fbdd1251..e77ea1d30 100644 --- a/webapp/components/user_settings/custom_theme_chooser.jsx +++ b/webapp/components/user_settings/custom_theme_chooser.jsx @@ -230,11 +230,11 @@ class CustomThemeChooser extends React.Component { overlay={popoverContent} ref='headerOverlay' > - <span className='input-group-addon'> - <img - src={codeThemeURL} - /> - </span> + <span className='input-group-addon'> + <img + src={codeThemeURL} + /> + </span> </OverlayTrigger> </div> </div> diff --git a/webapp/components/user_settings/import_theme_modal.jsx b/webapp/components/user_settings/import_theme_modal.jsx index 32da296bf..f743feee6 100644 --- a/webapp/components/user_settings/import_theme_modal.jsx +++ b/webapp/components/user_settings/import_theme_modal.jsx @@ -81,7 +81,7 @@ class ImportThemeModal extends React.Component { theme.mentionHighlightLink = '#2f81b7'; theme.codeTheme = 'github'; - let user = UserStore.getCurrentUser(); + const user = UserStore.getCurrentUser(); user.theme_props = theme; Client.updateUser(user, diff --git a/webapp/components/user_settings/premade_theme_chooser.jsx b/webapp/components/user_settings/premade_theme_chooser.jsx index 4b0faf865..9552c686d 100644 --- a/webapp/components/user_settings/premade_theme_chooser.jsx +++ b/webapp/components/user_settings/premade_theme_chooser.jsx @@ -59,6 +59,7 @@ export default class PremadeThemeChooser extends React.Component { <a href='http://docs.mattermost.com/help/settings/theme-colors.html#custom-theme-examples' target='_blank' + rel='noopener noreferrer' > <FormattedMessage id='user.settings.display.theme.otherThemes' diff --git a/webapp/components/user_settings/user_settings_notifications.jsx b/webapp/components/user_settings/user_settings_notifications.jsx index fa84ce2d6..6a3f598e2 100644 --- a/webapp/components/user_settings/user_settings_notifications.jsx +++ b/webapp/components/user_settings/user_settings_notifications.jsx @@ -150,13 +150,13 @@ class NotificationsTab extends React.Component { data.channel = this.state.channelKey.toString(); Client.updateUserNotifyProps(data, - function success() { + () => { this.props.updateSection(''); AsyncClient.getMe(); - }.bind(this), - function failure(err) { + }, + (err) => { this.setState({serverError: err.message}); - }.bind(this) + } ); } handleCancel(e) { @@ -254,7 +254,8 @@ class NotificationsTab extends React.Component { <div key='userNotificationLevelOption'> <div className='radio'> <label> - <input type='radio' + <input + type='radio' checked={notifyActive[0]} onChange={this.handleNotifyRadio.bind(this, 'all')} /> @@ -393,8 +394,8 @@ class NotificationsTab extends React.Component { /> </label> <br/> - </div> - </div> + </div> + </div> ); const extraInfo = ( diff --git a/webapp/components/user_settings/user_settings_security.jsx b/webapp/components/user_settings/user_settings_security.jsx index 700aa295a..433d08d5c 100644 --- a/webapp/components/user_settings/user_settings_security.jsx +++ b/webapp/components/user_settings/user_settings_security.jsx @@ -608,11 +608,11 @@ class SecurityTab extends React.Component { const inputs = []; inputs.push( <div key='userSignInOption'> - {emailOption} - {gitlabOption} - <br/> - {ldapOption} - {googleOption} + {emailOption} + {gitlabOption} + <br/> + {ldapOption} + {googleOption} </div> ); diff --git a/webapp/components/user_settings/user_settings_theme.jsx b/webapp/components/user_settings/user_settings_theme.jsx index f19538f71..389fde004 100644 --- a/webapp/components/user_settings/user_settings_theme.jsx +++ b/webapp/components/user_settings/user_settings_theme.jsx @@ -212,7 +212,8 @@ export default class ThemeSetting extends React.Component { key='premadeThemeColorLabel' > <label> - <input type='radio' + <input + type='radio' checked={!displayCustom} onChange={this.updateType.bind(this, 'premade')} /> @@ -233,7 +234,8 @@ export default class ThemeSetting extends React.Component { key='customThemeColorLabel' > <label> - <input type='radio' + <input + type='radio' checked={displayCustom} onChange={this.updateType.bind(this, 'custom')} /> diff --git a/webapp/components/view_image.jsx b/webapp/components/view_image.jsx index c4d7cb4aa..f70a57cb8 100644 --- a/webapp/components/view_image.jsx +++ b/webapp/components/view_image.jsx @@ -404,6 +404,7 @@ function ImagePreview({filename, fileUrl, fileInfo, maxHeight}) { <a href={fileUrl} target='_blank' + rel='noopener noreferrer' download={true} > <img diff --git a/webapp/components/view_image_popover_bar.jsx b/webapp/components/view_image_popover_bar.jsx index 5b9b2362f..3554ae3f8 100644 --- a/webapp/components/view_image_popover_bar.jsx +++ b/webapp/components/view_image_popover_bar.jsx @@ -54,6 +54,7 @@ export default class ViewImagePopoverBar extends React.Component { download={this.props.filename} className='text' target='_blank' + rel='noopener noreferrer' > <FormattedMessage id='view_image_popover.download' diff --git a/webapp/components/youtube_video.jsx b/webapp/components/youtube_video.jsx index 6083fd8a1..f96504e88 100644 --- a/webapp/components/youtube_video.jsx +++ b/webapp/components/youtube_video.jsx @@ -4,7 +4,7 @@ import $ from 'jquery'; import ChannelStore from 'stores/channel_store.jsx'; -const ytRegex = /(?:http|https):\/\/(?:www\.)?(?:(?:youtube\.com\/(?:(?:v\/)|(\/u\/\w\/)|(?:(?:watch|embed\/watch)(?:\/|.*v=))|(?:embed\/)|(?:user\/[^\/]+\/u\/[0-9]\/)))|(?:youtu\.be\/))([^#\&\?]*)/; +const ytRegex = /(?:http|https):\/\/(?:www\.)?(?:(?:youtube\.com\/(?:(?:v\/)|(\/u\/\w\/)|(?:(?:watch|embed\/watch)(?:\/|.*v=))|(?:embed\/)|(?:user\/[^\/]+\/u\/[0-9]\/)))|(?:youtu\.be\/))([^#&\?]*)/; import React from 'react'; import {Link} from 'react-router'; diff --git a/webapp/package.json b/webapp/package.json index 9c0377cdd..81f868baa 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -5,52 +5,52 @@ "dependencies": { "autolinker": "mattermost/Autolinker.js#9689831109e104d7b545318e54199e6de8fd9b87", "bootstrap": "3.3.6", - "bootstrap-colorpicker": "2.3.0", - "chart.js": "1.0.2", + "bootstrap-colorpicker": "2.3.3", + "chart.js": "2.1.2", "compass-mixins": "0.12.7", "fastclick": "1.0.6", "flux": "2.1.1", - "font-awesome": "4.5.0", - "highlight.js": "9.2.0", + "font-awesome": "4.6.1", + "highlight.js": "9.3.0", "intl": "1.1.0", "jasny-bootstrap": "3.1.3", - "jquery": "2.2.1", + "jquery": "2.2.3", "keymirror": "0.1.1", "marked": "mattermost/marked#cb85e5cc81bc7937dbb73c3c53d9532b1b97e3ca", "match-at": "0.1.0", - "object-assign": "4.0.1", - "perfect-scrollbar": "0.6.10", - "react": "0.14.7", - "react-addons-pure-render-mixin": "0.14.7", - "react-bootstrap": "0.28.3", + "object-assign": "4.1.0", + "perfect-scrollbar": "0.6.11", + "react": "15.0.2", + "react-addons-pure-render-mixin": "15.0.2", + "react-bootstrap": "0.29.3", "react-custom-scrollbars": "4.0.0-beta.1", - "react-dom": "0.14.7", + "react-dom": "15.0.2", "react-intl": "2.0.0-rc-1", - "react-router": "2.0.1", - "react-textarea-autosize": "3.3.0", + "react-router": "2.4.0", + "react-textarea-autosize": "4.0.1", "superagent": "1.8.3", "twemoji": "2.0.5", "velocity-animate": "1.2.3" }, "devDependencies": { - "babel-eslint": "5.0.0", + "babel-eslint": "6.0.4", "babel-loader": "6.2.4", - "babel-plugin-transform-runtime": "6.6.0", - "babel-polyfill": "6.7.2", - "babel-preset-es2015-webpack": "6.4.0", + "babel-plugin-transform-runtime": "6.8.0", + "babel-polyfill": "6.8.0", + "babel-preset-es2015-webpack": "6.4.1", "babel-preset-react": "6.5.0", "babel-preset-stage-0": "6.5.0", - "copy-webpack-plugin": "1.1.1", + "copy-webpack-plugin": "2.1.3", "css-loader": "0.23.1", - "eslint": "2.2.0", - "eslint-plugin-react": "4.0.0", + "eslint": "2.9.0", + "eslint-plugin-react": "5.1.1", "exports-loader": "0.6.3", "extract-text-webpack-plugin": "1.0.1", "file-loader": "0.8.5", "html-loader": "0.4.3", "imports-loader": "0.6.5", "jquery-deferred": "0.3.0", - "jsdom": "8.5.0", + "jsdom": "9.0.0", "jsdom-global": "1.7.0", "json-loader": "0.5.4", "mocha": "2.4.5", @@ -58,11 +58,11 @@ "mocha-webpack": "0.3.0", "node-sass": "3.4.2", "raw-loader": "0.5.1", - "react-addons-test-utils": "0.14.7", + "react-addons-test-utils": "15.0.2", "sass-loader": "3.2.0", - "style-loader": "0.13.0", + "style-loader": "0.13.1", "url-loader": "0.5.7", - "webpack": "2.1.0-beta.5", + "webpack": "2.1.0-beta.7", "webpack-node-externals": "1.2.0" }, "scripts": { diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index 32ea8441c..b34e92530 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -290,7 +290,7 @@ class ChannelStoreClass extends EventEmitter { } leaveChannel(id) { - delete this.channelMembers[id]; + Reflect.deleteProperty(this.channelMembers, id); const element = this.channels.indexOf(id); if (element > -1) { this.channels.splice(element, 1); diff --git a/webapp/tests/.eslintrc.json b/webapp/tests/.eslintrc.json new file mode 100644 index 000000000..c2d57abea --- /dev/null +++ b/webapp/tests/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "rules": { + "no-console": 0, + "global-require": 0, + "func-names": 0, + "prefer-arrow-callback": 0, + "no-magic-numbers": 0, + "no-unreachable": 0, + "new-cap": 0, + "max-nested-callbacks": 0 + } +} diff --git a/webapp/tests/client_channel.test.jsx b/webapp/tests/client_channel.test.jsx index 9d88f3de0..6b66173a5 100644 --- a/webapp/tests/client_channel.test.jsx +++ b/webapp/tests/client_channel.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_command.test.jsx b/webapp/tests/client_command.test.jsx index f7f0d2b25..769fa2fa0 100644 --- a/webapp/tests/client_command.test.jsx +++ b/webapp/tests/client_command.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_general.test.jsx b/webapp/tests/client_general.test.jsx index 870c11257..d18927445 100644 --- a/webapp/tests/client_general.test.jsx +++ b/webapp/tests/client_general.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - var assert = require('assert'); import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_hooks.test.jsx b/webapp/tests/client_hooks.test.jsx index 0cad22153..8d09802a9 100644 --- a/webapp/tests/client_hooks.test.jsx +++ b/webapp/tests/client_hooks.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_oauth.test.jsx b/webapp/tests/client_oauth.test.jsx index df2fc665b..a9a6bd919 100644 --- a/webapp/tests/client_oauth.test.jsx +++ b/webapp/tests/client_oauth.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_post.test.jsx b/webapp/tests/client_post.test.jsx index c8e6fad0f..3c6f05c9f 100644 --- a/webapp/tests/client_post.test.jsx +++ b/webapp/tests/client_post.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_preferences.test.jsx b/webapp/tests/client_preferences.test.jsx index 987728704..95b026bfc 100644 --- a/webapp/tests/client_preferences.test.jsx +++ b/webapp/tests/client_preferences.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_team.test.jsx b/webapp/tests/client_team.test.jsx index e8b71d2f8..3179e9f69 100644 --- a/webapp/tests/client_team.test.jsx +++ b/webapp/tests/client_team.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/client_user.test.jsx b/webapp/tests/client_user.test.jsx index 621be6c6a..9dc875e9d 100644 --- a/webapp/tests/client_user.test.jsx +++ b/webapp/tests/client_user.test.jsx @@ -1,13 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ - import assert from 'assert'; import TestHelper from './test_helper.jsx'; diff --git a/webapp/tests/spinner_button.test.jsx b/webapp/tests/spinner_button.test.jsx index 0e282e0ee..68488b61d 100644 --- a/webapp/tests/spinner_button.test.jsx +++ b/webapp/tests/spinner_button.test.jsx @@ -1,9 +1,3 @@ -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ var jsdom = require('mocha-jsdom'); var assert = require('assert'); @@ -21,4 +15,4 @@ describe('SpinnerButton', function() { assert.equal(spinner.props.spinning, false, 'should start in the default false state'); }); -});
\ No newline at end of file +}); diff --git a/webapp/tests/test_helper.jsx b/webapp/tests/test_helper.jsx index f19d96433..4352096a1 100644 --- a/webapp/tests/test_helper.jsx +++ b/webapp/tests/test_helper.jsx @@ -1,14 +1,6 @@ // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -/* eslint-disable no-console */ -/* eslint-disable global-require */ -/* eslint-disable func-names */ -/* eslint-disable prefer-arrow-callback */ -/* eslint-disable no-magic-numbers */ -/* eslint-disable no-unreachable */ -/* eslint-disable new-cap */ - import Client from '../client/client.jsx'; import jqd from 'jquery-deferred'; diff --git a/webapp/utils/text_formatting.jsx b/webapp/utils/text_formatting.jsx index 96b51d632..623fe0660 100644 --- a/webapp/utils/text_formatting.jsx +++ b/webapp/utils/text_formatting.jsx @@ -318,7 +318,7 @@ function parseSearchTerms(searchTerm) { termString = termString.substring(captured[0].length); // break the text up into words based on how the server splits them in SqlPostStore.SearchPosts and then discard empty terms - terms.push(...captured[0].split(/[ <>+\-\(\)\~\@]/).filter((term) => !!term)); + terms.push(...captured[0].split(/[ <>+\-\(\)~@]/).filter((term) => !!term)); continue; } diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 2f728226c..1f52bb451 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -457,7 +457,7 @@ export function replaceHtmlEntities(text) { }; var newtext = text; for (var tag in tagsToReplace) { - if ({}.hasOwnProperty.call(tagsToReplace, tag)) { + if (Reflect.apply({}.hasOwnProperty, this, [tagsToReplace, tag])) { var regex = new RegExp(tag, 'g'); newtext = newtext.replace(regex, tagsToReplace[tag]); } @@ -473,7 +473,7 @@ export function insertHtmlEntities(text) { }; var newtext = text; for (var tag in tagsToReplace) { - if ({}.hasOwnProperty.call(tagsToReplace, tag)) { + if (Reflect.apply({}.hasOwnProperty, this, [tagsToReplace, tag])) { var regex = new RegExp(tag, 'g'); newtext = newtext.replace(regex, tagsToReplace[tag]); } @@ -924,7 +924,7 @@ export function isValidUsername(name) { error = 'This field is required'; } else if (name.length < Constants.MIN_USERNAME_LENGTH || name.length > Constants.MAX_USERNAME_LENGTH) { error = 'Must be between ' + Constants.MIN_USERNAME_LENGTH + ' and ' + Constants.MAX_USERNAME_LENGTH + ' characters'; - } else if (!(/^[a-z0-9\.\-\_]+$/).test(name)) { + } else if (!(/^[a-z0-9\.\-_]+$/).test(name)) { error = "Must contain only letters, numbers, and the symbols '.', '-', and '_'."; } else if (!(/[a-z]/).test(name.charAt(0))) { //eslint-disable-line no-negated-condition error = 'First character must be a letter.'; @@ -977,7 +977,7 @@ Image.prototype.load = function imageLoad(url, progressCallback) { xmlHTTP.responseType = 'arraybuffer'; xmlHTTP.onload = function onLoad() { var h = xmlHTTP.getAllResponseHeaders(); - var m = h.match(/^Content-Type\:\s*(.*?)$/mi); + var m = h.match(/^Content-Type:\s*(.*?)$/mi); var mimeType = m[1] || 'image/png'; var blob = new Blob([this.response], {type: mimeType}); @@ -1142,7 +1142,7 @@ export function generateId() { // implementation taken from http://stackoverflow.com/a/2117523 var id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'; - id = id.replace(/[xy]/g, function replaceRandom(c) { + id = id.replace(/[xy]/g, (c) => { var r = Math.floor(Math.random() * 16); var v; |