Fix react warnings and part of backstage (#4706)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
05783664cd
Коммит
145876681f
@@ -19,7 +19,7 @@ const REQUEST_GET = 'G';
|
||||
export default class AddCommand extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired
|
||||
team: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ export default class AddCommand extends React.Component {
|
||||
className='form-control'
|
||||
value={this.state.username}
|
||||
onChange={this.updateUsername}
|
||||
placholder={Utils.localizeMessage('add_command.username.placeholder', 'Username')}
|
||||
placeholder={Utils.localizeMessage('add_command.username.placeholder', 'Username')}
|
||||
/>
|
||||
<div className='form__help'>
|
||||
<FormattedMessage
|
||||
|
||||
@@ -15,7 +15,7 @@ import SpinnerButton from 'components/spinner_button.jsx';
|
||||
export default class AddIncomingWebhook extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.PropTypes.object.isRequired
|
||||
team: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import SpinnerButton from 'components/spinner_button.jsx';
|
||||
export default class AddOAuthApp extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired
|
||||
team: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import * as AsyncClient from 'utils/async_client.jsx';
|
||||
import {localizeMessage} from 'utils/utils.jsx';
|
||||
|
||||
import BackstageHeader from 'components/backstage/components/backstage_header.jsx';
|
||||
import ChannelSelect from 'components/channel_select.jsx';
|
||||
@@ -15,7 +16,7 @@ import SpinnerButton from 'components/spinner_button.jsx';
|
||||
export default class AddOutgoingWebhook extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired
|
||||
team: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
@@ -368,18 +369,12 @@ export default class AddOutgoingWebhook extends React.Component {
|
||||
<option
|
||||
value='0'
|
||||
>
|
||||
<FormattedMessage
|
||||
id='add_outgoing_webhook.triggerWordsTriggerWhenFullWord'
|
||||
defaultMessage='First word matches a trigger word exactly'
|
||||
/>
|
||||
{localizeMessage('add_outgoing_webhook.triggerWordsTriggerWhenFullWord', 'First word matches a trigger word exactly')}
|
||||
</option>
|
||||
<option
|
||||
value='1'
|
||||
>
|
||||
<FormattedMessage
|
||||
id='add_outgoing_webhook.triggerWordsTriggerWhenStartsWith'
|
||||
defaultMessage='First word starts with a trigger word'
|
||||
/>
|
||||
{localizeMessage('add_outgoing_webhook.triggerWordsTriggerWhenStartsWith', 'First word starts with a trigger word')}
|
||||
</option>
|
||||
</select>
|
||||
<div className='form__help'>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
import IntegrationStore from 'stores/integration_store.jsx';
|
||||
import TeamStore from 'stores/team_store.jsx';
|
||||
import UserStore from 'stores/user_store.jsx';
|
||||
|
||||
import {loadTeamCommands} from 'actions/integration_actions.jsx';
|
||||
@@ -12,8 +11,8 @@ import React from 'react';
|
||||
export default class CommandsContainer extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired,
|
||||
children: React.propTypes.node.isRequired
|
||||
team: React.PropTypes.object,
|
||||
children: React.PropTypes.node
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,10 +22,10 @@ export default class CommandsContainer extends React.Component {
|
||||
this.handleIntegrationChange = this.handleIntegrationChange.bind(this);
|
||||
this.handleUserChange = this.handleUserChange.bind(this);
|
||||
|
||||
const teamId = TeamStore.getCurrentId();
|
||||
const teamId = this.props.team ? this.props.team.id : '';
|
||||
|
||||
this.state = {
|
||||
commands: IntegrationStore.getCommands(teamId),
|
||||
commands: IntegrationStore.getCommands(teamId) || [],
|
||||
loading: !IntegrationStore.hasReceivedCommands(teamId),
|
||||
users: UserStore.getProfiles()
|
||||
};
|
||||
@@ -47,7 +46,7 @@ export default class CommandsContainer extends React.Component {
|
||||
}
|
||||
|
||||
handleIntegrationChange() {
|
||||
const teamId = TeamStore.getCurrentId();
|
||||
const teamId = this.props.team.id;
|
||||
|
||||
this.setState({
|
||||
commands: IntegrationStore.getCommands(teamId),
|
||||
|
||||
@@ -15,7 +15,7 @@ import Constants from 'utils/constants.jsx';
|
||||
export default class ConfirmIntegration extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.PropTypes.object.isRequired,
|
||||
team: React.PropTypes.object,
|
||||
location: React.PropTypes.object,
|
||||
loading: React.PropTypes.bool
|
||||
};
|
||||
@@ -159,7 +159,7 @@ export default class ConfirmIntegration extends React.Component {
|
||||
|
||||
helpText = [];
|
||||
helpText.push(
|
||||
<p>
|
||||
<p key='add_oauth_app.doneHelp'>
|
||||
<FormattedHTMLMessage
|
||||
id='add_oauth_app.doneHelp'
|
||||
defaultMessage='Your OAuth 2.0 application has been set up. Please use the following Client ID and Client Secret when requesting authorization for your application (see <a href="https://docs.mattermost.com/developer/oauth-2-0-applications.html">documentation</a> for further details).'
|
||||
@@ -167,7 +167,7 @@ export default class ConfirmIntegration extends React.Component {
|
||||
</p>
|
||||
);
|
||||
helpText.push(
|
||||
<p>
|
||||
<p key='add_oauth_app.clientId'>
|
||||
<FormattedHTMLMessage
|
||||
id='add_oauth_app.clientId'
|
||||
defaultMessage='<b>Client ID:</b> {id}'
|
||||
@@ -186,7 +186,7 @@ export default class ConfirmIntegration extends React.Component {
|
||||
);
|
||||
|
||||
helpText.push(
|
||||
<p>
|
||||
<p key='add_oauth_app.doneUrlHelp'>
|
||||
<FormattedHTMLMessage
|
||||
id='add_oauth_app.doneUrlHelp'
|
||||
defaultMessage='The following are your authorized redirect URL(s).'
|
||||
|
||||
@@ -23,7 +23,7 @@ const REQUEST_GET = 'G';
|
||||
export default class EditCommand extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired,
|
||||
team: React.PropTypes.object,
|
||||
location: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
@@ -624,7 +624,7 @@ export default class EditCommand extends React.Component {
|
||||
className='form-control'
|
||||
value={this.state.username}
|
||||
onChange={this.updateUsername}
|
||||
placholder={Utils.localizeMessage('add_command.username.placeholder', 'Username')}
|
||||
placeholder={Utils.localizeMessage('add_command.username.placeholder', 'Username')}
|
||||
/>
|
||||
<div className='form__help'>
|
||||
<FormattedMessage
|
||||
|
||||
@@ -2,11 +2,13 @@
|
||||
// See License.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {Link} from 'react-router';
|
||||
import {FormattedMessage} from 'react-intl';
|
||||
|
||||
export default class InstalledCommand extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.PropTypes.object.isRequired,
|
||||
command: React.PropTypes.object.isRequired,
|
||||
onRegenToken: React.PropTypes.func.isRequired,
|
||||
onDelete: React.PropTypes.func.isRequired,
|
||||
@@ -129,14 +131,14 @@ export default class InstalledCommand extends React.Component {
|
||||
/>
|
||||
</a>
|
||||
{' - '}
|
||||
<a
|
||||
href={'edit?id=' + command.id}
|
||||
<Link
|
||||
to={`/${this.props.team.name}/integrations/commands/edit?id=${command.id}`}
|
||||
>
|
||||
<FormattedMessage
|
||||
id='installed_integrations.edit'
|
||||
defaultMessage='Edit'
|
||||
/>
|
||||
</a>
|
||||
</Link>
|
||||
{' - '}
|
||||
<a
|
||||
href='#'
|
||||
|
||||
@@ -13,10 +13,10 @@ import {FormattedMessage} from 'react-intl';
|
||||
export default class InstalledCommands extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired,
|
||||
users: React.propTypes.object.isRequired,
|
||||
commands: React.propTypes.array.isRequired,
|
||||
loading: React.propTypes.bool.isRequired
|
||||
team: React.PropTypes.object,
|
||||
users: React.PropTypes.object,
|
||||
commands: React.PropTypes.array,
|
||||
loading: React.PropTypes.bool
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ export default class InstalledCommands extends React.Component {
|
||||
return (
|
||||
<InstalledCommand
|
||||
key={command.id}
|
||||
team={this.props.team}
|
||||
command={command}
|
||||
onRegenToken={this.regenCommandToken}
|
||||
onDelete={this.deleteCommand}
|
||||
|
||||
@@ -19,7 +19,7 @@ import {FormattedMessage} from 'react-intl';
|
||||
export default class InstalledIncomingWebhooks extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.PropTypes.object.isRequired
|
||||
team: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import InstalledOAuthApp from './installed_oauth_app.jsx';
|
||||
export default class InstalledOAuthApps extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired
|
||||
team: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ import {FormattedMessage} from 'react-intl';
|
||||
export default class InstalledOutgoingWebhooks extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.propTypes.object.isRequired
|
||||
team: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@ import * as Utils from 'utils/utils.jsx';
|
||||
export default class Integrations extends React.Component {
|
||||
static get propTypes() {
|
||||
return {
|
||||
team: React.PropTypes.object.isRequired,
|
||||
user: React.PropTypes.object.isRequired
|
||||
team: React.PropTypes.object,
|
||||
user: React.PropTypes.object
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user