@bloom-housing/ui-components 3.0.1-alpha.23 → 3.0.1-alpha.27
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,50 @@
|
|
|
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
|
+
## [3.0.1-alpha.27](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.26...@bloom-housing/ui-components@3.0.1-alpha.27) (2021-12-01)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [3.0.1-alpha.26](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.25...@bloom-housing/ui-components@3.0.1-alpha.26) (2021-12-01)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [3.0.1-alpha.25](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.24...@bloom-housing/ui-components@3.0.1-alpha.25) (2021-11-30)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @bloom-housing/ui-components
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [3.0.1-alpha.24](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.23...@bloom-housing/ui-components@3.0.1-alpha.24) (2021-11-29)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* guard against 0 output ([0ea9012](https://github.com/bloom-housing/bloom/commit/0ea9012fdac02fb1cb4357abec2ec69633902654))
|
|
36
|
+
* remove bold style from current waitlist size ([2e2f414](https://github.com/bloom-housing/bloom/commit/2e2f4141e62c8544c0828b29de0b99bb97abb201))
|
|
37
|
+
* show waitlist values even if they're zero ([6a35e67](https://github.com/bloom-housing/bloom/commit/6a35e679f142105e40719e89bda3d957e3200e1d))
|
|
38
|
+
* simpler conditionals ([f3e588d](https://github.com/bloom-housing/bloom/commit/f3e588d5e6dd0a39d1aed99ef6eba0054540ed14))
|
|
39
|
+
* waitlist: handle both null and undefined ([90fd369](https://github.com/bloom-housing/bloom/commit/90fd369b471c7f9baa0a1d58f452159449fe6fcf))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* simplify Waitlist component and use more flexible schema ([96df149](https://github.com/bloom-housing/bloom/commit/96df1496f377ddfa6f0e6c016c84954b6a43ff4a))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
6
50
|
## [3.0.1-alpha.23](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.22...@bloom-housing/ui-components@3.0.1-alpha.23) (2021-11-29)
|
|
7
51
|
|
|
8
52
|
**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": "3.0.1-alpha.
|
|
3
|
+
"version": "3.0.1-alpha.27",
|
|
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.1-alpha.
|
|
72
|
+
"@bloom-housing/backend-core": "^3.0.1-alpha.28",
|
|
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": "28ba129acbb39974b1ec5c95a7fbdbf85db545bf"
|
|
104
104
|
}
|
package/src/helpers/unitTypes.ts
CHANGED
|
@@ -5,7 +5,7 @@ type GetUnitTypeNamesReturn = {
|
|
|
5
5
|
name: string
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export const UnitTypeSort = ["studio", "oneBdrm", "twoBdrm", "threeBdrm", "fourBdrm"]
|
|
8
|
+
export const UnitTypeSort = ["SRO", "studio", "oneBdrm", "twoBdrm", "threeBdrm", "fourBdrm"]
|
|
9
9
|
|
|
10
10
|
export const sortUnitTypes = (units: UnitType[] | GetUnitTypeNamesReturn[]) => {
|
|
11
11
|
if (!units) return []
|
package/src/locales/general.json
CHANGED
|
@@ -309,6 +309,7 @@
|
|
|
309
309
|
"legend": "Preferred unit type",
|
|
310
310
|
"optionsLabel": "Check all that apply:",
|
|
311
311
|
"options": {
|
|
312
|
+
"SRO": "SRO",
|
|
312
313
|
"studio": "Studio",
|
|
313
314
|
"oneBdrm": "1 Bedroom",
|
|
314
315
|
"twoBdrm": "2 Bedroom",
|
|
@@ -1106,6 +1107,7 @@
|
|
|
1106
1107
|
"header": "Public Lottery",
|
|
1107
1108
|
"seeVideo": "See Video"
|
|
1108
1109
|
},
|
|
1110
|
+
"recommended": "Recommended",
|
|
1109
1111
|
"referralContactPhone": "Referral Contact Phone",
|
|
1110
1112
|
"referralSummary": "Referral Summary",
|
|
1111
1113
|
"remainingUnitsAfterPreferenceConsideration": "After all preference holders have been considered, any remaining units will be available to other qualified applicants.",
|
|
@@ -1198,7 +1200,7 @@
|
|
|
1198
1200
|
"selectionCriteria": "Selection Criteria",
|
|
1199
1201
|
"selectPreferences": "Select Preferences",
|
|
1200
1202
|
"showClosedListings": "Show Closed Listings",
|
|
1201
|
-
"singleRoomOccupancy": "
|
|
1203
|
+
"singleRoomOccupancy": "SRO",
|
|
1202
1204
|
"singleRoomOccupancyDescription": "This property offers single rooms for one person only. Tenants may share bathrooms, and sometimes kitchen facilities.",
|
|
1203
1205
|
"specialNotes": "Special Notes",
|
|
1204
1206
|
"streetAddressOrPOBox": "Street Address or PO Box",
|
|
@@ -1209,7 +1211,7 @@
|
|
|
1209
1211
|
"threeBdrm": "3 BR",
|
|
1210
1212
|
"fourBdrm": "4 BR",
|
|
1211
1213
|
"studio": "Studio",
|
|
1212
|
-
"SRO": "
|
|
1214
|
+
"SRO": "SRO"
|
|
1213
1215
|
},
|
|
1214
1216
|
"unitsAreFor": "These units are for %{type}.",
|
|
1215
1217
|
"unitsHaveAccessibilityFeaturesFor": "These units have accessibility features for people with %{type}.",
|
|
@@ -1231,7 +1233,7 @@
|
|
|
1231
1233
|
"maxSize": "Maximum Waitlist Size",
|
|
1232
1234
|
"maxSizeQuestion": "What is the maximum size of the waitlist?",
|
|
1233
1235
|
"open": "Open Waitlist",
|
|
1234
|
-
"openQuestion": "
|
|
1236
|
+
"openQuestion": "Do you want to show a waitlist?",
|
|
1235
1237
|
"openSize": "Number of Openings",
|
|
1236
1238
|
"openSizeQuestion": "How many spots are open on the list?",
|
|
1237
1239
|
"openSlots": "Open Waitlist Slots",
|
|
@@ -1304,7 +1306,7 @@
|
|
|
1304
1306
|
"twoBdrm": "Two Bedroom",
|
|
1305
1307
|
"threeBdrm": "Three Bedroom",
|
|
1306
1308
|
"fourBdrm": "Four Bedroom",
|
|
1307
|
-
"SRO": "
|
|
1309
|
+
"SRO": "SRO"
|
|
1308
1310
|
}
|
|
1309
1311
|
},
|
|
1310
1312
|
"events": {
|
|
@@ -1,77 +1,46 @@
|
|
|
1
1
|
import * as React from "react"
|
|
2
2
|
import { t } from "../../../helpers/translator"
|
|
3
3
|
|
|
4
|
-
const WaitlistItem = (props: { className?: string; value: number; text: string }) => {
|
|
5
|
-
return props.value ? (
|
|
6
|
-
<li className={`uppercase text-gray-800 text-tiny ${props.className}`}>
|
|
7
|
-
<span className="text-right w-12 inline-block pr-2">{props.value}</span>
|
|
8
|
-
<span>{props.text}</span>
|
|
9
|
-
</li>
|
|
10
|
-
) : null
|
|
11
|
-
}
|
|
12
|
-
|
|
13
4
|
export interface WaitlistProps {
|
|
14
5
|
isWaitlistOpen: boolean
|
|
15
|
-
waitlistMaxSize
|
|
16
|
-
waitlistCurrentSize
|
|
17
|
-
waitlistOpenSpots
|
|
18
|
-
unitsAvailable: number
|
|
6
|
+
waitlistMaxSize?: number | null
|
|
7
|
+
waitlistCurrentSize?: number | null
|
|
8
|
+
waitlistOpenSpots?: number | null
|
|
19
9
|
}
|
|
20
10
|
|
|
11
|
+
const WaitlistItem = (props: { className?: string; value: number; text: string }) => (
|
|
12
|
+
<li className={`uppercase text-gray-800 text-tiny ${props.className}`}>
|
|
13
|
+
<span className="text-right w-12 inline-block pr-2">{props.value}</span>
|
|
14
|
+
<span>{props.text}</span>
|
|
15
|
+
</li>
|
|
16
|
+
)
|
|
17
|
+
|
|
21
18
|
const Waitlist = (props: WaitlistProps) => {
|
|
22
|
-
|
|
23
|
-
if (!props.isWaitlistOpen && !props.waitlistCurrentSize) return <></>
|
|
24
|
-
if (props.unitsAvailable && props.unitsAvailable > 0 && props.isWaitlistOpen) {
|
|
25
|
-
header = t("listings.waitlist.unitsAndWaitlist")
|
|
26
|
-
subheader = t("listings.waitlist.submitAnApplication")
|
|
27
|
-
waitlistItems = (
|
|
28
|
-
<>
|
|
29
|
-
<WaitlistItem
|
|
30
|
-
value={props.unitsAvailable}
|
|
31
|
-
text={t("listings.availableUnits")}
|
|
32
|
-
className={"font-semibold"}
|
|
33
|
-
/>
|
|
34
|
-
{props.waitlistOpenSpots && (
|
|
35
|
-
<WaitlistItem
|
|
36
|
-
value={props.waitlistOpenSpots}
|
|
37
|
-
text={t("listings.waitlist.openSlots")}
|
|
38
|
-
className={"font-semibold"}
|
|
39
|
-
/>
|
|
40
|
-
)}
|
|
41
|
-
</>
|
|
42
|
-
)
|
|
43
|
-
} else {
|
|
44
|
-
if (props.isWaitlistOpen) {
|
|
45
|
-
header = t("listings.waitlist.isOpen")
|
|
46
|
-
subheader = t("listings.waitlist.submitForWaitlist")
|
|
47
|
-
} else {
|
|
48
|
-
header = t("listings.waitlist.closed")
|
|
49
|
-
subheader = null
|
|
50
|
-
}
|
|
51
|
-
waitlistItems = (
|
|
52
|
-
<>
|
|
53
|
-
<WaitlistItem
|
|
54
|
-
value={props.waitlistCurrentSize || 0}
|
|
55
|
-
text={t("listings.waitlist.currentSize")}
|
|
56
|
-
/>
|
|
57
|
-
{props.waitlistOpenSpots && (
|
|
58
|
-
<WaitlistItem
|
|
59
|
-
value={props.waitlistOpenSpots}
|
|
60
|
-
text={t("listings.waitlist.openSlots")}
|
|
61
|
-
className={"font-semibold"}
|
|
62
|
-
/>
|
|
63
|
-
)}
|
|
64
|
-
<WaitlistItem value={props.waitlistMaxSize || 0} text={t("listings.waitlist.finalSize")} />
|
|
65
|
-
</>
|
|
66
|
-
)
|
|
67
|
-
}
|
|
19
|
+
if (!props.isWaitlistOpen) return <></>
|
|
68
20
|
|
|
69
21
|
return (
|
|
70
22
|
<section className="aside-block is-tinted">
|
|
71
|
-
<h4 className="text-caps-tiny">{
|
|
23
|
+
<h4 className="text-caps-tiny">{t("listings.waitlist.unitsAndWaitlist")}</h4>
|
|
72
24
|
<div>
|
|
73
|
-
|
|
74
|
-
|
|
25
|
+
<p className="text-tiny text-gray-800 pb-3">{t("listings.waitlist.submitAnApplication")}</p>
|
|
26
|
+
<ul>
|
|
27
|
+
{props.waitlistCurrentSize !== null && props.waitlistCurrentSize !== undefined && (
|
|
28
|
+
<WaitlistItem
|
|
29
|
+
value={props.waitlistCurrentSize}
|
|
30
|
+
text={t("listings.waitlist.currentSize")}
|
|
31
|
+
/>
|
|
32
|
+
)}
|
|
33
|
+
{props.waitlistOpenSpots !== null && props.waitlistOpenSpots !== undefined && (
|
|
34
|
+
<WaitlistItem
|
|
35
|
+
value={props.waitlistOpenSpots}
|
|
36
|
+
text={t("listings.waitlist.openSlots")}
|
|
37
|
+
className={"font-semibold"}
|
|
38
|
+
/>
|
|
39
|
+
)}
|
|
40
|
+
{props.waitlistMaxSize != null && (
|
|
41
|
+
<WaitlistItem value={props.waitlistMaxSize} text={t("listings.waitlist.finalSize")} />
|
|
42
|
+
)}
|
|
43
|
+
</ul>
|
|
75
44
|
</div>
|
|
76
45
|
</section>
|
|
77
46
|
)
|