Merge pull request #2292 from mozilla/PLT-2064

PLT-2064 Slash command hints don't autocomplete
This commit is contained in:
Harrison Healey
2016-03-01 09:21:09 -05:00
2 changed files with 4 additions and 2 deletions

View File

@@ -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}

View File

@@ -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
});
}