diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-29 15:13:31 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-29 15:19:04 -0400 |
commit | 132d4cdf8f01b068ec9c343a4ecbf1e7e23e19e5 (patch) | |
tree | 9c9f4db39a0172b4e4752801ac1a0a4d9fe64b18 /webapp/components | |
parent | 46020c7722aff1690aae8f31c443c0c6af4a6083 (diff) | |
download | chat-132d4cdf8f01b068ec9c343a4ecbf1e7e23e19e5.tar.gz chat-132d4cdf8f01b068ec9c343a4ecbf1e7e23e19e5.tar.bz2 chat-132d4cdf8f01b068ec9c343a4ecbf1e7e23e19e5.zip |
Moved backstage integrations pages to /settings/integrations
Diffstat (limited to 'webapp/components')
-rw-r--r-- | webapp/components/backstage/add_incoming_webhook.jsx | 27 | ||||
-rw-r--r-- | webapp/components/backstage/add_integration.jsx | 36 | ||||
-rw-r--r-- | webapp/components/backstage/add_outgoing_webhook.jsx | 27 | ||||
-rw-r--r-- | webapp/components/backstage/backstage_sidebar.jsx | 36 | ||||
-rw-r--r-- | webapp/components/backstage/installed_integrations.jsx | 17 | ||||
-rw-r--r-- | webapp/components/navbar_dropdown.jsx | 2 |
6 files changed, 9 insertions, 136 deletions
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 ( <div className='backstage row'> <div className='add-incoming-webhook'> @@ -184,7 +161,7 @@ export default class AddIncomingWebhook extends React.Component { <div className='add-integration__submit-row'> <Link className='btn btn-sm' - to={`/${team.name}/integrations/add`} + to={'/settings/integrations/add'} > <FormattedMessage id='add_incoming_webhook.cancel' diff --git a/webapp/components/backstage/add_integration.jsx b/webapp/components/backstage/add_integration.jsx index 1e57bd55d..cebc1e8b0 100644 --- a/webapp/components/backstage/add_integration.jsx +++ b/webapp/components/backstage/add_integration.jsx @@ -3,45 +3,13 @@ import React from 'react'; -import TeamStore from 'stores/team_store.jsx'; - import {FormattedMessage} from 'react-intl'; import AddIntegrationOption from './add_integration_option.jsx'; import WebhookIcon from 'images/webhook_icon.jpg'; export default class AddIntegration extends React.Component { - constructor(props) { - super(props); - - this.handleChange = this.handleChange.bind(this); - - this.state = { - team: TeamStore.getCurrent() - }; - } - - componentDidMount() { - TeamStore.addChangeListener(this.handleChange); - } - - componentWillUnmount() { - TeamStore.removeChangeListener(this.handleChange); - } - - handleChange() { - this.setState({ - team: TeamStore.getCurrent() - }); - } - render() { - const team = TeamStore.getCurrent(); - - if (!team) { - return null; - } - const options = []; if (window.mm_config.EnableIncomingWebhooks === 'true') { @@ -61,7 +29,7 @@ export default class AddIntegration extends React.Component { defaultMessage='Create webhook URLs for use in external integrations.' /> } - 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 ( <div className='backstage row'> <div className='add-outgoing-webhook'> @@ -250,7 +227,7 @@ export default class AddOutgoingWebhook extends React.Component { <div className='add-integration__submit-row'> <Link className='btn btn-sm' - to={`/${team.name}/integrations/add`} + to={'/settings/integrations/add'} > <FormattedMessage id='add_outgoing_webhook.cancel' diff --git a/webapp/components/backstage/backstage_sidebar.jsx b/webapp/components/backstage/backstage_sidebar.jsx index ab9afd3fc..63a0df5cb 100644 --- a/webapp/components/backstage/backstage_sidebar.jsx +++ b/webapp/components/backstage/backstage_sidebar.jsx @@ -3,50 +3,18 @@ import React from 'react'; -import TeamStore from 'stores/team_store.jsx'; - import BackstageCategory from './backstage_category.jsx'; import BackstageSection from './backstage_section.jsx'; import {FormattedMessage} from 'react-intl'; export default class BackstageSidebar extends React.Component { - constructor(props) { - super(props); - - this.handleChange = this.handleChange.bind(this); - - this.state = { - team: TeamStore.getCurrent() - }; - } - - componentDidMount() { - TeamStore.addChangeListener(this.handleChange); - } - - componentWillUnmount() { - TeamStore.removeChangeListener(this.handleChange); - } - - handleChange() { - this.setState({ - team: TeamStore.getCurrent() - }); - } - render() { - const team = TeamStore.getCurrent(); - - if (!team) { - return null; - } - return ( <div className='backstage__sidebar'> <ul> <BackstageCategory name='integrations' - parentLink={`/${team.name}`} + parentLink={'/settings'} icon='fa-link' title={ <FormattedMessage @@ -72,7 +40,6 @@ export default class BackstageSidebar extends React.Component { defaultMessage='Add Integration' /> )} - collapsible={true} > <BackstageSection name='incoming_webhook' @@ -99,4 +66,3 @@ export default class BackstageSidebar extends React.Component { ); } } - diff --git a/webapp/components/backstage/installed_integrations.jsx b/webapp/components/backstage/installed_integrations.jsx index 45f289df4..ff0b6e4ec 100644 --- a/webapp/components/backstage/installed_integrations.jsx +++ b/webapp/components/backstage/installed_integrations.jsx @@ -6,7 +6,6 @@ import React from 'react'; import * as AsyncClient from 'utils/async_client.jsx'; import ChannelStore from 'stores/channel_store.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,7 +18,6 @@ export default class InstalledIntegrations extends React.Component { super(props); this.handleIntegrationChange = this.handleIntegrationChange.bind(this); - this.handleTeamChange = this.handleTeamChange.bind(this); this.updateFilter = this.updateFilter.bind(this); this.updateTypeFilter = this.updateTypeFilter.bind(this); @@ -28,7 +26,6 @@ export default class InstalledIntegrations extends React.Component { this.deleteOutgoingWebhook = this.deleteOutgoingWebhook.bind(this); this.state = { - team: TeamStore.getCurrent(), incomingWebhooks: [], outgoingWebhooks: [], typeFilter: '', @@ -38,7 +35,6 @@ export default class InstalledIntegrations extends React.Component { componentWillMount() { IntegrationStore.addChangeListener(this.handleIntegrationChange); - TeamStore.addChangeListener(this.handleTeamChange); if (window.mm_config.EnableIncomingWebhooks === 'true') { if (IntegrationStore.hasReceivedIncomingWebhooks()) { @@ -63,7 +59,6 @@ export default class InstalledIntegrations extends React.Component { componentWillUnmount() { IntegrationStore.removeChangeListener(this.handleIntegrationChange); - TeamStore.removeChangeListener(this.handleTeamChange); } handleIntegrationChange() { @@ -73,12 +68,6 @@ export default class InstalledIntegrations extends React.Component { }); } - handleTeamChange() { - this.setState({ - team: TeamStore.getCurrent() - }); - } - updateTypeFilter(e, typeFilter) { e.preventDefault(); @@ -206,10 +195,6 @@ export default class InstalledIntegrations extends React.Component { } render() { - if (!this.state.team) { - return null; - } - const incomingWebhooks = this.state.incomingWebhooks; const outgoingWebhooks = this.state.outgoingWebhooks; @@ -269,7 +254,7 @@ export default class InstalledIntegrations extends React.Component { </h1> <Link className='add-integrations-link' - to={`/${this.state.team.name}/integrations/add`} + to={'/settings/integrations/add'} > <button type='button' diff --git a/webapp/components/navbar_dropdown.jsx b/webapp/components/navbar_dropdown.jsx index 48ddd9bc7..da1ae237e 100644 --- a/webapp/components/navbar_dropdown.jsx +++ b/webapp/components/navbar_dropdown.jsx @@ -130,7 +130,7 @@ export default class NavbarDropdown extends React.Component { if (isAdmin || window.EnableAdminOnlyIntegrations !== 'true') { integrationsLink = ( <li> - <Link to={'/' + this.props.teamName + '/integrations'}> + <Link to={'/settings/integrations'}> <FormattedMessage id='navbar_dropdown.integrations' defaultMessage='Integrations' |