Skip to content

Commit

Permalink
remove unuse code and add more comments fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
binggaofw committed Jul 17, 2023
1 parent adeb210 commit b6d89ba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
8 changes: 7 additions & 1 deletion src/frontend/src/components/public/PIASubHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,16 @@ function PIASubHeader({
]);

useEffect(() => {
// If all reviews are acknowledged
// the current status is in final review and
// MPO too has acknowledged, the PIA can progress to complete.
let reviewProgramAreaDone = false;
if (pia?.status === PiaStatuses.FINAL_REVIEW) {
const selectedRoles = pia?.review?.programArea?.selectedRoles || [];
const reviewProgramAreaDone = selectedRoles.every((role) => pia?.review?.programArea?.reviews?.[role]?.isAcknowledged === true)
reviewProgramAreaDone = selectedRoles.every(
(role) =>
pia?.review?.programArea?.reviews?.[role]?.isAcknowledged === true,
);
}

if (
Expand Down
5 changes: 2 additions & 3 deletions src/frontend/src/pages/PIAForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,10 @@ const PIAFormPage = () => {
}
} else if (buttonValue === 'completePIA') {
const updatedPia = await upsertAndUpdatePia({
// here not sure what status for this one, need to discuss

status: PiaStatuses.COMPLETE,
});
// need to revisit this part, what happen when complete PIA
// need to revisit this part, current route to pia_intake tab
// when complete PIA story done, will go to Complete PIA list page
if (updatedPia?.id) {
navigate(
buildDynamicPath(routes.PIA_VIEW, {
Expand Down
10 changes: 0 additions & 10 deletions src/frontend/src/utils/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,16 +416,6 @@ export const statusList = (pia: IPiaForm | null): StatusList => {
cancelLabel: 'Cancel',
},
},
{
status: 'COMPLETE',
modal: {
title: 'Submit for Completion',
description:
'Once CPO has confirmed all necessary ministry reviews have occurred and data has been uploaded to the PID, PIA will move to “Complete” status.',
confirmLabel: 'Yes, submit',
cancelLabel: 'Cancel',
},
},
],
},
},
Expand Down

0 comments on commit b6d89ba

Please sign in to comment.