-
Notifications
You must be signed in to change notification settings - Fork 81
docs(Chat): improve examples to follow style guide #3236
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
base: master
Are you sure you want to change the base?
Conversation
Hello @IvanDanchev, Check the below option if you would like to automatically generate PR to production. The automation uses the branch for the cherry-pick, and then will delete the branch. Please, do not delete it manually.
|
|
||
public class ChatMessage | ||
{ | ||
public string Id { get; set; } | ||
|
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 normally don't use empty lines in classes to keep the code snippets shorter.
|
||
private List<string> QuickReplies = new List<string> | ||
@code { | ||
private TelerikChat<ChatMessage> ChatRef { get; set; } |
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.
Nullable references are enabled by default in new .NET apps. Our code snippets should not trigger compiler warnings about possible null values.
private TelerikChat<ChatMessage> ChatRef { get; set; } | |
private TelerikChat<ChatMessage>? ChatRef { get; set; } |
@@ -57,6 +57,7 @@ Configure file upload behavior using the `ChatFileSelectSettings` component: | |||
|
|||
@code { | |||
private TelerikChat<ChatMessage> Chat1; |
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.
Should be, with the corresponding ?
or !
in method calls.
private TelerikChat<ChatMessage> Chat1; | |
private TelerikChat<ChatMessage>? ChatRef { get; set; } |
private List<ChatMessage> Messages { get; set; } = new List<ChatMessage> | ||
#region Component Parameters | ||
|
||
private List<ChatMessage> ChatData { get; set; } |
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.
Should be
private List<ChatMessage> ChatData { get; set; } | |
private List<ChatMessage> ChatData { get; set; } = new(); |
or
private List<ChatMessage> ChatData { get; set; } | |
private List<ChatMessage>? ChatData { get; set; } |
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.
- Ideally, code snippets should not trigger compiler warnings about possible null values. Collections should be either initialized or nullable. Component references should be nullable.
- No need for new lines in class definitions, to make the snippets shorter.
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.
Ignored. This PR is outside of the docs-reviewers scope.
Note to external contributors: make sure to sign our Contribution License Agreement (CLA) for Blazor UI first:
https://forms.office.com/Pages/ResponsePage.aspx?id=Z2om2-DLJk2uGtBYH-A1NbWxVqugKN5DvVp8I-1AgOBURFBVSkwyMlA1TkFDVFdMNU1aM1o1UlZQOC4u