diff --git a/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx b/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx index a776783bfa..5d1a7ca743 100644 --- a/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx +++ b/services/common/src/components/projectSummary/AuthorizationsInvolved.tsx @@ -51,9 +51,8 @@ import { Link } from "react-router-dom"; import { PROJECT_SUMMARY_DOCUMENT_TYPE_CODE_STATE, ENVIRONMENTAL_MANAGMENT_ACT, - MUNICIPAL_WASTEWATER_REGULATION_URL, - HAZARDOUS_WASTE_REGULATION_URL, - WASTE_DISCHARGE_AUTHORIZATIONS_URL, + WASTE_DISCHARGE_NEW_AUTHORIZATIONS_URL, + WASTE_DISCHARGE_AMENDMENT_AUTHORIZATIONS_URL, } from "../.."; import { SystemFlagEnum } from "@mds/common/constants/enums"; import { getSystemFlag } from "@mds/common/redux/selectors/authenticationSelectors"; @@ -585,17 +584,20 @@ export const AuthorizationsInvolved = () => { {authorization.description} {authorization.code === ENVIRONMENTAL_MANAGMENT_ACT && ( - For registration under the{" "} - - Municipal Wastewater Regulation - {" "} - and{" "} - - Hazardous Waste Regulation, + For registration under the Municipal Wastewater Regulation and Hazardous Waste + Regulation, please refer to the{" "} + + new authorization {" "} - please refer to the{" "} - - waste discharge authorization + or{" "} + + authorization amendment {" "} guideline. diff --git a/services/common/src/components/projectSummary/__snapshots__/AuthorizationsInvolved.spec.tsx.snap b/services/common/src/components/projectSummary/__snapshots__/AuthorizationsInvolved.spec.tsx.snap index 1f9caf1ea6..f2afefb64e 100644 --- a/services/common/src/components/projectSummary/__snapshots__/AuthorizationsInvolved.spec.tsx.snap +++ b/services/common/src/components/projectSummary/__snapshots__/AuthorizationsInvolved.spec.tsx.snap @@ -154,31 +154,22 @@ exports[`AuthorizationsInvolved renders properly 1`] = `
- For registration under the + For registration under the Municipal Wastewater Regulation and Hazardous Waste Regulation, please refer to the - Municipal Wastewater Regulation + new authorization - and + or - Hazardous Waste Regulation, - - - please refer to the - - - waste discharge authorization + authorization amendment guideline. diff --git a/services/common/src/constants/strings.tsx b/services/common/src/constants/strings.tsx index 59dc9f4a51..1bc972eebd 100755 --- a/services/common/src/constants/strings.tsx +++ b/services/common/src/constants/strings.tsx @@ -462,9 +462,7 @@ export const DISCHARGE_FACTOR_FORM_NEW = export const DISCHARGE_FACTOR_FORM_AMENDMENT = "https://www2.gov.bc.ca/assets/gov/environment/waste-management/waste-discharge-authorization/guides/forms/epd-ema-06_amend_discharge_factor_amendment_form.pdf"; -export const MUNICIPAL_WASTEWATER_REGULATION_URL = - "https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/87_2012"; -export const HAZARDOUS_WASTE_REGULATION_URL = - "https://www.bclaws.gov.bc.ca/civix/document/id/complete/statreg/63_88_00"; -export const WASTE_DISCHARGE_AUTHORIZATIONS_URL = - "https://www2.gov.bc.ca/gov/content/environment/waste-management/waste-discharge-authorization"; +export const WASTE_DISCHARGE_NEW_AUTHORIZATIONS_URL = + "https://www2.gov.bc.ca/gov/content/environment/waste-management/waste-discharge-authorization/apply"; +export const WASTE_DISCHARGE_AMENDMENT_AUTHORIZATIONS_URL = + "https://www2.gov.bc.ca/gov/content/environment/waste-management/waste-discharge-authorization/change"; diff --git a/services/core-web/common/utils/Validate.ts b/services/core-web/common/utils/Validate.ts index 3cfbb5a7df..6a525fc2ec 100644 --- a/services/core-web/common/utils/Validate.ts +++ b/services/core-web/common/utils/Validate.ts @@ -346,3 +346,8 @@ export const validateIfApplicationTypeCorrespondsToPermitNumber = ( } return undefined; }; + +export const assessedLiabilityNegativeWarning = (value) => + positiveNumber(value) + ? "A negative value will decrease the current assessed liability" + : undefined; diff --git a/services/core-web/src/components/Forms/PermitAmendmentForm.js b/services/core-web/src/components/Forms/PermitAmendmentForm.js index 8c4053d944..d76c450472 100644 --- a/services/core-web/src/components/Forms/PermitAmendmentForm.js +++ b/services/core-web/src/components/Forms/PermitAmendmentForm.js @@ -13,6 +13,7 @@ import { dateNotInFuture, number, validateSelectOptions, + assessedLiabilityNegativeWarning, } from "@common/utils/Validate"; import { resetForm, currencyMask } from "@common/utils/helpers"; import { renderConfig } from "@/components/common/config"; @@ -201,6 +202,7 @@ export class PermitAmendmentForm extends Component { {...currencyMask} validate={[number]} disabled={this.props.securityNotRequired} + warn={[assessedLiabilityNegativeWarning]} /> diff --git a/services/core-web/src/components/Forms/Securities/BondForm.js b/services/core-web/src/components/Forms/Securities/BondForm.js index 43e2a3a3e4..b379b7a23e 100644 --- a/services/core-web/src/components/Forms/Securities/BondForm.js +++ b/services/core-web/src/components/Forms/Securities/BondForm.js @@ -15,6 +15,7 @@ import { dateNotBeforeOther, dateNotAfterOther, validateSelectOptions, + assessedLiabilityNegativeWarning, } from "@common/utils/Validate"; import { resetForm, upperCase, currencyMask } from "@common/utils/helpers"; import { BOND_DOCUMENTS } from "@mds/common/constants/API"; @@ -166,6 +167,7 @@ export class BondForm extends Component { {...currencyMask} validate={[required, number, currency]} disabled={this.props.editBond} + warn={[assessedLiabilityNegativeWarning]} /> diff --git a/services/core-web/src/components/Forms/permits/PermitAmendmentSecurityForm.js b/services/core-web/src/components/Forms/permits/PermitAmendmentSecurityForm.js index 50d1d47146..e187d4c2dd 100644 --- a/services/core-web/src/components/Forms/permits/PermitAmendmentSecurityForm.js +++ b/services/core-web/src/components/Forms/permits/PermitAmendmentSecurityForm.js @@ -6,7 +6,12 @@ import { Field, reduxForm, formValueSelector, change } from "redux-form"; import { Form } from "@ant-design/compatible"; import "@ant-design/compatible/assets/index.css"; import { Button, Col, Row, Popconfirm } from "antd"; -import { currency, required, validateSelectOptions } from "@common/utils/Validate"; +import { + currency, + required, + validateSelectOptions, + assessedLiabilityNegativeWarning, +} from "@common/utils/Validate"; import { currencyMask } from "@common/utils/helpers"; import * as FORM from "@/constants/forms"; import { securityNotRequiredReasonOptions } from "@/constants/NOWConditions"; @@ -84,6 +89,7 @@ export const PermitAmendmentSecurityForm = (props) => { allowClear {...currencyMask} validate={[currency]} + warn={[assessedLiabilityNegativeWarning]} /> diff --git a/services/core-web/src/styles/settings/themeOverride.scss b/services/core-web/src/styles/settings/themeOverride.scss index 2c57a57c8c..d0849600a8 100644 --- a/services/core-web/src/styles/settings/themeOverride.scss +++ b/services/core-web/src/styles/settings/themeOverride.scss @@ -725,6 +725,13 @@ select { margin-bottom: 6px; } +.ant-legacy-form-item-control.has-warning { + .ant-legacy-form-explain { + color: #694f16 !important; + } +} + + .ant-legacy-form-vertical { .ant-legacy-form-item { padding-bottom: 2px; diff --git a/services/core-web/src/tests/components/Forms/Securities/__snapshots__/BondForm.spec.js.snap b/services/core-web/src/tests/components/Forms/Securities/__snapshots__/BondForm.spec.js.snap index 54a6292a2e..aca35a00f3 100644 --- a/services/core-web/src/tests/components/Forms/Securities/__snapshots__/BondForm.spec.js.snap +++ b/services/core-web/src/tests/components/Forms/Securities/__snapshots__/BondForm.spec.js.snap @@ -35,6 +35,11 @@ exports[`BondForm renders properly 1`] = ` [Function], ] } + warn={ + Array [ + [Function], + ] + } /> diff --git a/services/core-web/src/tests/components/Forms/__snapshots__/PermitAmendmentForm.spec.js.snap b/services/core-web/src/tests/components/Forms/__snapshots__/PermitAmendmentForm.spec.js.snap index e4714bdffb..95508f33be 100644 --- a/services/core-web/src/tests/components/Forms/__snapshots__/PermitAmendmentForm.spec.js.snap +++ b/services/core-web/src/tests/components/Forms/__snapshots__/PermitAmendmentForm.spec.js.snap @@ -112,6 +112,11 @@ exports[`PermitAmendmentForm renders properly 1`] = ` [Function], ] } + warn={ + Array [ + [Function], + ] + } /> { @@ -477,4 +478,19 @@ describe("Validate class", () => { expect(errors.end_date).toContain(apptType); }); }); + describe("`assessedLiabilityNegativeWarning` function", () => { + it("returns `undefined` if `value` is not negative", () => { + const value = 1000; + expect(assessedLiabilityNegativeWarning(value)).toEqual(undefined); + }); + + it("returns `A negative value will decrease the current assessed liability` if value is a negative number", () => { + const negativeValue = -1000; + const positiveValue = 1000; + expect(assessedLiabilityNegativeWarning(negativeValue)).toEqual( + `A negative value will decrease the current assessed liability` + ); + expect(assessedLiabilityNegativeWarning(positiveValue)).toEqual(undefined); + }); + }); }); diff --git a/services/minespace-web/common/utils/Validate.ts b/services/minespace-web/common/utils/Validate.ts index 3cfbb5a7df..6a525fc2ec 100644 --- a/services/minespace-web/common/utils/Validate.ts +++ b/services/minespace-web/common/utils/Validate.ts @@ -346,3 +346,8 @@ export const validateIfApplicationTypeCorrespondsToPermitNumber = ( } return undefined; }; + +export const assessedLiabilityNegativeWarning = (value) => + positiveNumber(value) + ? "A negative value will decrease the current assessed liability" + : undefined;