From 132d4cdf8f01b068ec9c343a4ecbf1e7e23e19e5 Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Tue, 29 Mar 2016 15:13:31 -0400 Subject: Moved backstage integrations pages to /settings/integrations --- .../components/backstage/add_incoming_webhook.jsx | 27 ++-------------- webapp/components/backstage/add_integration.jsx | 36 ++-------------------- .../components/backstage/add_outgoing_webhook.jsx | 27 ++-------------- webapp/components/backstage/backstage_sidebar.jsx | 36 +--------------------- .../backstage/installed_integrations.jsx | 17 +--------- webapp/components/navbar_dropdown.jsx | 2 +- webapp/root.jsx | 2 +- 7 files changed, 10 insertions(+), 137 deletions(-) (limited to 'webapp') diff --git a/webapp/components/backstage/add_incoming_webhook.jsx b/webapp/components/backstage/add_incoming_webhook.jsx index 8beec3ff5..fa7531fc6 100644 --- a/webapp/components/backstage/add_incoming_webhook.jsx +++ b/webapp/components/backstage/add_incoming_webhook.jsx @@ -5,7 +5,6 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; import {browserHistory} from 'react-router'; -import TeamStore from 'stores/team_store.jsx'; import ChannelSelect from 'components/channel_select.jsx'; import {FormattedMessage} from 'react-intl'; @@ -17,7 +16,6 @@ export default class AddIncomingWebhook extends React.Component { constructor(props) { super(props); - this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.updateName = this.updateName.bind(this); @@ -25,7 +23,6 @@ export default class AddIncomingWebhook extends React.Component { this.updateChannelId = this.updateChannelId.bind(this); this.state = { - team: TeamStore.getCurrent(), name: '', description: '', channelId: '', @@ -35,20 +32,6 @@ export default class AddIncomingWebhook extends React.Component { }; } - componentDidMount() { - TeamStore.addChangeListener(this.handleChange); - } - - componentWillUnmount() { - TeamStore.removeChangeListener(this.handleChange); - } - - handleChange() { - this.setState({ - team: TeamStore.getCurrent() - }); - } - handleSubmit(e) { e.preventDefault(); @@ -83,7 +66,7 @@ export default class AddIncomingWebhook extends React.Component { AsyncClient.addIncomingHook( hook, () => { - browserHistory.push(`/${this.state.team.name}/integrations/installed`); + browserHistory.push('/settings/integrations/installed'); }, (err) => { this.setState({ @@ -112,12 +95,6 @@ export default class AddIncomingWebhook extends React.Component { } render() { - const team = TeamStore.getCurrent(); - - if (!team) { - return null; - } - return (
@@ -184,7 +161,7 @@ export default class AddIncomingWebhook extends React.Component {
} - link={`/${team.name}/integrations/add/incoming_webhook`} + link={'/settings/integrations/add/incoming_webhook'} /> ); } @@ -83,7 +51,7 @@ export default class AddIntegration extends React.Component { defaultMessage='Create webhooks to send new message events to an external integration.' /> } - link={`/${team.name}/integrations/add/outgoing_webhook`} + link={'/settings/integrations/add/outgoing_webhook'} /> ); } diff --git a/webapp/components/backstage/add_outgoing_webhook.jsx b/webapp/components/backstage/add_outgoing_webhook.jsx index ea530ff57..3ae2f8606 100644 --- a/webapp/components/backstage/add_outgoing_webhook.jsx +++ b/webapp/components/backstage/add_outgoing_webhook.jsx @@ -5,7 +5,6 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; import {browserHistory} from 'react-router'; -import TeamStore from 'stores/team_store.jsx'; import ChannelSelect from 'components/channel_select.jsx'; import {FormattedMessage} from 'react-intl'; @@ -17,7 +16,6 @@ export default class AddOutgoingWebhook extends React.Component { constructor(props) { super(props); - this.handleChange = this.handleChange.bind(this); this.handleSubmit = this.handleSubmit.bind(this); this.updateName = this.updateName.bind(this); @@ -27,7 +25,6 @@ export default class AddOutgoingWebhook extends React.Component { this.updateCallbackUrls = this.updateCallbackUrls.bind(this); this.state = { - team: TeamStore.getCurrent(), name: '', description: '', channelId: '', @@ -39,20 +36,6 @@ export default class AddOutgoingWebhook extends React.Component { }; } - componentDidMount() { - TeamStore.addChangeListener(this.handleChange); - } - - componentWillUnmount() { - TeamStore.removeChangeListener(this.handleChange); - } - - handleChange() { - this.setState({ - team: TeamStore.getCurrent() - }); - } - handleSubmit(e) { e.preventDefault(); @@ -103,7 +86,7 @@ export default class AddOutgoingWebhook extends React.Component { AsyncClient.addOutgoingHook( hook, () => { - browserHistory.push(`/${this.state.team.name}/integrations/installed`); + browserHistory.push('/settings/integrations/installed'); }, (err) => { this.setState({ @@ -144,12 +127,6 @@ export default class AddOutgoingWebhook extends React.Component { } render() { - const team = TeamStore.getCurrent(); - - if (!team) { - return null; - } - return (
@@ -250,7 +227,7 @@ export default class AddOutgoingWebhook extends React.Component {
    )} - collapsible={true} >