This is an automated email from the ASF dual-hosted git repository. madhan pushed a commit to branch ranger-2.6 in repository https://gitbox.apache.org/repos/asf/ranger.git
commit 0b3d90c264be565ceefcd06c9977c8de27520b26 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]> (cherry picked from commit 92f3466879873f1abff0b8239a7b48ae3b1d7682) --- .../src/views/AuditEvent/AccessLogs.jsx | 67 +++++++++++++++++++--- .../src/views/AuditEvent/AccessLogsTable.jsx | 4 +- 2 files changed, 60 insertions(+), 11 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 ff6807520..39d7bcf48 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 9b489510a..af5f89ab1 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 @@ -181,11 +181,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>
