Skip to content

Commit 90658ad

Browse files
authored
More hearing types (#2018)
* fix(hearing): Update hearing types - location can also sometimes be missing * fix(yarn): Remove unneeded package-lock.json, add package-lock.json to gitignore (because we use yarn), and remove yarn from the package.json deps list
1 parent df75b8d commit 90658ad

File tree

8 files changed

+11
-39595
lines changed

8 files changed

+11
-39595
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
/.pnp
66
.pnp.js
77
.yarn*
8+
package-lock.json
89

910
# testing
1011
/coverage

components/HearingsScheduled/HearingsScheduled.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type EventData = {
1010
type: "hearing" | "session"
1111
name: string
1212
id: number
13-
location: string
13+
location?: string
1414
fullDate: Date // TODO: Could be a timestamp
1515
year: string
1616
month: string
@@ -132,7 +132,7 @@ export const EventCard = ({
132132
)}
133133
</p>
134134
<p className={`lh-sm mb-3 ms-2 text-secondary`}>
135-
{truncateEntry(location)}
135+
{truncateEntry(location ?? "")}
136136
</p>
137137
</div>
138138
</div>

components/HearingsScheduled/calendarEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const useCalendarEvents = () => {
4444
type: e.type,
4545
name: e.content.Name ?? "Hearing",
4646
id: e.content.EventId,
47-
location: e.content.Location.LocationName,
47+
location: e.content.Location?.LocationName ?? undefined,
4848
fullDate: eventDate.toJSDate(),
4949
year: date.year,
5050
month: date.month,

functions/src/events/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ export const Session = BaseEvent.extend({
5454
})
5555
export type HearingLocation = Static<typeof HearingLocation>
5656
export const HearingLocation = Record({
57-
AddressLine1: String,
57+
AddressLine1: Nullable(String),
5858
AddressLine2: Nullable(String),
59-
City: String,
60-
LocationName: String,
61-
State: String,
62-
ZipCode: String
59+
City: Nullable(String),
60+
LocationName: Nullable(String),
61+
State: Nullable(String),
62+
ZipCode: Nullable(String)
6363
})
6464
export type HearingContent = Static<typeof HearingContent>
6565
export const HearingContent = BaseEventContent.extend({

functions/src/hearings/search.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ export const {
106106
year: schedule.year,
107107
committeeCode: content.HearingHost?.CommitteeCode ?? undefined,
108108
committeeName: committeeName ?? undefined,
109-
locationName: content.Location?.LocationName,
110-
locationCity: content.Location?.City,
109+
locationName: content.Location?.LocationName ?? undefined,
110+
locationCity: content.Location?.City ?? undefined,
111111
chairNames: hearing.committeeChairs ?? [],
112112
agendaTopics,
113113
billNumbers: dedupedBills.map(bill => bill.number),

0 commit comments

Comments
 (0)