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

FileUpload: Add Disabled property #6572

Merged

Conversation

Mr-Technician
Copy link
Member

Description

This is the sister PR to #6511 and adds a Disabled property to the MudFileUpload.

This PR also adds a ParentDisabled cascading value to the MudBaseButton, allowing it to inherit its Disabled state from the MudFileUpload as well as the MudForm once #6511 is merged.

image

How Has This Been Tested?

I have added two unit tests.

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.

@codecov
Copy link

codecov bot commented Mar 31, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.10 ⚠️

Comparison is base (2631eef) 91.47% compared to head (5a5efe4) 91.37%.

❗ Current head 5a5efe4 differs from pull request most recent head db0bbfe. Consider uploading reports for the commit db0bbfe to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #6572      +/-   ##
==========================================
- Coverage   91.47%   91.37%   -0.10%     
==========================================
  Files         393      397       +4     
  Lines       14877    14919      +42     
==========================================
+ Hits        13608    13632      +24     
- Misses       1269     1287      +18     
Impacted Files Coverage Δ
src/MudBlazor/Components/Button/MudButton.razor 100.00% <ø> (ø)
src/MudBlazor/Components/Button/MudFab.razor 100.00% <ø> (ø)
...rc/MudBlazor/Components/Button/MudIconButton.razor 100.00% <ø> (ø)
src/MudBlazor/Base/MudBaseButton.cs 86.95% <100.00%> (+0.59%) ⬆️
src/MudBlazor/Components/Button/MudFab.razor.cs 100.00% <100.00%> (ø)
...udBlazor/Components/FileUpload/MudFileUpload.razor 100.00% <100.00%> (ø)
...lazor/Components/FileUpload/MudFileUpload.razor.cs 96.55% <100.00%> (+0.25%) ⬆️

... and 23 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@henon henon left a comment

Choose a reason for hiding this comment

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

Looks good!

[Parameter]
[Category(CategoryTypes.FileUpload.Behavior)]
public bool Disabled { get; set; }
[CascadingParameter(Name = "ParentDisabled")] private bool ParentDisabled { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

Can we have a new line between the attribute and property, because it would align with the rest of the file style?

Copy link
Member Author

Choose a reason for hiding this comment

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

This style (no newline following attribute) is consistent with the usage of CascadingParameter elsewhere.

src/MudBlazor/Components/Button/MudFab.razor Outdated Show resolved Hide resolved
src/MudBlazor/Components/Button/MudIconButton.razor Outdated Show resolved Hide resolved
@Mr-Technician Mr-Technician merged commit e0afebd into MudBlazor:dev Mar 31, 2023
@Mr-Technician Mr-Technician deleted the feature/fileupload-disabled branch March 31, 2023 18:22
ScarletKuro pushed a commit to ScarletKuro/MudBlazor that referenced this pull request Apr 4, 2023
* Add Disabled property to FileUpload and cascade BaseButton disabled state.

* Style changes.

* Refactor CascadingValue.
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
* Add Disabled property to FileUpload and cascade BaseButton disabled state.

* Style changes.

* Refactor CascadingValue.
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

3 participants