-
-
Notifications
You must be signed in to change notification settings - Fork 141
Hearing Transcriptions base page #1899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mertbagt
merged 78 commits into
codeforboston:main
from
mertbagt:hearing-transcriptions-base-page
Aug 26, 2025
Merged
Changes from all commits
Commits
Show all changes
78 commits
Select commit
Hold shift + click to select a range
7a3a55c
initial commit
mertbagt 1eedc9f
retrieve data
mertbagt 949575b
hearing title
mertbagt 44ea709
error handling
mertbagt ae13ee5
refactor async function
mertbagt 6718832
added state variable
mertbagt c99bdba
Merge branch 'main' of https://github.com/codeforboston/maple into he…
mertbagt fc9fb89
resolved title error
mertbagt c24b97e
basic state vars
mertbagt 98280a2
useEffect
mertbagt 9256787
committee tag
mertbagt 3779b97
dynamic routes
mertbagt 2852fc7
cleanup
mertbagt 317f8b5
columns
mertbagt 0536486
disclaimer
mertbagt 5bb9eda
responsive iframes
mertbagt a60a9a8
replace iframes with video
mertbagt 8230873
cleanup
mertbagt 45f7373
cleanup2
mertbagt 866ac01
cleanup3
mertbagt 1aba5b4
updated h1
mertbagt 094a940
Merge branch 'main' of https://github.com/codeforboston/maple into he…
mertbagt b8af3fd
cleanup
mertbagt e1a5ddb
transcriptions query
mertbagt d14e6e1
transcription data firestore
mertbagt 77fd1bf
working on firestore
mertbagt 9bd74c0
cleanup
mertbagt aeb594a
cleanup
mertbagt af6d66f
alternate bad code filtering
mertbagt 0b15532
alt zod attempt
mertbagt f4904b8
reinstated videoURL sanity check
mertbagt 0f8edf3
zod attempt 3
mertbagt b05debf
transcriptions feed initial wiring
mertbagt a750f0f
basic columns
mertbagt adcbf39
cleanup
mertbagt 8f95b46
cleanup
mertbagt 95b25b3
Merge branch 'main' of https://github.com/codeforboston/maple into he…
mertbagt aae9e4d
handle transcription not on file
mertbagt 863a906
resolve conflicts
mertbagt ac411b6
click timestamp -> seek video currentTime
mertbagt 489f8bf
end stamp
mertbagt b5d4033
timestamp button
mertbagt ccddcde
format milliseconds
mertbagt 8c1fe92
added element end to timestamp button
mertbagt 7b513a3
remove end timestamp
mertbagt ad59af2
alternating background colors
mertbagt d440ab4
cleanup
mertbagt 7adc0b1
sidebar
mertbagt 6a8d74d
sidebar chairmembers
mertbagt 0ca12d0
error container
mertbagt dd93435
cleanup
mertbagt 0fa7d14
remove obsolete console logs
mertbagt d9f2b8f
replaced 404 redirect with messaging for scheduled hearings that don'…
mertbagt 6b00924
removed redirect code
mertbagt de77372
added feature flagging
mertbagt e476506
members
mertbagt 4827dd6
reused committee button for show more clickable
mertbagt 4e9f3cf
sidebar bottom
mertbagt 2cb1366
removed attempt at using agenda
mertbagt aaa8078
cleanup
mertbagt ecec89a
remove event.ts change
mertbagt e1fe029
eventId
mertbagt 45a4f96
removed styledcontainer
mertbagt aac82fb
refactored video with useRef
mertbagt cc301f3
removed inline style
mertbagt b150735
reassert eventId fix
mertbagt bd76247
removed Default Values
mertbagt 6060c34
prevent FirebaseError
mertbagt 2938830
cleanup
mertbagt e9cba43
cleanup
mertbagt 2e7d481
updated even rows
mertbagt 0ba52e0
uped cache control values
mertbagt b06f11e
moved page specific translations to hearing.json
mertbagt 9d1ee2f
handle Invalid Date
mertbagt 5548285
reduced cache control
mertbagt afb59d9
update useTranslation(filenames)
mertbagt 462b494
reinstate week long cache control
mertbagt 5402c6c
remove console log
mertbagt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
mertbagt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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`} | ||
> | ||
{committeeName} | ||
</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> | ||
) | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.