Skip to content

DataGrid Phase 3#4705

Merged
henon merged 60 commits intoMudBlazor:devfrom
tjscience:datagrid_phase3
Jul 13, 2022
Merged

DataGrid Phase 3#4705
henon merged 60 commits intoMudBlazor:devfrom
tjscience:datagrid_phase3

Conversation

@tjscience
Copy link
Contributor

Description

Please see the project for more details: https://github.com/tjscience/MudBlazor/projects/3

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • The PR is submitted to the correct branch (dev).
  • My code follows the code style of this project.
  • I've added relevant tests.

Garderoben and others added 30 commits March 6, 2022 14:09
Removed debugging code in HeaderCell.
Fixed issue with culture and datetime on examples page.
…tions

MudDataGrid: Refactor FilterDefintions API
Refactored CellContext creation code into the class itself.
Refactored HeaderContext creation code into the class itself.
Refactored FooterContext creation code into the class itself.
https://github.com/tjscience/MudBlazor/projects/3#card-79771104
Adapt and extend existing tests for local and server side sorting to new functionality
Solution changed due to duplicate project GUID
…dden-fix

data grid fix for bind-hidden not calling hidden callback in all scen…
@henon
Copy link
Contributor

henon commented Jun 21, 2022

Pushed the change as @ScarletKuro suggested (Thanks man!) and it compiles without errors now.

@henon henon added the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Jun 21, 2022
@mikes-gh
Copy link
Contributor

@tjscience Sorry this is still open. We need the tests fixed please. 🙏

@mikes-gh
Copy link
Contributor

@henon I can see the API test failure may be to do with the generic typing so it may be the generated tests that need looking at. I'll see if I can fix.

@henon
Copy link
Contributor

henon commented Jun 29, 2022

@tjscience So I guess you did not run the entire suite locally but only the DataGrid tests? That would be the only way for me to explain how the tests can work for you (as you say) but not on the server.

In any case, we probably need to exempt some of the generic internal components or those who can't live on their own without a specific parent from the auto-generated unit tests. I'll look at this as soon as I find the time.

@henon henon requested a review from just-the-benno June 29, 2022 11:47
@tjscience
Copy link
Contributor Author

Before submitting the PR, I did run the entire test suite locally and I had no errors. After mike-gh mentioned to fix the tests, I ran the tests for the DataGrid. What other tests would I need to fix here?

@henon
Copy link
Contributor

henon commented Jun 29, 2022

I'll sort it out.

DateTime? valueDateTime = Value == null ? null : (DateTime)Value;
var isnotnull = Expression.IsTrue(Expression.Property(field, "HasValue"));
var isnull = Expression.IsFalse(Expression.Property(field, "HasValue"));
var isnotnull = Expression.IsTrue(Expression.Property(field, typeof(bool?), "HasValue"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DateTime? should be here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You sure? HasValue sounds like a boolean propert to me. But then again, I have no deep understanding of this code

Copy link
Member

@ScarletKuro ScarletKuro Jun 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, DateTime will have a HasValue with ? sign, since it's a value type like int, bool, double etc. And this method is intended to work with DateTime?.
Sorry, I didn't specify this in my comment earlier. The bool? was only an example for specific GenerateFilterExpressionForBooleanTypes method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I get it now. The type is not the type of the HasValue property but of the DateTime? which has that property.

var isnotnull = Expression.IsTrue(Expression.Property(field, "HasValue"));
var isnull = Expression.IsFalse(Expression.Property(field, "HasValue"));
var isnotnull = Expression.IsTrue(Expression.Property(field, typeof(bool?), "HasValue"));
var isnull = Expression.IsFalse(Expression.Property(field, typeof(bool?), "HasValue"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DateTime? should be here

double? valueNumber = Value == null ? null : Convert.ToDouble(Value);
var isnotnull = Expression.IsTrue(Expression.Property(field, "HasValue"));
var isnull = Expression.IsFalse(Expression.Property(field, "HasValue"));
var isnotnull = Expression.IsTrue(Expression.Property(field, typeof(bool?), "HasValue"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double? here

var isnotnull = Expression.IsTrue(Expression.Property(field, "HasValue"));
var isnull = Expression.IsFalse(Expression.Property(field, "HasValue"));
var isnotnull = Expression.IsTrue(Expression.Property(field, typeof(bool?), "HasValue"));
var isnull = Expression.IsFalse(Expression.Property(field, typeof(bool?), "HasValue"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double? here

@TobiasBreuer
Copy link
Contributor

Hey, @tjscience , @ScarletKuro , @henon, the attached patch file (unitTestsFixes.zip) will fix the failing tests in this branch (zipped it as GitHub does not accept *.patch files).
Main reasons are missing EventListener mock service in the test contexts, missing categorization of new properties and missing null-checks.
Also of course the changes that @ScarletKuro already pointed out.

@tjscience: Please have a look at the patch and apply the changes as desired.
Please note that even after applying the patch there is one test still failing on my end which is
public void MudExpansionPanel_Respects_Collapsing_Order() that fails at panels[item].OuterHtml.Should().Contain("mud-panel-expanded");.
I did not do anything here as I don't have any insights on that component...

@tjscience
Copy link
Contributor Author

@TobiasBreuer, I will try and patch this in the next day or two. Thanks.

@tjscience
Copy link
Contributor Author

@henon, seems like the issues have been resolved.

@codecov
Copy link

codecov bot commented Jul 13, 2022

Codecov Report

Merging #4705 (791ca7e) into dev (64502b3) will decrease coverage by 1.40%.
The diff coverage is 71.77%.

@@            Coverage Diff             @@
##              dev    #4705      +/-   ##
==========================================
- Coverage   91.38%   89.97%   -1.41%     
==========================================
  Files         365      370       +5     
  Lines       12537    13290     +753     
==========================================
+ Hits        11457    11958     +501     
- Misses       1080     1332     +252     
Impacted Files Coverage Δ
...Components/DataGrid/DataGridColumnResizeService.cs 0.00% <0.00%> (ø)
.../MudBlazor/Components/DataGrid/FooterCell.razor.cs 100.00% <ø> (ø)
src/MudBlazor/Components/DataGrid/Row.razor.cs 100.00% <ø> (ø)
...c/MudBlazor/Components/DataGrid/SelectColumn.razor 100.00% <ø> (ø)
...azor/Components/DataGrid/FilterHeaderCell.razor.cs 16.66% <16.66%> (ø)
...dBlazor/Components/DataGrid/FilterHeaderCell.razor 38.46% <38.46%> (ø)
src/MudBlazor/Components/DataGrid/FilterContext.cs 54.54% <54.54%> (ø)
.../MudBlazor/Components/DataGrid/HeaderCell.razor.cs 66.46% <57.40%> (-12.21%) ⬇️
src/MudBlazor/Components/DataGrid/Column.cs 66.34% <59.67%> (-18.18%) ⬇️
src/MudBlazor/Components/DataGrid/Filter.razor.cs 47.43% <66.66%> (+2.65%) ⬆️
... and 44 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64502b3...791ca7e. Read the comment docs.

@henon
Copy link
Contributor

henon commented Jul 13, 2022

Merging this will decrease overall coverabe by 1.4% but I think people have been waiting for this a long time and getting it out there is more important than this number at the moment.

@henon henon merged commit a9acca1 into MudBlazor:dev Jul 13, 2022
@henon henon added this to the 6.0.12 milestone Jul 13, 2022
@henon
Copy link
Contributor

henon commented Jul 13, 2022

Thank you big time @tjscience !

jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
jammerware pushed a commit to jammerware/MudBlazor that referenced this pull request Sep 20, 2022

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
@kaddrison
Copy link

kaddrison commented Oct 11, 2022 via email

@tjscience tjscience deleted the datagrid_phase3 branch October 11, 2022 20:21
3dots pushed a commit to 3dots/MudBlazor that referenced this pull request Mar 23, 2023

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
ScarletKuro pushed a commit to ScarletKuro/MudBlazor that referenced this pull request Mar 27, 2023

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
ferraridavide pushed a commit to ferraridavide/MudBlazor that referenced this pull request May 30, 2023

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023

Co-authored-by: Jonny Larsson <[email protected]>
Co-authored-by: Tobias Breuer <[email protected]>
Co-authored-by: [email protected] <[email protected]>
Co-authored-by: segfault <[email protected]>
Co-authored-by: Meinrad Recheis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants