Skip to content

Commit 2637677

Browse files
authored
Merge pull request #2083 from codeforboston/main
Deploy to Prod 3/24/26
2 parents 8f0b9e7 + ccb623e commit 2637677

42 files changed

Lines changed: 2235 additions & 1695 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-backend-dev.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,12 @@ jobs:
2929
GCP_SA_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
3030
ASSEMBLY_API_KEY: ${{ secrets.ASSEMBLY_API_KEY }}
3131
PROJECT_ID: digital-testimony-dev
32+
33+
# Update Typesense Schema
34+
- uses: google-github-actions/auth@v3
35+
with:
36+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
37+
- uses: google-github-actions/setup-gcloud@v3
38+
- name: Update Typesense Schema
39+
run: |
40+
gcloud pubsub topics publish --project=digital-testimony-dev checkSearchIndexVersion --message='{"check": true}'

.github/workflows/deploy-prod.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ jobs:
2323
GCP_SA_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
2424
ASSEMBLY_API_KEY: ${{ secrets.ASSEMBLY_API_KEY }}
2525
PROJECT_ID: digital-testimony-prod
26+
27+
# Update Typesense Schema
28+
- uses: google-github-actions/auth@v3
29+
with:
30+
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
31+
- uses: google-github-actions/setup-gcloud@v3
32+
- name: Update Typesense Schema
33+
run: |
34+
gcloud pubsub topics publish --project=digital-testimony-prod checkSearchIndexVersion --message='{"check": true}'

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ We are creating a new web platform called MAPLE (the Massachusetts Platform for
66

77
## Essentials
88

9-
Join the [Code for Boston Slack](https://communityinviter.com/apps/cfb-public/default-badge) and our `#maple-testimony` channel. Ask to join the Zenhub project and to be added as a collaborator on Github, and provide your Github username.
9+
Join the [Code for Boston Slack](https://communityinviter.com/apps/cfb-public/default-badge) and our `#maple-testimony` channel. Ask to be added as a collaborator on Github, and provide your Github username.
1010

1111
Attend a [weekly hack night at Code for Boston](https://www.meetup.com/code-for-boston/events/) and join our group.
1212

@@ -16,7 +16,7 @@ Check out the [Contributing](./Contributing.md) docs for how to contribute to th
1616

1717
## Links
1818

19-
- [Zenhub project board](https://app.zenhub.com/workspaces/design-and-development-629389aa02e9d200139c90b8/board), where issues are organized
19+
- [GitHub issues](https://github.com/codeforboston/maple/issues), where issues are organized
2020
- [Figma Designs](<https://www.figma.com/file/oMNmgiqDGTMco2v54gOW3b/MAPLE-Soft-Launch-(Mar-2023)?t=N7wquH4vslGiB1tK-0>), where UI designs are organized
2121
- [Chromatic Storybook Library](https://www.chromatic.com/library?appId=634f3926f2a0d0f0195eefd7&branch=main), where our React UI component library is documented.
2222
- [Maple Documentation on the Wiki](https://github.com/codeforboston/maple/wiki)
@@ -253,4 +253,4 @@ Thanks to all our contributors!
253253

254254
<!-- ALL-CONTRIBUTORS-LIST:END -->
255255

256-
This table follows the [All Contributors](https://allcontributors.org/) specification and is managed by the @all-contributors bot. You can add yourself or another contributor by [commenting on an issue or a pull request](https://allcontributors.org/docs/en/bot/usage).
256+
This table follows the [All Contributors](https://allcontributors.org/) specification and is managed by the @all-contributors bot. You can add yourself or another contributor by [commenting on an issue or a pull request](https://allcontributors.org/bot/usage/).

components/AboutPagesCard/AboutPagesCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const AboutPagesCard: FC<PropsWithChildren<{ title: string }>> = ({
2525
children
2626
}) => {
2727
return (
28-
<Card className="m-5 rounded-3 bg-white">
28+
<Card className="mx-sm-5 mx-xs-3 my-5 rounded-3 bg-white">
2929
<StyledHeader
3030
as="h1"
3131
className="bg-secondary text-white overflow-hidden fs-sm-1 pt-2 pt-sm-3 pb-1 pb-sm-3 ps-4 ps-sm-5 pe-5"

components/ProfilePage/VerifyAccountSection.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ export const VerifyAccountSection = ({
1818
return (
1919
<TitledSectionCard title={"Verify Your Account"} className={className}>
2020
<div>
21-
<p className="fw-bold text-info">
22-
{t("verifyAccountSection.verifyAccount")}
23-
</p>
21+
<p className="fw-bold">{t("verifyAccountSection.verifyAccount")}</p>
2422

2523
{sendEmailVerification.status === "success" ? (
2624
<Alert variant="success">
@@ -35,7 +33,7 @@ export const VerifyAccountSection = ({
3533

3634
{sendEmailVerification.status !== "success" ? (
3735
<LoadingButton
38-
variant="info"
36+
variant="secondary"
3937
className="text-white"
4038
loading={sendEmailVerification.loading}
4139
onClick={() => sendEmailVerification.execute(user)}

components/bill/BillDetails.tsx

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,32 @@ import { Back } from "components/shared/CommonComponents"
1515
import { useFlags } from "components/featureFlags"
1616
import { FollowBillButton } from "components/shared/FollowButton"
1717
import { PendingUpgradeBanner } from "components/PendingUpgradeBanner"
18-
import { isCurrentCourt } from "functions/src/shared"
18+
import {
19+
currentBallotInitiativeCommittee,
20+
isCurrentCourt
21+
} from "functions/src/shared"
1922

2023
export const BillDetails = ({ bill }: BillProps) => {
2124
const { t } = useTranslation("common")
2225

2326
const isPendingUpgrade = useAuth().claims?.role === "pendingUpgrade"
2427
const flags = useFlags()
25-
2628
const { user } = useAuth()
2729

30+
let isBallotMeasure = false
31+
const curComm = bill?.currentCommittee?.id
32+
33+
if (curComm === currentBallotInitiativeCommittee) {
34+
isBallotMeasure = true
35+
}
36+
2837
return (
2938
<>
3039
{isPendingUpgrade && <PendingUpgradeBanner />}
3140
{!isCurrentCourt(bill.court) && (
3241
<Banner>{t("bill.old_session", { billCourt: bill.court })}</Banner>
3342
)}
43+
{isBallotMeasure && <Banner>{t("bill.ballot_initiative")}</Banner>}
3444

3545
<Container className="mt-3 mb-3">
3646
<Row>
@@ -74,14 +84,19 @@ export const BillDetails = ({ bill }: BillProps) => {
7484
</Col>
7585
</Row>
7686
)}
77-
<Row className="mt-2">
87+
<Row className="my-2">
7888
<Col>
7989
<Summary bill={bill} />
8090
</Col>
8191
</Row>
82-
<Row>
92+
<Row className="mt-4">
8393
<Col md={8}>
84-
<Sponsors bill={bill} className="mt-4 pb-1" />
94+
{isBallotMeasure ? (
95+
<></>
96+
) : (
97+
<Sponsors bill={bill} className="pb-1" />
98+
)}
99+
85100
<BillTestimonies bill={bill} className="mt-4" />
86101
{flags.lobbyingTable && (
87102
<LobbyingTable bill={bill} className="mt-4 pb-1" />

components/bill/Summary.tsx

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ import { SmartIcon } from "./SmartIcon"
1717
import { TestimonyCounts } from "./TestimonyCounts"
1818
import { BillProps } from "./types"
1919
import { BillTopic } from "functions/src/bills/types"
20-
import { currentGeneralCourt } from "functions/src/shared"
20+
import {
21+
currentBallotInitiativeCommittee,
22+
currentGeneralCourt
23+
} from "functions/src/shared"
2124

2225
const Divider = styled(Col)`
2326
width: 2px;
@@ -30,6 +33,10 @@ const FormattedBillDetails = styled(Col)`
3033
white-space: pre-wrap;
3134
`
3235

36+
const BallotSummaryRow = styled(Row)`
37+
white-space: pre-wrap;
38+
`
39+
3340
const SmartTag = ({ topic }: { topic: BillTopic }) => {
3441
return (
3542
<links.Internal
@@ -106,6 +113,8 @@ export const Summary = ({
106113
const handleHideBillDetails = () => setShowBillDetails(false)
107114
const billText = bill?.content?.DocumentText
108115
const hearingIds = bill?.hearingIds
116+
const isBallotMeasure =
117+
bill?.currentCommittee?.id === currentBallotInitiativeCommittee
109118

110119
const { showLLMFeatures } = useFlags()
111120

@@ -203,10 +212,20 @@ export const Summary = ({
203212
<hr className={`m-0 border-bottom border-2`} />
204213
<SmartDisclaimer />
205214
</>
215+
) : bill.summary !== undefined && isBallotMeasure ? (
216+
<>
217+
<hr className={`m-0 mb-3 border-bottom border-2`} />
218+
</>
206219
) : (
207220
<></>
208221
)}
209-
<Row className="mx-1 mb-3">{bill.summary}</Row>
222+
{bill.summary !== undefined && isBallotMeasure ? (
223+
<BallotSummaryRow className={`mx-1 mb-3`}>
224+
{bill.summary}
225+
</BallotSummaryRow>
226+
) : (
227+
<Row className="mx-1 mb-3">{bill.summary}</Row>
228+
)}
210229
<Row className={`d-flex mx-0 my-1`} xs="auto">
211230
{bill.topics?.map(t => (
212231
<SmartTag key={t.topic} topic={t} />

components/buttons.tsx

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,48 @@ export const CopyButton = ({
341341
)
342342
}
343343

344+
export const ShareLinkButton = ({
345+
text,
346+
tooltipDurationMs = 1000,
347+
children,
348+
format = "text/html",
349+
...props
350+
}: ButtonProps & {
351+
text: string
352+
tooltipDurationMs?: number
353+
format?: string
354+
}) => {
355+
const { t } = useTranslation("common")
356+
const [show, setShow] = useState(false)
357+
const target = useRef(null)
358+
const closeTimeout = useRef<any>()
359+
return (
360+
<>
361+
<CopyToClipboard
362+
text={text}
363+
options={{ format: format }}
364+
onCopy={(_, success) => {
365+
if (success) {
366+
clearTimeout(closeTimeout.current)
367+
setShow(true)
368+
closeTimeout.current = setTimeout(
369+
() => setShow(false),
370+
tooltipDurationMs
371+
)
372+
}
373+
}}
374+
>
375+
<Button ref={target} style={{ color: "#737373" }} variant="" {...props}>
376+
{children}
377+
</Button>
378+
</CopyToClipboard>
379+
<Overlay target={target} show={show} placement="top">
380+
{props => <Tooltip {...props}>{t("copiedToClipboard")}</Tooltip>}
381+
</Overlay>
382+
</>
383+
)
384+
}
385+
344386
export const GearIcon = (
345387
<div className={`py-0`}>
346388
<svg

components/db/bills.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export type BillContent = {
3333
Cosponsors: MemberReference[]
3434
LegislationTypeName: string
3535
Pinslip: string
36-
DocumentText: string
36+
DocumentText?: string
3737
}
3838

3939
export type BillTopic = {

components/hearing/HearingDetails.tsx

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { doc, getDoc } from "firebase/firestore"
1+
import { useRouter } from "next/router"
22
import { Trans, useTranslation } from "next-i18next"
3-
import { useCallback, useEffect, useRef, useState } from "react"
3+
import { useEffect, useRef, useState } from "react"
44
import styled from "styled-components"
55
import { Col, Container, Image, Row } from "../bootstrap"
6-
import { firestore } from "../firebase"
76
import * as links from "../links"
87
import { committeeURL, External } from "../links"
98
import {
@@ -12,7 +11,12 @@ import {
1211
FeatureCalloutButton
1312
} from "../shared/CommonComponents"
1413
import { HearingSidebar } from "./HearingSidebar"
15-
import { HearingData, Paragraph, fetchTranscriptionData } from "./hearing"
14+
import {
15+
HearingData,
16+
Paragraph,
17+
convertToString,
18+
fetchTranscriptionData
19+
} from "./hearing"
1620
import { Transcriptions } from "./Transcriptions"
1721

1822
const LegalContainer = styled(Container)`
@@ -51,9 +55,11 @@ export const HearingDetails = ({
5155
hearingData: HearingData
5256
}) => {
5357
const { t } = useTranslation(["common", "hearing"])
54-
const [transcriptData, setTranscriptData] = useState<Paragraph[] | null>(null)
58+
const router = useRouter()
5559

60+
const [transcriptData, setTranscriptData] = useState<Paragraph[] | null>(null)
5661
const [videoLoaded, setVideoLoaded] = useState(false)
62+
5763
const handleVideoLoad = () => {
5864
setVideoLoaded(true)
5965
}
@@ -63,6 +69,15 @@ export const HearingDetails = ({
6369
videoRef.current ? (videoRef.current.currentTime = value) : null
6470
}
6571

72+
useEffect(() => {
73+
const startTime = router.query.t
74+
const resultString: string = convertToString(startTime)
75+
76+
if (startTime && videoRef.current) {
77+
setCurTimeVideo(parseInt(resultString, 10))
78+
}
79+
}, [router.query.t, videoRef.current])
80+
6681
useEffect(() => {
6782
;(async function () {
6883
if (!videoTranscriptionId || transcriptData !== null) return
@@ -169,6 +184,7 @@ export const HearingDetails = ({
169184

170185
{transcriptData ? (
171186
<Transcriptions
187+
hearingId={hearingId}
172188
transcriptData={transcriptData}
173189
setCurTimeVideo={setCurTimeVideo}
174190
videoLoaded={videoLoaded}

0 commit comments

Comments
 (0)