summaryrefslogtreecommitdiffstats
path: root/webapp/components/filtered_user_list.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-07-06 13:40:59 -0800
committerGitHub <noreply@github.com>2016-07-06 13:40:59 -0800
commitd5f243dad694d6746ec2b6560a81212a78d8c975 (patch)
tree7f1de697c906ff909f26b739eebaa77f18edf790 /webapp/components/filtered_user_list.jsx
parent3eee51f74e893f3182519ad0edb72dd5d8b107fd (diff)
downloadchat-d5f243dad694d6746ec2b6560a81212a78d8c975.tar.gz
chat-d5f243dad694d6746ec2b6560a81212a78d8c975.tar.bz2
chat-d5f243dad694d6746ec2b6560a81212a78d8c975.zip
PLT-2863 adding remove user from team (#3429)
* PLT-2863 adding remove user from team * PLT-2863 adding the client side UI * Fixing trailing space * Fixing reported issues * Adding documentatino * Switching to final javascript driver
Diffstat (limited to 'webapp/components/filtered_user_list.jsx')
-rw-r--r--webapp/components/filtered_user_list.jsx15
1 files changed, 13 insertions, 2 deletions
diff --git a/webapp/components/filtered_user_list.jsx b/webapp/components/filtered_user_list.jsx
index b6d8f11f9..67d038fd9 100644
--- a/webapp/components/filtered_user_list.jsx
+++ b/webapp/components/filtered_user_list.jsx
@@ -39,17 +39,24 @@ class FilteredUserList extends React.Component {
this.state = {
filter: '',
users: this.filterUsers(props.teamMembers, props.users),
- selected: 'team'
+ selected: 'team',
+ teamMembers: props.teamMembers
};
}
- componentWillUpdate(nextProps) {
+ componentWillReceiveProps(nextProps) {
// assume the user list is immutable
if (this.props.users !== nextProps.users) {
this.setState({
users: this.filterUsers(nextProps.teamMembers, nextProps.users)
});
}
+
+ if (this.props.teamMembers !== nextProps.teamMembers) {
+ this.setState({
+ users: this.filterUsers(nextProps.teamMembers, nextProps.users)
+ });
+ }
}
componentDidMount() {
@@ -70,6 +77,10 @@ class FilteredUserList extends React.Component {
var filteredUsers = users.filter((user) => {
for (const index in teamMembers) {
if (teamMembers.hasOwnProperty(index) && teamMembers[index].user_id === user.id) {
+ if (teamMembers[index].delete_at > 0) {
+ return false;
+ }
+
return true;
}
}