From d8bd57901e33a7057e26e782e295099ffcc0da89 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 6 Sep 2017 23:04:13 -0700 Subject: Removing webapp --- .../components/abstract_incoming_webhook.jsx | 253 ------- .../components/abstract_outgoing_webhook.jsx | 483 -------------- .../components/add_command/add_command.jsx | 615 ----------------- .../integrations/components/add_command/index.js | 25 - .../add_incoming_webhook/add_incoming_webhook.jsx | 68 -- .../components/add_incoming_webhook/index.js | 25 - .../components/add_oauth_app/add_oauth_app.jsx | 441 ------------- .../integrations/components/add_oauth_app/index.js | 25 - .../add_outgoing_webhook/add_outgoing_webhook.jsx | 69 -- .../components/add_outgoing_webhook/index.js | 25 - .../commands_container/commands_container.jsx | 78 --- .../components/commands_container/index.js | 29 - .../confirm_integration/confirm_integration.jsx | 258 -------- .../components/confirm_integration/index.js | 16 - .../integrations/components/delete_integration.jsx | 51 -- .../components/edit_command/edit_command.jsx | 727 --------------------- .../integrations/components/edit_command/index.js | 31 - .../edit_incoming_webhook.jsx | 112 ---- .../components/edit_incoming_webhook/index.js | 30 - .../edit_outgoing_webhook.jsx | 169 ----- .../components/edit_outgoing_webhook/index.js | 30 - .../integrations/components/installed_command.jsx | 176 ----- .../components/installed_commands/index.js | 25 - .../installed_commands/installed_commands.jsx | 160 ----- .../components/installed_incoming_webhook.jsx | 147 ----- .../components/installed_incoming_webhooks.jsx | 178 ----- .../components/installed_oauth_app.jsx | 270 -------- .../components/installed_oauth_apps/index.js | 31 - .../installed_oauth_apps/installed_oauth_apps.jsx | 165 ----- .../components/installed_outgoing_webhook.jsx | 244 ------- .../components/installed_outgoing_webhooks.jsx | 182 ------ .../integrations/components/integration_option.jsx | 41 -- .../integrations/components/integrations.jsx | 175 ----- 33 files changed, 5354 deletions(-) delete mode 100644 webapp/components/integrations/components/abstract_incoming_webhook.jsx delete mode 100644 webapp/components/integrations/components/abstract_outgoing_webhook.jsx delete mode 100644 webapp/components/integrations/components/add_command/add_command.jsx delete mode 100644 webapp/components/integrations/components/add_command/index.js delete mode 100644 webapp/components/integrations/components/add_incoming_webhook/add_incoming_webhook.jsx delete mode 100644 webapp/components/integrations/components/add_incoming_webhook/index.js delete mode 100644 webapp/components/integrations/components/add_oauth_app/add_oauth_app.jsx delete mode 100644 webapp/components/integrations/components/add_oauth_app/index.js delete mode 100644 webapp/components/integrations/components/add_outgoing_webhook/add_outgoing_webhook.jsx delete mode 100644 webapp/components/integrations/components/add_outgoing_webhook/index.js delete mode 100644 webapp/components/integrations/components/commands_container/commands_container.jsx delete mode 100644 webapp/components/integrations/components/commands_container/index.js delete mode 100644 webapp/components/integrations/components/confirm_integration/confirm_integration.jsx delete mode 100644 webapp/components/integrations/components/confirm_integration/index.js delete mode 100644 webapp/components/integrations/components/delete_integration.jsx delete mode 100644 webapp/components/integrations/components/edit_command/edit_command.jsx delete mode 100644 webapp/components/integrations/components/edit_command/index.js delete mode 100644 webapp/components/integrations/components/edit_incoming_webhook/edit_incoming_webhook.jsx delete mode 100644 webapp/components/integrations/components/edit_incoming_webhook/index.js delete mode 100644 webapp/components/integrations/components/edit_outgoing_webhook/edit_outgoing_webhook.jsx delete mode 100644 webapp/components/integrations/components/edit_outgoing_webhook/index.js delete mode 100644 webapp/components/integrations/components/installed_command.jsx delete mode 100644 webapp/components/integrations/components/installed_commands/index.js delete mode 100644 webapp/components/integrations/components/installed_commands/installed_commands.jsx delete mode 100644 webapp/components/integrations/components/installed_incoming_webhook.jsx delete mode 100644 webapp/components/integrations/components/installed_incoming_webhooks.jsx delete mode 100644 webapp/components/integrations/components/installed_oauth_app.jsx delete mode 100644 webapp/components/integrations/components/installed_oauth_apps/index.js delete mode 100644 webapp/components/integrations/components/installed_oauth_apps/installed_oauth_apps.jsx delete mode 100644 webapp/components/integrations/components/installed_outgoing_webhook.jsx delete mode 100644 webapp/components/integrations/components/installed_outgoing_webhooks.jsx delete mode 100644 webapp/components/integrations/components/integration_option.jsx delete mode 100644 webapp/components/integrations/components/integrations.jsx (limited to 'webapp/components/integrations') diff --git a/webapp/components/integrations/components/abstract_incoming_webhook.jsx b/webapp/components/integrations/components/abstract_incoming_webhook.jsx deleted file mode 100644 index 1253842a7..000000000 --- a/webapp/components/integrations/components/abstract_incoming_webhook.jsx +++ /dev/null @@ -1,253 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import React from 'react'; -import PropTypes from 'prop-types'; - -import BackstageHeader from 'components/backstage/components/backstage_header.jsx'; -import ChannelSelect from 'components/channel_select.jsx'; -import {FormattedMessage} from 'react-intl'; -import FormError from 'components/form_error.jsx'; -import SpinnerButton from 'components/spinner_button.jsx'; -import {Link} from 'react-router/es6'; - -export default class AbstractIncomingWebhook extends React.Component { - static propTypes = { - - /** - * The current team - */ - team: PropTypes.object.isRequired, - - /** - * The header text to render, has id and defaultMessage - */ - header: PropTypes.object.isRequired, - - /** - * The footer text to render, has id and defaultMessage - */ - footer: PropTypes.object.isRequired, - - /** - * The server error text after a failed action - */ - serverError: PropTypes.string.isRequired, - - /** - * The hook used to set the initial state - */ - initialHook: PropTypes.object, - - /** - * The async function to run when the action button is pressed - */ - action: PropTypes.func.isRequired - } - - constructor(props) { - super(props); - - this.state = this.getStateFromHook(this.props.initialHook || {}); - } - - getStateFromHook = (hook) => { - return { - displayName: hook.display_name || '', - description: hook.description || '', - channelId: hook.channel_id || '', - saving: false, - serverError: '', - clientError: null - }; - } - - handleSubmit = (e) => { - e.preventDefault(); - - if (this.state.saving) { - return; - } - - this.setState({ - saving: true, - serverError: '', - clientError: '' - }); - - if (!this.state.channelId) { - this.setState({ - saving: false, - clientError: ( - - ) - }); - - return; - } - - const hook = { - channel_id: this.state.channelId, - display_name: this.state.displayName, - description: this.state.description - }; - - this.props.action(hook).then(() => this.setState({saving: false})); - } - - updateDisplayName = (e) => { - this.setState({ - displayName: e.target.value - }); - } - - updateDescription = (e) => { - this.setState({ - description: e.target.value - }); - } - - updateChannelId = (e) => { - this.setState({ - channelId: e.target.value - }); - } - - render() { - var headerToRender = this.props.header; - var footerToRender = this.props.footer; - - return ( -
- - - - - - -
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- - - - - - - -
-
-
-
- ); - } -} diff --git a/webapp/components/integrations/components/abstract_outgoing_webhook.jsx b/webapp/components/integrations/components/abstract_outgoing_webhook.jsx deleted file mode 100644 index 397423395..000000000 --- a/webapp/components/integrations/components/abstract_outgoing_webhook.jsx +++ /dev/null @@ -1,483 +0,0 @@ -// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. -// See License.txt for license information. - -import React from 'react'; -import PropTypes from 'prop-types'; - -import TeamStore from 'stores/team_store.jsx'; - -import {localizeMessage} from 'utils/utils.jsx'; - -import BackstageHeader from 'components/backstage/components/backstage_header.jsx'; -import ChannelSelect from 'components/channel_select.jsx'; -import {FormattedMessage} from 'react-intl'; -import FormError from 'components/form_error.jsx'; -import {Link} from 'react-router/es6'; -import SpinnerButton from 'components/spinner_button.jsx'; - -export default class AbstractOutgoingWebhook extends React.Component { - static propTypes = { - - /** - * The current team - */ - team: PropTypes.object.isRequired, - - /** - * The header text to render, has id and defaultMessage - */ - header: PropTypes.object.isRequired, - - /** - * The footer text to render, has id and defaultMessage - */ - footer: PropTypes.object.isRequired, - - /** - * Any extra component/node to render - */ - renderExtra: PropTypes.node.isRequired, - - /** - * The server error text after a failed action - */ - serverError: PropTypes.string.isRequired, - - /** - * The hook used to set the initial state - */ - initialHook: PropTypes.object, - - /** - * The async function to run when the action button is pressed - */ - action: PropTypes.func.isRequired - } - - constructor(props) { - super(props); - - this.state = this.getStateFromHook(this.props.initialHook || {}); - } - - getStateFromHook = (hook) => { - let triggerWords = ''; - if (hook.trigger_words) { - let i = 0; - for (i = 0; i < hook.trigger_words.length; i++) { - triggerWords += hook.trigger_words[i] + '\n'; - } - } - - let callbackUrls = ''; - if (hook.callback_urls) { - let i = 0; - for (i = 0; i < hook.callback_urls.length; i++) { - callbackUrls += hook.callback_urls[i] + '\n'; - } - } - - return { - displayName: hook.display_name || '', - description: hook.description || '', - contentType: hook.content_type || 'application/x-www-form-urlencoded', - channelId: hook.channel_id || '', - triggerWords, - triggerWhen: hook.trigger_when || 0, - callbackUrls, - saving: false, - clientError: null - }; - } - - handleSubmit = (e) => { - e.preventDefault(); - - if (this.state.saving) { - return; - } - - this.setState({ - saving: true, - clientError: '' - }); - - const triggerWords = []; - if (this.state.triggerWords) { - for (let triggerWord of this.state.triggerWords.split('\n')) { - triggerWord = triggerWord.trim(); - - if (triggerWord.length > 0) { - triggerWords.push(triggerWord); - } - } - } - - if (!this.state.channelId && triggerWords.length === 0) { - this.setState({ - saving: false, - clientError: ( - - ) - }); - - return; - } - - const callbackUrls = []; - for (let callbackUrl of this.state.callbackUrls.split('\n')) { - callbackUrl = callbackUrl.trim(); - - if (callbackUrl.length > 0) { - callbackUrls.push(callbackUrl); - } - } - - if (callbackUrls.length === 0) { - this.setState({ - saving: false, - clientError: ( - - ) - }); - - return; - } - - const hook = { - team_id: TeamStore.getCurrentId(), - channel_id: this.state.channelId, - trigger_words: triggerWords, - trigger_when: parseInt(this.state.triggerWhen, 10), - callback_urls: callbackUrls, - display_name: this.state.displayName, - content_type: this.state.contentType, - description: this.state.description - }; - - this.props.action(hook).then(() => this.setState({saving: false})); - } - - updateDisplayName = (e) => { - this.setState({ - displayName: e.target.value - }); - } - - updateDescription = (e) => { - this.setState({ - description: e.target.value - }); - } - - updateContentType = (e) => { - this.setState({ - contentType: e.target.value - }); - } - - updateChannelId = (e) => { - this.setState({ - channelId: e.target.value - }); - } - - updateTriggerWords = (e) => { - this.setState({ - triggerWords: e.target.value - }); - } - - updateTriggerWhen = (e) => { - this.setState({ - triggerWhen: e.target.value - }); - } - - updateCallbackUrls = (e) => { - this.setState({ - callbackUrls: e.target.value - }); - } - - render() { - const contentTypeOption1 = 'application/x-www-form-urlencoded'; - const contentTypeOption2 = 'application/json'; - - var headerToRender = this.props.header; - var footerToRender = this.props.footer; - var renderExtra = this.props.renderExtra; - - return ( -
- - - - - - -
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
- -
-
- -
-
-
-
- -
- -
- -
-
-
-
- -
-