Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
7a3a55c
initial commit
mertbagt Aug 7, 2025
1eedc9f
retrieve data
mertbagt Aug 9, 2025
949575b
hearing title
mertbagt Aug 10, 2025
44ea709
error handling
mertbagt Aug 10, 2025
ae13ee5
refactor async function
mertbagt Aug 10, 2025
6718832
added state variable
mertbagt Aug 10, 2025
c99bdba
Merge branch 'main' of https://github.com/codeforboston/maple into he…
mertbagt Aug 10, 2025
fc9fb89
resolved title error
mertbagt Aug 10, 2025
c24b97e
basic state vars
mertbagt Aug 10, 2025
98280a2
useEffect
mertbagt Aug 10, 2025
9256787
committee tag
mertbagt Aug 11, 2025
3779b97
dynamic routes
mertbagt Aug 11, 2025
2852fc7
cleanup
mertbagt Aug 11, 2025
317f8b5
columns
mertbagt Aug 11, 2025
0536486
disclaimer
mertbagt Aug 11, 2025
5bb9eda
responsive iframes
mertbagt Aug 12, 2025
a60a9a8
replace iframes with video
mertbagt Aug 12, 2025
8230873
cleanup
mertbagt Aug 12, 2025
45f7373
cleanup2
mertbagt Aug 12, 2025
866ac01
cleanup3
mertbagt Aug 12, 2025
1aba5b4
updated h1
mertbagt Aug 12, 2025
094a940
Merge branch 'main' of https://github.com/codeforboston/maple into he…
mertbagt Aug 12, 2025
b8af3fd
cleanup
mertbagt Aug 13, 2025
e1a5ddb
transcriptions query
mertbagt Aug 14, 2025
d14e6e1
transcription data firestore
mertbagt Aug 14, 2025
77fd1bf
working on firestore
mertbagt Aug 14, 2025
9bd74c0
cleanup
mertbagt Aug 14, 2025
aeb594a
cleanup
mertbagt Aug 14, 2025
af6d66f
alternate bad code filtering
mertbagt Aug 14, 2025
0b15532
alt zod attempt
mertbagt Aug 14, 2025
f4904b8
reinstated videoURL sanity check
mertbagt Aug 14, 2025
0f8edf3
zod attempt 3
mertbagt Aug 14, 2025
b05debf
transcriptions feed initial wiring
mertbagt Aug 14, 2025
a750f0f
basic columns
mertbagt Aug 14, 2025
adcbf39
cleanup
mertbagt Aug 14, 2025
8f95b46
cleanup
mertbagt Aug 14, 2025
95b25b3
Merge branch 'main' of https://github.com/codeforboston/maple into he…
mertbagt Aug 14, 2025
aae9e4d
handle transcription not on file
mertbagt Aug 18, 2025
863a906
resolve conflicts
mertbagt Aug 18, 2025
ac411b6
click timestamp -> seek video currentTime
mertbagt Aug 18, 2025
489f8bf
end stamp
mertbagt Aug 18, 2025
b5d4033
timestamp button
mertbagt Aug 18, 2025
ccddcde
format milliseconds
mertbagt Aug 18, 2025
8c1fe92
added element end to timestamp button
mertbagt Aug 18, 2025
7b513a3
remove end timestamp
mertbagt Aug 18, 2025
ad59af2
alternating background colors
mertbagt Aug 19, 2025
d440ab4
cleanup
mertbagt Aug 19, 2025
7adc0b1
sidebar
mertbagt Aug 19, 2025
6a8d74d
sidebar chairmembers
mertbagt Aug 19, 2025
0ca12d0
error container
mertbagt Aug 19, 2025
dd93435
cleanup
mertbagt Aug 19, 2025
0fa7d14
remove obsolete console logs
mertbagt Aug 19, 2025
d9f2b8f
replaced 404 redirect with messaging for scheduled hearings that don'…
mertbagt Aug 20, 2025
6b00924
removed redirect code
mertbagt Aug 20, 2025
de77372
added feature flagging
mertbagt Aug 20, 2025
e476506
members
mertbagt Aug 20, 2025
4827dd6
reused committee button for show more clickable
mertbagt Aug 20, 2025
4e9f3cf
sidebar bottom
mertbagt Aug 20, 2025
2cb1366
removed attempt at using agenda
mertbagt Aug 20, 2025
aaa8078
cleanup
mertbagt Aug 20, 2025
ecec89a
remove event.ts change
mertbagt Aug 21, 2025
e1fe029
eventId
mertbagt Aug 21, 2025
45a4f96
removed styledcontainer
mertbagt Aug 21, 2025
aac82fb
refactored video with useRef
mertbagt Aug 21, 2025
cc301f3
removed inline style
mertbagt Aug 21, 2025
b150735
reassert eventId fix
mertbagt Aug 21, 2025
bd76247
removed Default Values
mertbagt Aug 21, 2025
6060c34
prevent FirebaseError
mertbagt Aug 21, 2025
2938830
cleanup
mertbagt Aug 21, 2025
e9cba43
cleanup
mertbagt Aug 21, 2025
2e7d481
updated even rows
mertbagt Aug 21, 2025
0ba52e0
uped cache control values
mertbagt Aug 21, 2025
b06f11e
moved page specific translations to hearing.json
mertbagt Aug 21, 2025
9d1ee2f
handle Invalid Date
mertbagt Aug 21, 2025
5548285
reduced cache control
mertbagt Aug 21, 2025
afb59d9
update useTranslation(filenames)
mertbagt Aug 21, 2025
462b494
reinstate week long cache control
mertbagt Aug 21, 2025
5402c6c
remove console log
mertbagt Aug 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions components/featureFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ export const FeatureFlags = z.object({
/** Lobbying Table */
lobbyingTable: z.boolean().default(false),
/** LLM Bill Summary and Tags **/
showLLMFeatures: z.boolean().default(false)
showLLMFeatures: z.boolean().default(false),
/** Hearings and Transcriptions **/
hearingsAndTranscriptions: z.boolean().default(false)
})

export type FeatureFlags = z.infer<typeof FeatureFlags>
Expand All @@ -32,23 +34,26 @@ const defaults: Record<Env, FeatureFlags> = {
billTracker: true,
followOrg: true,
lobbyingTable: false,
showLLMFeatures: true
showLLMFeatures: true,
hearingsAndTranscriptions: true
},
production: {
testimonyDiffing: false,
notifications: true,
billTracker: false,
followOrg: true,
lobbyingTable: false,
showLLMFeatures: true
showLLMFeatures: true,
hearingsAndTranscriptions: false
},
test: {
testimonyDiffing: false,
notifications: true,
billTracker: false,
followOrg: true,
lobbyingTable: false,
showLLMFeatures: true
showLLMFeatures: true,
hearingsAndTranscriptions: true
}
}

Expand Down
157 changes: 157 additions & 0 deletions components/hearing/HearingDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import { doc, getDoc } from "firebase/firestore"
import { Trans, useTranslation } from "next-i18next"
import { useCallback, useEffect, useRef, useState } from "react"
import styled from "styled-components"
import { Col, Container, Image, Row } from "../bootstrap"
import { HearingSidebar } from "./HearingSidebar"
import { Transcriptions } from "./Transcriptions"
import { firestore } from "components/firebase"
import * as links from "components/links"

export const CommitteeButton = styled.button`
border-radius: 12px;
font-size: 12px;
`

const LegalContainer = styled(Container)`
background-color: white;
`

const VideoChild = styled.video`
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
`

const VideoParent = styled.div`
position: relative;
width: 100%;
padding-top: 56.25%; /* For 16:9 aspect ratio */
overflow: hidden;
`

export const HearingDetails = ({
hearingId
}: {
hearingId: string | string[] | undefined
}) => {
const { t } = useTranslation(["common", "hearing"])

const videoRef = useRef<HTMLVideoElement>(null)
function setCurTimeVideo(value: number) {
videoRef.current ? (videoRef.current.currentTime = value) : null
}

const eventId = `hearing-${hearingId}`

const [committeeCode, setCommitteeCode] = useState("")
const [committeeName, setCommitteeName] = useState("")
const [description, setDescription] = useState("")
const [generalCourtNumber, setGeneralCourtNumber] = useState("")
const [hearingDate, setHearingDate] = useState("")
const [videoTranscriptionId, setVideoTranscriptionId] = useState("")
const [videoURL, setVideoURL] = useState("")

const hearingData = useCallback(async () => {
const hearing = await getDoc(doc(firestore, `events/${eventId}`))
const docData = hearing.data()

setCommitteeCode(docData?.content.HearingHost.CommitteeCode)
setCommitteeName(docData?.content.Name)
setDescription(docData?.content.Description)
setGeneralCourtNumber(docData?.content.HearingHost.GeneralCourtNumber)
setHearingDate(docData?.content.EventDate)
setVideoTranscriptionId(docData?.videoTranscriptionId)
setVideoURL(docData?.videoURL)
}, [eventId])

useEffect(() => {
hearingData()
}, [hearingData])

return (
<Container className="mt-3 mb-3">
<h1>
{t("hearing")} {hearingId}
</h1>

<h5 className={`mb-3`}>{description}</h5>

{committeeName ? (
<links.External
href={`https://malegislature.gov/Committees/Detail/${committeeCode}/${generalCourtNumber}`}
>
<CommitteeButton
className={`btn btn-secondary d-flex text-nowrap mt-1 mx-1 p-1`}
>
&nbsp; {committeeName} &nbsp;
</CommitteeButton>
</links.External>
) : (
<></>
)}

<div className={`row mt-4`}>
<Col className={`col-md-8`}>
<LegalContainer className={`pb-2 rounded`}>
<Row
className={`d-flex align-items-center justify-content-between`}
fontSize={"12px"}
xs="auto"
>
<Col>
<div className={`fs-6 fw-bold mt-2`}>
<Image
src="/images/smart-summary.svg"
alt={t("bill.smart_tag")}
height={`34`}
width={`24`}
className={`me-2 pb-1`}
/>
{t("bill.smart_disclaimer2")}
</div>
</Col>

<Col>
<Trans
t={t}
i18nKey="bill.smart_disclaimer3"
components={[
// eslint-disable-next-line react/jsx-key
<links.Internal href="/about/how-maple-uses-ai" />
]}
/>
</Col>
</Row>
</LegalContainer>

{videoURL ? (
<VideoParent className={`my-3`}>
<VideoChild ref={videoRef} src={videoURL} controls muted />
</VideoParent>
) : (
<LegalContainer className={`fs-6 fw-bold my-3 py-2 rounded`}>
{t("no_video_on_file")}
</LegalContainer>
)}

<Transcriptions
setCurTimeVideo={setCurTimeVideo}
videoTranscriptionId={videoTranscriptionId}
/>
</Col>

<div className={`col-md-4`}>
<HearingSidebar
committeeCode={committeeCode}
generalCourtNumber={generalCourtNumber}
hearingDate={hearingDate}
/>
</div>
</div>
</Container>
)
}
Loading