From faf944f47a9bc84365a7ddd949fc7e7b1ac2c057 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 8 Sep 2016 08:49:03 -0400 Subject: Displayed proper token on integration creation confirmation (#3991) --- .../integrations/components/add_command.jsx | 2 +- .../components/add_outgoing_webhook.jsx | 2 +- .../components/confirm_integration.jsx | 22 ++++++---------------- 3 files changed, 8 insertions(+), 18 deletions(-) (limited to 'webapp/components') diff --git a/webapp/components/integrations/components/add_command.jsx b/webapp/components/integrations/components/add_command.jsx index d71fb7c3f..e01358aa7 100644 --- a/webapp/components/integrations/components/add_command.jsx +++ b/webapp/components/integrations/components/add_command.jsx @@ -166,7 +166,7 @@ export default class AddCommand extends React.Component { AsyncClient.addCommand( command, (data) => { - browserHistory.push('/' + this.props.team.name + '/integrations/confirm?type=commands&id=' + data.token); + browserHistory.push('/' + this.props.team.name + '/integrations/confirm?type=commands&id=' + data.id); }, (err) => { this.setState({ diff --git a/webapp/components/integrations/components/add_outgoing_webhook.jsx b/webapp/components/integrations/components/add_outgoing_webhook.jsx index bf0d327ef..c3d9b0933 100644 --- a/webapp/components/integrations/components/add_outgoing_webhook.jsx +++ b/webapp/components/integrations/components/add_outgoing_webhook.jsx @@ -120,7 +120,7 @@ export default class AddOutgoingWebhook extends React.Component { AsyncClient.addOutgoingHook( hook, (data) => { - browserHistory.push('/' + this.props.team.name + '/integrations/confirm?type=outgoing_webhooks&id=' + data.token); + browserHistory.push('/' + this.props.team.name + '/integrations/confirm?type=outgoing_webhooks&id=' + data.id); }, (err) => { this.setState({ diff --git a/webapp/components/integrations/components/confirm_integration.jsx b/webapp/components/integrations/components/confirm_integration.jsx index bb26a9a8a..b9274f2e4 100644 --- a/webapp/components/integrations/components/confirm_integration.jsx +++ b/webapp/components/integrations/components/confirm_integration.jsx @@ -5,8 +5,7 @@ import React from 'react'; import BackstageHeader from 'components/backstage/components/backstage_header.jsx'; import {FormattedMessage, FormattedHTMLMessage} from 'react-intl'; -import {browserHistory, Link} from 'react-router/es6'; -import SpinnerButton from 'components/spinner_button.jsx'; +import {Link} from 'react-router/es6'; import UserStore from 'stores/user_store.jsx'; import IntegrationStore from 'stores/integration_store.jsx'; @@ -24,8 +23,6 @@ export default class ConfirmIntegration extends React.Component { constructor(props) { super(props); - this.handleDone = this.handleDone.bind(this); - this.handleIntegrationChange = this.handleIntegrationChange.bind(this); const userId = UserStore.getCurrentId(); @@ -55,13 +52,6 @@ export default class ConfirmIntegration extends React.Component { }); } - handleDone() { - browserHistory.push('/' + this.props.team.name + '/integrations/' + this.state.type); - this.setState({ - id: '' - }); - } - render() { let headerText = null; let helpText = null; @@ -87,7 +77,7 @@ export default class ConfirmIntegration extends React.Component { id='add_command.token' defaultMessage='Token: {token}' values={{ - token: this.state.id + token: IntegrationStore.getCommand(this.props.team.id, this.state.id).token }} />

@@ -139,7 +129,7 @@ export default class ConfirmIntegration extends React.Component { id='add_outgoing_webhook.token' defaultMessage='Token: {token}' values={{ - token: this.state.id + token: IntegrationStore.getOutgoingWebhook(this.props.team.id, this.state.id).token }} />

@@ -233,16 +223,16 @@ export default class ConfirmIntegration extends React.Component { {helpText} {tokenText}
- - +
-- cgit v1.2.3-1-g7c22