dismiss deleted message in RHS (#6914)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6a056a0042
Коммит
b1322746d2
@@ -332,13 +332,6 @@ export function emitPreferencesDeletedEvent(preferences) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function emitRemovePost(post) {
|
|
||||||
AppDispatcher.handleViewAction({
|
|
||||||
type: Constants.ActionTypes.REMOVE_POST,
|
|
||||||
post
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function sendEphemeralPost(message, channelId) {
|
export function sendEphemeralPost(message, channelId) {
|
||||||
const timestamp = Utils.getTimestamp();
|
const timestamp = Utils.getTimestamp();
|
||||||
const post = {
|
const post = {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import FailedPostOptions from 'components/post_view/failed_post_options';
|
|||||||
import DotMenu from 'components/dot_menu';
|
import DotMenu from 'components/dot_menu';
|
||||||
import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay.jsx';
|
import EmojiPickerOverlay from 'components/emoji_picker/emoji_picker_overlay.jsx';
|
||||||
|
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
|
||||||
import {addReaction} from 'actions/post_actions.jsx';
|
import {addReaction} from 'actions/post_actions.jsx';
|
||||||
|
|
||||||
import TeamStore from 'stores/team_store.jsx';
|
import TeamStore from 'stores/team_store.jsx';
|
||||||
@@ -56,7 +55,7 @@ export default class RhsComment extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
removePost() {
|
removePost() {
|
||||||
GlobalActions.emitRemovePost(this.props.post);
|
this.props.removePost(this.props.post);
|
||||||
}
|
}
|
||||||
|
|
||||||
createRemovePostButton() {
|
createRemovePostButton() {
|
||||||
@@ -447,5 +446,6 @@ RhsComment.propTypes = {
|
|||||||
isFlagged: PropTypes.bool,
|
isFlagged: PropTypes.bool,
|
||||||
status: PropTypes.string,
|
status: PropTypes.string,
|
||||||
isBusy: PropTypes.bool,
|
isBusy: PropTypes.bool,
|
||||||
getPostList: PropTypes.func.isRequired
|
getPostList: PropTypes.func.isRequired,
|
||||||
|
removePost: PropTypes.func.isRequired
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import {connect} from 'react-redux';
|
import {connect} from 'react-redux';
|
||||||
|
import {bindActionCreators} from 'redux';
|
||||||
import {getPost, makeGetPostsForThread} from 'mattermost-redux/selectors/entities/posts';
|
import {getPost, makeGetPostsForThread} from 'mattermost-redux/selectors/entities/posts';
|
||||||
|
import {removePost} from 'mattermost-redux/actions/posts';
|
||||||
|
|
||||||
import RhsThread from './rhs_thread.jsx';
|
import RhsThread from './rhs_thread.jsx';
|
||||||
|
|
||||||
@@ -24,4 +26,12 @@ function makeMapStateToProps() {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(makeMapStateToProps)(RhsThread);
|
function mapDispatchToProps(dispatch) {
|
||||||
|
return {
|
||||||
|
actions: bindActionCreators({
|
||||||
|
removePost
|
||||||
|
}, dispatch)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default connect(makeMapStateToProps, mapDispatchToProps)(RhsThread);
|
||||||
|
|||||||
@@ -59,7 +59,10 @@ export default class RhsThread extends React.Component {
|
|||||||
currentUser: PropTypes.object.isRequired,
|
currentUser: PropTypes.object.isRequired,
|
||||||
useMilitaryTime: PropTypes.bool.isRequired,
|
useMilitaryTime: PropTypes.bool.isRequired,
|
||||||
toggleSize: PropTypes.func,
|
toggleSize: PropTypes.func,
|
||||||
shrink: PropTypes.func
|
shrink: PropTypes.func,
|
||||||
|
actions: PropTypes.shape({
|
||||||
|
removePost: PropTypes.func.isRequired
|
||||||
|
}).isRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
@@ -401,6 +404,7 @@ export default class RhsThread extends React.Component {
|
|||||||
status={status}
|
status={status}
|
||||||
isBusy={this.state.isBusy}
|
isBusy={this.state.isBusy}
|
||||||
getPostList={this.getPostListContainer}
|
getPostList={this.getPostListContainer}
|
||||||
|
removePost={this.props.actions.removePost}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user