This is an automated email from the ASF dual-hosted git repository.

rmani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new 92f346687 RANGER-5006: User name column in Ranger audit not rendering 
properly when it is of larger length
92f346687 is described below

commit 92f3466879873f1abff0b8239a7b48ae3b1d7682
Author: Dhaval Rajpara <[email protected]>
AuthorDate: Mon Nov 25 17:48:31 2024 +0530

    RANGER-5006: User name column in Ranger audit not rendering properly when 
it is of larger length
    
    Signed-off-by: Ramesh Mani <[email protected]>
---
 .../src/views/AuditEvent/AccessLogs.jsx            | 67 +++++++++++++++++++---
 .../src/views/AuditEvent/AccessLogsTable.jsx       | 16 ++----
 2 files changed, 62 insertions(+), 21 deletions(-)

diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
index 30263cfac..9af635448 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogs.jsx
@@ -495,6 +495,15 @@ function Access() {
       {
         Header: "Application",
         accessor: "agentId",
+        Cell: (rawValue) => {
+          if (!isEmpty(rawValue?.value)) {
+            return (
+              <div className="text-truncate" title={rawValue.value}>
+                {rawValue.value}
+              </div>
+            );
+          } else return "--";
+        },
         width: 100,
         disableResizing: true,
         disableSortBy: true,
@@ -503,6 +512,15 @@ function Access() {
       {
         Header: "User",
         accessor: "requestUser",
+        Cell: (rawValue) => {
+          if (!isEmpty(rawValue?.value)) {
+            return (
+              <div className="text-truncate" title={rawValue.value}>
+                {rawValue.value}
+              </div>
+            );
+          } else return "--";
+        },
         width: 120,
         disableResizing: true,
         getResizerProps: () => {}
@@ -542,7 +560,10 @@ function Access() {
 
           if (!isUndefined(resourcePath) || !isUndefined(requestData)) {
             let resourcePathText = isEmpty(resourcePath) ? "--" : resourcePath;
-            let resourceTypeText = isEmpty(resourceType) || 
resourceType=="@null" ? "--" : resourceType;
+            let resourceTypeText =
+              isEmpty(resourceType) || resourceType == "@null"
+                ? "--"
+                : resourceType;
             return (
               <React.Fragment>
                 <div className="clearfix d-flex flex-nowrap m-0">
@@ -569,7 +590,13 @@ function Access() {
         Header: "Access Type",
         accessor: "accessType",
         Cell: (rawValue) => {
-          return <p className="text-truncate">{rawValue.value}</p>;
+          if (!isEmpty(rawValue?.value)) {
+            return (
+              <div className="text-truncate" title={rawValue.value}>
+                {rawValue.value}
+              </div>
+            );
+          } else return "--";
         },
         width: 130,
         disableResizing: true,
@@ -581,11 +608,7 @@ function Access() {
         Cell: (rawValue) => {
           return (
             <h6>
-              <Badge
-                bg="info"
-                title={rawValue.value}
-                className="text-truncate mw-100"
-              >
+              <Badge bg="info" title={rawValue.value} 
className="text-truncate">
                 {rawValue.value}
               </Badge>
             </h6>
@@ -620,6 +643,15 @@ function Access() {
       {
         Header: "Access Enforcer",
         accessor: "aclEnforcer",
+        Cell: (rawValue) => {
+          if (!isEmpty(rawValue?.value)) {
+            return (
+              <div className="text-truncate" title={rawValue.value}>
+                {rawValue.value}
+              </div>
+            );
+          } else return "--";
+        },
         width: 120,
         disableResizing: true,
         getResizerProps: () => {}
@@ -644,6 +676,15 @@ function Access() {
       {
         Header: "Client IP",
         accessor: "clientIP",
+        Cell: (rawValue) => {
+          if (!isEmpty(rawValue?.value)) {
+            return (
+              <div className="text-truncate" title={rawValue.value}>
+                {rawValue.value}
+              </div>
+            );
+          } else return "--";
+        },
         width: 110,
         disableResizing: true,
         getResizerProps: () => {}
@@ -656,7 +697,11 @@ function Access() {
         disableSortBy: true,
         Cell: (rawValue) => {
           if (!isEmpty(rawValue?.value)) {
-            return <div className="text-truncate">{rawValue.value}</div>;
+            return (
+              <div className="text-truncate" title={rawValue.value}>
+                {rawValue.value}
+              </div>
+            );
           } else {
             return <div className="text-center">--</div>;
           }
@@ -670,7 +715,11 @@ function Access() {
           if (!isEmpty(rawValue?.value)) {
             return (
               <h6>
-                <Badge bg="dark" className="text-truncate mw-100">
+                <Badge
+                  bg="dark"
+                  className="text-truncate"
+                  title={rawValue.value}
+                >
                   {rawValue.value}
                 </Badge>
               </h6>
diff --git 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
index 7057a5138..753a23df9 100644
--- 
a/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
+++ 
b/security-admin/src/main/webapp/react-webapp/src/views/AuditEvent/AccessLogsTable.jsx
@@ -183,11 +183,11 @@ export const AccessLogsTable = ({ data = {} }) => {
           </td>
         </tr>
         <tr>
-          <td className="text-nowrap">Access Enforcer</td>
+          <td>Access Enforcer</td>
           <td>{!isEmpty(aclEnforcer) ? aclEnforcer : "--"}</td>
         </tr>
         <tr>
-          <td className="text-nowrap">Agent Host Name </td>
+          <td>Agent Host Name </td>
           <td>{!isEmpty(agentHost) ? agentHost : "--"}</td>
         </tr>
         <tr>
@@ -222,21 +222,13 @@ export const AccessLogsTable = ({ data = {} }) => {
         <tr>
           <td>Datasets</td>
           <td>
-            {!isEmpty(datasets)
-              ? JSON.parse(datasets)
-                  .sort()
-                  .join(", ")
-              : "--"}
+            {!isEmpty(datasets) ? JSON.parse(datasets).sort().join(", ") : 
"--"}
           </td>
         </tr>
         <tr>
           <td>Projects</td>
           <td>
-            {!isEmpty(projects)
-              ? JSON.parse(projects)
-                  .sort()
-                  .join(", ")
-              : "--"}
+            {!isEmpty(projects) ? JSON.parse(projects).sort().join(", ") : 
"--"}
           </td>
         </tr>
       </tbody>

Reply via email to