Skip to content

MudDropZone: Add ItemClassSelector parameter.#7599

Merged
henon merged 9 commits intoMudBlazor:devfrom
RPalejiya:dev
Oct 24, 2023
Merged

MudDropZone: Add ItemClassSelector parameter.#7599
henon merged 9 commits intoMudBlazor:devfrom
RPalejiya:dev

Conversation

@RPalejiya
Copy link
Contributor

@RPalejiya RPalejiya commented Oct 5, 2023

Description

Currently there is no way to define class for draggable items of a DropZone. This change will allow to define ItemsClassSelector on and components. discussion #6300

How Has This Been Tested?

Added test case "DropzoneItemClassSelectorTest.razor" No new test. None

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. - Dont know enough to add unit test but added test in viewer project.

@github-actions github-actions bot added enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library PR: needs review labels Oct 5, 2023
@ScarletKuro
Copy link
Member

ScarletKuro commented Oct 5, 2023

Hi. I only see you pushed changes to .gitignore file: https://github.com/MudBlazor/MudBlazor/pull/7599/files
and this file shouldn't be modified btw.
Please, check your PR and make sure you pushed the correct changes.

Ravi Palejiya added 2 commits October 6, 2023 06:29
@codecov
Copy link

codecov bot commented Oct 6, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (4a59a37) 90.58% compared to head (1da9e09) 86.16%.
Report is 16 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #7599      +/-   ##
==========================================
- Coverage   90.58%   86.16%   -4.42%     
==========================================
  Files         427      427              
  Lines       15224    15249      +25     
  Branches        0     3323    +3323     
==========================================
- Hits        13791    13140     -651     
+ Misses       1433     1425       -8     
- Partials        0      684     +684     
Files Coverage Δ
...azor/Components/DropZone/MudDropContainer.razor.cs 68.00% <100.00%> (-21.19%) ⬇️
...rc/MudBlazor/Components/DropZone/MudDropZone.razor 93.33% <ø> (-6.67%) ⬇️
...MudBlazor/Components/DropZone/MudDropZone.razor.cs 93.47% <60.00%> (-6.53%) ⬇️

... and 192 files with indirect coverage changes

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

@RPalejiya
Copy link
Contributor Author

Please check it now. I reverted incorrect commit to gitignore and pushed correct commit to the PR.

…cute code when draging starts (Similar to ItemDropped).
@ScarletKuro ScarletKuro requested a review from henon October 13, 2023 13:24
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.

The item class selector looks good. The additional event is not needed I think, at least I see no reason why two events sending exactly the same data are being invoked in the same place. Please remove or make your case why it is needed.

@henon henon changed the title Defining ItemClass property for DropZone Items. MudDropZone: Add ItemClassSelector parameter. Oct 14, 2023
…isitng TransactionStarted event.

Corrected the Test for it.
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.

Actually I argued that the ItemPicked event is not really needed because the TransactionStarted event is already serving the same purpose, it is just not named as intuitively as ItemPicked. So unless you can provide an argument why TransactionStarted is not suitable I'd say let's remove it and just add to the summary of TransactionStarted that it is raised when an item is picked.

@RPalejiya
Copy link
Contributor Author

Thanks for the clarification. Please review if I get it correct this time.

@henon
Copy link
Contributor

henon commented Oct 23, 2023

By the way, you added a test component but I don't see a unit test that checks that the class selector func works and that the event is called. We'd need that also to make sure future PRs will not accidentally break these features.

@RPalejiya
Copy link
Contributor Author

Added two unit tests. Please check.

@henon henon merged commit 9d36942 into MudBlazor:dev Oct 24, 2023
@henon
Copy link
Contributor

henon commented Oct 24, 2023

Great, thanks @RPalejiya !

ilovepilav pushed a commit to ilovepilav/MudBlazor that referenced this pull request Nov 25, 2023
* Adding functionality to Dropzone Item to apply custom class on item of the dropzone using funciton.
Added test for this.
* DropZone - Adding eventhandler for "ItemPicked" to provide way to execute code when draging starts (Similar to ItemDropped).



---------

Co-authored-by: Ravi Palejiya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants