From 5e2596598f97e318f1e4e8bd835b08a011fa0b60 Mon Sep 17 00:00:00 2001 From: Nicolas Clerc Date: Mon, 15 Feb 2016 09:11:35 +0100 Subject: add external slashcommands management --- webapp/components/suggestion/command_provider.jsx | 4 ++-- webapp/components/suggestion/suggestion_box.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'webapp/components/suggestion') diff --git a/webapp/components/suggestion/command_provider.jsx b/webapp/components/suggestion/command_provider.jsx index 36860fa66..204f52483 100644 --- a/webapp/components/suggestion/command_provider.jsx +++ b/webapp/components/suggestion/command_provider.jsx @@ -37,9 +37,9 @@ CommandSuggestion.propTypes = { }; export default class CommandProvider { - handlePretextChanged(suggestionId, pretext) { + handlePretextChanged(suggestionId, pretext, channelId) { if (pretext.startsWith('/')) { - AsyncClient.getSuggestedCommands(pretext, suggestionId, CommandSuggestion); + AsyncClient.getSuggestedCommands(pretext, channelId, suggestionId, CommandSuggestion); } } } diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx index e3ec63194..04e4006f1 100644 --- a/webapp/components/suggestion/suggestion_box.jsx +++ b/webapp/components/suggestion/suggestion_box.jsx @@ -111,7 +111,7 @@ export default class SuggestionBox extends React.Component { handlePretextChanged(pretext) { for (const provider of this.props.providers) { - provider.handlePretextChanged(this.suggestionId, pretext); + provider.handlePretextChanged(this.suggestionId, pretext, this.props.channelId); } } -- cgit v1.2.3-1-g7c22 From 49eda73749d0920e985fc0f92df34a575088012c Mon Sep 17 00:00:00 2001 From: Nicolas Clerc Date: Mon, 15 Feb 2016 09:48:56 +0100 Subject: eslint error: validate suggestion_box channelId prop --- webapp/components/suggestion/suggestion_box.jsx | 1 + 1 file changed, 1 insertion(+) (limited to 'webapp/components/suggestion') diff --git a/webapp/components/suggestion/suggestion_box.jsx b/webapp/components/suggestion/suggestion_box.jsx index 04e4006f1..97c6c6cd9 100644 --- a/webapp/components/suggestion/suggestion_box.jsx +++ b/webapp/components/suggestion/suggestion_box.jsx @@ -160,6 +160,7 @@ SuggestionBox.propTypes = { value: React.PropTypes.string.isRequired, onUserInput: React.PropTypes.func, providers: React.PropTypes.arrayOf(React.PropTypes.object), + channelId: React.PropTypes.string, // explicitly name any input event handlers we override and need to manually call onChange: React.PropTypes.func, -- cgit v1.2.3-1-g7c22