Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .github/workflows/deploy-backend-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,12 @@ jobs:
GCP_SA_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
ASSEMBLY_API_KEY: ${{ secrets.ASSEMBLY_API_KEY }}
PROJECT_ID: digital-testimony-dev

# Update Typesense Schema
- uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- uses: google-github-actions/setup-gcloud@v3
- name: Update Typesense Schema
run: |
gcloud pubsub topics publish --project=digital-testimony-dev checkSearchIndexVersion --message='{"check": true}'
9 changes: 9 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,12 @@ jobs:
GCP_SA_KEY: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
ASSEMBLY_API_KEY: ${{ secrets.ASSEMBLY_API_KEY }}
PROJECT_ID: digital-testimony-prod

# Update Typesense Schema
- uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_KEY }}
- uses: google-github-actions/setup-gcloud@v3
- name: Update Typesense Schema
run: |
gcloud pubsub topics publish --project=digital-testimony-prod checkSearchIndexVersion --message='{"check": true}'
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We are creating a new web platform called MAPLE (the Massachusetts Platform for

## Essentials

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.
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.

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

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

## Links

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

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

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).
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/).
2 changes: 1 addition & 1 deletion components/AboutPagesCard/AboutPagesCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const AboutPagesCard: FC<PropsWithChildren<{ title: string }>> = ({
children
}) => {
return (
<Card className="m-5 rounded-3 bg-white">
<Card className="mx-sm-5 mx-xs-3 my-5 rounded-3 bg-white">
<StyledHeader
as="h1"
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"
Expand Down
6 changes: 2 additions & 4 deletions components/ProfilePage/VerifyAccountSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ export const VerifyAccountSection = ({
return (
<TitledSectionCard title={"Verify Your Account"} className={className}>
<div>
<p className="fw-bold text-info">
{t("verifyAccountSection.verifyAccount")}
</p>
<p className="fw-bold">{t("verifyAccountSection.verifyAccount")}</p>

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

{sendEmailVerification.status !== "success" ? (
<LoadingButton
variant="info"
variant="secondary"
className="text-white"
loading={sendEmailVerification.loading}
onClick={() => sendEmailVerification.execute(user)}
Expand Down
25 changes: 20 additions & 5 deletions components/bill/BillDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,32 @@ import { Back } from "components/shared/CommonComponents"
import { useFlags } from "components/featureFlags"
import { FollowBillButton } from "components/shared/FollowButton"
import { PendingUpgradeBanner } from "components/PendingUpgradeBanner"
import { isCurrentCourt } from "functions/src/shared"
import {
currentBallotInitiativeCommittee,
isCurrentCourt
} from "functions/src/shared"

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

const isPendingUpgrade = useAuth().claims?.role === "pendingUpgrade"
const flags = useFlags()

const { user } = useAuth()

let isBallotMeasure = false
const curComm = bill?.currentCommittee?.id

if (curComm === currentBallotInitiativeCommittee) {
isBallotMeasure = true
}

return (
<>
{isPendingUpgrade && <PendingUpgradeBanner />}
{!isCurrentCourt(bill.court) && (
<Banner>{t("bill.old_session", { billCourt: bill.court })}</Banner>
)}
{isBallotMeasure && <Banner>{t("bill.ballot_initiative")}</Banner>}

<Container className="mt-3 mb-3">
<Row>
Expand Down Expand Up @@ -74,14 +84,19 @@ export const BillDetails = ({ bill }: BillProps) => {
</Col>
</Row>
)}
<Row className="mt-2">
<Row className="my-2">
<Col>
<Summary bill={bill} />
</Col>
</Row>
<Row>
<Row className="mt-4">
<Col md={8}>
<Sponsors bill={bill} className="mt-4 pb-1" />
{isBallotMeasure ? (
<></>
) : (
<Sponsors bill={bill} className="pb-1" />
)}

<BillTestimonies bill={bill} className="mt-4" />
{flags.lobbyingTable && (
<LobbyingTable bill={bill} className="mt-4 pb-1" />
Expand Down
23 changes: 21 additions & 2 deletions components/bill/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ import { SmartIcon } from "./SmartIcon"
import { TestimonyCounts } from "./TestimonyCounts"
import { BillProps } from "./types"
import { BillTopic } from "functions/src/bills/types"
import { currentGeneralCourt } from "functions/src/shared"
import {
currentBallotInitiativeCommittee,
currentGeneralCourt
} from "functions/src/shared"

const Divider = styled(Col)`
width: 2px;
Expand All @@ -30,6 +33,10 @@ const FormattedBillDetails = styled(Col)`
white-space: pre-wrap;
`

const BallotSummaryRow = styled(Row)`
white-space: pre-wrap;
`

const SmartTag = ({ topic }: { topic: BillTopic }) => {
return (
<links.Internal
Expand Down Expand Up @@ -106,6 +113,8 @@ export const Summary = ({
const handleHideBillDetails = () => setShowBillDetails(false)
const billText = bill?.content?.DocumentText
const hearingIds = bill?.hearingIds
const isBallotMeasure =
bill?.currentCommittee?.id === currentBallotInitiativeCommittee

const { showLLMFeatures } = useFlags()

Expand Down Expand Up @@ -203,10 +212,20 @@ export const Summary = ({
<hr className={`m-0 border-bottom border-2`} />
<SmartDisclaimer />
</>
) : bill.summary !== undefined && isBallotMeasure ? (
<>
<hr className={`m-0 mb-3 border-bottom border-2`} />
</>
) : (
<></>
)}
<Row className="mx-1 mb-3">{bill.summary}</Row>
{bill.summary !== undefined && isBallotMeasure ? (
<BallotSummaryRow className={`mx-1 mb-3`}>
{bill.summary}
</BallotSummaryRow>
) : (
<Row className="mx-1 mb-3">{bill.summary}</Row>
)}
<Row className={`d-flex mx-0 my-1`} xs="auto">
{bill.topics?.map(t => (
<SmartTag key={t.topic} topic={t} />
Expand Down
42 changes: 42 additions & 0 deletions components/buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,48 @@ export const CopyButton = ({
)
}

export const ShareLinkButton = ({
text,
tooltipDurationMs = 1000,
children,
format = "text/html",
...props
}: ButtonProps & {
text: string
tooltipDurationMs?: number
format?: string
}) => {
const { t } = useTranslation("common")
const [show, setShow] = useState(false)
const target = useRef(null)
const closeTimeout = useRef<any>()
return (
<>
<CopyToClipboard
text={text}
options={{ format: format }}
onCopy={(_, success) => {
if (success) {
clearTimeout(closeTimeout.current)
setShow(true)
closeTimeout.current = setTimeout(
() => setShow(false),
tooltipDurationMs
)
}
}}
>
<Button ref={target} style={{ color: "#737373" }} variant="" {...props}>
{children}
</Button>
</CopyToClipboard>
<Overlay target={target} show={show} placement="top">
{props => <Tooltip {...props}>{t("copiedToClipboard")}</Tooltip>}
</Overlay>
</>
)
}

export const GearIcon = (
<div className={`py-0`}>
<svg
Expand Down
2 changes: 1 addition & 1 deletion components/db/bills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export type BillContent = {
Cosponsors: MemberReference[]
LegislationTypeName: string
Pinslip: string
DocumentText: string
DocumentText?: string
}

export type BillTopic = {
Expand Down
26 changes: 21 additions & 5 deletions components/hearing/HearingDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { doc, getDoc } from "firebase/firestore"
import { useRouter } from "next/router"
import { Trans, useTranslation } from "next-i18next"
import { useCallback, useEffect, useRef, useState } from "react"
import { useEffect, useRef, useState } from "react"
import styled from "styled-components"
import { Col, Container, Image, Row } from "../bootstrap"
import { firestore } from "../firebase"
import * as links from "../links"
import { committeeURL, External } from "../links"
import {
Expand All @@ -12,7 +11,12 @@ import {
FeatureCalloutButton
} from "../shared/CommonComponents"
import { HearingSidebar } from "./HearingSidebar"
import { HearingData, Paragraph, fetchTranscriptionData } from "./hearing"
import {
HearingData,
Paragraph,
convertToString,
fetchTranscriptionData
} from "./hearing"
import { Transcriptions } from "./Transcriptions"

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

const [transcriptData, setTranscriptData] = useState<Paragraph[] | null>(null)
const [videoLoaded, setVideoLoaded] = useState(false)

const handleVideoLoad = () => {
setVideoLoaded(true)
}
Expand All @@ -63,6 +69,15 @@ export const HearingDetails = ({
videoRef.current ? (videoRef.current.currentTime = value) : null
}

useEffect(() => {
const startTime = router.query.t
const resultString: string = convertToString(startTime)

if (startTime && videoRef.current) {
setCurTimeVideo(parseInt(resultString, 10))
}
}, [router.query.t, videoRef.current])

useEffect(() => {
;(async function () {
if (!videoTranscriptionId || transcriptData !== null) return
Expand Down Expand Up @@ -169,6 +184,7 @@ export const HearingDetails = ({

{transcriptData ? (
<Transcriptions
hearingId={hearingId}
transcriptData={transcriptData}
setCurTimeVideo={setCurTimeVideo}
videoLoaded={videoLoaded}
Expand Down
Loading
Loading