Skip to content

Commit

Permalink
Resolve all comments in azure review (#998)
Browse files Browse the repository at this point in the history
* Resovle all comments from dom in azure review
https://apiview.dev/Assemblies/Review/42fe51ace1e24184a42351ff89044352

* Update packages/react-components/src/components/MessageThread.tsx

Co-authored-by: Nan Jiang <[email protected]>
Co-authored-by: James Burnside <[email protected]>
  • Loading branch information
3 people authored Nov 2, 2021
1 parent 16fe225 commit 6708f87
Show file tree
Hide file tree
Showing 57 changed files with 167 additions and 116 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Update according to azure review",
"packageName": "@internal/calling-component-bindings",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Update according to azure review",
"packageName": "@internal/calling-stateful-client",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Update according to azure review",
"packageName": "@internal/chat-component-bindings",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Update according to azure review",
"packageName": "@internal/react-components",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Update according to azure review",
"packageName": "@internal/react-composites",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Update according to azure review",
"packageName": "@internal/storybook",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export type CallingHandlers = {
onHangUp: () => Promise<void>;
onCreateLocalStreamView: (options?: VideoStreamOptions) => Promise<void>;
onCreateRemoteStreamView: (userId: string, options?: VideoStreamOptions) => Promise<void>;
onParticipantRemove: (userId: string) => Promise<void>;
onRemoveParticipant: (userId: string) => Promise<void>;
onDisposeRemoteStreamView: (userId: string) => Promise<void>;
onDisposeLocalStreamView: () => Promise<void>;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export type CallingHandlers = {
onHangUp: () => Promise<void>;
onCreateLocalStreamView: (options?: VideoStreamOptions) => Promise<void>;
onCreateRemoteStreamView: (userId: string, options?: VideoStreamOptions) => Promise<void>;
onParticipantRemove: (userId: string) => Promise<void>;
onRemoveParticipant: (userId: string) => Promise<void>;
onDisposeRemoteStreamView: (userId: string) => Promise<void>;
onDisposeLocalStreamView: () => Promise<void>;
};
Expand Down Expand Up @@ -284,7 +284,7 @@ export const createDefaultCallingHandlers = memoizeOne(
await disposeAllLocalPreviewViews(callClient);
};

const onParticipantRemove = async (userId: string): Promise<void> => {
const onRemoveParticipant = async (userId: string): Promise<void> => {
await call?.removeParticipant(fromFlatCommunicationIdentifier(userId));
};

Expand All @@ -301,7 +301,7 @@ export const createDefaultCallingHandlers = memoizeOne(
onToggleScreenShare,
onCreateLocalStreamView,
onCreateRemoteStreamView,
onParticipantRemove,
onRemoveParticipant,
onStartLocalVideo,
onDisposeRemoteStreamView,
onDisposeLocalStreamView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export interface DiagnosticsCallFeatureState {
export interface IncomingCallState {
callEndReason?: CallEndReason;
callerInfo: CallerInfo;
endTime: Date | undefined;
endTime?: Date;
id: string;
startTime: Date;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/calling-stateful-client/src/CallClientState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export interface IncomingCallState {
* Stores the local date when the call ended on the client. This property is added by the stateful layer and is not a
* proxy of SDK state. It is undefined if the call is not ended yet.
*/
endTime: Date | undefined;
endTime?: Date;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export type ChatHandlers = {
onSendMessage: (content: string) => Promise<void>;
onMessageSeen: (chatMessageId: string) => Promise<void>;
onTyping: () => Promise<void>;
onParticipantRemove: (userId: string) => Promise<void>;
onRemoveParticipant: (userId: string) => Promise<void>;
updateThreadTopicName: (topicName: string) => Promise<void>;
onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;
onUpdateMessage: (messageId: string, content: string) => Promise<void>;
Expand Down
4 changes: 2 additions & 2 deletions packages/chat-component-bindings/src/errorBarSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export const errorBarSelector: ErrorBarSelector = createSelector(
if (error !== undefined) {
if (sendMessageError !== undefined) {
activeErrorMessages.push({
type: 'sendMessageNotInThisThread',
type: 'sendMessageNotInChatThread',
// Set the latest timestamp of all the errors that translated to an active error.
timestamp:
sendMessageError.timestamp > (error.timestamp ?? 0) ? sendMessageError.timestamp : error.timestamp
Expand Down Expand Up @@ -106,7 +106,7 @@ const latestAccessDeniedError = (latestErrors: ChatErrors): ActiveErrorMessage |
};

const latestNotInThisThreadError = (latestErrors: ChatErrors): ActiveErrorMessage | undefined => {
return latestActiveErrorSatisfying(latestErrors, 'userNotInThisThread', (error: ChatError): boolean => {
return latestActiveErrorSatisfying(latestErrors, 'userNotInChatThread', (error: ChatError): boolean => {
if (!error || !error.innerError) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export type ChatHandlers = {
onSendMessage: (content: string) => Promise<void>;
onMessageSeen: (chatMessageId: string) => Promise<void>;
onTyping: () => Promise<void>;
onParticipantRemove: (userId: string) => Promise<void>;
onRemoveParticipant: (userId: string) => Promise<void>;
updateThreadTopicName: (topicName: string) => Promise<void>;
onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;
onUpdateMessage: (messageId: string, content: string) => Promise<void>;
Expand Down Expand Up @@ -61,7 +61,7 @@ export const createDefaultChatHandlers = memoizeOne(
onTyping: async () => {
await chatThreadClient.sendTypingNotification();
},
onParticipantRemove: async (userId: string) => {
onRemoveParticipant: async (userId: string) => {
await chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));
},
updateThreadTopicName: async (topicName: string) => {
Expand Down
26 changes: 13 additions & 13 deletions packages/communication-react/review/communication-react.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export type AzureCommunicationCallAdapterArgs = {

// @public
export type AzureCommunicationChatAdapterArgs = {
endpointUrl: string;
endpoint: string;
userId: CommunicationUserIdentifier;
displayName: string;
credential: CommunicationTokenCredential;
Expand All @@ -135,7 +135,7 @@ export type AzureCommunicationChatAdapterArgs = {

// @alpha
export type AzureCommunicationMeetingAdapterArgs = {
endpointUrl: string;
endpoint: string;
userId: CommunicationUserIdentifier;
displayName: string;
credential: CommunicationTokenCredential;
Expand Down Expand Up @@ -409,7 +409,7 @@ export type CallingHandlers = {
onHangUp: () => Promise<void>;
onCreateLocalStreamView: (options?: VideoStreamOptions) => Promise<void>;
onCreateRemoteStreamView: (userId: string, options?: VideoStreamOptions) => Promise<void>;
onParticipantRemove: (userId: string) => Promise<void>;
onRemoveParticipant: (userId: string) => Promise<void>;
onDisposeRemoteStreamView: (userId: string) => Promise<void>;
onDisposeLocalStreamView: () => Promise<void>;
};
Expand Down Expand Up @@ -624,7 +624,7 @@ export type ChatHandlers = {
onSendMessage: (content: string) => Promise<void>;
onMessageSeen: (chatMessageId: string) => Promise<void>;
onTyping: () => Promise<void>;
onParticipantRemove: (userId: string) => Promise<void>;
onRemoveParticipant: (userId: string) => Promise<void>;
updateThreadTopicName: (topicName: string) => Promise<void>;
onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;
onUpdateMessage: (messageId: string, content: string) => Promise<void>;
Expand Down Expand Up @@ -906,13 +906,13 @@ export const createAzureCommunicationCallAdapter: ({ userId, displayName, creden
export const createAzureCommunicationCallAdapterFromClient: (callClient: StatefulCallClient, callAgent: CallAgent, locator: TeamsMeetingLinkLocator | GroupCallLocator) => Promise<CallAdapter>;

// @public
export const createAzureCommunicationChatAdapter: ({ endpointUrl, userId, displayName, credential, threadId }: AzureCommunicationChatAdapterArgs) => Promise<ChatAdapter>;
export const createAzureCommunicationChatAdapter: ({ endpoint: endpointUrl, userId, displayName, credential, threadId }: AzureCommunicationChatAdapterArgs) => Promise<ChatAdapter>;

// @public
export const createAzureCommunicationChatAdapterFromClient: (chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient) => Promise<ChatAdapter>;

// @alpha
export const createAzureCommunicationMeetingAdapter: ({ userId, displayName, credential, endpointUrl, chatThreadId, callLocator }: AzureCommunicationMeetingAdapterArgs) => Promise<MeetingAdapter>;
export const createAzureCommunicationMeetingAdapter: ({ userId, displayName, credential, endpoint, chatThreadId, callLocator }: AzureCommunicationMeetingAdapterArgs) => Promise<MeetingAdapter>;

// @public
export const createDefaultCallingHandlers: (callClient: StatefulCallClient, callAgent: CallAgent | undefined, deviceManager: StatefulDeviceManager | undefined, call: Call | undefined) => CallingHandlers;
Expand Down Expand Up @@ -1113,14 +1113,14 @@ export interface ErrorBarStrings {
callNoSpeakerFound: string;
muteGeneric: string;
sendMessageGeneric: string;
sendMessageNotInThisThread: string;
sendMessageNotInChatThread: string;
startScreenShareGeneric: string;
startVideoGeneric: string;
stopScreenShareGeneric: string;
stopVideoGeneric: string;
unableToReachChatService: string;
unmuteGeneric: string;
userNotInThisThread: string;
userNotInChatThread: string;
}

// @public
Expand Down Expand Up @@ -1191,7 +1191,7 @@ export interface _Identifiers {
export interface IncomingCallState {
callEndReason?: CallEndReason;
callerInfo: CallerInfo;
endTime: Date | undefined;
endTime?: Date;
id: string;
startTime: Date;
}
Expand Down Expand Up @@ -1403,7 +1403,7 @@ export type MessageProps = {
strings: MessageThreadStrings;
messageContainerStyle?: ComponentSlotStyle;
showDate?: boolean;
editDisabled?: boolean;
disableEditing?: boolean;
onUpdateMessage?: (messageId: string, content: string) => Promise<void>;
onDeleteMessage?: (messageId: string) => Promise<void>;
};
Expand Down Expand Up @@ -1466,7 +1466,7 @@ export type MessageThreadProps = {
onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;
onUpdateMessage?: (messageId: string, content: string) => Promise<void>;
onDeleteMessage?: (messageId: string) => Promise<void>;
editDisabled?: boolean;
disableEditing?: boolean;
strings?: Partial<MessageThreadStrings>;
};

Expand Down Expand Up @@ -1660,7 +1660,7 @@ export type ParticipantListProps = {
excludeMe?: boolean;
onRenderParticipant?: (participant: CommunicationParticipant) => JSX.Element | null;
onRenderAvatar?: OnRenderAvatarCallback;
onParticipantRemove?: (userId: string) => void;
onRemoveParticipant?: (userId: string) => void;
onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;
styles?: ParticipantListStyles;
};
Expand Down Expand Up @@ -1709,7 +1709,7 @@ export interface ParticipantsButtonProps extends ControlBarButtonProps {
myUserId?: string;
onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;
onMuteAll?: () => void;
onParticipantRemove?: (userId: string) => void;
onRemoveParticipant?: (userId: string) => void;
onRenderAvatar?: OnRenderAvatarCallback;
onRenderParticipant?: (participant: CommunicationParticipant) => JSX.Element | null;
onRenderParticipantList?: (props: ParticipantListProps) => JSX.Element | null;
Expand Down
12 changes: 6 additions & 6 deletions packages/react-components/review/react-components.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,14 +317,14 @@ export interface ErrorBarStrings {
callNoSpeakerFound: string;
muteGeneric: string;
sendMessageGeneric: string;
sendMessageNotInThisThread: string;
sendMessageNotInChatThread: string;
startScreenShareGeneric: string;
startVideoGeneric: string;
stopScreenShareGeneric: string;
stopVideoGeneric: string;
unableToReachChatService: string;
unmuteGeneric: string;
userNotInThisThread: string;
userNotInChatThread: string;
}

// @public
Expand Down Expand Up @@ -425,7 +425,7 @@ export type MessageProps = {
strings: MessageThreadStrings;
messageContainerStyle?: ComponentSlotStyle;
showDate?: boolean;
editDisabled?: boolean;
disableEditing?: boolean;
onUpdateMessage?: (messageId: string, content: string) => Promise<void>;
onDeleteMessage?: (messageId: string) => Promise<void>;
};
Expand Down Expand Up @@ -471,7 +471,7 @@ export type MessageThreadProps = {
onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;
onUpdateMessage?: (messageId: string, content: string) => Promise<void>;
onDeleteMessage?: (messageId: string) => Promise<void>;
editDisabled?: boolean;
disableEditing?: boolean;
strings?: Partial<MessageThreadStrings>;
};

Expand Down Expand Up @@ -631,7 +631,7 @@ export type ParticipantListProps = {
excludeMe?: boolean;
onRenderParticipant?: (participant: CommunicationParticipant) => JSX.Element | null;
onRenderAvatar?: OnRenderAvatarCallback;
onParticipantRemove?: (userId: string) => void;
onRemoveParticipant?: (userId: string) => void;
onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;
styles?: ParticipantListStyles;
};
Expand Down Expand Up @@ -668,7 +668,7 @@ export interface ParticipantsButtonProps extends ControlBarButtonProps {
myUserId?: string;
onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;
onMuteAll?: () => void;
onParticipantRemove?: (userId: string) => void;
onRemoveParticipant?: (userId: string) => void;
onRenderAvatar?: OnRenderAvatarCallback;
onRenderParticipant?: (participant: CommunicationParticipant) => JSX.Element | null;
onRenderParticipantList?: (props: ParticipantListProps) => JSX.Element | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type ChatMessageProps = {
message: ChatMessage;
messageContainerStyle?: ComponentSlotStyle;
showDate?: boolean;
editDisabled?: boolean;
disableEditing?: boolean;
onUpdateMessage?: (messageId: string, content: string) => Promise<void>;
onDeleteMessage?: (messageId: string) => Promise<void>;
strings: MessageThreadStrings;
Expand Down Expand Up @@ -95,7 +95,7 @@ export const ChatMessageComponent = (props: ChatMessageProps): JSX.Element => {
const ids = useIdentifiers();
const theme = useTheme();

const { message, onUpdateMessage, onDeleteMessage, editDisabled, showDate, messageContainerStyle, strings } = props;
const { message, onUpdateMessage, onDeleteMessage, disableEditing, showDate, messageContainerStyle, strings } = props;
const [isEditing, setIsEditing] = useState(false);

const menuClass = mergeStyles(chatActionsCSS, {
Expand Down Expand Up @@ -170,7 +170,7 @@ export const ChatMessageComponent = (props: ChatMessageProps): JSX.Element => {
message.editedOn ? <div className={chatMessageEditedTagStyle(theme)}>{strings.editedTag}</div> : undefined
}
positionActionMenu={false}
actionMenu={!editDisabled && message.status !== 'sending' && message.mine ? actionMenu : undefined}
actionMenu={!disableEditing && message.status !== 'sending' && message.mine ? actionMenu : undefined}
/>
);
};
Expand Down
8 changes: 4 additions & 4 deletions packages/react-components/src/components/ErrorBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ export interface ErrorBarStrings {
/**
* User is no longer on the thread.
*
* See also: {@link ErrorBarStrings.sendMessageNotInThisThread} for a more specific error.
* See also: {@link ErrorBarStrings.sendMessageNotInChatThread} for a more specific error.
*/
userNotInThisThread: string;
userNotInChatThread: string;

/**
* Sending message failed because user is no longer on the thread.
*/
sendMessageNotInThisThread: string;
sendMessageNotInChatThread: string;

/**
* A generic message when sending message fails.
Expand Down Expand Up @@ -180,7 +180,7 @@ export interface ActiveErrorMessage {
*
* This component internally tracks dismissed by the user.
* * Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.
* * Errors that do not have a timestamp: The error is dismissed until it dissappears from the props.
* * Errors that do not have a timestamp: The error is dismissed until it disappears from the props.
* If the error recurs, it is shown in the UI.
*
* Uses {@link @fluentui/react#MessageBar} UI element.
Expand Down
Loading

0 comments on commit 6708f87

Please sign in to comment.