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

MudTabPanel: Allow icon color to be set from panel #9001

Merged
merged 17 commits into from
May 29, 2024

Conversation

djflan
Copy link
Contributor

@djflan djflan commented May 18, 2024

Description

Allows MudTab Icon Color to be set from MudTabPanel (override)

How Has This Been Tested?

Visually tested using the existing 'RippleTest'

Type 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 enhancement New feature or request PR: needs review labels May 18, 2024
Copy link

codecov bot commented May 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.63%. Comparing base (28bc599) to head (3ae482a).
Report is 242 commits behind head on dev.

Current head 3ae482a differs from pull request most recent head 5569a1c

Please upload reports for the commit 5569a1c to get more accurate results.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9001      +/-   ##
==========================================
+ Coverage   89.82%   90.63%   +0.80%     
==========================================
  Files         412      398      -14     
  Lines       11878    12382     +504     
  Branches     2364     2406      +42     
==========================================
+ Hits        10670    11222     +552     
+ Misses        681      621      -60     
- Partials      527      539      +12     

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

@danielchalmers
Copy link
Contributor

Should it be Inherit instead of default like the original property?

/// <summary>
/// The color of the icon. It supports the theme colors.
/// </summary>
[Parameter]
[Category(CategoryTypes.Tabs.Appearance)]
public Color IconColor { get; set; } = Color.Inherit;

Also needs unit test

@henon
Copy link
Collaborator

henon commented May 25, 2024

@djflan Thanks for the PR, it is good to merge except there is no unit test which is our policy for PRs. The reason is that any feature that has a test can not be accidentally be undone or broken. It is the reason why the library is so stable despite hundreds of collaborators.

In your case, check that the color of the panel is used if unset and when set it overrides the color.

@djflan
Copy link
Contributor Author

djflan commented May 25, 2024

@djflan Thanks for the PR, it is good to merge except there is no unit test which is our policy for PRs. The reason is that any feature that has a test can not be accidentally be undone or broken. It is the reason why the library is so stable despite hundreds of collaborators.

In your case, check that the color of the panel is used if unset and when set it overrides the color.

Added a unit test. Seems tricky to get the color of the icon. I had to assign 'Color.Success' and check the SVG class list for 'mud-success-text'. currently unsure if there is another way to do this.

@dennisrahmen
Copy link
Contributor

Hey not at my pc currently so could not test myself. Could you check if the icon is grayed out when the tab is disabled.

This should be the case if no specific color is set as well as when there is a color set for the tab or inherited as you added here.

If not you would need to pass down the "Disabled" property to the icon.

@djflan
Copy link
Contributor Author

djflan commented May 29, 2024

Hey not at my pc currently so could not test myself. Could you check if the icon is grayed out when the tab is disabled.

This should be the case if no specific color is set as well as when there is a color set for the tab or inherited as you added here.

If not you would need to pass down the "Disabled" property to the icon.

Added a check for disabled panel state and inherited color when disabled. Also added a unit test for this since I'm sure it will be requested.

@henon henon removed the needs tests label May 29, 2024
@henon henon merged commit e032140 into MudBlazor:dev May 29, 2024
1 of 2 checks passed
@henon
Copy link
Collaborator

henon commented May 29, 2024

Thanks!

@djflan djflan deleted the feat/mud-tab-panel-allow-set-icon-color branch June 5, 2024 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants