From 343c05c3abf52cf70310d49b88f540fc2da5cf2f Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Tue, 6 Feb 2024 19:52:38 +0800 Subject: [PATCH] fix: add table label ellipsis to avoid much long label #23 --- .../components/website/MetricsTable.tsx | 1 + src/server/tests/seeds/website.ts | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/client/components/website/MetricsTable.tsx b/src/client/components/website/MetricsTable.tsx index 1e8c931..d5ff813 100644 --- a/src/client/components/website/MetricsTable.tsx +++ b/src/client/components/website/MetricsTable.tsx @@ -41,6 +41,7 @@ export const MetricsTable: React.FC = React.memo((props) => { { title: title[0], dataIndex: 'x', + ellipsis: true, render: (val) => val ?? (None), }, { diff --git a/src/server/tests/seeds/website.ts b/src/server/tests/seeds/website.ts index 9d041ce..b764951 100644 --- a/src/server/tests/seeds/website.ts +++ b/src/server/tests/seeds/website.ts @@ -96,7 +96,24 @@ async function createSessionEvent(session: WebsiteSession) { data: Array.from({ length: faker.number.int({ max: 20 }) }).map(() => ({ sessionId: session.id, websiteId: session.websiteId, - urlPath: '/', + urlPath: [ + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.directoryPath(), + faker.system.filePath(), + ].join(''), // generate long path createdAt: faker.date.between({ from: session.createdAt, to: endDate,