diff --git a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx index 4bbb86c2e..facf49a4a 100644 --- a/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx +++ b/components/LegislatorProfile/SidebarComponents/UpcomingHearings.tsx @@ -78,20 +78,18 @@ export function UpcomingHearings({ committeeList }: { committeeList: any[] }) { } } - const LegislatorCommitteCodes = committeeList.map(code => code.CommitteeCode) + const LegislatorCommitteeCodes = committeeList.map(code => code.CommitteeCode) let legislatorEvents: any[] = [] if (events) { eventList.forEach(event => { - if (LegislatorCommitteCodes.includes(event.code)) { + if (LegislatorCommitteeCodes.includes(event.code)) { legislatorEvents.push(event) } }) } - console.log("legislatorEvents", legislatorEvents) - return ( {t("upcomingHearings")} diff --git a/pages/dev/token.tsx b/pages/dev/token.tsx index 074bb7012..6cac3a8d6 100644 --- a/pages/dev/token.tsx +++ b/pages/dev/token.tsx @@ -11,10 +11,12 @@ * 4. Click "Copy" and paste into your curl / MCP client */ +import { Trans, useTranslation } from "next-i18next" +import React, { useState, useCallback } from "react" import { useAuth } from "components/auth" +import { Internal } from "components/links" import { createPage } from "components/page" import { createGetStaticTranslationProps } from "components/translations" -import React, { useState, useCallback } from "react" function TokenPage() { const { user } = useAuth() @@ -23,6 +25,8 @@ function TokenPage() { const [copied, setCopied] = useState(false) const [error, setError] = useState(null) + const { t } = useTranslation("auth") + const getToken = useCallback(async () => { if (!user) return setError(null) @@ -50,13 +54,18 @@ function TokenPage() { if (!user) { return (
-

Firebase ID Token

+

{t("firebaseIdToken")}

- ⚠️ You are not signed in. Please{" "} - - sign in - {" "} - first. + {/* eslint-disable i18next/no-literal-string */} + ⚠️ {t("notSignedIn")}{" "} + + {t("signIn")} + {" "} + {t("first")} + {/* eslint-enable i18next/no-literal-string */}

) @@ -64,19 +73,16 @@ function TokenPage() { return (
-

Firebase ID Token

+

{t("firebaseIdToken")}

- Signed in as {user.email ?? user.uid} + {t("signedInAs.1")} + {user.email ?? user.uid}

-

- Use this token to connect an MCP client (e.g. Claude Code) to the MAPLE - MCP server. Paste it into your client config as shown below, then - reconnect. -

+

{t("signedInAs.2")}

-

Claude Code / .mcp.json

+

{t("signedInAs.3")}

         {`{
   "mcpServers": {
@@ -103,7 +109,12 @@ function TokenPage() {
         )}
       
- {error &&

Error: {error}

} + {error && ( +

+ {t("error")} + {error} +

+ )} {token && ( <> @@ -114,31 +125,28 @@ function TokenPage() { onClick={e => (e.target as HTMLTextAreaElement).select()} />

- ⏱ Expires: {expiry} + {t("expires.1")} + {expiry}

)}

- ⏱ Tokens expire after 1 hour. Return here and click - “Refresh Token” when yours expires, then update your - client config with the new value. + }} t={t} />

- 🔑 Need a long-lived token? Organisations and - persistent integrations can request an agent key — a - non-expiring credential stored in Firestore — from the MAPLE team. - Agent keys work in the same{" "} - Authorization: Bearer header - and never need refreshing. + , italics: }} + t={t} + /> + {t("expires.4")} + {t("expires.5")}

-

- 🔒 Do not share your token. It grants access to the MAPLE MCP server on - behalf of your account. -

+

{t("expires.6")}

) } diff --git a/public/locales/en/auth.json b/public/locales/en/auth.json index 488a70ecc..c4b3179bf 100644 --- a/public/locales/en/auth.json +++ b/public/locales/en/auth.json @@ -1,96 +1,113 @@ { - "signUp": "Sign Up", - "signIn": "Sign In", - "signOut": "Sign Out", - "signUpOrIn": "Sign Up or Sign In", - "logInSignUp": "Log in / Sign up", + "addVoice": "Add your voice to the conversation by becoming a member!", + "agreeRequired": "In order to continue you must agree to the privacy policy and terms of use", + "agreeSignUp": "Agree and Sign Up", "altLogInSignUp": "Sign in to Testify", - "logInPrompt": "Please log in", - "continue": "Continue", + "almostThere": "Almost there!", "cancel": "Cancel", - "email": "Email", - "password": "Password", - "confirmPassword": "Confirm Password", - "forgotPassword": "Forgot your password?", - "forgotPassword2": "Forgot password?", - "addVoice": "Add your voice to the conversation by becoming a member!", - "mailboxImgAlt": "Mail entering mailbox", "checkInbox": "Check your inbox! If you don't see anything, be sure to check your spam folder.", + "confirmPassword": "Confirm Password", + "continue": "Continue", + "continueGoogle": "Continue with Google", + "email": "Email", "emailedLink": "We'll email you with a link to reset it.", "emailIsRequired": "An email is required.", - "sendRecovery": "Send Recovery Email", - "signUpAsOrg": "Sign Up As An Organization", - "orgEmail": "Organization Email", - "orgName": "Organization Name", - "fullName": "Full Name", - "nameIsRequired": "A full name is required", "errEmptyAndMinLength": "Should have at least two characters", - "selectOrgCat": "Select an organization category", - "passwordRequired": "A password is required.", - "passwordLength": "Your password must be 8 characters or longer.", - "mustConfirmPassword": "You must confirm your password.", - "mustMatch": "Confirmed password must match password.", - "registerAs": "Register as", - "individualUser": "Individual User", + "error": "Error: ", + "establishedPolicy": "We have established this Privacy Policy so you can understand the care with which we intend to treat your personal information.", + "expires": { + "1": "⏱ Expires: ", + "2": "⏱ Tokens expire after 1 hour. Return here and click “Refresh Token” when yours expires, then update your client config with the new value.", + "3": "🔑 Need a long-lived token? Organisations and persistent integrations can request an agent key — a non-expiring credential stored in Firestore — from the MAPLE team. Agent keys work in the same ", + "4": "Authorization: Bearer", + "5": " header and never need refreshing.", + "6": "🔒 Do not share your token. It grants access to the MAPLE MCP server on behalf of your account." + }, + "firebaseIdToken": "Firebase ID Token", + "first": "first", + "forgotPassword": "Forgot your password?", + "forgotPassword2": "Forgot password?", + "fullName": "Full Name", "individualDescription": "An individual user, which also includes any non-incorporated Massachusetts based organizations", + "individualUser": "Individual User", + "infoShared": "Everything you share with us, other than your email and password, will be available on our website, MAPLE.", + "infoStored": "We store your name, email address, state representative, senator, and password.", + "justLogIn": "You’ll be redirected automatically after logging in.", + "logInPrompt": "Please log in", + "logInSignUp": "Log in / Sign up", + "mailboxImgAlt": "Mail entering mailbox", + "mustConfirmPassword": "You must confirm your password.", + "mustMatch": "Confirmed password must match password.", + "nameIsRequired": "A full name is required", + "newsletterInfo": "We may send newsletters via email to MAPLE members. You can unsubscribe from these newsletters at any time by using the 'Unsubscribe' link in the emails themselves. We never share with or sell your email to third party providers.", + "noSale": "We do not and will not sell any of your personal information.", + "notSignedIn": "You are not signed in. Please", + "or": "or", "org": "Organization", "orgDescription": "Only available for incorporated Massachusetts Organizations", - "orgVetting": "All Organization types have to go through a request and approval process ran by MAPLE admins. Once your request has been approved you will recieve an email and be granted access into MAPLE", - "profileIcon": "Profile Icon", - "or": "or", - "continueGoogle": "Continue with Google", + "orgEmail": "Organization Email", + "orgName": "Organization Name", + "orgVetting": "All Organization types have to go through a request and approval process ran by MAPLE admins. Once your request has been approved you will recieve an email and be granted access into MAPLE", + "password": "Password", + "passwordLength": "Your password must be 8 characters or longer.", + "passwordRequired": "A password is required.", + "phoneVerification": { + "codePlaceholder": "Enter six-digit code", + "enterVerificationCode": "Please enter the verification code.", + "errors": { + "credentialAlreadyInUse": "This phone number is already linked to another account.", + "invalidPhoneNumber": "Please enter a valid phone number\n(e.g. 617 555-1234).", + "operationNotAllowed": "Phone verification is not enabled. Please try again later or contact us at info@mapletestimony.org.", + "providerAlreadyLinked": "This account already has a phone number linked." + }, + "phonePlaceholder": "Enter your 10-digit phone number", + "receiveCode": "Receive code", + "signedInRequired": "You must be signed in to verify your phone.", + "stepOne": "Step one.", + "stepOneDescription": "Enter your phone number below.", + "stepTwo": "Step two.", + "stepTwoDescription": "Enter the code that was sent to your phone.", + "successMessage": "Success! Your phone number has been verified.", + "verify": "Verify" + }, + "phoneVerificationModalTitle": "Verify Phone", + "pleaseConsider": "Please consider logging in first:", "privacyAndTerms": "Privacy Policy & Terms", "privacyPolicy": "Privacy Policy", + "probablySignedOut": "You were possibly signed out while trying to go to a page that needs to be signed in to function", + "profileIcon": "Profile Icon", "readMore": "Read More", - "establishedPolicy": "We have established this Privacy Policy so you can understand the care with which we intend to treat your personal information.", - "infoStored": "We store your name, email address, state representative, senator, and password.", - "infoShared": "Everything you share with us, other than your email and password, will be available on our website, MAPLE.", - "noSale": "We do not and will not sell any of your personal information.", - "TOS": "Terms of Service", - "userUnderstands": "You understand that by submitting your testimony to MAPLE you are making it available to MAPLE under an express license that allows reproduction.", - "newsletterInfo": "We may send newsletters via email to MAPLE members. You can unsubscribe from these newsletters at any time by using the 'Unsubscribe' link in the emails themselves. We never share with or sell your email to third party providers.", - "agreeRequired": "In order to continue you must agree to the privacy policy and terms of use", - "agreeSignUp": "Agree and Sign Up", - "subscribeNewsletter": "Click here to subscribe to our newsletter", - "verifyEmail": "Verify your email address", - "verifyLinkSent": "Please verify your email for your account by clicking the verification link we sent to your email. You will be required to verify your email before submitting testimony.", + "registerAs": "Register as", + "sendRecovery": "Send Recovery Email", + "selectOrgCat": "Select an organization category", "setUpProfile": "Set Up Your Profile", - "probablySignedOut": "You were possibly signed out while trying to go to a page that needs to be signed in to function", - "pleaseConsider": "Please consider logging in first:", + "signedInAs": { + "1": "Signed in as ", + "2": "Use this token to connect an MCP client (e.g. Claude Code) to the MAPLE MCP server. Paste it into your client config as shown below, then reconnect.", + "3": "Claude Code / .mcp.json" + }, + "signIn": "Sign In", "signInToAccess": "Login required to access the content", - "almostThere": "Almost there!", - "justLogIn": "You’ll be redirected automatically after logging in.", + "signOut": "Sign Out", + "signUp": "Sign Up", + "signUpAsOrg": "Sign Up As An Organization", + "signUpOrIn": "Sign Up or Sign In", + "subscribeNewsletter": "Click here to subscribe to our newsletter", + "TOS": "Terms of Service", + "userUnderstands": "You understand that by submitting your testimony to MAPLE you are making it available to MAPLE under an express license that allows reproduction.", "verifyAccountSection": { - "title": "Verify Account", + "checkEmail": "Check your email!", "description": "MAPLE requires our users to verify both their email address and phone number to be able to post testimony on our platform. We do this in an effort to reduce the number of bots that are able to publish on MAPLE.", "emailHeader": "Email address", + "phoneDescription": "Receive a verification code on your phone", + "phoneHeader": "Phone number", + "sendAnotherLink": "Resend link", + "successMessage": "Successfully verified. Thank you!", + "title": "Verify Account", "verifyEmail": "Click the link in your email inbox from MAPLE.", "verifyEmailSpam": "If you don’t see it, be sure to check your spam folder.", - "checkEmail": "Check your email!", - "sendAnotherLink": "Resend link", - "phoneHeader": "Phone number", - "phoneDescription": "Receive a verification code on your phone", - "verifyPhone": "Verify", - "successMessage": "Successfully verified. Thank you!" + "verifyPhone": "Verify" }, - "phoneVerificationModalTitle": "Verify Phone", - "phoneVerification": { - "stepOne": "Step one.", - "stepOneDescription": "Enter your phone number below.", - "phonePlaceholder": "Enter your 10-digit phone number", - "receiveCode": "Receive code", - "stepTwo": "Step two.", - "stepTwoDescription": "Enter the code that was sent to your phone.", - "codePlaceholder": "Enter six-digit code", - "verify": "Verify", - "errors": { - "credentialAlreadyInUse": "This phone number is already linked to another account.", - "providerAlreadyLinked": "This account already has a phone number linked.", - "invalidPhoneNumber": "Please enter a valid phone number\n(e.g. 617 555-1234).", - "operationNotAllowed": "Phone verification is not enabled. Please try again later or contact us at info@mapletestimony.org." - }, - "signedInRequired": "You must be signed in to verify your phone.", - "enterVerificationCode": "Please enter the verification code.", - "successMessage": "Success! Your phone number has been verified." - } + "verifyEmail": "Verify your email address", + "verifyLinkSent": "Please verify your email for your account by clicking the verification link we sent to your email. You will be required to verify your email before submitting testimony." } \ No newline at end of file