diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-05-12 12:11:02 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-12 12:11:02 -0400 |
commit | d1efb66ad7b017f0fbfe6f0c20843b30f396e504 (patch) | |
tree | 5b48a38382015de815b2d45d58836c5ca06b631c /webapp/components/backstage | |
parent | 3f0325fd223dcb3a6eec92f772df1e7541ab0b2b (diff) | |
parent | 9a701b7e5b31ca803a2d92f0b3b1d7cc68bf3c37 (diff) | |
download | chat-d1efb66ad7b017f0fbfe6f0c20843b30f396e504.tar.gz chat-d1efb66ad7b017f0fbfe6f0c20843b30f396e504.tar.bz2 chat-d1efb66ad7b017f0fbfe6f0c20843b30f396e504.zip |
Merge branch 'release-3.0'
Diffstat (limited to 'webapp/components/backstage')
3 files changed, 30 insertions, 15 deletions
diff --git a/webapp/components/backstage/installed_commands.jsx b/webapp/components/backstage/installed_commands.jsx index 71373e077..df1f56687 100644 --- a/webapp/components/backstage/installed_commands.jsx +++ b/webapp/components/backstage/installed_commands.jsx @@ -5,6 +5,7 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; import IntegrationStore from 'stores/integration_store.jsx'; +import TeamStore from 'stores/team_store.jsx'; import * as Utils from 'utils/utils.jsx'; import {FormattedMessage} from 'react-intl'; @@ -20,16 +21,18 @@ export default class InstalledCommands extends React.Component { this.regenCommandToken = this.regenCommandToken.bind(this); this.deleteCommand = this.deleteCommand.bind(this); + const teamId = TeamStore.getCurrentId(); + this.state = { - commands: IntegrationStore.getCommands(), - loading: !IntegrationStore.hasReceivedCommands() + commands: IntegrationStore.getCommands(teamId), + loading: !IntegrationStore.hasReceivedCommands(teamId) }; } componentDidMount() { IntegrationStore.addChangeListener(this.handleIntegrationChange); - if (window.mm_config.EnableCommands === 'true' && this.state.loading) { + if (window.mm_config.EnableCommands === 'true') { AsyncClient.listTeamCommands(); } } @@ -39,9 +42,11 @@ export default class InstalledCommands extends React.Component { } handleIntegrationChange() { + const teamId = TeamStore.getCurrentId(); + this.setState({ - commands: IntegrationStore.getCommands(), - loading: !IntegrationStore.hasReceivedCommands() + commands: IntegrationStore.getCommands(teamId), + loading: !IntegrationStore.hasReceivedCommands(teamId) }); } diff --git a/webapp/components/backstage/installed_incoming_webhooks.jsx b/webapp/components/backstage/installed_incoming_webhooks.jsx index 389f65919..0a38a6ab5 100644 --- a/webapp/components/backstage/installed_incoming_webhooks.jsx +++ b/webapp/components/backstage/installed_incoming_webhooks.jsx @@ -5,6 +5,7 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; import IntegrationStore from 'stores/integration_store.jsx'; +import TeamStore from 'stores/team_store.jsx'; import * as Utils from 'utils/utils.jsx'; import {FormattedMessage} from 'react-intl'; @@ -19,16 +20,18 @@ export default class InstalledIncomingWebhooks extends React.Component { this.deleteIncomingWebhook = this.deleteIncomingWebhook.bind(this); + const teamId = TeamStore.getCurrentId(); + this.state = { - incomingWebhooks: IntegrationStore.getIncomingWebhooks(), - loading: !IntegrationStore.hasReceivedIncomingWebhooks() + incomingWebhooks: IntegrationStore.getIncomingWebhooks(teamId), + loading: !IntegrationStore.hasReceivedIncomingWebhooks(teamId) }; } componentDidMount() { IntegrationStore.addChangeListener(this.handleIntegrationChange); - if (window.mm_config.EnableIncomingWebhooks === 'true' && this.state.loading) { + if (window.mm_config.EnableIncomingWebhooks === 'true') { AsyncClient.listIncomingHooks(); } } @@ -38,9 +41,11 @@ export default class InstalledIncomingWebhooks extends React.Component { } handleIntegrationChange() { + const teamId = TeamStore.getCurrentId(); + this.setState({ - incomingWebhooks: IntegrationStore.getIncomingWebhooks(), - loading: !IntegrationStore.hasReceivedIncomingWebhooks() + incomingWebhooks: IntegrationStore.getIncomingWebhooks(teamId), + loading: !IntegrationStore.hasReceivedIncomingWebhooks(teamId) }); } diff --git a/webapp/components/backstage/installed_outgoing_webhooks.jsx b/webapp/components/backstage/installed_outgoing_webhooks.jsx index e0817fda8..b79bc3530 100644 --- a/webapp/components/backstage/installed_outgoing_webhooks.jsx +++ b/webapp/components/backstage/installed_outgoing_webhooks.jsx @@ -5,6 +5,7 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; import IntegrationStore from 'stores/integration_store.jsx'; +import TeamStore from 'stores/team_store.jsx'; import * as Utils from 'utils/utils.jsx'; import {FormattedMessage} from 'react-intl'; @@ -20,16 +21,18 @@ export default class InstalledOutgoingWebhooks extends React.Component { this.regenOutgoingWebhookToken = this.regenOutgoingWebhookToken.bind(this); this.deleteOutgoingWebhook = this.deleteOutgoingWebhook.bind(this); + const teamId = TeamStore.getCurrentId(); + this.state = { - outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(), - loading: !IntegrationStore.hasReceivedOutgoingWebhooks() + outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(teamId), + loading: !IntegrationStore.hasReceivedOutgoingWebhooks(teamId) }; } componentDidMount() { IntegrationStore.addChangeListener(this.handleIntegrationChange); - if (window.mm_config.EnableOutgoingWebhooks === 'true' && this.state.loading) { + if (window.mm_config.EnableOutgoingWebhooks === 'true') { AsyncClient.listOutgoingHooks(); } } @@ -39,9 +42,11 @@ export default class InstalledOutgoingWebhooks extends React.Component { } handleIntegrationChange() { + const teamId = TeamStore.getCurrentId(); + this.setState({ - outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(), - loading: !IntegrationStore.hasReceivedOutgoingWebhooks() + outgoingWebhooks: IntegrationStore.getOutgoingWebhooks(teamId), + loading: !IntegrationStore.hasReceivedOutgoingWebhooks(teamId) }); } |