Skip to content
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
4cac434
remove roleHint and permissions provider rooms
dmceachernmsft Jul 21, 2023
41d01d7
Change files
dmceachernmsft Jul 21, 2023
d8243ff
Duplicate change files for beta release
dmceachernmsft Jul 21, 2023
5b24e0e
fix build
dmceachernmsft Jul 21, 2023
629c98b
fix beta without role or permissions
dmceachernmsft Jul 25, 2023
8925cd7
fix tests
dmceachernmsft Jul 25, 2023
58a5ee9
Fix cc
dmceachernmsft Jul 25, 2023
dd3897f
Merge branch 'main' into dmceachernmsft/remove-roleHint-permissions
dmceachernmsft Jul 25, 2023
7e9f38c
fix lint
dmceachernmsft Jul 25, 2023
8f0e2f0
fix lint
dmceachernmsft Jul 25, 2023
9bdfb7b
add comment
dmceachernmsft Jul 25, 2023
a0af1f9
fix stable build
dmceachernmsft Jul 25, 2023
5776182
fix beta build
dmceachernmsft Jul 25, 2023
0984806
fix hermetic tests tsc
dmceachernmsft Jul 26, 2023
a72d9ea
fix calling tests
dmceachernmsft Jul 26, 2023
26aba0b
Update @azure-communication-react-4a68d2af-c87d-4503-ae94-1cc2561980f…
dmceachernmsft Jul 26, 2023
205e59a
Update @azure-communication-react-4a68d2af-c87d-4503-ae94-1cc2561980f…
dmceachernmsft Jul 26, 2023
be561d0
remoe test.only
dmceachernmsft Jul 26, 2023
f13a413
Merge branch 'dmceachernmsft/remove-roleHint-permissions' of https://…
dmceachernmsft Jul 26, 2023
eeda8f4
update participant list logic for non rooms
dmceachernmsft Jul 26, 2023
698c270
Merge branch 'main' of https://github.com/Azure/communication-ui-libr…
dmceachernmsft Jul 26, 2023
38651f4
update participant list API to take user role
dmceachernmsft Jul 26, 2023
ee3bebd
fix cc
dmceachernmsft Jul 26, 2023
d64a93f
update stable
dmceachernmsft Jul 26, 2023
53ba133
fix cc around callAdapter options
dmceachernmsft Jul 26, 2023
8210d75
fix component test
dmceachernmsft Jul 26, 2023
1464ecd
Merge branch 'main' into dmceachernmsft/remove-roleHint-permissions
dmceachernmsft Jul 26, 2023
ef82c97
Add capabilities selector to disable camera, microphone and screensha…
mgamis-msft Jul 26, 2023
320b998
Change files
mgamis-msft Jul 26, 2023
43b3965
Duplicate change files for beta release
mgamis-msft Jul 26, 2023
9f0f444
fix tests
dmceachernmsft Jul 27, 2023
f8e4d72
refactor API
dmceachernmsft Jul 27, 2023
3577466
fix cc
dmceachernmsft Jul 27, 2023
2580ec4
remove role from API
dmceachernmsft Jul 28, 2023
50c7da9
update local tile hiding to be done media gallery
dmceachernmsft Jul 28, 2023
23c6ecd
turn off logacy experience
dmceachernmsft Jul 28, 2023
72ba054
Added capabilites to default mock CallAdapter state
mgamis-msft Jul 28, 2023
b15d927
Merge branch 'dmceachernmsft/remove-roleHint-permissions' into mgamis…
mgamis-msft Jul 28, 2023
333e54e
stable build fixes
mgamis-msft Jul 28, 2023
46a3a31
disable button only if capabality property is set and is false
mgamis-msft Jul 28, 2023
cafc6d2
fix stable
dmceachernmsft Jul 28, 2023
cf3c8fc
Merge branch 'main' into dmceachernmsft/remove-roleHint-permissions
dmceachernmsft Jul 28, 2023
b80bb5e
fix calling sample
dmceachernmsft Jul 28, 2023
de0f5b9
Merge branch 'dmceachernmsft/remove-roleHint-permissions' of https://…
dmceachernmsft Jul 28, 2023
22c4224
Fix participant list selectors
dmceachernmsft Jul 28, 2023
2da4f97
Merge branch 'dmceachernmsft/remove-roleHint-permissions' into mgamis…
mgamis-msft Jul 28, 2023
d1f9074
fix cc for stabilization
dmceachernmsft Jul 28, 2023
c48ba84
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Jul 28, 2023
0146903
Merge branch 'dmceachernmsft/remove-roleHint-permissions' into mgamis…
mgamis-msft Jul 28, 2023
60e93a3
fix rooms test
dmceachernmsft Jul 28, 2023
4dec22e
fix hermetic tests
dmceachernmsft Jul 28, 2023
9e257da
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Jul 28, 2023
43d860e
Merge branch 'dmceachernmsft/remove-roleHint-permissions' into mgamis…
mgamis-msft Jul 28, 2023
2c30ab5
Merge branch 'main' into mgamis/capabilities-selector
mgamis-msft Jul 30, 2023
dfa9d64
fix imports
mgamis-msft Jul 31, 2023
c4900e7
typo fix
mgamis-msft Jul 31, 2023
172e950
Merge branch 'main' into mgamis/capabilities-selector
mgamis-msft Aug 1, 2023
e1bd8ce
fix conditional compilation
mgamis-msft Aug 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Add capabilities selector to disable camera, microphone and screenshare buttons when corresponding capability is not present",
"packageName": "@azure/communication-react",
"email": "79475487+mgamis-msft@users.noreply.github.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Add capabilities selector to disable camera, microphone and screenshare buttons when corresponding capability is not present",
"packageName": "@azure/communication-react",
"email": "79475487+mgamis-msft@users.noreply.github.com",
"dependentChangeType": "none"
}
11 changes: 11 additions & 0 deletions packages/calling-component-bindings/src/baseSelectors.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { DominantSpeakersInfo } from '@azure/communication-calling';
/* @conditional-compile-remove(capabilities) */
import { ParticipantCapabilities } from '@azure/communication-calling';
/* @conditional-compile-remove(unsupported-browser) */
import { EnvironmentInfo } from '@azure/communication-calling';
import { ParticipantRole } from '@azure/communication-calling';
Expand Down Expand Up @@ -39,6 +41,15 @@ export const getRole = (state: CallClientState, props: CallingBaseSelectorProps)
return 'Unknown';
};

/* @conditional-compile-remove(capabilities) */
/**
* @private
*/
export const getCapabilites = (
state: CallClientState,
props: CallingBaseSelectorProps
): ParticipantCapabilities | undefined => state.calls[props.callId]?.capabilities?.capabilities;

/**
* @private
*/
Expand Down
36 changes: 20 additions & 16 deletions packages/calling-component-bindings/src/callControlSelectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import {
getIsScreenSharingOn,
getLocalVideoStreams
} from './baseSelectors';
/* @conditional-compile-remove(rooms) */
import { getRole } from './baseSelectors';
/* @conditional-compile-remove(capabilities) */
import { getCapabilites } from './baseSelectors';
/* @conditional-compile-remove(PSTN-calls) */
import { getCallState } from './baseSelectors';
import { _isPreviewOn } from './utils/callUtils';
Expand Down Expand Up @@ -41,11 +41,13 @@ export type MicrophoneButtonSelector = (
* @public
*/
export const microphoneButtonSelector: MicrophoneButtonSelector = reselect.createSelector(
[getCallExists, getIsMuted, getDeviceManager, /* @conditional-compile-remove(rooms) */ getRole],
(callExists, isMuted, deviceManager, /* @conditional-compile-remove(rooms) */ role) => {
[getCallExists, getIsMuted, getDeviceManager, /* @conditional-compile-remove(capabilities) */ getCapabilites],
(callExists, isMuted, deviceManager, /* @conditional-compile-remove(capabilities) */ capabilities) => {
const permission = deviceManager.deviceAccess ? deviceManager.deviceAccess.audio : true;
/* @conditional-compile-remove(capabilities) */
const incapable = capabilities?.muteUnmuteMic.isPresent === false;
return {
disabled: !callExists || !permission || /* @conditional-compile-remove(rooms) */ role === 'Consumer',
disabled: !callExists || !permission || /* @conditional-compile-remove(capabilities) */ incapable,
checked: callExists ? !isMuted : false,
microphones: deviceManager.microphones,
speakers: deviceManager.speakers,
Expand Down Expand Up @@ -76,18 +78,19 @@ export type CameraButtonSelector = (
* @public
*/
export const cameraButtonSelector: CameraButtonSelector = reselect.createSelector(
[getLocalVideoStreams, getDeviceManager, /* @conditional-compile-remove(rooms) */ getRole],
(localVideoStreams, deviceManager, /* @conditional-compile-remove(rooms) */ role) => {
[getLocalVideoStreams, getDeviceManager, /* @conditional-compile-remove(capabilities) */ getCapabilites],
(localVideoStreams, deviceManager, /* @conditional-compile-remove(capabilities) */ capabilities) => {
const previewOn = _isPreviewOn(deviceManager);
const localVideoFromCall = localVideoStreams?.find((stream) => stream.mediaStreamType === 'Video');
const permission = deviceManager.deviceAccess ? deviceManager.deviceAccess.video : true;

/* @conditional-compile-remove(capabilities) */
const incapable = capabilities?.turnVideoOnOff.isPresent === false;
return {
disabled:
!deviceManager.selectedCamera ||
!permission ||
!deviceManager.cameras.length ||
/* @conditional-compile-remove(rooms) */ role === 'Consumer',
/* @conditional-compile-remove(capabilities) */ incapable,
checked: localVideoStreams !== undefined && localVideoStreams.length > 0 ? !!localVideoFromCall : previewOn,
cameras: deviceManager.cameras,
selectedCamera: deviceManager.selectedCamera
Expand Down Expand Up @@ -118,20 +121,21 @@ export const screenShareButtonSelector: ScreenShareButtonSelector = reselect.cre
[
getIsScreenSharingOn,
/* @conditional-compile-remove(PSTN-calls) */ getCallState,
/* @conditional-compile-remove(rooms) */ getRole
/* @conditional-compile-remove(capabilities) */ getCapabilites
],
(
isScreenSharingOn,
/* @conditional-compile-remove(PSTN-calls) */ callState,
/* @conditional-compile-remove(rooms) */ role
/* @conditional-compile-remove(capabilities) */ capabilities
) => {
let disabled: boolean | undefined = undefined;
/* @conditional-compile-remove(capabilities) */
disabled = disabled || capabilities?.shareScreen.isPresent === false;
/* @conditional-compile-remove(PSTN-calls) */
disabled = disabled || ['InLobby', 'Connecting'].includes(callState);
return {
checked: isScreenSharingOn,
/* @conditional-compile-remove(PSTN-calls) */
disabled:
(callState === 'InLobby' ? true : callState === 'Connecting' ?? false) ||
/* @conditional-compile-remove(rooms) */ role === 'Consumer' ||
/* @conditional-compile-remove(rooms) */ role === 'Attendee'
disabled
};
}
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ import type {
} from '../../../common';
/* @conditional-compile-remove(teams-identity-support) */
import type { CallKind, ParticipantRole } from '@azure/communication-calling';
/* @conditional-compile-remove(capabilities) */
import type { ParticipantCapabilities } from '@azure/communication-calling';
/* @conditional-compile-remove(capabilities) */
import { CapabilitiesCallFeature } from '@internal/calling-stateful-client';

const SERVER_URL = 'http://localhost';
const APP_DIR = path.join(__dirname, '../../../app/call');
Expand Down Expand Up @@ -100,7 +104,9 @@ export function defaultMockCallAdapterState(
/* @conditional-compile-remove(call-transfer) */
optimalVideoCount: {
maxRemoteVideoStreams: 4
}
},
/* @conditional-compile-remove(capabilities) */
capabilities: role ? getCapabilitiesFromRole(role) : undefined
},
userId: { kind: 'communicationUser', communicationUserId: '1' },
devices: {
Expand Down Expand Up @@ -283,3 +289,87 @@ export const stubLocalCameraName = async (page: Page): Promise<void> => {
}
});
};

/* @conditional-compile-remove(capabilities) */
const getCapabilitiesFromRole = (role: ParticipantRole): CapabilitiesCallFeature => {
switch (role) {
case 'Attendee':
return {
capabilities: attendeeCapabilitiesInRoomsCall
};
case 'Consumer':
return {
capabilities: consumerCapabilitiesInRoomsCall
};
default:
return {
capabilities: presenterCapabilitiesInRoomsCall
};
}
};

/* @conditional-compile-remove(capabilities) */
const consumerCapabilitiesInRoomsCall: ParticipantCapabilities = {
addAcsUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
addPhoneNumber: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
addTeamsUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
blurBackground: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
hangUpForEveryOne: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
hardMuteParticipants: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
manageLobby: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
muteUnmuteMic: { isPresent: false, reason: 'RoleRestricted' },
pstnDialOut: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
raiseHand: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
removeParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
removeParticipantsSpotlight: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
shareScreen: { isPresent: false, reason: 'RoleRestricted' },
softMuteParticipants: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
spotlightParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
startLiveCaptions: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
stopLiveCaptions: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
turnVideoOnOff: { isPresent: false, reason: 'RoleRestricted' }
};

/* @conditional-compile-remove(capabilities) */
const attendeeCapabilitiesInRoomsCall: ParticipantCapabilities = {
addAcsUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
addPhoneNumber: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
addTeamsUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
blurBackground: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
hangUpForEveryOne: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
hardMuteParticipants: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
manageLobby: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
muteUnmuteMic: { isPresent: true, reason: 'Capable' },
pstnDialOut: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
raiseHand: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
removeParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
removeParticipantsSpotlight: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
shareScreen: { isPresent: false, reason: 'RoleRestricted' },
softMuteParticipants: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
spotlightParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
startLiveCaptions: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
stopLiveCaptions: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
turnVideoOnOff: { isPresent: true, reason: 'Capable' }
};

/* @conditional-compile-remove(capabilities) */
const presenterCapabilitiesInRoomsCall: ParticipantCapabilities = {
addAcsUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
addPhoneNumber: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
addTeamsUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
blurBackground: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
hangUpForEveryOne: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
hardMuteParticipants: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
manageLobby: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
muteUnmuteMic: { isPresent: true, reason: 'Capable' },
pstnDialOut: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
raiseHand: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
removeParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
removeParticipantsSpotlight: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
shareScreen: { isPresent: true, reason: 'Capable' },
softMuteParticipants: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
spotlightParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
startLiveCaptions: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
stopLiveCaptions: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' },
turnVideoOnOff: { isPresent: true, reason: 'Capable' }
};