Skip to content
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

DataGrid: Remove 'Value not null' criteria for FilterDefinition #8706

Merged
merged 3 commits into from
Apr 26, 2024

Conversation

aditya119
Copy link
Contributor

@aditya119 aditya119 commented Apr 15, 2024

Description

Fixes #8702
On MudDataGrid, when is empty or is not empty filters are applied. Filter icon does not show filled funnel.
This creates confusion whether filter was applied or not.

The hasFilter property in HeaderCell.razor.cs was returning false when filter definition did not have a value.
Since, is empty and is not empty filter definitions will never have a value so datagrid column header was showing empty funnel despite filter being applied.
The logic was updated to ignore the check for Value when checking whether column hasFilter.

How Has This Been Tested?

Visually tested.
image

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)
  • Documentation (fix or improvement to the website or code docs)

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 Something does not work as intended/expected PR: needs review labels Apr 15, 2024
@aditya119 aditya119 changed the title Remove criteria that filter definition should have value for hasFilter property to be true Remove criteria that FilterDefinition should have Value not null for hasFilter property to be true Apr 15, 2024
@ScarletKuro
Copy link
Member

Hi. Thanks for PR.

Please, add a bUnit test to test this case.

Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.11%. Comparing base (28bc599) to head (ac88346).
Report is 63 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8706      +/-   ##
==========================================
+ Coverage   89.82%   90.11%   +0.28%     
==========================================
  Files         412      418       +6     
  Lines       11878    12050     +172     
  Branches     2364     2365       +1     
==========================================
+ Hits        10670    10859     +189     
+ Misses        681      658      -23     
- Partials      527      533       +6     

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

@aditya119
Copy link
Contributor Author

Please, add a bUnit test to test this case.

Added test to check scenarios of filter definition with value, without value and filter not applied.

@ScarletKuro
Copy link
Member

Added test to check scenarios of filter definition with value, without value and filter not applied.

Thanks!

Copy link
Contributor

@tjscience tjscience left a comment

Choose a reason for hiding this comment

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

This one looks good. Thanks, @aditya119!

@ScarletKuro ScarletKuro changed the title Remove criteria that FilterDefinition should have Value not null for hasFilter property to be true DataGrid: Remove 'Value not null' criteria for FilterDefinition Apr 26, 2024
@ScarletKuro ScarletKuro merged commit 20c58ba into MudBlazor:dev Apr 26, 2024
4 checks passed
@aditya119 aditya119 deleted the fix/column-filter-icon branch April 26, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Column header filter icon does not show filled funnel when 'is empty' or 'is not empty' filters are applied
3 participants