Merge branch 'feat-user-roles' into develop
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import * as userRoles from './userRoles';
|
||||
|
||||
const initialState =
|
||||
{
|
||||
id : null,
|
||||
picture : null,
|
||||
isMobile : false,
|
||||
roles : [ userRoles.ALL ],
|
||||
canSendMic : false,
|
||||
canSendWebcam : false,
|
||||
canShareScreen : false,
|
||||
@@ -49,6 +52,24 @@ const me = (state = initialState, action) =>
|
||||
return { ...state, loggedIn: flag };
|
||||
}
|
||||
|
||||
case 'ADD_ROLE':
|
||||
{
|
||||
if (state.roles.includes(action.payload.role))
|
||||
return state;
|
||||
|
||||
const roles = [ ...state.roles, action.payload.role ];
|
||||
|
||||
return { ...state, roles };
|
||||
}
|
||||
|
||||
case 'REMOVE_ROLE':
|
||||
{
|
||||
const roles = state.roles.filter((role) =>
|
||||
role !== action.payload.role);
|
||||
|
||||
return { ...state, roles };
|
||||
}
|
||||
|
||||
case 'SET_PICTURE':
|
||||
return { ...state, picture: action.payload.picture };
|
||||
|
||||
|
||||
@@ -16,6 +16,9 @@ const peer = (state = {}, action) =>
|
||||
|
||||
case 'SET_PEER_SCREEN_IN_PROGRESS':
|
||||
return { ...state, peerScreenInProgress: action.payload.flag };
|
||||
|
||||
case 'SET_PEER_KICK_IN_PROGRESS':
|
||||
return { ...state, peerKickInProgress: action.payload.flag };
|
||||
|
||||
case 'SET_PEER_RAISE_HAND_STATE':
|
||||
return { ...state, raiseHandState: action.payload.raiseHandState };
|
||||
@@ -40,6 +43,21 @@ const peer = (state = {}, action) =>
|
||||
return { ...state, picture: action.payload.picture };
|
||||
}
|
||||
|
||||
case 'ADD_PEER_ROLE':
|
||||
{
|
||||
const roles = [ ...state.roles, action.payload.role ];
|
||||
|
||||
return { ...state, roles };
|
||||
}
|
||||
|
||||
case 'REMOVE_PEER_ROLE':
|
||||
{
|
||||
const roles = state.roles.filter((role) =>
|
||||
role !== action.payload.role);
|
||||
|
||||
return { ...state, roles };
|
||||
}
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
@@ -71,6 +89,8 @@ const peers = (state = {}, action) =>
|
||||
case 'SET_PEER_RAISE_HAND_STATE':
|
||||
case 'SET_PEER_PICTURE':
|
||||
case 'ADD_CONSUMER':
|
||||
case 'ADD_PEER_ROLE':
|
||||
case 'REMOVE_PEER_ROLE':
|
||||
{
|
||||
const oldPeer = state[action.payload.peerId];
|
||||
|
||||
@@ -82,6 +102,7 @@ const peers = (state = {}, action) =>
|
||||
return { ...state, [oldPeer.id]: peer(oldPeer, action) };
|
||||
}
|
||||
|
||||
case 'SET_PEER_KICK_IN_PROGRESS':
|
||||
case 'REMOVE_CONSUMER':
|
||||
{
|
||||
const oldPeer = state[action.payload.peerId];
|
||||
|
||||
+32
-20
@@ -1,24 +1,27 @@
|
||||
const initialState =
|
||||
{
|
||||
name : '',
|
||||
state : 'new', // new/connecting/connected/disconnected/closed,
|
||||
locked : false,
|
||||
inLobby : false,
|
||||
signInRequired : false,
|
||||
accessCode : '', // access code to the room if locked and joinByAccessCode == true
|
||||
joinByAccessCode : true, // if true: accessCode is a possibility to open the room
|
||||
activeSpeakerId : null,
|
||||
torrentSupport : false,
|
||||
showSettings : false,
|
||||
fullScreenConsumer : null, // ConsumerID
|
||||
windowConsumer : null, // ConsumerID
|
||||
toolbarsVisible : true,
|
||||
mode : 'democratic',
|
||||
selectedPeerId : null,
|
||||
spotlights : [],
|
||||
settingsOpen : false,
|
||||
lockDialogOpen : false,
|
||||
joined : false
|
||||
name : '',
|
||||
state : 'new', // new/connecting/connected/disconnected/closed,
|
||||
locked : false,
|
||||
inLobby : false,
|
||||
signInRequired : false,
|
||||
accessCode : '', // access code to the room if locked and joinByAccessCode == true
|
||||
joinByAccessCode : true, // if true: accessCode is a possibility to open the room
|
||||
activeSpeakerId : null,
|
||||
torrentSupport : false,
|
||||
showSettings : false,
|
||||
fullScreenConsumer : null, // ConsumerID
|
||||
windowConsumer : null, // ConsumerID
|
||||
toolbarsVisible : true,
|
||||
mode : 'democratic',
|
||||
selectedPeerId : null,
|
||||
spotlights : [],
|
||||
settingsOpen : false,
|
||||
lockDialogOpen : false,
|
||||
joined : false,
|
||||
muteAllInProgress : false,
|
||||
stopAllVideoInProgress : false,
|
||||
closeMeetingInProgress : false
|
||||
};
|
||||
|
||||
const room = (state = initialState, action) =>
|
||||
@@ -110,7 +113,7 @@ const room = (state = initialState, action) =>
|
||||
|
||||
case 'TOGGLE_JOINED':
|
||||
{
|
||||
const joined = !state.joined;
|
||||
const joined = true;
|
||||
|
||||
return { ...state, joined };
|
||||
}
|
||||
@@ -163,6 +166,15 @@ const room = (state = initialState, action) =>
|
||||
return { ...state, spotlights };
|
||||
}
|
||||
|
||||
case 'MUTE_ALL_IN_PROGRESS':
|
||||
return { ...state, muteAllInProgress: action.payload.flag };
|
||||
|
||||
case 'STOP_ALL_VIDEO_IN_PROGRESS':
|
||||
return { ...state, stopAllVideoInProgress: action.payload.flag };
|
||||
|
||||
case 'CLOSE_MEETING_IN_PROGRESS':
|
||||
return { ...state, closeMeetingInProgress: action.payload.flag };
|
||||
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
export const ADMIN = 'admin';
|
||||
export const MODERATOR = 'moderator';
|
||||
export const AUTHENTICATED = 'authenticated';
|
||||
export const ALL = 'normal';
|
||||
Reference in New Issue
Block a user