Skip to content

Commit fcfd535

Browse files
authored
Revert "Deploy to PROD 1/18/26"
1 parent 364e91b commit fcfd535

File tree

18 files changed

+314
-638
lines changed

18 files changed

+314
-638
lines changed

components/about/MapleAI/MapleAI.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ const MapleAI = () => {
4141
<li>
4242
<b>{t("section1.desc3Bold")}</b> {t("section1.desc3Main")}
4343
</li>
44-
<li>
45-
<b>{t("section1.desc4Bold")}</b> {t("section1.desc4Main")}
46-
</li>
4744
</ul>
4845
</DescrContainer>
4946
<DescrContainer className="pb-3 px-4">
@@ -132,10 +129,6 @@ const MapleAI = () => {
132129
<b>{t("section4.sub1.desc5Bold")}</b>{" "}
133130
{t("section4.sub1.desc5Main")}
134131
</li>
135-
<li>
136-
<b>{t("section4.sub1.desc6Bold")}</b>{" "}
137-
{t("section4.sub1.desc6Main")}
138-
</li>
139132
</ul>
140133
</DescrContainer>
141134
<Divider />

components/auth/hooks.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,31 @@ export function useCreateUserWithEmailAndPassword(isOrg: boolean) {
6767
email,
6868
password
6969
)
70+
await finishSignup({ requestedRole: isOrg ? "organization" : "user" })
71+
72+
const categories = orgCategory ? [orgCategory] : ""
73+
7074
if (isOrg) {
71-
await finishSignup({
72-
requestedRole: "organization",
73-
fullName,
74-
orgCategories: orgCategory ? [orgCategory] : "",
75-
notificationFrequency: "Weekly",
76-
email: credentials.user.email
77-
})
75+
await Promise.all([
76+
setProfile(credentials.user.uid, {
77+
fullName,
78+
orgCategories: categories,
79+
notificationFrequency: "Weekly",
80+
email: credentials.user.email
81+
}),
82+
sendEmailVerification(credentials.user)
83+
])
7884
} else {
79-
await finishSignup({
80-
requestedRole: "user",
81-
fullName,
82-
notificationFrequency: "Weekly",
83-
email: credentials.user.email,
84-
public: true
85-
})
85+
await Promise.all([
86+
setProfile(credentials.user.uid, {
87+
fullName,
88+
notificationFrequency: "Weekly",
89+
email: credentials.user.email,
90+
public: true
91+
}),
92+
sendEmailVerification(credentials.user)
93+
])
8694
}
87-
await sendEmailVerification(credentials.user)
8895

8996
return credentials
9097
}

components/auth/types.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { functions } from "components/firebase"
22
import { httpsCallable } from "firebase/functions"
33
import { Role } from "../../functions/src/auth/types"
4-
import { Profile } from "components/db"
54

65
export * from "../../functions/src/auth/types"
76

8-
export const finishSignup = httpsCallable<
9-
{ requestedRole: Role } | Partial<Profile>,
10-
void
11-
>(functions, "finishSignup")
7+
export const finishSignup = httpsCallable<{ requestedRole: Role }, void>(
8+
functions,
9+
"finishSignup"
10+
)

components/hearing/HearingDetails.tsx

Lines changed: 76 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
FeatureCalloutButton
1313
} from "../shared/CommonComponents"
1414
import { HearingSidebar } from "./HearingSidebar"
15-
import { HearingData, Paragraph, fetchTranscriptionData } from "./hearing"
15+
import { Paragraph, fetchTranscriptionData } from "./transcription"
1616
import { Transcriptions } from "./Transcriptions"
1717

1818
const LegalContainer = styled(Container)`
@@ -36,22 +36,12 @@ const VideoParent = styled.div`
3636
`
3737

3838
export const HearingDetails = ({
39-
hearingData: {
40-
billsInAgenda,
41-
committeeCode,
42-
committeeName,
43-
description,
44-
generalCourtNumber,
45-
hearingDate,
46-
hearingId,
47-
videoTranscriptionId,
48-
videoURL
49-
}
39+
hearingId
5040
}: {
51-
hearingData: HearingData
41+
hearingId: string | string[] | undefined
5242
}) => {
5343
const { t } = useTranslation(["common", "hearing"])
54-
const [transcriptData, setTranscriptData] = useState<Paragraph[] | null>(null)
44+
const [transcriptData, setTranscriptData] = useState<Paragraph[]>([])
5545

5646
const [videoLoaded, setVideoLoaded] = useState(false)
5747
const handleVideoLoad = () => {
@@ -63,14 +53,43 @@ export const HearingDetails = ({
6353
videoRef.current ? (videoRef.current.currentTime = value) : null
6454
}
6555

56+
const eventId = `hearing-${hearingId}`
57+
58+
const [billsInAgenda, setBillsInAgenda] = useState([])
59+
const [committeeCode, setCommitteeCode] = useState("")
60+
const [committeeName, setCommitteeName] = useState("")
61+
const [description, setDescription] = useState("")
62+
const [generalCourtNumber, setGeneralCourtNumber] = useState("")
63+
const [hearingDate, setHearingDate] = useState("")
64+
const [videoTranscriptionId, setVideoTranscriptionId] = useState("")
65+
const [videoURL, setVideoURL] = useState("")
66+
67+
const hearingData = useCallback(async () => {
68+
const hearing = await getDoc(doc(firestore, `events/${eventId}`))
69+
const docData = hearing.data()
70+
71+
setBillsInAgenda(docData?.content.HearingAgendas[0]?.DocumentsInAgenda)
72+
setCommitteeCode(docData?.content.HearingHost.CommitteeCode)
73+
setCommitteeName(docData?.content.Name)
74+
setDescription(docData?.content.Description)
75+
setGeneralCourtNumber(docData?.content.HearingHost.GeneralCourtNumber)
76+
setHearingDate(docData?.content.EventDate)
77+
setVideoTranscriptionId(docData?.videoTranscriptionId)
78+
setVideoURL(docData?.videoURL)
79+
}, [eventId])
80+
6681
useEffect(() => {
6782
;(async function () {
68-
if (!videoTranscriptionId || transcriptData !== null) return
83+
if (!videoTranscriptionId || transcriptData.length !== 0) return
6984
const docList = await fetchTranscriptionData(videoTranscriptionId)
7085
setTranscriptData(docList)
7186
})()
7287
}, [videoTranscriptionId])
7388

89+
useEffect(() => {
90+
hearingData()
91+
}, [hearingData])
92+
7493
return (
7594
<Container className="mt-3 mb-3">
7695
<Row className={`mb-3`}>
@@ -96,15 +115,11 @@ export const HearingDetails = ({
96115
)}
97116

98117
{committeeName ? (
99-
committeeCode ? (
100-
<h1>
101-
<External href={committeeURL(committeeCode)}>
102-
{committeeName}
103-
</External>
104-
</h1>
105-
) : (
106-
<h1>{committeeName}</h1>
107-
)
118+
<h1>
119+
<External href={committeeURL(committeeCode)}>
120+
{committeeName}
121+
</External>
122+
</h1>
108123
) : (
109124
<></>
110125
)}
@@ -113,41 +128,37 @@ export const HearingDetails = ({
113128

114129
<Row>
115130
<Col className={`col-md-8 mt-4`}>
116-
{transcriptData ? (
117-
<LegalContainer className={`pb-2 rounded`}>
118-
<Row
119-
className={`d-flex align-items-center justify-content-between`}
120-
fontSize={"12px"}
121-
xs="auto"
122-
>
123-
<Col>
124-
<div className={`fs-6 fw-bold mt-2`}>
125-
<Image
126-
src="/images/smart-summary.svg"
127-
alt={t("bill.smart_tag")}
128-
height={`34`}
129-
width={`24`}
130-
className={`me-2 pb-1`}
131-
/>
132-
{t("bill.smart_disclaimer2")}
133-
</div>
134-
</Col>
135-
136-
<Col>
137-
<Trans
138-
t={t}
139-
i18nKey="bill.smart_disclaimer3"
140-
components={[
141-
// eslint-disable-next-line react/jsx-key
142-
<links.Internal href="/about/how-maple-uses-ai" />
143-
]}
131+
<LegalContainer className={`pb-2 rounded`}>
132+
<Row
133+
className={`d-flex align-items-center justify-content-between`}
134+
fontSize={"12px"}
135+
xs="auto"
136+
>
137+
<Col>
138+
<div className={`fs-6 fw-bold mt-2`}>
139+
<Image
140+
src="/images/smart-summary.svg"
141+
alt={t("bill.smart_tag")}
142+
height={`34`}
143+
width={`24`}
144+
className={`me-2 pb-1`}
144145
/>
145-
</Col>
146-
</Row>
147-
</LegalContainer>
148-
) : (
149-
<></>
150-
)}
146+
{t("bill.smart_disclaimer2")}
147+
</div>
148+
</Col>
149+
150+
<Col>
151+
<Trans
152+
t={t}
153+
i18nKey="bill.smart_disclaimer3"
154+
components={[
155+
// eslint-disable-next-line react/jsx-key
156+
<links.Internal href="/about/how-maple-uses-ai" />
157+
]}
158+
/>
159+
</Col>
160+
</Row>
161+
</LegalContainer>
151162

152163
{videoURL ? (
153164
<VideoParent className={`mt-3`}>
@@ -161,24 +172,16 @@ export const HearingDetails = ({
161172
</VideoParent>
162173
) : (
163174
<LegalContainer className={`fs-6 fw-bold my-3 py-2 rounded`}>
164-
{transcriptData
165-
? t("no_video_on_file", { ns: "hearing" })
166-
: t("no_video_or_transcript", { ns: "hearing" })}
175+
{t("no_video_on_file", { ns: "hearing" })}
167176
</LegalContainer>
168177
)}
169178

170-
{transcriptData ? (
171-
<Transcriptions
172-
transcriptData={transcriptData}
173-
setCurTimeVideo={setCurTimeVideo}
174-
videoLoaded={videoLoaded}
175-
videoRef={videoRef}
176-
/>
177-
) : videoURL ? (
178-
<LegalContainer className={`fs-6 fw-bold mb-2 py-2 rounded-bottom`}>
179-
<div>{t("no_transcript_on_file", { ns: "hearing" })}</div>
180-
</LegalContainer>
181-
) : null}
179+
<Transcriptions
180+
transcriptData={transcriptData}
181+
setCurTimeVideo={setCurTimeVideo}
182+
videoLoaded={videoLoaded}
183+
videoRef={videoRef}
184+
/>
182185
</Col>
183186

184187
<div className={`col-md-4`}>

0 commit comments

Comments
 (0)