From ee41c0bd93ae38b74485325c343bf04cbad0f3f5 Mon Sep 17 00:00:00 2001 From: KDSBrowne Date: Tue, 30 Oct 2018 13:17:40 +0000 Subject: [PATCH] adjust variable names / remove duplicate return --- .../polls/server/handlers/userResponded.js | 1 - .../api/polls/server/methods/startPoll.js | 2 -- .../imports/ui/components/poll/component.jsx | 10 +++---- .../components/poll/live-result/component.jsx | 12 ++++----- .../components/poll/live-result/styles.scss | 26 +++++++++---------- .../imports/ui/components/poll/styles.scss | 10 +++---- 6 files changed, 28 insertions(+), 33 deletions(-) diff --git a/bigbluebutton-html5/imports/api/polls/server/handlers/userResponded.js b/bigbluebutton-html5/imports/api/polls/server/handlers/userResponded.js index 15649fd180..5c6ef7ae61 100644 --- a/bigbluebutton-html5/imports/api/polls/server/handlers/userResponded.js +++ b/bigbluebutton-html5/imports/api/polls/server/handlers/userResponded.js @@ -1,4 +1,3 @@ - import { check } from 'meteor/check'; import Polls from '/imports/api/polls'; import Logger from '/imports/startup/server/logger'; diff --git a/bigbluebutton-html5/imports/api/polls/server/methods/startPoll.js b/bigbluebutton-html5/imports/api/polls/server/methods/startPoll.js index 03181c4715..7f4722837a 100644 --- a/bigbluebutton-html5/imports/api/polls/server/methods/startPoll.js +++ b/bigbluebutton-html5/imports/api/polls/server/methods/startPoll.js @@ -22,10 +22,8 @@ export default function startPoll(credentials, pollType, pollId, answers) { if (pollType === 'custom') { EVENT_NAME = 'StartCustomPollReqMsg'; - check(answers, Array); payload.answers = answers; - return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); } return RedisPubSub.publishUserMessage(CHANNEL, EVENT_NAME, meetingId, requesterUserId, payload); diff --git a/bigbluebutton-html5/imports/ui/components/poll/component.jsx b/bigbluebutton-html5/imports/ui/components/poll/component.jsx index ddd66085c2..fb6af3839d 100644 --- a/bigbluebutton-html5/imports/ui/components/poll/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/poll/component.jsx @@ -86,7 +86,7 @@ class Poll extends Component { this.nonPresenterRedirect = this.nonPresenterRedirect.bind(this); this.getInputFields = this.getInputFields.bind(this); this.handleInputChange = this.handleInputChange.bind(this); - this.back = this.back.bind(this); + this.handleBackClick = this.handleBackClick.bind(this); } componentWillMount() { @@ -135,9 +135,7 @@ class Poll extends Component { this.inputEditor = []; - return customPollReq - ? this.setState({ customPollReq: false }) - : this.setState({ customPollReq: true }); + return this.setState({ customPollReq: !this.state.customPollReq }); } renderQuickPollBtns() { @@ -187,7 +185,7 @@ class Poll extends Component { ); } - back() { + handleBackClick() { const { stopPoll } = this.props; stopPoll(); @@ -216,7 +214,7 @@ class Poll extends Component { getUser, currentPoll, }} - back={this.back} + handleBackClick={this.handleBackClick} /> ); diff --git a/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx b/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx index fd486c579c..c2ac1204da 100644 --- a/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/poll/live-result/component.jsx @@ -81,10 +81,10 @@ class LiveResult extends Component { } = currentPoll; if (responses && answers) { - responses.map((ur) => { + responses.forEach((ur) => { const user = getUser(ur.userId); if (user) { - answers.map((obj) => { + answers.forEach((obj) => { if (obj.id === ur.answerId) { respondedUsers.push(
{user.name}
); respondedUsers.push(
{obj.key}
); @@ -98,6 +98,7 @@ class LiveResult extends Component { return respondedUsers; } + getUnresponsive() { const { currentPoll, getUser } = this.props; @@ -112,9 +113,8 @@ class LiveResult extends Component { const usersList = _.compact(users); if (usersList) { - usersList.map((userId) => { + usersList.forEach((userId) => { const user = getUser(userId); - if (user && user.connectionStatus == 'online') { usersToRespond.push(
{user.name}
); usersToRespond.push(
-
); @@ -127,7 +127,7 @@ class LiveResult extends Component { render() { const { - intl, publishPoll, stopPoll, back, + intl, publishPoll, stopPoll, handleBackClick, } = this.props; return ( @@ -149,7 +149,7 @@ class LiveResult extends Component { />