From 0fcffdfc99a2d9dbe861347e1fa14f194fa67234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Fri, 28 Mar 2025 18:03:02 +0400 Subject: [PATCH] Truncate control name in sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Émile Ré --- .../organizations/frameworks/FrameworkView/ControlList.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/console/src/pages/organizations/frameworks/FrameworkView/ControlList.tsx b/apps/console/src/pages/organizations/frameworks/FrameworkView/ControlList.tsx index 68b849c96..3db769d50 100644 --- a/apps/console/src/pages/organizations/frameworks/FrameworkView/ControlList.tsx +++ b/apps/console/src/pages/organizations/frameworks/FrameworkView/ControlList.tsx @@ -3,6 +3,8 @@ import { ControlList_List$key } from "./__generated__/ControlList_List.graphql"; import { NavLink, useParams } from "react-router"; import { cn } from "@/lib/utils"; +const maxControlNameLength = 80; + export const controlListFragment = graphql` fragment ControlList_List on Framework { controls(first: 100, orderBy: { field: CREATED_AT, direction: ASC }) @@ -68,7 +70,9 @@ export function ControlList(props: ControlListProps) { isActive && "font-medium" )} > - {control.name} + {control.name.length > maxControlNameLength + ? `${control.name.slice(0, maxControlNameLength - 2)}…` + : control.name} );