fix(CardUpload):修正CardUpload、AvatarUpload这两个组件表单验证时提示信息不能正确移除的Bug - #8330
fix(CardUpload):修正CardUpload、AvatarUpload这两个组件表单验证时提示信息不能正确移除的Bug#8330Tony-ST0754 wants to merge 11 commits into
Conversation
fix:修正CardUpload、AvatarUpload这两个组件表单验证时,这两个组件上已正确上传文件,提示信息不能正确移除的Bug
|
Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts CardUpload and AvatarUpload add-button rendering so that validation messages are correctly cleared when files are uploaded, by always rendering the add-button fragment and controlling visibility via the ShowAddButton flag. Flow diagram for updated CardUpload and AvatarUpload add button renderingflowchart TD
A[Start render component] --> B{IsUploadButtonAtFirst}
B -->|true| C[Render RenderAdd at first position]
B -->|false| D[Render RenderAdd at last position]
C --> E{ShowAddButton}
D --> E
E -->|true| F[Render add button with hidden=false]
E -->|false| G[Render add button with hidden=true]
F --> H[Validation passes and message cleared]
G --> H
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.
Hey - I've left some high level feedback:
- Since both CardUpload and AvatarUpload now share the same pattern for always rendering the add button and toggling visibility via
hidden, consider extracting this into a shared helper/component to avoid divergence and ease future maintenance. - Using the
hiddenattribute changes both visual and accessibility behavior; if the intent is only to hide the button visually, consider using a CSS class instead (e.g.,class="... @(ShowAddButton() ? "" : "d-none")") so you can more easily control layout and accessibility semantics.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Since both CardUpload and AvatarUpload now share the same pattern for always rendering the add button and toggling visibility via `hidden`, consider extracting this into a shared helper/component to avoid divergence and ease future maintenance.
- Using the `hidden` attribute changes both visual and accessibility behavior; if the intent is only to hide the button visually, consider using a CSS class instead (e.g., `class="... @(ShowAddButton() ? "" : "d-none")"`) so you can more easily control layout and accessibility semantics.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8330 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 771 771
Lines 34546 34544 -2
=========================================
- Hits 34546 34544 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
fix:修正CardUpload、AvatarUpload这两个组件表单验证时,这两个组件上已正确上传文件,提示信息不能正确移除的Bug
Link issues
fixes #8329
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: