@nocobase/client-v2 2.2.53 → 2.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/BaseApplication.d.ts +3 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutModel.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
- package/es/flow/admin-shell/admin-layout/observeAdminMenuRoutes.d.ts +26 -0
- package/es/flow/models/blocks/table/TableJSFieldItemModel.d.ts +1 -1
- package/es/index.mjs +108 -108
- package/lib/index.js +97 -97
- package/package.json +7 -7
- package/src/BaseApplication.tsx +25 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +7 -9
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +48 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +6 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +17 -21
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +1 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +34 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +146 -0
- package/src/flow/admin-shell/admin-layout/index.ts +1 -0
- package/src/flow/admin-shell/admin-layout/observeAdminMenuRoutes.ts +60 -0
- package/src/flow/models/blocks/details/DetailsBlockModel.tsx +5 -1
- package/src/flow/models/blocks/table/TableJSFieldItemModel.tsx +11 -3
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +26 -0
|
@@ -12,7 +12,33 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
12
12
|
// Prime the model module graph so the editable field bindings used by the quick edit data scope setting are registered.
|
|
13
13
|
import '../../../index';
|
|
14
14
|
import { RecordSelectFieldModel } from '../../../fields/AssociationFieldModel/RecordSelectFieldModel';
|
|
15
|
+
import { TableBlockModel } from '../TableBlockModel';
|
|
15
16
|
import { TableColumnModel } from '../TableColumnModel';
|
|
17
|
+
import { TableJSFieldItemModel } from '../TableJSFieldItemModel';
|
|
18
|
+
|
|
19
|
+
describe('table JS field menu', () => {
|
|
20
|
+
it('excludes the tree children relationship by metadata and keeps ordinary associations', async () => {
|
|
21
|
+
const engine = new FlowEngine();
|
|
22
|
+
engine.registerModels({ TableBlockModel });
|
|
23
|
+
engine.dataSourceManager.getDataSource('main').addCollection({
|
|
24
|
+
name: 'categories',
|
|
25
|
+
fields: [
|
|
26
|
+
{ name: 'descendants', type: 'hasMany', target: 'categories', interface: 'o2m', treeChildren: true },
|
|
27
|
+
{ name: 'children', type: 'hasMany', target: 'categories', interface: 'o2m' },
|
|
28
|
+
{ name: 'parent', type: 'belongsTo', target: 'categories', interface: 'm2o' },
|
|
29
|
+
{ name: 'title', type: 'string', interface: 'input' },
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
const table = engine.createModel<TableBlockModel>({
|
|
33
|
+
use: 'TableBlockModel',
|
|
34
|
+
stepParams: { resourceSettings: { init: { dataSourceKey: 'main', collectionName: 'categories' } } },
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const items = await TableJSFieldItemModel.defineChildren(table.context);
|
|
38
|
+
|
|
39
|
+
expect(items.map((item) => item.key)).toEqual(['children', 'parent', 'title', 'js-association-fields']);
|
|
40
|
+
});
|
|
41
|
+
});
|
|
16
42
|
|
|
17
43
|
const createQuickEditDataScopeCtx = (
|
|
18
44
|
overrides: { associationPathName?: string; editable?: boolean; isAssociation?: boolean } = {},
|