Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check capability to see if set caption language should be shown for teams meeting #5600

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
7b22b68
check capability
carocao-msft Jan 30, 2025
6c15464
Change files
carocao-msft Jan 30, 2025
1d92a0a
Merge branch 'main' into carocao/capability
carocao-msft Jan 30, 2025
05b0d9a
update
carocao-msft Jan 30, 2025
c3f9d20
Update packages/react-composites CallWithChatComposite browser test s…
github-actions[bot] Jan 30, 2025
47e50f1
Update packages/react-composites CallWithChatComposite browser test s…
github-actions[bot] Jan 30, 2025
9d4cefb
Merge branch 'carocao/capability' of https://github.com/Azure/communi…
github-actions[bot] Jan 30, 2025
8fb9375
update test
carocao-msft Jan 30, 2025
ec6a39e
fix test
carocao-msft Jan 31, 2025
cab2024
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Jan 31, 2025
67f7f40
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Jan 31, 2025
575024a
Merge branch 'carocao/capability' of https://github.com/Azure/communi…
github-actions[bot] Jan 31, 2025
5717f39
update
carocao-msft Jan 31, 2025
910d56b
Update packages/react-composites CallWithChatComposite browser test s…
github-actions[bot] Jan 31, 2025
98c1ed1
Update packages/react-composites CallWithChatComposite browser test s…
github-actions[bot] Jan 31, 2025
2fcf32d
Merge branch 'carocao/capability' of https://github.com/Azure/communi…
github-actions[bot] Jan 31, 2025
52c2d85
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Jan 31, 2025
7d5c694
Merge branch 'carocao/capability' of https://github.com/Azure/communi…
github-actions[bot] Jan 31, 2025
6b92d6c
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Jan 31, 2025
68dcc5e
Merge branch 'carocao/capability' of https://github.com/Azure/communi…
github-actions[bot] Jan 31, 2025
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,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Captions",
"comment": "Check capability to determine if set caption language should be shown for teams meeting",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "Captions",
"comment": "Check capability to determine if set caption language should be shown for teams meeting",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ import {
useRemoteSpotlightCallbacksWithPrompt,
useStopAllSpotlightCallbackWithPrompt
} from '../utils/spotlightUtils';

import { getCaptionsKind, getIsTeamsCall } from '../selectors/baseSelectors';
import { getIsTeamsCall } from '../selectors/baseSelectors';
import { useHandlers } from '../hooks/useHandlers';
import { MoreDrawer } from '../../common/Drawer/MoreDrawer';
/* @conditional-compile-remove(breakout-rooms) */
Expand Down Expand Up @@ -488,11 +487,11 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
);
}

const isTeamsCaptions = useSelector(getCaptionsKind) === 'TeamsCaptions';
const isTeamsMeeting = useSelector(getIsTeamsMeeting);

const isTeamsCall = useSelector(getIsTeamsCall);
const useTeamsCaptions = isTeamsMeeting || isTeamsCall || isTeamsCaptions;
// Teams captions are only available in Teams meetings or Teams calls.
// For Teams Meetings, we need to check if the capability is present.
const useTeamsCaptions = (isTeamsMeeting && capabilities?.setCaptionLanguage?.isPresent) || isTeamsCall;
const hasJoinedCall = useSelector(getCallStatus) === 'Connected';
const isCaptionsOn = useSelector(getCaptionsStatus);
const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,14 @@ test.describe('Teams Closed Captions Banner tests', async () => {
if (isTestProfileMobile(testInfo)) {
test.skip();
}
const initialState = defaultMockCallAdapterState();
const initialState = defaultMockCallAdapterState([], 'Presenter', false);
if (initialState?.call) {
initialState.isTeamsMeeting = true;
initialState.call.captionsFeature = captionsFeatureState;

initialState.call.captionsFeature.captionsKind = 'TeamsCaptions';
if (initialState.call.capabilitiesFeature) {
initialState.call.capabilitiesFeature.capabilities.setCaptionLanguage.isPresent = true;
}
}
await page.goto(buildUrlWithMockAdapter(serverUrl, initialState, { newControlBarExperience: 'true' }));
await pageClick(page, dataUiId('captions-banner-more-button'));
Expand All @@ -121,11 +123,13 @@ test.describe('Captions buttons in call control', () => {
});

test('Captions settings renders normally', async ({ page, serverUrl }, testInfo) => {
const initialState = defaultMockCallAdapterState();
const initialState = defaultMockCallAdapterState([], 'Presenter', false);
if (initialState?.call) {
initialState.isTeamsMeeting = true;
if (initialState.call.capabilitiesFeature) {
initialState.call.capabilitiesFeature.capabilities.setCaptionLanguage.isPresent = true;
}
initialState.call.captionsFeature = captionsFeatureState;

initialState.call.captionsFeature.captionsKind = 'TeamsCaptions';
}
await page.goto(buildUrlWithMockAdapter(serverUrl, initialState, { newControlBarExperience: 'true' }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,18 @@ test.describe('Teams Closed Captions Banner tests', async () => {
if (isTestProfileMobile(testInfo)) {
test.skip();
}
const initialState = defaultMockCallAdapterState([defaultMockRemoteParticipant('Paul Bridges')]);
const initialState = defaultMockCallAdapterState(
[defaultMockRemoteParticipant('Paul Bridges')],
'Presenter',
false
);
if (initialState?.call) {
initialState.isTeamsMeeting = true;
initialState.call.captionsFeature = captionsFeatureState;

initialState.call.captionsFeature.captionsKind = 'TeamsCaptions';
if (initialState.call.capabilitiesFeature) {
initialState.call.capabilitiesFeature.capabilities.setCaptionLanguage.isPresent = true;
}
}
await loadCallPage(page, serverUrl, initialState);
await pageClick(page, dataUiId('captions-banner-more-button'));
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.