Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR to test-rook for fixing observation #1 in FOIMOD-3300 #1061

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions web/src/components/FOI/Home/MCFPersonal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down Expand Up @@ -221,6 +221,8 @@ const MCFPersonal = ({
};

const handleClose = () => {
setSearchValue("");
setFileTypeSearchValue("");
setCurrentEditRecord();
setCurPersonalAttributes({
person: "",
Expand All @@ -234,6 +236,11 @@ const MCFPersonal = ({
setOpenContextPopup(false);
};

const reset = () => {
setSearchValue("");
setFileTypeSearchValue("");
};

const handleFileTypeSearchKeywordChange = (keyword) => {
setFileTypeSearchValue(keyword);
}
Expand Down Expand Up @@ -583,13 +590,13 @@ const MCFPersonal = ({
<DialogActions>
<button
className={`btn-bottom btn-save btn`}
onClick={() => updatePersonalAttributes()}
onClick={() => {updatePersonalAttributes();reset();}}
>
Update for Individual
</button>
<button
className={`btn-bottom btn-save btn`}
onClick={() => updatePersonalAttributes(true)}
onClick={() => {updatePersonalAttributes(true);reset();}}
>
Update for All
</button>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/FOI/Home/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down