summaryrefslogtreecommitdiffstats
path: root/webapp/components/integrations
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/integrations')
-rw-r--r--webapp/components/integrations/components/add_command.jsx4
-rw-r--r--webapp/components/integrations/components/add_incoming_webhook.jsx2
-rw-r--r--webapp/components/integrations/components/add_oauth_app.jsx2
-rw-r--r--webapp/components/integrations/components/add_outgoing_webhook.jsx13
-rw-r--r--webapp/components/integrations/components/commands_container.jsx11
-rw-r--r--webapp/components/integrations/components/confirm_integration.jsx8
-rw-r--r--webapp/components/integrations/components/edit_command.jsx4
-rw-r--r--webapp/components/integrations/components/installed_command.jsx8
-rw-r--r--webapp/components/integrations/components/installed_commands.jsx9
-rw-r--r--webapp/components/integrations/components/installed_incoming_webhooks.jsx2
-rw-r--r--webapp/components/integrations/components/installed_oauth_apps.jsx2
-rw-r--r--webapp/components/integrations/components/installed_outgoing_webhooks.jsx2
-rw-r--r--webapp/components/integrations/components/integrations.jsx4
13 files changed, 34 insertions, 37 deletions
diff --git a/webapp/components/integrations/components/add_command.jsx b/webapp/components/integrations/components/add_command.jsx
index 6ca1cf100..ccff14c55 100644
--- a/webapp/components/integrations/components/add_command.jsx
+++ b/webapp/components/integrations/components/add_command.jsx
@@ -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
diff --git a/webapp/components/integrations/components/add_incoming_webhook.jsx b/webapp/components/integrations/components/add_incoming_webhook.jsx
index b65696965..0372fbbcb 100644
--- a/webapp/components/integrations/components/add_incoming_webhook.jsx
+++ b/webapp/components/integrations/components/add_incoming_webhook.jsx
@@ -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
};
}
diff --git a/webapp/components/integrations/components/add_oauth_app.jsx b/webapp/components/integrations/components/add_oauth_app.jsx
index 4c01c5af0..701cbad76 100644
--- a/webapp/components/integrations/components/add_oauth_app.jsx
+++ b/webapp/components/integrations/components/add_oauth_app.jsx
@@ -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
};
}
diff --git a/webapp/components/integrations/components/add_outgoing_webhook.jsx b/webapp/components/integrations/components/add_outgoing_webhook.jsx
index c3d9b0933..9e9aaaeb2 100644
--- a/webapp/components/integrations/components/add_outgoing_webhook.jsx
+++ b/webapp/components/integrations/components/add_outgoing_webhook.jsx
@@ -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'>
diff --git a/webapp/components/integrations/components/commands_container.jsx b/webapp/components/integrations/components/commands_container.jsx
index 1c2b7af3e..4ab465218 100644
--- a/webapp/components/integrations/components/commands_container.jsx
+++ b/webapp/components/integrations/components/commands_container.jsx
@@ -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),
diff --git a/webapp/components/integrations/components/confirm_integration.jsx b/webapp/components/integrations/components/confirm_integration.jsx
index 1cc1e727b..6d778f241 100644
--- a/webapp/components/integrations/components/confirm_integration.jsx
+++ b/webapp/components/integrations/components/confirm_integration.jsx
@@ -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).'
diff --git a/webapp/components/integrations/components/edit_command.jsx b/webapp/components/integrations/components/edit_command.jsx
index 395c977ca..ac2c12bff 100644
--- a/webapp/components/integrations/components/edit_command.jsx
+++ b/webapp/components/integrations/components/edit_command.jsx
@@ -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
diff --git a/webapp/components/integrations/components/installed_command.jsx b/webapp/components/integrations/components/installed_command.jsx
index ecd7d9608..96ccaf3e3 100644
--- a/webapp/components/integrations/components/installed_command.jsx
+++ b/webapp/components/integrations/components/installed_command.jsx
@@ -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='#'
diff --git a/webapp/components/integrations/components/installed_commands.jsx b/webapp/components/integrations/components/installed_commands.jsx
index da4d871fa..e080cd706 100644
--- a/webapp/components/integrations/components/installed_commands.jsx
+++ b/webapp/components/integrations/components/installed_commands.jsx
@@ -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}
diff --git a/webapp/components/integrations/components/installed_incoming_webhooks.jsx b/webapp/components/integrations/components/installed_incoming_webhooks.jsx
index 0b6ea18c7..ed98f1053 100644
--- a/webapp/components/integrations/components/installed_incoming_webhooks.jsx
+++ b/webapp/components/integrations/components/installed_incoming_webhooks.jsx
@@ -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
};
}
diff --git a/webapp/components/integrations/components/installed_oauth_apps.jsx b/webapp/components/integrations/components/installed_oauth_apps.jsx
index 322c95511..da5f16aec 100644
--- a/webapp/components/integrations/components/installed_oauth_apps.jsx
+++ b/webapp/components/integrations/components/installed_oauth_apps.jsx
@@ -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
};
}
diff --git a/webapp/components/integrations/components/installed_outgoing_webhooks.jsx b/webapp/components/integrations/components/installed_outgoing_webhooks.jsx
index 21176f8b7..4e9a0260f 100644
--- a/webapp/components/integrations/components/installed_outgoing_webhooks.jsx
+++ b/webapp/components/integrations/components/installed_outgoing_webhooks.jsx
@@ -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
};
}
diff --git a/webapp/components/integrations/components/integrations.jsx b/webapp/components/integrations/components/integrations.jsx
index 9dc64d0cf..580e70cf6 100644
--- a/webapp/components/integrations/components/integrations.jsx
+++ b/webapp/components/integrations/components/integrations.jsx
@@ -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
};
}