From e9ca88bc193dbaada85d7c16021c99e0285317dd Mon Sep 17 00:00:00 2001 From: Richard Qi Date: Mon, 22 Jul 2024 15:20:51 -0700 Subject: [PATCH 1/2] Fix observation #1 for FOIMOD-#3300 --- web/src/components/FOI/Home/MCFPersonal.js | 11 +++++++++-- web/src/components/FOI/Home/utils.js | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/web/src/components/FOI/Home/MCFPersonal.js b/web/src/components/FOI/Home/MCFPersonal.js index 51c22911d..85a5e1ef8 100644 --- a/web/src/components/FOI/Home/MCFPersonal.js +++ b/web/src/components/FOI/Home/MCFPersonal.js @@ -221,6 +221,8 @@ const MCFPersonal = ({ }; const handleClose = () => { + setSearchValue(""); + setFileTypeSearchValue(""); setCurrentEditRecord(); setCurPersonalAttributes({ person: "", @@ -234,6 +236,11 @@ const MCFPersonal = ({ setOpenContextPopup(false); }; + const reset = () => { + setSearchValue(""); + setFileTypeSearchValue(""); + }; + const handleFileTypeSearchKeywordChange = (keyword) => { setFileTypeSearchValue(keyword); } @@ -583,13 +590,13 @@ const MCFPersonal = ({ diff --git a/web/src/components/FOI/Home/utils.js b/web/src/components/FOI/Home/utils.js index dbcf9974e..0edbb2f05 100644 --- a/web/src/components/FOI/Home/utils.js +++ b/web/src/components/FOI/Home/utils.js @@ -106,7 +106,7 @@ export const sortDocList = (fullDocList, currentDoc, sortedDocList, requestInfo) if (childDocList.length == 1) { sortedChildDocList = childDocList; } else { - if (requestInfo.bcgovcode === "MCF") { + if (requestInfo?.bcgovcode === "MCF") { sortedChildDocList = childDocList.sort(CFDSorting); } else { sortedChildDocList = childDocList.sort(docSorting); From 847eccb2d776b6a4a75ea6b739b7821e0666409c Mon Sep 17 00:00:00 2001 From: Richard Qi Date: Mon, 22 Jul 2024 15:33:09 -0700 Subject: [PATCH 2/2] fix observatoin #1 FOIMOD-3300 --- web/src/components/FOI/Home/MCFPersonal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/FOI/Home/MCFPersonal.js b/web/src/components/FOI/Home/MCFPersonal.js index 85a5e1ef8..357ad47e7 100644 --- a/web/src/components/FOI/Home/MCFPersonal.js +++ b/web/src/components/FOI/Home/MCFPersonal.js @@ -166,7 +166,7 @@ const MCFPersonal = ({ _sectionArray.map((section) => { if(_keyword && section.name.toLowerCase().includes(_keyword.toLowerCase())) { newSectionArray.push(section); - } else if(section.divisionid === _selectedSectionValue) { + } else if(section.name === _selectedSectionValue) { newSectionArray.unshift(section); } });