Skip to content

MudDialogProvider: Add missing BackgroundClass (#8454)#8458

Merged
henon merged 3 commits intoMudBlazor:devfrom
Alerinos:dev
Mar 25, 2024
Merged

MudDialogProvider: Add missing BackgroundClass (#8454)#8458
henon merged 3 commits intoMudBlazor:devfrom
Alerinos:dev

Conversation

@Alerinos
Copy link
Contributor

@Alerinos Alerinos commented Mar 25, 2024

Description

resolves #8454

How Has This Been Tested?

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.

@Alerinos
Copy link
Contributor Author

/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/Components/Dialog/DialogOptions.cs(26,22): error CS8632: The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. [/home/runner/work/MudBlazor/MudBlazor/src/MudBlazor/MudBlazor.csproj::TargetFramework=net7.0]
    public class DialogOptions
    {
        public DialogPosition? Position { get; set; }

        public MaxWidth? MaxWidth { get; set; }

        public bool? DisableBackdropClick { get; set; }
        public bool? CloseOnEscapeKey { get; set; }
        public bool? NoHeader { get; set; }
        public bool? CloseButton { get; set; }
        public bool? FullScreen { get; set; }
        public bool? FullWidth { get; set; }
        public string? ClassBackground { get; set; }
    }

I don't understand, you don't accept the possibility of a null on a string? The parameter may not be present, so it should be null, it is optional.

@danielchalmers
Copy link
Member

That string should be nullable by default because it's not in a '#nullable' annotations context. Try dropping the ?.

@Alerinos
Copy link
Contributor Author

@danielchalmers I have enabled nullable for these two files and fixed the errors with null missing. We should support null, even Microsoft recommends that we have nullable enabled for the entire project.

@danielchalmers
Copy link
Member

Please see #6535 if you're interested in helping in this area

@codecov
Copy link

codecov bot commented Mar 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.85%. Comparing base (61e8a76) to head (2e8fa79).

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #8458   +/-   ##
=======================================
  Coverage   88.84%   88.85%           
=======================================
  Files         416      416           
  Lines       12358    12359    +1     
  Branches     2458     2458           
=======================================
+ Hits        10980    10981    +1     
  Misses        845      845           
  Partials      533      533           

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

@Alerinos
Copy link
Contributor Author

Please see #6535 if you're interested in helping in this area

In a few days I will have a little free time so I can help a little.

@danielchalmers
Copy link
Member

Please see #6535 if you're interested in helping in this area

In a few days I will have a little free time so I can help a little.

I know that'll be very appreciated!

@henon henon changed the title in MudDialogProvider is missing from ClassBackground #8454 MudDialogProvider: Add missing BackgroundClass (#8454) Mar 25, 2024
@henon
Copy link
Contributor

henon commented Mar 25, 2024

Please rename it to BackgroundClass in DialogOptions.

@ArieGato will change the property name in dialog provider in his breaking-change PR to BackgroundClass as well, then we will have consistency.

@Alerinos
Copy link
Contributor Author

@henon
Changing the name will cause problems when updating systems that already exist. I suggest you add a new name but keep the old one too with ObsoleteAttribute.
Then, in some time, retire the old name completely.
https://learn.microsoft.com/pl-pl/dotnet/api/system.obsoleteattribute?view=net-8.0

@henon
Copy link
Contributor

henon commented Mar 25, 2024

I know we do this all the time. But the next release will be v7.0.0 where we finally after waiting for years remove all obsolete properties and make breaking changes. This will be only one in a dozen breaking changes and there will be a migration guide: #8447

@henon
Copy link
Contributor

henon commented Mar 25, 2024

In any case, you can rename the property you added without a breaking change, so please do so.

@Alerinos
Copy link
Contributor Author

@henon Ok, I understand. Done

Copy link
Contributor

@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.

@ScarletKuro You may merge after taking a second look

Copy link
Member

@ScarletKuro ScarletKuro left a comment

Choose a reason for hiding this comment

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

lgtm

@ScarletKuro
Copy link
Member

I guess this is breaking change
ClassBackground -> BackgroundClass since public API is changed?

@henon henon added breaking change This change will require consumer code updates and removed PR: needs review labels Mar 25, 2024
@henon henon merged commit 824fa40 into MudBlazor:dev Mar 25, 2024
@henon henon added API change Modifies the public API surface v7 labels Mar 25, 2024
@henon
Copy link
Contributor

henon commented Mar 25, 2024

Added to the v7.0.0 Migration Guide
#8447

@henon henon mentioned this pull request Mar 26, 2024
biegehydra pushed a commit to biegehydra/MudBlazor that referenced this pull request Apr 26, 2024
@phamilton4321
Copy link
Contributor

Hi all, I can see the property in the MudDialogProvider component (7.0), that's great. But is it really implemented?
I'm asking because it has no effect for what I could test with 2 projects. Neither in a ShowDialog nor a Dialog<>.ShowAsync

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API change Modifies the public API surface breaking change This change will require consumer code updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

in MudDialogProvider is missing from ClassBackground

5 participants