-
-
Notifications
You must be signed in to change notification settings - Fork 81
[HxInputBase] ChipRemoveActionBuilder #1063
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
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 PR fixes #1062 by introducing a ChipRemoveActionBuilder to dynamically build chip removal actions from expression trees and updating the HxInputBase component accordingly. Key changes include:
- Introducing ChipRemoveActionBuilder for deferred expression parsing and caching.
- Updating HxInputBase to use the new builder for chip removal.
- Adding comprehensive tests to ensure correct behavior and error handling.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
HxInputBaseTests/HxInputBase_GetChipRemoveAction_NestedModel_Test.razor | Added test page to exercise chip removal on nested models. |
Forms/Internal/ChipRemoveActionBuilder.cs | New builder class for creating chip removal actions from expressions. |
Forms/HxInputBase.cs | Updated to utilize the new ChipRemoveActionBuilder. |
Forms/Internal/ChipRemoveActionBuilderTests.cs | Added tests covering various scenarios for the builder. |
Files not reviewed (1)
- Havit.Blazor.Documentation/XmlDoc/Havit.Blazor.Components.Web.Bootstrap.xml: Language not supported
Comments suppressed due to low confidence (1)
Havit.Blazor.Components.Web.Bootstrap/Forms/HxInputBase.cs:406
- [nitpick] Consider renaming 'builder' to a more descriptive name such as 'chipRemoveActionBuilder' for improved code clarity.
var builder = new ChipRemoveActionBuilder(ValueExpression, value);
Havit.Blazor.Components.Web.Bootstrap/Forms/Internal/ChipRemoveActionBuilder.cs
Outdated
Show resolved
Hide resolved
@jirikanda I'm going to merge this into |
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 PR fixes #1062 by refactoring the chip removal action to use a dedicated builder, and adds both integration and unit tests to validate the new behavior.
- Introduces ChipRemoveActionBuilder for generating chip removal actions.
- Updates HxInputBase to use the new builder.
- Adds integration tests in a new Razor test file and comprehensive unit tests for the builder.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
HxInputBaseTests/HxInputBase_GetChipRemoveAction_NestedModel_Test.razor | Added a new interactive test page for nested model chip removal. |
Forms/Internal/ChipRemoveActionBuilder.cs | Introduces a builder that constructs the chip removal action at runtime. |
Forms/HxInputBase.cs | Refactored GetChipRemoveAction to use the new builder instead of an inline lambda. |
Forms/Internal/ChipRemoveActionBuilderTests.cs | Added unit tests covering various scenarios for the ChipRemoveActionBuilder. |
Files not reviewed (1)
- Havit.Blazor.Documentation/XmlDoc/Havit.Blazor.Components.Web.Bootstrap.xml: Language not supported
Comments suppressed due to low confidence (1)
Havit.Blazor.Components.Web.Bootstrap/Forms/Internal/ChipRemoveActionBuilder.cs:36
- The List is declared without importing System.Collections.Generic, which may lead to compile errors. Please add 'using System.Collections.Generic;' at the top of the file.
var accessChain = new List<MemberInfo>();
Fixes #1062.