Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
mattermost-webapp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
sysadmin
mattermost
mattermost-webapp
Commits
2df9b112
Unverified
Commit
2df9b112
authored
Dec 05, 2018
by
George Goldberg
Committed by
cpanato
Dec 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MM-13321: Fix providers that don't extend Provider. (#2139)
* Fix providers that don't extend Provider. * Fix snapshots
parent
4dc67e0a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
5 deletions
+22
-5
components/__snapshots__/textbox.test.jsx.snap
components/__snapshots__/textbox.test.jsx.snap
+18
-3
components/suggestion/command_provider.jsx
components/suggestion/command_provider.jsx
+2
-1
components/suggestion/emoticon_provider.jsx
components/suggestion/emoticon_provider.jsx
+2
-1
No files found.
components/__snapshots__/textbox.test.jsx.snap
View file @
2df9b112
...
...
@@ -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}
...
...
components/suggestion/command_provider.jsx
View file @
2df9b112
...
...
@@ -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
();
...
...
components/suggestion/emoticon_provider.jsx
View file @
2df9b112
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment