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

MudDataGrid: Add FilterVariant Property #8484

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

dunds-com
Copy link

@dunds-com dunds-com commented Mar 26, 2024

Description

MudDataGrid was missing the Variant property, so you could not set it for the filtering.

How Has This Been Tested?

Visually tested using the docs.

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.

@henon henon changed the title MudDataGrid: Added Variant Property MudDataGrid: Add Variant Property Mar 28, 2024
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.

Please change the xml comment

src/MudBlazor/Components/DataGrid/MudDataGrid.razor.cs Outdated Show resolved Hide resolved
src/MudBlazor/Components/DataGrid/MudDataGrid.razor.cs Outdated Show resolved Hide resolved
@henon
Copy link
Collaborator

henon commented Mar 28, 2024

Can you show before and after screenshots how the new visuals look? Thanks

@dunds-com
Copy link
Author

@henon
Old:
Old

New:
New

@ScarletKuro
Copy link
Member

fyi: the tests fail now

@henon henon changed the title MudDataGrid: Add Variant Property MudDataGrid: Add FilterVariant Property Mar 28, 2024
Copy link
Contributor

@tjscience tjscience left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks, @dunds-com!

@ScarletKuro
Copy link
Member

@dunds-com can you fix the tests? It looks related, then we can merge.

@dunds-com
Copy link
Author

dunds-com commented Apr 2, 2024

@ScarletKuro @tjscience @henon

The test doesn't seem to find the add button in the filters anymore.
comp.FindAll(".filters-panel > button")[0].Click();

But it does work when using the method.
await comp.InvokeAsync(() => dataGrid.Instance.AddFilter());

Maybe setting the variant is causing the button to be rendered with a delay?

@henon
Copy link
Collaborator

henon commented Apr 2, 2024

If it is indeed a timing issue as you suspect then you could prove it by waiting for 1 second with await Task.Delay(TimeSpan.FromSeconds(1)). But I am not so sure that's it. Variant shouldn't introduce a delay. Maybe the css selector is not correct any longer?

@dunds-com
Copy link
Author

@henon

await Task.Delay(TimeSpan.FromSeconds(1));

// click the Add Filter button in the filters panel to add a filter
comp.FindAll(".filters-panel > button")[0].Click();

Adding the delay does not seem to have an effect.

@henon
Copy link
Collaborator

henon commented Apr 3, 2024

Do a Constole.WriteLine(comp.Markup); to see the html structure at that point in time. That'll tell you why the css selector doesn't work

@ScarletKuro
Copy link
Member

Very strange, technically added property shouldn't have affected anything except the .mud-button-filled-primary

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

4 participants