PLT-4457 Added AtMention component to better render at mentions (#6563)
* Moved Utils.searchForTerm into an action * Added easier importing of index.jsx files * PLT-4457 Added AtMention component to better render at mentions * Fixed client unit tests * Fixed merge conflict * Fixed merge conflicts
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
270fc41c0f
Коммит
68ea0abfa6
@@ -388,14 +388,6 @@ export function insertHtmlEntities(text) {
|
||||
return newtext;
|
||||
}
|
||||
|
||||
export function searchForTerm(term) {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_SEARCH_TERM,
|
||||
term,
|
||||
do_search: true
|
||||
});
|
||||
}
|
||||
|
||||
export function getFileType(extin) {
|
||||
var ext = extin.toLowerCase();
|
||||
if (Constants.IMAGE_TYPES.indexOf(ext) > -1) {
|
||||
@@ -1312,16 +1304,11 @@ export function isValidPassword(password) {
|
||||
}
|
||||
|
||||
export function handleFormattedTextClick(e) {
|
||||
const mentionAttribute = e.target.getAttributeNode('data-mention');
|
||||
const hashtagAttribute = e.target.getAttributeNode('data-hashtag');
|
||||
const linkAttribute = e.target.getAttributeNode('data-link');
|
||||
const channelMentionAttribute = e.target.getAttributeNode('data-channel-mention');
|
||||
|
||||
if (mentionAttribute) {
|
||||
e.preventDefault();
|
||||
|
||||
searchForTerm(mentionAttribute.value);
|
||||
} else if (hashtagAttribute) {
|
||||
if (hashtagAttribute) {
|
||||
e.preventDefault();
|
||||
|
||||
searchForTerm(hashtagAttribute.value);
|
||||
@@ -1339,6 +1326,15 @@ export function handleFormattedTextClick(e) {
|
||||
}
|
||||
}
|
||||
|
||||
// This should eventually be removed once everywhere else calls the action
|
||||
function searchForTerm(term) {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_SEARCH_TERM,
|
||||
term,
|
||||
do_search: true
|
||||
});
|
||||
}
|
||||
|
||||
export function isEmptyObject(object) {
|
||||
if (!object) {
|
||||
return true;
|
||||
|
||||
Ссылка в новой задаче
Block a user