Skip to content

Commit 0b3d90c

Browse files
dhavaljrajparamneethiraj
authored andcommitted
RANGER-5006: User name column in Ranger audit not rendering properly when it is of larger length
Signed-off-by: Ramesh Mani <rmani@apache.org> (cherry picked from commit 92f3466)
1 parent 76115bd commit 0b3d90c

File tree

2 files changed

+60
-11
lines changed

2 files changed

+60
-11
lines changed

security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,15 @@ function Access() {
495495
{
496496
Header: "Application",
497497
accessor: "agentId",
498+
Cell: (rawValue) => {
499+
if (!isEmpty(rawValue?.value)) {
500+
return (
501+
<div className="text-truncate" title={rawValue.value}>
502+
{rawValue.value}
503+
</div>
504+
);
505+
} else return "--";
506+
},
498507
width: 100,
499508
disableResizing: true,
500509
disableSortBy: true,
@@ -503,6 +512,15 @@ function Access() {
503512
{
504513
Header: "User",
505514
accessor: "requestUser",
515+
Cell: (rawValue) => {
516+
if (!isEmpty(rawValue?.value)) {
517+
return (
518+
<div className="text-truncate" title={rawValue.value}>
519+
{rawValue.value}
520+
</div>
521+
);
522+
} else return "--";
523+
},
506524
width: 120,
507525
disableResizing: true,
508526
getResizerProps: () => {}
@@ -542,7 +560,10 @@ function Access() {
542560

543561
if (!isUndefined(resourcePath) || !isUndefined(requestData)) {
544562
let resourcePathText = isEmpty(resourcePath) ? "--" : resourcePath;
545-
let resourceTypeText = isEmpty(resourceType) || resourceType=="@null" ? "--" : resourceType;
563+
let resourceTypeText =
564+
isEmpty(resourceType) || resourceType == "@null"
565+
? "--"
566+
: resourceType;
546567
return (
547568
<React.Fragment>
548569
<div className="clearfix d-flex flex-nowrap m-0">
@@ -569,7 +590,13 @@ function Access() {
569590
Header: "Access Type",
570591
accessor: "accessType",
571592
Cell: (rawValue) => {
572-
return <p className="text-truncate">{rawValue.value}</p>;
593+
if (!isEmpty(rawValue?.value)) {
594+
return (
595+
<div className="text-truncate" title={rawValue.value}>
596+
{rawValue.value}
597+
</div>
598+
);
599+
} else return "--";
573600
},
574601
width: 130,
575602
disableResizing: true,
@@ -581,11 +608,7 @@ function Access() {
581608
Cell: (rawValue) => {
582609
return (
583610
<h6>
584-
<Badge
585-
bg="info"
586-
title={rawValue.value}
587-
className="text-truncate mw-100"
588-
>
611+
<Badge bg="info" title={rawValue.value} className="text-truncate">
589612
{rawValue.value}
590613
</Badge>
591614
</h6>
@@ -620,6 +643,15 @@ function Access() {
620643
{
621644
Header: "Access Enforcer",
622645
accessor: "aclEnforcer",
646+
Cell: (rawValue) => {
647+
if (!isEmpty(rawValue?.value)) {
648+
return (
649+
<div className="text-truncate" title={rawValue.value}>
650+
{rawValue.value}
651+
</div>
652+
);
653+
} else return "--";
654+
},
623655
width: 120,
624656
disableResizing: true,
625657
getResizerProps: () => {}
@@ -644,6 +676,15 @@ function Access() {
644676
{
645677
Header: "Client IP",
646678
accessor: "clientIP",
679+
Cell: (rawValue) => {
680+
if (!isEmpty(rawValue?.value)) {
681+
return (
682+
<div className="text-truncate" title={rawValue.value}>
683+
{rawValue.value}
684+
</div>
685+
);
686+
} else return "--";
687+
},
647688
width: 110,
648689
disableResizing: true,
649690
getResizerProps: () => {}
@@ -656,7 +697,11 @@ function Access() {
656697
disableSortBy: true,
657698
Cell: (rawValue) => {
658699
if (!isEmpty(rawValue?.value)) {
659-
return <div className="text-truncate">{rawValue.value}</div>;
700+
return (
701+
<div className="text-truncate" title={rawValue.value}>
702+
{rawValue.value}
703+
</div>
704+
);
660705
} else {
661706
return <div className="text-center">--</div>;
662707
}
@@ -670,7 +715,11 @@ function Access() {
670715
if (!isEmpty(rawValue?.value)) {
671716
return (
672717
<h6>
673-
<Badge bg="dark" className="text-truncate mw-100">
718+
<Badge
719+
bg="dark"
720+
className="text-truncate"
721+
title={rawValue.value}
722+
>
674723
{rawValue.value}
675724
</Badge>
676725
</h6>

security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,11 @@ export const AccessLogsTable = ({ data = {} }) => {
181181
</td>
182182
</tr>
183183
<tr>
184-
<td className="text-nowrap">Access Enforcer</td>
184+
<td>Access Enforcer</td>
185185
<td>{!isEmpty(aclEnforcer) ? aclEnforcer : "--"}</td>
186186
</tr>
187187
<tr>
188-
<td className="text-nowrap">Agent Host Name </td>
188+
<td>Agent Host Name </td>
189189
<td>{!isEmpty(agentHost) ? agentHost : "--"}</td>
190190
</tr>
191191
<tr>

0 commit comments

Comments
 (0)