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

MudTable: Added StripedGroups parameter to stripe per group instead of per row. #8604

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

Etzix
Copy link
Contributor

@Etzix Etzix commented Apr 7, 2024

Description

This adds the parameter StripedGroups to the table that can be used togheter with the grouping system to stripe even/odd groups, instead of Striped that stripes based on even/odd rows.

Open to improvement suggestions, but this implementation works. I tried to do this using only CSS, but that seems impossible. In the end my CSS + C# implementation got so complex that i decided to scrap it and make this PR instead.

How Has This Been Tested?

Visually and simple unit test.

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)

firefox_tfkP8JKD5r

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 enhancement New feature or request PR: needs review labels Apr 7, 2024
@Etzix
Copy link
Contributor Author

Etzix commented Apr 7, 2024

Can't figure out why the code quality check is failing. Appreciate any help

I was looking at the wrong file 😄

Copy link

codecov bot commented Apr 8, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 89.87%. Comparing base (28bc599) to head (4c2b7f8).
Report is 7 commits behind head on dev.

Files Patch % Lines
.../MudBlazor/Components/Table/MudTableGroupRow.razor 50.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8604      +/-   ##
==========================================
+ Coverage   89.82%   89.87%   +0.04%     
==========================================
  Files         412      412              
  Lines       11878    11886       +8     
  Branches     2364     2364              
==========================================
+ Hits        10670    10682      +12     
+ Misses        681      676       -5     
- Partials      527      528       +1     

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

@Etzix
Copy link
Contributor Author

Etzix commented Apr 8, 2024

I'm not sure how i should write test coverage for the 2 lines that Codecov is mentioning. Any help is appreciated 🙏

* Even/Odd css should apply to the correct group based on what the user assumes to be the even/odd group, not a index that starts at 0.
* Removed unnecessary footerClass and moved the adding of the class into the cs file.
* Added simple test for the classes.
@Etzix
Copy link
Contributor Author

Etzix commented Apr 8, 2024

I made some improvements and added a simple test for the striped classes.

@henon
Copy link
Collaborator

henon commented Apr 18, 2024

I am not sure about this. I'd rather want a way to allow any kind of custom CSS classes applied per row. Like a Func<RowContext, string> RowClassFunc which you call with any necessary info in the row context like index, group, element etc and the user can return the css class per row. This would allow so many different applications like a line-based striping that alternates between groups etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR: needs review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants