Skip to content

Commit edf8d4e

Browse files
feat: preselect jurisdiction
1 parent 51d6c9c commit edf8d4e

30 files changed

Lines changed: 467 additions & 351 deletions

api/test/unit/services/script-runner.service.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
MultiselectQuestionsApplicationSectionEnum,
77
ReviewOrderTypeEnum,
88
} from '@prisma/client';
9+
import { mockDeep } from 'jest-mock-extended';
10+
911
import { randomUUID } from 'crypto';
1012
import { Request as ExpressRequest } from 'express';
1113
import { User } from '../../../src/dtos/users/user.dto';

sites/partners/.jest/setup-tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Future home of additional Jest config
2+
import "@testing-library/jest-dom"
23
import { addTranslation } from "@bloom-housing/ui-components"
34
import generalTranslations from "@bloom-housing/shared-helpers/src/locales/general.json"
45
import { serviceOptions } from "@bloom-housing/shared-helpers/src/types/backend-swagger"
5-
import "@testing-library/jest-dom"
66
import axios from "axios"
77
import general from "../page_content/locale_overrides/general.json"
88
addTranslation({ ...generalTranslations, ...general })

sites/partners/__tests__/components/listings/PaperListingForm/sections/ApplicationDates.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ describe("ApplicationDates", () => {
5353
render(
5454
<FormComponent>
5555
<ApplicationDates
56+
jurisdiction="JurisdictionA"
5657
listing={{} as unknown as FormListing}
5758
requiredFields={[]}
5859
openHouseEvents={[]}
@@ -102,6 +103,7 @@ describe("ApplicationDates", () => {
102103
render(
103104
<FormComponent>
104105
<ApplicationDates
106+
jurisdiction="JurisdictionA"
105107
listing={{} as unknown as FormListing}
106108
requiredFields={["applicationDueDate"]}
107109
openHouseEvents={[]}
@@ -140,6 +142,7 @@ describe("ApplicationDates", () => {
140142
render(
141143
<FormComponent>
142144
<ApplicationDates
145+
jurisdiction="JurisdictionA"
143146
listing={{} as unknown as FormListing}
144147
requiredFields={[]}
145148
openHouseEvents={[]}
@@ -191,6 +194,7 @@ describe("ApplicationDates", () => {
191194
render(
192195
<FormComponent>
193196
<ApplicationDates
197+
jurisdiction="JurisdictionA"
194198
listing={{} as unknown as FormListing}
195199
requiredFields={[]}
196200
openHouseEvents={[]}
@@ -250,6 +254,7 @@ describe("ApplicationDates", () => {
250254
render(
251255
<FormComponent>
252256
<ApplicationDates
257+
jurisdiction="JurisdictionA"
253258
listing={{} as unknown as FormListing}
254259
requiredFields={[]}
255260
openHouseEvents={[]}

sites/partners/page_content/locale_overrides/general.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@
227227
"listings.copy.unitSubNote": "Unit data will automatically be copied unless this box is unchecked.",
228228
"listings.copyListing": "Copy listing",
229229
"listings.createdDate": "Created date",
230+
"listings.createListing": "Create listing",
230231
"listings.customOnlineApplicationUrl": "Custom online application URL",
231232
"listings.depositMax": "Deposit max",
232233
"listings.depositMin": "Deposit min",

sites/partners/src/components/listings/PaperListingDetails/sections/DetailListingData.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,37 @@ import { t } from "@bloom-housing/ui-components"
33
import { FieldValue, Grid } from "@bloom-housing/ui-seeds"
44
import SectionWithGrid from "../../../shared/SectionWithGrid"
55
import { ListingContext } from "../../ListingContext"
6-
import { getDetailFieldDate, getDetailFieldTime } from "./helpers"
6+
import { getDetailFieldDate, getDetailFieldString, getDetailFieldTime } from "./helpers"
77

8-
const DetailListingData = () => {
8+
type DetailsListingDataProps = {
9+
showJurisdictionName: boolean
10+
}
11+
12+
const DetailListingData = (props: DetailsListingDataProps) => {
913
const listing = useContext(ListingContext)
1014

1115
return (
1216
<SectionWithGrid heading={t("listings.details.listingData")} inset>
13-
<Grid.Row>
14-
<Grid.Cell>
15-
<FieldValue label={t("listings.details.id")}>{listing.id}</FieldValue>
16-
</Grid.Cell>
17+
{props.showJurisdictionName && (
18+
<Grid.Row>
19+
<Grid.Cell>
20+
<FieldValue id="jurisdictions.name" label={t("t.jurisdiction")}>
21+
{getDetailFieldString(listing.jurisdictions.name)}
22+
</FieldValue>
23+
</Grid.Cell>
24+
</Grid.Row>
25+
)}
26+
<Grid.Row columns={5}>
1727
<Grid.Cell>
1828
<FieldValue label={t("listings.details.createdDate")}>
1929
{getDetailFieldDate(listing.createdAt)}
2030
{" at "}
2131
{getDetailFieldTime(listing.createdAt)}
2232
</FieldValue>
2333
</Grid.Cell>
34+
<Grid.Cell className={"seeds-grid-span-2"}>
35+
<FieldValue label={t("listings.details.id")}>{listing.id}</FieldValue>
36+
</Grid.Cell>
2437
</Grid.Row>
2538
</SectionWithGrid>
2639
)

sites/partners/src/components/listings/PaperListingDetails/sections/DetailListingIntro.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,6 @@ const DetailListingIntro = () => {
3939
</Grid.Cell>
4040
</Grid.Row>
4141
<Grid.Row>
42-
<Grid.Cell>
43-
<FieldValue id="jurisdictions.name" label={t("t.jurisdiction")}>
44-
{getDetailFieldString(listing.jurisdictions.name)}
45-
</FieldValue>
46-
</Grid.Cell>
4742
<Grid.Cell>
4843
<FieldValue
4944
id="developer"

sites/partners/src/components/listings/PaperListingForm/UnitForm.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,21 @@ import SectionWithGrid from "../../shared/SectionWithGrid"
2121
import styles from "./ListingForm.module.scss"
2222

2323
type UnitFormProps = {
24-
onSubmit: (unit: TempUnit) => void
25-
onClose: (openNextUnit: boolean, openCurrentUnit: boolean, defaultUnit: TempUnit) => void
2624
defaultUnit: TempUnit | undefined
27-
nextId: number
2825
draft: boolean
2926
jurisdiction: string
27+
nextId: number
28+
onClose: (openNextUnit: boolean, openCurrentUnit: boolean, defaultUnit: TempUnit) => void
29+
onSubmit: (unit: TempUnit) => void
3030
}
3131

3232
const UnitForm = ({
33-
onSubmit,
34-
onClose,
3533
defaultUnit,
36-
nextId,
3734
draft,
3835
jurisdiction,
36+
nextId,
37+
onClose,
38+
onSubmit,
3939
}: UnitFormProps) => {
4040
const { amiChartsService } = useContext(AuthContext)
4141

0 commit comments

Comments
 (0)