Skip to content

Commit fce25f0

Browse files
[Bugfix] Device dropdown behavior updated for no devices (#2575)
* update dropdown behavior for no devices * build stable API files * remove test.only * Change files * Duplicate change files for beta release * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * update strings and revert props spread * build stable API * Build beta API files * add new test for mobile * update changefiles * update for comments * remove test.only * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * change snapshot names * change screenshot names * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * delete redundant screenshots * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 49a7d79 commit fce25f0

21 files changed

Lines changed: 109 additions & 12 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Update Composite dropdown behavior to correctly notify the user that they have no devices.",
4+
"packageName": "@azure/communication-react",
5+
"email": "94866715+dmceachernmsft@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Update Composite dropdown behavior to correctly notify the user that they have no devices.",
4+
"packageName": "@azure/communication-react",
5+
"email": "94866715+dmceachernmsft@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,9 @@ export interface CallCompositeStrings {
551551
mutedMessage: string;
552552
networkReconnectMoreDetails: string;
553553
networkReconnectTitle: string;
554+
noCamerasLabel: string;
555+
noMicrophonesLabel: string;
556+
noSpeakersLabel: string;
554557
openDialpadButtonLabel: string;
555558
openDtmfDialpadLabel: string;
556559
outboundCallingNoticeString: string;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,9 @@ export interface CallCompositeStrings {
424424
mutedMessage: string;
425425
networkReconnectMoreDetails: string;
426426
networkReconnectTitle: string;
427+
noCamerasLabel: string;
428+
noMicrophonesLabel: string;
429+
noSpeakersLabel: string;
427430
participantJoinedNoticeString: string;
428431
participantLeftNoticeString: string;
429432
privacyPolicy: string;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,9 @@ export interface CallCompositeStrings {
400400
mutedMessage: string;
401401
networkReconnectMoreDetails: string;
402402
networkReconnectTitle: string;
403+
noCamerasLabel: string;
404+
noMicrophonesLabel: string;
405+
noSpeakersLabel: string;
403406
openDialpadButtonLabel: string;
404407
openDtmfDialpadLabel: string;
405408
outboundCallingNoticeString: string;

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ export interface CallCompositeStrings {
327327
mutedMessage: string;
328328
networkReconnectMoreDetails: string;
329329
networkReconnectTitle: string;
330+
noCamerasLabel: string;
331+
noMicrophonesLabel: string;
332+
noSpeakersLabel: string;
330333
participantJoinedNoticeString: string;
331334
participantLeftNoticeString: string;
332335
privacyPolicy: string;

packages/react-composites/src/composites/CallComposite/Strings.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,22 @@ export interface CallCompositeStrings {
3333
* Label for camera dropdown.
3434
*/
3535
cameraLabel: string;
36+
/**
37+
* Label for when there are no cameras present on configuration screen.
38+
*/
39+
noCamerasLabel: string;
3640
/**
3741
* Label for sound dropdown.
3842
*/
3943
soundLabel: string;
44+
/**
45+
* Label for when no microphones were found on the configuration screen
46+
*/
47+
noMicrophonesLabel: string;
48+
/**
49+
* Label for when no speakers were found on the configuration screen.
50+
*/
51+
noSpeakersLabel: string;
4052
/**
4153
* Error shown when camera access is blocked by the browser.
4254
*/

packages/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ export const ConfigurationpageCameraDropdown = (props: ConfigurationpageCameraDr
4141
/* @conditional-compile-remove(call-readiness) */
4242
const cameraBlockedDropdown = (
4343
<_DevicePermissionDropdown
44+
{...props.dropdownProps}
4445
styles={dropDownStyles(theme)}
4546
constrain={{ video: true, audio: false }}
4647
strings={devicePermissionDropdownStringsCamera}
4748
icon={
4849
<CallCompositeIcon iconName="ControlButtonCameraOn" style={{ height: '1.25rem', marginRight: '0.625rem' }} />
4950
}
5051
onClick={props.onClickEnableDevicePermission}
51-
{...props.dropdownProps}
5252
/>
5353
);
5454

packages/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export const ConfigurationpageMicDropdown = (props: ConfigurationpageMicDropdown
4141
/* @conditional-compile-remove(call-readiness) */
4242
const microphoneBlockedDropdown = (
4343
<_DevicePermissionDropdown
44+
{...props.dropdownProps}
4445
styles={dropDownStyles(theme)}
4546
constrain={{ video: false, audio: true }}
4647
strings={devicePermissionDropdownStringsMicrophone}
4748
icon={<CallCompositeIcon iconName="ControlButtonMicOn" style={{ height: '1.25rem', marginRight: '0.625rem' }} />}
4849
onClick={props.onClickEnableDevicePermission}
49-
{...props.dropdownProps}
5050
/>
5151
);
5252

packages/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
102102
const defaultPlaceHolder = locale.strings.call.defaultPlaceHolder;
103103
const cameraLabel = locale.strings.call.cameraLabel;
104104
const soundLabel = locale.strings.call.soundLabel;
105+
const noSpeakersLabel = locale.strings.call.noSpeakersLabel;
106+
const noCameraLabel = locale.strings.call.noCamerasLabel;
107+
const noMicLabel = locale.strings.call.noMicrophonesLabel;
105108

106109
const cameraPermissionGranted = props.cameraPermissionGranted;
107110
const micPermissionGranted = props.microphonePermissionGranted;
@@ -131,14 +134,18 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
131134
/* @conditional-compile-remove(call-readiness) */
132135
const dropdownProps = usePropsFor(_DevicePermissionDropdown);
133136

137+
const hasCameras = props.cameras.length > 0;
138+
const hasMicrophones = props.microphones.length > 0;
139+
const hasSpeakers = props.speakers.length > 0;
140+
134141
const cameraGrantedDropdown = (
135142
<Dropdown
136143
data-ui-id="call-composite-local-camera-settings"
137144
aria-labelledby={'call-composite-local-camera-settings-label'}
138-
placeholder={defaultPlaceHolder}
145+
placeholder={hasCameras ? defaultPlaceHolder : noCameraLabel}
139146
options={cameraPermissionGranted ? getDropDownList(props.cameras) : [{ key: 'deniedOrUnknown', text: '' }]}
140147
styles={dropDownStyles(theme)}
141-
disabled={!cameraPermissionGranted}
148+
disabled={!cameraPermissionGranted || !hasCameras}
142149
errorMessage={
143150
props.cameraPermissionGranted === undefined || props.cameraPermissionGranted
144151
? undefined
@@ -165,9 +172,9 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
165172
{roleCanUseMic && (
166173
<Dropdown
167174
aria-labelledby={'call-composite-local-sound-settings-label'}
168-
placeholder={defaultPlaceHolder}
175+
placeholder={hasMicrophones ? defaultPlaceHolder : noMicLabel}
169176
styles={dropDownStyles(theme)}
170-
disabled={!micPermissionGranted}
177+
disabled={!micPermissionGranted || !hasMicrophones}
171178
errorMessage={
172179
props.microphonePermissionGranted === undefined || props.microphonePermissionGranted
173180
? undefined
@@ -238,7 +245,7 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
238245
/>
239246
<Dropdown
240247
aria-labelledby={'call-composite-local-sound-settings-label'}
241-
placeholder={defaultPlaceHolder}
248+
placeholder={hasSpeakers ? defaultPlaceHolder : noSpeakersLabel}
242249
styles={dropDownStyles(theme)}
243250
disabled={props.speakers.length === 0}
244251
options={getDropDownList(props.speakers)}

0 commit comments

Comments
 (0)