Unverified Commit 2df9b112 authored by George Goldberg's avatar George Goldberg Committed by cpanato

MM-13321: Fix providers that don't extend Provider. (#2139)

* Fix providers that don't extend Provider.

* Fix snapshots
parent 4dc67e0a
......@@ -57,7 +57,12 @@ exports[`components/TextBox should match snapshot with required props 1`] = `
"latestPrefix": "",
"requestStarted": false,
},
EmoticonProvider {},
EmoticonProvider {
"disableDispatches": false,
"latestComplete": true,
"latestPrefix": "",
"requestStarted": false,
},
]
}
renderDividers={true}
......@@ -207,7 +212,12 @@ exports[`components/TextBox should throw error when new property is too long 1`]
"latestPrefix": "",
"requestStarted": false,
},
EmoticonProvider {},
EmoticonProvider {
"disableDispatches": false,
"latestComplete": true,
"latestPrefix": "",
"requestStarted": false,
},
]
}
renderDividers={true}
......@@ -357,7 +367,12 @@ exports[`components/TextBox should throw error when value is too long 1`] = `
"latestPrefix": "",
"requestStarted": false,
},
EmoticonProvider {},
EmoticonProvider {
"disableDispatches": false,
"latestComplete": true,
"latestPrefix": "",
"requestStarted": false,
},
]
}
renderDividers={true}
......
......@@ -11,6 +11,7 @@ import store from 'stores/redux_store.jsx';
import * as UserAgent from 'utils/user_agent.jsx';
import Suggestion from './suggestion.jsx';
import Provider from './provider.jsx';
export class CommandSuggestion extends Suggestion {
render() {
......@@ -38,7 +39,7 @@ export class CommandSuggestion extends Suggestion {
}
}
export default class CommandProvider {
export default class CommandProvider extends Provider {
handlePretextChanged(pretext, resultCallback) {
if (pretext.startsWith('/')) {
const command = pretext.toLowerCase();
......
......@@ -13,6 +13,7 @@ import store from 'stores/redux_store.jsx';
import * as Emoticons from 'utils/emoticons.jsx';
import Suggestion from './suggestion.jsx';
import Provider from './provider.jsx';
const MIN_EMOTICON_LENGTH = 2;
const EMOJI_CATEGORY_SUGGESTION_BLACKLIST = ['skintone'];
......@@ -49,7 +50,7 @@ class EmoticonSuggestion extends Suggestion {
}
}
export default class EmoticonProvider {
export default class EmoticonProvider extends Provider {
handlePretextChanged(pretext, resultsCallback) {
// Look for the potential emoticons at the start of the text, after whitespace, and at the start of emoji reaction commands
const captured = (/(^|\s|^\+|^-)(:([^:\s]*))$/g).exec(pretext);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment