Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/codeforboston/maple into fo…
Browse files Browse the repository at this point in the history
…llowing-tab
  • Loading branch information
mertbagt committed Jan 9, 2023
2 parents 0f27923 + b8087b2 commit 7c282cc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion 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 `#legislative-testimony` channel. Ask to join the Zenhub and Zeplin projects.
Join the [Code for Boston Slack](https://communityinviter.com/apps/cfb-public/default-badge) and our `#maple-testimony` channel. Ask to join the Zenhub and Zeplin projects.

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

Expand Down
8 changes: 4 additions & 4 deletions components/AboutSection/AboutSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ export default function AboutSection() {
>
<AboutInfoCard
title="Who"
bodytext="Anyone can submit testimony to the MA legislature. Legislators tend to value testimony most when it comes from their own constituents, so testimony from MA residents is typically directed to both the committee that is substantively responsible for the bill as well as the legislators (House member and Senator) representing your district."
bodytext="Anyone can submit testimony to the MA legislature. Testimony from MA residents is typically directed to the committee leading the bill and your district House and Senate legislators."
></AboutInfoCard>
<AboutInfoCard
title="When"
bodytext="Committees generally accept testimony up until the hearing date designated for a bill. You can use the bill pages on this website to identify relevant committee dates. Although some committees will accept testimony after this date, for the greatest impact you should submit your testimony before the hearing."
bodytext="MAPLE welcomes testimony at any time, but we recommend submitting your testimony before the scheduled hearing date for the greatest impact. The relevant committee dates are listed on the bill pages of this website. "
></AboutInfoCard>
<AboutInfoCard
title="Why"
bodytext="The key role of testimony is to let your legislators know how you feel about an issue. If you don't share your perspective, it may not be taken into account when policymakers make decisions about the laws that govern all our lives."
bodytext="Let your legislators know how you feel about an issue, so policymakers can make better informed decisions about the laws that govern all our lives."
></AboutInfoCard>
<AboutInfoCard
title="Where"
bodytext="Testimony is generally accepted by committees of the legislature by sending an email to their Chairs. This website, MAPLE, will help you to do this by making it easy to find a bill you want to testify in and then generate an email, which you fully control, which you can then send to the relevant personnel."
bodytext="Testimony is generally accepted by sending an email to the committee Chairs. The MAPLE website will help you easily find a bill you want to testify in and draft an email to send to the relevant personnel."
></AboutInfoCard>
<AboutInfoCard
title="What"
Expand Down
8 changes: 3 additions & 5 deletions components/HearingsScheduled/HearingsScheduled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { useCalendarEvents } from "./calendarEvents"

export type EventData = {
index: number
type: string
type: "hearing" | "session"
name: string
id: number
location: string
Expand Down Expand Up @@ -68,10 +68,8 @@ export const EventCard = ({
</div>
<div>
<p className={styles.name}>
{type === "hearings" ? (
<a title="testing" href={`${hearingBaseURL}${id}`}>
{truncateEntry(name)}
</a>
{type === "hearing" ? (
<a href={`${hearingBaseURL}${id}`}>{truncateEntry(name)}</a>
) : (
<a href={`${sessionBaseURL}${id}`}>{truncateEntry(name)}</a>
)}
Expand Down
12 changes: 9 additions & 3 deletions firestore.rules
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ service cloud.firestore {
allow write: if false;
}
match /profiles/{uid} {
function validUser() {
return request.auth.uid == uid
}

function validRoleChange() {
return !request.resource.data.diff(resource.data).affectedKeys().hasAny(['role'])
}
Expand All @@ -27,7 +31,8 @@ service cloud.firestore {
// Only normal "user" roles can toggle visibility.
// or if the profile is an organization.
allow read: if resource.data.public || request.auth.uid == uid
allow create, update: if request.auth.uid == uid && validRoleChange() && validPublicChange()
allow create: if validUser() && request.resource.data.role == 'user' && request.resource.data.public == false
allow update: if validUser() && validRoleChange() && validPublicChange()
}
// Allow querying publications individually or with a collection group.
match /{path=**}/publishedTestimony/{id} {
Expand All @@ -41,8 +46,9 @@ service cloud.firestore {
allow read, write: if request.auth.uid == uid
}
match /archivedTestimony/{id} {
// Not accessible by users, for record keeping.
allow read, write: if false
// Publicly readable, for posterity.
allow read: if true
allow write: if false
}
}
}
Expand Down

0 comments on commit 7c282cc

Please sign in to comment.