doc(SelectGeneric): update IsEditable paraemeter sample code#6135
Merged
doc(SelectGeneric): update IsEditable paraemeter sample code#6135
IsEditable paraemeter sample code#6135Conversation
Co-Authored-By: yswCode <56284285+yswcode@users.noreply.github.com>
Contributor
Reviewer's GuideRefactored SelectGeneric to delegate editable-item insertion and reset logic to an asynchronous callback, and updated the sample to show how to pass TextConvertToValueCallback. Class Diagram: Updates to SelectGeneric and SelectGenerics SampleclassDiagram
class SelectGeneric~TValue~ {
+TextConvertToValueCallback: Func<string, Task<TValue?>>
#OnChange(ChangeEventArgs args) Task
}
class SelectGenerics {
+TextConvertToValueCallback(string v) Task<Foo>
-_genericItems: List<SelectedItem<Foo>>
-_selectedFoo: Foo
}
class Foo {
+Id: int
+Address: string
}
SelectGenerics ..> Foo : uses
SelectGenerics ..> SelectGeneric~Foo~ : configures & uses
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
- Add a
<summary>documentation entry for the new TextConvertToValueCallback parameter in SelectGeneric.razor so its purpose and usage are clearly described. - Populate the en-US.json and zh-CN.json locale files with labels/descriptions for TextConvertToValueCallback so your samples remain fully localized.
- Consider throwing a clear exception or issuing a warning when IsEditable is true but TextConvertToValueCallback is not provided to help consumers catch misconfigurations early.
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6135 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 703 703
Lines 31073 31069 -4
Branches 4397 4397
=========================================
- Hits 31073 31069 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link issues
fixes #6134
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Update the editable SelectGeneric sample to demonstrate asynchronous text-to-value conversion and adjust the component’s change logic to delegate item updates externally and restore the previous selection on null responses.
Bug Fixes:
Enhancements: