Skip to content

MudDataGrid: Fix for Guid column filtering (#7381)#7383

Merged
ScarletKuro merged 1 commit intoMudBlazor:devfrom
jonathanpotts:fix/datagrid-guid-filtering
Aug 27, 2023
Merged

MudDataGrid: Fix for Guid column filtering (#7381)#7383
ScarletKuro merged 1 commit intoMudBlazor:devfrom
jonathanpotts:fix/datagrid-guid-filtering

Conversation

@jonathanpotts
Copy link
Contributor

@jonathanpotts jonathanpotts commented Aug 19, 2023

Description

Fixes #7381

src/MudBlazor/Components/DataGrid/Filter.cs
Added support to handle Guid field types.

src/MudBlazor/Components/DataGrid/MudDataGrid.razor
Changed the MudTextField components in the filters menu to use Guid? instead of string when the field type is Guid.

src/MudBlazor.UnitTests/Components/DataGridTests.cs
src/MudBlazor.UnitTests.Viewer/TestComponents/DataGrid/DataGridFiltersTest.razor
Add Guid? column filter testing to DataGridFiltersTest.

How Has This Been Tested?

Added Guid? column filter testing to DataGridFiltersTest.
All unit tests passed when I ran them.
I manually tested the changes to see if it fixes my issue.

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.

@github-actions github-actions bot added bug Unexpected behavior or functionality not working as intended PR: needs review labels Aug 19, 2023
@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Patch coverage: 16.66% and project coverage change: +0.04% 🎉

Comparison is base (47a1372) 90.59% compared to head (3392745) 90.63%.

❗ Current head 3392745 differs from pull request most recent head 1024bb2. Consider uploading reports for the commit 1024bb2 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7383      +/-   ##
==========================================
+ Coverage   90.59%   90.63%   +0.04%     
==========================================
  Files         427      427              
  Lines       15176    15257      +81     
==========================================
+ Hits        13748    13828      +80     
- Misses       1428     1429       +1     
Files Changed Coverage Δ
...rc/MudBlazor/Components/DataGrid/MudDataGrid.razor 86.92% <ø> (ø)
src/MudBlazor/Components/DataGrid/Filter.cs 73.43% <16.66%> (-5.88%) ⬇️

... and 8 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ScarletKuro
Copy link
Member

ScarletKuro commented Aug 20, 2023

Hi. Thanks for contribution.

@tjscience, we've had an internal discussion about this, and you suggested to eliminate filtering for Guid entirely, due to some drawbacks with current solution - you need to input the entire Guid into the textbox to initiate the filtering process, making it impossible to filter Guid partially. Instead, suggest the users to convert the Guid to a string. But I would consider to merge this, as this is better than nothing. Also this solution includes validation which tells that a valid Guid has to be entered. So I tested it and it's a not a bad solution.
validation

@ScarletKuro ScarletKuro requested a review from tjscience August 20, 2023 16:46
@ScarletKuro ScarletKuro merged commit 566a948 into MudBlazor:dev Aug 27, 2023
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Guid column filtering on MudDataGrid

3 participants