-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(CardUpload): adjust IconTemplate order #7025
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
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR adjusts the rendering logic in CardUpload so that a custom IconTemplate is displayed before the default image preview, and updates associated unit tests to reflect this change and strengthen JSON converter testing. Class diagram for CardUpload rendering logic updateclassDiagram
class CardUpload {
+AllowExtensions
+CanPreviewCallback
+IconTemplate
+GetItemClassString(item)
+OnClickZoom(item)
}
class UploadItem {
+PrevUrl
+IsImage(allowExtensions, canPreviewCallback)
}
CardUpload "1" *-- "many" UploadItem: contains
CardUpload : IconTemplate(item)
UploadItem : IsImage(AllowExtensions, CanPreviewCallback)
CardUpload : OnClickZoom(item)
CardUpload : GetItemClassString(item)
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7025 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 743 743
Lines 32453 32453
Branches 4498 4498
=========================================
Hits 32453 32453
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request modifies the CardUpload component to prioritize the IconTemplate rendering over the default image preview logic, and adds corresponding test coverage for this behavior change.
- Changed the conditional rendering order in CardUpload.razor to check
IconTemplatefirst - Added test to verify IconTemplate can be reset to null
- Added null assertion to improve test robustness in JsonDescriptionEnumConverterTest
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Upload/CardUpload.razor | Reordered conditional checks to prioritize custom IconTemplate over default image rendering |
| test/UnitTest/Components/UploadCardTest.cs | Added test case to verify IconTemplate can be explicitly set to null |
| test/UnitTest/Converters/JsonDescriptionEnumConverterTest.cs | Added null assertion for deserialized object before accessing properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Link issues
fixes #7024
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Adjust CardUpload component to apply custom IconTemplate before default image preview and update unit tests to cover null template and JSON deserialization
Bug Fixes:
Tests: