mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-19 02:23:00 +08:00
feat(plugin-block-tree): support default sorting (#10339)
This commit is contained in:
@@ -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'),
|
||||
|
||||
+9
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user