Updating client dependancies and ESLint (#2954)

* Updating client dependancies

* Fixing eslint errors with updates

* Updating eslint
Этот коммит содержится в:
Christopher Speller
2016-05-12 07:50:53 -04:00
коммит произвёл Joram Wilander
родитель a3cfdf0483
Коммит 4b260b761a
69 изменённых файлов: 762 добавлений и 791 удалений

Просмотреть файл

@@ -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}]
}
}

Просмотреть файл

@@ -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:'
/>
&nbsp;{config.Version}&nbsp;({config.BuildNumber})
{'\u00a0' + config.Version + '\u00a0' + config.BuildNumber}
</div>
</div>
{licensee}

Просмотреть файл

@@ -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});
}

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -277,7 +277,8 @@ export default class ComplianceReports extends React.Component {
<table>
<tbody>
<tr>
<td colSpan='5'
<td
colSpan='5'
style={{paddingBottom: '6px'}}
>
<FormattedMessage

Просмотреть файл

@@ -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

Просмотреть файл

@@ -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

Просмотреть файл

@@ -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);
export default injectIntl(FileSettings);

Просмотреть файл

@@ -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/'}

Просмотреть файл

@@ -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);
export default injectIntl(LogSettings);

Просмотреть файл

@@ -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);
export default injectIntl(PrivacySettings);

Просмотреть файл

@@ -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);
export default injectIntl(RateSettings);

Просмотреть файл

@@ -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

Просмотреть файл

@@ -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);
export default injectIntl(SqlSettings);

Просмотреть файл

@@ -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

Просмотреть файл

@@ -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 = (

Просмотреть файл

@@ -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...'

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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 {

Просмотреть файл

@@ -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 {

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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);

Просмотреть файл

@@ -81,7 +81,7 @@ export default class ErrorBar extends React.Component {
className='error-bar__close'
onClick={this.handleClose}
>
&times;
{'×'}
</a>
</div>
);

Просмотреть файл

@@ -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'

Просмотреть файл

@@ -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)}/>

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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>
);
}

Просмотреть файл

@@ -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'

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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>
);
}

Просмотреть файл

@@ -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}

Просмотреть файл

@@ -98,7 +98,11 @@ export default class RemovedFromChannelModal extends React.Component {
className='close'
data-dismiss='modal'
aria-label='Close'
><span aria-hidden='true'>&times;</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

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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

Просмотреть файл

@@ -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});
}

Просмотреть файл

@@ -473,7 +473,9 @@ class GeneralTab extends React.Component {
data-dismiss='modal'
aria-label='Close'
>
<span aria-hidden='true'>&times;</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);
export default injectIntl(GeneralTab);

Просмотреть файл

@@ -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'

Просмотреть файл

@@ -92,7 +92,9 @@ class TeamSettingsModal extends React.Component {
data-dismiss='modal'
aria-label='Close'
>
<span aria-hidden='true'>&times;</span>
<span aria-hidden='true'>
{'×'}
</span>
</button>
<h4
className='modal-title'
@@ -133,4 +135,4 @@ TeamSettingsModal.propTypes = {
intl: intlShape.isRequired
};
export default injectIntl(TeamSettingsModal);
export default injectIntl(TeamSettingsModal);

Просмотреть файл

@@ -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'
>

Просмотреть файл

@@ -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();

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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>

Просмотреть файл

@@ -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,

Просмотреть файл

@@ -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'

Просмотреть файл

@@ -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 = (

Просмотреть файл

@@ -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>
);

Просмотреть файл

@@ -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')}
/>

Просмотреть файл

@@ -404,6 +404,7 @@ function ImagePreview({filename, fileUrl, fileInfo, maxHeight}) {
<a
href={fileUrl}
target='_blank'
rel='noopener noreferrer'
download={true}
>
<img

Просмотреть файл

@@ -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'

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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": {

Просмотреть файл

@@ -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);

12
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
}
}

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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');
});
});
});

Просмотреть файл

@@ -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';

Просмотреть файл

@@ -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;
}

Просмотреть файл

@@ -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;