summaryrefslogtreecommitdiffstats
path: root/web/react
diff options
context:
space:
mode:
authorHarrison Healey <harrisonmhealey@gmail.com>2016-03-01 09:21:09 -0500
committerHarrison Healey <harrisonmhealey@gmail.com>2016-03-01 09:21:09 -0500
commitf9e7e82e6f4e1a0c99b3b6224a8f5f56a3197b5f (patch)
tree3f1a07f172ba795e2ec2bb5cc4b3118e53606872 /web/react
parent327a3427b301726c64273f0fb50e0cd4c3671d90 (diff)
parent7ead702e39125bf10650175544aace37d8d041dc (diff)
downloadchat-f9e7e82e6f4e1a0c99b3b6224a8f5f56a3197b5f.tar.gz
chat-f9e7e82e6f4e1a0c99b3b6224a8f5f56a3197b5f.tar.bz2
chat-f9e7e82e6f4e1a0c99b3b6224a8f5f56a3197b5f.zip
Merge pull request #2292 from mozilla/PLT-2064
PLT-2064 Slash command hints don't autocomplete
Diffstat (limited to 'web/react')
-rw-r--r--web/react/components/suggestion/command_provider.jsx2
-rw-r--r--web/react/utils/async_client.jsx4
2 files changed, 4 insertions, 2 deletions
diff --git a/web/react/components/suggestion/command_provider.jsx b/web/react/components/suggestion/command_provider.jsx
index 09c9b9982..21d6d0e0e 100644
--- a/web/react/components/suggestion/command_provider.jsx
+++ b/web/react/components/suggestion/command_provider.jsx
@@ -18,7 +18,7 @@ class CommandSuggestion extends React.Component {
onClick={onClick}
>
<div className='command__title'>
- <string>{item.suggestion}</string>
+ <string>{item.suggestion} {item.hint}</string>
</div>
<div className='command__desc'>
{item.description}
diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx
index 13b57092d..ca9d81865 100644
--- a/web/react/utils/async_client.jsx
+++ b/web/react/utils/async_client.jsx
@@ -787,11 +787,13 @@ export function getSuggestedCommands(command, suggestionId, component) {
data.forEach((cmd) => {
if (('/' + cmd.trigger).indexOf(command) === 0) {
let s = '/' + cmd.trigger;
+ let hint = '';
if (cmd.auto_complete_hint && cmd.auto_complete_hint.length !== 0) {
- s += ' ' + cmd.auto_complete_hint;
+ hint = cmd.auto_complete_hint;
}
matches.push({
suggestion: s,
+ hint,
description: cmd.auto_complete_desc
});
}