-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MDS-6232] IRT/Application statuses (#3317)
* make database changes for application and irt status tables * whole lot of FE changes, mostly related to showing the status * deal with the render errors on the MS IRT form, consolidate some useEffects with equal dep arrays, take out +=/-= that made no sense * FE & BE issues with IRT * issues with mma, fix typos, update test * update BE tests * remove commented out code * remove typo from snaps * update status_code change when submitting from a Changes Requested Status. --------- Co-authored-by: Mat.Busby <[email protected]>
- Loading branch information
1 parent
817518f
commit 2aac6e5
Showing
57 changed files
with
1,149 additions
and
1,674 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
migrations/sql/V2024.11.15.10.17__irt_and_application_status_code_updates.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
ALTER TABLE major_mine_application_status_code DROP COLUMN display_order; | ||
|
||
INSERT INTO information_requirements_table_status_code ( | ||
information_requirements_table_status_code, | ||
description, | ||
create_user, | ||
update_user | ||
) VALUES | ||
('OHD', 'On Hold', 'system-mds', 'system-mds'), | ||
('WDN', 'Withdrawn', 'system-mds', 'system-mds'), | ||
('COM', 'Complete', 'system-mds', 'system-mds') | ||
; | ||
|
||
INSERT INTO major_mine_application_status_code ( | ||
major_mine_application_status_code, | ||
description, | ||
create_user, | ||
update_user | ||
) VALUES | ||
('OHD', 'On Hold', 'system-mds', 'system-mds'), | ||
('WDN', 'Withdrawn', 'system-mds', 'system-mds'), | ||
('COM', 'Complete', 'system-mds', 'system-mds') | ||
; | ||
|
||
UPDATE information_requirements_table SET status_code = 'COM' WHERE status_code = 'APV'; | ||
UPDATE major_mine_application SET status_code = 'COM' WHERE status_code = 'APV'; | ||
|
||
DELETE FROM information_requirements_table_status_code WHERE information_requirements_table_status_code = 'APV'; | ||
DELETE FROM major_mine_application_status_code WHERE major_mine_application_status_code = 'APV'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
services/common/src/components/projects/ProjectCallout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import React, { FC, ReactElement } from "react"; | ||
import { CALLOUT_SEVERITY, MAJOR_MINE_APPLICATION_AND_IRT_STATUS_CODE_CODES, PROJECT_STATUS_CODES, PROJECT_SUMMARY_STATUS_CODES, SystemFlagEnum } from "@mds/common/constants"; | ||
import Callout from "../common/Callout"; | ||
import { Alert, Col, Row } from "antd"; | ||
import { useSelector } from "react-redux"; | ||
import { getSystemFlag } from "@mds/common/redux/selectors/authenticationSelectors"; | ||
|
||
export const statusTextHash = { | ||
"DFT": { severity: CALLOUT_SEVERITY.warning, message: "This project step has not been formally submitted by the proponent through MineSpace. MineSpace users can update text fields and add documents." }, | ||
"WDN": { severity: CALLOUT_SEVERITY.danger, message: "MineSpace users cannot update text fields or update documents. Contact the Ministry to change this status." }, | ||
"COM": { severity: CALLOUT_SEVERITY.success, message: "The review of this project is completed. MineSpace users cannot update text fields or update documents." }, | ||
"OHD": { severity: CALLOUT_SEVERITY.danger, message: "This project is on hold. MineSpace users cannot update text fields or update documents. Contact the Ministry to change this status." }, | ||
"SUB": { severity: CALLOUT_SEVERITY.success, message: "This project has been formally submitted by the proponent through MineSpace. MineSpace users can update documents only." }, | ||
"UNR": { severity: CALLOUT_SEVERITY.warning, message: "This project is being actively reviewed. MineSpace users cannot update text fields or update documents." }, | ||
"CHR": { severity: CALLOUT_SEVERITY.warning, message: "This project requires changes by the mine. MineSpace users can update text fields and update documents. Note: when the MineSpace user resubmits at this step the project status will be changed to under review." }, | ||
"ASG": { severity: CALLOUT_SEVERITY.success, message: "This project has been formally submitted by the proponent through MineSpace. MineSpace users can update documents only." } | ||
} | ||
|
||
interface ProjectCalloutProps { | ||
status_code: PROJECT_STATUS_CODES | MAJOR_MINE_APPLICATION_AND_IRT_STATUS_CODE_CODES; | ||
formField?: ReactElement; | ||
} | ||
|
||
const ProjectCallout: FC<ProjectCalloutProps> = ({ | ||
status_code, | ||
formField }) => { | ||
|
||
const systemFlag = useSelector(getSystemFlag); | ||
const isCore = systemFlag === SystemFlagEnum.core; | ||
const calloutParams = statusTextHash[status_code ?? "DFT"]; | ||
let title = PROJECT_SUMMARY_STATUS_CODES[status_code ?? "DFT"]; | ||
const hasFormField = Boolean(formField); | ||
const colProps = hasFormField ? { xs: 24, md: 18 } : { span: 24 }; | ||
|
||
if (status_code === PROJECT_STATUS_CODES.ASG && !isCore) { | ||
title = PROJECT_SUMMARY_STATUS_CODES.SUB; | ||
} | ||
|
||
return ( | ||
isCore ? | ||
<Alert | ||
message={title} | ||
description={ | ||
<Row justify="space-between"> | ||
<Col {...colProps}> | ||
{calloutParams.message} | ||
</Col> | ||
{hasFormField && | ||
<Col xs={24} md={6}> | ||
{formField} | ||
</Col> | ||
} | ||
</Row> | ||
} | ||
showIcon | ||
type="warning" | ||
className="margin-large--bottom" | ||
/> | ||
: <Callout | ||
message={calloutParams.message} | ||
title={title} | ||
severity={calloutParams.severity} | ||
|
||
/>); | ||
}; | ||
|
||
export default ProjectCallout; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 5 additions & 2 deletions
7
services/common/src/interfaces/projects/majorMinesApplication.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
import { IMajorMinesApplicationDocument } from "@mds/common/index"; | ||
import { IMajorMinesApplicationDocument, MAJOR_MINE_APPLICATION_AND_IRT_STATUS_CODE_CODES } from "@mds/common/index"; | ||
|
||
export interface IMajorMinesApplication { | ||
major_mine_application_id: number; | ||
major_mine_application_guid: string; | ||
project_guid: string; | ||
status_code: string; | ||
status_code: MAJOR_MINE_APPLICATION_AND_IRT_STATUS_CODE_CODES; | ||
documents: IMajorMinesApplicationDocument[]; | ||
update_user: string; | ||
update_timestamp: string; | ||
create_user: string; | ||
create_timestamp: string; | ||
primary_documents: IMajorMinesApplicationDocument[]; | ||
spatial_documents: IMajorMinesApplicationDocument[]; | ||
supporting_documents: IMajorMinesApplicationDocument[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.