Skip to content

Commit

Permalink
Upgrade Calling SDK version to 1.0.1-beta.1 (#145)
Browse files Browse the repository at this point in the history
* Calling SDK upgrade for communication-ui and acs-calling-declarative

* Fix failing test

* Upgrade Calling SDK version for Calling Sample

* Upgrade Calling SDK version for OneToOne Sample

* Refactor Calling Sample to support new CallAgent usage

* Fix OneToOne Call popup not closing issue

* Missed files in last commit

* Fix version issue in storybook

* Change files

* Fix storybook snapshot

* Fix issue with OneToOne displayName not working in video call

* Fix failing tests

* Fix storybook snapshot

* updating snapshot

* Regenerate snapshot

Co-authored-by: Anjul Garg <anjulgarg@live.com>
  • Loading branch information
allenplusplus and anjulgarg authored Apr 16, 2021
1 parent bc6af1c commit 068ccc7
Show file tree
Hide file tree
Showing 71 changed files with 843 additions and 617 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Upgrade to Calling SDK version 1.0.1-beta.1",
"packageName": "@azure/acs-calling-declarative",
"email": "allenhwang@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Upgrade to Calling SDK version 1.0.1-beta.1",
"packageName": "@azure/communication-ui",
"email": "allenhwang@microsoft.com",
"dependentChangeType": "patch"
}
54 changes: 27 additions & 27 deletions common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/acs-calling-declarative/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
]
},
"dependencies": {
"@azure/communication-common": "1.0.0-beta.4",
"@azure/communication-calling": "1.0.0-beta.9",
"@azure/communication-common": "1.0.0",
"@azure/communication-calling": "1.0.1-beta.1",
"events": "~3.3.0",
"immer": "~8.0.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { CallClient } from '@azure/communication-calling';
import { CallDirection } from '@azure/communication-calling';
import { CallEndReason } from '@azure/communication-calling';
import { CallerInfo } from '@azure/communication-calling';
import { CallingApplicationKind } from '@azure/communication-common';
import { CallState } from '@azure/communication-calling';
import { CommunicationUserKind } from '@azure/communication-common';
import { DeviceAccess } from '@azure/communication-calling';
Expand All @@ -27,7 +26,7 @@ export interface Call {
direction: CallDirection;
endTime: Date | undefined;
id: string;
isMicrophoneMuted: boolean;
isMuted: boolean;
isScreenSharingOn: boolean;
localVideoStreams: ReadonlyArray<LocalVideoStream>;
remoteParticipants: Map<string, RemoteParticipant>;
Expand Down Expand Up @@ -84,7 +83,7 @@ export interface LocalVideoStream {
export interface RemoteParticipant {
callEndReason?: CallEndReason;
displayName?: string;
identifier: CommunicationUserKind | PhoneNumberKind | CallingApplicationKind | MicrosoftTeamsUserKind | UnknownIdentifierKind;
identifier: CommunicationUserKind | PhoneNumberKind | MicrosoftTeamsUserKind | UnknownIdentifierKind;
isMuted: boolean;
isSpeaking: boolean;
state: RemoteParticipantState;
Expand Down
16 changes: 4 additions & 12 deletions packages/acs-calling-declarative/src/CallAgentDeclarative.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ import {
Call,
CallAgent,
CollectionUpdatedEvent,
GroupChatCallLocator,
GroupLocator,
IncomingCallEvent,
JoinCallOptions,
MeetingLocator,
StartCallOptions
} from '@azure/communication-calling';
import {
CommunicationUserIdentifier,
PhoneNumberIdentifier,
CallingApplicationIdentifier,
UnknownIdentifier
} from '@azure/communication-common';
import { CommunicationUserIdentifier, PhoneNumberIdentifier, UnknownIdentifier } from '@azure/communication-common';
import EventEmitter from 'events';
import { callAgentDeclaratify } from './CallAgentDeclarative';
import { CallContext, MAX_CALL_HISTORY_LENGTH } from './CallContext';
Expand Down Expand Up @@ -42,12 +38,7 @@ class MockCallAgent implements CallAgent {

startCall(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
participants: (
| CommunicationUserIdentifier
| PhoneNumberIdentifier
| CallingApplicationIdentifier
| UnknownIdentifier
)[],
participants: (CommunicationUserIdentifier | PhoneNumberIdentifier | UnknownIdentifier)[],
// eslint-disable-next-line @typescript-eslint/no-unused-vars
options?: StartCallOptions
): Call {
Expand All @@ -57,6 +48,7 @@ class MockCallAgent implements CallAgent {
return call;
}
join(groupLocator: GroupLocator, options?: JoinCallOptions): Call;
join(groupChatCallLocator: GroupChatCallLocator, options?: JoinCallOptions): Call;
join(meetingLocator: MeetingLocator, options?: JoinCallOptions): Call;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
join(meetingLocator: any, options?: any): Call {
Expand Down
12 changes: 3 additions & 9 deletions packages/acs-calling-declarative/src/CallClientState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
VideoDeviceInfo
} from '@azure/communication-calling';
import {
CallingApplicationKind,
CommunicationUserKind,
MicrosoftTeamsUserKind,
PhoneNumberKind,
Expand Down Expand Up @@ -58,12 +57,7 @@ export interface RemoteParticipant {
/**
* Proxy of {@Link @azure/communication-calling#RemoteParticipant.identifier}.
*/
identifier:
| CommunicationUserKind
| PhoneNumberKind
| CallingApplicationKind
| MicrosoftTeamsUserKind
| UnknownIdentifierKind;
identifier: CommunicationUserKind | PhoneNumberKind | MicrosoftTeamsUserKind | UnknownIdentifierKind;
/**
* Proxy of {@Link @azure/communication-calling#RemoteParticipant.displayName}.
*/
Expand Down Expand Up @@ -115,9 +109,9 @@ export interface Call {
*/
direction: CallDirection;
/**
* Proxy of {@Link @azure/communication-calling#Call.isMicrophoneMuted}.
* Proxy of {@Link @azure/communication-calling#Call.isMuted}.
*/
isMicrophoneMuted: boolean;
isMuted: boolean;
/**
* Proxy of {@Link @azure/communication-calling#Call.isScreenSharingOn}.
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/acs-calling-declarative/src/CallContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class CallContext {
existingCall.state = call.state;
existingCall.callEndReason = call.callEndReason;
existingCall.direction = call.direction;
existingCall.isMicrophoneMuted = call.isMicrophoneMuted;
existingCall.isMuted = call.isMuted;
existingCall.isScreenSharingOn = call.isScreenSharingOn;
existingCall.localVideoStreams = call.localVideoStreams;
existingCall.remoteParticipants = call.remoteParticipants;
Expand Down Expand Up @@ -196,7 +196,7 @@ export class CallContext {
produce(this._state, (draft: CallClientState) => {
const call = draft.calls.get(callId);
if (call) {
call.isMicrophoneMuted = isMicrophoneMuted;
call.isMuted = isMicrophoneMuted;
}
})
);
Expand Down
11 changes: 5 additions & 6 deletions packages/acs-calling-declarative/src/CallDeclarative.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ describe('declarative call', () => {
mockCall.callerInfo = { identifier: { kind: 'communicationUser' } } as CallerInfo;
mockCall.state = 'None';
mockCall.direction = 'Incoming';
mockCall.isMicrophoneMuted = false;
mockCall.isMuted = false;
mockCall.isScreenSharingOn = false;
mockCall.localVideoStreams = [];
mockCall.remoteParticipants = [];
mockCall.isMicrophoneMuted = false;
mockCall.mute = () => {
return Promise.resolve();
};
Expand All @@ -33,14 +32,14 @@ describe('declarative call', () => {

const declarativeCall = callDeclaratify(mockCall, context);

mockCall.isMicrophoneMuted = true;
mockCall.isMuted = true;
await declarativeCall.mute();

expect(context.getState().calls.get(mockCallId)?.isMicrophoneMuted).toBe(true);
expect(context.getState().calls.get(mockCallId)?.isMuted).toBe(true);

mockCall.isMicrophoneMuted = false;
mockCall.isMuted = false;
await declarativeCall.unmute();

expect(context.getState().calls.get(mockCallId)?.isMicrophoneMuted).toBe(false);
expect(context.getState().calls.get(mockCallId)?.isMuted).toBe(false);
});
});
4 changes: 2 additions & 2 deletions packages/acs-calling-declarative/src/CallDeclarative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ class ProxyCall implements ProxyHandler<Call> {
case 'mute': {
return (): Promise<void> => {
return target.mute().then(() => {
this._context.setCallIsMicrophoneMuted(this._call.id, this._call.isMicrophoneMuted);
this._context.setCallIsMicrophoneMuted(this._call.id, this._call.isMuted);
});
};
}
case 'unmute': {
return (): Promise<void> => {
return target.unmute().then(() => {
this._context.setCallIsMicrophoneMuted(this._call.id, this._call.isMicrophoneMuted);
this._context.setCallIsMicrophoneMuted(this._call.id, this._call.isMuted);
});
};
}
Expand Down
Loading

0 comments on commit 068ccc7

Please sign in to comment.