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", "extends": "eslint:recommended",
"parserOptions": { "parserOptions": {
"ecmaVersion": 6, "ecmaVersion": 6,
"sourceType": "module", "sourceType": "module",
"ecmaFeatures": { "ecmaFeatures": {
"jsx": true, "jsx": true,
"impliedStrict": true, "impliedStrict": true,
"modules": true "modules": true
} }
}, },
"parser": "babel-eslint", "parser": "babel-eslint",
"plugins": [ "plugins": [
"react" "react"
], ],
"env": { "env": {
"browser": true, "browser": true,
"node": true, "node": true,
"jquery": true, "jquery": true,
"es6": true "es6": true
}, },
"globals": { "globals": {
"jest": true, "jest": true,
"describe": true, "describe": true,
"it": true, "it": true,
"expect": true, "expect": true,
"before": true "before": true
}, },
"rules": { "rules": {
"comma-dangle": [2, "never"], "array-bracket-spacing": [2, "never"],
"array-callback-return": 2, "array-callback-return": 2,
"prefer-rest-params": 2, "arrow-body-style": 0,
"no-unmodified-loop-condition": 2, "arrow-parens": [2, "always"],
"sort-imports": 0, "arrow-spacing": [2, { "before": true, "after": true }],
"no-new-symbol": 2, "block-scoped-var": 2,
"no-empty-function": 2, "brace-style": [2, "1tbs", { "allowSingleLine": false }],
"no-whitespace-before-property": 2, "camelcase": [2, {"properties": "never"}],
"no-useless-constructor": 2, "comma-dangle": [2, "never"],
"id-blacklist": 0, "comma-spacing": [2, {"before": false, "after": true}],
"one-var-declaration-per-line": 0, "comma-style": [2, "last"],
"no-extra-label": 2, "complexity": [1, 10],
"template-curly-spacing": [2, "never"], "computed-property-spacing": [2, "never"],
"no-self-assign": 2, "consistent-return": 2,
"newline-per-chained-call": 0, "consistent-this": [2, "self"],
"no-confusing-arrow": 2, "constructor-super": 2,
"no-case-declarations": 2, "curly": [2, "all"],
"no-cond-assign": [2, "except-parens"], "dot-location": [2, "object"],
"no-console": 2, "dot-notation": 2,
"no-constant-condition": 2, "eqeqeq": [2, "smart"],
"no-debugger": 2, "func-names": 2,
"no-dupe-args": 2, "func-style": [2, "declaration"],
"no-dupe-keys": 2, "generator-star-spacing": [2, {"before": false, "after": true}],
"no-duplicate-case": 2, "global-require": 2,
"no-empty": 2, "guard-for-in": 2,
"no-empty-pattern": 2, "id-blacklist": 0,
"no-ex-assign": 2, "indent": [2, 4, {"SwitchCase": 0}],
"no-extra-semi": 2, "jsx-quotes": [2, "prefer-single"],
"no-fallthrough": 2, "key-spacing": [2, {"beforeColon": false, "afterColon": true}],
"no-func-assign": 2, "keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}],
"no-inner-declarations": 0, "linebreak-style": 2,
"no-invalid-regexp": 2, "lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }],
"no-irregular-whitespace": 2, "max-nested-callbacks": [1, {"max":1}],
"no-unexpected-multiline": 2, "max-nested-callbacks": [2, {"max":2}],
"no-unreachable": 2, "max-statements-per-line": [2, {"max": 1}],
"no-magic-numbers": [1, { "ignore": [-1, 0, 1, 2], "enforceConst": true, "detectObjects": true } ], "new-cap": 2,
"valid-typeof": 2, "new-parens": 2,
"newline-before-return": 0,
"block-scoped-var": 2, "newline-per-chained-call": 0,
"complexity": [0, 8], "no-alert": 2,
"consistent-return": 2, "no-array-constructor": 2,
"curly": [2, "all"], "no-caller": 2,
"dot-location": [2, "object"], "no-case-declarations": 2,
"dot-notation": 2, "no-class-assign": 2,
"eqeqeq": [2, "smart"], "no-cond-assign": [2, "except-parens"],
"global-require": 2, "no-confusing-arrow": 2,
"guard-for-in": 2, "no-console": 2,
"no-alert": 2, "no-const-assign": 2,
"no-array-constructor": 2, "no-constant-condition": 2,
"no-caller": 2, "no-debugger": 2,
"no-div-regex": 2, "no-div-regex": 2,
"no-else-return": 2, "no-dupe-args": 2,
"no-eval": 2, "no-dupe-class-members": 2,
"no-extend-native": 2, "no-dupe-keys": 2,
"no-extra-bind": 2, "no-duplicate-case": 2,
"no-floating-decimal": 2, "no-duplicate-imports": [2, {"includeExports": true}],
"no-implied-eval": 2, "no-else-return": 2,
"no-implicit-globals": 0, "no-empty": 2,
"no-iterator": 2, "no-empty-function": 2,
"no-labels": 2, "no-empty-pattern": 2,
"no-lone-blocks": 2, "no-eval": 2,
"no-loop-func": 2, "no-ex-assign": 2,
"no-multi-spaces": [2, { "exceptions": { "Property": false } }], "no-extend-native": 2,
"no-multi-str": 0, "no-extra-bind": 2,
"no-native-reassign": 2, "no-extra-label": 2,
"no-new": 2, "no-extra-semi": 2,
"no-new-func": 2, "no-fallthrough": 2,
"no-new-object": 2, "no-floating-decimal": 2,
"no-new-wrappers": 2, "no-func-assign": 2,
"no-octal-escape": 2, "no-implicit-globals": 0,
"no-param-reassign": 2, "no-implied-eval": 2,
"no-process-env": 2, "no-inner-declarations": 0,
"no-process-exit": 2, "no-invalid-regexp": 2,
"no-proto": 2, "no-irregular-whitespace": 2,
"no-redeclare": 2, "no-iterator": 2,
"no-return-assign": [2, "always"], "no-labels": 2,
"no-script-url": 2, "no-lone-blocks": 2,
"no-self-compare": 2, "no-lonely-if": 2,
"no-sequences": 2, "no-loop-func": 2,
"no-throw-literal": 2, "no-magic-numbers": [1, { "ignore": [-1, 0, 1, 2], "enforceConst": true, "detectObjects": true } ],
"no-undef-init": 2, "no-mixed-spaces-and-tabs": 2,
"no-unused-expressions": 2, "no-multi-spaces": [2, { "exceptions": { "Property": false } }],
"no-useless-concat": 1, "no-multi-str": 0,
"no-void": 2, "no-multiple-empty-lines": [2, {"max": 1}],
"no-warning-comments": 1, "no-native-reassign": 2,
"no-with": 2, "no-negated-condition": 2,
"radix": 2, "no-nested-ternary": 2,
"vars-on-top": 0, "no-new": 2,
"wrap-iife": [2, "outside"], "no-new-func": 2,
"yoda": [2, "never", {"exceptRange": false, "onlyEquality": false}], "no-new-object": 2,
"no-new-symbol": 2,
"no-undefined": 2, "no-new-wrappers": 2,
"no-shadow": [2, {"hoist": "functions"}], "no-octal-escape": 2,
"no-shadow-restricted-names": 2, "no-param-reassign": 2,
"no-unused-vars": [2, {"vars": "all", "args": "after-used"}], "no-process-env": 2,
"no-use-before-define": [2, "nofunc"], "no-process-exit": 2,
"no-proto": 2,
// Style "no-redeclare": 2,
"array-bracket-spacing": [2, "never"], "no-return-assign": [2, "always"],
"brace-style": [2, "1tbs", { "allowSingleLine": false }], "no-script-url": 2,
"camelcase": [2, {"properties": "never"}], "no-self-assign": 2,
"comma-spacing": [2, {"before": false, "after": true}], "no-self-compare": 2,
"comma-style": [2, "last"], "no-sequences": 2,
"computed-property-spacing": [2, "never"], "no-shadow": [2, {"hoist": "functions"}],
"consistent-this": [2, "self"], "no-shadow-restricted-names": 2,
"func-names": 2, "no-spaced-func": 2,
"func-style": [2, "declaration"], "no-ternary": 0,
"indent": [2, 4, {"SwitchCase": 0}], "no-this-before-super": 2,
"jsx-quotes": [2, "prefer-single"], "no-throw-literal": 2,
"key-spacing": [2, {"beforeColon": false, "afterColon": true}], "no-trailing-spaces": [2, { "skipBlankLines": false }],
"linebreak-style": 2, "no-undef-init": 2,
"lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }], "no-undefined": 2,
"new-cap": 2, "no-underscore-dangle": 2,
"new-parens": 2, "no-unexpected-multiline": 2,
"no-lonely-if": 2, "no-unmodified-loop-condition": 2,
"no-mixed-spaces-and-tabs": 2, "no-unneeded-ternary": [2, {"defaultAssignment": false}],
"no-multiple-empty-lines": [2, {"max": 1}], "no-unreachable": 2,
"no-negated-condition": 2, "no-unsafe-finally": 2,
"no-nested-ternary": 2, "no-unused-expressions": 2,
"no-spaced-func": 2, "no-unused-vars": [2, {"vars": "all", "args": "after-used"}],
"no-ternary": 0, "no-use-before-define": [2, "nofunc"],
"no-trailing-spaces": [2, { "skipBlankLines": false }], "no-useless-computed-key": 2,
"no-underscore-dangle": 2, "no-useless-concat": 2,
"no-unneeded-ternary": [2, {"defaultAssignment": false}], "no-useless-constructor": 2,
"object-curly-spacing": [2, "never"], "no-useless-escape": 2,
"one-var": [2, "never"], "no-var": 0,
"operator-linebreak": [2, "after"], "no-void": 2,
"padded-blocks": [2, "never"], "no-warning-comments": 1,
"quote-props": [2, "as-needed"], "no-whitespace-before-property": 2,
"quotes": [2, "single", "avoid-escape"], "no-with": 2,
"semi": [2, "always"], "object-curly-spacing": [2, "never"],
"semi-spacing": [2, {"before": false, "after": true}], "object-shorthand": [1, "always"],
"keyword-spacing": [2, {"before": true, "after": true, "overrides": {}}], "one-var": [2, "never"],
"space-before-blocks": [2, "always"], "one-var-declaration-per-line": 0,
"space-before-function-paren": [2, "never"], "operator-linebreak": [2, "after"],
"space-in-parens": [2, "never"], "padded-blocks": [2, "never"],
"space-infix-ops": 2, "prefer-arrow-callback": 2,
"space-unary-ops": [2, { "words": true, "nonwords": false }], "prefer-const": 2,
"wrap-regex": 2, "prefer-reflect": 2,
"prefer-rest-params": 2,
// ES6 stuff "prefer-spread": 2,
"arrow-parens": [2, "always"], "prefer-template": 0,
"arrow-body-style": 0, "quote-props": [2, "as-needed"],
"arrow-spacing": [2, { "before": true, "after": true }], "quotes": [2, "single", "avoid-escape"],
"constructor-super": 2, "radix": 2,
"generator-star-spacing": [2, {"before": false, "after": true}], "react/display-name": [2, { "ignoreTranspilerName": false }],
"no-class-assign": 2, "react/jsx-boolean-value": [2, "always"],
"no-const-assign": 2, "react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }],
"no-dupe-class-members": 2, "react/jsx-curly-spacing": [2, "never"],
"no-this-before-super": 2, "react/jsx-equals-spacing": [2, "never"],
"no-var": 0, "react/jsx-first-prop-new-line": [2, "multiline"],
"object-shorthand": [1, "always"], "react/jsx-handler-names": 0,
"prefer-arrow-callback": 1, "react/jsx-indent": [2, 4],
"prefer-const": 1, "react/jsx-indent-props": [2, 4],
"prefer-spread": 2, "react/jsx-key": 2,
"prefer-reflect": 1, "react/jsx-max-props-per-line": [2, { "maximum": 1 }],
"prefer-template": 0, "react/jsx-no-bind": 1,
"require-yield": 2, "react/jsx-no-duplicate-props": [2, { "ignoreCase": false }],
"react/jsx-no-literals": 2,
// React Specific "react/jsx-no-target-blank": 2,
"react/display-name": [2, { "ignoreTranspilerName": false }], "react/jsx-no-undef": 2,
"react/no-deprecated": 2, "react/jsx-pascal-case": 2,
"react/no-is-mounted": 2, "react/jsx-space-before-closing": [2, "never"],
"react/no-string-refs": 0, "react/jsx-uses-react": 2,
"react/jsx-pascal-case": 2, "react/jsx-uses-vars": 2,
"react/jsx-indent": [1, 4], "react/no-danger": 0,
"react/jsx-equals-spacing": [2, "never"], "react/no-deprecated": 2,
"react/jsx-handler-names": 0, "react/no-did-mount-set-state": 2,
"react/jsx-boolean-value": [2, "always"], "react/no-did-update-set-state": 2,
"react/jsx-closing-bracket-location": [2, { "location": "tag-aligned" }], "react/no-direct-mutation-state": 2,
"react/jsx-curly-spacing": [2, "never"], "react/no-is-mounted": 2,
"react/jsx-indent-props": [2, 4], "react/no-multi-comp": [2, { "ignoreStateless": true }],
"react/jsx-key": 2, "react/no-set-state": 0,
"react/jsx-max-props-per-line": [2, { "maximum": 1 }], "react/no-string-refs": 0,
"react/jsx-no-bind": 1, "react/no-unknown-property": 2,
"react/jsx-space-before-closing": [2, "never"], "react/prefer-es6-class": 2,
"react/jsx-no-duplicate-props": [2, { "ignoreCase": false }], "react/prefer-stateless-function": 0,
"react/jsx-no-literals": 1, "react/prop-types": 2,
"react/jsx-no-undef": 2, "react/require-render-return": 2,
"react/jsx-uses-react": 2, "react/self-closing-comp": 2,
"react/jsx-uses-vars": 2, "react/sort-comp": 0,
"react/no-danger": 0, "react/wrap-multilines": 2,
"react/no-did-mount-set-state": 2, "require-yield": 2,
"react/no-did-update-set-state": 2, "semi": [2, "always"],
"react/no-direct-mutation-state": 2, "semi-spacing": [2, {"before": false, "after": true}],
"react/no-multi-comp": [2, { "ignoreStateless": true }], "sort-imports": 0,
"react/no-set-state": 0, "space-before-blocks": [2, "always"],
"react/no-unknown-property": 2, "space-before-function-paren": [2, "never"],
"react/prefer-es6-class": 2, "space-in-parens": [2, "never"],
"react/prop-types": 2, "space-infix-ops": 2,
"react/self-closing-comp": 2, "space-unary-ops": [2, { "words": true, "nonwords": false }],
"react/sort-comp": 0, "template-curly-spacing": [2, "never"],
"react/wrap-multilines": 2 "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 <a
target='_blank' target='_blank'
rel='noopener noreferrer'
href='http://www.mattermost.org/' href='http://www.mattermost.org/'
> >
{'mattermost.org'} {'mattermost.org'}
@@ -76,6 +77,7 @@ export default class AboutBuildModal extends React.Component {
/> />
<a <a
target='_blank' target='_blank'
rel='noopener noreferrer'
href='http://about.mattermost.com/' href='http://about.mattermost.com/'
> >
{'about.mattermost.com'} {'about.mattermost.com'}
@@ -133,7 +135,7 @@ export default class AboutBuildModal extends React.Component {
id='about.version' id='about.version'
defaultMessage='Version:' defaultMessage='Version:'
/> />
&nbsp;{config.Version}&nbsp;({config.BuildNumber}) {'\u00a0' + config.Version + '\u00a0' + config.BuildNumber}
</div> </div>
</div> </div>
{licensee} {licensee}

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

@@ -23,7 +23,7 @@ export default class ActivityLogModal extends React.Component {
this.onHide = this.onHide.bind(this); this.onHide = this.onHide.bind(this);
this.onShow = this.onShow.bind(this); this.onShow = this.onShow.bind(this);
let state = this.getStateFromStores(); const state = this.getStateFromStores();
state.moreInfo = []; state.moreInfo = [];
this.state = state; this.state = state;
@@ -43,14 +43,14 @@ export default class ActivityLogModal extends React.Component {
modalContent.removeClass('animation--highlight'); modalContent.removeClass('animation--highlight');
}, 1500); }, 1500);
Client.revokeSession(altId, Client.revokeSession(altId,
function handleRevokeSuccess() { () => {
AsyncClient.getSessions(); AsyncClient.getSessions();
}, },
function handleRevokeError(err) { (err) => {
let state = this.getStateFromStores(); const state = this.getStateFromStores();
state.serverError = err; state.serverError = err;
this.setState(state); this.setState(state);
}.bind(this) }
); );
} }
onShow() { onShow() {
@@ -85,7 +85,7 @@ export default class ActivityLogModal extends React.Component {
} }
} }
handleMoreInfo(index) { handleMoreInfo(index) {
let newMoreInfo = this.state.moreInfo; const newMoreInfo = this.state.moreInfo;
newMoreInfo[index] = true; newMoreInfo[index] = true;
this.setState({moreInfo: newMoreInfo}); this.setState({moreInfo: newMoreInfo});
} }

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

@@ -134,13 +134,13 @@ export default class AdminSidebar extends React.Component {
placement='top' placement='top'
overlay={removeTooltip} overlay={removeTooltip}
> >
<span <span
className='menu-icon--right menu__close' className='menu-icon--right menu__close'
onClick={this.removeTeam.bind(this, team.id)} onClick={this.removeTeam.bind(this, team.id)}
style={{cursor: 'pointer'}} style={{cursor: 'pointer'}}
> >
{'×'} {'×'}
</span> </span>
</OverlayTrigger> </OverlayTrigger>
</a> </a>
</li> </li>
@@ -424,7 +424,7 @@ export default class AdminSidebar extends React.Component {
</li> </li>
</ul> </ul>
<ul className='nav nav__sub-menu'> <ul className='nav nav__sub-menu'>
<li> <li>
<h4> <h4>
<span className='icon fa fa-gear'></span> <span className='icon fa fa-gear'></span>
<span> <span>
@@ -442,14 +442,14 @@ export default class AdminSidebar extends React.Component {
placement='top' placement='top'
overlay={addTeamTooltip} overlay={addTeamTooltip}
> >
<a <a
href='#' href='#'
onClick={this.showTeamSelect} onClick={this.showTeamSelect}
> >
<i <i
className='fa fa-plus' className='fa fa-plus'
></i> ></i>
</a> </a>
</OverlayTrigger> </OverlayTrigger>
</span> </span>
</h4> </h4>

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

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

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

@@ -285,12 +285,12 @@ class EmailSettings extends React.Component {
var emailSuccess = ''; var emailSuccess = '';
if (this.state.emailSuccess) { if (this.state.emailSuccess) {
emailSuccess = ( emailSuccess = (
<div className='alert alert-success'> <div className='alert alert-success'>
<i className='fa fa-check'></i> <i className='fa fa-check'></i>
<FormattedMessage <FormattedMessage
id='admin.email.emailSuccess' id='admin.email.emailSuccess'
defaultMessage='No errors were reported while sending an email. Please check your inbox to make sure.' defaultMessage='No errors were reported while sending an email. Please check your inbox to make sure.'
/> />
</div> </div>
); );
} }
@@ -298,15 +298,15 @@ class EmailSettings extends React.Component {
var emailFail = ''; var emailFail = '';
if (this.state.emailFail) { if (this.state.emailFail) {
emailSuccess = ( emailSuccess = (
<div className='alert alert-warning'> <div className='alert alert-warning'>
<i className='fa fa-warning'></i> <i className='fa fa-warning'></i>
<FormattedMessage <FormattedMessage
id='admin.email.emailFail' id='admin.email.emailFail'
defaultMessage='Connection unsuccessful: {error}' defaultMessage='Connection unsuccessful: {error}'
values={{ values={{
error: this.state.emailFail error: this.state.emailFail
}} }}
/> />
</div> </div>
); );
} }
@@ -507,10 +507,10 @@ class EmailSettings extends React.Component {
defaultChecked={this.props.config.EmailSettings.EnableSignUpWithEmail} defaultChecked={this.props.config.EmailSettings.EnableSignUpWithEmail}
onChange={this.handleChange.bind(this, 'allowSignUpWithEmail_true')} onChange={this.handleChange.bind(this, 'allowSignUpWithEmail_true')}
/> />
<FormattedMessage <FormattedMessage
id='admin.email.true' id='admin.email.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -520,10 +520,10 @@ class EmailSettings extends React.Component {
defaultChecked={!this.props.config.EmailSettings.EnableSignUpWithEmail} defaultChecked={!this.props.config.EmailSettings.EnableSignUpWithEmail}
onChange={this.handleChange.bind(this, 'allowSignUpWithEmail_false')} onChange={this.handleChange.bind(this, 'allowSignUpWithEmail_false')}
/> />
<FormattedMessage <FormattedMessage
id='admin.email.false' id='admin.email.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -648,10 +648,10 @@ class EmailSettings extends React.Component {
defaultChecked={this.props.config.EmailSettings.SendEmailNotifications} defaultChecked={this.props.config.EmailSettings.SendEmailNotifications}
onChange={this.handleChange.bind(this, 'sendEmailNotifications_true')} onChange={this.handleChange.bind(this, 'sendEmailNotifications_true')}
/> />
<FormattedMessage <FormattedMessage
id='admin.email.true' id='admin.email.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -661,10 +661,10 @@ class EmailSettings extends React.Component {
defaultChecked={!this.props.config.EmailSettings.SendEmailNotifications} defaultChecked={!this.props.config.EmailSettings.SendEmailNotifications}
onChange={this.handleChange.bind(this, 'sendEmailNotifications_false')} onChange={this.handleChange.bind(this, 'sendEmailNotifications_false')}
/> />
<FormattedMessage <FormattedMessage
id='admin.email.false' id='admin.email.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedHTMLMessage <FormattedHTMLMessage
@@ -696,10 +696,10 @@ class EmailSettings extends React.Component {
onChange={this.handleChange.bind(this, 'requireEmailVerification_true')} onChange={this.handleChange.bind(this, 'requireEmailVerification_true')}
disabled={!this.state.sendEmailNotifications} disabled={!this.state.sendEmailNotifications}
/> />
<FormattedMessage <FormattedMessage
id='admin.email.true' id='admin.email.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -710,10 +710,10 @@ class EmailSettings extends React.Component {
onChange={this.handleChange.bind(this, 'requireEmailVerification_false')} onChange={this.handleChange.bind(this, 'requireEmailVerification_false')}
disabled={!this.state.sendEmailNotifications} disabled={!this.state.sendEmailNotifications}
/> />
<FormattedMessage <FormattedMessage
id='admin.email.false' id='admin.email.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage

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

@@ -122,7 +122,6 @@ class GitLabSettings extends React.Component {
className='form-horizontal' className='form-horizontal'
role='form' role='form'
> >
<div className='form-group'> <div className='form-group'>
<label <label
className='control-label col-sm-4' className='control-label col-sm-4'
@@ -143,10 +142,10 @@ class GitLabSettings extends React.Component {
defaultChecked={this.props.config.GitLabSettings.Enable} defaultChecked={this.props.config.GitLabSettings.Enable}
onChange={this.handleChange.bind(this, 'EnableTrue')} onChange={this.handleChange.bind(this, 'EnableTrue')}
/> />
<FormattedMessage <FormattedMessage
id='admin.gitlab.true' id='admin.gitlab.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -156,10 +155,10 @@ class GitLabSettings extends React.Component {
defaultChecked={!this.props.config.GitLabSettings.Enable} defaultChecked={!this.props.config.GitLabSettings.Enable}
onChange={this.handleChange.bind(this, 'EnableFalse')} onChange={this.handleChange.bind(this, 'EnableFalse')}
/> />
<FormattedMessage <FormattedMessage
id='admin.gitlab.false' id='admin.gitlab.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage

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

@@ -592,10 +592,10 @@ class FileSettings extends React.Component {
defaultChecked={this.props.config.FileSettings.EnablePublicLink} defaultChecked={this.props.config.FileSettings.EnablePublicLink}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.image.true' id='admin.image.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -605,10 +605,10 @@ class FileSettings extends React.Component {
defaultChecked={!this.props.config.FileSettings.EnablePublicLink} defaultChecked={!this.props.config.FileSettings.EnablePublicLink}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.image.false' id='admin.image.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -689,4 +689,4 @@ FileSettings.propTypes = {
config: React.PropTypes.object 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 '} {'Mattermost Enterprise Edition. Unlock enterprise features in this software through the purchase of a subscription from '}
<a <a
target='_blank' target='_blank'
rel='noopener noreferrer'
href='https://mattermost.com/' href='https://mattermost.com/'
> >
{'https://mattermost.com/'} {'https://mattermost.com/'}

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

@@ -143,10 +143,10 @@ class LogSettings extends React.Component {
defaultChecked={this.props.config.LogSettings.EnableConsole} defaultChecked={this.props.config.LogSettings.EnableConsole}
onChange={this.handleChange.bind(this, 'console_true')} onChange={this.handleChange.bind(this, 'console_true')}
/> />
<FormattedMessage <FormattedMessage
id='admin.log.true' id='admin.log.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -156,10 +156,10 @@ class LogSettings extends React.Component {
defaultChecked={!this.props.config.LogSettings.EnableConsole} defaultChecked={!this.props.config.LogSettings.EnableConsole}
onChange={this.handleChange.bind(this, 'console_false')} onChange={this.handleChange.bind(this, 'console_false')}
/> />
<FormattedMessage <FormattedMessage
id='admin.log.false' id='admin.log.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -221,10 +221,10 @@ class LogSettings extends React.Component {
defaultChecked={this.props.config.LogSettings.EnableFile} defaultChecked={this.props.config.LogSettings.EnableFile}
onChange={this.handleChange.bind(this, 'file_true')} onChange={this.handleChange.bind(this, 'file_true')}
/> />
<FormattedMessage <FormattedMessage
id='admin.log.true' id='admin.log.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -234,10 +234,10 @@ class LogSettings extends React.Component {
defaultChecked={!this.props.config.LogSettings.EnableFile} defaultChecked={!this.props.config.LogSettings.EnableFile}
onChange={this.handleChange.bind(this, 'file_false')} onChange={this.handleChange.bind(this, 'file_false')}
/> />
<FormattedMessage <FormattedMessage
id='admin.log.false' id='admin.log.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -415,4 +415,4 @@ LogSettings.propTypes = {
config: React.PropTypes.object 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} defaultChecked={this.props.config.PrivacySettings.ShowEmailAddress}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.privacy.true' id='admin.privacy.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -121,10 +121,10 @@ class PrivacySettings extends React.Component {
defaultChecked={!this.props.config.PrivacySettings.ShowEmailAddress} defaultChecked={!this.props.config.PrivacySettings.ShowEmailAddress}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.privacy.false' id='admin.privacy.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -155,10 +155,10 @@ class PrivacySettings extends React.Component {
defaultChecked={this.props.config.PrivacySettings.ShowFullName} defaultChecked={this.props.config.PrivacySettings.ShowFullName}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.privacy.true' id='admin.privacy.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -168,10 +168,10 @@ class PrivacySettings extends React.Component {
defaultChecked={!this.props.config.PrivacySettings.ShowFullName} defaultChecked={!this.props.config.PrivacySettings.ShowFullName}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.privacy.false' id='admin.privacy.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -212,4 +212,4 @@ PrivacySettings.propTypes = {
config: React.PropTypes.object 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} defaultChecked={this.props.config.RateLimitSettings.EnableRateLimiter}
onChange={this.handleChange.bind(this, 'EnableRateLimiterTrue')} onChange={this.handleChange.bind(this, 'EnableRateLimiterTrue')}
/> />
<FormattedMessage <FormattedMessage
id='admin.rate.true' id='admin.rate.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -185,10 +185,10 @@ class RateSettings extends React.Component {
defaultChecked={!this.props.config.RateLimitSettings.EnableRateLimiter} defaultChecked={!this.props.config.RateLimitSettings.EnableRateLimiter}
onChange={this.handleChange.bind(this, 'EnableRateLimiterFalse')} onChange={this.handleChange.bind(this, 'EnableRateLimiterFalse')}
/> />
<FormattedMessage <FormattedMessage
id='admin.rate.false' id='admin.rate.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -280,10 +280,10 @@ class RateSettings extends React.Component {
onChange={this.handleChange.bind(this, 'VaryByRemoteAddrTrue')} onChange={this.handleChange.bind(this, 'VaryByRemoteAddrTrue')}
disabled={!this.state.EnableRateLimiter} disabled={!this.state.EnableRateLimiter}
/> />
<FormattedMessage <FormattedMessage
id='admin.rate.true' id='admin.rate.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -294,10 +294,10 @@ class RateSettings extends React.Component {
onChange={this.handleChange.bind(this, 'VaryByRemoteAddrFalse')} onChange={this.handleChange.bind(this, 'VaryByRemoteAddrFalse')}
disabled={!this.state.EnableRateLimiter} disabled={!this.state.EnableRateLimiter}
/> />
<FormattedMessage <FormattedMessage
id='admin.rate.false' id='admin.rate.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -368,4 +368,4 @@ RateSettings.propTypes = {
config: React.PropTypes.object 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} defaultChecked={this.props.config.ServiceSettings.EnableIncomingWebhooks}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -392,10 +392,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableIncomingWebhooks} defaultChecked={!this.props.config.ServiceSettings.EnableIncomingWebhooks}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -426,10 +426,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnableOutgoingWebhooks} defaultChecked={this.props.config.ServiceSettings.EnableOutgoingWebhooks}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -439,10 +439,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableOutgoingWebhooks} defaultChecked={!this.props.config.ServiceSettings.EnableOutgoingWebhooks}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -473,10 +473,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnableCommands} defaultChecked={this.props.config.ServiceSettings.EnableCommands}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -486,10 +486,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableCommands} defaultChecked={!this.props.config.ServiceSettings.EnableCommands}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -520,10 +520,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnableOnlyAdminIntegrations} defaultChecked={this.props.config.ServiceSettings.EnableOnlyAdminIntegrations}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -533,10 +533,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableOnlyAdminIntegrations} defaultChecked={!this.props.config.ServiceSettings.EnableOnlyAdminIntegrations}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -567,10 +567,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnablePostUsernameOverride} defaultChecked={this.props.config.ServiceSettings.EnablePostUsernameOverride}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -580,10 +580,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnablePostUsernameOverride} defaultChecked={!this.props.config.ServiceSettings.EnablePostUsernameOverride}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -594,7 +594,7 @@ class ServiceSettings extends React.Component {
</div> </div>
</div> </div>
<div className='form-group'> <div className='form-group'>
<label <label
className='control-label col-sm-4' className='control-label col-sm-4'
htmlFor='EnablePostIconOverride' htmlFor='EnablePostIconOverride'
@@ -614,10 +614,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnablePostIconOverride} defaultChecked={this.props.config.ServiceSettings.EnablePostIconOverride}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -627,10 +627,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnablePostIconOverride} defaultChecked={!this.props.config.ServiceSettings.EnablePostIconOverride}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -661,10 +661,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnableTesting} defaultChecked={this.props.config.ServiceSettings.EnableTesting}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -674,10 +674,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableTesting} defaultChecked={!this.props.config.ServiceSettings.EnableTesting}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -708,10 +708,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnableDeveloper} defaultChecked={this.props.config.ServiceSettings.EnableDeveloper}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -721,10 +721,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableDeveloper} defaultChecked={!this.props.config.ServiceSettings.EnableDeveloper}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -755,10 +755,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnableSecurityFixAlert} defaultChecked={this.props.config.ServiceSettings.EnableSecurityFixAlert}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -768,10 +768,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableSecurityFixAlert} defaultChecked={!this.props.config.ServiceSettings.EnableSecurityFixAlert}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -802,10 +802,10 @@ class ServiceSettings extends React.Component {
defaultChecked={this.props.config.ServiceSettings.EnableInsecureOutgoingConnections} defaultChecked={this.props.config.ServiceSettings.EnableInsecureOutgoingConnections}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.true' id='admin.service.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -815,10 +815,10 @@ class ServiceSettings extends React.Component {
defaultChecked={!this.props.config.ServiceSettings.EnableInsecureOutgoingConnections} defaultChecked={!this.props.config.ServiceSettings.EnableInsecureOutgoingConnections}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.service.false' id='admin.service.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage

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

@@ -330,10 +330,10 @@ class SqlSettings extends React.Component {
defaultChecked={this.props.config.SqlSettings.Trace} defaultChecked={this.props.config.SqlSettings.Trace}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.sql.true' id='admin.sql.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -343,10 +343,10 @@ class SqlSettings extends React.Component {
defaultChecked={!this.props.config.SqlSettings.Trace} defaultChecked={!this.props.config.SqlSettings.Trace}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.sql.false' id='admin.sql.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -387,4 +387,4 @@ SqlSettings.propTypes = {
config: React.PropTypes.object 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} defaultChecked={this.props.config.TeamSettings.EnableTeamCreation}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.true' id='admin.team.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -486,10 +486,10 @@ class TeamSettings extends React.Component {
defaultChecked={!this.props.config.TeamSettings.EnableTeamCreation} defaultChecked={!this.props.config.TeamSettings.EnableTeamCreation}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.false' id='admin.team.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -520,10 +520,10 @@ class TeamSettings extends React.Component {
defaultChecked={this.props.config.TeamSettings.EnableUserCreation} defaultChecked={this.props.config.TeamSettings.EnableUserCreation}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.true' id='admin.team.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -533,10 +533,10 @@ class TeamSettings extends React.Component {
defaultChecked={!this.props.config.TeamSettings.EnableUserCreation} defaultChecked={!this.props.config.TeamSettings.EnableUserCreation}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.false' id='admin.team.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -567,10 +567,10 @@ class TeamSettings extends React.Component {
defaultChecked={this.props.config.TeamSettings.EnableOpenServer} defaultChecked={this.props.config.TeamSettings.EnableOpenServer}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.true' id='admin.team.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -580,10 +580,10 @@ class TeamSettings extends React.Component {
defaultChecked={!this.props.config.TeamSettings.EnableOpenServer} defaultChecked={!this.props.config.TeamSettings.EnableOpenServer}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.false' id='admin.team.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage
@@ -643,10 +643,10 @@ class TeamSettings extends React.Component {
defaultChecked={this.props.config.TeamSettings.RestrictTeamNames} defaultChecked={this.props.config.TeamSettings.RestrictTeamNames}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.true' id='admin.team.true'
defaultMessage='true' defaultMessage='true'
/> />
</label> </label>
<label className='radio-inline'> <label className='radio-inline'>
<input <input
@@ -656,10 +656,10 @@ class TeamSettings extends React.Component {
defaultChecked={!this.props.config.TeamSettings.RestrictTeamNames} defaultChecked={!this.props.config.TeamSettings.RestrictTeamNames}
onChange={this.handleChange} onChange={this.handleChange}
/> />
<FormattedMessage <FormattedMessage
id='admin.team.false' id='admin.team.false'
defaultMessage='false' defaultMessage='false'
/> />
</label> </label>
<p className='help-text'> <p className='help-text'>
<FormattedMessage <FormattedMessage

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

@@ -224,8 +224,8 @@ export default class UserItem extends React.Component {
let showMakeSystemAdmin = user.roles === '' || user.roles === 'admin'; let showMakeSystemAdmin = user.roles === '' || user.roles === 'admin';
let showMakeActive = false; let showMakeActive = false;
let showMakeNotActive = user.roles !== 'system_admin'; 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'; const 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 showMfaReset = mfaEnabled && user.mfa_active;
if (user.delete_at > 0) { if (user.delete_at > 0) {
currentRoles = ( currentRoles = (

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

@@ -7,7 +7,7 @@ import React from 'react';
export default class StatisticCount extends React.Component { export default class StatisticCount extends React.Component {
render() { render() {
let loading = ( const loading = (
<FormattedMessage <FormattedMessage
id='analytics.chart.loading' id='analytics.chart.loading'
defaultMessage='Loading...' defaultMessage='Loading...'

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

@@ -4,13 +4,12 @@
import React from 'react'; import React from 'react';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import {browserHistory} from 'react-router';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import BackstageHeader from './backstage_header.jsx'; import BackstageHeader from './backstage_header.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import FormError from 'components/form_error.jsx'; 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'; import SpinnerButton from 'components/spinner_button.jsx';
const REQUEST_POST = 'P'; const REQUEST_POST = 'P';

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

@@ -4,14 +4,13 @@
import React from 'react'; import React from 'react';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import {browserHistory} from 'react-router';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import BackstageHeader from './backstage_header.jsx'; import BackstageHeader from './backstage_header.jsx';
import ChannelSelect from 'components/channel_select.jsx'; import ChannelSelect from 'components/channel_select.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import FormError from 'components/form_error.jsx'; 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'; import SpinnerButton from 'components/spinner_button.jsx';
export default class AddIncomingWebhook extends React.Component { export default class AddIncomingWebhook extends React.Component {

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

@@ -4,14 +4,13 @@
import React from 'react'; import React from 'react';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import {browserHistory} from 'react-router';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import BackstageHeader from './backstage_header.jsx'; import BackstageHeader from './backstage_header.jsx';
import ChannelSelect from 'components/channel_select.jsx'; import ChannelSelect from 'components/channel_select.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import FormError from 'components/form_error.jsx'; 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'; import SpinnerButton from 'components/spinner_button.jsx';
export default class AddOutgoingWebhook extends React.Component { export default class AddOutgoingWebhook extends React.Component {

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

@@ -478,11 +478,11 @@ export default class ChannelHeader extends React.Component {
overlay={popoverContent} overlay={popoverContent}
ref='headerOverlay' ref='headerOverlay'
> >
<div <div
onClick={TextFormatting.handleClick} onClick={TextFormatting.handleClick}
className='description' className='description'
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false})}} dangerouslySetInnerHTML={{__html: TextFormatting.formatText(channel.header, {singleline: true, mentionHighlight: false})}}
/> />
</OverlayTrigger> </OverlayTrigger>
</div> </div>
</th> </th>

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

@@ -289,10 +289,10 @@ export default class ChannelNotificationsModal extends React.Component {
checked={this.state.unreadLevel === 'all'} checked={this.state.unreadLevel === 'all'}
onChange={this.handleUpdateMarkUnreadLevel.bind(this, 'all')} onChange={this.handleUpdateMarkUnreadLevel.bind(this, 'all')}
/> />
<FormattedMessage <FormattedMessage
id='channel_notifications.allUnread' id='channel_notifications.allUnread'
defaultMessage='For all unread messages' defaultMessage='For all unread messages'
/> />
</label> </label>
<br/> <br/>
</div> </div>

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

@@ -112,7 +112,7 @@ class CreateComment extends React.Component {
return; return;
} }
let post = {}; const post = {};
post.filenames = []; post.filenames = [];
post.message = this.state.messageText; post.message = this.state.messageText;
@@ -145,7 +145,7 @@ class CreateComment extends React.Component {
AsyncClient.getPosts(this.props.channelId); AsyncClient.getPosts(this.props.channelId);
const channel = ChannelStore.get(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.msg_count = channel.total_msg_count;
member.last_viewed_at = Date.now(); member.last_viewed_at = Date.now();
ChannelStore.setChannelMember(member); ChannelStore.setChannelMember(member);
@@ -192,7 +192,7 @@ class CreateComment extends React.Component {
GlobalActions.emitLocalUserTypingEvent(this.props.channelId, this.props.rootId); GlobalActions.emitLocalUserTypingEvent(this.props.channelId, this.props.rootId);
} }
handleUserInput(messageText) { handleUserInput(messageText) {
let draft = PostStore.getCommentDraft(this.props.rootId); const draft = PostStore.getCommentDraft(this.props.rootId);
draft.message = messageText; draft.message = messageText;
PostStore.storeCommentDraft(this.props.rootId, draft); PostStore.storeCommentDraft(this.props.rootId, draft);
@@ -240,7 +240,7 @@ class CreateComment extends React.Component {
this.focusTextbox(); this.focusTextbox();
} }
handleUploadStart(clientIds) { handleUploadStart(clientIds) {
let draft = PostStore.getCommentDraft(this.props.rootId); const draft = PostStore.getCommentDraft(this.props.rootId);
draft.uploadsInProgress = draft.uploadsInProgress.concat(clientIds); draft.uploadsInProgress = draft.uploadsInProgress.concat(clientIds);
PostStore.storeCommentDraft(this.props.rootId, draft); PostStore.storeCommentDraft(this.props.rootId, draft);
@@ -252,7 +252,7 @@ class CreateComment extends React.Component {
this.focusTextbox(); this.focusTextbox();
} }
handleFileUploadComplete(filenames, clientIds) { handleFileUploadComplete(filenames, clientIds) {
let draft = PostStore.getCommentDraft(this.props.rootId); const draft = PostStore.getCommentDraft(this.props.rootId);
// remove each finished file from uploads // remove each finished file from uploads
for (let i = 0; i < clientIds.length; i++) { for (let i = 0; i < clientIds.length; i++) {
@@ -272,7 +272,7 @@ class CreateComment extends React.Component {
if (clientId === -1) { if (clientId === -1) {
this.setState({serverError: err}); this.setState({serverError: err});
} else { } else {
let draft = PostStore.getCommentDraft(this.props.rootId); const draft = PostStore.getCommentDraft(this.props.rootId);
const index = draft.uploadsInProgress.indexOf(clientId); const index = draft.uploadsInProgress.indexOf(clientId);
if (index !== -1) { if (index !== -1) {
@@ -285,8 +285,8 @@ class CreateComment extends React.Component {
} }
} }
removePreview(id) { removePreview(id) {
let previews = this.state.previews; const previews = this.state.previews;
let uploadsInProgress = this.state.uploadsInProgress; const uploadsInProgress = this.state.uploadsInProgress;
// id can either be the path of an uploaded file or the client id of an in progress upload // id can either be the path of an uploaded file or the client id of an in progress upload
let index = previews.indexOf(id); let index = previews.indexOf(id);
@@ -301,7 +301,7 @@ class CreateComment extends React.Component {
previews.splice(index, 1); previews.splice(index, 1);
} }
let draft = PostStore.getCommentDraft(this.props.rootId); const draft = PostStore.getCommentDraft(this.props.rootId);
draft.previews = previews; draft.previews = previews;
draft.uploadsInProgress = uploadsInProgress; draft.uploadsInProgress = uploadsInProgress;
PostStore.storeCommentDraft(this.props.rootId, draft); PostStore.storeCommentDraft(this.props.rootId, draft);

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

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

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

@@ -149,12 +149,12 @@ class FileAttachment extends React.Component {
if (this.state.fileSize < 0) { if (this.state.fileSize < 0) {
Client.getFileInfo( Client.getFileInfo(
filename, filename,
function success(data) { (data) => {
if (this.canSetState) { if (this.canSetState) {
this.setState({fileSize: parseInt(data.size, 10)}); this.setState({fileSize: parseInt(data.size, 10)});
} }
}.bind(this), },
function error() { () => {
// Do nothing // Do nothing
} }
); );
@@ -175,7 +175,8 @@ class FileAttachment extends React.Component {
className='post-image__column' className='post-image__column'
key={filename} key={filename}
> >
<a className='post-image__thumbnail' <a
className='post-image__thumbnail'
href='#' href='#'
onClick={() => this.props.handleImageClick(this.props.index)} onClick={() => this.props.handleImageClick(this.props.index)}
> >
@@ -186,9 +187,10 @@ class FileAttachment extends React.Component {
href={fileUrl} href={fileUrl}
download={filenameString} download={filenameString}
data-toggle='tooltip' data-toggle='tooltip'
title={this.props.intl.formatMessage(holders.download) + ' \"' + filenameString + '\"'} title={this.props.intl.formatMessage(holders.download) + ' "' + filenameString + '"'}
className='post-image__name' className='post-image__name'
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
{trimmedFilename} {trimmedFilename}
</a> </a>
@@ -198,6 +200,7 @@ class FileAttachment extends React.Component {
download={filenameString} download={filenameString}
className='post-image__download' className='post-image__download'
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
<span <span
className='fa fa-download' className='fa fa-download'

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

@@ -38,6 +38,7 @@ export default function FileInfoPreview({filename, fileUrl, fileInfo, formatMess
className={'file-details__preview'} className={'file-details__preview'}
to={fileUrl} to={fileUrl}
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
<span className='file-details__preview-helper'/> <span className='file-details__preview-helper'/>
<img src={Utils.getPreviewImagePath(filename)}/> <img src={Utils.getPreviewImagePath(filename)}/>

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

@@ -33,8 +33,8 @@ export default class NotLoggedIn extends React.Component {
id='help_link' id='help_link'
className='pull-right footer-link' className='pull-right footer-link'
target='_blank' target='_blank'
rel='noopener noreferrer'
href={global.window.mm_config.HelpLink} href={global.window.mm_config.HelpLink}
rel='noreferrer'
> >
<FormattedMessage id='web.footer.help'/> <FormattedMessage id='web.footer.help'/>
</a> </a>
@@ -42,8 +42,8 @@ export default class NotLoggedIn extends React.Component {
id='terms_link' id='terms_link'
className='pull-right footer-link' className='pull-right footer-link'
target='_blank' target='_blank'
rel='noopener noreferrer'
href={global.window.mm_config.TermsOfServiceLink} href={global.window.mm_config.TermsOfServiceLink}
rel='noreferrer'
> >
<FormattedMessage id='web.footer.terms'/> <FormattedMessage id='web.footer.terms'/>
</a> </a>
@@ -51,8 +51,8 @@ export default class NotLoggedIn extends React.Component {
id='privacy_link' id='privacy_link'
className='pull-right footer-link' className='pull-right footer-link'
target='_blank' target='_blank'
rel='noopener noreferrer'
href={global.window.mm_config.PrivacyPolicyLink} href={global.window.mm_config.PrivacyPolicyLink}
rel='noreferrer'
> >
<FormattedMessage id='web.footer.privacy'/> <FormattedMessage id='web.footer.privacy'/>
</a> </a>
@@ -60,8 +60,8 @@ export default class NotLoggedIn extends React.Component {
id='about_link' id='about_link'
className='pull-right footer-link' className='pull-right footer-link'
target='_blank' target='_blank'
rel='noopener noreferrer'
href={global.window.mm_config.AboutLink} href={global.window.mm_config.AboutLink}
rel='noreferrer'
> >
<FormattedMessage id='web.footer.about'/> <FormattedMessage id='web.footer.about'/>
</a> </a>

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

@@ -258,15 +258,17 @@ class InviteMemberModal extends React.Component {
var removeButton = null; var removeButton = null;
if (index) { if (index) {
removeButton = (<div> removeButton = (
<button <div>
type='button' <button
className='btn btn-link remove__member' type='button'
onClick={this.removeInviteFields.bind(this, index)} className='btn btn-link remove__member'
> onClick={this.removeInviteFields.bind(this, index)}
<span className='fa fa-trash'></span> >
</button> <span className='fa fa-trash'></span>
</div>); </button>
</div>
);
} }
var emailClass = 'form-group invite'; var emailClass = 'form-group invite';
if (emailError) { if (emailError) {
@@ -283,54 +285,56 @@ class InviteMemberModal extends React.Component {
if (lastNameError) { if (lastNameError) {
lastNameClass += ' has-error'; lastNameClass += ' has-error';
} }
nameFields = (<div className='row--invite'> nameFields = (
<div className='col-sm-6'> <div className='row--invite'>
<div className={firstNameClass}> <div className='col-sm-6'>
<input <div className={firstNameClass}>
type='text' <input
className='form-control' type='text'
ref={'first_name' + index} className='form-control'
placeholder={formatMessage(holders.firstname)} ref={'first_name' + index}
maxLength='64' placeholder={formatMessage(holders.firstname)}
disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} maxLength='64'
spellCheck='false' disabled={!this.state.emailEnabled || !this.state.userCreationEnabled}
/> spellCheck='false'
{firstNameError} />
</div> {firstNameError}
</div> </div>
<div className='col-sm-6'> </div>
<div className={lastNameClass}> <div className='col-sm-6'>
<input <div className={lastNameClass}>
type='text' <input
className='form-control' type='text'
ref={'last_name' + index} className='form-control'
placeholder={formatMessage(holders.lastname)} ref={'last_name' + index}
maxLength='64' placeholder={formatMessage(holders.lastname)}
disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} maxLength='64'
spellCheck='false' disabled={!this.state.emailEnabled || !this.state.userCreationEnabled}
/> spellCheck='false'
{lastNameError} />
</div> {lastNameError}
</div> </div>
</div>); </div>
</div>
);
inviteSections[index] = ( inviteSections[index] = (
<div key={'key' + index}> <div key={'key' + index}>
{removeButton} {removeButton}
<div className={emailClass}> <div className={emailClass}>
<input <input
onKeyUp={this.displayNameKeyUp} onKeyUp={this.displayNameKeyUp}
type='text' type='text'
ref={'email' + index} ref={'email' + index}
className='form-control' className='form-control'
placeholder='email@domain.com' placeholder='email@domain.com'
maxLength='64' maxLength='64'
disabled={!this.state.emailEnabled || !this.state.userCreationEnabled} disabled={!this.state.emailEnabled || !this.state.userCreationEnabled}
spellCheck='false' spellCheck='false'
/> />
{emailError} {emailError}
</div> </div>
{nameFields} {nameFields}
</div> </div>
); );
} }

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

@@ -235,8 +235,8 @@ export default class NavbarDropdown extends React.Component {
<li> <li>
<Link <Link
target='_blank' target='_blank'
rel='noopener noreferrer'
to={global.window.mm_config.HelpLink} to={global.window.mm_config.HelpLink}
rel='noreferrer'
> >
<FormattedMessage <FormattedMessage
id='navbar_dropdown.help' id='navbar_dropdown.help'
@@ -253,8 +253,8 @@ export default class NavbarDropdown extends React.Component {
<li> <li>
<Link <Link
target='_blank' target='_blank'
rel='noopener noreferrer'
to={global.window.mm_config.ReportAProblemLink} to={global.window.mm_config.ReportAProblemLink}
rel='noreferrer'
> >
<FormattedMessage <FormattedMessage
id='navbar_dropdown.report' id='navbar_dropdown.report'

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

@@ -59,7 +59,7 @@ class PostAttachment extends React.Component {
toggleCollapseState(e) { toggleCollapseState(e) {
e.preventDefault(); e.preventDefault();
let state = this.state; const state = this.state;
state.text = state.collapsed ? state.uncollapsedText : state.collapsedText; state.text = state.collapsed ? state.uncollapsedText : state.collapsedText;
state.collapsed = !state.collapsed; state.collapsed = !state.collapsed;
this.setState(state); this.setState(state);
@@ -142,22 +142,22 @@ class PostAttachment extends React.Component {
}); });
if (headerCols.length > 0) { // Flush last fields if (headerCols.length > 0) { // Flush last fields
fieldTables.push( fieldTables.push(
<table <table
className='attachment___fields' className='attachment___fields'
key={'attachment__table__' + nrTables} key={'attachment__table__' + nrTables}
> >
<thead> <thead>
<tr> <tr>
{headerCols} {headerCols}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
{bodyCols} {bodyCols}
</tr> </tr>
</tbody> </tbody>
</table> </table>
); );
} }
return ( return (
<div> <div>
@@ -209,6 +209,7 @@ class PostAttachment extends React.Component {
<a <a
href={data.author_link} href={data.author_link}
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
{author} {author}
</a> </a>
@@ -226,6 +227,7 @@ class PostAttachment extends React.Component {
className='attachment__title-link' className='attachment__title-link'
href={data.title_link} href={data.title_link}
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
{data.title} {data.title}
</a> </a>

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

@@ -72,30 +72,31 @@ export default class PostAttachmentOEmbed extends React.Component {
className='attachment attachment--oembed' className='attachment attachment--oembed'
ref='attachment' ref='attachment'
> >
<div className='attachment__content'> <div className='attachment__content'>
<div <div
className={'clearfix attachment__container'} className={'clearfix attachment__container'}
>
<h1
className='attachment__title'
> >
<h1 <a
className='attachment__title' className='attachment__title-link'
href={data.url}
target='_blank'
rel='noopener noreferrer'
> >
<a {data.title}
className='attachment__title-link' </a>
href={data.url} </h1>
target='_blank' <div >
> <div
{data.title} className={'attachment__body attachment__body--no_thumb'}
</a> >
</h1> {content}
<div >
<div
className={'attachment__body attachment__body--no_thumb'}
>
{content}
</div>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>
); );
} }

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

@@ -120,7 +120,8 @@ export default class PostBodyAdditionalContent extends React.Component {
let toggle; let toggle;
if (Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMBED_TOGGLE)) { if (Utils.isFeatureEnabled(Constants.PRE_RELEASE_FEATURES.EMBED_TOGGLE)) {
toggle = ( toggle = (
<a className='post__embed-visibility' <a
className='post__embed-visibility'
data-expanded={this.state.embedVisible} data-expanded={this.state.embedVisible}
aria-label='Toggle Embed Visibility' aria-label='Toggle Embed Visibility'
onClick={this.toggleEmbedVisibility} onClick={this.toggleEmbedVisibility}
@@ -131,7 +132,8 @@ export default class PostBodyAdditionalContent extends React.Component {
return ( return (
<div> <div>
{toggle} {toggle}
<div className='post__embed-container' <div
className='post__embed-container'
hidden={!this.state.embedVisible} hidden={!this.state.embedVisible}
> >
{generateEmbed} {generateEmbed}

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

@@ -98,7 +98,11 @@ export default class RemovedFromChannelModal extends React.Component {
className='close' className='close'
data-dismiss='modal' data-dismiss='modal'
aria-label='Close' aria-label='Close'
><span aria-hidden='true'>&times;</span></button> >
<span aria-hidden='true'>
{'×'}
</span>
</button>
<h4 className='modal-title'> <h4 className='modal-title'>
<FormattedMessage <FormattedMessage
id='removed_channel.from' id='removed_channel.from'
@@ -107,16 +111,16 @@ export default class RemovedFromChannelModal extends React.Component {
<span className='name'>{channelName}</span></h4> <span className='name'>{channelName}</span></h4>
</div> </div>
<div className='modal-body'> <div className='modal-body'>
<p> <p>
<FormattedMessage <FormattedMessage
id='removed_channel.remover' id='removed_channel.remover'
defaultMessage='{remover} removed you from {channel}' defaultMessage='{remover} removed you from {channel}'
values={{ values={{
remover: (remover), remover: (remover),
channel: (channelName) channel: (channelName)
}} }}
/> />
</p> </p>
</div> </div>
<div className='modal-footer'> <div className='modal-footer'>
<button <button

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

@@ -23,7 +23,7 @@ export default class SettingsSidebar extends React.Component {
} }
} }
render() { render() {
let tabList = this.props.tabs.map(function makeTab(tab) { let tabList = this.props.tabs.map((tab) => {
let key = `${tab.name}_li`; let key = `${tab.name}_li`;
let className = ''; let className = '';
if (this.props.activeTab === tab.name) { if (this.props.activeTab === tab.name) {
@@ -44,7 +44,7 @@ export default class SettingsSidebar extends React.Component {
</a> </a>
</li> </li>
); );
}.bind(this)); });
return ( return (
<div> <div>

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

@@ -640,13 +640,13 @@ export default class Sidebar extends React.Component {
placement='top' placement='top'
overlay={createChannelTootlip} overlay={createChannelTootlip}
> >
<a <a
className='add-channel-btn' className='add-channel-btn'
href='#' href='#'
onClick={this.showNewChannelModal.bind(this, 'O')} onClick={this.showNewChannelModal.bind(this, 'O')}
> >
{'+'} {'+'}
</a> </a>
</OverlayTrigger> </OverlayTrigger>
</h4> </h4>
</li> </li>
@@ -677,13 +677,13 @@ export default class Sidebar extends React.Component {
placement='top' placement='top'
overlay={createGroupTootlip} overlay={createGroupTootlip}
> >
<a <a
className='add-channel-btn' className='add-channel-btn'
href='#' href='#'
onClick={this.showNewChannelModal.bind(this, 'P')} onClick={this.showNewChannelModal.bind(this, 'P')}
> >
{'+'} {'+'}
</a> </a>
</OverlayTrigger> </OverlayTrigger>
</h4> </h4>
</li> </li>

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

@@ -89,7 +89,7 @@ export default class SidebarHeader extends React.Component {
overlay={<Tooltip id='team-name__tooltip'>{this.props.teamDisplayName}</Tooltip>} overlay={<Tooltip id='team-name__tooltip'>{this.props.teamDisplayName}</Tooltip>}
ref='descriptionOverlay' ref='descriptionOverlay'
> >
<div className='team__name'>{this.props.teamDisplayName}</div> <div className='team__name'>{this.props.teamDisplayName}</div>
</OverlayTrigger> </OverlayTrigger>
</div> </div>
</a> </a>

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

@@ -174,8 +174,8 @@ export default class SidebarRightMenu extends React.Component {
<li> <li>
<Link <Link
target='_blank' target='_blank'
rel='noopener noreferrer'
to={global.window.mm_config.HelpLink} to={global.window.mm_config.HelpLink}
rel='noreferrer'
> >
<i className='fa fa-question'></i> <i className='fa fa-question'></i>
<FormattedMessage <FormattedMessage
@@ -193,8 +193,8 @@ export default class SidebarRightMenu extends React.Component {
<li> <li>
<Link <Link
target='_blank' target='_blank'
rel='noopener noreferrer'
to={global.window.mm_config.ReportAProblemLink} to={global.window.mm_config.ReportAProblemLink}
rel='noreferrer'
> >
<i className='fa fa-phone'></i> <i className='fa fa-phone'></i>
<FormattedMessage <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) { handleSubmit(e) {
e.preventDefault(); e.preventDefault();
@@ -296,32 +323,7 @@ export default class SignupUserComplete extends React.Component {
this.state.data, this.state.data,
this.state.hash, this.state.hash,
this.state.inviteId, this.state.inviteId,
(data) => { this.handleUserCreated.bind(this, user),
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});
}
}
);
},
(err) => { (err) => {
this.setState({serverError: err.message}); this.setState({serverError: err.message});
} }

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

@@ -473,7 +473,9 @@ class GeneralTab extends React.Component {
data-dismiss='modal' data-dismiss='modal'
aria-label='Close' aria-label='Close'
> >
<span aria-hidden='true'>&times;</span> <span aria-hidden='true'>
{'×'}
</span>
</button> </button>
<h4 <h4
className='modal-title' className='modal-title'
@@ -518,4 +520,4 @@ GeneralTab.propTypes = {
activeSection: React.PropTypes.string.isRequired activeSection: React.PropTypes.string.isRequired
}; };
export default injectIntl(GeneralTab); export default injectIntl(GeneralTab);

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

@@ -123,7 +123,8 @@ class TeamImportTab extends React.Component {
return ( return (
<div> <div>
<div className='modal-header'> <div className='modal-header'>
<button type='button' <button
type='button'
className='close' className='close'
data-dismiss='modal' data-dismiss='modal'
aria-label='Close' aria-label='Close'

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

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

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

@@ -211,6 +211,7 @@ export default class Textbox extends React.Component {
{previewLink} {previewLink}
<a <a
target='_blank' target='_blank'
rel='noopener noreferrer'
href='http://docs.mattermost.com/help/getting-started/messaging-basics.html' href='http://docs.mattermost.com/help/getting-started/messaging-basics.html'
className='textbox-help-link' className='textbox-help-link'
> >

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

@@ -25,7 +25,7 @@ export default class ModalToggleButton extends React.Component {
} }
render() { 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 // allow callers to provide an onClick which will be called before the modal is shown
let clickHandler = this.show; 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 // 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, show: this.state.show,
onHide: () => { onHide: () => {
this.hide(); this.hide();

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

@@ -149,6 +149,7 @@ export default class TutorialIntroScreens extends React.Component {
<a <a
href={'mailto:' + global.window.mm_config.SupportEmail} href={'mailto:' + global.window.mm_config.SupportEmail}
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
{global.window.mm_config.SupportEmail} {global.window.mm_config.SupportEmail}
</a> </a>

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

@@ -230,11 +230,11 @@ class CustomThemeChooser extends React.Component {
overlay={popoverContent} overlay={popoverContent}
ref='headerOverlay' ref='headerOverlay'
> >
<span className='input-group-addon'> <span className='input-group-addon'>
<img <img
src={codeThemeURL} src={codeThemeURL}
/> />
</span> </span>
</OverlayTrigger> </OverlayTrigger>
</div> </div>
</div> </div>

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

@@ -81,7 +81,7 @@ class ImportThemeModal extends React.Component {
theme.mentionHighlightLink = '#2f81b7'; theme.mentionHighlightLink = '#2f81b7';
theme.codeTheme = 'github'; theme.codeTheme = 'github';
let user = UserStore.getCurrentUser(); const user = UserStore.getCurrentUser();
user.theme_props = theme; user.theme_props = theme;
Client.updateUser(user, Client.updateUser(user,

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

@@ -59,6 +59,7 @@ export default class PremadeThemeChooser extends React.Component {
<a <a
href='http://docs.mattermost.com/help/settings/theme-colors.html#custom-theme-examples' href='http://docs.mattermost.com/help/settings/theme-colors.html#custom-theme-examples'
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
<FormattedMessage <FormattedMessage
id='user.settings.display.theme.otherThemes' id='user.settings.display.theme.otherThemes'

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

@@ -150,13 +150,13 @@ class NotificationsTab extends React.Component {
data.channel = this.state.channelKey.toString(); data.channel = this.state.channelKey.toString();
Client.updateUserNotifyProps(data, Client.updateUserNotifyProps(data,
function success() { () => {
this.props.updateSection(''); this.props.updateSection('');
AsyncClient.getMe(); AsyncClient.getMe();
}.bind(this), },
function failure(err) { (err) => {
this.setState({serverError: err.message}); this.setState({serverError: err.message});
}.bind(this) }
); );
} }
handleCancel(e) { handleCancel(e) {
@@ -254,7 +254,8 @@ class NotificationsTab extends React.Component {
<div key='userNotificationLevelOption'> <div key='userNotificationLevelOption'>
<div className='radio'> <div className='radio'>
<label> <label>
<input type='radio' <input
type='radio'
checked={notifyActive[0]} checked={notifyActive[0]}
onChange={this.handleNotifyRadio.bind(this, 'all')} onChange={this.handleNotifyRadio.bind(this, 'all')}
/> />
@@ -393,8 +394,8 @@ class NotificationsTab extends React.Component {
/> />
</label> </label>
<br/> <br/>
</div> </div>
</div> </div>
); );
const extraInfo = ( const extraInfo = (

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

@@ -608,11 +608,11 @@ class SecurityTab extends React.Component {
const inputs = []; const inputs = [];
inputs.push( inputs.push(
<div key='userSignInOption'> <div key='userSignInOption'>
{emailOption} {emailOption}
{gitlabOption} {gitlabOption}
<br/> <br/>
{ldapOption} {ldapOption}
{googleOption} {googleOption}
</div> </div>
); );

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

@@ -212,7 +212,8 @@ export default class ThemeSetting extends React.Component {
key='premadeThemeColorLabel' key='premadeThemeColorLabel'
> >
<label> <label>
<input type='radio' <input
type='radio'
checked={!displayCustom} checked={!displayCustom}
onChange={this.updateType.bind(this, 'premade')} onChange={this.updateType.bind(this, 'premade')}
/> />
@@ -233,7 +234,8 @@ export default class ThemeSetting extends React.Component {
key='customThemeColorLabel' key='customThemeColorLabel'
> >
<label> <label>
<input type='radio' <input
type='radio'
checked={displayCustom} checked={displayCustom}
onChange={this.updateType.bind(this, 'custom')} onChange={this.updateType.bind(this, 'custom')}
/> />

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

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

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

@@ -54,6 +54,7 @@ export default class ViewImagePopoverBar extends React.Component {
download={this.props.filename} download={this.props.filename}
className='text' className='text'
target='_blank' target='_blank'
rel='noopener noreferrer'
> >
<FormattedMessage <FormattedMessage
id='view_image_popover.download' id='view_image_popover.download'

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

@@ -4,7 +4,7 @@
import $ from 'jquery'; import $ from 'jquery';
import ChannelStore from 'stores/channel_store.jsx'; 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 React from 'react';
import {Link} from 'react-router'; import {Link} from 'react-router';

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

@@ -5,52 +5,52 @@
"dependencies": { "dependencies": {
"autolinker": "mattermost/Autolinker.js#9689831109e104d7b545318e54199e6de8fd9b87", "autolinker": "mattermost/Autolinker.js#9689831109e104d7b545318e54199e6de8fd9b87",
"bootstrap": "3.3.6", "bootstrap": "3.3.6",
"bootstrap-colorpicker": "2.3.0", "bootstrap-colorpicker": "2.3.3",
"chart.js": "1.0.2", "chart.js": "2.1.2",
"compass-mixins": "0.12.7", "compass-mixins": "0.12.7",
"fastclick": "1.0.6", "fastclick": "1.0.6",
"flux": "2.1.1", "flux": "2.1.1",
"font-awesome": "4.5.0", "font-awesome": "4.6.1",
"highlight.js": "9.2.0", "highlight.js": "9.3.0",
"intl": "1.1.0", "intl": "1.1.0",
"jasny-bootstrap": "3.1.3", "jasny-bootstrap": "3.1.3",
"jquery": "2.2.1", "jquery": "2.2.3",
"keymirror": "0.1.1", "keymirror": "0.1.1",
"marked": "mattermost/marked#cb85e5cc81bc7937dbb73c3c53d9532b1b97e3ca", "marked": "mattermost/marked#cb85e5cc81bc7937dbb73c3c53d9532b1b97e3ca",
"match-at": "0.1.0", "match-at": "0.1.0",
"object-assign": "4.0.1", "object-assign": "4.1.0",
"perfect-scrollbar": "0.6.10", "perfect-scrollbar": "0.6.11",
"react": "0.14.7", "react": "15.0.2",
"react-addons-pure-render-mixin": "0.14.7", "react-addons-pure-render-mixin": "15.0.2",
"react-bootstrap": "0.28.3", "react-bootstrap": "0.29.3",
"react-custom-scrollbars": "4.0.0-beta.1", "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-intl": "2.0.0-rc-1",
"react-router": "2.0.1", "react-router": "2.4.0",
"react-textarea-autosize": "3.3.0", "react-textarea-autosize": "4.0.1",
"superagent": "1.8.3", "superagent": "1.8.3",
"twemoji": "2.0.5", "twemoji": "2.0.5",
"velocity-animate": "1.2.3" "velocity-animate": "1.2.3"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "5.0.0", "babel-eslint": "6.0.4",
"babel-loader": "6.2.4", "babel-loader": "6.2.4",
"babel-plugin-transform-runtime": "6.6.0", "babel-plugin-transform-runtime": "6.8.0",
"babel-polyfill": "6.7.2", "babel-polyfill": "6.8.0",
"babel-preset-es2015-webpack": "6.4.0", "babel-preset-es2015-webpack": "6.4.1",
"babel-preset-react": "6.5.0", "babel-preset-react": "6.5.0",
"babel-preset-stage-0": "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", "css-loader": "0.23.1",
"eslint": "2.2.0", "eslint": "2.9.0",
"eslint-plugin-react": "4.0.0", "eslint-plugin-react": "5.1.1",
"exports-loader": "0.6.3", "exports-loader": "0.6.3",
"extract-text-webpack-plugin": "1.0.1", "extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.8.5", "file-loader": "0.8.5",
"html-loader": "0.4.3", "html-loader": "0.4.3",
"imports-loader": "0.6.5", "imports-loader": "0.6.5",
"jquery-deferred": "0.3.0", "jquery-deferred": "0.3.0",
"jsdom": "8.5.0", "jsdom": "9.0.0",
"jsdom-global": "1.7.0", "jsdom-global": "1.7.0",
"json-loader": "0.5.4", "json-loader": "0.5.4",
"mocha": "2.4.5", "mocha": "2.4.5",
@@ -58,11 +58,11 @@
"mocha-webpack": "0.3.0", "mocha-webpack": "0.3.0",
"node-sass": "3.4.2", "node-sass": "3.4.2",
"raw-loader": "0.5.1", "raw-loader": "0.5.1",
"react-addons-test-utils": "0.14.7", "react-addons-test-utils": "15.0.2",
"sass-loader": "3.2.0", "sass-loader": "3.2.0",
"style-loader": "0.13.0", "style-loader": "0.13.1",
"url-loader": "0.5.7", "url-loader": "0.5.7",
"webpack": "2.1.0-beta.5", "webpack": "2.1.0-beta.7",
"webpack-node-externals": "1.2.0" "webpack-node-externals": "1.2.0"
}, },
"scripts": { "scripts": {

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

@@ -290,7 +290,7 @@ class ChannelStoreClass extends EventEmitter {
} }
leaveChannel(id) { leaveChannel(id) {
delete this.channelMembers[id]; Reflect.deleteProperty(this.channelMembers, id);
const element = this.channels.indexOf(id); const element = this.channels.indexOf(id);
if (element > -1) { if (element > -1) {
this.channels.splice(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. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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'); var assert = require('assert');
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; import TestHelper from './test_helper.jsx';

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

@@ -1,13 +1,6 @@
// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 assert from 'assert';
import TestHelper from './test_helper.jsx'; 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 jsdom = require('mocha-jsdom');
var assert = require('assert'); var assert = require('assert');
@@ -21,4 +15,4 @@ describe('SpinnerButton', function() {
assert.equal(spinner.props.spinning, false, 'should start in the default false state'); 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. // Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // 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 Client from '../client/client.jsx';
import jqd from 'jquery-deferred'; import jqd from 'jquery-deferred';

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

@@ -318,7 +318,7 @@ function parseSearchTerms(searchTerm) {
termString = termString.substring(captured[0].length); 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 // 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; continue;
} }

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

@@ -457,7 +457,7 @@ export function replaceHtmlEntities(text) {
}; };
var newtext = text; var newtext = text;
for (var tag in tagsToReplace) { for (var tag in tagsToReplace) {
if ({}.hasOwnProperty.call(tagsToReplace, tag)) { if (Reflect.apply({}.hasOwnProperty, this, [tagsToReplace, tag])) {
var regex = new RegExp(tag, 'g'); var regex = new RegExp(tag, 'g');
newtext = newtext.replace(regex, tagsToReplace[tag]); newtext = newtext.replace(regex, tagsToReplace[tag]);
} }
@@ -473,7 +473,7 @@ export function insertHtmlEntities(text) {
}; };
var newtext = text; var newtext = text;
for (var tag in tagsToReplace) { for (var tag in tagsToReplace) {
if ({}.hasOwnProperty.call(tagsToReplace, tag)) { if (Reflect.apply({}.hasOwnProperty, this, [tagsToReplace, tag])) {
var regex = new RegExp(tag, 'g'); var regex = new RegExp(tag, 'g');
newtext = newtext.replace(regex, tagsToReplace[tag]); newtext = newtext.replace(regex, tagsToReplace[tag]);
} }
@@ -924,7 +924,7 @@ export function isValidUsername(name) {
error = 'This field is required'; error = 'This field is required';
} else if (name.length < Constants.MIN_USERNAME_LENGTH || name.length > Constants.MAX_USERNAME_LENGTH) { } 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'; 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 '_'."; error = "Must contain only letters, numbers, and the symbols '.', '-', and '_'.";
} else if (!(/[a-z]/).test(name.charAt(0))) { //eslint-disable-line no-negated-condition } else if (!(/[a-z]/).test(name.charAt(0))) { //eslint-disable-line no-negated-condition
error = 'First character must be a letter.'; error = 'First character must be a letter.';
@@ -977,7 +977,7 @@ Image.prototype.load = function imageLoad(url, progressCallback) {
xmlHTTP.responseType = 'arraybuffer'; xmlHTTP.responseType = 'arraybuffer';
xmlHTTP.onload = function onLoad() { xmlHTTP.onload = function onLoad() {
var h = xmlHTTP.getAllResponseHeaders(); 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 mimeType = m[1] || 'image/png';
var blob = new Blob([this.response], {type: mimeType}); var blob = new Blob([this.response], {type: mimeType});
@@ -1142,7 +1142,7 @@ export function generateId() {
// implementation taken from http://stackoverflow.com/a/2117523 // implementation taken from http://stackoverflow.com/a/2117523
var id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'; 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 r = Math.floor(Math.random() * 16);
var v; var v;