-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(chat): add support for custom message template #2750
feat(chat): add support for custom message template #2750
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2750 +/- ##
==========================================
- Coverage 84.57% 78.39% -6.19%
==========================================
Files 235 265 +30
Lines 8059 8265 +206
Branches 710 899 +189
==========================================
- Hits 6816 6479 -337
- Misses 1023 1503 +480
- Partials 220 283 +63
|
src/framework/theme/components/chat/chat-custom-message.directive.spec.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.spec.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message-showcase.component.html
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message-showcase.component.html
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message-showcase.component.html
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-messsage-showcase.component.ts
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-messsage-showcase.component.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message.component.html
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message.component.html
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message.component.ts
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message-table.component.ts
Outdated
Show resolved
Hide resolved
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 also need to update docs to tell users about custom message support. You'll find docs on the chat in the chat.component.ts
file in the comment above the class declaration. Please, add several sentences on how to provide a custom message template and then reference your example via @stacked-example(Custom message, chat/chat-custom-message.component)
.
To start the docs app run npm run docs:serve
. If you update text in the documentation comment in the chat component file you need to run npm run docs:parse
to see the change in the docs app (no need to restart docs app).
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message.component.html
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message.component.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/chat/chat-custom-message.directive.ts
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/chat-custom-message.component.html
Outdated
Show resolved
Hide resolved
And fix formatting
src/playground/with-layout/chat/chat-custom-message.component.scss
Outdated
Show resolved
Hide resolved
src/playground/with-layout/chat/components/chat-custom-message-table.component.scss
Outdated
Show resolved
Hide resolved
…ssociated members
…Styles description
To simplify template reading.
To remove unnecessary whitespace
Looks like docs app styles (bootstrap) was leaking into examples, so there was no top margin in the docs examples, but it was presented in the user app
Move div class and style to the host element
So all message type has consistent spacing between sender and message
As we have it as a class property
So user template could take up all available space
Please read and mark the following check list before creating a pull request:
Short description of what this resolves:
Fixes #2134. Fixes #2279.
Update for #2413
BREAKING CHANGE:
NbChatMessageComponent
constructor now has a second parameter (NbCustomMessageService
).