forked from bloom-housing/bloom
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: backend changes for what to expect changes (#508)
* fix: update email confirmation what to expect copy * fix: email tests (bloom-housing#3095) * feat: new listing type field * 3032/new what to expect core (bloom-housing#3087) * feat: bring over What to Expect and update Markdown styles * feat: show dedicated content on the What to Expect form step * feat: add additional text to terms and confirmation * feat: update form conditionals to use waitlist enum * fix: remove stray import * fix: typos and improved switch statements * fix: confirmation text and remove lottery date * fix: add back in eligibility translations (bloom-housing#3134) * fix: add back in detail page changes (#510) * fix: remove check for whatToExpect in cypress test Co-authored-by: Emily Jablonski <[email protected]> Co-authored-by: Jared White <[email protected]>
- Loading branch information
1 parent
9a1a33a
commit 85cb4da
Showing
36 changed files
with
556 additions
and
219 deletions.
There are no files selected for viewing
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
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 was deleted.
Oops, something went wrong.
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,4 +1,5 @@ | ||
export enum ListingReviewOrder { | ||
lottery = "lottery", | ||
firstComeFirstServe = "firstComeFirstServe", | ||
waitlist = "waitlist", | ||
} |
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
40 changes: 40 additions & 0 deletions
40
backend/core/src/migration/1663104141106-new-confirmation-email-translations.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
import { Language } from "../shared/types/language-enum" | ||
|
||
export class newConfirmationEmailTranslations1663104141106 implements MigrationInterface { | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
let generalTranslation = await queryRunner.query( | ||
`SELECT translations FROM translations WHERE jurisdiction_id IS NULL AND language = ($1)`, | ||
[Language.en] | ||
) | ||
|
||
generalTranslation = generalTranslation["0"]["translations"] | ||
|
||
generalTranslation.confirmation = { | ||
...generalTranslation.confirmation, | ||
eligible: { | ||
fcfs: | ||
"Eligibile applicants will be contacted on a first come first serve basis until vacancies are filled.", | ||
fcfsPreference: | ||
"Housing preferences, if applicable, will affect first come first serve order.", | ||
lottery: | ||
"Once the application period closes, eligible applicants will be placed in order based on lottery rank order.", | ||
lotteryPreference: "Housing preferences, if applicable, will affect lottery rank order.", | ||
waitlist: | ||
"Eligibile applicants will be placed on the waitlist on a first come first serve basis until waitlist spots are filled.", | ||
waitlistPreference: "Housing preferences, if applicable, will affect waitlist order.", | ||
waitlistContact: | ||
"You may be contacted while on the waitlist to confirm that you wish to remain on the waitlist.", | ||
}, | ||
interview: | ||
"If you are contacted for an interview, you will be asked to fill out a more detailed application and provide supporting documents.", | ||
} | ||
|
||
await queryRunner.query( | ||
`UPDATE "translations" SET translations = ($1) where jurisdiction_id IS NULL and language = ($2)`, | ||
[generalTranslation, Language.en] | ||
) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> {} | ||
} |
61 changes: 61 additions & 0 deletions
61
backend/core/src/migration/1663959354563-new-listing-type-enum.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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
|
||
export class newListingTypeEnum1663959354563 implements MigrationInterface { | ||
name = "newListingTypeEnum1663959354563" | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TYPE "public"."listings_review_order_type_enum" RENAME TO "listings_review_order_type_enum_old"` | ||
) | ||
await queryRunner.query( | ||
`CREATE TYPE "public"."listings_review_order_type_enum" AS ENUM('lottery', 'firstComeFirstServe', 'waitlist')` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "listings" ALTER COLUMN "review_order_type" TYPE "public"."listings_review_order_type_enum" USING "review_order_type"::"text"::"public"."listings_review_order_type_enum"` | ||
) | ||
await queryRunner.query(`DROP TYPE "public"."listings_review_order_type_enum_old"`) | ||
|
||
const listings = await queryRunner.query(`SELECT id, listing_availability FROM listings`) | ||
|
||
for (const l of listings) { | ||
if (l.listing_availability === "openWaitlist") { | ||
await queryRunner.query(`UPDATE listings SET review_order_type = ($1) WHERE id = ($2)`, [ | ||
"waitlist", | ||
l.id, | ||
]) | ||
} | ||
} | ||
await queryRunner.query(`ALTER TABLE "listings" DROP COLUMN "listing_availability"`) | ||
await queryRunner.query(`DROP TYPE "public"."listings_listing_availability_enum"`) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "listings" ADD "listing_availability" "public"."listings_listing_availability_enum"` | ||
) | ||
await queryRunner.query( | ||
`CREATE TYPE "public"."listings_listing_availability_enum" AS ENUM('availableUnits', 'openWaitlist')` | ||
) | ||
const listings = await queryRunner.query(`SELECT id, review_order_type FROM listings`) | ||
|
||
for (const l of listings) { | ||
if (l.review_order_type === "waitlist") { | ||
await queryRunner.query(`UPDATE listings SET listing_availability = ($1) WHERE id = ($2)`, [ | ||
"openWaitlist", | ||
l.id, | ||
]) | ||
} | ||
} | ||
|
||
await queryRunner.query( | ||
`CREATE TYPE "public"."listings_review_order_type_enum_old" AS ENUM('lottery', 'firstComeFirstServe')` | ||
) | ||
await queryRunner.query( | ||
`ALTER TABLE "listings" ALTER COLUMN "review_order_type" TYPE "public"."listings_review_order_type_enum_old" USING "review_order_type"::"text"::"public"."listings_review_order_type_enum_old"` | ||
) | ||
await queryRunner.query(`DROP TYPE "public"."listings_review_order_type_enum"`) | ||
await queryRunner.query( | ||
`ALTER TYPE "public"."listings_review_order_type_enum_old" RENAME TO "listings_review_order_type_enum"` | ||
) | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
backend/core/src/migration/1665528174645-email-reset-translations.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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
import { Language } from "../shared/types/language-enum" | ||
|
||
export class emailResetTranslations1665528174645 implements MigrationInterface { | ||
name = "emailResetTranslations1665528174645" | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
let generalTranslation = await queryRunner.query( | ||
`SELECT translations FROM translations WHERE jurisdiction_id IS NULL AND language = ($1)`, | ||
[Language.en] | ||
) | ||
|
||
generalTranslation = generalTranslation["0"]["translations"] | ||
|
||
generalTranslation.confirmation = { | ||
...generalTranslation.confirmation, | ||
eligible: { | ||
fcfs: | ||
"Eligible applicants will be contacted on a first come first serve basis until vacancies are filled.", | ||
waitlist: | ||
"Eligible applicants will be placed on the waitlist on a first come first serve basis until waitlist spots are filled.", | ||
lottery: | ||
"Once the application period closes, eligible applicants will be placed in order based on lottery rank order.", | ||
fcfsPreference: | ||
"Housing preferences, if applicable, will affect first come first serve order.", | ||
waitlistContact: | ||
"You may be contacted while on the waitlist to confirm that you wish to remain on the waitlist.", | ||
lotteryPreference: "Housing preferences, if applicable, will affect lottery rank order.", | ||
waitlistPreference: "Housing preferences, if applicable, will affect waitlist order.", | ||
}, | ||
} | ||
|
||
await queryRunner.query( | ||
`UPDATE "translations" SET translations = ($1) where jurisdiction_id IS NULL and language = ($2)`, | ||
[generalTranslation, Language.en] | ||
) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> {} | ||
} |
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
Oops, something went wrong.