From 35320efe1afad87419992275ba555ddcbfcdf46b Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 18 Mar 2016 13:16:51 -0400 Subject: Revert "PLT-2183 Slash command auto-complete" --- .../user_settings/manage_command_hooks.jsx | 313 ++++++++------------- 1 file changed, 120 insertions(+), 193 deletions(-) (limited to 'webapp/components/user_settings/manage_command_hooks.jsx') diff --git a/webapp/components/user_settings/manage_command_hooks.jsx b/webapp/components/user_settings/manage_command_hooks.jsx index 9703664cc..ce353ad64 100644 --- a/webapp/components/user_settings/manage_command_hooks.jsx +++ b/webapp/components/user_settings/manage_command_hooks.jsx @@ -4,13 +4,9 @@ import LoadingScreen from '../loading_screen.jsx'; import * as Client from 'utils/client.jsx'; -import * as Utils from 'utils/utils.jsx'; -import Constants from 'utils/constants.jsx'; import {intlShape, injectIntl, defineMessages, FormattedMessage, FormattedHTMLMessage} from 'react-intl'; -const PreReleaseFeatures = Constants.PRE_RELEASE_FEATURES; - const holders = defineMessages({ requestTypePost: { id: 'user.settings.cmds.request_type_post', @@ -63,7 +59,6 @@ export default class ManageCommandCmds extends React.Component { this.getCmds = this.getCmds.bind(this); this.addNewCmd = this.addNewCmd.bind(this); this.emptyCmd = this.emptyCmd.bind(this); - this.updateExternalManagement = this.updateExternalManagement.bind(this); this.updateTrigger = this.updateTrigger.bind(this); this.updateURL = this.updateURL.bind(this); this.updateMethod = this.updateMethod.bind(this); @@ -104,7 +99,7 @@ export default class ManageCommandCmds extends React.Component { addNewCmd(e) { e.preventDefault(); - if (this.state.cmd.url === '' || (this.state.cmd.trigger === '' && !this.state.external_management)) { + if (this.state.cmd.trigger === '' || this.state.cmd.url === '') { return; } @@ -194,12 +189,6 @@ export default class ManageCommandCmds extends React.Component { ); } - updateExternalManagement(e) { - var cmd = this.state.cmd; - cmd.external_management = e.target.checked; - this.setState(cmd); - } - updateTrigger(e) { var cmd = this.state.cmd; cmd.trigger = e.target.value; @@ -281,26 +270,11 @@ export default class ManageCommandCmds extends React.Component { ); } - let slashCommandAutocompleteDiv; - if (Utils.isFeatureEnabled(PreReleaseFeatures.SLASHCMD_AUTOCMP)) { - slashCommandAutocompleteDiv = ( -
- - - {cmd.external_management ? this.props.intl.formatMessage(holders.autocompleteYes) : this.props.intl.formatMessage(holders.autocompleteNo)} -
- ); - } - cmds.push(
- {slashCommandAutocompleteDiv} {triggerDiv}
@@ -442,188 +416,46 @@ export default class ManageCommandCmds extends React.Component {
); - const disableButton = this.state.cmd.url === '' || (this.state.cmd.trigger === '' && !this.state.external_management); - - let triggerInput; - if (!this.state.cmd.external_management) { - triggerInput = ( -
- -
- -
-
- -
-
- ); - } - - let slashCommandAutocompleteCheckbox; - if (Utils.isFeatureEnabled(PreReleaseFeatures.SLASHCMD_AUTOCMP)) { - slashCommandAutocompleteCheckbox = ( -
- -
-
- -
-
-
- - ); - } - - let autoCompleteSettings; - if (!this.state.cmd.external_management) { - autoCompleteSettings = ( -
-
- -
-
- -
-
-
- -
- -
- -
-
- -
-
+ const disableButton = this.state.cmd.trigger === '' || this.state.cmd.url === ''; -
- -
- -
-
- -
-
+ return ( +
+ +
+
+
- {addError}
-
- ); - } - - return ( -
- -
-
-
- - {slashCommandAutocompleteCheckbox} - {triggerInput}
- {autoCompleteSettings} +
+ +
+
+ +
+
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ {addError} +