feat(plugin-block-tree): support default sorting (#10339)

This commit is contained in:
Jiann
2026-08-11 21:12:00 +08:00
committed by GitHub
parent 9850be3cde
commit b106e307b5
2 changed files with 13 additions and 0 deletions
@@ -716,6 +716,10 @@ TreeBlockModel.registerFlow({
use: 'dataScope',
title: tExpr('Data scope'),
},
defaultSorting: {
use: 'sortingRule',
title: tExpr('Default sorting'),
},
connectFields: {
use: treeConnectDataBlocks.name,
title: tExpr('Connect data blocks'),
@@ -69,6 +69,15 @@ describe('TreeBlockModel', () => {
expect(String(TreeFilterBlockMenuModel.meta?.searchPlaceholder)).toContain('Search');
});
it('exposes default sorting in tree settings', () => {
const flow = TreeBlockModel.globalFlowRegistry.getFlow('treeSettings');
expect(flow.steps.defaultSorting).toMatchObject({
use: 'sortingRule',
title: expect.stringContaining('Default sorting'),
});
});
it('keeps multi relation entries in associated records for tree filter block menu', async () => {
const engine = new FlowEngine();
engine.registerModels({ TreeBlockModel });