From e67fe2038ff0428b7c38e3a54a70d97947d5c714 Mon Sep 17 00:00:00 2001 From: Junyi Date: Thu, 9 May 2024 10:35:53 +0800 Subject: [PATCH] feat(client): add hidden option to interface (#4279) --- .../client/src/collection-manager/Configuration/interfaces.tsx | 1 + .../collection-field-interface/CollectionFieldInterface.ts | 1 + .../src/client/expression.tsx | 1 + 3 files changed, 3 insertions(+) diff --git a/packages/core/client/src/collection-manager/Configuration/interfaces.tsx b/packages/core/client/src/collection-manager/Configuration/interfaces.tsx index 8ecd02c154..cc4d57b208 100644 --- a/packages/core/client/src/collection-manager/Configuration/interfaces.tsx +++ b/packages/core/client/src/collection-manager/Configuration/interfaces.tsx @@ -22,6 +22,7 @@ export const getOptions = ( ...group, key: groupName, children: Object.keys(fieldInterfaces[groupName] || {}) + .filter((type) => !fieldInterfaces[groupName][type].hidden) .map((type) => { const field = fieldInterfaces[groupName][type]; return { diff --git a/packages/core/client/src/data-source/collection-field-interface/CollectionFieldInterface.ts b/packages/core/client/src/data-source/collection-field-interface/CollectionFieldInterface.ts index bba227213d..19f112d829 100644 --- a/packages/core/client/src/data-source/collection-field-interface/CollectionFieldInterface.ts +++ b/packages/core/client/src/data-source/collection-field-interface/CollectionFieldInterface.ts @@ -53,4 +53,5 @@ export abstract class CollectionFieldInterface { validateSchema?(fieldSchema: ISchema): Record; usePathOptions?(field: CollectionFieldOptions): any; schemaInitialize?(schema: ISchema, data: any): void; + hidden?: boolean; } diff --git a/packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/src/client/expression.tsx b/packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/src/client/expression.tsx index 1e9402488c..0b994670e4 100644 --- a/packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/src/client/expression.tsx +++ b/packages/plugins/@nocobase/plugin-workflow-dynamic-calculation/src/client/expression.tsx @@ -30,4 +30,5 @@ export class ExpressionFieldInterface extends CollectionFieldInterface { properties = { ...defaultProps, }; + hidden = true; }