Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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": "prerelease",
"comment": "turn call readiness alwayson",
"packageName": "@azure/communication-react",
"email": "2684369+JamesBurnside@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "turn call readiness alwayson",
"packageName": "@azure/communication-react",
"email": "2684369+JamesBurnside@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ export type CallCompositeOptions = {
errorBar?: boolean;
callControls?: boolean | CallControlOptions;
devicePermissions?: DevicePermissionRestrictions;
callReadinessOptedIn?: boolean;
onPermissionsTroubleshootingClick?: (permissionsState: {
camera: PermissionState;
microphone: PermissionState;
Expand Down Expand Up @@ -971,7 +970,6 @@ export type CallWithChatCompositeOptions = {
microphone: PermissionState;
}) => void;
onNetworkingTroubleShootingClick?: () => void;
callReadinessOptedIn?: boolean;
};

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,6 @@ export type CallCompositeOptions = {
errorBar?: boolean;
callControls?: boolean | CallControlOptions;
devicePermissions?: DevicePermissionRestrictions;
callReadinessOptedIn?: boolean;
onPermissionsTroubleshootingClick?: (permissionsState: {
camera: PermissionState;
microphone: PermissionState;
Expand Down Expand Up @@ -727,7 +726,6 @@ export type CallWithChatCompositeOptions = {
microphone: PermissionState;
}) => void;
onNetworkingTroubleShootingClick?: () => void;
callReadinessOptedIn?: boolean;
};

// @public
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,4 @@ describe('CallComposite device permission test for call readiness opted in/opted
expect(audioDevicePermissionRequests).toBe(1);
expect(videoDevicePermissionRequests).toBe(1);
});

/* @conditional-compile-remove(call-readiness) */
test('Audio and video device permission should still be requested when callreadiness option opted in', async () => {
mount(<CallComposite adapter={adapter} options={{ callReadinessOptedIn: true }} />);
Comment thread
JamesBurnside marked this conversation as resolved.
expect(audioDevicePermissionRequests).toBe(1);
expect(videoDevicePermissionRequests).toBe(1);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ export type CallCompositeOptions = {
*/
devicePermissions?: DevicePermissionRestrictions;
/* @conditional-compile-remove(call-readiness) */
/**
* Opt in call readiness feature for your call
* Setting this to `true` will add call readiness features to the call experience
*/
callReadinessOptedIn?: boolean;
/* @conditional-compile-remove(call-readiness) */
/**
* Callback you may provide to supply users with further steps to troubleshoot why they have been
* unable to grant your site the required permissions for the call.
Expand Down Expand Up @@ -227,8 +221,6 @@ const MainScreen = (props: MainScreenProps): JSX.Element => {
onPermissionsTroubleshootingClick={props.options?.onPermissionsTroubleshootingClick}
/* @conditional-compile-remove(call-readiness) */
onNetworkingTroubleShootingClick={props.options?.onNetworkingTroubleShootingClick}
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn={props.options?.callReadinessOptedIn}
/>
);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export interface ConfigurationpageCameraDropdownProps {
cameraGrantedDropdown: JSX.Element;
cameraPermissionGranted: boolean;
dropdownProps?: Record<string, never> & Partial<CallingHandlers>;
callReadinessOptedIn?: boolean;
onClickEnableDevicePermission?: () => void;
}

Expand Down Expand Up @@ -53,9 +52,7 @@ export const ConfigurationpageCameraDropdown = (props: ConfigurationpageCameraDr
);

/* @conditional-compile-remove(call-readiness) */
if (props.callReadinessOptedIn) {
return <>{props.cameraPermissionGranted ? props.cameraGrantedDropdown : cameraBlockedDropdown}</>;
}
return props.cameraPermissionGranted ? props.cameraGrantedDropdown : cameraBlockedDropdown;

return props.cameraGrantedDropdown;
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export interface ConfigurationpageErrorBarProps {
camera: PermissionState;
microphone: PermissionState;
};
callReadinessOptedIn?: boolean;
}

/**
Expand All @@ -47,9 +46,7 @@ export const ConfigurationpageErrorBar = (props: ConfigurationpageErrorBarProps)
/* @conditional-compile-remove(call-readiness) */
onNetworkingTroubleShootingClick,
/* @conditional-compile-remove(call-readiness) */
permissionsState,
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn = false
permissionsState
} = props;

/* @conditional-compile-remove(call-readiness) */
Expand All @@ -60,7 +57,7 @@ export const ConfigurationpageErrorBar = (props: ConfigurationpageErrorBarProps)
};

/* @conditional-compile-remove(call-readiness) */
if (showTroubleShootingErrorBar && callReadinessOptedIn) {
if (showTroubleShootingErrorBar) {
return (
<_TroubleshootingGuideErrorBar
troubleshootingGuideStrings={permissionTroubleshootingGuideStrings}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export interface ConfigurationpageMicDropdownProps {
micGrantedDropdown: JSX.Element;
micPermissionGranted: boolean;
dropdownProps?: Record<string, never> & Partial<CallingHandlers>;
callReadinessOptedIn?: boolean;
onClickEnableDevicePermission?: () => void;
}

Expand Down Expand Up @@ -51,8 +50,7 @@ export const ConfigurationpageMicDropdown = (props: ConfigurationpageMicDropdown
);

/* @conditional-compile-remove(call-readiness) */
if (props.callReadinessOptedIn) {
return <> {props.micPermissionGranted ? props.micGrantedDropdown : microphoneBlockedDropdown}</>;
}
return props.micPermissionGranted ? props.micGrantedDropdown : microphoneBlockedDropdown;

return props.micGrantedDropdown;
};
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export interface LocalDeviceSettingsType {
onSelectCamera: (device: VideoDeviceInfo, options?: VideoStreamOptions) => Promise<void>;
onSelectMicrophone: (device: AudioDeviceInfo) => Promise<void>;
onSelectSpeaker: (device: AudioDeviceInfo) => Promise<void>;
callReadinessOptedIn?: boolean;
/* @conditional-compile-remove(call-readiness) */
onClickEnableDevicePermission?: () => void;
}
Expand Down Expand Up @@ -218,8 +217,6 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
/* @conditional-compile-remove(call-readiness) */
dropdownProps={dropdownProps}
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn={props.callReadinessOptedIn ?? false}
/* @conditional-compile-remove(call-readiness) */
onClickEnableDevicePermission={props.onClickEnableDevicePermission}
/>
</Stack>
Expand All @@ -239,8 +236,6 @@ export const LocalDeviceSettings = (props: LocalDeviceSettingsType): JSX.Element
/* @conditional-compile-remove(call-readiness) */
dropdownProps={dropdownProps}
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn={props.callReadinessOptedIn ?? false}
/* @conditional-compile-remove(call-readiness) */
onClickEnableDevicePermission={props.onClickEnableDevicePermission}
/>
<Dropdown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export interface ConfigurationPageProps {
}) => void;
/* @conditional-compile-remove(call-readiness) */
onNetworkingTroubleShootingClick?: () => void;
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn?: boolean;
}

/**
Expand All @@ -71,8 +69,7 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element =>
mobileView,
/* @conditional-compile-remove(call-readiness) */ devicePermissions,
/* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick,
/* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick,
/* @conditional-compile-remove(call-readiness) */ callReadinessOptedIn = false
/* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick
} = props;

const options = useAdaptedSelector(getCallingSelector(DevicesButton));
Expand Down Expand Up @@ -203,48 +200,39 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element =>
/* @conditional-compile-remove(call-readiness) */
onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}
errorBarProps={errorBarProps}
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn={callReadinessOptedIn}
/>
</Stack>
{
/* @conditional-compile-remove(call-readiness) */
// show the following screen if permission API is availible (not unsupported) and videoState, audioState is assigned values
callReadinessOptedIn &&
videoState &&
videoState !== 'unsupported' &&
audioState &&
audioState !== 'unsupported' && (
<CallReadinessModal
mobileView={mobileView}
/* @conditional-compile-remove(unsupported-browser) */
environmentInfo={environmentInfo}
permissionsState={permissionsState}
isPermissionsModalDismissed={isPermissionsModalDismissed}
setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}
onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}
/>
)
videoState && videoState !== 'unsupported' && audioState && audioState !== 'unsupported' && (
<CallReadinessModal
mobileView={mobileView}
/* @conditional-compile-remove(unsupported-browser) */
environmentInfo={environmentInfo}
permissionsState={permissionsState}
isPermissionsModalDismissed={isPermissionsModalDismissed}
setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}
onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}
/>
)
}

{
/* @conditional-compile-remove(call-readiness) */
// show the following screen if permission API is not availible (unsupported) and videoState, audioState is assigned values
callReadinessOptedIn &&
videoState &&
audioState &&
(videoState === 'unsupported' || audioState === 'unsupported') && (
<CallReadinessModalFallBack
mobileView={mobileView}
checkPermissionModalShowing={forceShowingCheckPermissions}
permissionsState={permissionsState}
isPermissionsModalDismissed={isPermissionsModalDismissed}
/* @conditional-compile-remove(unsupported-browser) */
environmentInfo={environmentInfo}
setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}
onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}
/>
)
videoState && audioState && (videoState === 'unsupported' || audioState === 'unsupported') && (
<CallReadinessModalFallBack
mobileView={mobileView}
checkPermissionModalShowing={forceShowingCheckPermissions}
permissionsState={permissionsState}
isPermissionsModalDismissed={isPermissionsModalDismissed}
/* @conditional-compile-remove(unsupported-browser) */
environmentInfo={environmentInfo}
setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}
onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}
/>
)
}

<Stack
Expand Down Expand Up @@ -283,8 +271,6 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element =>
/* @conditional-compile-remove(call-readiness) */ audioState
)}
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn={callReadinessOptedIn}
/* @conditional-compile-remove(call-readiness) */
onClickEnableDevicePermission={() => {
setIsPermissionsModalDismissed(true);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ export type CallWithChatCompositeOptions = {
* if this is not supplied, the composite will not show a 'network troubleshooting' link.
*/
onNetworkingTroubleShootingClick?: () => void;
/* @conditional-compile-remove(call-readiness) */
/**
* Opt in call readiness feature for your call
* setting this to True will add call readiness feature in call experience
*/
callReadinessOptedIn?: boolean;
};

/**
Expand Down Expand Up @@ -212,8 +206,6 @@ type CallWithChatScreenProps = {
rtl?: boolean;
/* @conditional-compile-remove(call-readiness) */
devicePermissions?: DevicePermissionRestrictions;
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn?: boolean;
};

const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
Expand Down Expand Up @@ -378,9 +370,7 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
options={{
callControls: false,
/* @conditional-compile-remove(call-readiness) */
devicePermissions: props.devicePermissions,
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn: props.callReadinessOptedIn
devicePermissions: props.devicePermissions
}}
adapter={callAdapter}
fluentTheme={fluentTheme}
Expand Down Expand Up @@ -491,8 +481,6 @@ export const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.El
{...props}
/* @conditional-compile-remove(call-readiness) */
devicePermissions={options?.devicePermissions}
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn={options?.callReadinessOptedIn}
callWithChatAdapter={adapter}
formFactor={formFactor}
callControls={options?.callControls}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ test.describe('Tests for guidance UI on config page to guide users through enabl
const initialState = defaultMockConfigPageStateDeviceDisabled();
await page.goto(
buildUrlWithMockAdapter(serverUrl, initialState, {
usePermissionTroubleshootingActions: 'true',
customCallCompositeOptions: JSON.stringify({ callReadinessOptedIn: true })
usePermissionTroubleshootingActions: 'true'
})
);
const context = await page.context();
Expand All @@ -32,8 +31,7 @@ test.describe('Tests for guidance UI on config page to guide users through enabl
const initialState = defaultMockConfigPageStateDeviceDisabled();
await page.goto(
buildUrlWithMockAdapter(serverUrl, initialState, {
usePermissionTroubleshootingActions: 'true',
customCallCompositeOptions: JSON.stringify({ callReadinessOptedIn: true })
usePermissionTroubleshootingActions: 'true'
})
);

Expand All @@ -53,8 +51,7 @@ test.describe('Tests for guidance UI on config page to guide users through enabl
const initialState = defaultMockConfigPageStateDeviceDisabled();
await page.goto(
buildUrlWithMockAdapter(serverUrl, initialState, {
usePermissionTroubleshootingActions: 'true',
customCallCompositeOptions: JSON.stringify({ callReadinessOptedIn: true })
usePermissionTroubleshootingActions: 'true'
})
);
const context = await page.context();
Expand All @@ -72,8 +69,7 @@ test.describe('Tests for guidance UI on config page to guide users through enabl
const initialState = defaultMockConfigPageStateDeviceDisabled();
await page.goto(
buildUrlWithMockAdapter(serverUrl, initialState, {
usePermissionTroubleshootingActions: 'true',
customCallCompositeOptions: JSON.stringify({ callReadinessOptedIn: true })
usePermissionTroubleshootingActions: 'true'
})
);
const context = await page.context();
Expand All @@ -93,8 +89,7 @@ test.describe('Tests for guidance UI on config page to guide users through enabl
initialState.call = undefined;
await page.goto(
buildUrlWithMockAdapter(serverUrl, initialState, {
usePermissionTroubleshootingActions: 'true',
customCallCompositeOptions: JSON.stringify({ callReadinessOptedIn: true })
usePermissionTroubleshootingActions: 'true'
})
);
const context = await page.context();
Expand Down
2 changes: 0 additions & 2 deletions samples/CallWithChat/src/app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ const App = (): JSX.Element => {
endpoint={callWithChatArgs.endpointUrl}
/* @conditional-compile-remove(PSTN-calls) */
alternateCallerId={callWithChatArgs.alternateCallerId}
/* @conditional-compile-remove(call-readiness) */
callReadinessOptedIn={true}
/>
);
}
Expand Down
Loading