Repository navigation
feat(AutoGenerateColumn): add Required property - #8643
Conversation
feat:开启Required、IsRequiredWhenAdd、IsRequiredWhenEdit属性支持
|
Thanks for your PR, @Tony-ST0754. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8643 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 776 776
Lines 35234 35243 +9
=========================================
+ Hits 35234 35243 +9
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:
|
Reviewer's GuideAdds Required, IsRequiredWhenAdd, and IsRequiredWhenEdit support to AutoGenerateColumnAttribute using nullable backing fields to preserve unset-vs-explicit-false semantics and fallback behavior, with unit tests covering all state transitions. 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 found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs" line_range="90-95" />
<code_context>
- bool? ITableColumn.IsRequiredWhenAdd { get; set; }
+ /// <summary>
+ /// <para lang="zh">获得/设置 当前列是否必填。默认值为 null,使用 <see cref="RequiredAttribute"/> 或 <see cref="IsRequiredWhenAdd"/>、<see cref="IsRequiredWhenEdit"/> 值</para>
+ /// <para lang="en">Gets or sets whether the current column is required. Default is null, using the <see cref="RequiredAttribute"/> or the <see cref="IsRequiredWhenAdd"/>, <see cref="IsRequiredWhenEdit"/> values</para>
+ /// </summary>
+ public bool Required
+ {
+ get => _required ?? false;
+ set => _required = value;
+ }
</code_context>
<issue_to_address>
**Unset settings appear false**
When a caller reads an unset setting through the public attribute property, the public property getters convert an unset backing value to `false`, so callers reading the attribute directly see the same value for unset and explicitly disabled settings, contrary to the documented null default.
Update the public-property documentation to say that its getter returns false when unset and that the interface view preserves null.
Also at `src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs:108-114`, `src/BootstrapBlazor/Attributes/AutoGenerateColumnAttribute.cs:127-131`.
</issue_to_address>Sourcery assessment
Approved.
AutoGenerateColumn开启Required、IsRequiredWhenAdd、IsRequiredWhenEdit属性支持null,保证原业务逻辑不变Link issues
fixes #8642
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Support configuring required-field behavior for automatically generated columns while preserving existing default behavior.
New Features:
Enhancements:
Tests: