From 35320efe1afad87419992275ba555ddcbfcdf46b Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Fri, 18 Mar 2016 13:16:51 -0400 Subject: Revert "PLT-2183 Slash command auto-complete" --- webapp/utils/async_client.jsx | 6 +++--- webapp/utils/client.jsx | 5 ++--- webapp/utils/constants.jsx | 4 ---- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'webapp/utils') diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index 2392b50b9..d3f91bb0e 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -781,12 +781,12 @@ export function savePreferences(preferences, success, error) { ); } -export function getSuggestedCommands(command, channelId, suggestionId, component) { - client.listCommands({command: command, channelId: channelId}, +export function getSuggestedCommands(command, suggestionId, component) { + client.listCommands( (data) => { var matches = []; data.forEach((cmd) => { - if (('/' + cmd.trigger).indexOf(command) === 0 || cmd.external_management) { + if (('/' + cmd.trigger).indexOf(command) === 0) { let s = '/' + cmd.trigger; let hint = ''; if (cmd.auto_complete_hint && cmd.auto_complete_hint.length !== 0) { diff --git a/webapp/utils/client.jsx b/webapp/utils/client.jsx index 69bda4303..e29cf71d3 100644 --- a/webapp/utils/client.jsx +++ b/webapp/utils/client.jsx @@ -1031,13 +1031,12 @@ export function regenCommandToken(data, success, error) { }); } -export function listCommands(data, success, error) { +export function listCommands(success, error) { $.ajax({ url: '/api/v1/commands/list', dataType: 'json', contentType: 'application/json', - type: 'POST', - data: JSON.stringify(data), + type: 'GET', success, error: function onError(xhr, status, err) { var e = handleError('listCommands', xhr, status, err); diff --git a/webapp/utils/constants.jsx b/webapp/utils/constants.jsx index 4ee934e11..a4aa7604c 100644 --- a/webapp/utils/constants.jsx +++ b/webapp/utils/constants.jsx @@ -595,10 +595,6 @@ export default { EMBED_TOGGLE: { label: 'embed_toggle', description: 'Show toggle for all embed previews' - }, - SLASHCMD_AUTOCMP: { - label: 'slashCmd_autocmp', - description: 'Enable external application to offer slash command autocomplete' } }, OVERLAY_TIME_DELAY: 400, -- cgit v1.2.3-1-g7c22