Skip to content

DataGridExamples: Fix item removal when list is empty#7571

Merged
ScarletKuro merged 1 commit intoMudBlazor:devfrom
MohamedYassin-J:fix/data_grid_observability_example
Oct 1, 2023
Merged

DataGridExamples: Fix item removal when list is empty#7571
ScarletKuro merged 1 commit intoMudBlazor:devfrom
MohamedYassin-J:fix/data_grid_observability_example

Conversation

@MohamedYassin-J
Copy link
Contributor

Description

During interactions with the data grid examples, specifically the 'Observability' example, I encountered an issue. An error arises when all items from the data grid are removed, and a further attempt to remove an item is made. The root cause was identified as a missing verification to determine if the list of items is already empty before initiating item removal. This update rectifies this oversight, ensuring smooth item management.

How Has This Been Tested?

To ensure the robustness of the implemented fix:

  1. Automated Testing: All existing unit tests were executed, and they passed without any failures.
  2. Manual Testing: I manually interacted with the 'Observability' example, adding and removing items multiple times, ensuring that no errors are produced under different scenarios.

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)

Visual Demonstrations

To better understand the issue and its subsequent resolution, please refer to the GIFs below:

Before the Fix:

Before Fix GIF

After the Fix:

After Fix GIF

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 bug Unexpected behavior or functionality not working as intended PR: needs review labels Sep 29, 2023
@codecov
Copy link

codecov bot commented Sep 29, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (e3034ac) 90.56% compared to head (ba83fc6) 90.56%.
Report is 1 commits behind head on dev.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #7571   +/-   ##
=======================================
  Coverage   90.56%   90.56%           
=======================================
  Files         427      427           
  Lines       15216    15217    +1     
=======================================
+ Hits        13781    13782    +1     
  Misses       1435     1435           
Files Coverage Δ
src/MudBlazor/Components/DataGrid/Column.razor.cs 78.31% <100.00%> (+0.26%) ⬆️
...rc/MudBlazor/Components/DataGrid/MudDataGrid.razor 86.92% <ø> (ø)

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

@Yomodo
Copy link
Contributor

Yomodo commented Sep 29, 2023

A fix like this has recently been merged: #7557

@ScarletKuro
Copy link
Member

A fix like this has recently been merged: #7557

I see it was closed for some reason, not merged?

@Yomodo
Copy link
Contributor

Yomodo commented Sep 29, 2023

I see it was closed for some reason, not merged?

ai, my bad

@MohamedYassin-J
Copy link
Contributor Author

A fix like this has recently been merged: #7557

I see it was closed for some reason, not merged?

Actually, the PR was part of a collaborative exercise between a friend and me. We decided to learn about contributing to open source projects together. He gave me this specific fix as a task, using MudBlazor as our starting point. The closure was intentional, serving more as a learning experience than a genuine contribution.

@ScarletKuro ScarletKuro requested a review from henon September 29, 2023 15:12
@ScarletKuro ScarletKuro changed the title DataGridExamples: Managing Item Removal for an Empty List DataGridExamples: Fix item removal when list is empty Oct 1, 2023
@ScarletKuro ScarletKuro merged commit bd04d94 into MudBlazor:dev Oct 1, 2023
@ScarletKuro
Copy link
Member

ScarletKuro commented Oct 1, 2023

@henon merged this without second review, as this change looks simple enough.

@henon
Copy link
Contributor

henon commented Oct 1, 2023

Sure, thanks @ScarletKuro! Thank you @MohamedYassin-J !

@MohamedYassin-J MohamedYassin-J deleted the fix/data_grid_observability_example branch October 1, 2023 12:37
ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Unexpected behavior or functionality not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants