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

feat: new hopwa program #455

Merged
merged 2 commits into from
Jul 27, 2022
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
39 changes: 39 additions & 0 deletions backend/core/src/migration/1658941145026-new-hopwa-program.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { MigrationInterface, QueryRunner } from "typeorm"

export class newHopwaProgram1658941145026 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const jurisdiction = await queryRunner.query(
`
SELECT
id
FROM jurisdictions
WHERE name = 'Alameda';
`
)
await queryRunner.query(
`
INSERT INTO programs(title, subtitle, description, form_metadata)
SELECT
'Housing Opportunities for Persons with AIDS (HOPWA)' as title,
'There are apartments set-aside for households eligible for the HOPWA program (Housing Opportunities for Persons with AIDS), which are households where a person has been medically diagnosed with HIV/AIDS. These apartments also have Project-Based Section rental subsidies (tenant pays 30% of household income). If you have questions about HOPWA eligibility or need support in submitting this application, please contact AHIP (AIDS Housing Information Project) at (510) 537-2600 or (510) 695-5222.' as subtitle,
'Housing Opportunities for Persons with AIDS (HOPWA)' as description,
'{"key":"HOPWA","type":"radio","customSelectText":"Please indicate here if you are interested in applying for one of these HOPWA apartments.","options":[{"key":"interested","extraData":[],"description":false},{"key":"notInterested","extraData":[],"description":false}]}' as form_metadata
;
`
)
const program = await queryRunner.query(
`
SELECT
id
FROM programs
WHERE title = 'Housing Opportunities for Persons with AIDS (HOPWA)';
`
)
await queryRunner.query(
`INSERT INTO jurisdictions_programs_programs (jurisdictions_id, programs_id) VALUES ($1, $2)`,
[jurisdiction[0].id, program[0].id]
)
}

public async down(queryRunner: QueryRunner): Promise<void> {}
}
4 changes: 3 additions & 1 deletion sites/public/pages/applications/household/programs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ const ApplicationPrograms = () => {
<div className="form-card__group field text-lg">
<fieldset>
<p className="field-note mb-4">
{pageProgram?.formMetadata?.type === FormMetaDataType.checkbox
{pageProgram?.formMetadata?.customSelectText
? pageProgram?.formMetadata?.customSelectText
: pageProgram?.formMetadata?.type === FormMetaDataType.checkbox
? t("errors.selectAllThatApply")
: t("t.pleaseSelectOne")}
</p>
Expand Down
10 changes: 8 additions & 2 deletions sites/public/src/forms/applications/FormSummaryDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React, { Fragment, useEffect, useState } from "react"
import { LocalizedLink, MultiLineAddress, ViewItem, t } from "@bloom-housing/ui-components"
import { getUniqueUnitTypes, getProgramOptionName } from "@bloom-housing/shared-helpers"
import { Address, AllExtraDataTypes, InputType, Listing } from "@bloom-housing/backend-core/types"
import {
Address,
AllExtraDataTypes,
ApplicationProgram,
InputType,
Listing,
} from "@bloom-housing/backend-core/types"

type FormSummaryDetailsProps = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down Expand Up @@ -330,7 +336,7 @@ const FormSummaryDetails = ({
))}
</ViewItem>
{application.programs
.filter((item) => item.claimed === true)
.filter((item: ApplicationProgram) => item.claimed === true && item.key !== "HOPWA")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emilyjablonski , I don't like this, but I'm ok with it since we're overhauling preferences/programs now. Are we handling cases like this with the new setup?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, in the new form we do have an explicit "hide" check

.map((program) =>
program.options
.filter((item) => item.checked === true)
Expand Down
3 changes: 3 additions & 0 deletions ui-components/src/locales/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,9 @@
"application.programs.disabilityOrMentalIllness.disabilityOrMentalIllness.label": "Yes",
"application.programs.disabilityOrMentalIllness.doNotConsider.label": "No",
"application.programs.disabilityOrMentalIllness.summary": "People with Developmental Disabilities or Mental Illness",
"application.programs.HOPWA.interested.label": "I'm interested",
"application.programs.HOPWA.notInterested.label": "I'm not interested",
"application.programs.HOPWA.summary": "HOPWA",
"application.programs.housingSituation.doNotConsider.label": "No",
"application.programs.housingSituation.homeless.description": "Includes living outside, or in your car, or staying at a shelter, or in a motel / hotel paid for with an emergency voucher",
"application.programs.housingSituation.homeless.label": "I'm homeless",
Expand Down