Skip to content

Commit 3460998

Browse files
Add missing cc code for media-access and resolve new ts lint requirement for constant file name (#5542)
1 parent d71776a commit 3460998

File tree

10 files changed

+88
-20
lines changed

10 files changed

+88
-20
lines changed

packages/calling-component-bindings/src/utils/videoGalleryUtils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export const _videoGalleryRemoteParticipantsMemo: _VideoGalleryRemoteParticipant
7878
participant.contentSharingStream,
7979
remoteParticipantReaction,
8080
spotlight,
81+
/* @conditional-compile-remove(media-access) */
8182
participant.mediaAccess,
83+
/* @conditional-compile-remove(media-access) */
8284
participant.role,
8385
/* @conditional-compile-remove(remote-ufd) */
8486
Math.max(
@@ -183,6 +185,7 @@ export const convertRemoteParticipantToVideoGalleryRemoteParticipant = (
183185
raisedHand,
184186
reaction,
185187
spotlight,
188+
/* @conditional-compile-remove(media-access) */
186189
mediaAccess,
187190
/* @conditional-compile-remove(media-access) */
188191
canAudioBeForbidden: role === 'Attendee',

packages/chat-stateful-client/src/ChatContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-ch
1616
import { CommunicationIdentifierKind, UnknownIdentifierKind } from '@azure/communication-common';
1717
import { AzureLogger, createClientLogger, getLogLevel } from '@azure/logger';
1818
import { _safeJSONStringify, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';
19-
import { Constants } from './Constants';
19+
import { Constants } from './constants';
2020
import { TypingIndicatorReceivedEvent } from '@azure/communication-chat';
2121
import { chatStatefulLogger } from './Logger';
2222
import type { CommunicationTokenCredential } from '@azure/communication-common';

packages/chat-stateful-client/src/StatefulChatClient.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {
1818
import { ChatParticipant as SignalingChatParticipant } from '@azure/communication-signaling';
1919
import { _createStatefulChatClientWithDeps } from './StatefulChatClient';
2020
import { ChatClientState, ChatError } from './ChatClientState';
21-
import { Constants } from './Constants';
21+
import { Constants } from './constants';
2222
import {
2323
StateChangeListener,
2424
StatefulChatClientWithEventTrigger,

packages/react-components/src/components/ParticipantItem.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ export interface ParticipantItemStrings {
7878
participantItemWithMoreOptionsAriaLabel?: string;
7979
/** String for the attendee role */
8080
attendeeRole: string;
81+
/* @conditional-compile-remove(media-access) */
8182
/** Label for the disabled microphone icon in participant state stack */
83+
/* @conditional-compile-remove(media-access) */
8284
micDisabledIconLabel: string;
8385
/** Label for the disabled camera icon in participant state stack */
8486
cameraDisabledIconLabel: string;

packages/react-components/src/components/ParticipantList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ const onRenderParticipantDefault = (
254254
displayName: displayName ?? '',
255255
connectionState: formatParticipantStateString(callingParticipant, strings) ?? '',
256256
mutedState: (callingParticipant.isMuted ? strings?.mutedIconLabel : undefined) ?? '',
257+
/* @conditional-compile-remove(media-access) */
257258
micDisabledState:
258259
(callingParticipant.mediaAccess?.isAudioPermitted === false ? strings?.micDisabledIconLabel : undefined) ?? '',
260+
/* @conditional-compile-remove(media-access) */
259261
cameraDisabledState:
260262
(callingParticipant.mediaAccess?.isVideoPermitted === false ? strings?.cameraDisabledIconLabel : undefined) ?? '',
261263
sharingState: (callingParticipant.isScreenSharing ? strings?.sharingIconLabel : undefined) ?? '',

packages/react-components/src/components/VideoTile.tsx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ export interface VideoTileStrings {
6565
moreOptionsParticipantHandRaisedAriaLabel: string;
6666
/** String for the announcement of whether the participant is speaking or not */
6767
moreOptionsParticipantIsSpeakingAriaLabel: string;
68+
/* @conditional-compile-remove(media-access) */
6869
/** String for the announcement of whether the participant microphone disabled */
6970
moreOptionsParticipantMicDisabledAriaLabel: string;
71+
/* @conditional-compile-remove(media-access) */
7072
/** String for the announcement of whether the participant camera disabled */
7173
moreOptionsParticipantCameraDisabledAriaLabel: string;
7274
}
@@ -244,7 +246,9 @@ const VideoTileMoreOptionsButton = (props: {
244246
participantIsSpeaking: boolean | undefined;
245247
participantIsMuted: boolean | undefined;
246248
canShowContextMenuButton: boolean;
249+
/* @conditional-compile-remove(media-access) */
247250
isMicDisabled?: boolean;
251+
/* @conditional-compile-remove(media-access) */
248252
isCameraDisabled?: boolean;
249253
}): JSX.Element => {
250254
const locale = useLocale().strings.videoTile;
@@ -258,7 +262,9 @@ const VideoTileMoreOptionsButton = (props: {
258262
participantIsSpeaking,
259263
participantState,
260264
participantIsMuted,
265+
/* @conditional-compile-remove(media-access) */
261266
isMicDisabled,
267+
/* @conditional-compile-remove(media-access) */
262268
isCameraDisabled
263269
} = props;
264270
const [moreButtonAiraDescription, setMoreButtonAriaDescription] = useState<string>('');
@@ -271,9 +277,11 @@ const VideoTileMoreOptionsButton = (props: {
271277
participantHandRaised,
272278
participantState,
273279
participantIsSpeaking,
280+
locale,
281+
/* @conditional-compile-remove(media-access) */
274282
isMicDisabled,
275-
isCameraDisabled,
276-
locale
283+
/* @conditional-compile-remove(media-access) */
284+
isCameraDisabled
277285
)
278286
);
279287
}, [
@@ -283,7 +291,9 @@ const VideoTileMoreOptionsButton = (props: {
283291
participantIsSpeaking,
284292
participantState,
285293
locale,
294+
/* @conditional-compile-remove(media-access) */
286295
isMicDisabled,
296+
/* @conditional-compile-remove(media-access) */
287297
isCameraDisabled
288298
]);
289299

@@ -461,7 +471,13 @@ export const VideoTile = (props: VideoTileProps): JSX.Element => {
461471
mediaAccess
462472
)
463473
: undefined,
464-
[canShowLabel, isMuted, mediaAccess, participantStateString, showMuteIndicator]
474+
[
475+
canShowLabel,
476+
isMuted,
477+
/* @conditional-compile-remove(media-access) */ mediaAccess,
478+
participantStateString,
479+
showMuteIndicator
480+
]
465481
);
466482
const canShowParticipantIcons = participantMediaAccessIcons || isSpotlighted || isPinned;
467483

@@ -558,7 +574,9 @@ export const VideoTile = (props: VideoTileProps): JSX.Element => {
558574
participantState={participantStateString}
559575
participantIsSpeaking={isSpeaking}
560576
canShowContextMenuButton={canShowContextMenuButton}
577+
/* @conditional-compile-remove(media-access) */
561578
isMicDisabled={mediaAccess?.isAudioPermitted === false}
579+
/* @conditional-compile-remove(media-access) */
562580
isCameraDisabled={mediaAccess?.isVideoPermitted === false}
563581
/>
564582
</Stack>

packages/react-components/src/components/utils.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,16 +436,20 @@ export const formatMoreButtonAriaDescription = (
436436
isHandRaised?: boolean,
437437
state?: string,
438438
isSpeaking?: boolean,
439+
strings?: VideoTileStrings,
440+
/* @conditional-compile-remove(media-access) */
439441
isMicDisabled?: boolean,
440-
isCameraDisabled?: boolean,
441-
strings?: VideoTileStrings
442+
/* @conditional-compile-remove(media-access) */
443+
isCameraDisabled?: boolean
442444
): string => {
443445
const mutedState = isMuted
444446
? strings?.moreOptionsParticipantMutedStateMutedAriaLabel
445447
: strings?.moreOptionsParticipantMutedStateUnmutedAriaLabel;
446448
const handRaisedState = isHandRaised ? strings?.moreOptionsParticipantHandRaisedAriaLabel : undefined;
447449
const isSpeakingState = isSpeaking ? strings?.moreOptionsParticipantIsSpeakingAriaLabel : undefined;
450+
/* @conditional-compile-remove(media-access) */
448451
const micDisabledState = isMicDisabled ? strings?.moreOptionsParticipantMicDisabledAriaLabel : undefined;
452+
/* @conditional-compile-remove(media-access) */
449453
const cameraDisabledState = isCameraDisabled ? strings?.moreOptionsParticipantCameraDisabledAriaLabel : undefined;
450454
const description = strings?.moreOptionsButtonAriaLabel
451455
? _formatString(strings?.moreOptionsButtonAriaLabel, {
@@ -454,7 +458,9 @@ export const formatMoreButtonAriaDescription = (
454458
isHandRaised: handRaisedState ?? ' ',
455459
state: state ?? ' ',
456460
isSpeaking: isSpeakingState ?? ' ',
461+
/* @conditional-compile-remove(media-access) */
457462
micDisabledState: micDisabledState ?? ' ',
463+
/* @conditional-compile-remove(media-access) */
458464
cameraDisabledState: cameraDisabledState ?? ' '
459465
})
460466
: '';

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,8 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
362362
const canForbidOthersAudio = !!capabilities?.forbidOthersAudio?.isPresent;
363363
/* @conditional-compile-remove(media-access) */
364364
const canForbidOthersVideo = !!capabilities?.forbidOthersVideo?.isPresent;
365-
/* @conditional-compile-remove(media-access) */
366365
const onToggleParticipantMicPeoplePaneProps = useMemo(() => {
366+
/* @conditional-compile-remove(media-access) */
367367
return {
368368
onForbidAudio: canForbidOthersAudio ? onForbidAudio : undefined,
369369
onPermitAudio: canForbidOthersAudio ? onPermitAudio : undefined,
@@ -375,26 +375,27 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
375375
onPermitOthersVideo: canForbidOthersVideo ? muteAllHandlers.onPermitOthersVideo : undefined,
376376
meetingMediaAccess
377377
};
378+
return {};
378379
}, [
379-
canForbidOthersAudio,
380-
onForbidAudio,
381-
onPermitAudio,
382-
muteAllHandlers.onForbidOthersAudio,
383-
muteAllHandlers.onPermitOthersAudio,
384-
muteAllHandlers.onForbidOthersVideo,
385-
muteAllHandlers.onPermitOthersVideo,
386-
canForbidOthersVideo,
387-
onForbidVideo,
388-
onPermitVideo,
389-
meetingMediaAccess
380+
/* @conditional-compile-remove(media-access) */ canForbidOthersAudio,
381+
/* @conditional-compile-remove(media-access) */ onForbidAudio,
382+
/* @conditional-compile-remove(media-access) */ onPermitAudio,
383+
/* @conditional-compile-remove(media-access) */ muteAllHandlers.onForbidOthersAudio,
384+
/* @conditional-compile-remove(media-access) */ muteAllHandlers.onPermitOthersAudio,
385+
/* @conditional-compile-remove(media-access) */ muteAllHandlers.onForbidOthersVideo,
386+
/* @conditional-compile-remove(media-access) */ muteAllHandlers.onPermitOthersVideo,
387+
/* @conditional-compile-remove(media-access) */ canForbidOthersVideo,
388+
/* @conditional-compile-remove(media-access) */ onForbidVideo,
389+
/* @conditional-compile-remove(media-access) */ onPermitVideo,
390+
/* @conditional-compile-remove(media-access) */ meetingMediaAccess
390391
]);
391392

392393
const { isPeoplePaneOpen, openPeoplePane, closePeoplePane } = usePeoplePane({
393394
...peoplePaneProps,
394395
...spotlightPeoplePaneProps,
395396
...onMuteParticipantPeoplePaneProps,
396397
...pinPeoplePaneProps,
397-
/* @conditional-compile-remove(media-access) */ ...onToggleParticipantMicPeoplePaneProps
398+
...onToggleParticipantMicPeoplePaneProps
398399
});
399400
const togglePeoplePane = useCallback(() => {
400401
if (isPeoplePaneOpen) {

packages/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.tsx

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,13 @@ export const usePeoplePane = (props: {
318318
onStopAllSpotlight,
319319
spotlightedParticipantUserIds,
320320
localeStrings.muteAllMenuLabel,
321+
/* @conditional-compile-remove(media-access) */
321322
localeStrings.forbidOthersAudioMenuLabel,
323+
/* @conditional-compile-remove(media-access) */
322324
localeStrings.permitOthersAudioMenuLabel,
325+
/* @conditional-compile-remove(media-access) */
323326
localeStrings.forbidOthersVideoMenuLabel,
327+
/* @conditional-compile-remove(media-access) */
324328
localeStrings.permitOthersVideoMenuLabel,
325329
localeStrings.stopAllSpotlightMenuLabel
326330
]);
@@ -553,14 +557,22 @@ export const usePeoplePane = (props: {
553557
spotlightedParticipantUserIds,
554558
onMuteParticipant,
555559
remoteParticipants,
560+
/* @conditional-compile-remove(media-access) */
556561
onPermitAudio,
562+
/* @conditional-compile-remove(media-access) */
557563
onForbidAudio,
564+
/* @conditional-compile-remove(media-access) */
558565
onPermitVideo,
566+
/* @conditional-compile-remove(media-access) */
559567
onForbidVideo,
560568
onFetchParticipantMenuItems,
569+
/* @conditional-compile-remove(media-access) */
561570
localeStrings.permitAudioMenuLabel,
571+
/* @conditional-compile-remove(media-access) */
562572
localeStrings.forbidAudioMenuLabel,
573+
/* @conditional-compile-remove(media-access) */
563574
localeStrings.permitVideoMenuLabel,
575+
/* @conditional-compile-remove(media-access) */
564576
localeStrings.forbidVideoMenuLabel,
565577
localeStrings.stopSpotlightOnSelfMenuLabel,
566578
localeStrings.stopSpotlightMenuLabel,
@@ -668,25 +680,45 @@ export const usePeoplePane = (props: {
668680
}, [
669681
muteAllPromptLabels,
670682
showMuteAllPrompt,
683+
/* @conditional-compile-remove(media-access) */
671684
localeStrings.forbidOthersAudioDialogTitle,
685+
/* @conditional-compile-remove(media-access) */
672686
localeStrings.forbidOthersAudioDialogContent,
687+
/* @conditional-compile-remove(media-access) */
673688
localeStrings.forbidOthersAudioConfirmButtonLabel,
689+
/* @conditional-compile-remove(media-access) */
674690
localeStrings.forbidOthersAudioCancelButtonLabel,
691+
/* @conditional-compile-remove(media-access) */
675692
localeStrings.permitOthersAudioDialogTitle,
693+
/* @conditional-compile-remove(media-access) */
676694
localeStrings.permitOthersAudioDialogContent,
695+
/* @conditional-compile-remove(media-access) */
677696
localeStrings.permitOthersAudioConfirmButtonLabel,
697+
/* @conditional-compile-remove(media-access) */
678698
localeStrings.permitOthersAudioCancelButtonLabel,
699+
/* @conditional-compile-remove(media-access) */
679700
localeStrings.forbidOthersVideoDialogTitle,
701+
/* @conditional-compile-remove(media-access) */
680702
localeStrings.forbidOthersVideoDialogContent,
703+
/* @conditional-compile-remove(media-access) */
681704
localeStrings.forbidOthersVideoConfirmButtonLabel,
705+
/* @conditional-compile-remove(media-access) */
682706
localeStrings.forbidOthersVideoCancelButtonLabel,
707+
/* @conditional-compile-remove(media-access) */
683708
localeStrings.permitOthersVideoDialogTitle,
709+
/* @conditional-compile-remove(media-access) */
684710
localeStrings.permitOthersVideoDialogContent,
711+
/* @conditional-compile-remove(media-access) */
685712
localeStrings.permitOthersVideoConfirmButtonLabel,
713+
/* @conditional-compile-remove(media-access) */
686714
localeStrings.permitOthersVideoCancelButtonLabel,
715+
/* @conditional-compile-remove(media-access) */
687716
showForbidOthersAudioPrompt,
717+
/* @conditional-compile-remove(media-access) */
688718
showPermitOthersAudioPrompt,
719+
/* @conditional-compile-remove(media-access) */
689720
showForbidOthersVideoPrompt,
721+
/* @conditional-compile-remove(media-access) */
690722
showPermitOthersVideoPrompt,
691723
inviteLink,
692724
onFetchAvatarPersonaData,
@@ -699,9 +731,13 @@ export const usePeoplePane = (props: {
699731
role,
700732
alternateCallerId,
701733
onMuteAllPromptConfirm,
734+
/* @conditional-compile-remove(media-access) */
702735
onForbidAllAttendeesPromptConfirm,
736+
/* @conditional-compile-remove(media-access) */
703737
onPermitAllAttendeesPromptConfirm,
738+
/* @conditional-compile-remove(media-access) */
704739
onForbidOthersVideoPromptConfirm,
740+
/* @conditional-compile-remove(media-access) */
705741
onPermitOthersVideoPromptConfirm
706742
]);
707743

0 commit comments

Comments
 (0)