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

fix: comment out income validation and change to text field #620

Merged
merged 3 commits into from
Jun 5, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,31 @@ const DetailsHouseholdIncome = () => {
>
<GridCell>
<ViewItem label={t("application.details.annualIncome")} dataTestId="annualIncome">
{/*
// TODO: Commenting out temporarily due to application issues
{application.incomePeriod === IncomePeriod.perYear
? formatIncome(
parseFloat(application.income),
application.incomePeriod,
IncomePeriod.perYear
)
: t("t.n/a")}
: t("t.n/a")} */}
{application.incomePeriod === IncomePeriod.perYear ? application.income : t("t.n/a")}
</ViewItem>
</GridCell>

<GridCell>
<ViewItem label={t("application.details.monthlyIncome")} dataTestId="monthlyIncome">
{/*
// TODO: Commenting out temporarily due to application issues
{application.incomePeriod === IncomePeriod.perMonth
? formatIncome(
parseFloat(application.income),
application.incomePeriod,
IncomePeriod.perMonth
)
: t("t.n/a")}
: t("t.n/a")} */}
{application.incomePeriod === IncomePeriod.perMonth ? application.income : t("t.n/a")}
</ViewItem>
</GridCell>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const FormHouseholdIncome = () => {
<ViewItem label={t("application.details.annualIncome")}>
<Field
id="incomeYear"
type="number"
// TODO: Commenting out temporarily due to application issues
// type="number"
name="incomeYear"
label={t("application.details.annualIncome")}
placeholder={t("t.enterAmount")}
Expand All @@ -74,7 +75,8 @@ const FormHouseholdIncome = () => {
<ViewItem label={t("application.details.monthlyIncome")}>
<Field
id="incomeMonth"
type="number"
// TODO: Commenting out temporarily due to application issues
// type="number"
name="incomeMonth"
label={t("application.details.monthlyIncome")}
placeholder={t("t.enterAmount")}
Expand Down
18 changes: 12 additions & 6 deletions sites/public/src/pages/applications/financial/income.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,14 @@ const ApplicationIncome = () => {
const onSubmit = (data) => {
const { income, incomePeriod } = data
const incomeValue = income.replaceAll(",", "")
// TODO: Commenting out temporarily due to application issues
// Skip validation of total income if the applicant has income vouchers.
const validationError = application.incomeVouchers
? null
: verifyIncome(listing, incomeValue, incomePeriod)
setIncomeError(validationError)
// const validationError = application.incomeVouchers
// ? null
// : verifyIncome(listing, incomeValue, incomePeriod)
// setIncomeError(validationError)

const validationError = false

if (!validationError) {
const toSave = { income: incomeValue, incomePeriod }
Expand Down Expand Up @@ -179,11 +182,14 @@ const ApplicationIncome = () => {
<Field
id="income"
name="income"
type="currency"
// TODO: Commenting out temporarily due to application issues
// type="currency"
label={t("application.financial.income.prompt")}
caps={true}
placeholder={t("application.financial.income.placeholder")}
validation={{ required: true, min: 0.01 }}
// TODO: Commenting out temporarily due to application issues
// validation={{ required: true, min: 0.01 }}
validation={{ required: true }}
error={errors.income}
register={register}
errorMessage={t("errors.numberError")}
Expand Down