@bloom-housing/ui-components 3.0.0 → 3.0.1-alpha.3

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,86 @@
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.3](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.2...@bloom-housing/ui-components@3.0.1-alpha.3) (2021-11-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * add Programs section to listings management ([#2093](https://github.com/bloom-housing/bloom/issues/2093)) ([9bd1fe1](https://github.com/bloom-housing/bloom/commit/9bd1fe1033dee0fb7e73756254474471bc304f5e))
12
+
13
+
14
+
15
+
16
+
17
+ ## [3.0.1-alpha.2](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.1...@bloom-housing/ui-components@3.0.1-alpha.2) (2021-11-08)
18
+
19
+ **Note:** Version bump only for package @bloom-housing/ui-components
20
+
21
+
22
+
23
+
24
+
25
+ ## [3.0.1-alpha.1](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.1-alpha.0...@bloom-housing/ui-components@3.0.1-alpha.1) (2021-11-08)
26
+
27
+ **Note:** Version bump only for package @bloom-housing/ui-components
28
+
29
+
30
+
31
+
32
+
33
+ ## [3.0.1-alpha.0](https://github.com/bloom-housing/bloom/compare/@bloom-housing/ui-components@3.0.0...@bloom-housing/ui-components@3.0.1-alpha.0) (2021-11-05)
34
+
35
+
36
+ * 1837/preferences cleanup 3 (#2144) ([3ce6d5e](https://github.com/bloom-housing/bloom/commit/3ce6d5eb5aac49431ec5bf4912dbfcbe9077d84e)), closes [#2144](https://github.com/bloom-housing/bloom/issues/2144)
37
+
38
+
39
+ ### BREAKING CHANGES
40
+
41
+ * Preferences are now M-N relation with a listing and have an intermediate table with ordinal number
42
+
43
+ * refactor(backend): preferences deduplication
44
+
45
+ So far each listing referenced it's own unique Preferences. This change introduces Many to Many
46
+ relationship between Preference and Listing entity and forces sharing Preferences between listings.
47
+
48
+ * feat(backend): extend preferences migration with moving existing relations to a new intermediate tab
49
+
50
+ * feat(backend): add Preference - Jurisdiction ManyToMany relation
51
+
52
+ * feat: adapt frontend to backend changes
53
+
54
+ * fix(backend): typeORM preferences select statement
55
+
56
+ * fix(backend): connect preferences with jurisdictions in seeds, fix pref filter validator
57
+
58
+ * fix(backend): fix missing import in preferences-filter-params.ts
59
+
60
+ * refactor: rebase issue
61
+
62
+ * feat: uptake jurisdictional preferences
63
+
64
+ * fix: fixup tests
65
+
66
+ * fix: application preferences ignore page, always separate
67
+
68
+ * Remove page from src/migration/1633359409242-add-listing-preferences-intermediate-relation.ts
69
+
70
+ * fix: preference fetching and ordering/pages
71
+
72
+ * Fix code style issues with Prettier
73
+
74
+ * fix(backend): query User__leasingAgentInListings__jurisdiction_User__leasingAgentIn specified more
75
+
76
+ * fix: perferences cypress tests
77
+
78
+ Co-authored-by: Michal Plebanski <michalp@airnauts.com>
79
+ Co-authored-by: Emily Jablonski <emily.jablonski@exygy.com>
80
+ Co-authored-by: Lint Action <lint-action@samuelmeuli.com>
81
+
82
+
83
+
84
+
85
+
6
86
  # [3.0.0](https://github.com/seanmalbert/bloom/compare/@bloom-housing/ui-components@2.0.1-alpha.8...@bloom-housing/ui-components@3.0.0) (2021-11-05)
7
87
 
8
88
  **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.0",
3
+ "version": "3.0.1-alpha.3",
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.0",
72
+ "@bloom-housing/backend-core": "^3.0.1-alpha.3",
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": "05ed5c42d83134d0401081b2e67f739ad5bf69ac"
103
+ "gitHead": "e0fcb37b598e3d6bcd9916b70d7d578322c6196d"
104
104
  }
@@ -7,6 +7,7 @@ import {
7
7
  UserBasic,
8
8
  UserCreate,
9
9
  UserService,
10
+ UserProfileService,
10
11
  serviceOptions,
11
12
  Status,
12
13
  AmiChartsService,
@@ -15,6 +16,7 @@ import {
15
16
  UnitTypesService,
16
17
  PreferencesService,
17
18
  JurisdictionsService,
19
+ ProgramsService,
18
20
  } from "@bloom-housing/backend-core/types"
19
21
  import {
20
22
  createContext,
@@ -39,8 +41,10 @@ type ContextProps = {
39
41
  listingsService: ListingsService
40
42
  jurisdictionsService: JurisdictionsService
41
43
  userService: UserService
44
+ userProfileService: UserProfileService
42
45
  authService: AuthService
43
46
  preferencesService: PreferencesService
47
+ programsService: ProgramsService
44
48
  reservedCommunityTypeService: ReservedCommunityTypesService
45
49
  unitPriorityService: UnitAccessibilityPriorityTypesService
46
50
  unitTypesService: UnitTypesService
@@ -225,8 +229,10 @@ export const AuthProvider: FunctionComponent = ({ children }) => {
225
229
  listingsService: new ListingsService(),
226
230
  jurisdictionsService: new JurisdictionsService(),
227
231
  userService: new UserService(),
232
+ userProfileService: new UserProfileService(),
228
233
  authService: new AuthService(),
229
234
  preferencesService: new PreferencesService(),
235
+ programsService: new ProgramsService(),
230
236
  reservedCommunityTypeService: new ReservedCommunityTypesService(),
231
237
  unitPriorityService: new UnitAccessibilityPriorityTypesService(),
232
238
  unitTypesService: new UnitTypesService(),
@@ -33,8 +33,8 @@ const DOBField = (props: DOBFieldProps) => {
33
33
  return [name, baseName].filter((item) => item).join(".")
34
34
  }
35
35
 
36
- const birthDay = watch(getFieldName("birthDay"))
37
- const birthMonth = watch(getFieldName("birthMonth"))
36
+ const birthDay = watch(getFieldName("birthDay")) ?? defaultDOB?.birthDay
37
+ const birthMonth = watch(getFieldName("birthMonth")) ?? defaultDOB?.birthMonth
38
38
 
39
39
  const validateAge = (value: string) => {
40
40
  return (
@@ -4,6 +4,7 @@ import {
4
4
  ApplicationPreference,
5
5
  FormMetadataOptions,
6
6
  Preference,
7
+ ListingPreference,
7
8
  } from "@bloom-housing/backend-core/types"
8
9
  import { UseFormMethods } from "react-hook-form"
9
10
  import {
@@ -373,20 +374,25 @@ export type ExclusiveKey = {
373
374
  /*
374
375
  Create an array of all exclusive keys from a preference set
375
376
  */
376
- export const getExclusiveKeys = (preferences: Preference[]) => {
377
+ export const getExclusiveKeys = (preferences: ListingPreference[]) => {
377
378
  const exclusive: ExclusiveKey[] = []
378
- preferences?.forEach((preference) => {
379
- preference?.formMetadata?.options.forEach((option: FormMetadataOptions) => {
379
+ preferences?.forEach((listingPreference) => {
380
+ listingPreference.preference?.formMetadata?.options.forEach((option: FormMetadataOptions) => {
380
381
  if (option.exclusive)
381
382
  exclusive.push({
382
- optionKey: getPreferenceOptionName(option.key, preference?.formMetadata?.key ?? ""),
383
- preferenceKey: preference?.formMetadata?.key,
383
+ optionKey: getPreferenceOptionName(
384
+ option.key,
385
+ listingPreference.preference?.formMetadata?.key ?? ""
386
+ ),
387
+ preferenceKey: listingPreference.preference?.formMetadata?.key,
384
388
  })
385
389
  })
386
- if (!preference?.formMetadata?.hideGenericDecline)
390
+ if (!listingPreference.preference?.formMetadata?.hideGenericDecline)
387
391
  exclusive.push({
388
- optionKey: getExclusivePreferenceOptionName(preference?.formMetadata?.key),
389
- preferenceKey: preference?.formMetadata?.key,
392
+ optionKey: getExclusivePreferenceOptionName(
393
+ listingPreference.preference?.formMetadata?.key
394
+ ),
395
+ preferenceKey: listingPreference.preference?.formMetadata?.key,
390
396
  })
391
397
  })
392
398
  return exclusive
@@ -1,10 +1,22 @@
1
1
  import * as React from "react"
2
- import { Preference, PreferenceLink } from "@bloom-housing/backend-core/types"
3
2
  import "./PreferencesList.scss"
4
3
  import { locale } from "../helpers/translator"
5
4
 
5
+ export interface ListPreferenceLink {
6
+ title: string
7
+ url: string
8
+ }
9
+
10
+ export interface ListPreference {
11
+ ordinal?: number
12
+ links?: ListPreferenceLink[]
13
+ title?: string
14
+ subtitle?: string
15
+ description?: string
16
+ }
17
+
6
18
  export interface PreferencesListProps {
7
- preferences: Preference[]
19
+ listingPreferences: ListPreference[]
8
20
  }
9
21
 
10
22
  const getOrdinal = (n: number) => {
@@ -18,10 +30,7 @@ const getOrdinal = (n: number) => {
18
30
  }
19
31
 
20
32
  const PreferencesList = (props: PreferencesListProps) => {
21
- const filteredPreferences = props.preferences.filter(
22
- (pref) => !pref.formMetadata?.hideFromListing
23
- )
24
- const preferences = filteredPreferences.map((preference: Preference, index: number) => {
33
+ const preferences = props.listingPreferences?.map((preference: ListPreference, index: number) => {
25
34
  const itemClasses = ["preferences-list__item", "info-card"]
26
35
 
27
36
  if (!preference.subtitle && !preference.description && !preference.links) {
@@ -43,7 +52,7 @@ const PreferencesList = (props: PreferencesListProps) => {
43
52
  )}
44
53
  {preference.links && (
45
54
  <div className="preferences-list__links">
46
- {preference.links.map((link: PreferenceLink, linkIndex: number) => (
55
+ {preference.links.map((link: ListPreferenceLink, linkIndex: number) => (
47
56
  <span key={linkIndex}>
48
57
  <a href={link.url}>{link.title}</a>
49
58
  </span>
@@ -891,6 +891,7 @@
891
891
  "isDigitalApplication": "Is there a digital application?",
892
892
  "isPaperApplication": "Is there a paper application?",
893
893
  "isReferralOpportunity": "Is there a referral opportunity?",
894
+ "selectJurisdiction": "You must first select a jurisdiction",
894
895
  "latitude": "Latitude",
895
896
  "leasingAgentAddress": "Leasing Agent Address",
896
897
  "listingPreviewOnly": "This is a listing preview only.",