From dcdea9f30b419eeb8d55ed9be3f824aaf27de50c Mon Sep 17 00:00:00 2001 From: Harrison Healey Date: Thu, 24 Mar 2016 16:52:29 -0400 Subject: Added AddIntegration page --- webapp/components/backstage/add_integration.jsx | 110 ++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 webapp/components/backstage/add_integration.jsx (limited to 'webapp/components/backstage/add_integration.jsx') diff --git a/webapp/components/backstage/add_integration.jsx b/webapp/components/backstage/add_integration.jsx new file mode 100644 index 000000000..1ca079bb7 --- /dev/null +++ b/webapp/components/backstage/add_integration.jsx @@ -0,0 +1,110 @@ +// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +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') { + options.push( + + } + description={ + + } + link={`/${team.name}/integrations/add/incoming_webhook`} + /> + ); + } + + if (window.mm_config.EnableOutgoingWebhooks === 'true') { + options.push( + + } + description={ + + } + link={`/${team.name}/integrations/add/outgoing_webhook`} + /> + ); + } + + return ( +
+
+
+

+ +

+
+
+
+ {options} +
+
+ ); + } +} + -- cgit v1.2.3-1-g7c22