nutui-react
nutui-react copied to clipboard
fix(FormItem): 修复initialValue属性初始化未被正确加入到Formstore中导致的问题
Taro和H5同样的改动
- [x] 日常 bug 修复
Summary by CodeRabbit
-
新功能
- 增加了表单项和表单初始值设置的功能。
-
测试
- 添加了针对表单项和表单初始值设置的测试用例,包括表单和表单项同时设置初始值及提交的场景。
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 85.79%. Comparing base (
d4c0049
) to head (9903def
). Report is 4 commits behind head on next.
Additional details and impacted files
@@ Coverage Diff @@
## next #2247 +/- ##
=======================================
Coverage 85.78% 85.79%
=======================================
Files 217 217
Lines 22783 22795 +12
Branches 2481 2485 +4
=======================================
+ Hits 19545 19557 +12
Misses 3233 3233
Partials 5 5
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Walkthrough
此次更新主要集中在表单和表单项的初始值设置功能。为表单项和表单添加了初始值的测试,并在FormItem
组件的componentDidMount
方法中增加了逻辑,以根据特定条件设置字段的初始值。
Changes
文件路径 | 变更摘要 |
---|---|
src/packages/form/__tests__/form.spec.tsx |
添加了测试用例,以验证表单和表单项的初始值设置,包括提交时的场景。 |
src/packages/formitem/formitem.taro.tsx |
更新了FormItem 类的componentDidMount 方法,增加了根据特定条件设置字段初始值的逻辑。 |
src/packages/formitem/formitem.tsx |
在FormItem 类的componentDidMount 方法中添加了逻辑,以根据特定条件设置字段值。 |
🐰✨
表单初始值,今朝新添, 测试覆盖,万事皆安。 逻辑更新,组件绽放, 代码如诗,程序如画。
Recent Review Details
Configuration used: CodeRabbit UI Review profile: CHILL
Commits
Files that changed from the base of the PR and between eeda4210f1052500d7ed7ef5a60f5270be64ba1a and 9903def7bb4b8228bf6a02199a0f4726461341b7.Files selected for processing (3)
- src/packages/form/tests/form.spec.tsx (1 hunks)
- src/packages/formitem/formitem.taro.tsx (2 hunks)
- src/packages/formitem/formitem.tsx (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- src/packages/form/tests/form.spec.tsx
- src/packages/formitem/formitem.taro.tsx
- src/packages/formitem/formitem.tsx
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Tips
Chat
There are 3 ways to chat with CodeRabbit:
Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitai
in a new review comment at the desired location with your query. Examples:-
@coderabbitai generate unit testing code for this file.
-
@coderabbitai modularize this function.
-
- PR comments: Tag
@coderabbitai
in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:-
@coderabbitai generate interesting stats about this repository and render them as a table.
-
@coderabbitai show all the console.log statements in this repository.
-
@coderabbitai read src/utils.ts and generate unit testing code.
-
@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
-
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.
CodeRabbit Commands (invoked as PR comments)
-
@coderabbitai pause
to pause the reviews on a PR. -
@coderabbitai resume
to resume the paused reviews. -
@coderabbitai review
to trigger a review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai resolve
resolve all the CodeRabbit review comments. -
@coderabbitai help
to get help.
Additionally, you can add @coderabbitai ignore
anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml
)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yaml
file to the root of your repository. - Please see the configuration documentation for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Documentation and Community
- Visit our Documentation for detailed information on how to use CodeRabbit.
- Join our Discord Community to get help, request features, and share feedback.
- Follow us on X/Twitter for updates and announcements.