-
Notifications
You must be signed in to change notification settings - Fork 17
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
Sandbox: Flag enum content is not displayed in 'View' mode #67
Comments
Partial fix currently exists in OAT repo branch: da/component-update, but Modified FlagsInput.razor to still create checkboxes in cases where the flag enum member is |
This is probably the wrong approach. This should be covered by the |
According to official documentation the way to check if a type is nullable is
https://docs.microsoft.com/en-us/dotnet/api/system.nullable.getunderlyingtype?view=net-5.0 However, this does not appear to work for Enums, and this method will instead return |
I've narrowed this problem down to only Enums that start as null. Enums that are nullable but don't start as null now work. |
Now works with nullable enums that are default to null.
* Carry Scaffold Parameter Value Types * Update ScaffoldInput.razor * Update FlagsInput to use carried type * Update Scaffold.cs * Update ScaffoldInput.razor * Move Tuple Check to Helpers.cs * Update Helpers.cs * Update Helpers.cs * Update Helpers.cs * Revert "Update Helpers.cs" This reverts commit fa6dee3. * Style ObjectInput * Update ScaffoldInput.razor * Update ScaffoldInput.razor * Update PropertyInput.razor * Update BoolInput.razor * Update FlagsInput.razor * Fix #68 and #69 * Should fix button to set nullables. * Finish fixing #67 Now works with nullable enums that are default to null. * Fixes * Update OAT.Blazor.csproj * Mostly Fix GUI Issues: Many elements cannot be clicked on, but can be tabbed to and used. Icons images are not sized correctly. * Improve which constructors are supported to match the inputs we have supported. Fixes setting values in dictionaries. * Remove merge comments. * Also show the checkbox if the value is null We cannot actually check if reference types are nullable so we need to check if the value is null and show the checkbox when it is null. We do not show the checkbox if the value is no longer null and we can't confirm that its nullable. * Support lists of enums * Bump dependencies Co-authored-by: David Alcantar <daalcant@microsoft.com>
Description:
In the Sandbox, objects containing flag enum members do not display corresponding enum content when viewed. Only the label is displayed.
E.g. see FirewallObject flag enum member 'Profiles'
Expected behavior:
Objects in 'View' mode should display all possible enum flag values as checkboxes, defaulting to unchecked.
To Reproduce:
Steps to reproduce the behavior:
Configuration:
The text was updated successfully, but these errors were encountered: