File tree Expand file tree Collapse file tree 4 files changed +17
-6
lines changed
Expand file tree Collapse file tree 4 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,15 @@ import KeyIcon from "~/assets/icons/key.svg?react";
77type ActorCellProps = {
88 size ?: "large" | "small" ;
99 value : AuditRecordActor ;
10+ maxLength ?: number ;
1011} ;
1112
12- export default function ActorCell ( { size = "large" , value } : ActorCellProps ) {
13- const name = getAuditLogActorName ( value ) ;
13+ export default function ActorCell ( {
14+ size = "large" ,
15+ value,
16+ maxLength,
17+ } : ActorCellProps ) {
18+ const name = getAuditLogActorName ( value , maxLength ) ;
1419 const isSystem = value . type === ACTOR_TYPES . SYSTEM ;
1520 const isServiceUser = value . type === ACTOR_TYPES . SERVICE_USER ;
1621
Original file line number Diff line number Diff line change 2626
2727.name-column {
2828 padding-left : var (--rs-space-7 );
29- max-width : 200 px ;
29+ max-width : 240 px ;
3030}
3131.org-column {
3232 max-width : 200px ;
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ export default function SidePanelDetails({
6969 href = { `/users/${ actor ?. id } ` }
7070 label = "Actor"
7171 data-test-id = "actor-link" >
72- < ActorCell value = { actor ! } size = "small" />
72+ < ActorCell value = { actor ! } size = "small" maxLength = { 12 } />
7373 </ SidepanelListItemLink >
7474 < SidepanelListItemLink
7575 isLink = { ! ! orgId && ! isZeroUUID ( orgId ) }
Original file line number Diff line number Diff line change @@ -5,12 +5,18 @@ import {
55 AuditRecordSchema ,
66} from "@raystack/proton/frontier" ;
77
8- export const getAuditLogActorName = ( actor ?: AuditRecordActor ) => {
8+ export const getAuditLogActorName = (
9+ actor ?: AuditRecordActor ,
10+ maxLength = 15 ,
11+ ) => {
912 if ( actor ?. type === ACTOR_TYPES . SYSTEM ) return "System" ;
1013
1114 const name = actor ?. title || actor ?. name || "-" ;
1215
13- if ( actor ?. metadata ?. [ "is_super_user" ] === true ) return name + " (Admin)" ;
16+ if ( actor ?. metadata ?. [ "is_super_user" ] === true )
17+ if ( name . length > maxLength )
18+ return name . substring ( 0 , maxLength ) + "..." + " (Admin)" ;
19+ else return name + " (Admin)" ;
1420
1521 return name ;
1622} ;
You can’t perform that action at this time.
0 commit comments