-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add notification and toast #2883
Conversation
@compulim if this PR is including changes to typing indicator and suggested actions, please include the issues linked in the following comment: #2871 (comment) |
5efde46
to
d375cb7
Compare
@@ -212,6 +219,20 @@ const Composer = ({ | |||
}; | |||
}, [dispatch, directLine, userID, username]); | |||
|
|||
const internalMarkdownIt = useMemo(() => new MarkdownIt(), []); | |||
|
|||
const internalRenderMarkdownInline = useMemo( |
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.
Do we need to sanitize the resulting HTML? Also do we want the internalMarkdownIt
to respect the carriage return style option?
Co-Authored-By: TJ Durnford <tjdford@gmail.com>
d7913fe
to
4674793
Compare
Changelog Entry
Added
styleOptions.slowConnectionAfter
(in milliseconds)Samples
Description
This is feature work for adding a notification bar to Web Chat.
To add/set/replace a notification entry, use the following code.
Design
Markdown support
All notifications message can be enriched by using Markdown. Hyperlinks will have
rel="noopener noreferrer"
andtarget="_blank"
added for privacy reasons. Internally, it will use a version of Markdown-It renderer bundled with Web Chat. It will not use the version passed by the dev viarenderMarkdown
prop.Sorting notifications
Notifications will be sorted with the most recent one on the top. If a notification is updated, they will be moved to the top of the list.
Updating notifications
All notifications are ID-ed using
id
. Notifications can be updated by dispatching `WEB_CHAT/SET_NOTIFICATION with the same ID.After the notification is updated, their timestamp will be updated and they will be moved to the top of the list.
Multiple notifications
When more than one notification is visible, they will be collapsed as an accordion. The accordion can be expanded/collapsed through user gesture.
The color and icon of the accordion will be based on the highest level of all visible notifications.
error
>warn
>info
>success
.Connectivity status
Connectivity status will become part of notification and stored in Redux store.
The connectivity status visual will be hidden from the notification bar (i.e.
<BasicNotificationBar>
). A new component<BasicConnectivityStatus>
will render the connectivity status exclusively.Screenshots
Support Markdown
Multiple notifications
Single "success" notifications
Works under IE11
Specific Changes