@bloom-housing/ui-components 4.0.1-alpha.42 → 4.0.1-alpha.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,41 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [4.0.1-alpha.46](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.0.1-alpha.45...@bloom-housing/ui-components@4.0.1-alpha.46) (2022-02-08)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [4.0.1-alpha.45](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.0.1-alpha.44...@bloom-housing/ui-components@4.0.1-alpha.45) (2022-02-07)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [4.0.1-alpha.44](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.0.1-alpha.43...@bloom-housing/ui-components@4.0.1-alpha.44) (2022-02-02)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* unit accordion radio button not showing default value ([#2451](https://github.com/bloom-housing/bloom/issues/2451)) ([4ed8103](https://github.com/bloom-housing/bloom/commit/4ed81039b9130d0433b11df2bdabc495ce2b9f24))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## [4.0.1-alpha.43](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.0.1-alpha.42...@bloom-housing/ui-components@4.0.1-alpha.43) (2022-02-02)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
6
41
|
## [4.0.1-alpha.42](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@4.0.1-alpha.41...@bloom-housing/ui-components@4.0.1-alpha.42) (2022-02-02)
|
|
7
42
|
|
|
8
43
|
**Note:** Version bump only for package @bloom-housing/ui-components
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloom-housing/ui-components",
|
|
3
|
-
"version": "4.0.1-alpha.
|
|
3
|
+
"version": "4.0.1-alpha.46",
|
|
4
4
|
"author": "Sean Albert <sean.albert@exygy.com>",
|
|
5
5
|
"description": "Shared user interface components for Bloom affordable housing system",
|
|
6
6
|
"homepage": "https://github.com/bloom-housing/bloom/tree/master/shared/ui-components",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"webpack": "^4.44.2"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@bloom-housing/backend-core": "^3.0.2-alpha.
|
|
72
|
+
"@bloom-housing/backend-core": "^3.0.2-alpha.30",
|
|
73
73
|
"@mapbox/mapbox-sdk": "^0.13.0",
|
|
74
74
|
"@types/body-scroll-lock": "^2.6.1",
|
|
75
75
|
"@types/jwt-decode": "^2.2.1",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"tailwindcss": "2.2.10",
|
|
101
101
|
"typesafe-actions": "^5.1.0"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "05adf4166eacf3605b0a2b395119cfb1cef68387"
|
|
104
104
|
}
|
package/src/forms/DOBField.tsx
CHANGED
|
@@ -41,7 +41,7 @@ const DOBField = (props: DOBFieldProps) => {
|
|
|
41
41
|
const validateAge = (value: string) => {
|
|
42
42
|
return (
|
|
43
43
|
parseInt(value) > 1900 &&
|
|
44
|
-
dayjs(`${birthMonth}/${birthDay}/${value}`, "
|
|
44
|
+
dayjs(`${birthMonth}/${birthDay}/${value}`, "M/D/YYYY") < dayjs().subtract(18, "years")
|
|
45
45
|
)
|
|
46
46
|
}
|
|
47
47
|
|
package/src/forms/FieldGroup.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react"
|
|
1
|
+
import React, { useState, useEffect, useCallback } from "react"
|
|
2
2
|
import { ExpandableContent } from "../actions/ExpandableContent"
|
|
3
3
|
import { ErrorMessage } from "../notifications/ErrorMessage"
|
|
4
4
|
import { UseFormMethods, RegisterOptions } from "react-hook-form"
|
|
@@ -9,6 +9,7 @@ interface FieldSingle {
|
|
|
9
9
|
id: string
|
|
10
10
|
label: string
|
|
11
11
|
value?: string
|
|
12
|
+
dataTestId?: string
|
|
12
13
|
defaultChecked?: boolean
|
|
13
14
|
description?: React.ReactNode
|
|
14
15
|
defaultText?: string
|
|
@@ -87,7 +88,7 @@ const FieldGroup = ({
|
|
|
87
88
|
disabled={item.disabled}
|
|
88
89
|
ref={register(validation)}
|
|
89
90
|
{...item.inputProps}
|
|
90
|
-
data-test-id={dataTestId}
|
|
91
|
+
data-test-id={item.dataTestId ?? dataTestId}
|
|
91
92
|
/>
|
|
92
93
|
<label
|
|
93
94
|
htmlFor={item.id}
|
|
@@ -110,22 +111,25 @@ const FieldGroup = ({
|
|
|
110
111
|
)
|
|
111
112
|
}
|
|
112
113
|
|
|
113
|
-
const checkSelected = (
|
|
114
|
-
formFields
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
114
|
+
const checkSelected = useCallback(
|
|
115
|
+
(formFields: FieldSingle[] | undefined, checkedValues: string[]) => {
|
|
116
|
+
formFields?.forEach((field) => {
|
|
117
|
+
if (field.defaultChecked) {
|
|
118
|
+
checkedValues.push(field.label)
|
|
119
|
+
}
|
|
120
|
+
if (field.subFields) {
|
|
121
|
+
checkSelected(field.subFields, checkedValues)
|
|
122
|
+
}
|
|
123
|
+
})
|
|
124
|
+
},
|
|
125
|
+
[]
|
|
126
|
+
)
|
|
123
127
|
|
|
124
128
|
useEffect(() => {
|
|
125
129
|
const initialValues: string[] = []
|
|
126
130
|
checkSelected(fields, initialValues)
|
|
127
131
|
setCheckedInputs([...initialValues])
|
|
128
|
-
}, [])
|
|
132
|
+
}, [checkSelected, setCheckedInputs, fields])
|
|
129
133
|
|
|
130
134
|
const getInputSet = (item: FieldSingle): React.ReactNode => {
|
|
131
135
|
return (
|
|
@@ -141,6 +145,7 @@ const FieldGroup = ({
|
|
|
141
145
|
placeholder={t("t.description")}
|
|
142
146
|
className={"mb-4"}
|
|
143
147
|
disabled={item.disabled}
|
|
148
|
+
dataTestId={item.dataTestId}
|
|
144
149
|
/>
|
|
145
150
|
)}
|
|
146
151
|
</div>
|
package/src/locales/general.json
CHANGED
|
@@ -428,6 +428,17 @@
|
|
|
428
428
|
"doNotConsider": {
|
|
429
429
|
"label": "No"
|
|
430
430
|
}
|
|
431
|
+
},
|
|
432
|
+
"rentBasedOnIncome": {
|
|
433
|
+
"summary": "Flat Rent & Rent Based on Income",
|
|
434
|
+
"flatRent": {
|
|
435
|
+
"label": "Affordable apartment with flat rent",
|
|
436
|
+
"description": "I would like to apply for an affordable flat rent apartment, which has a set monthly rent amount that is below market rate. Note - applicants with Section 8 Mobile Housing Choice Vouchers (HCV) are welcome to apply."
|
|
437
|
+
},
|
|
438
|
+
"30Percent": {
|
|
439
|
+
"label": "Project based affordable apartments with a rent at 30% of your income",
|
|
440
|
+
"description": "I would like to apply for an apartment with Project-Based subsidy. These apartments require initial screening and yearly certification by the Housing Authority. The Housing Authority will calculate my monthly rent payment to approximately 30% of monthly income."
|
|
441
|
+
}
|
|
431
442
|
}
|
|
432
443
|
},
|
|
433
444
|
"preferences": {
|
|
@@ -911,7 +922,8 @@
|
|
|
911
922
|
"errors": {
|
|
912
923
|
"alert": {
|
|
913
924
|
"badRequest": "Looks like something went wrong. Please try again. \n\nContact your housing department if you're still experiencing issues.",
|
|
914
|
-
"timeoutPleaseTryAgain": "Oops! Looks like something went wrong. Please try again."
|
|
925
|
+
"timeoutPleaseTryAgain": "Oops! Looks like something went wrong. Please try again.",
|
|
926
|
+
"emailConflict": "That email is already in use"
|
|
915
927
|
},
|
|
916
928
|
"notFound": {
|
|
917
929
|
"title": "Page Not Found",
|
|
@@ -66,7 +66,13 @@ const UnitTables = (props: UnitTablesProps) => {
|
|
|
66
66
|
number: unit.number,
|
|
67
67
|
sqFeet: (
|
|
68
68
|
<>
|
|
69
|
-
|
|
69
|
+
{unit.sqFeet ? (
|
|
70
|
+
<>
|
|
71
|
+
<strong>{parseInt(unit.sqFeet)}</strong> {t("t.sqFeet")}
|
|
72
|
+
</>
|
|
73
|
+
) : (
|
|
74
|
+
<></>
|
|
75
|
+
)}
|
|
70
76
|
</>
|
|
71
77
|
),
|
|
72
78
|
numBathrooms: <strong>{unit.numBathrooms}</strong>,
|