From 92d0eab0cc65f3b3dd472fa2d8ca09b8dd55bce7 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Wed, 29 Mar 2023 16:54:59 +0800 Subject: [PATCH] fix(audit-logs): Add ellipsis feature to table columns (#1603) * fix: text is so long * feat: don't need rowSelection --- .../audit-logs/src/client/components/AuditLogsField.tsx | 8 ++++++-- .../audit-logs/src/client/components/AuditLogsValue.tsx | 4 ++-- .../client/components/AuditLogsViewActionInitializer.tsx | 4 +--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/plugins/audit-logs/src/client/components/AuditLogsField.tsx b/packages/plugins/audit-logs/src/client/components/AuditLogsField.tsx index 5d5705588..2735ba06d 100644 --- a/packages/plugins/audit-logs/src/client/components/AuditLogsField.tsx +++ b/packages/plugins/audit-logs/src/client/components/AuditLogsField.tsx @@ -1,4 +1,4 @@ -import { useCompile } from '@nocobase/client'; +import { EllipsisWithTooltip, useCompile } from '@nocobase/client'; import React from 'react'; import { observer, useField } from '@formily/react'; @@ -8,5 +8,9 @@ export const AuditLogsField = observer(() => { if (!field.value) { return null; } - return
{field.value?.uiSchema?.title ? compile(field.value?.uiSchema?.title) : field.value.name}
; + return ( + + {field.value?.uiSchema?.title ? compile(field.value?.uiSchema?.title) : field.value.name} + + ); }); diff --git a/packages/plugins/audit-logs/src/client/components/AuditLogsValue.tsx b/packages/plugins/audit-logs/src/client/components/AuditLogsValue.tsx index b604b210f..fe4f51c25 100644 --- a/packages/plugins/audit-logs/src/client/components/AuditLogsValue.tsx +++ b/packages/plugins/audit-logs/src/client/components/AuditLogsValue.tsx @@ -1,4 +1,4 @@ -import { FormProvider, SchemaComponent, useRecord } from '@nocobase/client'; +import { EllipsisWithTooltip, FormProvider, SchemaComponent, useRecord } from '@nocobase/client'; import React from 'react'; import { observer, useField } from '@formily/react'; @@ -19,5 +19,5 @@ export const AuditLogsValue = observer(() => { ); } - return
{field.value ? JSON.stringify(field.value) : null}
; + return {field.value ? JSON.stringify(field.value) : null}; }); diff --git a/packages/plugins/audit-logs/src/client/components/AuditLogsViewActionInitializer.tsx b/packages/plugins/audit-logs/src/client/components/AuditLogsViewActionInitializer.tsx index 702255093..675843c59 100644 --- a/packages/plugins/audit-logs/src/client/components/AuditLogsViewActionInitializer.tsx +++ b/packages/plugins/audit-logs/src/client/components/AuditLogsViewActionInitializer.tsx @@ -255,9 +255,7 @@ export const AuditLogsViewActionInitializer = (props) => { type: 'array', 'x-component': 'TableV2', 'x-component-props': { - rowSelection: { - type: 'checkbox', - }, + rowSelection: false, useProps: '{{ useTableFieldProps }}', }, properties: {