summaryrefslogtreecommitdiffstats
path: root/webapp/components/integrations/components/add_incoming_webhook
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/integrations/components/add_incoming_webhook')
-rw-r--r--webapp/components/integrations/components/add_incoming_webhook/add_incoming_webhook.jsx68
-rw-r--r--webapp/components/integrations/components/add_incoming_webhook/index.js25
2 files changed, 0 insertions, 93 deletions
diff --git a/webapp/components/integrations/components/add_incoming_webhook/add_incoming_webhook.jsx b/webapp/components/integrations/components/add_incoming_webhook/add_incoming_webhook.jsx
deleted file mode 100644
index 23f0fad6f..000000000
--- a/webapp/components/integrations/components/add_incoming_webhook/add_incoming_webhook.jsx
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import React from 'react';
-import {browserHistory} from 'react-router/es6';
-import PropTypes from 'prop-types';
-
-import AbstractIncomingWebhook from 'components/integrations/components/abstract_incoming_webhook.jsx';
-
-const HEADER = {id: 'integrations.add', defaultMessage: 'Add'};
-const FOOTER = {id: 'add_incoming_webhook.save', defaultMessage: 'Save'};
-
-export default class AddIncomingWebhook extends React.PureComponent {
- static propTypes = {
-
- /**
- * The current team
- */
- team: PropTypes.object.isRequired,
-
- /**
- * The request state for createIncomingHook action. Contains status and error
- */
- createIncomingHookRequest: PropTypes.object.isRequired,
-
- actions: PropTypes.shape({
-
- /**
- * The function to call to add a new incoming webhook
- */
- createIncomingHook: PropTypes.func.isRequired
- }).isRequired
- }
-
- constructor(props) {
- super(props);
-
- this.state = {
- serverError: ''
- };
- }
-
- addIncomingHook = async (hook) => {
- this.setState({serverError: ''});
-
- const data = await this.props.actions.createIncomingHook(hook);
- if (data) {
- browserHistory.push(`/${this.props.team.name}/integrations/confirm?type=incoming_webhooks&id=${data.id}`);
- return;
- }
-
- if (this.props.createIncomingHookRequest.error) {
- this.setState({serverError: this.props.createIncomingHookRequest.error.message});
- }
- }
-
- render() {
- return (
- <AbstractIncomingWebhook
- team={this.props.team}
- header={HEADER}
- footer={FOOTER}
- action={this.addIncomingHook}
- serverError={this.state.serverError}
- />
- );
- }
-}
diff --git a/webapp/components/integrations/components/add_incoming_webhook/index.js b/webapp/components/integrations/components/add_incoming_webhook/index.js
deleted file mode 100644
index ed2b53ba8..000000000
--- a/webapp/components/integrations/components/add_incoming_webhook/index.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
- import {connect} from 'react-redux';
- import {bindActionCreators} from 'redux';
- import {createIncomingHook} from 'mattermost-redux/actions/integrations';
-
- import AddIncomingWebhook from './add_incoming_webhook.jsx';
-
- function mapStateToProps(state, ownProps) {
- return {
- ...ownProps,
- createIncomingHookRequest: state.requests.integrations.createIncomingHook
- };
- }
-
- function mapDispatchToProps(dispatch) {
- return {
- actions: bindActionCreators({
- createIncomingHook
- }, dispatch)
- };
- }
-
- export default connect(mapStateToProps, mapDispatchToProps)(AddIncomingWebhook); \ No newline at end of file