From a86bdc9f1efda4912b00ec1187cd53c34c58730b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20M=C3=B6ller?= Date: Tue, 9 Jul 2024 11:11:08 -0300 Subject: [PATCH 1/3] Fix: Breakouts calculation for valid users incorrect --- .../actions-bar/create-breakout-room/component.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx index d3a03b9722..e03d8dd62d 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx @@ -469,7 +469,7 @@ class BreakoutRoom extends PureComponent { return; } - if (users.length === this.getUserByRoom(0).length && !freeJoin) { + if (users.length === this.getUserByRoom(0).length) { this.setState({ leastOneUserIsValid: false }); return; } @@ -510,9 +510,9 @@ class BreakoutRoom extends PureComponent { onInviteBreakout() { const { getBreakouts, sendInvitation } = this.props; - const { users, freeJoin } = this.state; + const { users } = this.state; const breakouts = getBreakouts(); - if (users.length === this.getUserByRoom(0).length && !freeJoin) { + if (users.length === this.getUserByRoom(0).length) { this.setState({ leastOneUserIsValid: false }); return; } @@ -637,7 +637,7 @@ class BreakoutRoom extends PureComponent { } setFreeJoin(e) { - this.setState({ freeJoin: e.target.checked, leastOneUserIsValid: true }); + this.setState({ freeJoin: e.target.checked }); } setRecord(e) { @@ -724,7 +724,7 @@ class BreakoutRoom extends PureComponent { this.setState({ users: usersCopy, - leastOneUserIsValid: (this.getUserByRoom(0).length !== users.length || freeJoin), + leastOneUserIsValid: (this.getUserByRoom(0).length !== users.length), }, () => { addNewAlert(intl.formatMessage(intlMessages.movedUserLabel, { 0: userName, 1: room })) }); @@ -1149,6 +1149,8 @@ class BreakoutRoom extends PureComponent { leastOneUserIsValid, } = this.state; + console.log('leastOneUserIsValid', leastOneUserIsValid); + return ( From ce8bb567a0477bb8392e41b2940cd3c279c03080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20M=C3=B6ller?= Date: Wed, 10 Jul 2024 10:21:12 -0300 Subject: [PATCH 2/3] Revert "Fix: Breakouts calculation for valid users incorrect" This reverts commit a86bdc9f1efda4912b00ec1187cd53c34c58730b. --- .../actions-bar/create-breakout-room/component.jsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx index e03d8dd62d..d3a03b9722 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx @@ -469,7 +469,7 @@ class BreakoutRoom extends PureComponent { return; } - if (users.length === this.getUserByRoom(0).length) { + if (users.length === this.getUserByRoom(0).length && !freeJoin) { this.setState({ leastOneUserIsValid: false }); return; } @@ -510,9 +510,9 @@ class BreakoutRoom extends PureComponent { onInviteBreakout() { const { getBreakouts, sendInvitation } = this.props; - const { users } = this.state; + const { users, freeJoin } = this.state; const breakouts = getBreakouts(); - if (users.length === this.getUserByRoom(0).length) { + if (users.length === this.getUserByRoom(0).length && !freeJoin) { this.setState({ leastOneUserIsValid: false }); return; } @@ -637,7 +637,7 @@ class BreakoutRoom extends PureComponent { } setFreeJoin(e) { - this.setState({ freeJoin: e.target.checked }); + this.setState({ freeJoin: e.target.checked, leastOneUserIsValid: true }); } setRecord(e) { @@ -724,7 +724,7 @@ class BreakoutRoom extends PureComponent { this.setState({ users: usersCopy, - leastOneUserIsValid: (this.getUserByRoom(0).length !== users.length), + leastOneUserIsValid: (this.getUserByRoom(0).length !== users.length || freeJoin), }, () => { addNewAlert(intl.formatMessage(intlMessages.movedUserLabel, { 0: userName, 1: room })) }); @@ -1149,8 +1149,6 @@ class BreakoutRoom extends PureComponent { leastOneUserIsValid, } = this.state; - console.log('leastOneUserIsValid', leastOneUserIsValid); - return ( From fe3b81628f481cb4c0ac13636a6ebff9594266cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20M=C3=B6ller?= Date: Wed, 10 Jul 2024 10:45:08 -0300 Subject: [PATCH 3/3] Change of approach --- .../create-breakout-room/component.jsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx index d3a03b9722..a7fb2ac68d 100644 --- a/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/actions-bar/create-breakout-room/component.jsx @@ -265,6 +265,7 @@ class BreakoutRoom extends PureComponent { captureSlides: false, durationIsValid: true, breakoutJoinedUsers: null, + enableUnassingUsers: null, }; this.btnLevelId = uniqueId('btn-set-level-'); @@ -470,7 +471,7 @@ class BreakoutRoom extends PureComponent { } if (users.length === this.getUserByRoom(0).length && !freeJoin) { - this.setState({ leastOneUserIsValid: false }); + this.setState({ leastOneUserIsValid: false, enableUnassingUsers: false }); return; } @@ -516,6 +517,10 @@ class BreakoutRoom extends PureComponent { this.setState({ leastOneUserIsValid: false }); return; } + if (users.length === this.getUserByRoom(0).length) { + this.setState({ enableUnassingUsers: false }); + return; + } breakouts.forEach((breakout) => { const { breakoutId } = breakout; @@ -637,7 +642,10 @@ class BreakoutRoom extends PureComponent { } setFreeJoin(e) { - this.setState({ freeJoin: e.target.checked, leastOneUserIsValid: true }); + this.setState({ + freeJoin: e.target.checked, + leastOneUserIsValid: true, + }); } setRecord(e) { @@ -725,6 +733,7 @@ class BreakoutRoom extends PureComponent { this.setState({ users: usersCopy, leastOneUserIsValid: (this.getUserByRoom(0).length !== users.length || freeJoin), + enableUnassingUsers: (this.getUserByRoom(0).length !== users.length), }, () => { addNewAlert(intl.formatMessage(intlMessages.movedUserLabel, { 0: userName, 1: room })) }); @@ -1146,7 +1155,7 @@ class BreakoutRoom extends PureComponent { if (isUpdate) return null; const { numberOfRoomsIsValid, - leastOneUserIsValid, + enableUnassingUsers, } = this.state; return ( @@ -1154,7 +1163,7 @@ class BreakoutRoom extends PureComponent { {intl.formatMessage(intlMessages.manageRooms)} - {leastOneUserIsValid ? ( + {enableUnassingUsers ? (