Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
pawarprasad123 merged PR #708: URL: https://github.com/apache/atlas/pull/708 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5249192580 https://github.com/user-attachments/assets/12f6042a-3712-4c7f-919e-3d9c49f05203"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5245266923 https://github.com/user-attachments/assets/60c51c76-48fa-4160-a2b4-c925167ef46c"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5244997146 https://github.com/user-attachments/assets/481c1e78-3683-43e6-ae19-1f8c81f00399"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3749622416
##
dashboardv2/public/css/scss/drawer.scss:
##
@@ -0,0 +1,414 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+
+// http://www.apache.org/licenses/LICENSE-2.0
+
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+/* Purge Summary Wrapper to match React */
+.purge-summary-wrapper {
+background-color: #fafafa;
+border: 1px solid #e0e0e0;
+border-radius: 8px;
+padding: 16px;
+margin-top: 15px;
+margin-bottom: 20px;
+}
+
+.purge-run-id-row {
+margin-bottom: 15px;
+font-size: 14px;
+font-weight: 500;
+}
+
+.purge-run-id-copy {
+cursor: pointer;
+color: #6b7280;
+margin-left: 5px;
+}
+
+.purge-warning-alert {
+padding: 10px;
+margin-bottom: 15px;
+}
+
+.audit-type-details-title {
+word-break: break-word;
+}
+
+.purge-summary-container {
+display: flex;
+gap: 15px;
+margin-top: 15px;
+flex-wrap: wrap;
+}
+
+.purge-summary-card {
+flex: 1;
+min-width: 120px;
+padding: 12px;
+border-radius: 8px;
+border: 1px solid rgba(0, 0, 0, 0.08);
+background-color: #fafafa;
+box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
+display: flex;
+flex-direction: column;
+align-items: flex-start;
+justify-content: flex-start;
+text-align: left;
+cursor: default;
+
+&.clickable {
+cursor: pointer;
+transition: box-shadow 0.2s;
+
+&:hover {
+box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
+}
+}
+
+&.card-legacy {
+max-width: 250px;
+}
+
+.card-label {
+font-size: 11px;
+color: #6b7280;
+/* textSecondary */
+margin-bottom: 4px;
+font-weight: 600;
+text-transform: uppercase;
+letter-spacing: 0.5px;
+}
+
+.card-value {
+font-size: 24px;
+font-weight: 500;
+color: #111827;
+/* textPrimary */
+}
+
+&.card-blue {
+background-color: #eff6ff;
+border-color: #bfdbfe;
+
+.card-label,
+.card-value {
+color: #1d4ed8;
+}
+}
+
+&.card-green {
+background-color: #f0fdf4;
+border-color: #bbf7d0;
+
+.card-label,
+.card-value {
+color: #15803d;
+}
+}
+
+&.card-red.has-count {
+background-color: #fef2f2;
+border-color: #fecaca;
+
+.card-label,
+.card-value {
+color: #d32f2f;
+}
+}
+
+&.card-amber.has-count {
+background-color: #fffbeb;
+border-color: #fef08a;
+
+.card-label,
+.card-value {
+color: #ed6c02;
+}
+}
+}
+
+/* Drawer styles */
+.drawer-overlay {
+position: fixed;
+top: 0;
+left: 0;
+width: 100%;
+height: 100%;
+background-color: rgba(0, 0, 0, 0.4);
+z-index: 1030;
+display: none;
+&.open { display: block; }
+}
+
+.drawer-panel {
+position: fixed;
+top: 0;
+right: -400px;
+width: 400px;
+height: 100vh;
+overflow: hidden;
+background-color: #fff;
+box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
+z-index: 1038;
+transition: right 0.3s ease;
+display: flex;
+flex-direction: column;
+
+&.open { right: 0; }
+
+.drawer-header {
+display: flex;
+justify-content: space-between;
+align-items: center;
+padding: 8px 12px;
+flex-shrink: 0;
+h4 { margin: 0; font-size: 16px; font-weight: 600; }
+.close-drawer { cursor: pointer; font-size: 18px; color: #6b7280;
&:hover { color: #111827; } }
+}
+
+.drawer-body {
+flex: 1;
+min-height: 0;
+overflow: hidden;
+display: flex;
+flex-direction: column;
+
+.drawer-search, .drawer-run-id {
+margin: 4px 12px;
+flex-shrink: 0;
+}
+
+.drawer-search {
+padding-bottom: 8px;
+.search-input-wrapper {
+position: relative;
+i { position: absolute; left: 12px; top: 10px; color: #9ca3af;
}
+input {
+width: 100%;
+padding: 8px 12px 8px 32px;
+border: none;
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5241235254 https://github.com/user-attachments/assets/e35f0c33-261e-4702-8825-ec149846c27c"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5241083350 https://github.com/user-attachments/assets/09aeba51-3bca-4d3a-afd2-cfc362e5ddf5"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3749631845
##
dashboardv2/public/js/views/audit/AdminAuditTableLayoutView.js:
##
@@ -349,25 +392,95 @@ define(['require',
};
this.showModal(modalData);
},
-displayPurgeAndImportAudits: function(obj) {
+displayPurgeAndImportAudits: function (obj) {
+var adminTypDetails = Enums.category[obj.operation];
+
+// If it's a new JSON string (from new API changes), parse it.
+var isJson = false;
+var summaryData = {};
+try {
+summaryData = typeof obj.results === 'string' ?
JSON.parse(obj.results) : obj.results;
+if (summaryData && typeof summaryData === 'object' &&
!Array.isArray(summaryData)) {
+isJson = true;
+}
+} catch (e) {
+isJson = false;
+}
+
+if (isJson) {
+// It's the new Summary format
+var runId = summaryData.runId || obj.model.get('runId') ||
'';
+var paramsArr = obj.model.get('params') ?
obj.model.get('params').split(',') : [];
+
+var reqCount = summaryData.requestedCount !== undefined ?
summaryData.requestedCount : paramsArr.length;
+var purgedCount = summaryData.purgedCount !== undefined ?
summaryData.purgedCount : 0;
+var purgedDependenciesCount =
summaryData.purgedDependenciesCount || 0;
+var totalPurgedCount = purgedCount +
purgedDependenciesCount;
+var failedCount = summaryData.failedCount || 0;
+var failedDependenciesCount =
summaryData.failedDependenciesCount || 0;
+var totalFailedCount = failedCount +
failedDependenciesCount;
+var skippedCount = summaryData.skippedCount || 0;
+
+var html = '';
+
+html += '';
+if (runId) {
+html += 'Run
Id: ' + _.escape(runId) + ' ';
+}
+
+html += '';
+
+// Requested
+html += '';
+html += 'REQUESTED' + reqCount + '';
+
+// Total Purged
+var rawResults = obj.originalResults ? obj.originalResults
: (typeof obj.results === 'string' ? obj.results : JSON.stringify(obj.results));
+html += ' 0 ?
'data-id="drawerSummaryTrigger" data-type="purged" data-runid="' +
_.escape(runId) + '" data-guid="' + _.escape(obj.model.get('guid')) + '"
data-results="' + _.escape(rawResults) + '"' : '') + '>';
+html += 'PURGED' + totalPurgedCount + '';
+
+// Failed
+html += '';
+html += 'FAILED' + totalFailedCount + '';
+
+// Skipped
+html += '';
Review Comment:
Fixed! I have updated the Classic UI logic to perfectly match React. The
Failed and Skipped tooltips now dynamically render a neutral message when the
count is 0, and only show the failure/skipped logs instruction when the count
is > 0 or executionFailed is true.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3749629676
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,716 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, Pagination,
PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+const controller = new AbortController();
+
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' },
+signal: controller.signal
+ })
+.then(res => {
+ if (!controller.signal.aborted) {
+if (res.data && !Array.isArray(res.data) && typeof res.data ===
'object') {
+ setSummaryData(res.data);
+}
+ }
+})
+.catch(err => {
+ if (!controller.signal.aborted && err.name !== 'AbortError' &&
err.name !== 'CanceledError') {
+console.error("Failed to fetch purge summary", err);
+ }
+})
+.finally(() => {
+ if (!controller.signal.aborted) {
+setLoadingSummary(false);
+ }
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3749624223
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,716 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, Pagination,
PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+const controller = new AbortController();
+
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' },
+signal: controller.signal
+ })
+.then(res => {
+ if (!controller.signal.aborted) {
+if (res.data && !Array.isArray(res.data) && typeof res.data ===
'object') {
+ setSummaryData(res.data);
+}
+ }
+})
+.catch(err => {
+ if (!controller.signal.aborted && err.name !== 'AbortError' &&
err.name !== 'CanceledError') {
+console.error("Failed to fetch purge summary", err);
+ }
+})
+.finally(() => {
+ if (!controller.signal.aborted) {
+setLoadingSummary(false);
+ }
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
pawarprasad123 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3747356837
##
dashboardv2/public/js/views/audit/AdminAuditTableLayoutView.js:
##
@@ -349,25 +392,95 @@ define(['require',
};
this.showModal(modalData);
},
-displayPurgeAndImportAudits: function(obj) {
+displayPurgeAndImportAudits: function (obj) {
+var adminTypDetails = Enums.category[obj.operation];
+
+// If it's a new JSON string (from new API changes), parse it.
+var isJson = false;
+var summaryData = {};
+try {
+summaryData = typeof obj.results === 'string' ?
JSON.parse(obj.results) : obj.results;
+if (summaryData && typeof summaryData === 'object' &&
!Array.isArray(summaryData)) {
+isJson = true;
+}
+} catch (e) {
+isJson = false;
+}
+
+if (isJson) {
+// It's the new Summary format
+var runId = summaryData.runId || obj.model.get('runId') ||
'';
+var paramsArr = obj.model.get('params') ?
obj.model.get('params').split(',') : [];
+
+var reqCount = summaryData.requestedCount !== undefined ?
summaryData.requestedCount : paramsArr.length;
+var purgedCount = summaryData.purgedCount !== undefined ?
summaryData.purgedCount : 0;
+var purgedDependenciesCount =
summaryData.purgedDependenciesCount || 0;
+var totalPurgedCount = purgedCount +
purgedDependenciesCount;
+var failedCount = summaryData.failedCount || 0;
+var failedDependenciesCount =
summaryData.failedDependenciesCount || 0;
+var totalFailedCount = failedCount +
failedDependenciesCount;
+var skippedCount = summaryData.skippedCount || 0;
+
+var html = '';
+
+html += '';
+if (runId) {
+html += 'Run
Id: ' + _.escape(runId) + ' ';
+}
+
+html += '';
+
+// Requested
+html += '';
+html += 'REQUESTED' + reqCount + '';
+
+// Total Purged
+var rawResults = obj.originalResults ? obj.originalResults
: (typeof obj.results === 'string' ? obj.results : JSON.stringify(obj.results));
+html += ' 0 ?
'data-id="drawerSummaryTrigger" data-type="purged" data-runid="' +
_.escape(runId) + '" data-guid="' + _.escape(obj.model.get('guid')) + '"
data-results="' + _.escape(rawResults) + '"' : '') + '>';
+html += 'PURGED' + totalPurgedCount + '';
+
+// Failed
+html += '';
+html += 'FAILED' + totalFailedCount + '';
+
+// Skipped
+html += '';
Review Comment:
title="Some entities failed to purge. Please check purgefailure.log for
details."
Blocker — Classic UI tooltips always show failure message (even when count =
0)
Failed/Skipped card title is always the failure message, even when count is
0. Please match React behavior: show a neutral tooltip when count is 0, failure
message only when count > 0 or executionFailed.
##
dashboardv2/public/js/views/audit/AdminAuditTableLayoutView.js:
##
@@ -164,18 +166,41 @@ define(['require',
that.getAdminCollection();
}
},
-getAdminCollection: function(option) {
+getAdminCollection: function (option) {
var that = this,
auditFilters =
CommonViewFunction.attributeFilter.generateAPIObj(that.ruleUrl);
+
+if (that.isFilters && auditFilters && (auditFilters.criterion
|| auditFilters.attributeName)) {
+var hasRunId = false;
+var checkRunId = function (crit) {
+if (!crit) return;
+if (crit.attributeName === 'runId') hasRunId = true;
+if (crit.criterion && Array.isArray(crit.criterion)) {
+crit.criterion.forEach(checkRunId);
+}
+};
+checkRunId(auditFilters);
+
+if (hasRunId) {
+auditFilters = {
+"condition": "AND",
+"criterion": [
+auditFilters,
+{ "attributeName": "auditRowKind", "operator":
"eq", "attributeValue": "SUMMARY" }
Review Comment:
Blocker — Classic UI does not remove existing auditRowKind before
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5236635711 https://github.com/user-attachments/assets/41676a7c-4ffd-4d36-9b68-77ac5fcf5ad8"; /> https://github.com/user-attachments/assets/1f6b343d-f555-4fbf-9e6c-5e2e549fc9b1"; /> https://github.com/user-attachments/assets/4d4fe083-8f19-4b1b-be4d-85fdd6655726"; /> https://github.com/user-attachments/assets/a4f00b47-886a-4f0c-820c-d8086ae5ef2a"; /> https://github.com/user-attachments/assets/534fed5c-5fba-4787-ac05-7db22750c56b"; /> https://github.com/user-attachments/assets/af0bb514-7ea7-44f9-be8a-cc5ccdbc6721"; /> https://github.com/user-attachments/assets/28720c75-5a6e-42e9-bb50-815733a99974"; /> https://github.com/user-attachments/assets/ebe4ad01-f66d-4e02-b7ad-a5fd01de8e68"; /> https://github.com/user-attachments/assets/2b7fe385-d3ce-4fb8-9d75-4352d43d7c94"; /> https://github.com/user-attachments/assets/9d8441a0-ba87-47bc-9ac5-06248a9beac5"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3746939232
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,715 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, Pagination,
PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+const controller = new AbortController();
+
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' },
+signal: controller.signal
+ })
+.then(res => {
+ if (!controller.signal.aborted) {
+if (res.data && !Array.isArray(res.data) && typeof res.data ===
'object') {
+ setSummaryData(res.data);
+}
+ }
+})
+.catch(err => {
+ if (!controller.signal.aborted && err.name !== 'AbortError' &&
err.name !== 'CanceledError') {
+console.error("Failed to fetch purge summary", err);
+ }
+})
+.finally(() => {
+ if (!controller.signal.aborted) {
+setLoadingSummary(false);
+ }
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3746934901
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,715 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, Pagination,
PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+const controller = new AbortController();
+
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' },
+signal: controller.signal
+ })
+.then(res => {
+ if (!controller.signal.aborted) {
+if (res.data && !Array.isArray(res.data) && typeof res.data ===
'object') {
+ setSummaryData(res.data);
+}
+ }
+})
+.catch(err => {
+ if (!controller.signal.aborted && err.name !== 'AbortError' &&
err.name !== 'CanceledError') {
+console.error("Failed to fetch purge summary", err);
+ }
+})
+.finally(() => {
+ if (!controller.signal.aborted) {
+setLoadingSummary(false);
+ }
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3746923801
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,715 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, Pagination,
PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+const controller = new AbortController();
+
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' },
+signal: controller.signal
+ })
+.then(res => {
+ if (!controller.signal.aborted) {
+if (res.data && !Array.isArray(res.data) && typeof res.data ===
'object') {
+ setSummaryData(res.data);
+}
+ }
+})
+.catch(err => {
+ if (!controller.signal.aborted && err.name !== 'AbortError' &&
err.name !== 'CanceledError') {
+console.error("Failed to fetch purge summary", err);
+ }
+})
+.finally(() => {
+ if (!controller.signal.aborted) {
+setLoadingSummary(false);
+ }
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3746922951
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,715 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, Pagination,
PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+const controller = new AbortController();
+
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' },
+signal: controller.signal
+ })
+.then(res => {
+ if (!controller.signal.aborted) {
+if (res.data && !Array.isArray(res.data) && typeof res.data ===
'object') {
+ setSummaryData(res.data);
+}
+ }
+})
+.catch(err => {
+ if (!controller.signal.aborted && err.name !== 'AbortError' &&
err.name !== 'CanceledError') {
+console.error("Failed to fetch purge summary", err);
+ }
+})
+.finally(() => {
+ if (!controller.signal.aborted) {
+setLoadingSummary(false);
+ }
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
pawarprasad123 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3746549338
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,715 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, Pagination,
PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+const controller = new AbortController();
+
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' },
+signal: controller.signal
+ })
+.then(res => {
+ if (!controller.signal.aborted) {
+if (res.data && !Array.isArray(res.data) && typeof res.data ===
'object') {
+ setSummaryData(res.data);
+}
+ }
+})
+.catch(err => {
+ if (!controller.signal.aborted && err.name !== 'AbortError' &&
err.name !== 'CanceledError') {
+console.error("Failed to fetch purge summary", err);
+ }
+})
+.finally(() => {
+ if (!controller.signal.aborted) {
+setLoadingSummary(false);
+ }
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3736982136
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,730 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, CircularProgress,
Pagination, PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [loadingPurgedApi, setLoadingPurgedApi] = useState(false);
+ const [purgedTotalCount, setPurgedTotalCount] = useState(0);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+ const drawerScrollTimerRef = useRef |
null>(null);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
Review Comment:
I have added an AbortController and a cleanup return function to the
useEffect hook. This ensures that any pending fetch requests are properly
aborted and state updates are blocked if the component unmounts or the guid
dependency changes, preventing any stale state issues
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3736980358
##
dashboard/src/hooks/__tests__/useVirtualization.test.ts:
##
@@ -0,0 +1,89 @@
+/*
Review Comment:
Fixed! The PR description has been updated to accurately reflect that we are
now exclusively using client-side pagination since the server-side endpoint is
no longer supported for new-format purge audits
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,730 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, CircularProgress,
Pagination, PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [loadingPurgedApi, setLoadingPurgedApi] = useState(false);
+ const [purgedTotalCount, setPurgedTotalCount] = useState(0);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+ const drawerScrollTimerRef = useRef |
null>(null);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' }
+ })
+.then(res => {
+ if (res.data && typeof res.data === 'object') {
+setSummaryData(res.data);
+ }
+})
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3736977488
##
dashboard/src/views/Administrator/Audits/__tests__/AuditResults.test.tsx:
##
@@ -795,4 +820,656 @@ describe('AuditResults Component', () => {
expect(typographies.length).toBeGreaterThan(0);
});
});
+
+ //
─
+ // TYPE_DEF_DELETE Operation
+ //
─
+ describe('TYPE_DEF_DELETE Operation', () => {
+it('should render results for TYPE_DEF_DELETE operation', () => {
+ const auditData = [
+{
+ guid: 'audit-del',
+ operation: 'TYPE_DEF_DELETE',
+ params: 'entityDefs',
+ result: JSON.stringify({
+entityDefs: [{ name: 'DeletedEntity', category: 'entityDefs' }]
+ })
+}
+ ];
+ render();
+
+ expect(screen.getByText('DeletedEntity')).toBeInTheDocument();
+ expect(screen.getByText(/TYPE_DEF_DELETE/)).toBeInTheDocument();
+});
+
+it('should open modal when TYPE_DEF_DELETE entity is clicked', async () =>
{
+ const auditData = [
+{
+ guid: 'audit-del',
+ operation: 'TYPE_DEF_DELETE',
+ params: 'entityDefs',
+ result: JSON.stringify({
+entityDefs: [{ name: 'DeletedEntity', category: 'entityDefs' }]
+ })
+}
+ ];
+ render();
+
+ fireEvent.click(screen.getByText('DeletedEntity'));
+ await waitFor(() => {
+expect(screen.getByTestId('custom-modal')).toBeInTheDocument();
+ });
+});
+ });
+
+ //
─
+ // PURGE — JSON Summary Format (new structured format)
+ //
─
+ describe('PURGE Operations — JSON Summary format', () => {
+const summaryResult = JSON.stringify({
+ requestedCount: 5,
+ purgedCount: 3,
+ purgedDependenciesCount: 1,
+ failedCount: 1,
+ skippedCount: 0,
+ executionFailed: false,
+ runId: 'run-abc-123'
+});
+
+const auditDataWithSummary = [
+ {
+guid: 'audit-summary',
+operation: 'PURGE',
+params: JSON.stringify(['g1', 'g2', 'g3', 'g4', 'g5']),
+result: summaryResult
+ }
+];
+
+it('should display purgedCount from JSON summary', () => {
+ render();
+ // Total Purged = purgedCount(3) + purgedDependenciesCount(1) = 4
+ expect(screen.getByText('4')).toBeInTheDocument();
+});
+
+it('should display failedCount from JSON summary', () => {
+ render();
+ expect(screen.getByText('Failed')).toBeInTheDocument();
+ expect(screen.getByText('1')).toBeInTheDocument();
+});
+
+it('should display skippedCount from JSON summary', () => {
+ render();
+ expect(screen.getByText('Skipped')).toBeInTheDocument();
+ expect(screen.getByText('0')).toBeInTheDocument();
+});
+
+it('should display Requested count from JSON summary', () => {
+ render();
+ expect(screen.getByText('Requested')).toBeInTheDocument();
+ expect(screen.getByText('5')).toBeInTheDocument();
+});
+
+it('should show executionFailed alert when failedCount > 0', () => {
+ const failedResult = JSON.stringify({
+requestedCount: 3, purgedCount: 1, purgedDependenciesCount: 0,
+failedCount: 2, skippedCount: 0, executionFailed: true, runId: 'test'
+ });
+ const auditData = [{ guid: 'a-fail', operation: 'PURGE', params: '',
result: failedResult }];
+
+ render();
+
+
+});
+
+it('should NOT show executionFailed alert when failedCount is 0', () => {
+ const okResult = JSON.stringify({
+requestedCount: 3, purgedCount: 3, purgedDependenciesCount: 0,
+failedCount: 0, skippedCount: 0, executionFailed: false, runId: 'test'
+ });
+ const auditData = [{ guid: 'a-ok', operation: 'PURGE', params: '',
result: okResult }];
+
+ render();
+
+ expect(screen.queryByText('Partial success')).not.toBeInTheDocument();
+});
+
+it('should show PURGE with JSON array result (not object)', () => {
+ const arrayResult = JSON.stringify(['arr-guid-1', 'arr-guid-2']);
+ const auditData = [{ guid: 'a-arr', operation: 'PURGE', params: '',
result: arrayResult }];
+
+ render();
+
+ // Open drawer
+ fireEvent.click(screen.getAllByText('PURGED')[0]);
+
+ expect(screen.getByText('arr-guid-1')).toBeInTheDocument();
+ expect(screen.getByText('arr-guid-2')).toBeInTheDocument();
+});
+
+it('should handle PURGE with JSON params array', () => {
+ const auditData = [
+{
+ guid: 'a-params-arr',
+ operation: 'PURGE',
+ params: JSON.stringify(['req-guid-1', 'req-guid-2']),
+ result:
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3736978966
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,730 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, CircularProgress,
Pagination, PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [loadingPurgedApi, setLoadingPurgedApi] = useState(false);
+ const [purgedTotalCount, setPurgedTotalCount] = useState(0);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+ const drawerScrollTimerRef = useRef |
null>(null);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' }
+ })
+.then(res => {
+ if (res.data && typeof res.data === 'object') {
+setSummaryData(res.data);
+ }
+})
+.catch(err => {
+ console.error("Failed to fetch purge summary", err);
+})
+.finally(() => {
+ setLoadingSummary(false);
+});
+}
+ }, [isPurgeOperation, summaryGuid]);
+
+ let summary: Record = summaryData || {};
+ let requestedEntitiesList: string[] = [];
+ let
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3736976198
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,730 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, CircularProgress,
Pagination, PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [loadingPurgedApi, setLoadingPurgedApi] = useState(false);
+ const [purgedTotalCount, setPurgedTotalCount] = useState(0);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+ const drawerScrollTimerRef = useRef |
null>(null);
Review Comment:
Removed purgedTotalCount, drawerScrollTimerRef, and all associated unused
props from both the main component state and the drawer interface since they
were no longer needed
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,730 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, CircularProgress,
Pagination, PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3736974843
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,227 +15,730 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Box, Drawer,
IconButton, Stack, Tooltip, TextField, InputAdornment, CircularProgress,
Pagination, PaginationItem, Skeleton } from "@mui/material";
+import KeyboardDoubleArrowLeftIcon from
"@mui/icons-material/KeyboardDoubleArrowLeft";
+import KeyboardDoubleArrowRightIcon from
"@mui/icons-material/KeyboardDoubleArrowRight";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from "@hooks/useVirtualization";
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState, useEffect } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from "@components/muiComponents";
+import { fetchApi } from "@api/apiMethods/fetchApi";
+import "./AuditResults.scss";
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(25);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('25');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [loadingPurgedApi, setLoadingPurgedApi] = useState(false);
+ const [purgedTotalCount, setPurgedTotalCount] = useState(0);
+ const [summaryData, setSummaryData] = useState |
null>(null);
+ const [loadingSummary, setLoadingSummary] = useState(false);
+ const drawerScrollTimerRef = useRef |
null>(null);
+
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ const summaryGuid = auditObj?.guid ?? row.original.guid;
+
+ useEffect(() => {
+if (isPurgeOperation && summaryGuid) {
+ setLoadingSummary(true);
+ fetchApi(`/api/atlas/admin/audit/${summaryGuid}/summary`, {
+method: "GET",
+headers: { 'Accept': 'application/json', 'Content-Type':
'application/json' }
+ })
+.then(res => {
+ if (res.data && typeof res.data === 'object') {
+setSummaryData(res.data);
+ }
+})
+.catch(err => {
+ console.error("Failed to fetch purge summary", err);
+})
+.finally(() => {
+ setLoadingSummary(false);
+});
+}
+ }, [isPurgeOperation, summaryGuid]);
+
+ let summary: Record = summaryData || {};
+ let requestedEntitiesList: string[] = [];
+ let
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5216521064 https://github.com/user-attachments/assets/007f0c73-d8d1-4035-972e-826304728c99"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5216238862 https://github.com/user-attachments/assets/fd51034c-e153-45e8-a410-31807d607db5"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5216005505 https://github.com/user-attachments/assets/49e79033-abb7-496e-aff8-6f1c9925a50e"; /> https://github.com/user-attachments/assets/f60dcc55-72fb-4bbf-acfc-188cf0d5a492"; /> https://github.com/user-attachments/assets/ca3a1789-d83c-4776-9fe9-030bc3672ba6"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708: URL: https://github.com/apache/atlas/pull/708#discussion_r3688426729 ## dashboardv2/public/js/templates/audit/DrawerView_tmpl.html: ## @@ -0,0 +1,58 @@ + + Review Comment: Added appropriate aria-labels and accessibility roles to the classic UI drawer controls -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3688425875
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,130 +15,228 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Divider, Alert,
AlertTitle, Box, Drawer, IconButton, Stack, Tooltip, TextField, InputAdornment,
CircularProgress } from "@mui/material";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from '@hooks/useVirtualization';
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from '@components/muiComponents';
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
+
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(10);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('10');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [loadingPurgedApi, setLoadingPurgedApi] = useState(false);
+ const [purgedTotalCount, setPurgedTotalCount] = useState(0);
+ const drawerScrollTimerRef = useRef |
null>(null);
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ let summary: Record = {};
+ let requestedEntitiesList: string[] = [];
+ let legacyPurgedList: string[] = [];
+
+ if (isPurgeOperation) {
+try {
+ const parsed = typeof result === "string" ? JSON.parse(result) : result;
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
+summary = (parsed as Record).summary
+ ? (parsed as Record).summary as Record
+ : parsed as Record;
+ } else if (Array.isArray(parsed)) {
+legacyPurgedList = (parsed as unknown[]).map((item) =>
+ typeof item === "string" ? item : (item as { guid?: string }).guid
|| String(item)
+);
+ }
+} catch (e) {
Review Comment:
Renamed the unused catch block variable to _e to resolve the warning
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,130 +15,228 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Divider, Alert,
AlertTitle, Box, Drawer, IconButton, Stack, Tooltip, TextField, InputAdornment,
CircularProgress }
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3688424886
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -153,89 +251,494 @@ const AuditResults = ({ componentProps, row }: any) => {
>
{name}
-
-
- );
-})}
-
-
+ }
+/>
+
+);
+ })}
+
+ );
+})}
+
+ ) : operation === "IMPORT" || operation === "EXPORT" ? (
+
+ ) : !isPurgeOperation ? (
+No Results Found
+ ) : null}
+
+ {/* Purge Audit View */}
+ {isPurgeOperation ? (
+
+
+
+{/* Run Id Header with Copy Action */}
+{runId !== 'N/A' && (
+
+
+ Run Id: {runId}
+
+
+ {
+ if (navigator.clipboard) {
+navigator.clipboard.writeText(runId);
+ } else {
+const textField = document.createElement('textarea');
+textField.innerText = runId;
+document.body.appendChild(textField);
+textField.select();
+document.execCommand('copy');
+textField.remove();
+ }
+ setCopiedRunId(true);
+ setTimeout(() => setCopiedRunId(false), 2000);
+}}
+sx={{ p: 0.5 }}
+ >
+
+
+
+
+)}
+
+{/* 4 Cards Grid: Requested, Total Purged, Failed (Display Only),
Skipped (Display Only) */}
+
+ {/* 1. Clickable Requested Card */}
+ {isSummaryRow && (
+
+ {
+ setActivePurgeView(PurgeActiveView.REQUESTED);
+ setDrawerPage(1);
+ setScrollTop(0);
+}}
+sx={{
+ p: 1.5,
+ borderRadius: 2,
+ backgroundColor: '#eff6ff',
+ border: '1px solid #bfdbfe',
+ transition: 'all 0.2s ease-in-out',
+ cursor: 'pointer',
+ boxShadow: '0 1px 3px rgba(0,0,0,0.04)',
+ '&:hover': {
+transform: 'translateY(-2px)',
+boxShadow: '0 4px 12px rgba(59,130,246,0.15)',
+borderColor: '#60a5fa'
+ }
+}}
+ >
+
+ Requested
+
+
+ {requestedCount}
+
+
+
+ )}
+
+ {/* 2. Clickable Total Purged Card */}
+
+ 0 ? 'pointer' : 'default',
+boxShadow: '0 1px 3px rgba(0,0,0,0.04)',
+'&:hover': totalPurgedCount > 0 ? {
+ transform: 'translateY(-2px)',
+ boxShadow: '0 4px 12px rgba(34,197,94,0.15)',
+ borderColor: '#4ade80'
+} : {}
+ }}
+>
+
+{isSummaryRow ? 'Total Purged' : 'Purged Entities'}
+
+
+{totalPurgedCount}
+
+
-
- )}
-
- ) : (
-operation != "PURGE" &&
-operation != "AUTO_PURGE" &&
-operation != "IMPORT" &&
-operation != "EXPORT" && No Results Found
- )}
-
- {(operation == "PURGE" || operation == "AUTO_PURGE") &&
!isEmpty(resultObj) ? (
-<>
- {`${category[operation]}`}
-
-{resultObj.map((obj: string) => {
- return (
-
- {
- setOpenPurgeModal(true);
- setCurrentPurgeResultObj(obj);
+
+ {/* 3 & 4. Display-Only Failed and Skipped Cards */}
+ {isSummaryRow && (
+<>
+
+ 0 || executionFailed
+ ? "Some entities failed to purge. Please check
/logs/purgefailure.log for details."
+ : "No failed entities during this purge operation."
+ }
+ arrow
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
pawarprasad123 commented on code in PR #708:
URL: https://github.com/apache/atlas/pull/708#discussion_r3682870034
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -15,130 +15,228 @@
* limitations under the License.
*/
-import { Grid, Link, List, ListItem, ListItemText, Typography } from
"@mui/material";
-import { auditAction, category } from "@utils/Enum";
+import { Grid, Link, List, ListItem, ListItemText, Typography, Divider, Alert,
AlertTitle, Box, Drawer, IconButton, Stack, Tooltip, TextField, InputAdornment,
CircularProgress } from "@mui/material";
+import ContentCopyIcon from "@mui/icons-material/ContentCopy";
+import SearchIcon from "@mui/icons-material/Search";
+import { auditAction, category, AuditOperation, PurgeActiveView } from
"@utils/Enum";
import { isEmpty, jsonParse } from "@utils/Utils";
+import { useVirtualization } from '@hooks/useVirtualization';
import CustomModal from "@components/Modal";
import TypeDefAuditDetailModal from "@components/TypeDefAuditDetailModal";
-import { useState } from "react";
-import { Item } from "@utils/Muiutils";
+import { useRef, useState } from "react";
import AuditsTab from "@views/DetailPage/EntityDetailTabs/AuditsTab";
import ImportExportAudits from "./ImportExportAudits";
+import { LightTooltip } from '@components/muiComponents';
-const AuditResults = ({ componentProps, row }: any) => {
+interface AuditEntry {
+ guid: string;
+ operation: string;
+ params?: string;
+ result?: string;
+ runId?: string;
+ [key: string]: unknown;
+}
+
+interface AuditResultsProps {
+ componentProps?: {
+auditData?: AuditEntry[];
+ };
+ row: {
+original: {
+ guid: string;
+ runId?: string;
+ [key: string]: unknown;
+};
+ };
+}
+
+const AuditResults = ({ componentProps, row }: AuditResultsProps) => {
const { auditData } = componentProps || {};
const [openModal, setOpenModal] = useState(false);
const [openPurgeModal, setOpenPurgeModal] = useState(false);
- const [currentResultObj, setCurrentObj] = useState({});
- const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState("");
+ const [currentResultObj, setCurrentObj] = useState |
undefined>();
+ // Stores the guid of the clicked purged entity
+ const [currentPurgeResultObj, setCurrentPurgeResultObj] = useState();
+ const [activePurgeView, setActivePurgeView] =
useState(PurgeActiveView.NONE);
+ const [drawerSearchText, setDrawerSearchText] = useState('');
+ const [drawerPage, setDrawerPage] = useState(1);
+ const [drawerPageSize, setDrawerPageSize] = useState(10);
+ const [drawerPageSizeInput, setDrawerPageSizeInput] = useState('10');
+ const [scrollTop, setScrollTop] = useState(0);
+ const [copiedRunId, setCopiedRunId] = useState(false);
+ const [purgedApiGuids, setPurgedApiGuids] = useState([]);
+ const [loadingPurgedApi, setLoadingPurgedApi] = useState(false);
+ const [purgedTotalCount, setPurgedTotalCount] = useState(0);
+ const drawerScrollTimerRef = useRef |
null>(null);
+
const handleCloseModal = () => {
setOpenModal(false);
};
const handleClosePurgeModal = () => {
setOpenPurgeModal(false);
};
- const auditObj = !isEmpty(auditData)
-? auditData.find((obj: { guid: string }) => obj.guid == row.original.guid)
-: {};
- const { operation, params, result } = auditObj;
+ const auditObj: AuditEntry | undefined = !isEmpty(auditData)
+? (auditData as AuditEntry[]).find((obj) => obj.guid === row.original.guid)
+: undefined;
+
+ const operation = auditObj?.operation ?? '';
+ const params = auditObj?.params;
+ const result = auditObj?.result;
+
+ let isPurgeOperation = operation === AuditOperation.PURGE || operation ===
AuditOperation.AUTO_PURGE;
+ let summary: Record = {};
+ let requestedEntitiesList: string[] = [];
+ let legacyPurgedList: string[] = [];
+
+ if (isPurgeOperation) {
+try {
+ const parsed = typeof result === "string" ? JSON.parse(result) : result;
+ if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
+summary = (parsed as Record).summary
+ ? (parsed as Record).summary as Record
+ : parsed as Record;
+ } else if (Array.isArray(parsed)) {
+legacyPurgedList = (parsed as unknown[]).map((item) =>
+ typeof item === "string" ? item : (item as { guid?: string }).guid
|| String(item)
+);
+ }
+} catch (e) {
Review Comment:
Unused catch variables — rename to _e
##
dashboard/src/views/Administrator/Audits/AuditResults.tsx:
##
@@ -153,89 +251,494 @@ const AuditResults = ({ componentProps, row }: any) => {
>
{name}
-
-
- );
-})}
-
-
+ }
+/>
+
+
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5127488319 https://github.com/user-attachments/assets/89ac3586-3274-4b22-8ab2-2a8cf376331f"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5127318213 https://github.com/user-attachments/assets/7c92c171-9cb5-4fc3-9810-e46ec8c9030f"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
Re: [PR] ATLAS-5350: Atlas UI: Enhance Purge Audit Results UI [atlas]
Brijesh619 commented on PR #708: URL: https://github.com/apache/atlas/pull/708#issuecomment-5127071603 Atlas React UI https://github.com/user-attachments/assets/aa7b18b2-b56e-4b4a-a728-8fcf446c35db"; /> https://github.com/user-attachments/assets/1c061479-8a24-4276-8c9c-536bc84417ce"; /> https://github.com/user-attachments/assets/4983f6ac-25fe-41f3-bf5a-56bbb4dcb52e"; /> https://github.com/user-attachments/assets/0186ff35-cfa3-41cb-a85c-27319d81228e"; /> https://github.com/user-attachments/assets/032fce3a-8c29-429c-8349-e52d84060b07"; /> Atlas Classic UI https://github.com/user-attachments/assets/461c52e3-7bb2-4354-8197-540a2eff1fac"; /> https://github.com/user-attachments/assets/814ec376-bf04-42b0-a0d4-6e03ac7be9cb"; /> https://github.com/user-attachments/assets/0cd893aa-2b65-471a-ab12-03d8b3d8904b"; /> https://github.com/user-attachments/assets/b68d91b5-6bf3-419b-863d-3aa354642df9"; /> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
