Moved backstage integrations pages to /settings/integrations
Этот коммит содержится в:
@@ -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'
|
||||
|
||||
@@ -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'}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -247,7 +247,7 @@ function renderRootComponent() {
|
||||
path=':team/logout'
|
||||
onEnter={onLoggedOut}
|
||||
/>
|
||||
<Route path=':team/integrations'>
|
||||
<Route path='settings/integrations'>
|
||||
<IndexRedirect to='installed'/>
|
||||
<Route
|
||||
path='installed'
|
||||
|
||||
Ссылка в новой задаче
Block a user