From c94b7b9d4fe2c51e6427888d9ba6e3d7b8eb321c Mon Sep 17 00:00:00 2001 From: Nicolas Clerc Date: Tue, 8 Mar 2016 01:34:41 +0100 Subject: toggle incompatible settings views --- .../user_settings/manage_command_hooks.jsx | 254 +++++++++++---------- 1 file changed, 135 insertions(+), 119 deletions(-) (limited to 'webapp') diff --git a/webapp/components/user_settings/manage_command_hooks.jsx b/webapp/components/user_settings/manage_command_hooks.jsx index 71dcc36e9..9703664cc 100644 --- a/webapp/components/user_settings/manage_command_hooks.jsx +++ b/webapp/components/user_settings/manage_command_hooks.jsx @@ -444,6 +444,35 @@ 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 = ( @@ -474,46 +503,128 @@ export default class ManageCommandCmds extends React.Component { ); } - return ( -
- -
-
-
+ let autoCompleteSettings; + if (!this.state.cmd.external_management) { + autoCompleteSettings = ( +
+
+ +
+
+ +
+
+
- {slashCommandAutocompleteCheckbox}
+
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+ {addError} +
+
+ ); + } + + return ( +
+ +
+
+
+ + {slashCommandAutocompleteCheckbox} + {triggerInput} +
-
- -
-
- -
-
-
- -
- -
- -
-
- -
-
- -
- -
- -
-
- -
-
- -
- -
- -
-
- -
- {addError} -
+ {autoCompleteSettings}