From 32a79f0bc4360deecc0fd4effa733517bd50e7c1 Mon Sep 17 00:00:00 2001 From: phanphan Date: Fri, 24 May 2024 13:20:59 +0700 Subject: [PATCH 1/2] refactor --- cope2n-fe/src/pages/reviews2/index.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/cope2n-fe/src/pages/reviews2/index.tsx b/cope2n-fe/src/pages/reviews2/index.tsx index fca81ca..b99421b 100644 --- a/cope2n-fe/src/pages/reviews2/index.tsx +++ b/cope2n-fe/src/pages/reviews2/index.tsx @@ -60,7 +60,6 @@ const ReviewPage = () => { const [selectedFileData, setSelectedFileData] = useState(null); const [selectedFileDataSource, setSelectedFileDataSource] = useState({}); const [selectedFileName, setSelectedFileName] = useState(null); - const [disableUpdateFileBtn, setDisableUpdateFileBtn] = useState(false); // Default date range: 1 month ago to today const [filterDateRange, setFilterDateRange] = useState(['', '']); @@ -114,6 +113,7 @@ const ReviewPage = () => { updateSelectedFileDataSource(fileDataSource); let reason = fileDataSource.Reason; let solution = fileDataSource['Counter Measures']; + console.log("🚀 ~ setAndLoadSelectedFile ~ solution:", reason, solution) if (!reason) { setReason(null); @@ -155,8 +155,6 @@ const ReviewPage = () => { filterAccuracy, ) .then((data) => { - // setRequests(data?.subscription_requests); - // setHasNextRequest(data?.subscription_requests.length > 1); setTotalPages(data?.page?.total_requests); setHasNextRequest(requestIndex < data?.page?.total_requests); const requestData = fetchRequest( @@ -206,8 +204,6 @@ const ReviewPage = () => { filterAccuracy, ).then((data) => { setTotalPages(data?.page?.total_requests); - // setRequests(data?.subscription_requests); - // setHasNextRequest(data?.subscription_requests.length > 1); setHasNextRequest(1 < data?.page?.total_requests); const firstRequest = fetchRequest( data?.subscription_requests[0].RequestID, @@ -234,7 +230,6 @@ const ReviewPage = () => { filterAccuracy, ).then((data) => { setTotalPages(data?.page?.total_requests); - // setRequests(data?.subscription_requests); setHasNextRequest(1 < data?.page?.total_requests); const firstRequest = fetchRequest( data?.subscription_requests[0].RequestID, @@ -628,6 +623,7 @@ const ReviewPage = () => { type='primary' shape='default' size='middle' + disabled={currentRequest && currentRequest['Is Reviewed'] } style={{ minWidth: '120px', alignSelf: 'flex-end' }} onClick={handleConfirmReview} > From 2c713b85ac09ba945eb6152cad4ea1ee4a52fd76 Mon Sep 17 00:00:00 2001 From: phanphan Date: Fri, 24 May 2024 13:22:24 +0700 Subject: [PATCH 2/2] remove console --- cope2n-fe/src/pages/reviews2/index.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/cope2n-fe/src/pages/reviews2/index.tsx b/cope2n-fe/src/pages/reviews2/index.tsx index b99421b..b654982 100644 --- a/cope2n-fe/src/pages/reviews2/index.tsx +++ b/cope2n-fe/src/pages/reviews2/index.tsx @@ -113,7 +113,6 @@ const ReviewPage = () => { updateSelectedFileDataSource(fileDataSource); let reason = fileDataSource.Reason; let solution = fileDataSource['Counter Measures']; - console.log("🚀 ~ setAndLoadSelectedFile ~ solution:", reason, solution) if (!reason) { setReason(null);