From f303fe4df476b806e46ce893b7c42de3033303ee Mon Sep 17 00:00:00 2001 From: gcampes Date: Tue, 23 Feb 2016 11:06:47 -0300 Subject: [PATCH] Adds event handling for kick user Conflicts: bigbluebutton-html5/app/client/react/components/UserList/UserItem.jsx --- .../react/components/UserList/README.md | 4 +- .../react/components/UserList/UserItem.jsx | 78 ++++++++++++++++++- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/app/client/react/components/UserList/README.md b/bigbluebutton-html5/app/client/react/components/UserList/README.md index 5fff024aa3..9d9efbb2cf 100644 --- a/bigbluebutton-html5/app/client/react/components/UserList/README.md +++ b/bigbluebutton-html5/app/client/react/components/UserList/README.md @@ -1,7 +1,9 @@ # TODO - [] Migrate kick functionality [] Migrate user lock status, currently is just a dummy boolean. + [] Migrate set presenter functionality to a service + [] Migrate kick user functionality to a service + [] Migrate open private chat to a service # Know Issues diff --git a/bigbluebutton-html5/app/client/react/components/UserList/UserItem.jsx b/bigbluebutton-html5/app/client/react/components/UserList/UserItem.jsx index bb7ab111e9..c2872ea27e 100644 --- a/bigbluebutton-html5/app/client/react/components/UserList/UserItem.jsx +++ b/bigbluebutton-html5/app/client/react/components/UserList/UserItem.jsx @@ -1,4 +1,17 @@ UserItem = React.createClass({ + + handleKick(user) { + kickUser(BBB.getMeetingId(), user.id, getInSession("userId"), getInSession("authToken")); + }, + + handleMute(user) { + alert('Should mute user ' + user.name); + }, + + handleUnmute(user) { + alert('Should unmute user ' + user.name); + }, + handleOpenPrivateChat(user) { let userIdSelected = user.id; @@ -19,7 +32,6 @@ UserItem = React.createClass({ }, handleSetPresenter(user){ - /*this is a global function and should be looked at to be changed to a better solution*/ setUserPresenter(BBB.getMeetingId(), user.id, getInSession('userId'), user.name, getInSession('authToken')); }, @@ -30,6 +42,7 @@ UserItem = React.createClass({ {this.renderStatusIcons(user)} {this.renderUserName(user)} {this.renderUnreadBadge(user.unreadMessagesCount)} + {this.renderSharingStatus(user)} ); }, @@ -89,5 +102,68 @@ UserItem = React.createClass({ {(unreadMessagesCount > 9) ? '9+' : unreadMessagesCount} ); + }, + + renderSharingStatus(user) { + const { sharingStatus, name: userName } = user; + + const currentUser = this.props.currentUser; + + let icons = []; + + if(sharingStatus.isListenOnly) { + icons.push(); + } else { + if(sharingStatus.isMuted) { + icons.push( + + ); + } else { + let talkingStatusIcon = ; + + if(sharingStatus.isTalking) { + talkingStatusIcon = ; + } + + icons.push( + + ); + } + } + + if (!user.isCurrent && currentUser.isModerator) { + icons.push( + + ); + } + + if (sharingStatus.isWebcamOpen) { + icons.push(); + } + + if (sharingStatus.isLocked) { + icons.push(); + } + + return ( +
+ {icons.map(i => i)} +
+ ); } })