MudDataGrid: Fix grouping for bound and unbound scenarios using ParameterState#8463
Merged
ScarletKuro merged 2 commits intoMudBlazor:devfrom Apr 1, 2024
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #8463 +/- ##
==========================================
- Coverage 89.39% 89.38% -0.02%
==========================================
Files 413 413
Lines 11865 11863 -2
Branches 2354 2353 -1
==========================================
- Hits 10607 10604 -3
- Misses 736 737 +1
Partials 522 522 ☔ View full report in Codecov by Sentry. |
Member
|
Thanks for the PR, I will look it later! |
8a13de7 to
27bc9f6
Compare
Member
|
LGTM. PS: I rebased against latest change, to make sure we don't get formatting errors. |
Member
|
Hmmm seems like some build errors after rebase, I will investigate later. |
Member
|
@Anu6is [Test]
public void DateRangePicker_Preset_No_Timestamp()
{
var comp = Context.RenderComponent<DateRangePickerPresetWithoutTimestampTest>();
comp.Markup.Should().Contain("mud-range-start-selected");
comp.Markup.Should().Contain("mud-range-end-selected");
}
[Test]
public void DateRangePicker_Preset_Timestamp()
{
var comp = Context.RenderComponent<DateRangePickerPresetRangeWithTimestampTest>();
comp.Markup.Should().Contain("mud-range-start-selected");
comp.Markup.Should().Contain("mud-range-end-selected");
}
|
6 tasks
Contributor
|
Corrected unit tests in #8543 |
27bc9f6 to
c1122f1
Compare
Member
|
@peterthorpe81 thanks. |
biegehydra
pushed a commit
to biegehydra/MudBlazor
that referenced
this pull request
Apr 26, 2024
…eterState (MudBlazor#8463) Co-authored-by: Peter Thorpe <[email protected]>
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes MudDataGrid column grouping so it works for bound and unbound scenarios.
Description
Fixes: #8159
This fix implements the ParameterState framework for MudDataGrid column grouping. Allowing the parameter to be used in a bound state or as an initializer as disussed in #8258
There is a breaking change (minor I believe) in relation to the
Groupableparameter. If you setgroupingin code to true andgroupableto false it will render grouped. Similarly if you@bind-groupingit won't respect the groupable parameter. Previously the behaviour was inconsistent between the initial value and an updated parameter. The grid UI fully respects the groupable parameter as before.I think this is appropriate behaviour, the UI enforces the groupable parameter but the developer has the choice to ignore it and group by any column. I can't think of a scenario where this will be an issue. There is potentially a way to retain the behaviour but it does mean in
@bind-groupingscenarios withgroupable="false"there is an immediate event callback to reset grouping. It would seem less flexible to me anyway.How Has This Been Tested?
Tested visually
Added test
DataGridGroupingTestBoundAndUnboundScenariosto try grouping for bound and unbound scenarios and expected behaviour.Types of changes
Checklist:
dev).