-
Notifications
You must be signed in to change notification settings - Fork 1
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
Person Icons, Emojis, Images, Group Title +N #3
Conversation
} | ||
|
||
return removeHtmlPTags(previewString); | ||
// removes <p> tags from the string | ||
previewString = removeHtmlPTags(previewString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't address <span />
or <div />
tags or any number of other HTML that could appear. Maybe consider: https://www.npmjs.com/package/html-to-text. You may still want to keep the "Sent an image." path and the emoji path.
// handle images | ||
const graphImageUrlRegex = /<img[^>]+?src=["']https:\/\/graph\.microsoft\.com\/[^"'>]+?["']/; | ||
|
||
const imageMatch = content.match(graphImageUrlRegex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This crashes with an error if content is null | undefined
. You can probably just shortcut out of this method if there is no preview.
// define the JSX for FluentUI Icons + Styling | ||
const oneOnOneProfilePicture = <ChatListItemIcon chatType="oneOnOne" />; | ||
const GroupProfilePicture = <ChatListItemIcon chatType="group" />; | ||
|
||
const other = chatObj.members?.find(m => (m as AadUserConversationMember).userId !== myId); | ||
const otherAad = other as AadUserConversationMember; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably want to have a bot icon for bots which are applications, not conversation members. Or at a minimum they should use the default icon and not the user's icon.
Because the chat component comes from ACS, it doesn't actually send info about the bot, so that control just uses the default icon.
} | ||
|
||
return removeHtmlPTags(previewString); | ||
// removes <p> tags from the string | ||
previewString = removeHtmlPTags(previewString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this should happen on content not necessarily previewString and be moved up above the "handle general chats" section.
} else if (previewMessage?.from?.application?.displayName) { | ||
previewString = previewMessage?.from?.application?.displayName + ': ' + previewMessage?.body?.content; | ||
previewString = previewMessage?.from?.application?.displayName + ': ' + content; | ||
} | ||
|
||
// handle all events | ||
if (previewMessage?.eventDetail) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this doing anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 234 handles the preview message being from a bot, Line 238 handles events like "Member Added"
Your demo was great. I think there was one issue with a drag-and-drop image. If you fix that, then I will approve. Thanks, Peter. |
…raph-toolkit into andrewDoing/person-icon
…raph-toolkit into andrewDoing/person-icon
|
Closes 307, 360, 370
PR Type
Description of the changes
PR checklist
yarn build
) and changes have been tested in at least two supported browsers (Edge + non-Chromium based browser)yarn setLicense
)Other information