-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
TreeViewItem: Throw exception when ItemTemplate is misconfigured #8867
TreeViewItem: Throw exception when ItemTemplate is misconfigured #8867
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #8867 +/- ##
==========================================
+ Coverage 89.82% 90.13% +0.30%
==========================================
Files 412 421 +9
Lines 11878 12304 +426
Branches 2364 2431 +67
==========================================
+ Hits 10670 11090 +420
+ Misses 681 665 -16
- Partials 527 549 +22 ☔ View full report in Codecov by Sentry. |
protected override void OnParametersSet() | ||
{ | ||
base.OnParametersSet(); | ||
|
||
if (Text == null && (Value == null && MudTreeRoot?.ServerData != null)) | ||
throw new InvalidOperationException( | ||
$"'{nameof(MudTreeView<T>)}.{nameof(MudTreeRoot.ServerData)}' requires '{nameof(MudTreeRoot.ItemTemplate)}.{nameof(MudTreeViewItem<T>)}.{nameof(Value)}' to be supplied."); | ||
} |
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.
@Taylan2020 for a && b && c
you don't need brackets.
@ScarletKuro is this OK or should we use the state framework for this?
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.
I guess it's fine for this case.
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.
In principle this is mergable. I just want to get a second opinion from @ScarletKuro
src/MudBlazor.UnitTests.Viewer/TestComponents/TreeView/TreeViewTest8.razor
Show resolved
Hide resolved
lol, while searching for the the thing to fix I stumbled accross this:
Guess that was an oversight by me in an earlier PR |
Thanks @Taylan2020 ! |
Description
I'm creating this PR in reference to my previously deleted PR #8168.
@henon fix is now ready to merge for v7. Thanks.
How Has This Been Tested?
Unit test is included in the comit covering the same scenario from Ticket #7156.
Types of changes
Checklist:
dev
).