Moved backstage integrations pages to /settings/integrations

Этот коммит содержится в:
Harrison Healey
2016-03-29 15:13:31 -04:00
родитель 46020c7722
Коммит 132d4cdf8f
7 изменённых файлов: 10 добавлений и 137 удалений

Просмотреть файл

@@ -5,7 +5,6 @@ import React from 'react';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import {browserHistory} from 'react-router'; import {browserHistory} from 'react-router';
import TeamStore from 'stores/team_store.jsx';
import ChannelSelect from 'components/channel_select.jsx'; import ChannelSelect from 'components/channel_select.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -17,7 +16,6 @@ export default class AddIncomingWebhook extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
this.updateName = this.updateName.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.updateChannelId = this.updateChannelId.bind(this);
this.state = { this.state = {
team: TeamStore.getCurrent(),
name: '', name: '',
description: '', description: '',
channelId: '', 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) { handleSubmit(e) {
e.preventDefault(); e.preventDefault();
@@ -83,7 +66,7 @@ export default class AddIncomingWebhook extends React.Component {
AsyncClient.addIncomingHook( AsyncClient.addIncomingHook(
hook, hook,
() => { () => {
browserHistory.push(`/${this.state.team.name}/integrations/installed`); browserHistory.push('/settings/integrations/installed');
}, },
(err) => { (err) => {
this.setState({ this.setState({
@@ -112,12 +95,6 @@ export default class AddIncomingWebhook extends React.Component {
} }
render() { render() {
const team = TeamStore.getCurrent();
if (!team) {
return null;
}
return ( return (
<div className='backstage row'> <div className='backstage row'>
<div className='add-incoming-webhook'> <div className='add-incoming-webhook'>
@@ -184,7 +161,7 @@ export default class AddIncomingWebhook extends React.Component {
<div className='add-integration__submit-row'> <div className='add-integration__submit-row'>
<Link <Link
className='btn btn-sm' className='btn btn-sm'
to={`/${team.name}/integrations/add`} to={'/settings/integrations/add'}
> >
<FormattedMessage <FormattedMessage
id='add_incoming_webhook.cancel' id='add_incoming_webhook.cancel'

Просмотреть файл

@@ -3,45 +3,13 @@
import React from 'react'; import React from 'react';
import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
import AddIntegrationOption from './add_integration_option.jsx'; import AddIntegrationOption from './add_integration_option.jsx';
import WebhookIcon from 'images/webhook_icon.jpg'; import WebhookIcon from 'images/webhook_icon.jpg';
export default class AddIntegration extends React.Component { 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() { render() {
const team = TeamStore.getCurrent();
if (!team) {
return null;
}
const options = []; const options = [];
if (window.mm_config.EnableIncomingWebhooks === 'true') { 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.' 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.' 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'}
/> />
); );
} }

Просмотреть файл

@@ -5,7 +5,6 @@ import React from 'react';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import {browserHistory} from 'react-router'; import {browserHistory} from 'react-router';
import TeamStore from 'stores/team_store.jsx';
import ChannelSelect from 'components/channel_select.jsx'; import ChannelSelect from 'components/channel_select.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -17,7 +16,6 @@ export default class AddOutgoingWebhook extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
this.updateName = this.updateName.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.updateCallbackUrls = this.updateCallbackUrls.bind(this);
this.state = { this.state = {
team: TeamStore.getCurrent(),
name: '', name: '',
description: '', description: '',
channelId: '', 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) { handleSubmit(e) {
e.preventDefault(); e.preventDefault();
@@ -103,7 +86,7 @@ export default class AddOutgoingWebhook extends React.Component {
AsyncClient.addOutgoingHook( AsyncClient.addOutgoingHook(
hook, hook,
() => { () => {
browserHistory.push(`/${this.state.team.name}/integrations/installed`); browserHistory.push('/settings/integrations/installed');
}, },
(err) => { (err) => {
this.setState({ this.setState({
@@ -144,12 +127,6 @@ export default class AddOutgoingWebhook extends React.Component {
} }
render() { render() {
const team = TeamStore.getCurrent();
if (!team) {
return null;
}
return ( return (
<div className='backstage row'> <div className='backstage row'>
<div className='add-outgoing-webhook'> <div className='add-outgoing-webhook'>
@@ -250,7 +227,7 @@ export default class AddOutgoingWebhook extends React.Component {
<div className='add-integration__submit-row'> <div className='add-integration__submit-row'>
<Link <Link
className='btn btn-sm' className='btn btn-sm'
to={`/${team.name}/integrations/add`} to={'/settings/integrations/add'}
> >
<FormattedMessage <FormattedMessage
id='add_outgoing_webhook.cancel' id='add_outgoing_webhook.cancel'

Просмотреть файл

@@ -3,50 +3,18 @@
import React from 'react'; import React from 'react';
import TeamStore from 'stores/team_store.jsx';
import BackstageCategory from './backstage_category.jsx'; import BackstageCategory from './backstage_category.jsx';
import BackstageSection from './backstage_section.jsx'; import BackstageSection from './backstage_section.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
export default class BackstageSidebar extends React.Component { 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() { render() {
const team = TeamStore.getCurrent();
if (!team) {
return null;
}
return ( return (
<div className='backstage__sidebar'> <div className='backstage__sidebar'>
<ul> <ul>
<BackstageCategory <BackstageCategory
name='integrations' name='integrations'
parentLink={`/${team.name}`} parentLink={'/settings'}
icon='fa-link' icon='fa-link'
title={ title={
<FormattedMessage <FormattedMessage
@@ -72,7 +40,6 @@ export default class BackstageSidebar extends React.Component {
defaultMessage='Add Integration' defaultMessage='Add Integration'
/> />
)} )}
collapsible={true}
> >
<BackstageSection <BackstageSection
name='incoming_webhook' name='incoming_webhook'
@@ -99,4 +66,3 @@ export default class BackstageSidebar extends React.Component {
); );
} }
} }

Просмотреть файл

@@ -6,7 +6,6 @@ import React from 'react';
import * as AsyncClient from 'utils/async_client.jsx'; import * as AsyncClient from 'utils/async_client.jsx';
import ChannelStore from 'stores/channel_store.jsx'; import ChannelStore from 'stores/channel_store.jsx';
import IntegrationStore from 'stores/integration_store.jsx'; import IntegrationStore from 'stores/integration_store.jsx';
import TeamStore from 'stores/team_store.jsx';
import * as Utils from 'utils/utils.jsx'; import * as Utils from 'utils/utils.jsx';
import {FormattedMessage} from 'react-intl'; import {FormattedMessage} from 'react-intl';
@@ -19,7 +18,6 @@ export default class InstalledIntegrations extends React.Component {
super(props); super(props);
this.handleIntegrationChange = this.handleIntegrationChange.bind(this); this.handleIntegrationChange = this.handleIntegrationChange.bind(this);
this.handleTeamChange = this.handleTeamChange.bind(this);
this.updateFilter = this.updateFilter.bind(this); this.updateFilter = this.updateFilter.bind(this);
this.updateTypeFilter = this.updateTypeFilter.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.deleteOutgoingWebhook = this.deleteOutgoingWebhook.bind(this);
this.state = { this.state = {
team: TeamStore.getCurrent(),
incomingWebhooks: [], incomingWebhooks: [],
outgoingWebhooks: [], outgoingWebhooks: [],
typeFilter: '', typeFilter: '',
@@ -38,7 +35,6 @@ export default class InstalledIntegrations extends React.Component {
componentWillMount() { componentWillMount() {
IntegrationStore.addChangeListener(this.handleIntegrationChange); IntegrationStore.addChangeListener(this.handleIntegrationChange);
TeamStore.addChangeListener(this.handleTeamChange);
if (window.mm_config.EnableIncomingWebhooks === 'true') { if (window.mm_config.EnableIncomingWebhooks === 'true') {
if (IntegrationStore.hasReceivedIncomingWebhooks()) { if (IntegrationStore.hasReceivedIncomingWebhooks()) {
@@ -63,7 +59,6 @@ export default class InstalledIntegrations extends React.Component {
componentWillUnmount() { componentWillUnmount() {
IntegrationStore.removeChangeListener(this.handleIntegrationChange); IntegrationStore.removeChangeListener(this.handleIntegrationChange);
TeamStore.removeChangeListener(this.handleTeamChange);
} }
handleIntegrationChange() { handleIntegrationChange() {
@@ -73,12 +68,6 @@ export default class InstalledIntegrations extends React.Component {
}); });
} }
handleTeamChange() {
this.setState({
team: TeamStore.getCurrent()
});
}
updateTypeFilter(e, typeFilter) { updateTypeFilter(e, typeFilter) {
e.preventDefault(); e.preventDefault();
@@ -206,10 +195,6 @@ export default class InstalledIntegrations extends React.Component {
} }
render() { render() {
if (!this.state.team) {
return null;
}
const incomingWebhooks = this.state.incomingWebhooks; const incomingWebhooks = this.state.incomingWebhooks;
const outgoingWebhooks = this.state.outgoingWebhooks; const outgoingWebhooks = this.state.outgoingWebhooks;
@@ -269,7 +254,7 @@ export default class InstalledIntegrations extends React.Component {
</h1> </h1>
<Link <Link
className='add-integrations-link' className='add-integrations-link'
to={`/${this.state.team.name}/integrations/add`} to={'/settings/integrations/add'}
> >
<button <button
type='button' type='button'

Просмотреть файл

@@ -130,7 +130,7 @@ export default class NavbarDropdown extends React.Component {
if (isAdmin || window.EnableAdminOnlyIntegrations !== 'true') { if (isAdmin || window.EnableAdminOnlyIntegrations !== 'true') {
integrationsLink = ( integrationsLink = (
<li> <li>
<Link to={'/' + this.props.teamName + '/integrations'}> <Link to={'/settings/integrations'}>
<FormattedMessage <FormattedMessage
id='navbar_dropdown.integrations' id='navbar_dropdown.integrations'
defaultMessage='Integrations' defaultMessage='Integrations'

Просмотреть файл

@@ -247,7 +247,7 @@ function renderRootComponent() {
path=':team/logout' path=':team/logout'
onEnter={onLoggedOut} onEnter={onLoggedOut}
/> />
<Route path=':team/integrations'> <Route path='settings/integrations'>
<IndexRedirect to='installed'/> <IndexRedirect to='installed'/>
<Route <Route
path='installed' path='installed'