-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(client): support linkage style in table and form #4467
Open
sheldon66
wants to merge
14
commits into
nocobase:main
Choose a base branch
from
sheldon66:feat-linkage-style
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,599
−53
Conversation
This file contains 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
packages/core/client/src/modules/blocks/data-blocks/form/fieldSettingsFormItem.tsx
Outdated
Show resolved
Hide resolved
packages/core/client/src/modules/blocks/data-blocks/table/tableColumnSettings.tsx
Outdated
Show resolved
Hide resolved
packages/core/client/src/schema-component/antd/form-item/FormItem.tsx
Outdated
Show resolved
Hide resolved
packages/core/client/src/schema-component/antd/table-v2/Table.tsx
Outdated
Show resolved
Hide resolved
能再补充一些测试用例吗?现在这个功能的测试覆盖比较低 |
@sheldon66 如果需要补充 E2E 用例,可以临时参考一下这里的文档:https://nocobase.feishu.cn/wiki/CHoiw4aPOih55Bkb9dXcMdgjnre?from=from_copylink |
dddaa4c
to
3fe5090
Compare
3fe5090
to
696de15
Compare
style logic to hooks
600f4f2
to
234f115
Compare
zhangzhonghe
reviewed
Jun 3, 2024
packages/core/client/src/schema-component/antd/form-item/FormItem.tsx
Outdated
Show resolved
Hide resolved
packages/core/client/src/schema-component/antd/form-item/FormItem.tsx
Outdated
Show resolved
Hide resolved
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.
需求
支持Table和Form的Field使用联动规则框架配置color和backgroundColor样式
规则类型
样式联动规则与原有联动规则虽然框架是同一套,但是数据是隔离的,所以规则数据的存储应与
x-linkage-rules
分开,目前设计存储在x-style-linkage-rules
下同时,为联动规则增加类型字段
规则计算
增加规则计算函数, 可以计算规则中所有满足条件的action中的value
样式渲染
Table
在BodyCellComponent组件中渲染联动样式,在columns的onCell函数将当前record作为props传递给BodyCellComponent,
在BodyCellComponent读取当前record,并执行规则计算逻辑
Form
FormItem渲染样式,使用formilyJS的onFormValuesChange,当form数据有变动时执行规则计算逻辑
问题修复
Removed linkage rule setting in table column.
Fixed FormItem style not refreshing after settings change.
Replaced color select component with color picker component.