Skip to content

Legislator Profile Type#2166

Open
ACoullard wants to merge 7 commits into
codeforboston:mainfrom
ACoullard:AC/legislator-accounts
Open

Legislator Profile Type#2166
ACoullard wants to merge 7 commits into
codeforboston:mainfrom
ACoullard:AC/legislator-accounts

Conversation

@ACoullard

@ACoullard ACoullard commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Addresses issue #2137

  • Adds in new profile types legislator and pendingLegislator (mirroring organizations) as well as new routes to interact with this new account type and track which MA legislators already have profiles linked to them.
  • Adds in a new card to the sign up modal for creating a legislator account, a new modal to input email, password, pick legislator, etc.
  • Updates icons for signup modal. These icons are also used in places like the default profile icon.

Checklist

  • On the frontend, I've made my strings translate-able.
  • If I've added shared components, I've added a storybook story.
  • I've made pages responsive and look good on mobile.
  • If I've added new Firestore queries, I've added any new required indexes to firestore.indexes.json (Please do not only create indexes through the Firebase Web UI, even though the error messages may recommend it - indexes created this way may be obliterated by subsequent deploys)

Screenshots

Desktop

image

Mobile

image

Known issues

If you've run against limitations or caveats, include them here. Include follow-up issues as well.

Steps to test/reproduce

  1. Go to the home page

  2. Start the sign up flow

  3. select "Legislator"

  4. select a legislator from the drop down. This should filter our already selected legislators

  5. Complete the sign up process normally

  6. Check to ensure you cannot post testimony and the legislator specific message appears.

  7. Log in as an admin

  8. Check the PENDINGLEGISLATORS requests in the Upgrade Requests tab of the admin portal

  9. Approve your new legislator account

  10. Check to see that you can post testimony and all blocks are cleared

  11. Go to the home page

  12. Click on a testimony

  13. See that it's loaded with a loading spinner

@vercel

vercel Bot commented Jun 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
maple-dev Ready Ready Preview, Comment Jun 24, 2026 3:02am

Request Review

@ACoullard ACoullard force-pushed the AC/legislator-accounts branch from 03a2c84 to f35f619 Compare June 24, 2026 00:12
@ACoullard ACoullard marked this pull request as ready for review June 24, 2026 00:26
@ACoullard ACoullard changed the title Ac/legislator accounts Legislator Profile Type Jun 24, 2026

@Mephistic Mephistic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start here - I love how neatly the member search. box slots into the signup form.

I think now that we've got a working prototype, we have seen some grey areas in the Ticket that we should clear up at hack night before moving forward.

case "pendingLegislator":
case "admin":
return false
case "legislator":

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: We probably want "legislator" accounts to be public by default - the main reason legislators would make accounts is to communicate their stances to constituents.

<Modal.Body>
<Col md={12} className="mx-auto">
<Stack gap={2} direction="vertical">
<Stack gap={4} direction="vertical">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may need to play with the bootstrap columns a bit more - this seems to work fine for small and large screens, but there is a middle breakpoint that causes the Legislator button to spill over the modal:

Image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth looping in Grace if this ends up being a design question about how to make this look good at that breakpoint instead of a css bug.

useCreateLegislatorWithEmailAndPassword()

const { index } = useMemberSearch()
const { claimedCodes } = useClaimedMemberCodes()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the thought you put into the user experience here, but I think we can get away without excluding already claimed member codes. Any legitimate legislator will only try to claim themselves (and we have a search input to help them find themselves) and any illegitimate user doesn't deserve a good user experience.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think it may be more helpful in the admin view than the user-facing view.

It's possible more than one person will submit a request for a given legislator (possibly, but not necessarily maliciously - it could be the legislator and a staffer requesting from different email addresses). In that case, I think it's fine to let the users submit what they want and let the admins sort out the real deal.

(It's also possible the real legislator tries to claim the account second - so it may be desirable to leave their name in the select box so they can more easily contest ownership)

If so, we do want the MAPLE admin to know if there are multiple requests for a given member (even if one request has been previously accepted) - we should expose that in the admin interface for additional context.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does raise an issue about user verification I'd love to discuss:

  • Should we allow unverified users to be approved as legislators? (e.g. I sign up for a Rebecca Rausch legislator profile with her statehouse email, a MAPLE admin sees the request and approves it, and then I can post anything I want as Rebecca Rausch)
    • Seems like the answer shoud be no
    • Instead, I feel that the flow should be:
      • User signs up as a Pending Legislator
      • We tell them they must verify their email
      • Only after they verify their email does their account show up as "Pending Legislator" in the MAPLE admin view
        • IMO there's not a quick way to hook into the email verification flow (we host those links in an unconventional way, so it might be easiest to just hide pendingLegislator profiles with email_verified: false from the admin view
      • The MAPLE admin accepts them
      • The account is fully upgraded to Legislator status

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a nice-to-have (that may or may not make things easier in this PR, so I'll bring it up anyway):

  • Should we have special handling for government email addresses?
    • On the one hand, it would be a nice UX boost to auto-fill the appropriate legislator when the user uses their government email (e.g. my_legislator@ma.senate.gov) and we could even auto-approve requests to claim a legislator from a verified government email address (to cut down on the worklog for our admins)
    • On the other, they may not actually want to use their government email for things like this (e.g. preferring a personal/campaign email, or a staffer's email).

@mvictor55 How do you plan to approve/reject legislator profile requests? Do we need them to sign up with their government email so we have some proof they're real, or are there other signals we should look/ask for? We should discuss this at hack night.

refresh()
}

async function handleAcceptLegislator(record: any) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comments on the LegislatorProfileForm are probably relevant here too - but to reiterate:

  • We should filter out requests from users that aren't email_verified: true - if we don't even require email verification, then we have no signal to determine that anyone is actually connected to the legislator in question
  • We should surface if there are multiple requests for the same member (including a closed request if it was accepted and the Legislator is currently claimed). This may change if Matt V has other signals he'll be looking for to determine whether to accept these requests besides email address, but an admin should be able to see at a glance how many people are claiming ownership of one Legislator (so they at least know there's a conflict and don't auto-approve without realizing the ownership is contested).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants