From 951bec05e05ce6caf8476f3cbd0d198f74c4e9fb Mon Sep 17 00:00:00 2001 From: Aparna Date: Tue, 27 Aug 2024 22:27:51 -0700 Subject: [PATCH] FOIMOD-2982-Comments Tab - Type of Comments (Peer Review, Internal, General)-New Observation fixes Updates on Observation 9,11,12, 17 --- .../customComponents/Comments/InputField.js | 2 +- .../FOI/customComponents/Comments/index.js | 7 +- .../FOI/customComponents/ConfirmModal.js | 1 + forms-flow-web/src/helper/FOI/helper.js | 14 +++- .../models/FOIRawRequestComments.py | 70 +++++++++++++++--- .../request_api/models/FOIRequestComments.py | 73 ++++++++++++++++--- .../request_api/services/commentservice.py | 18 +++++ .../notifications/notificationuser.py | 26 ++++--- .../request_api/services/watcherservice.py | 1 + 9 files changed, 175 insertions(+), 37 deletions(-) diff --git a/forms-flow-web/src/components/FOI/customComponents/Comments/InputField.js b/forms-flow-web/src/components/FOI/customComponents/Comments/InputField.js index ca5da27b2..23a53e8cc 100644 --- a/forms-flow-web/src/components/FOI/customComponents/Comments/InputField.js +++ b/forms-flow-web/src/components/FOI/customComponents/Comments/InputField.js @@ -301,7 +301,7 @@ const InputField = ({ cancellor, parentId, child, inputvalue, edit, main, add, f ) : null} - {edit && + {edit && !parentId && { let _commentsbyCategory = filterCommentFn() - let _filteredcomments = filterkeyValue === "" ? _commentsbyCategory : _commentsbyCategory.filter(c => c.text.toLowerCase().indexOf(filterkeyValue.toLowerCase()) > -1) + let _filteredcomments = filterkeyValue === "" ? _commentsbyCategory : (_commentsbyCategory.filter(c => c.text.toLowerCase().indexOf(filterkeyValue.toLowerCase()) > -1 + || getCommentTypeFromId(commentTypes, c.commentTypeId)?.indexOf(filterkeyValue.toLowerCase()) > -1)) let filteredcomments = filterkeyinCommentsandReplies(_commentsbyCategory,_filteredcomments) setcomments(filteredcomments) }, [filterValue,commentsArray ,filterkeyValue]) let restrictedReqTaglist = useSelector((state) => state.foiRequests.restrictedReqTaglist); - // console.log("!!ministryAssignedToList:",ministryAssignedToList) - // console.log("!!iaoassignedToList:",iaoassignedToList) const filterCommentFn = () => { if(parseInt(filterValue) === -1){ diff --git a/forms-flow-web/src/components/FOI/customComponents/ConfirmModal.js b/forms-flow-web/src/components/FOI/customComponents/ConfirmModal.js index f81befa18..cda94911d 100644 --- a/forms-flow-web/src/components/FOI/customComponents/ConfirmModal.js +++ b/forms-flow-web/src/components/FOI/customComponents/ConfirmModal.js @@ -71,6 +71,7 @@ const ConfirmModal= ({