Merge pull request #1579 from hmhealey/plt1298

PLT-1298 Converted Command and @Mention autocomplete to new suggestion components
Этот коммит содержится в:
Christopher Speller
2015-12-03 08:23:43 -05:00
родитель eddd4e0fc4 482e3fc9a4
Коммит e92695c4a4
26 изменённых файлов: 474 добавлений и 815 удалений

Просмотреть файл

@@ -741,3 +741,27 @@ export function savePreferences(preferences, success, error) {
}
);
}
export function getSuggestedCommands(command, suggestionId, component) {
client.executeCommand(
'',
command,
true,
(data) => {
// pull out the suggested commands from the returned data
const terms = data.suggestions.map((suggestion) => suggestion.suggestion);
AppDispatcher.handleServerAction({
type: ActionTypes.SUGGESTION_RECEIVED_SUGGESTIONS,
id: suggestionId,
matchedPretext: command,
terms,
items: data.suggestions,
component
});
},
(err) => {
dispatchError(err, 'getCommandSuggestions');
}
);
}