Skip to content

Conversation

@swatkinson
Copy link
Contributor

@swatkinson swatkinson commented Aug 22, 2024

Description

Updated the MudGlobal.cs file to include more component defaults for:
Button, Card, DataGrid, Grid, Link, Stack, and Tabs

How Has This Been Tested?

I've updated the Mudglobal defaults from the program.cs of the UnitTests.Viewer project, and verified that the changes were reflected in the components on the website visually. (Had to make changes to some component tests to make sure they didnt overwrite the global component defaults)

image

Button default changes, for example:
image

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 Request for adding a new feature or enhancing existing functionality (not fixing a defect) PR: needs review labels Aug 22, 2024
@swatkinson swatkinson changed the title Updated Mudglobal to add more component defaults MudGlobal: Updated Mudglobal to add more component defaults Aug 22, 2024
@codecov
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.82%. Comparing base (28bc599) to head (c6d8997).
Report is 543 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #9691      +/-   ##
==========================================
+ Coverage   89.82%   90.82%   +0.99%     
==========================================
  Files         412      406       -6     
  Lines       11878    12825     +947     
  Branches     2364     2476     +112     
==========================================
+ Hits        10670    11648     +978     
+ Misses        681      623      -58     
- Partials      527      554      +27     

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

Copy link
Member

@danielchalmers danielchalmers left a comment

Choose a reason for hiding this comment

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

Great work! One small typo I noticed

@danielchalmers danielchalmers requested a review from henon August 22, 2024 17:34
/// </summary>
[Parameter]
[Category(CategoryTypes.Tabs.Appearance)]
public bool Outlined { get; set; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did you overlook this or is there a reason for not including it in MudGlobal?

@henon
Copy link
Collaborator

henon commented Sep 2, 2024

I would love an automated unit test using reflection for this. The idea is as follows:

  • Find all components, foreach component ...
    • check if there is a <ComponentNameWithoutMud>Defaults class (if not, do not fail for now, we can fail here later)
    • find all parameters of each component and foreach parameter ...
      • If there is a defaults class, check if the class contains a property with the same name as the parameter and if not fail the test
      • Check that changing the default in MudGlobal will affect the value of the parameter when instantiating the component

We already have an automated unit test that instantiates all components to make sure that they do not raise an exception. You could copy that test and reuse its logic for this.

@ScarletKuro
Copy link
Member

What's the status of this? Are we waiting the test proposed by @henon?

@henon
Copy link
Collaborator

henon commented Oct 12, 2024

No it is not necessary and to be honest might be harder to do than I thought. Merging now.

@henon henon changed the title MudGlobal: Updated Mudglobal to add more component defaults MudGlobal: Add more component defaults Oct 12, 2024
@henon henon merged commit 5403f08 into MudBlazor:dev Oct 12, 2024
@henon
Copy link
Collaborator

henon commented Oct 12, 2024

Thanks @swatkinson

@nicolassargos
Copy link

Hey! Nice job here. Do you plan to also add Variant ? That would be of great help.

ScarletKuro pushed a commit that referenced this pull request Oct 29, 2024
Co-authored-by: Spencer Watkinson <spencer.watkinson@caivan.com>
(cherry picked from commit 5403f08)
LLauter pushed a commit to cannellamedia/MudBlazor that referenced this pull request Dec 16, 2024
Co-authored-by: Spencer Watkinson <spencer.watkinson@caivan.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request for adding a new feature or enhancing existing functionality (not fixing a defect)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants