From 3fba8e42b140c1189bf3c06882cce5e2231e63da Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 8 Jan 2016 12:41:26 -0600 Subject: partial fix for UI --- web/react/utils/async_client.jsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'web/react/utils/async_client.jsx') diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index f218270da..78be646ac 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -747,20 +747,28 @@ export function savePreferences(preferences, success, error) { } export function getSuggestedCommands(command, suggestionId, component) { - client.executeCommand( - '', - command, - true, + client.listCommands( (data) => { + var matches = []; + data.forEach((cmd) => { + if (('/' + cmd.trigger).indexOf(command) === 0) { + matches.push({ + suggestion: '/' + cmd.trigger + ' ' + cmd.auto_complete_hint, + description: cmd.auto_complete_desc + }); + } + }); + // pull out the suggested commands from the returned data - const terms = data.suggestions.map((suggestion) => suggestion.suggestion); + //const terms = matches.map((suggestion) => suggestion.trigger); + const terms = matches.map((suggestion) => suggestion.suggestion); AppDispatcher.handleServerAction({ type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS, id: suggestionId, matchedPretext: command, terms, - items: data.suggestions, + items: matches, component }); }, -- cgit v1.2.3-1-g7c22 From dffc5323ecd9c7bc1af0ea06ef4827078f9bcd52 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 4 Feb 2016 08:03:42 -0800 Subject: PLT-1429 Fixing code review comments --- web/react/utils/async_client.jsx | 1 - 1 file changed, 1 deletion(-) (limited to 'web/react/utils/async_client.jsx') diff --git a/web/react/utils/async_client.jsx b/web/react/utils/async_client.jsx index 970b1a4c0..328a7a7f2 100644 --- a/web/react/utils/async_client.jsx +++ b/web/react/utils/async_client.jsx @@ -787,7 +787,6 @@ export function getSuggestedCommands(command, suggestionId, component) { }); // pull out the suggested commands from the returned data - //const terms = matches.map((suggestion) => suggestion.trigger); const terms = matches.map((suggestion) => suggestion.suggestion); AppDispatcher.handleServerAction({ -- cgit v1.2.3-1-g7c22