RANGER-4536: Audit UI updates to support datasets and projects
Signed-off-by: Madhan Neethiraj <madhan@apache.org>
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 141b06c..3106853 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
@@ -708,6 +708,40 @@
disableResizing: true,
disableSortBy: true,
getResizerProps: () => {}
+ },
+ {
+ Header: "Datasets",
+ accessor: "datasets",
+ Cell: (rawValue) => {
+ let Datasets = [];
+ if (!isEmpty(rawValue.value)) {
+ Datasets = JSON.parse(rawValue.value).sort();
+ } else {
+ return <div className="text-center">--</div>;
+ }
+ return <AccessMoreLess Data={Datasets} />;
+ },
+ width: 140,
+ disableResizing: true,
+ disableSortBy: true,
+ getResizerProps: () => {}
+ },
+ {
+ Header: "Projects",
+ accessor: "projects",
+ Cell: (rawValue) => {
+ let Projects = [];
+ if (!isEmpty(rawValue.value)) {
+ Projects = JSON.parse(rawValue.value).sort();
+ } else {
+ return <div className="text-center">--</div>;
+ }
+ return <AccessMoreLess Data={Projects} />;
+ },
+ width: 140,
+ disableResizing: true,
+ disableSortBy: true,
+ getResizerProps: () => {}
}
],
[]
@@ -890,6 +924,18 @@
type: "text"
},
{
+ category: "datasets",
+ label: "Datasets",
+ urlLabel: "datasets",
+ type: "text"
+ },
+ {
+ category: "projects",
+ label: "Projects",
+ urlLabel: "projects",
+ type: "text"
+ },
+ {
category: "requestUser",
label: "User",
urlLabel: "user",
@@ -954,6 +1000,8 @@
<br /> <b> Exclude User :</b> Name of User.
<br /> <b> Application :</b> Application.
<br /> <b> Tags :</b> Tag Name.
+ <br /> <b> Datasets:</b> Dataset Name.
+ <br /> <b> Projects:</b> Project Name.
<br /> <b> Permission :</b> Permission
</p>
}
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 e4c814d..7781ebd 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
@@ -52,7 +52,9 @@
eventCount,
zoneName,
requestData,
- tags
+ tags,
+ datasets,
+ projects
} = data;
const copyText = (val) => {
@@ -218,6 +220,26 @@
: "--"}
</td>
</tr>
+ <tr>
+ <td>Datasets</td>
+ <td>
+ {!isEmpty(datasets)
+ ? JSON.parse(datasets)
+ .sort()
+ .join(", ")
+ : "--"}
+ </td>
+ </tr>
+ <tr>
+ <td>Projects</td>
+ <td>
+ {!isEmpty(projects)
+ ? JSON.parse(projects)
+ .sort()
+ .join(", ")
+ : "--"}
+ </td>
+ </tr>
</tbody>
</Table>
);