Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions docs/config/handbook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -956,11 +956,18 @@ export default [
link: '/handbook/block-template',
},
{
title: 'Linkage rules',
'title.fr-FR': 'Règles de liaison',
'title.zh-CN': '联动规则',
'title.ja-JP': '連動ルール',
link: '/handbook/ui/blocks/block-settings/linkage-rule',
title: 'Field linkage rules',
'title.fr-FR': 'Règle de dépendance des champs',
'title.zh-CN': '字段联动规则',
'title.ja-JP': 'フィールド連動ルール',
link: '/handbook/ui/blocks/block-settings/field-linkage-rule',
},
{
title: 'Block linkage rules',
'title.fr-FR': 'Règle de dépendance des blocs',
'title.zh-CN': '区块联动规则',
'title.ja-JP': 'ブロック連動ルール',
link: '/handbook/ui/blocks/block-settings/block-linkage-rule',
},
{
title: 'Edit block title',
Expand Down Expand Up @@ -1521,6 +1528,13 @@ export default [
'title.ja-JP': '変数',
link: '/handbook/ui/variables',
},
{
title: 'Linkage rules',
'title.fr-FR': 'Règle de dépendance',
'title.zh-CN': '联动规则',
'title.ja-JP': '連動ルール(れんどうルール)',
link: '/handbook/ui/linkage-rule',
},
{
title: 'Template engines',
'title.fr-FR': 'Moteur de template',
Expand Down
2 changes: 1 addition & 1 deletion docs/en-US/handbook/block-multi-step-from/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Control the behavior of form fields through linkage rules.

![](https://static-docs.nocobase.com/202410101717884.png)

More content reference [Linkage rules](/handbook/ui/blocks/block-settings/linkage-rule)
More content reference [Linkage rules](/handbook/ui/blocks/block-settings/field-linkage-rule)


### Block Height Setting
Expand Down
1 change: 0 additions & 1 deletion docs/en-US/handbook/block-tree/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ Example: The form filter block connects to the detail data block to achieve link
For more information, refer to [Connecting Data Block](/handbook/ui/blocks/block-settings/connect-block)

- [Editing Block Title](/handbook/ui/blocks/block-settings/block-title)
- [Linkage Rule](/handbook/ui/blocks/block-settings/linkage-rule)
- [Save as Block Template](/handbook/block-template)

## Configuring Fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ The After successful submission enables customization of the response behavior u
- Stay on the current popup or page: After the operation is successful, the pop-up window or route is not closed
- Return to the previous popup or page(default): Close the popup window after the operation is successful
- Redirect to: After the operation succeeds, the route is switched to the specified route

### Redirect to a Specific Route

The `Submit` button in the form supports dynamically passing variables from the response data after a successful submission, to be used in a route redirection.

![20250405162542](https://static-docs.nocobase.com/20250405162542.png)

You can pass the response record data as variables into the path.
For example: After successfully creating a record, you can redirect to the details page of that record.
![20250405162732](https://static-docs.nocobase.com/20250405162732.png)
6 changes: 3 additions & 3 deletions docs/en-US/handbook/ui/actions/action-settings/edit-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Introduction

You can personalize the buttons name, icon, and background color. There are three color choices: default, highlighted, or Danger red.
You can customize the button's name, icon, and background color. You can choose from three color options: default, highlight, or red. When an icon is set, the button can display only the icon.

![20240413093715](https://static-docs.nocobase.com/20240413093715.png)
![20250405140611](https://static-docs.nocobase.com/20250405140611.png)

![20240413093745](https://static-docs.nocobase.com/20240413093745.png)
![20250405140640](https://static-docs.nocobase.com/20250405140640.png)
46 changes: 31 additions & 15 deletions docs/en-US/handbook/ui/actions/action-settings/linkage-rule.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,52 @@
# Linkage Rule
# Operation Linkage Rules

## Introduction

The linkage rules for actions are configured based on contextual data conditions and execution results. By configuring these linkage rules, you can control the status of actions (Visible, Hidden, Enabled, Disabled).
Operation linkage rules allow users to dynamically control the status of actions (such as Visible, Enabled, Hidden, Disabled) based on specific conditions. By configuring these rules, users can link the behavior of action buttons with the current record, user role, or contextual data. Starting from version `v1.7.0-beta.19`, global buttons support configuring linkage rules.

> **Note**: Operation linkage rules do not currently support direct linkage with form values. Therefore, it is not possible to perform conditional checks based on fields in the current form (i.e., current form variables are not supported). Currently, operation linkage rules support controlling the visibility, enablement, and disablement of actions based on other contextual data or system variables.

![20240423113057](https://static-docs.nocobase.com/20240423113057.png)

## Usage Instructions

![20240413102150](https://static-docs.nocobase.com/20240413102150.png)
![20250418152329](https://static-docs.nocobase.com/20250418152329.png)

When conditions are met (by default, they pass without conditions), the action will be triggered. Constants and variables can be used in the condition evaluation.

## Constants

Example: Only orders that are pending can be edited.

![20250418150033](https://static-docs.nocobase.com/20250418150033.png)

## Variables

### System Variables

When conditions are met (by default, they pass without conditions), the action is triggered. Constants and variables can be used in the condition evaluation.
Example 1: Disable the delete button for orders with a delivery date later than today.

### Applicable Buttons for Linkage Rules
![20250418145825](https://static-docs.nocobase.com/20250418145825.png)

Currently, only buttons with data context support configuring linkage rules.
Example 2: The bulk delete button on the order block table header is only available to the administrator role; other roles cannot perform this operation.

Row buttons in blocks such as tables and Gantt charts;
![20250418150637](https://static-docs.nocobase.com/20250418150637.png)

Buttons in detail blocks;
![20250418150826](https://static-docs.nocobase.com/20250418150826.png)

### Context Variables

### Constants
Example: The "Add" button in the order details (relationship block) is enabled only when the order status is "Pending Payment." In other statuses, the button will be disabled.

Example: Hide the copy button for orders that have been canceled.
![20250418145312](https://static-docs.nocobase.com/20250418145312.png)

![20240423113212](https://static-docs.nocobase.com/20240423113212.png)
![20250418150429](https://static-docs.nocobase.com/20250418150429.png)

### Variables
For more information on variable content, refer to [Variables](/handbook/ui/variables).

Example: Disable the delete button for orders with a delivery date later than today.
## RoadMap

![20240423113504](https://static-docs.nocobase.com/20240423113504.png)
- Planned or In Progress
- Operation linkage rules support for the current form

For further details on using variables, see the [Variables](/handbook/ui/variables) section.
For more information on linkage rules, refer to [Linkage Rules](/handbook/ui/linkage-rule)
14 changes: 14 additions & 0 deletions docs/en-US/handbook/ui/blocks/block-settings/block-linkage-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Block Linkage Rules

> **Note**: This feature is supported starting from version `v1.7.0-beta.xx`.

Block linkage rules allow users to dynamically control the visibility of blocks. For example, when a specific condition is met, a block can be hidden, enabling scenarios like **xxx**.

### Control Blocks with Global Variables
For example, "Current Role".

### Control Blocks with Contextual Variables
When a block can access the relevant records within the context, it can also control the block's visibility through contextual variables.
For example, "Current Record", "Current Form", "Current Popup Record", etc.

For more information on linkage rules, refer to [Linkage Rules](/handbook/ui/linkage-rule).
78 changes: 78 additions & 0 deletions docs/en-US/handbook/ui/blocks/block-settings/field-linkage-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Field Linkage Rules

## Introduction

Field linkage rules allow users to dynamically adjust the status of form/detail block fields based on user actions. Currently, the following blocks support field linkage rules:

- [Form Block](/handbook/ui/blocks/data-blocks/form#%E8%81%94%E5%8A%A8%E8%A7%84%E5%88%99)
- [Detail Block](/handbook/ui/blocks/data-blocks/details#%E8%81%94%E5%8A%A8%E8%A7%84%E5%88%99)
- [Sub-form](/handbook/ui/fields/specific/nester) (requires v1.3.17-beta or higher)
- [Sub-table](/handbook/ui/fields/specific/sub-table) (requires v1.3.17-beta or higher)

## Usage Instructions

#### **Linkage Rules in Form Block**

In form blocks, linkage rules can dynamically adjust field behavior based on specific conditions:

- **Control Field Visibility/Hidden**: Determine whether the current field is displayed based on the value of other fields.
- **Set Field as Required**: Dynamically set a field as required or optional based on specific conditions.
- **Assign Values**: Automatically assign values to fields based on conditions.
- **Configure Field Options**: Dynamically update the available options in dropdowns based on other fields in the form.
- **Limit Time Range for Time Fields**: In time fields, limit the selectable time range based on the values of other fields.

#### **Linkage Rules in Detail Block**

In detail blocks, linkage rules are mainly used to dynamically control the visibility and hiding of fields in the detail block.

![20250418161037](https://static-docs.nocobase.com/20250418161037.png)

### Assigning Values

Example: When an order is checked as a supplementary order, the order status is automatically set to "Pending Review."

![20250418161712](https://static-docs.nocobase.com/20250418161712.png)

### Required Fields

Example: When the order status is "Pending Payment", the order amount is required.

![20250418163252](https://static-docs.nocobase.com/20250418163252.png)

### Visibility/Hidden

Example: The payment method is displayed only when the order status is "Pending Payment."

![20250418163733](https://static-docs.nocobase.com/20250418163733.png)

### Options

> **Note**: This feature is supported starting from version `v1.7.0-beta.2`.

It supports dynamically configuring options for fields like `select`, `radioGroup`, `multipleSelect`, `checkboxGroup`, etc. The available options can be linked to the changes in other fields in the form.

Example: "Installment Payment" is available only when the order amount is greater than 10,000.

![20250418164806](https://static-docs.nocobase.com/20250418164806.png)

Linkage effect as shown below:

<video width="100%" height="440" controls>
<source src="https://static-docs.nocobase.com/20250418164831.mp4" type="video/mp4">
</video>

### Date Scope

> **Note**: This feature is supported starting from version `v1.7.0-beta.2`.

It supports dynamically configuring date ranges for fields such as `date`, `datetime`, `dateOnly`, `datetimeNoTz`, `unixTimestamp`, `createdAt`, `updatedAt`, etc. The selectable date range can automatically adjust based on changes in other fields in the form.

Example: After selecting the order date, the delivery date cannot be earlier than the order date.

![20250418165500](https://static-docs.nocobase.com/20250418165500.png)

Example: The delivery date cannot be earlier than today and cannot be later than the order deadline.

![20250418170520](https://static-docs.nocobase.com/20250418170520.png)

For more information on linkage rules, refer to [Linkage Rules](/handbook/ui/linkage-rule).
104 changes: 0 additions & 104 deletions docs/en-US/handbook/ui/blocks/block-settings/linkage-rule.md

This file was deleted.

Loading
Loading