Do not clear the more direct messsages list on every open (#3485)
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
f9e5a9029c
Коммит
a65f1fc266
@@ -160,11 +160,6 @@ export function emitPostFocusEvent(postId) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function emitProfilesForDmList() {
|
|
||||||
AsyncClient.getProfilesForDirectMessageList();
|
|
||||||
AsyncClient.getTeamMembers(TeamStore.getCurrentId());
|
|
||||||
}
|
|
||||||
|
|
||||||
export function emitCloseRightHandSide() {
|
export function emitCloseRightHandSide() {
|
||||||
AppDispatcher.handleServerAction({
|
AppDispatcher.handleServerAction({
|
||||||
type: ActionTypes.RECEIVED_SEARCH,
|
type: ActionTypes.RECEIVED_SEARCH,
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import Client from 'utils/web_client.jsx';
|
import Client from 'utils/web_client.jsx';
|
||||||
|
import * as AsyncClient from 'utils/async_client.jsx';
|
||||||
|
|
||||||
|
import TeamStore from 'stores/team_store.jsx';
|
||||||
|
|
||||||
export function switchFromLdapToEmail(email, password, ldapPassword, onSuccess, onError) {
|
export function switchFromLdapToEmail(email, password, ldapPassword, onSuccess, onError) {
|
||||||
Client.ldapToEmail(
|
Client.ldapToEmail(
|
||||||
@@ -20,3 +23,8 @@ export function switchFromLdapToEmail(email, password, ldapPassword, onSuccess,
|
|||||||
onError
|
onError
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getMoreDmList() {
|
||||||
|
AsyncClient.getProfilesForDirectMessageList();
|
||||||
|
AsyncClient.getTeamMembers(TeamStore.getCurrentId());
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,35 +1,38 @@
|
|||||||
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
|
||||||
// See License.txt for license information.
|
// See License.txt for license information.
|
||||||
|
|
||||||
import {Modal} from 'react-bootstrap';
|
import FilteredUserList from 'components/filtered_user_list.jsx';
|
||||||
import FilteredUserList from './filtered_user_list.jsx';
|
|
||||||
import UserStore from 'stores/user_store.jsx';
|
|
||||||
import TeamStore from 'stores/team_store.jsx';
|
|
||||||
import * as Utils from 'utils/utils.jsx';
|
|
||||||
import * as GlobalActions from 'actions/global_actions.jsx';
|
|
||||||
|
|
||||||
import {FormattedMessage} from 'react-intl';
|
|
||||||
import {browserHistory} from 'react-router/es6';
|
|
||||||
import SpinnerButton from 'components/spinner_button.jsx';
|
import SpinnerButton from 'components/spinner_button.jsx';
|
||||||
import LoadingScreen from 'components/loading_screen.jsx';
|
import LoadingScreen from 'components/loading_screen.jsx';
|
||||||
|
|
||||||
|
import {getMoreDmList} from 'actions/user_actions.jsx';
|
||||||
|
|
||||||
|
import UserStore from 'stores/user_store.jsx';
|
||||||
|
import TeamStore from 'stores/team_store.jsx';
|
||||||
|
|
||||||
|
import * as Utils from 'utils/utils.jsx';
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import {Modal} from 'react-bootstrap';
|
||||||
|
import {FormattedMessage} from 'react-intl';
|
||||||
|
import {browserHistory} from 'react-router/es6';
|
||||||
|
|
||||||
export default class MoreDirectChannels extends React.Component {
|
export default class MoreDirectChannels extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.handleHide = this.handleHide.bind(this);
|
this.handleHide = this.handleHide.bind(this);
|
||||||
this.handleOnEnter = this.handleOnEnter.bind(this);
|
|
||||||
this.handleShowDirectChannel = this.handleShowDirectChannel.bind(this);
|
this.handleShowDirectChannel = this.handleShowDirectChannel.bind(this);
|
||||||
this.handleUserChange = this.handleUserChange.bind(this);
|
this.handleUserChange = this.handleUserChange.bind(this);
|
||||||
this.onTeamChange = this.onTeamChange.bind(this);
|
this.onTeamChange = this.onTeamChange.bind(this);
|
||||||
this.createJoinDirectChannelButton = this.createJoinDirectChannelButton.bind(this);
|
this.createJoinDirectChannelButton = this.createJoinDirectChannelButton.bind(this);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
users: null,
|
users: UserStore.getProfilesForDmList(),
|
||||||
teamMembers: null,
|
teamMembers: TeamStore.getMembersForTeam(),
|
||||||
loadingDMChannel: -1
|
loadingDMChannel: -1,
|
||||||
|
usersLoaded: false,
|
||||||
|
teamMembersLoaded: false
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,17 +76,6 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
handleOnEnter() {
|
|
||||||
this.setState({
|
|
||||||
users: null,
|
|
||||||
teamMembers: null
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
handleOnEntered() {
|
|
||||||
GlobalActions.emitProfilesForDmList();
|
|
||||||
}
|
|
||||||
|
|
||||||
handleShowDirectChannel(teammate, e) {
|
handleShowDirectChannel(teammate, e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
@@ -107,13 +99,15 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
|
|
||||||
handleUserChange() {
|
handleUserChange() {
|
||||||
this.setState({
|
this.setState({
|
||||||
users: UserStore.getProfilesForDmList()
|
users: UserStore.getProfilesForDmList(),
|
||||||
|
usersLoaded: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onTeamChange() {
|
onTeamChange() {
|
||||||
this.setState({
|
this.setState({
|
||||||
teamMembers: TeamStore.getMembersForTeam()
|
teamMembers: TeamStore.getMembersForTeam(),
|
||||||
|
teamMembersLoaded: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,7 +133,7 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var body = null;
|
var body = null;
|
||||||
if (this.state.users == null || this.state.teamMembers == null) {
|
if (!this.state.usersLoaded || !this.state.teamMembersLoaded) {
|
||||||
body = (<LoadingScreen/>);
|
body = (<LoadingScreen/>);
|
||||||
} else {
|
} else {
|
||||||
var showTeamToggle = false;
|
var showTeamToggle = false;
|
||||||
@@ -163,8 +157,7 @@ export default class MoreDirectChannels extends React.Component {
|
|||||||
dialogClassName='more-modal more-direct-channels'
|
dialogClassName='more-modal more-direct-channels'
|
||||||
show={this.props.show}
|
show={this.props.show}
|
||||||
onHide={this.handleHide}
|
onHide={this.handleHide}
|
||||||
onEnter={this.handleOnEnter}
|
onEntered={getMoreDmList}
|
||||||
onEntered={this.handleOnEntered}
|
|
||||||
>
|
>
|
||||||
<Modal.Header closeButton={true}>
|
<Modal.Header closeButton={true}>
|
||||||
<Modal.Title>
|
<Modal.Title>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user