PLT-3506 Added flagged posts functionality (#3679)
* Added flagged posts functionality * UI Improvements to flags (#3697) * Added flag functionality for mobile * Updating flagged text (#3699) * Add back button to RHS thread when coming from flagged posts * Updating position of flags (#3708) * Plt 3506 - Reverting flag position (#3724) * Revert "Updating position of flags (#3708)" This reverts commit aaa05632c5d9eda35a048300a5bd7e99584c5b58. * Fixing the icon in search * Help text and white space improvements (#3730) * Updatng help text and some white spacing. * Updating help text
Этот коммит содержится в:
коммит произвёл
enahum
родитель
9b50b50283
Коммит
0184d6059b
@@ -190,7 +190,8 @@ export function emitPostFocusRightHandSideFromSearch(post, isMentionSearch) {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_POST_SELECTED,
|
||||
postId: Utils.getRootId(post),
|
||||
from_search: SearchStore.getSearchTerm()
|
||||
from_search: SearchStore.getSearchTerm(),
|
||||
from_flagged_posts: SearchStore.getIsFlaggedPosts()
|
||||
});
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
|
||||
@@ -9,12 +9,13 @@ import TeamStore from 'stores/team_store.jsx';
|
||||
import UserStore from 'stores/user_store.jsx';
|
||||
|
||||
import * as PostUtils from 'utils/post_utils.jsx';
|
||||
import Constants from 'utils/constants.jsx';
|
||||
const ActionTypes = Constants.ActionTypes;
|
||||
|
||||
import Client from 'client/web_client.jsx';
|
||||
import * as AsyncClient from 'utils/async_client.jsx';
|
||||
|
||||
import Constants from 'utils/constants.jsx';
|
||||
const ActionTypes = Constants.ActionTypes;
|
||||
const Preferences = Constants.Preferences;
|
||||
|
||||
export function handleNewPost(post, msg) {
|
||||
if (ChannelStore.getCurrentId() === post.channel_id) {
|
||||
if (window.isActive) {
|
||||
@@ -116,3 +117,38 @@ export function setUnreadPost(channelId, postId) {
|
||||
ChannelStore.emitLastViewed(lastViewed, ownNewMessage);
|
||||
}
|
||||
}
|
||||
|
||||
export function flagPost(postId) {
|
||||
AsyncClient.savePreference(Preferences.CATEGORY_FLAGGED_POST, postId, 'true');
|
||||
}
|
||||
|
||||
export function unflagPost(postId, success) {
|
||||
const pref = {
|
||||
user_id: UserStore.getCurrentId(),
|
||||
category: Preferences.CATEGORY_FLAGGED_POST,
|
||||
name: postId
|
||||
};
|
||||
AsyncClient.deletePreferences([pref], success);
|
||||
}
|
||||
|
||||
export function getFlaggedPosts() {
|
||||
Client.getFlaggedPosts(0, Constants.POST_CHUNK_SIZE,
|
||||
(data) => {
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_SEARCH,
|
||||
results: data,
|
||||
is_flagged_posts: true
|
||||
});
|
||||
|
||||
AppDispatcher.handleServerAction({
|
||||
type: ActionTypes.RECEIVED_SEARCH_TERM,
|
||||
term: null,
|
||||
do_search: false,
|
||||
is_mention_search: false
|
||||
});
|
||||
},
|
||||
(err) => {
|
||||
AsyncClient.dispatchError(err, 'getFlaggedPosts');
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user