Translates dynamically breakout room Names when default name is being used

This commit is contained in:
Gustavo Trott 2021-06-14 16:59:27 -03:00
parent 169670a36d
commit 37dea2215b
11 changed files with 54 additions and 19 deletions

View File

@ -9,11 +9,13 @@ object BreakoutModel {
externalId: String,
name: String,
sequence: Integer,
shortName: String,
isDefaultName: Boolean,
freeJoin: Boolean,
voiceConf: String,
assignedUsers: Vector[String]
): BreakoutRoom2x = {
new BreakoutRoom2x(id, externalId, name, parentId, sequence, freeJoin, voiceConf, assignedUsers, Vector(), Vector(), None, false)
new BreakoutRoom2x(id, externalId, name, parentId, sequence, shortName, isDefaultName, freeJoin, voiceConf, assignedUsers, Vector(), Vector(), None, false)
}
}

View File

@ -68,7 +68,7 @@ trait BreakoutRoomCreatedMsgHdlr {
def sendBreakoutRoomsList(breakoutModel: BreakoutModel): BreakoutModel = {
val breakoutRooms = breakoutModel.rooms.values.toVector map { r =>
new BreakoutRoomInfo(r.name, r.externalId, r.id, r.sequence, r.freeJoin)
new BreakoutRoomInfo(r.name, r.externalId, r.id, r.sequence, r.shortName, r.isDefaultName, r.freeJoin)
}
log.info("Sending breakout rooms list to {} with containing {} room(s)", liveMeeting.props.meetingProp.intId, breakoutRooms.length)
@ -95,7 +95,7 @@ trait BreakoutRoomCreatedMsgHdlr {
BbbCommonEnvCoreMsg(envelope, event)
}
val breakoutInfo = BreakoutRoomInfo(room.name, room.externalId, room.id, room.sequence, room.freeJoin)
val breakoutInfo = BreakoutRoomInfo(room.name, room.externalId, room.id, room.sequence, room.shortName, room.isDefaultName, room.freeJoin)
val event = build(liveMeeting.props.meetingProp.intId, breakoutInfo)
outGW.send(event)

View File

@ -28,7 +28,7 @@ trait BreakoutRoomsListMsgHdlr {
breakoutModel <- state.breakout
} yield {
val rooms = breakoutModel.rooms.values.toVector map { r =>
new BreakoutRoomInfo(r.name, r.externalId, r.id, r.sequence, r.freeJoin)
new BreakoutRoomInfo(r.name, r.externalId, r.id, r.sequence, r.shortName, r.isDefaultName, r.freeJoin)
}
val ready = breakoutModel.hasAllStarted()
broadcastEvent(rooms, ready)

View File

@ -47,7 +47,7 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait {
val (internalId, externalId) = BreakoutRoomsUtil.createMeetingIds(liveMeeting.props.meetingProp.intId, i)
val voiceConf = BreakoutRoomsUtil.createVoiceConfId(liveMeeting.props.voiceProp.voiceConf, i)
val breakout = BreakoutModel.create(parentId, internalId, externalId, room.name, room.sequence, room.freeJoin, voiceConf, room.users)
val breakout = BreakoutModel.create(parentId, internalId, externalId, room.name, room.sequence, room.shortName, room.isDefaultName, room.freeJoin, voiceConf, room.users)
rooms = rooms + (breakout.id -> breakout)
}
@ -56,6 +56,8 @@ trait CreateBreakoutRoomsCmdMsgHdlr extends RightsManagementTrait {
breakout.id, breakout.name,
liveMeeting.props.meetingProp.intId,
breakout.sequence,
breakout.shortName,
breakout.isDefaultName,
breakout.freeJoin,
liveMeeting.props.voiceProp.dialNumber,
breakout.voiceConf,

View File

@ -6,6 +6,8 @@ case class BreakoutRoom2x(
name: String,
parentId: String,
sequence: Int,
shortName: String,
isDefaultName: Boolean,
freeJoin: Boolean,
voiceConf: String,
assignedUsers: Vector[String],

View File

@ -13,7 +13,7 @@ case class BreakoutRoomJoinURLEvtMsgBody(parentId: String, breakoutId: String, e
object BreakoutRoomsListEvtMsg { val NAME = "BreakoutRoomsListEvtMsg" }
case class BreakoutRoomsListEvtMsg(header: BbbClientMsgHeader, body: BreakoutRoomsListEvtMsgBody) extends BbbCoreMsg
case class BreakoutRoomsListEvtMsgBody(meetingId: String, rooms: Vector[BreakoutRoomInfo], roomsReady: Boolean)
case class BreakoutRoomInfo(name: String, externalId: String, breakoutId: String, sequence: Int, freeJoin: Boolean)
case class BreakoutRoomInfo(name: String, externalId: String, breakoutId: String, sequence: Int, shortName: String, isDefaultName: Boolean, freeJoin: Boolean)
object BreakoutRoomsListMsg { val NAME = "BreakoutRoomsListMsg" }
case class BreakoutRoomsListMsg(header: BbbClientMsgHeader, body: BreakoutRoomsListMsgBody) extends StandardMsg
@ -47,6 +47,8 @@ case class BreakoutRoomDetail(
name: String,
parentId: String,
sequence: Integer,
shortName: String,
isDefaultName: Boolean,
freeJoin: Boolean,
dialNumber: String,
voiceConfId: String,
@ -65,7 +67,7 @@ case class BreakoutRoomDetail(
object CreateBreakoutRoomsCmdMsg { val NAME = "CreateBreakoutRoomsCmdMsg" }
case class CreateBreakoutRoomsCmdMsg(header: BbbClientMsgHeader, body: CreateBreakoutRoomsCmdMsgBody) extends StandardMsg
case class CreateBreakoutRoomsCmdMsgBody(meetingId: String, durationInMinutes: Int, record: Boolean, rooms: Vector[BreakoutRoomMsgBody])
case class BreakoutRoomMsgBody(name: String, sequence: Int, freeJoin: Boolean, users: Vector[String])
case class BreakoutRoomMsgBody(name: String, sequence: Int, shortName: String, isDefaultName: Boolean, freeJoin: Boolean, users: Vector[String])
// Sent by user to request ending all the breakout rooms
object EndAllBreakoutRoomsMsg { val NAME = "EndAllBreakoutRoomsMsg" }

View File

@ -6,6 +6,8 @@ public class CreateBreakoutRoom implements IMessage {
public final String parentMeetingId; // The main meeting internal id
public final String name; // The name of the breakout room
public final Integer sequence; // The sequence number of the breakout room
public final String shortName; // Name used in breakout rooms list
public final Boolean isDefaultName; // Inform if using default name or changed by moderator
public final Boolean freeJoin; // Allow users to freely join the conference
// in the client
public final String dialNumber;
@ -22,6 +24,8 @@ public class CreateBreakoutRoom implements IMessage {
String parentMeetingId,
String name,
Integer sequence,
String shortName,
Boolean isDefaultName,
Boolean freeJoin,
String dialNumber,
String voiceConfId,
@ -36,6 +40,8 @@ public class CreateBreakoutRoom implements IMessage {
this.parentMeetingId = parentMeetingId;
this.name = name;
this.sequence = sequence;
this.shortName = shortName;
this.isDefaultName = isDefaultName;
this.freeJoin = freeJoin;
this.dialNumber = dialNumber;
this.voiceConfId = voiceConfId;

View File

@ -87,6 +87,8 @@ class OldMeetingMsgHdlrActor(val olgMsgGW: OldMessageReceivedGW)
msg.body.room.parentId,
msg.body.room.name,
msg.body.room.sequence,
msg.body.room.shortName,
msg.body.room.isDefaultName,
msg.body.room.freeJoin,
msg.body.room.dialNumber,
msg.body.room.voiceConfId,

View File

@ -43,9 +43,9 @@ const intlMessages = defineMessages({
id: 'app.createBreakoutRoom.randomlyAssign',
description: 'randomly assign label',
},
roomName: {
id: 'app.createBreakoutRoom.roomName',
description: 'room intl to name the breakout meetings',
breakoutRoom: {
id: 'app.createBreakoutRoom.room',
description: 'breakout room',
},
freeJoinLabel: {
id: 'app.createBreakoutRoom.freeJoin',
@ -345,7 +345,9 @@ class BreakoutRoom extends PureComponent {
const rooms = _.range(1, numberOfRooms + 1).map((seq) => ({
users: this.getUserByRoom(seq).map((u) => u.userId),
name: this.getRoomName(seq),
name: this.getFullName(seq),
shortName: this.getRoomName(seq),
isDefaultName: !this.hasNameChanged(seq),
freeJoin,
sequence: seq,
}));
@ -514,17 +516,32 @@ class BreakoutRoom extends PureComponent {
}
getRoomName(position) {
const { intl, meetingName } = this.props;
const { intl } = this.props;
const { roomNamesChanged } = this.state;
if (typeof roomNamesChanged[position] !== 'undefined') {
if (this.hasNameChanged(position)) {
return roomNamesChanged[position];
}
return intl.formatMessage(intlMessages.roomName, {
0: meetingName,
1: position,
});
return intl.formatMessage(intlMessages.breakoutRoom, { 0: position });
}
getFullName(position) {
const { meetingName } = this.props;
return `${meetingName} (${this.getRoomName(position)})`;
}
hasNameChanged(position) {
const { intl } = this.props;
const { roomNamesChanged } = this.state;
if (typeof roomNamesChanged[position] !== 'undefined'
&& roomNamesChanged[position] !== intl.formatMessage(intlMessages.breakoutRoom, { 0: position })) {
return true;
} else {
return false;
}
}
hasNameDuplicated(position) {

View File

@ -65,7 +65,7 @@ export default {
isBreakoutRecordable: () => Meetings.findOne({ meetingId: Auth.meetingID },
{ fields: { 'breakoutProps.record': 1 } }).breakoutProps.record,
toggleRecording: () => makeCall('toggleRecording'),
createBreakoutRoom: (numberOfRooms, durationInMinutes, record = false) => makeCall('createBreakoutRoom', numberOfRooms, durationInMinutes, record),
createBreakoutRoom: (rooms, durationInMinutes, record = false) => makeCall('createBreakoutRoom', rooms, durationInMinutes, record),
sendInvitation: (breakoutId, userId) => makeCall('requestJoinURL', { breakoutId, userId }),
breakoutJoinedUsers: () => Breakouts.find({
joinedUsers: { $exists: true },

View File

@ -335,7 +335,9 @@ class BreakoutRoom extends PureComponent {
>
<div className={styles.content} key={`breakoutRoomList-${breakout.breakoutId}`}>
<span aria-hidden>
{breakout.name}
{ breakout.isDefaultName
? intl.formatMessage(intlMessages.breakoutRoom, { 0: breakout.sequence })
: breakout.shortName }
<span className={styles.usersAssignedNumberLabel}>
(
{breakout.joinedUsers.length}