Skip to content

Commit a36c091

Browse files
authored
Add prompt notification for assigned breakout room changes when auto move is false (#6048)
* Add prompt notification for assigned breakout room changes when auto move is false * Change files * update APIs * Update changelog workstream to 'Breakout rooms'
1 parent b500080 commit a36c091

10 files changed

Lines changed: 49 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Breakout rooms",
5+
"comment": "Add prompt notification for assigned breakout room changes when auto move is false",
6+
"packageName": "@azure/communication-react",
7+
"email": "miguelgamis@microsoft.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "Breakout rooms",
5+
"comment": "Add prompt notification for assigned breakout room changes when auto move is false",
6+
"packageName": "@azure/communication-react",
7+
"email": "miguelgamis@microsoft.com",
8+
"dependentChangeType": "patch"
9+
}

packages/calling-component-bindings/src/notificationStackSelector.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,13 @@ export const notificationStackSelector: NotificationStackSelector = createSelect
256256
timestamp: latestNotifications['assignedBreakoutRoomChanged'].timestamp
257257
});
258258
}
259+
if (latestNotifications['assignedBreakoutRoomChangedPromptJoin'] && assignedBreakoutRoom) {
260+
activeNotifications.push({
261+
type: 'assignedBreakoutRoomChangedPromptJoin',
262+
timestamp: latestNotifications['assignedBreakoutRoomChangedPromptJoin'].timestamp,
263+
onClickPrimaryButton: () => assignedBreakoutRoom.join()
264+
});
265+
}
259266
if (latestNotifications['assignedBreakoutRoomClosed']) {
260267
activeNotifications.push({
261268
type: 'assignedBreakoutRoomClosed',

packages/calling-stateful-client/src/BreakoutRoomsSubscriber.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,12 @@ export class BreakoutRoomsSubscriber {
8383
callState.breakoutRooms?.breakoutRoomDisplayName &&
8484
callState.breakoutRooms.breakoutRoomDisplayName !== breakoutRoom.displayName
8585
) {
86+
const target: NotificationTarget =
87+
breakoutRoom.autoMoveParticipantToBreakoutRoom === false
88+
? 'assignedBreakoutRoomChangedPromptJoin'
89+
: 'assignedBreakoutRoomChanged';
8690
this._context.setLatestNotification(this._callIdRef.callId, {
87-
target: 'assignedBreakoutRoomChanged',
91+
target,
8892
timestamp: new Date(Date.now())
8993
});
9094
} else if (
@@ -102,12 +106,14 @@ export class BreakoutRoomsSubscriber {
102106
this._context.deleteLatestNotification('assignedBreakoutRoomOpened', this._callIdRef.callId);
103107
this._context.deleteLatestNotification('assignedBreakoutRoomOpenedPromptJoin', this._callIdRef.callId);
104108
this._context.deleteLatestNotification('assignedBreakoutRoomChanged', this._callIdRef.callId);
109+
this._context.deleteLatestNotification('assignedBreakoutRoomChangedPromptJoin', this._callIdRef.callId);
105110
this._context.deleteLatestNotification('breakoutRoomJoined', this._callIdRef.callId);
106111
} else if (breakoutRoom.state === 'closed') {
107112
// This scenario covers the case where the breakout room is closed
108113
this._context.deleteLatestNotification('assignedBreakoutRoomOpened', this._callIdRef.callId);
109114
this._context.deleteLatestNotification('assignedBreakoutRoomOpenedPromptJoin', this._callIdRef.callId);
110115
this._context.deleteLatestNotification('assignedBreakoutRoomChanged', this._callIdRef.callId);
116+
this._context.deleteLatestNotification('assignedBreakoutRoomChangedPromptJoin', this._callIdRef.callId);
111117
this._context.deleteLatestNotification('breakoutRoomJoined', this._callIdRef.callId);
112118
this._context.deleteLatestNotification('breakoutRoomClosingSoon', this._callIdRef.callId);
113119
clearTimeout(this._breakoutRoomClosingSoonTimeoutId);
@@ -129,6 +135,7 @@ export class BreakoutRoomsSubscriber {
129135
this._context.deleteLatestNotification('assignedBreakoutRoomOpened', this._callIdRef.callId);
130136
this._context.deleteLatestNotification('assignedBreakoutRoomOpenedPromptJoin', this._callIdRef.callId);
131137
this._context.deleteLatestNotification('assignedBreakoutRoomChanged', this._callIdRef.callId);
138+
this._context.deleteLatestNotification('assignedBreakoutRoomChangedPromptJoin', this._callIdRef.callId);
132139

133140
// Send latest notification for breakoutRoomJoined on behalf of the call that was joined.
134141
this._context.setLatestNotification(call.id, {

packages/calling-stateful-client/src/CallClientState.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,6 +1232,7 @@ export type NotificationTarget =
12321232
| 'assignedBreakoutRoomOpened'
12331233
| 'assignedBreakoutRoomOpenedPromptJoin'
12341234
| 'assignedBreakoutRoomChanged'
1235+
| 'assignedBreakoutRoomChangedPromptJoin'
12351236
| 'assignedBreakoutRoomClosed'
12361237
| 'breakoutRoomJoined'
12371238
| 'breakoutRoomClosingSoon'

packages/communication-react/review/beta/communication-react.api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4231,6 +4231,7 @@ export type NotificationStackSelector = (state: CallClientState, props: CallingB
42314231
// @public
42324232
export interface NotificationStackStrings {
42334233
assignedBreakoutRoomChanged?: NotificationStrings;
4234+
assignedBreakoutRoomChangedPromptJoin?: NotificationStrings;
42344235
assignedBreakoutRoomClosed?: NotificationStrings;
42354236
assignedBreakoutRoomOpened?: NotificationStrings;
42364237
assignedBreakoutRoomOpenedPromptJoin?: NotificationStrings;
@@ -4307,7 +4308,7 @@ export interface NotificationStyles {
43074308
}
43084309

43094310
// @public (undocumented)
4310-
export type NotificationTarget = 'assignedBreakoutRoomOpened' | 'assignedBreakoutRoomOpenedPromptJoin' | 'assignedBreakoutRoomChanged' | 'assignedBreakoutRoomClosed' | 'breakoutRoomJoined' | 'breakoutRoomClosingSoon' | 'capabilityTurnVideoOnPresent' | 'capabilityTurnVideoOnAbsent' | 'capabilityUnmuteMicPresent' | 'capabilityUnmuteMicAbsent' | 'togetherModeStarted' | 'togetherModeEnded';
4311+
export type NotificationTarget = 'assignedBreakoutRoomOpened' | 'assignedBreakoutRoomOpenedPromptJoin' | 'assignedBreakoutRoomChanged' | 'assignedBreakoutRoomChangedPromptJoin' | 'assignedBreakoutRoomClosed' | 'breakoutRoomJoined' | 'breakoutRoomClosingSoon' | 'capabilityTurnVideoOnPresent' | 'capabilityTurnVideoOnAbsent' | 'capabilityUnmuteMicPresent' | 'capabilityUnmuteMicAbsent' | 'togetherModeStarted' | 'togetherModeEnded';
43114312

43124313
// @public
43134314
export type NotificationType = keyof NotificationStackStrings;

packages/communication-react/review/stable/communication-react.api.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3836,6 +3836,7 @@ export type NotificationStackSelector = (state: CallClientState, props: CallingB
38363836
// @public
38373837
export interface NotificationStackStrings {
38383838
assignedBreakoutRoomChanged?: NotificationStrings;
3839+
assignedBreakoutRoomChangedPromptJoin?: NotificationStrings;
38393840
assignedBreakoutRoomClosed?: NotificationStrings;
38403841
assignedBreakoutRoomOpened?: NotificationStrings;
38413842
assignedBreakoutRoomOpenedPromptJoin?: NotificationStrings;
@@ -3912,7 +3913,7 @@ export interface NotificationStyles {
39123913
}
39133914

39143915
// @public (undocumented)
3915-
export type NotificationTarget = 'assignedBreakoutRoomOpened' | 'assignedBreakoutRoomOpenedPromptJoin' | 'assignedBreakoutRoomChanged' | 'assignedBreakoutRoomClosed' | 'breakoutRoomJoined' | 'breakoutRoomClosingSoon' | 'capabilityTurnVideoOnPresent' | 'capabilityTurnVideoOnAbsent' | 'capabilityUnmuteMicPresent' | 'capabilityUnmuteMicAbsent' | 'togetherModeStarted' | 'togetherModeEnded';
3916+
export type NotificationTarget = 'assignedBreakoutRoomOpened' | 'assignedBreakoutRoomOpenedPromptJoin' | 'assignedBreakoutRoomChanged' | 'assignedBreakoutRoomChangedPromptJoin' | 'assignedBreakoutRoomClosed' | 'breakoutRoomJoined' | 'breakoutRoomClosingSoon' | 'capabilityTurnVideoOnPresent' | 'capabilityTurnVideoOnAbsent' | 'capabilityUnmuteMicPresent' | 'capabilityUnmuteMicAbsent' | 'togetherModeStarted' | 'togetherModeEnded';
39163917

39173918
// @public
39183919
export type NotificationType = keyof NotificationStackStrings;

packages/react-components/src/components/NotificationStack.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ export interface NotificationStackStrings {
255255
* Message shown in notification when the user's assigned breakout room is changed
256256
*/
257257
assignedBreakoutRoomChanged?: NotificationStrings;
258+
/**
259+
* Message shown in notification when the user is prompted to join their new assigned breakout room
260+
*/
261+
assignedBreakoutRoomChangedPromptJoin?: NotificationStrings;
258262
/**
259263
* Message shown in notification when the user's assigned breakout room is closed
260264
*/

packages/react-components/src/components/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@ export const customNotificationIconName: Partial<{ [key in NotificationType]: st
353353
assignedBreakoutRoomOpened: 'NotificationBarBreakoutRoomOpened',
354354
assignedBreakoutRoomOpenedPromptJoin: 'NotificationBarBreakoutRoomPromptJoin',
355355
assignedBreakoutRoomChanged: 'NotificationBarBreakoutRoomChanged',
356+
assignedBreakoutRoomChangedPromptJoin: 'NotificationBarBreakoutRoomChanged',
356357
assignedBreakoutRoomClosed: 'NotificationBarBreakoutRoomClosed',
357358
breakoutRoomJoined: 'NotificationBarBreakoutRoomJoined',
358359
breakoutRoomClosingSoon: 'NotificationBarBreakoutRoomClosingSoon',

packages/react-components/src/localization/locales/en-US/strings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,12 @@
604604
"message": "We'll move you to your assigned room in 5 seconds.",
605605
"dismissButtonAriaLabel": "Close"
606606
},
607+
"assignedBreakoutRoomChangedPromptJoin": {
608+
"title": "Your breakout room has changed",
609+
"message": "You've been assigned to a different breakout room.",
610+
"dismissButtonAriaLabel": "Close",
611+
"primaryButtonLabel": "Join room"
612+
},
607613
"assignedBreakoutRoomClosed": {
608614
"title": "Your breakout room has closed",
609615
"message": "We'll move you back to your meeting in 5 seconds.",

0 commit comments

Comments
 (0)