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

Snackbar: Fix type class not taking into account per-snackbar options #8423

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

danielchalmers
Copy link
Contributor

@danielchalmers danielchalmers commented Mar 23, 2024

Description

Fixes #5027.

var options = new SnackbarOptions(severity, Configuration);
configure?.Invoke(options);

SnackbarTypeClass was set in the SnackbarOptions constructor before the snackbar's configuration was assigned, thus falling back to the global configuration. Now the class creation is handled in SnackBarMessageState.SnackbarClass and SnackbarTypeClass is kept pure.

Docs were updated to reflect this new opportunity.

Note: SnackbarTypeClass can now be null but it's only used in one place (internally) inside a string.

How Has This Been Tested?

visually

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 Something does not work as intended/expected PR: needs review labels Mar 23, 2024
@danielchalmers danielchalmers changed the title Fix snackbar type class not taking into account changed options Snackbar: Fix style class not taking into account per-snackbar options Mar 23, 2024
@danielchalmers danielchalmers changed the title Snackbar: Fix style class not taking into account per-snackbar options Snackbar: Fix type class not taking into account per-snackbar options Mar 23, 2024
Copy link

codecov bot commented Mar 23, 2024

Codecov Report

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

Project coverage is 89.08%. Comparing base (222b8bb) to head (e2a37a9).
Report is 28 commits behind head on dev.

Files Patch % Lines
...Blazor/Components/Snackbar/SnackBarMessageState.cs 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #8423      +/-   ##
==========================================
+ Coverage   88.80%   89.08%   +0.27%     
==========================================
  Files         414      411       -3     
  Lines       12294    12184     -110     
  Branches     2455     2433      -22     
==========================================
- Hits        10918    10854      -64     
+ Misses        844      796      -48     
- Partials      532      534       +2     

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

@ScarletKuro ScarletKuro merged commit fccce94 into MudBlazor:dev Mar 28, 2024
2 of 3 checks passed
@ScarletKuro
Copy link
Member

Thanks.

@danielchalmers danielchalmers deleted the per-snackbar-variant branch April 4, 2024 23:47
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.

Per-snackbar options ignore Variant changing
3 participants