Updating client dependencies. Switching to yarn. (#6433)

* Updating client dependancies. Switching to using yarn.

* Updating React

* Moving pure components to using function syntax (performance gains with newer react version)

* Updating client dependancies.

* Ignore .yarninstall

* Enabling pre-lockfile because it's the entire point of using yarn.

* Removing old webpack config

* Moving to new prop-types

* Fixing ESLint Errors

* Updating jest snapshots.

* Cleaning up package.json
Этот коммит содержится в:
Christopher Speller
2017-05-18 09:28:18 -04:00
коммит произвёл GitHub
родитель 63e599c43b
Коммит 2bbedd9def
254 изменённых файлов: 10715 добавлений и 2228 удалений

1
.gitignore поставляемый
Просмотреть файл

@@ -22,6 +22,7 @@ cmd/mattermost/imports.go
# Build Targets # Build Targets
.prebuild .prebuild
.npminstall .npminstall
.yarninstall
# Compiled Object files, Static and Dynamic libs (Shared Objects) # Compiled Object files, Static and Dynamic libs (Shared Objects)
*.o *.o

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

@@ -2,37 +2,37 @@
BUILD_SERVER_DIR = .. BUILD_SERVER_DIR = ..
check-style: .npminstall check-style: .yarninstall
@echo Checking for style guide compliance @echo Checking for style guide compliance
npm run check yarn run check
test: .npminstall test: .yarninstall
cd $(BUILD_SERVER_DIR) && $(MAKE) internal-test-web-client cd $(BUILD_SERVER_DIR) && $(MAKE) internal-test-web-client
.npminstall: package.json .yarninstall: package.json
@echo Getting dependencies using npm @echo Getting dependencies using yarn
npm install yarn install --pure-lockfile
touch $@ touch $@
build: .npminstall build: .yarninstall
@echo Building mattermost Webapp @echo Building mattermost Webapp
rm -rf dist rm -rf dist
npm run build yarn run build
run: .npminstall run: .yarninstall
@echo Running mattermost Webapp for development @echo Running mattermost Webapp for development
npm run run & yarn run run &
run-fullmap: .npminstall run-fullmap: .yarninstall
@echo FULL SOURCE MAP Running mattermost Webapp for development FULL SOURCE MAP @echo FULL SOURCE MAP Running mattermost Webapp for development FULL SOURCE MAP
npm run run-fullmap & yarn run run-fullmap &
stop: stop:
@echo Stopping changes watching @echo Stopping changes watching
@@ -51,4 +51,4 @@ clean:
rm -rf dist rm -rf dist
rm -rf node_modules rm -rf node_modules
rm -f .npminstall rm -f .yarninstall

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

@@ -5,6 +5,8 @@ import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import Constants from 'utils/constants.jsx'; import Constants from 'utils/constants.jsx';
@@ -198,6 +200,6 @@ AboutBuildModal.defaultProps = {
}; };
AboutBuildModal.propTypes = { AboutBuildModal.propTypes = {
show: React.PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
onModalDismissed: React.PropTypes.func.isRequired onModalDismissed: PropTypes.func.isRequired
}; };

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

@@ -9,6 +9,7 @@ import UserStore from 'stores/user_store.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
@@ -16,9 +17,9 @@ import {FormattedMessage} from 'react-intl';
export default class AccessHistoryModal extends React.Component { export default class AccessHistoryModal extends React.Component {
static propTypes = { static propTypes = {
onHide: React.PropTypes.func.isRequired, onHide: PropTypes.func.isRequired,
actions: React.PropTypes.shape({ actions: PropTypes.shape({
getUserAudits: React.PropTypes.func.isRequired getUserAudits: PropTypes.func.isRequired
}).isRequired }).isRequired
} }

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

@@ -8,16 +8,17 @@ import UserStore from 'stores/user_store.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import {FormattedMessage, FormattedTime, FormattedDate} from 'react-intl'; import {FormattedMessage, FormattedTime, FormattedDate} from 'react-intl';
export default class ActivityLogModal extends React.Component { export default class ActivityLogModal extends React.Component {
static propTypes = { static propTypes = {
onHide: React.PropTypes.func.isRequired, onHide: PropTypes.func.isRequired,
actions: React.PropTypes.shape({ actions: PropTypes.shape({
getSessions: React.PropTypes.func.isRequired, getSessions: PropTypes.func.isRequired,
revokeSession: React.PropTypes.func.isRequired revokeSession: PropTypes.func.isRequired
}).isRequired }).isRequired
} }

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

@@ -14,6 +14,8 @@ import Constants from 'utils/constants.jsx';
import {displayUsernameForUser} from 'utils/utils.jsx'; import {displayUsernameForUser} from 'utils/utils.jsx';
import Client from 'client/web_client.jsx'; import Client from 'client/web_client.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -27,9 +29,9 @@ const MAX_SELECTABLE_VALUES = 20;
export default class AddUsersToTeam extends React.Component { export default class AddUsersToTeam extends React.Component {
static propTypes = { static propTypes = {
onModalDismissed: React.PropTypes.func, onModalDismissed: PropTypes.func,
actions: React.PropTypes.shape({ actions: PropTypes.shape({
getProfilesNotInTeam: React.PropTypes.func.isRequired getProfilesNotInTeam: PropTypes.func.isRequired
}).isRequired }).isRequired
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -13,7 +15,7 @@ import AdminSidebar from './admin_sidebar.jsx';
export default class AdminConsole extends React.Component { export default class AdminConsole extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
children: React.PropTypes.node.isRequired children: PropTypes.node.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -13,7 +15,7 @@ import {saveConfig} from 'actions/admin_actions.jsx';
export default class AdminSettings extends React.Component { export default class AdminSettings extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
config: React.PropTypes.object config: PropTypes.object
}; };
} }

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

@@ -2,6 +2,7 @@
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -14,7 +15,7 @@ import AdminSidebarSection from './admin_sidebar_section.jsx';
export default class AdminSidebar extends React.Component { export default class AdminSidebar extends React.Component {
static get contextTypes() { static get contextTypes() {
return { return {
router: React.PropTypes.object.isRequired router: PropTypes.object.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -8,13 +10,13 @@ import {Link} from 'react-router/es6';
export default class AdminSidebarCategory extends React.Component { export default class AdminSidebarCategory extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
name: React.PropTypes.string, name: PropTypes.string,
title: React.PropTypes.node.isRequired, title: PropTypes.node.isRequired,
icon: React.PropTypes.string.isRequired, icon: PropTypes.string.isRequired,
sectionClass: React.PropTypes.string, sectionClass: PropTypes.string,
parentLink: React.PropTypes.string, parentLink: PropTypes.string,
children: React.PropTypes.node, children: PropTypes.node,
action: React.PropTypes.node action: PropTypes.node
}; };
} }
@@ -26,7 +28,7 @@ export default class AdminSidebarCategory extends React.Component {
static get contextTypes() { static get contextTypes() {
return { return {
router: React.PropTypes.object.isRequired router: PropTypes.object.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -9,14 +11,14 @@ import * as Utils from 'utils/utils.jsx';
export default class AdminSidebarSection extends React.Component { export default class AdminSidebarSection extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
name: React.PropTypes.string.isRequired, name: PropTypes.string.isRequired,
title: React.PropTypes.node.isRequired, title: PropTypes.node.isRequired,
type: React.PropTypes.string, type: PropTypes.string,
parentLink: React.PropTypes.string, parentLink: PropTypes.string,
subsection: React.PropTypes.bool, subsection: PropTypes.bool,
children: React.PropTypes.arrayOf(React.PropTypes.element), children: PropTypes.arrayOf(PropTypes.element),
action: React.PropTypes.node, action: PropTypes.node,
onlyActiveOnIndex: React.PropTypes.bool onlyActiveOnIndex: PropTypes.bool
}; };
} }

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

@@ -1,40 +1,40 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
export default class Banner extends React.Component { export default function Banner(props) {
render() { let title = (
let title = ( <FormattedMessage
<FormattedMessage id='admin.banner.heading'
id='admin.banner.heading' defaultMessage='Note:'
defaultMessage='Note:' />
/> );
);
if (this.props.title) { if (props.title) {
title = this.props.title; title = props.title;
}
return (
<div className='banner'>
<div className='banner__content'>
<h4 className='banner__heading'>
{title}
</h4>
<p>
{this.props.description}
</p>
</div>
</div>
);
} }
return (
<div className='banner'>
<div className='banner__content'>
<h4 className='banner__heading'>
{title}
</h4>
<p>
{props.description}
</p>
</div>
</div>
);
} }
Banner.defaultProps = { Banner.defaultProps = {
}; };
Banner.propTypes = { Banner.propTypes = {
title: React.PropTypes.node, title: PropTypes.node,
description: React.PropTypes.node.isRequired description: PropTypes.node.isRequired
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -85,13 +87,13 @@ BooleanSetting.defaultProps = {
}; };
BooleanSetting.propTypes = { BooleanSetting.propTypes = {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
value: React.PropTypes.bool.isRequired, value: PropTypes.bool.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
trueText: React.PropTypes.node, trueText: PropTypes.node,
falseText: React.PropTypes.node, falseText: PropTypes.node,
disabled: React.PropTypes.bool.isRequired, disabled: PropTypes.bool.isRequired,
disabledText: React.PropTypes.node, disabledText: PropTypes.node,
helpText: React.PropTypes.node.isRequired helpText: PropTypes.node.isRequired
}; };

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

@@ -2,6 +2,7 @@
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
@@ -15,7 +16,7 @@ import {FormattedHTMLMessage, FormattedMessage} from 'react-intl';
export default class BrandImageSetting extends React.Component { export default class BrandImageSetting extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
disabled: React.PropTypes.bool.isRequired disabled: PropTypes.bool.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -11,8 +13,8 @@ import statusRed from 'images/status_red.png';
export default class ClusterTable extends React.Component { export default class ClusterTable extends React.Component {
static propTypes = { static propTypes = {
clusterInfos: React.PropTypes.array.isRequired, clusterInfos: PropTypes.array.isRequired,
reload: React.PropTypes.func.isRequired reload: PropTypes.func.isRequired
} }
render() { render() {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -114,101 +116,95 @@ const CONNECTION_SECURITY_HELP_TEXT_WEBSERVER = (
</table> </table>
); );
export class ConnectionSecurityDropdownSettingEmail extends React.Component { //eslint-disable-line react/no-multi-comp export function ConnectionSecurityDropdownSettingEmail(props) {
render() { return (
return ( <DropdownSetting
<DropdownSetting id='connectionSecurity'
id='connectionSecurity' values={[
values={[ {value: '', text: Utils.localizeMessage('admin.connectionSecurityNone', 'None')},
{value: '', text: Utils.localizeMessage('admin.connectionSecurityNone', 'None')}, {value: 'PLAIN', text: Utils.localizeMessage('admin.connectionSecurityPlain')},
{value: 'PLAIN', text: Utils.localizeMessage('admin.connectionSecurityPlain')}, {value: 'TLS', text: Utils.localizeMessage('admin.connectionSecurityTls', 'TLS (Recommended)')},
{value: 'TLS', text: Utils.localizeMessage('admin.connectionSecurityTls', 'TLS (Recommended)')}, {value: 'STARTTLS', text: Utils.localizeMessage('admin.connectionSecurityStart')}
{value: 'STARTTLS', text: Utils.localizeMessage('admin.connectionSecurityStart')} ]}
]} label={
label={ <FormattedMessage
<FormattedMessage id='admin.connectionSecurityTitle'
id='admin.connectionSecurityTitle' defaultMessage='Connection Security:'
defaultMessage='Connection Security:' />
/> }
} value={props.value}
value={this.props.value} onChange={props.onChange}
onChange={this.props.onChange} disabled={props.disabled}
disabled={this.props.disabled} helpText={CONNECTION_SECURITY_HELP_TEXT_EMAIL}
helpText={CONNECTION_SECURITY_HELP_TEXT_EMAIL} />
/> );
);
}
} }
ConnectionSecurityDropdownSettingEmail.defaultProps = { ConnectionSecurityDropdownSettingEmail.defaultProps = {
}; };
ConnectionSecurityDropdownSettingEmail.propTypes = { ConnectionSecurityDropdownSettingEmail.propTypes = {
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool.isRequired disabled: PropTypes.bool.isRequired
}; };
export class ConnectionSecurityDropdownSettingLdap extends React.Component { //eslint-disable-line react/no-multi-comp export function ConnectionSecurityDropdownSettingLdap(props) {
render() { return (
return ( <DropdownSetting
<DropdownSetting id='connectionSecurity'
id='connectionSecurity' values={[
values={[ {value: '', text: Utils.localizeMessage('admin.connectionSecurityNone', 'None')},
{value: '', text: Utils.localizeMessage('admin.connectionSecurityNone', 'None')}, {value: 'TLS', text: Utils.localizeMessage('admin.connectionSecurityTls', 'TLS (Recommended)')},
{value: 'TLS', text: Utils.localizeMessage('admin.connectionSecurityTls', 'TLS (Recommended)')}, {value: 'STARTTLS', text: Utils.localizeMessage('admin.connectionSecurityStart')}
{value: 'STARTTLS', text: Utils.localizeMessage('admin.connectionSecurityStart')} ]}
]} label={
label={ <FormattedMessage
<FormattedMessage id='admin.connectionSecurityTitle'
id='admin.connectionSecurityTitle' defaultMessage='Connection Security:'
defaultMessage='Connection Security:' />
/> }
} value={props.value}
value={this.props.value} onChange={props.onChange}
onChange={this.props.onChange} disabled={props.disabled}
disabled={this.props.disabled} helpText={CONNECTION_SECURITY_HELP_TEXT_LDAP}
helpText={CONNECTION_SECURITY_HELP_TEXT_LDAP} />
/> );
);
}
} }
ConnectionSecurityDropdownSettingLdap.defaultProps = { ConnectionSecurityDropdownSettingLdap.defaultProps = {
}; };
ConnectionSecurityDropdownSettingLdap.propTypes = { ConnectionSecurityDropdownSettingLdap.propTypes = {
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool.isRequired disabled: PropTypes.bool.isRequired
}; };
export class ConnectionSecurityDropdownSettingWebserver extends React.Component { //eslint-disable-line react/no-multi-comp export function ConnectionSecurityDropdownSettingWebserver(props) {
render() { return (
return ( <DropdownSetting
<DropdownSetting id='connectionSecurity'
id='connectionSecurity' values={[
values={[ {value: '', text: Utils.localizeMessage('admin.connectionSecurityNone', 'None')},
{value: '', text: Utils.localizeMessage('admin.connectionSecurityNone', 'None')}, {value: 'TLS', text: Utils.localizeMessage('admin.connectionSecurityTls', 'TLS (Recommended)')}
{value: 'TLS', text: Utils.localizeMessage('admin.connectionSecurityTls', 'TLS (Recommended)')} ]}
]} label={
label={ <FormattedMessage
<FormattedMessage id='admin.connectionSecurityTitle'
id='admin.connectionSecurityTitle' defaultMessage='Connection Security:'
defaultMessage='Connection Security:' />
/> }
} value={props.value}
value={this.props.value} onChange={props.onChange}
onChange={this.props.onChange} disabled={props.disabled}
disabled={this.props.disabled} helpText={CONNECTION_SECURITY_HELP_TEXT_WEBSERVER}
helpText={CONNECTION_SECURITY_HELP_TEXT_WEBSERVER} />
/> );
);
}
} }
ConnectionSecurityDropdownSettingWebserver.defaultProps = { ConnectionSecurityDropdownSettingWebserver.defaultProps = {
}; };
ConnectionSecurityDropdownSettingWebserver.propTypes = { ConnectionSecurityDropdownSettingWebserver.propTypes = {
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool.isRequired disabled: PropTypes.bool.isRequired
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -54,11 +56,11 @@ DropdownSetting.defaultProps = {
}; };
DropdownSetting.propTypes = { DropdownSetting.propTypes = {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
values: React.PropTypes.array.isRequired, values: PropTypes.array.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
helpText: React.PropTypes.node helpText: PropTypes.node
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -12,9 +14,9 @@ import {testEmail} from 'actions/admin_actions.jsx';
export default class EmailConnectionTestButton extends React.Component { export default class EmailConnectionTestButton extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
config: React.PropTypes.object.isRequired, config: PropTypes.object.isRequired,
getConfigFromState: React.PropTypes.func.isRequired, getConfigFromState: PropTypes.func.isRequired,
disabled: React.PropTypes.bool.isRequired disabled: PropTypes.bool.isRequired
}; };
} }

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

@@ -2,6 +2,7 @@
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -12,14 +13,14 @@ import * as Utils from 'utils/utils.jsx';
export default class FileUploadSetting extends Setting { export default class FileUploadSetting extends Setting {
static get propTypes() { static get propTypes() {
return { return {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
helpText: React.PropTypes.node, helpText: PropTypes.node,
uploadingText: React.PropTypes.node, uploadingText: PropTypes.node,
onSubmit: React.PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired,
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
fileType: React.PropTypes.string.isRequired, fileType: PropTypes.string.isRequired,
error: React.PropTypes.string error: PropTypes.string
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -10,15 +12,15 @@ import {FormattedMessage} from 'react-intl';
export default class GeneratedSetting extends React.Component { export default class GeneratedSetting extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
placeholder: React.PropTypes.string, placeholder: PropTypes.string,
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool.isRequired, disabled: PropTypes.bool.isRequired,
disabledText: React.PropTypes.node, disabledText: PropTypes.node,
helpText: React.PropTypes.node.isRequired, helpText: PropTypes.node.isRequired,
regenerateText: React.PropTypes.node regenerateText: PropTypes.node
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -12,9 +14,9 @@ import {ldapTest} from 'actions/admin_actions.jsx';
export default class LdapTestButton extends React.Component { export default class LdapTestButton extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
submitFunction: React.PropTypes.func, submitFunction: PropTypes.func,
saveNeeded: React.PropTypes.bool saveNeeded: PropTypes.bool
}; };
} }
constructor(props) { constructor(props) {

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

@@ -21,6 +21,8 @@ const holders = defineMessages({
} }
}); });
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
class LicenseSettings extends React.Component { class LicenseSettings extends React.Component {
@@ -278,7 +280,7 @@ class LicenseSettings extends React.Component {
LicenseSettings.propTypes = { LicenseSettings.propTypes = {
intl: intlShape.isRequired, intl: intlShape.isRequired,
config: React.PropTypes.object config: PropTypes.object
}; };
export default injectIntl(LicenseSettings); export default injectIntl(LicenseSettings);

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -11,11 +13,11 @@ import * as Utils from 'utils/utils.jsx';
export default class ManageTeamsDropdown extends React.Component { export default class ManageTeamsDropdown extends React.Component {
static propTypes = { static propTypes = {
user: React.PropTypes.object.isRequired, user: PropTypes.object.isRequired,
teamMember: React.PropTypes.object.isRequired, teamMember: PropTypes.object.isRequired,
onError: React.PropTypes.func.isRequired, onError: PropTypes.func.isRequired,
onMemberChange: React.PropTypes.func.isRequired, onMemberChange: PropTypes.func.isRequired,
onMemberRemove: React.PropTypes.func.isRequired onMemberRemove: PropTypes.func.isRequired
}; };
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -19,9 +21,9 @@ import RemoveFromTeamButton from './remove_from_team_button.jsx';
export default class ManageTeamsModal extends React.Component { export default class ManageTeamsModal extends React.Component {
static propTypes = { static propTypes = {
onModalDismissed: React.PropTypes.func.isRequired, onModalDismissed: PropTypes.func.isRequired,
show: React.PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
user: React.PropTypes.object user: PropTypes.object
}; };
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -8,10 +10,10 @@ import {removeUserFromTeam} from 'actions/team_actions.jsx';
export default class RemoveFromTeamButton extends React.PureComponent { export default class RemoveFromTeamButton extends React.PureComponent {
static propTypes = { static propTypes = {
onError: React.PropTypes.func.isRequired, onError: PropTypes.func.isRequired,
onMemberRemove: React.PropTypes.func.isRequired, onMemberRemove: PropTypes.func.isRequired,
team: React.PropTypes.object.isRequired, team: PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired user: PropTypes.object.isRequired
}; };
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import React from 'react'; import React from 'react';
@@ -65,15 +67,15 @@ MultiSelectSetting.defaultProps = {
}; };
MultiSelectSetting.propTypes = { MultiSelectSetting.propTypes = {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
values: React.PropTypes.array.isRequired, values: PropTypes.array.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
selected: React.PropTypes.array.isRequired, selected: PropTypes.array.isRequired,
mustBePresent: React.PropTypes.string, mustBePresent: PropTypes.string,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
helpText: React.PropTypes.node, helpText: PropTypes.node,
noResultText: React.PropTypes.node, noResultText: PropTypes.node,
errorText: React.PropTypes.node, errorText: PropTypes.node,
notPresent: React.PropTypes.node notPresent: PropTypes.node
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -88,12 +90,12 @@ PostEditSetting.defaultProps = {
}; };
PostEditSetting.propTypes = { PostEditSetting.propTypes = {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
timeLimitId: React.PropTypes.string.isRequired, timeLimitId: PropTypes.string.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
timeLimitValue: React.PropTypes.number.isRequired, timeLimitValue: PropTypes.number.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
helpText: React.PropTypes.node helpText: PropTypes.node
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -53,11 +55,11 @@ RadioSetting.defaultProps = {
}; };
RadioSetting.propTypes = { RadioSetting.propTypes = {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
values: React.PropTypes.array.isRequired, values: PropTypes.array.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
helpText: React.PropTypes.node helpText: PropTypes.node
}; };

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

@@ -2,6 +2,7 @@
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import Setting from './setting.jsx'; import Setting from './setting.jsx';
@@ -9,14 +10,14 @@ import Setting from './setting.jsx';
export default class RemoveFileSetting extends Setting { export default class RemoveFileSetting extends Setting {
static get propTypes() { static get propTypes() {
return { return {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
helpText: React.PropTypes.node, helpText: PropTypes.node,
removeButtonText: React.PropTypes.node.isRequired, removeButtonText: PropTypes.node.isRequired,
removingText: React.PropTypes.node, removingText: PropTypes.node,
fileName: React.PropTypes.string.isRequired, fileName: PropTypes.string.isRequired,
onSubmit: React.PropTypes.func.isRequired, onSubmit: PropTypes.func.isRequired,
disabled: React.PropTypes.bool disabled: PropTypes.bool
}; };
} }

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

@@ -8,14 +8,16 @@ import {FormattedMessage} from 'react-intl';
import {adminResetPassword} from 'actions/admin_actions.jsx'; import {adminResetPassword} from 'actions/admin_actions.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class ResetPasswordModal extends React.Component { export default class ResetPasswordModal extends React.Component {
static propTypes = { static propTypes = {
user: React.PropTypes.object, user: PropTypes.object,
show: React.PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
onModalSubmit: React.PropTypes.func, onModalSubmit: PropTypes.func,
onModalDismissed: React.PropTypes.func onModalDismissed: PropTypes.func
}; };
static defaultProps = { static defaultProps = {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -8,8 +10,8 @@ import {FormattedMessage} from 'react-intl';
export default class SaveButton extends React.Component { export default class SaveButton extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
saving: React.PropTypes.bool.isRequired, saving: PropTypes.bool.isRequired,
disabled: React.PropTypes.bool disabled: PropTypes.bool
}; };
} }

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

@@ -1,34 +1,34 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import React from 'react'; import React from 'react';
export default class Setting extends React.Component { export default function Setting(props) {
render() { return (
return ( <div className='form-group'>
<div className='form-group'> <label
<label className='control-label col-sm-4'
className='control-label col-sm-4' htmlFor={props.inputId}
htmlFor={this.props.inputId} >
> {props.label}
{this.props.label} </label>
</label> <div className='col-sm-8'>
<div className='col-sm-8'> {props.children}
{this.props.children} <div className='help-text'>
<div className='help-text'> {props.helpText}
{this.props.helpText}
</div>
</div> </div>
</div> </div>
); </div>
} );
} }
Setting.defaultProps = { Setting.defaultProps = {
}; };
Setting.propTypes = { Setting.propTypes = {
inputId: React.PropTypes.string, inputId: PropTypes.string,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
children: React.PropTypes.node.isRequired, children: PropTypes.node.isRequired,
helpText: React.PropTypes.node helpText: PropTypes.node
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -6,9 +8,9 @@ import React from 'react';
export default class SettingsGroup extends React.Component { export default class SettingsGroup extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
show: React.PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
header: React.PropTypes.node, header: PropTypes.node,
children: React.PropTypes.node children: PropTypes.node
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -12,7 +14,7 @@ import {ldapSyncNow} from 'actions/admin_actions.jsx';
export default class SyncNowButton extends React.Component { export default class SyncNowButton extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
disabled: React.PropTypes.bool disabled: PropTypes.bool
}; };
} }
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -34,10 +36,10 @@ const USERS_PER_PAGE = 50;
export default class SystemUsers extends React.Component { export default class SystemUsers extends React.Component {
static propTypes = { static propTypes = {
actions: React.PropTypes.shape({ actions: PropTypes.shape({
getTeams: React.PropTypes.func.isRequired, getTeams: PropTypes.func.isRequired,
getTeamStats: React.PropTypes.func.isRequired, getTeamStats: PropTypes.func.isRequired,
getUser: React.PropTypes.func.isRequired getUser: PropTypes.func.isRequired
}).isRequired }).isRequired
} }

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

@@ -13,13 +13,15 @@ import {adminResetMfa} from 'actions/admin_actions.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class SystemUsersDropdown extends React.Component { export default class SystemUsersDropdown extends React.Component {
static propTypes = { static propTypes = {
user: React.PropTypes.object.isRequired, user: PropTypes.object.isRequired,
doPasswordReset: React.PropTypes.func.isRequired, doPasswordReset: PropTypes.func.isRequired,
doManageTeams: React.PropTypes.func.isRequired doManageTeams: PropTypes.func.isRequired
}; };
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -16,17 +18,17 @@ import SystemUsersDropdown from './system_users_dropdown.jsx';
export default class SystemUsersList extends React.Component { export default class SystemUsersList extends React.Component {
static propTypes = { static propTypes = {
users: React.PropTypes.arrayOf(React.PropTypes.object), users: PropTypes.arrayOf(PropTypes.object),
usersPerPage: React.PropTypes.number, usersPerPage: PropTypes.number,
total: React.PropTypes.number, total: PropTypes.number,
nextPage: React.PropTypes.func, nextPage: PropTypes.func,
search: React.PropTypes.func.isRequired, search: PropTypes.func.isRequired,
focusOnMount: React.PropTypes.bool, focusOnMount: PropTypes.bool,
renderFilterRow: React.PropTypes.func, renderFilterRow: PropTypes.func,
teamId: React.PropTypes.string.isRequired, teamId: PropTypes.string.isRequired,
term: React.PropTypes.string.isRequired, term: PropTypes.string.isRequired,
onTermChange: React.PropTypes.func.isRequired onTermChange: PropTypes.func.isRequired
}; };
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -9,18 +11,18 @@ import Constants from 'utils/constants.jsx';
export default class TextSetting extends React.Component { export default class TextSetting extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
id: React.PropTypes.string.isRequired, id: PropTypes.string.isRequired,
label: React.PropTypes.node.isRequired, label: PropTypes.node.isRequired,
placeholder: React.PropTypes.string, placeholder: PropTypes.string,
helpText: React.PropTypes.node, helpText: PropTypes.node,
value: React.PropTypes.oneOfType([ value: PropTypes.oneOfType([
React.PropTypes.string, PropTypes.string,
React.PropTypes.number PropTypes.number
]).isRequired, ]).isRequired,
maxLength: React.PropTypes.number, maxLength: PropTypes.number,
onChange: React.PropTypes.func, onChange: PropTypes.func,
disabled: React.PropTypes.bool, disabled: PropTypes.bool,
type: React.PropTypes.oneOf([ type: PropTypes.oneOf([
'input', 'input',
'textarea' 'textarea'
]) ])

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -67,35 +69,33 @@ const WEBSERVER_MODE_HELP_TEXT = (
</div> </div>
); );
export default class WebserverModeDropdownSetting extends React.Component { export default function WebserverModeDropdownSetting(props) {
render() { return (
return ( <DropdownSetting
<DropdownSetting id='webserverMode'
id='webserverMode' values={[
values={[ {value: 'gzip', text: Utils.localizeMessage('admin.webserverModeGzip', 'gzip')},
{value: 'gzip', text: Utils.localizeMessage('admin.webserverModeGzip', 'gzip')}, {value: 'uncompressed', text: Utils.localizeMessage('admin.webserverModeUncompressed', 'Uncompressed')},
{value: 'uncompressed', text: Utils.localizeMessage('admin.webserverModeUncompressed', 'Uncompressed')}, {value: 'disabled', text: Utils.localizeMessage('admin.webserverModeDisabled', 'Disabled')}
{value: 'disabled', text: Utils.localizeMessage('admin.webserverModeDisabled', 'Disabled')} ]}
]} label={
label={ <FormattedMessage
<FormattedMessage id='admin.webserverModeTitle'
id='admin.webserverModeTitle' defaultMessage='Webserver Mode:'
defaultMessage='Webserver Mode:' />
/> }
} value={props.value}
value={this.props.value} onChange={props.onChange}
onChange={this.props.onChange} disabled={props.disabled}
disabled={this.props.disabled} helpText={WEBSERVER_MODE_HELP_TEXT}
helpText={WEBSERVER_MODE_HELP_TEXT} />
/> );
);
}
} }
WebserverModeDropdownSetting.defaultProps = { WebserverModeDropdownSetting.defaultProps = {
}; };
WebserverModeDropdownSetting.propTypes = { WebserverModeDropdownSetting.propTypes = {
value: React.PropTypes.string.isRequired, value: PropTypes.string.isRequired,
onChange: React.PropTypes.func.isRequired, onChange: PropTypes.func.isRequired,
disabled: React.PropTypes.bool.isRequired disabled: PropTypes.bool.isRequired
}; };

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

@@ -5,6 +5,8 @@ import {FormattedMessage} from 'react-intl';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import Chart from 'chart.js'; import Chart from 'chart.js';
@@ -80,9 +82,9 @@ export default class DoughnutChart extends React.Component {
} }
DoughnutChart.propTypes = { DoughnutChart.propTypes = {
title: React.PropTypes.node, title: PropTypes.node,
width: React.PropTypes.string, width: PropTypes.string,
height: React.PropTypes.string, height: PropTypes.string,
data: React.PropTypes.object, data: PropTypes.object,
options: React.PropTypes.object options: PropTypes.object
}; };

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

@@ -5,6 +5,8 @@ import {FormattedMessage} from 'react-intl';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import Chart from 'chart.js'; import Chart from 'chart.js';
@@ -110,10 +112,10 @@ export default class LineChart extends React.Component {
} }
LineChart.propTypes = { LineChart.propTypes = {
title: React.PropTypes.node.isRequired, title: PropTypes.node.isRequired,
width: React.PropTypes.string.isRequired, width: PropTypes.string.isRequired,
height: React.PropTypes.string.isRequired, height: PropTypes.string.isRequired,
data: React.PropTypes.object, data: PropTypes.object,
options: React.PropTypes.object options: PropTypes.object
}; };

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

@@ -3,33 +3,33 @@
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class StatisticCount extends React.Component { export default function StatisticCount(props) {
render() { const loading = (
const loading = ( <FormattedMessage
<FormattedMessage id='analytics.chart.loading'
id='analytics.chart.loading' defaultMessage='Loading...'
defaultMessage='Loading...' />
/> );
);
return ( return (
<div className='col-md-3 col-sm-6'> <div className='col-md-3 col-sm-6'>
<div className='total-count'> <div className='total-count'>
<div className='title'> <div className='title'>
{this.props.title} {props.title}
<i className={'fa ' + this.props.icon}/> <i className={'fa ' + props.icon}/>
</div>
<div className='content'>{this.props.count == null ? loading : this.props.count}</div>
</div> </div>
<div className='content'>{props.count == null ? loading : props.count}</div>
</div> </div>
); </div>
} );
} }
StatisticCount.propTypes = { StatisticCount.propTypes = {
title: React.PropTypes.node.isRequired, title: PropTypes.node.isRequired,
icon: React.PropTypes.string.isRequired, icon: PropTypes.string.isRequired,
count: React.PropTypes.number count: PropTypes.number
}; };

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

@@ -5,57 +5,57 @@ import Constants from 'utils/constants.jsx';
import {Tooltip, OverlayTrigger} from 'react-bootstrap'; import {Tooltip, OverlayTrigger} from 'react-bootstrap';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class TableChart extends React.Component { export default function TableChart(props) {
render() { return (
return ( <div className='col-sm-6'>
<div className='col-sm-6'> <div className='total-count recent-active-users'>
<div className='total-count recent-active-users'> <div className='title'>
<div className='title'> {props.title}
{this.props.title} </div>
</div> <div className='content'>
<div className='content'> <table>
<table> <tbody>
<tbody> {
{ props.data.map((item) => {
this.props.data.map((item) => { const tooltip = (
const tooltip = ( <Tooltip id={'tip-table-entry-' + item.name}>
<Tooltip id={'tip-table-entry-' + item.name}> {item.tip}
{item.tip} </Tooltip>
</Tooltip> );
);
return ( return (
<tr key={'table-entry-' + item.name}> <tr key={'table-entry-' + item.name}>
<td> <td>
<OverlayTrigger <OverlayTrigger
delayShow={Constants.OVERLAY_TIME_DELAY} delayShow={Constants.OVERLAY_TIME_DELAY}
placement='top' placement='top'
overlay={tooltip} overlay={tooltip}
> >
<time> <time>
{item.name} {item.name}
</time> </time>
</OverlayTrigger> </OverlayTrigger>
</td> </td>
<td> <td>
{item.value} {item.value}
</td> </td>
</tr> </tr>
); );
}) })
} }
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
); </div>
} );
} }
TableChart.propTypes = { TableChart.propTypes = {
title: React.PropTypes.node, title: PropTypes.node,
data: React.PropTypes.array data: PropTypes.array
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -24,8 +26,8 @@ const LAST_ANALYTICS_TEAM = 'last_analytics_team';
export default class TeamAnalytics extends React.Component { export default class TeamAnalytics extends React.Component {
static propTypes = { static propTypes = {
actions: React.PropTypes.shape({ actions: PropTypes.shape({
getTeams: React.PropTypes.func.isRequired getTeams: PropTypes.func.isRequired
}).isRequired }).isRequired
} }

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

@@ -7,6 +7,8 @@ import Constants from 'utils/constants.jsx';
import FileInfoPreview from './file_info_preview.jsx'; import FileInfoPreview from './file_info_preview.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class AudioVideoPreview extends React.Component { export default class AudioVideoPreview extends React.Component {
@@ -109,6 +111,6 @@ export default class AudioVideoPreview extends React.Component {
} }
AudioVideoPreview.propTypes = { AudioVideoPreview.propTypes = {
fileInfo: React.PropTypes.object.isRequired, fileInfo: PropTypes.object.isRequired,
fileUrl: React.PropTypes.string.isRequired fileUrl: PropTypes.string.isRequired
}; };

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

@@ -206,129 +206,129 @@ const holders = defineMessages({
} }
}); });
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
class AuditTable extends React.Component { function AuditTable(props) {
render() { var accessList = [];
var accessList = [];
const {formatMessage} = this.props.intl; const {formatMessage} = props.intl;
for (var i = 0; i < this.props.audits.length; i++) { for (var i = 0; i < props.audits.length; i++) {
const audit = this.props.audits[i]; const audit = props.audits[i];
const auditInfo = formatAuditInfo(audit, formatMessage); const auditInfo = formatAuditInfo(audit, formatMessage);
let uContent; let uContent;
if (this.props.showUserId) { if (props.showUserId) {
var profile = UserStore.getProfile(auditInfo.userId); var profile = UserStore.getProfile(auditInfo.userId);
if (profile) { if (profile) {
uContent = <td className='word-break--all'>{profile.email}</td>; uContent = <td className='word-break--all'>{profile.email}</td>;
} else { } else {
uContent = <td className='word-break--all'>{auditInfo.userId}</td>; uContent = <td className='word-break--all'>{auditInfo.userId}</td>;
}
} }
let iContent;
if (this.props.showIp) {
iContent = <td className='whitespace--nowrap word-break--all'>{auditInfo.ip}</td>;
}
let sContent;
if (this.props.showSession) {
sContent = <td className='whitespace--nowrap word-break--all'>{auditInfo.sessionId}</td>;
}
const descStyle = {};
if (auditInfo.desc.toLowerCase().indexOf('fail') !== -1) {
descStyle.color = 'red';
}
accessList[i] = (
<tr key={audit.id}>
<td className='whitespace--nowrap word-break--all'>{auditInfo.timestamp}</td>
{uContent}
<td
className='word-break--all'
style={descStyle}
>
{auditInfo.desc}
</td>
{iContent}
{sContent}
</tr>
);
} }
let userIdContent; let iContent;
if (this.props.showUserId) { if (props.showIp) {
userIdContent = ( iContent = <td className='whitespace--nowrap word-break--all'>{auditInfo.ip}</td>;
<th>
<FormattedMessage
id='audit_table.userId'
defaultMessage='User ID'
/>
</th>
);
} }
let ipContent; let sContent;
if (this.props.showIp) { if (props.showSession) {
ipContent = ( sContent = <td className='whitespace--nowrap word-break--all'>{auditInfo.sessionId}</td>;
<th>
<FormattedMessage
id='audit_table.ip'
defaultMessage='IP Address'
/>
</th>
);
} }
let sessionContent; const descStyle = {};
if (this.props.showSession) { if (auditInfo.desc.toLowerCase().indexOf('fail') !== -1) {
sessionContent = ( descStyle.color = 'red';
<th>
<FormattedMessage
id='audit_table.session'
defaultMessage='Session ID'
/>
</th>
);
} }
return ( accessList[i] = (
<table className='table'> <tr key={audit.id}>
<thead> <td className='whitespace--nowrap word-break--all'>{auditInfo.timestamp}</td>
<tr> {uContent}
<th> <td
<FormattedMessage className='word-break--all'
id='audit_table.timestamp' style={descStyle}
defaultMessage='Timestamp' >
/> {auditInfo.desc}
</th> </td>
{userIdContent} {iContent}
<th> {sContent}
<FormattedMessage </tr>
id='audit_table.action'
defaultMessage='Action'
/>
</th>
{ipContent}
{sessionContent}
</tr>
</thead>
<tbody>
{accessList}
</tbody>
</table>
); );
} }
let userIdContent;
if (props.showUserId) {
userIdContent = (
<th>
<FormattedMessage
id='audit_table.userId'
defaultMessage='User ID'
/>
</th>
);
}
let ipContent;
if (props.showIp) {
ipContent = (
<th>
<FormattedMessage
id='audit_table.ip'
defaultMessage='IP Address'
/>
</th>
);
}
let sessionContent;
if (props.showSession) {
sessionContent = (
<th>
<FormattedMessage
id='audit_table.session'
defaultMessage='Session ID'
/>
</th>
);
}
return (
<table className='table'>
<thead>
<tr>
<th>
<FormattedMessage
id='audit_table.timestamp'
defaultMessage='Timestamp'
/>
</th>
{userIdContent}
<th>
<FormattedMessage
id='audit_table.action'
defaultMessage='Action'
/>
</th>
{ipContent}
{sessionContent}
</tr>
</thead>
<tbody>
{accessList}
</tbody>
</table>
);
} }
AuditTable.propTypes = { AuditTable.propTypes = {
intl: intlShape.isRequired, intl: intlShape.isRequired,
audits: React.PropTypes.array.isRequired, audits: PropTypes.array.isRequired,
showUserId: React.PropTypes.bool, showUserId: PropTypes.bool,
showIp: React.PropTypes.bool, showIp: PropTypes.bool,
showSession: React.PropTypes.bool showSession: PropTypes.bool
}; };
export default injectIntl(AuditTable); export default injectIntl(AuditTable);

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

@@ -4,6 +4,7 @@
import FormError from 'components/form_error.jsx'; import FormError from 'components/form_error.jsx';
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import icon50 from 'images/icon50x50.png'; import icon50 from 'images/icon50x50.png';
@@ -13,8 +14,8 @@ import {getOAuthAppInfo, allowOAuth2} from 'actions/admin_actions.jsx';
export default class Authorize extends React.Component { export default class Authorize extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
location: React.PropTypes.object.isRequired, location: PropTypes.object.isRequired,
params: React.PropTypes.object.isRequired params: PropTypes.object.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -5,9 +7,9 @@ import React from 'react';
export default class AutosizeTextarea extends React.Component { export default class AutosizeTextarea extends React.Component {
static propTypes = { static propTypes = {
value: React.PropTypes.string, value: PropTypes.string,
placeholder: React.PropTypes.string, placeholder: PropTypes.string,
onHeightChange: React.PropTypes.func onHeightChange: PropTypes.func
} }
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -13,8 +15,8 @@ import ErrorBar from 'components/error_bar.jsx';
export default class BackstageController extends React.Component { export default class BackstageController extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
user: React.PropTypes.object, user: PropTypes.object,
children: React.PropTypes.node.isRequired children: PropTypes.node.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -8,11 +10,11 @@ import {Link} from 'react-router/es6';
export default class BackstageCategory extends React.Component { export default class BackstageCategory extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
name: React.PropTypes.string.isRequired, name: PropTypes.string.isRequired,
title: React.PropTypes.node.isRequired, title: PropTypes.node.isRequired,
icon: React.PropTypes.string.isRequired, icon: PropTypes.string.isRequired,
parentLink: React.PropTypes.string, parentLink: PropTypes.string,
children: React.PropTypes.arrayOf(React.PropTypes.element) children: PropTypes.arrayOf(PropTypes.element)
}; };
} }
@@ -25,7 +27,7 @@ export default class BackstageCategory extends React.Component {
static get contextTypes() { static get contextTypes() {
return { return {
router: React.PropTypes.object.isRequired router: PropTypes.object.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -6,7 +8,7 @@ import React from 'react';
export default class BackstageHeader extends React.Component { export default class BackstageHeader extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
children: React.PropTypes.node children: PropTypes.node
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -10,14 +12,14 @@ import LoadingScreen from 'components/loading_screen.jsx';
export default class BackstageList extends React.Component { export default class BackstageList extends React.Component {
static propTypes = { static propTypes = {
children: React.PropTypes.node, children: PropTypes.node,
header: React.PropTypes.node.isRequired, header: PropTypes.node.isRequired,
addLink: React.PropTypes.string, addLink: PropTypes.string,
addText: React.PropTypes.node, addText: PropTypes.node,
emptyText: React.PropTypes.node, emptyText: PropTypes.node,
helpText: React.PropTypes.node, helpText: PropTypes.node,
loading: React.PropTypes.bool.isRequired, loading: PropTypes.bool.isRequired,
searchPlaceholder: React.PropTypes.string searchPlaceholder: PropTypes.string
} }
static defaultProps = { static defaultProps = {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -9,7 +11,7 @@ import {Link} from 'react-router/es6';
export default class BackstageNavbar extends React.Component { export default class BackstageNavbar extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
team: React.PropTypes.object.isRequired team: PropTypes.object.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -8,11 +10,11 @@ import {Link} from 'react-router/es6';
export default class BackstageSection extends React.Component { export default class BackstageSection extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
name: React.PropTypes.string.isRequired, name: PropTypes.string.isRequired,
title: React.PropTypes.node.isRequired, title: PropTypes.node.isRequired,
parentLink: React.PropTypes.string, parentLink: PropTypes.string,
subsection: React.PropTypes.bool, subsection: PropTypes.bool,
children: React.PropTypes.arrayOf(React.PropTypes.element) children: PropTypes.arrayOf(PropTypes.element)
}; };
} }
@@ -26,7 +28,7 @@ export default class BackstageSection extends React.Component {
static get contextTypes() { static get contextTypes() {
return { return {
router: React.PropTypes.object.isRequired router: PropTypes.object.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -13,8 +15,8 @@ import {FormattedMessage} from 'react-intl';
export default class BackstageSidebar extends React.Component { export default class BackstageSidebar extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
team: React.PropTypes.object.isRequired, team: PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired user: PropTypes.object.isRequired
}; };
} }

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

@@ -9,6 +9,8 @@ import * as URL from 'utils/url.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class ChangeUrlModal extends React.Component { export default class ChangeUrlModal extends React.Component {
@@ -234,12 +236,12 @@ ChangeUrlModal.defaultProps = {
}; };
ChangeUrlModal.propTypes = { ChangeUrlModal.propTypes = {
show: React.PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
title: React.PropTypes.node, title: PropTypes.node,
submitButtonText: React.PropTypes.node, submitButtonText: PropTypes.node,
currentURL: React.PropTypes.string, currentURL: PropTypes.string,
serverError: React.PropTypes.node, serverError: PropTypes.node,
onModalSubmit: React.PropTypes.func.isRequired, onModalSubmit: PropTypes.func.isRequired,
onModalExited: React.PropTypes.func, onModalExited: PropTypes.func,
onModalDismissed: React.PropTypes.func.isRequired onModalDismissed: PropTypes.func.isRequired
}; };

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

@@ -37,6 +37,8 @@ import AppDispatcher from 'dispatcher/app_dispatcher.jsx';
import {Constants, Preferences, UserStatuses, ActionTypes} from 'utils/constants.jsx'; import {Constants, Preferences, UserStatuses, ActionTypes} from 'utils/constants.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import {Tooltip, OverlayTrigger, Popover} from 'react-bootstrap'; import {Tooltip, OverlayTrigger, Popover} from 'react-bootstrap';
@@ -948,5 +950,5 @@ export default class ChannelHeader extends React.Component {
} }
ChannelHeader.propTypes = { ChannelHeader.propTypes = {
channelId: React.PropTypes.string.isRequired channelId: PropTypes.string.isRequired
}; };

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

@@ -9,6 +9,8 @@ import {Modal} from 'react-bootstrap';
import TeamStore from 'stores/team_store.jsx'; import TeamStore from 'stores/team_store.jsx';
import * as TextFormatting from 'utils/text_formatting.jsx'; import * as TextFormatting from 'utils/text_formatting.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class ChannelInfoModal extends React.Component { export default class ChannelInfoModal extends React.Component {
@@ -137,6 +139,6 @@ export default class ChannelInfoModal extends React.Component {
} }
ChannelInfoModal.propTypes = { ChannelInfoModal.propTypes = {
onHide: React.PropTypes.func.isRequired, onHide: PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired channel: PropTypes.object.isRequired
}; };

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

@@ -5,15 +5,17 @@ import SpinnerButton from 'components/spinner_button.jsx';
import {addUserToChannel} from 'actions/channel_actions.jsx'; import {addUserToChannel} from 'actions/channel_actions.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
export default class ChannelInviteButton extends React.Component { export default class ChannelInviteButton extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
user: React.PropTypes.object.isRequired, user: PropTypes.object.isRequired,
channel: React.PropTypes.object.isRequired, channel: PropTypes.object.isRequired,
onInviteError: React.PropTypes.func.isRequired onInviteError: PropTypes.func.isRequired
}; };
} }

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

@@ -14,6 +14,8 @@ import {searchUsers} from 'actions/user_actions.jsx';
import * as UserAgent from 'utils/user_agent.jsx'; import * as UserAgent from 'utils/user_agent.jsx';
import Constants from 'utils/constants.jsx'; import Constants from 'utils/constants.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -25,11 +27,11 @@ const USERS_PER_PAGE = 50;
export default class ChannelInviteModal extends React.Component { export default class ChannelInviteModal extends React.Component {
static propTypes = { static propTypes = {
onHide: React.PropTypes.func.isRequired, onHide: PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired, channel: PropTypes.object.isRequired,
actions: React.PropTypes.shape({ actions: PropTypes.shape({
getProfilesNotInChannel: React.PropTypes.func.isRequired, getProfilesNotInChannel: PropTypes.func.isRequired,
getTeamStats: React.PropTypes.func.isRequired getTeamStats: PropTypes.func.isRequired
}).isRequired }).isRequired
} }

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

@@ -11,17 +11,19 @@ import * as Utils from 'utils/utils.jsx';
import {canManageMembers} from 'utils/channel_utils.jsx'; import {canManageMembers} from 'utils/channel_utils.jsx';
import {Constants} from 'utils/constants.jsx'; import {Constants} from 'utils/constants.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
export default class ChannelMembersDropdown extends React.Component { export default class ChannelMembersDropdown extends React.Component {
static propTypes = { static propTypes = {
channel: React.PropTypes.object.isRequired, channel: PropTypes.object.isRequired,
user: React.PropTypes.object.isRequired, user: PropTypes.object.isRequired,
teamMember: React.PropTypes.object.isRequired, teamMember: PropTypes.object.isRequired,
channelMember: React.PropTypes.object.isRequired, channelMember: PropTypes.object.isRequired,
actions: React.PropTypes.shape({ actions: PropTypes.shape({
getChannelStats: React.PropTypes.func.isRequired getChannelStats: PropTypes.func.isRequired
}).isRequired }).isRequired
} }

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

@@ -10,6 +10,8 @@ import ChannelStore from 'stores/channel_store.jsx';
import {canManageMembers} from 'utils/channel_utils.jsx'; import {canManageMembers} from 'utils/channel_utils.jsx';
import {Constants} from 'utils/constants.jsx'; import {Constants} from 'utils/constants.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -87,7 +89,7 @@ export default class ChannelMembersModal extends React.Component {
} }
ChannelMembersModal.propTypes = { ChannelMembersModal.propTypes = {
onModalDismissed: React.PropTypes.func.isRequired, onModalDismissed: PropTypes.func.isRequired,
showInviteModal: React.PropTypes.func.isRequired, showInviteModal: PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired channel: PropTypes.object.isRequired
}; };

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

@@ -5,6 +5,7 @@ import SettingItemMin from 'components/setting_item_min.jsx';
import SettingItemMax from 'components/setting_item_max.jsx'; import SettingItemMax from 'components/setting_item_max.jsx';
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -643,8 +644,8 @@ export default class ChannelNotificationsModal extends React.Component {
} }
ChannelNotificationsModal.propTypes = { ChannelNotificationsModal.propTypes = {
onHide: React.PropTypes.func.isRequired, onHide: PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired, channel: PropTypes.object.isRequired,
channelMember: React.PropTypes.object.isRequired, channelMember: PropTypes.object.isRequired,
currentUser: React.PropTypes.object.isRequired currentUser: PropTypes.object.isRequired
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -11,11 +13,11 @@ import {sortChannelsByDisplayName} from 'utils/channel_utils.jsx';
export default class ChannelSelect extends React.Component { export default class ChannelSelect extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
onChange: React.PropTypes.func, onChange: PropTypes.func,
value: React.PropTypes.string, value: PropTypes.string,
selectOpen: React.PropTypes.bool.isRequired, selectOpen: PropTypes.bool.isRequired,
selectPrivate: React.PropTypes.bool.isRequired, selectPrivate: PropTypes.bool.isRequired,
selectDm: React.PropTypes.bool.isRequired selectDm: PropTypes.bool.isRequired
}; };
} }

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

@@ -16,6 +16,8 @@ import UserStore from 'stores/user_store.jsx';
import Constants from 'utils/constants.jsx'; import Constants from 'utils/constants.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import $ from 'jquery'; import $ from 'jquery';
@@ -206,7 +208,7 @@ export default class SwitchChannelModal extends React.Component {
} }
SwitchChannelModal.propTypes = { SwitchChannelModal.propTypes = {
show: React.PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
onHide: React.PropTypes.func.isRequired onHide: PropTypes.func.isRequired
}; };

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

@@ -2,6 +2,7 @@
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import * as UserAgent from 'utils/user_agent.jsx'; import * as UserAgent from 'utils/user_agent.jsx';
@@ -91,5 +92,5 @@ ChannelView.defaultProps = {
}; };
ChannelView.propTypes = { ChannelView.propTypes = {
params: React.PropTypes.object.isRequired params: PropTypes.object.isRequired
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -54,6 +56,6 @@ export default class ClaimController extends React.Component {
ClaimController.defaultProps = { ClaimController.defaultProps = {
}; };
ClaimController.propTypes = { ClaimController.propTypes = {
location: React.PropTypes.object.isRequired, location: PropTypes.object.isRequired,
children: React.PropTypes.node children: PropTypes.node
}; };

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

@@ -8,6 +8,8 @@ import * as Utils from 'utils/utils.jsx';
import {checkMfa} from 'actions/user_actions.jsx'; import {checkMfa} from 'actions/user_actions.jsx';
import {emailToLdap} from 'actions/admin_actions.jsx'; import {emailToLdap} from 'actions/admin_actions.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -253,5 +255,5 @@ export default class EmailToLDAP extends React.Component {
EmailToLDAP.defaultProps = { EmailToLDAP.defaultProps = {
}; };
EmailToLDAP.propTypes = { EmailToLDAP.propTypes = {
email: React.PropTypes.string email: PropTypes.string
}; };

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

@@ -9,6 +9,8 @@ import Constants from 'utils/constants.jsx';
import {checkMfa} from 'actions/user_actions.jsx'; import {checkMfa} from 'actions/user_actions.jsx';
import {emailToOAuth} from 'actions/admin_actions.jsx'; import {emailToOAuth} from 'actions/admin_actions.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -171,6 +173,6 @@ export default class EmailToOAuth extends React.Component {
EmailToOAuth.defaultProps = { EmailToOAuth.defaultProps = {
}; };
EmailToOAuth.propTypes = { EmailToOAuth.propTypes = {
newType: React.PropTypes.string, newType: PropTypes.string,
email: React.PropTypes.string email: PropTypes.string
}; };

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

@@ -7,6 +7,8 @@ import * as Utils from 'utils/utils.jsx';
import {checkMfa, switchFromLdapToEmail} from 'actions/user_actions.jsx'; import {checkMfa, switchFromLdapToEmail} from 'actions/user_actions.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -240,5 +242,5 @@ export default class LDAPToEmail extends React.Component {
LDAPToEmail.defaultProps = { LDAPToEmail.defaultProps = {
}; };
LDAPToEmail.propTypes = { LDAPToEmail.propTypes = {
email: React.PropTypes.string email: PropTypes.string
}; };

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

@@ -4,6 +4,8 @@
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import Constants from 'utils/constants.jsx'; import Constants from 'utils/constants.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -139,6 +141,6 @@ export default class OAuthToEmail extends React.Component {
OAuthToEmail.defaultProps = { OAuthToEmail.defaultProps = {
}; };
OAuthToEmail.propTypes = { OAuthToEmail.propTypes = {
currentType: React.PropTypes.string, currentType: PropTypes.string,
email: React.PropTypes.string email: PropTypes.string
}; };

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

@@ -2,6 +2,7 @@
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import * as SyntaxHighlighting from 'utils/syntax_highlighting.jsx'; import * as SyntaxHighlighting from 'utils/syntax_highlighting.jsx';
@@ -136,6 +137,6 @@ export default class CodePreview extends React.Component {
} }
CodePreview.propTypes = { CodePreview.propTypes = {
fileInfo: React.PropTypes.object.isRequired, fileInfo: PropTypes.object.isRequired,
fileUrl: React.PropTypes.string.isRequired fileUrl: PropTypes.string.isRequired
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -41,11 +43,11 @@ export default function CommentIcon(props) {
} }
CommentIcon.propTypes = { CommentIcon.propTypes = {
idPrefix: React.PropTypes.string.isRequired, idPrefix: PropTypes.string.isRequired,
idCount: React.PropTypes.number, idCount: PropTypes.number,
handleCommentClick: React.PropTypes.func.isRequired, handleCommentClick: PropTypes.func.isRequired,
searchStyle: React.PropTypes.string, searchStyle: PropTypes.string,
commentCount: React.PropTypes.number commentCount: PropTypes.number
}; };
CommentIcon.defaultProps = { CommentIcon.defaultProps = {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -72,11 +74,11 @@ export default function PostFlagIcon(props) {
} }
PostFlagIcon.propTypes = { PostFlagIcon.propTypes = {
idPrefix: React.PropTypes.string.isRequired, idPrefix: PropTypes.string.isRequired,
idCount: React.PropTypes.number, idCount: PropTypes.number,
postId: React.PropTypes.string.isRequired, postId: PropTypes.string.isRequired,
isFlagged: React.PropTypes.bool.isRequired, isFlagged: PropTypes.bool.isRequired,
isEphemeral: React.PropTypes.bool isEphemeral: PropTypes.bool
}; };
PostFlagIcon.defaultProps = { PostFlagIcon.defaultProps = {

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

@@ -4,6 +4,8 @@
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class ConfirmModal extends React.Component { export default class ConfirmModal extends React.Component {
@@ -71,11 +73,11 @@ ConfirmModal.defaultProps = {
confirmButton: '' confirmButton: ''
}; };
ConfirmModal.propTypes = { ConfirmModal.propTypes = {
show: React.PropTypes.bool.isRequired, show: PropTypes.bool.isRequired,
title: React.PropTypes.node, title: PropTypes.node,
message: React.PropTypes.node, message: PropTypes.node,
confirmButtonClass: React.PropTypes.string, confirmButtonClass: PropTypes.string,
confirmButton: React.PropTypes.node, confirmButton: PropTypes.node,
onConfirm: React.PropTypes.func.isRequired, onConfirm: PropTypes.func.isRequired,
onCancel: React.PropTypes.func.isRequired onCancel: PropTypes.func.isRequired
}; };

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

@@ -30,6 +30,7 @@ const ActionTypes = Constants.ActionTypes;
const KeyCodes = Constants.KeyCodes; const KeyCodes = Constants.KeyCodes;
import {REACTION_PATTERN, EMOJI_PATTERN} from './create_post.jsx'; import {REACTION_PATTERN, EMOJI_PATTERN} from './create_post.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class CreateComment extends React.Component { export default class CreateComment extends React.Component {
@@ -659,7 +660,7 @@ export default class CreateComment extends React.Component {
} }
CreateComment.propTypes = { CreateComment.propTypes = {
channelId: React.PropTypes.string.isRequired, channelId: PropTypes.string.isRequired,
rootId: React.PropTypes.string.isRequired, rootId: PropTypes.string.isRequired,
latestPostId: React.PropTypes.string latestPostId: PropTypes.string
}; };

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

@@ -8,6 +8,8 @@ import {cleanUpUrlable} from 'utils/url.jsx';
import logoImage from 'images/logo.png'; import logoImage from 'images/logo.png';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -124,6 +126,6 @@ export default class TeamSignupDisplayNamePage extends React.Component {
} }
TeamSignupDisplayNamePage.propTypes = { TeamSignupDisplayNamePage.propTypes = {
state: React.PropTypes.object, state: PropTypes.object,
updateParent: React.PropTypes.func updateParent: PropTypes.func
}; };

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

@@ -8,6 +8,8 @@ import * as URL from 'utils/url.jsx';
import logoImage from 'images/logo.png'; import logoImage from 'images/logo.png';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import {Button, Tooltip, OverlayTrigger} from 'react-bootstrap'; import {Button, Tooltip, OverlayTrigger} from 'react-bootstrap';
@@ -242,6 +244,6 @@ export default class TeamUrl extends React.Component {
} }
TeamUrl.propTypes = { TeamUrl.propTypes = {
state: React.PropTypes.object, state: PropTypes.object,
updateParent: React.PropTypes.func updateParent: PropTypes.func
}; };

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

@@ -8,6 +8,8 @@ import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import {browserHistory, Link} from 'react-router/es6'; import {browserHistory, Link} from 'react-router/es6';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class CreateTeamController extends React.Component { export default class CreateTeamController extends React.Component {
@@ -90,5 +92,5 @@ export default class CreateTeamController extends React.Component {
} }
CreateTeamController.propTypes = { CreateTeamController.propTypes = {
children: React.PropTypes.node children: PropTypes.node
}; };

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

@@ -8,6 +8,8 @@ import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router/es6'; import {browserHistory} from 'react-router/es6';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {deleteChannel} from 'actions/channel_actions.jsx'; import {deleteChannel} from 'actions/channel_actions.jsx';
@@ -99,6 +101,6 @@ export default class DeleteChannelModal extends React.Component {
} }
DeleteChannelModal.propTypes = { DeleteChannelModal.propTypes = {
onHide: React.PropTypes.func.isRequired, onHide: PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired channel: PropTypes.object.isRequired
}; };

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

@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import ConfirmModal from './confirm_modal.jsx'; import ConfirmModal from './confirm_modal.jsx';
@@ -67,5 +68,5 @@ export default class DeleteModalTrigger extends React.Component {
} }
DeleteModalTrigger.propTypes = { DeleteModalTrigger.propTypes = {
onDelete: React.PropTypes.func.isRequired onDelete: PropTypes.func.isRequired
}; };

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

@@ -8,6 +8,8 @@ import {browserHistory, Link} from 'react-router/es6';
import {verifyEmail} from 'actions/user_actions.jsx'; import {verifyEmail} from 'actions/user_actions.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class DoVerifyEmail extends React.Component { export default class DoVerifyEmail extends React.Component {
@@ -75,5 +77,5 @@ export default class DoVerifyEmail extends React.Component {
DoVerifyEmail.defaultProps = { DoVerifyEmail.defaultProps = {
}; };
DoVerifyEmail.propTypes = { DoVerifyEmail.propTypes = {
location: React.PropTypes.object.isRequired location: PropTypes.object.isRequired
}; };

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

@@ -23,6 +23,8 @@ const holders = defineMessages({
} }
}); });
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
class EditChannelHeaderModal extends React.Component { class EditChannelHeaderModal extends React.Component {
@@ -221,8 +223,8 @@ class EditChannelHeaderModal extends React.Component {
EditChannelHeaderModal.propTypes = { EditChannelHeaderModal.propTypes = {
intl: intlShape.isRequired, intl: intlShape.isRequired,
onHide: React.PropTypes.func.isRequired, onHide: PropTypes.func.isRequired,
channel: React.PropTypes.object.isRequired channel: PropTypes.object.isRequired
}; };
export default injectIntl(EditChannelHeaderModal); export default injectIntl(EditChannelHeaderModal);

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

@@ -6,6 +6,8 @@ import PreferenceStore from 'stores/preference_store.jsx';
import Constants from 'utils/constants.jsx'; import Constants from 'utils/constants.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Modal} from 'react-bootstrap'; import {Modal} from 'react-bootstrap';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -181,6 +183,6 @@ export default class EditChannelPurposeModal extends React.Component {
} }
EditChannelPurposeModal.propTypes = { EditChannelPurposeModal.propTypes = {
channel: React.PropTypes.object, channel: PropTypes.object,
onModalDismissed: React.PropTypes.func.isRequired onModalDismissed: PropTypes.func.isRequired
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -14,12 +16,12 @@ import SpinnerButton from 'components/spinner_button.jsx';
export default class AddEmoji extends React.Component { export default class AddEmoji extends React.Component {
static propTypes = { static propTypes = {
team: React.PropTypes.object, team: PropTypes.object,
user: React.PropTypes.object user: PropTypes.object
}; };
static contextTypes = { static contextTypes = {
router: React.PropTypes.object.isRequired router: PropTypes.object.isRequired
}; };
constructor(props) { constructor(props) {

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

@@ -1,3 +1,4 @@
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -45,5 +46,5 @@ export default class DeleteEmoji extends DeleteModalTrigger {
} }
DeleteEmoji.propTypes = { DeleteEmoji.propTypes = {
onDelete: React.PropTypes.func.isRequired onDelete: PropTypes.func.isRequired
}; };

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

@@ -12,6 +12,8 @@ import {loadEmoji} from 'actions/emoji_actions.jsx';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {Link} from 'react-router'; import {Link} from 'react-router';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -19,8 +21,8 @@ import {FormattedMessage} from 'react-intl';
export default class EmojiList extends React.Component { export default class EmojiList extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
team: React.PropTypes.object, team: PropTypes.object,
user: React.PropTypes.object user: PropTypes.object
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -13,10 +15,10 @@ import {FormattedMessage} from 'react-intl';
export default class EmojiListItem extends React.Component { export default class EmojiListItem extends React.Component {
static get propTypes() { static get propTypes() {
return { return {
emoji: React.PropTypes.object.isRequired, emoji: PropTypes.object.isRequired,
onDelete: React.PropTypes.func.isRequired, onDelete: PropTypes.func.isRequired,
filter: React.PropTypes.string, filter: PropTypes.string,
creator: React.PropTypes.object.isRequired creator: PropTypes.object.isRequired
}; };
} }

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -5,10 +7,10 @@ import React from 'react';
export default class EmojiPickerCategory extends React.Component { export default class EmojiPickerCategory extends React.Component {
static propTypes = { static propTypes = {
category: React.PropTypes.string.isRequired, category: PropTypes.string.isRequired,
icon: React.PropTypes.node.isRequired, icon: PropTypes.node.isRequired,
onCategoryClick: React.PropTypes.func.isRequired, onCategoryClick: PropTypes.func.isRequired,
selected: React.PropTypes.bool.isRequired selected: PropTypes.bool.isRequired
} }
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -7,12 +9,12 @@ import EmojiStore from 'stores/emoji_store.jsx';
export default class EmojiPickerItem extends React.Component { export default class EmojiPickerItem extends React.Component {
static propTypes = { static propTypes = {
emoji: React.PropTypes.object.isRequired, emoji: PropTypes.object.isRequired,
onItemOver: React.PropTypes.func.isRequired, onItemOver: PropTypes.func.isRequired,
onItemOut: React.PropTypes.func.isRequired, onItemOut: PropTypes.func.isRequired,
onItemClick: React.PropTypes.func.isRequired, onItemClick: PropTypes.func.isRequired,
onItemUnmount: React.PropTypes.func.isRequired, onItemUnmount: PropTypes.func.isRequired,
category: React.PropTypes.string.isRequired category: PropTypes.string.isRequired
} }
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -9,7 +11,7 @@ import {FormattedMessage} from 'react-intl';
export default class EmojiPickerPreview extends React.Component { export default class EmojiPickerPreview extends React.Component {
static propTypes = { static propTypes = {
emoji: React.PropTypes.object emoji: PropTypes.object
} }
render() { render() {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -30,11 +32,11 @@ const CATEGORIES = [
class EmojiPicker extends React.Component { class EmojiPicker extends React.Component {
static propTypes = { static propTypes = {
customEmojis: React.PropTypes.object, customEmojis: PropTypes.object,
onEmojiClick: React.PropTypes.func.isRequired, onEmojiClick: PropTypes.func.isRequired,
pickerLocation: React.PropTypes.string.isRequired, pickerLocation: PropTypes.string.isRequired,
emojiOffset: React.PropTypes.number, emojiOffset: PropTypes.number,
outsideClick: React.PropTypes.func outsideClick: PropTypes.func
} }
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -9,7 +11,7 @@ import EmojiPicker from './emoji_picker.jsx';
export default class EmojiPickerContainer extends React.Component { export default class EmojiPickerContainer extends React.Component {
static propTypes = { static propTypes = {
onEmojiClick: React.PropTypes.func.isRequred onEmojiClick: PropTypes.func.isRequred
} }
constructor(props) { constructor(props) {

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

@@ -2,6 +2,7 @@
// See License.txt for license information. // See License.txt for license information.
import $ from 'jquery'; import $ from 'jquery';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import {Link} from 'react-router/es6'; import {Link} from 'react-router/es6';
@@ -12,7 +13,7 @@ import * as Utils from 'utils/utils.jsx';
export default class ErrorPage extends React.Component { export default class ErrorPage extends React.Component {
static propTypes = { static propTypes = {
location: React.PropTypes.object.isRequired location: PropTypes.object.isRequired
}; };
constructor(props) { constructor(props) {

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

@@ -7,6 +7,8 @@ import * as Utils from 'utils/utils.jsx';
import {Tooltip, OverlayTrigger} from 'react-bootstrap'; import {Tooltip, OverlayTrigger} from 'react-bootstrap';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class FileAttachment extends React.Component { export default class FileAttachment extends React.Component {
@@ -172,13 +174,13 @@ export default class FileAttachment extends React.Component {
} }
FileAttachment.propTypes = { FileAttachment.propTypes = {
fileInfo: React.PropTypes.object.isRequired, fileInfo: PropTypes.object.isRequired,
// the index of this attachment preview in the parent FileAttachmentList // the index of this attachment preview in the parent FileAttachmentList
index: React.PropTypes.number.isRequired, index: PropTypes.number.isRequired,
// handler for when the thumbnail is clicked passed the index above // handler for when the thumbnail is clicked passed the index above
handleImageClick: React.PropTypes.func, handleImageClick: PropTypes.func,
compactDisplay: React.PropTypes.bool compactDisplay: PropTypes.bool
}; };

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

@@ -5,6 +5,8 @@ import ViewImageModal from './view_image.jsx';
import FileAttachment from './file_attachment.jsx'; import FileAttachment from './file_attachment.jsx';
import Constants from 'utils/constants.jsx'; import Constants from 'utils/constants.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
export default class FileAttachmentList extends React.Component { export default class FileAttachmentList extends React.Component {
@@ -65,7 +67,7 @@ export default class FileAttachmentList extends React.Component {
} }
FileAttachmentList.propTypes = { FileAttachmentList.propTypes = {
fileCount: React.PropTypes.number.isRequired, fileCount: PropTypes.number.isRequired,
fileInfos: React.PropTypes.arrayOf(React.PropTypes.object), fileInfos: PropTypes.arrayOf(PropTypes.object),
compactDisplay: React.PropTypes.bool compactDisplay: PropTypes.bool
}; };

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -10,8 +12,8 @@ import FileAttachmentList from './file_attachment_list.jsx';
export default class FileAttachmentListContainer extends React.Component { export default class FileAttachmentListContainer extends React.Component {
static propTypes = { static propTypes = {
post: React.PropTypes.object.isRequired, post: PropTypes.object.isRequired,
compactDisplay: React.PropTypes.bool.isRequired compactDisplay: PropTypes.bool.isRequired
} }
constructor(props) { constructor(props) {

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

@@ -1,3 +1,5 @@
import PropTypes from 'prop-types';
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
@@ -54,6 +56,6 @@ export default class FileInfoPreview extends React.Component {
} }
FileInfoPreview.propTypes = { FileInfoPreview.propTypes = {
fileInfo: React.PropTypes.object.isRequired, fileInfo: PropTypes.object.isRequired,
fileUrl: React.PropTypes.string.isRequired fileUrl: PropTypes.string.isRequired
}; };

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

@@ -5,6 +5,8 @@ import FileStore from 'stores/file_store.jsx';
import ReactDOM from 'react-dom'; import ReactDOM from 'react-dom';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
import loadingGif from 'images/load.gif'; import loadingGif from 'images/load.gif';
@@ -99,7 +101,7 @@ FilePreview.defaultProps = {
uploadsInProgress: [] uploadsInProgress: []
}; };
FilePreview.propTypes = { FilePreview.propTypes = {
onRemove: React.PropTypes.func.isRequired, onRemove: PropTypes.func.isRequired,
fileInfos: React.PropTypes.arrayOf(React.PropTypes.object).isRequired, fileInfos: PropTypes.arrayOf(PropTypes.object).isRequired,
uploadsInProgress: React.PropTypes.array uploadsInProgress: PropTypes.array
}; };

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

@@ -33,6 +33,8 @@ const holders = defineMessages({
} }
}); });
import PropTypes from 'prop-types';
import React from 'react'; import React from 'react';
const OverlayTimeout = 500; const OverlayTimeout = 500;
@@ -422,19 +424,19 @@ class FileUpload extends React.Component {
FileUpload.propTypes = { FileUpload.propTypes = {
intl: intlShape.isRequired, intl: intlShape.isRequired,
onUploadError: React.PropTypes.func, onUploadError: PropTypes.func,
getFileCount: React.PropTypes.func, getFileCount: PropTypes.func,
getTarget: React.PropTypes.func.isRequired, getTarget: PropTypes.func.isRequired,
onClick: React.PropTypes.func, onClick: PropTypes.func,
onFileUpload: React.PropTypes.func, onFileUpload: PropTypes.func,
onUploadStart: React.PropTypes.func, onUploadStart: PropTypes.func,
onFileUploadChange: React.PropTypes.func, onFileUploadChange: PropTypes.func,
onTextDrop: React.PropTypes.func, onTextDrop: PropTypes.func,
channelId: React.PropTypes.string, channelId: PropTypes.string,
postType: React.PropTypes.string, postType: PropTypes.string,
onEmojiClick: React.PropTypes.func, onEmojiClick: PropTypes.func,
navBarName: React.PropTypes.string, navBarName: PropTypes.string,
emojiEnabled: React.PropTypes.bool emojiEnabled: PropTypes.bool
}; };
export default injectIntl(FileUpload, {withRef: true}); export default injectIntl(FileUpload, {withRef: true});

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше