diff --git a/packages/backend/src/graphql/schema.graphql b/packages/backend/src/graphql/schema.graphql index 76bf8310..da9702a7 100644 --- a/packages/backend/src/graphql/schema.graphql +++ b/packages/backend/src/graphql/schema.graphql @@ -429,7 +429,6 @@ input StepInput { type User { id: String fullName: String - password: String email: String role: String createdAt: String diff --git a/packages/web/src/components/LoginForm/index.tsx b/packages/web/src/components/LoginForm/index.tsx index b2354c31..fab8fae2 100644 --- a/packages/web/src/components/LoginForm/index.tsx +++ b/packages/web/src/components/LoginForm/index.tsx @@ -1,7 +1,8 @@ import * as React from 'react'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, Link as RouterLink } from 'react-router-dom'; import { useMutation } from '@apollo/client'; import Paper from '@mui/material/Paper'; +import Link from '@mui/material/Link'; import Typography from '@mui/material/Typography'; import LoadingButton from '@mui/lab/LoadingButton'; @@ -10,7 +11,6 @@ import * as URLS from 'config/urls'; import { LOGIN } from 'graphql/mutations/login'; import Form from 'components/Form'; import TextField from 'components/TextField'; -import { Link } from './style.ee'; function renderFields(props: { loading: boolean }) { const { loading = false } = props; @@ -52,8 +52,10 @@ function renderFields(props: { loading: boolean }) { - Don't have an Automatisch account yet? - Sign Up + Don't have an Automatisch account yet?  + + Sign up + ); diff --git a/packages/web/src/components/LoginForm/style.ee.ts b/packages/web/src/components/LoginForm/style.ee.ts deleted file mode 100644 index a49e5c6e..00000000 --- a/packages/web/src/components/LoginForm/style.ee.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { styled } from '@mui/material/styles'; -import { Link as RouterLink } from 'react-router-dom'; - -export const Link = styled(RouterLink)(({theme}) => ({ - textDecoration: 'underline', - marginLeft: theme.spacing(0.5) -})); \ No newline at end of file diff --git a/packages/web/src/components/SignUpForm/index.ee.tsx b/packages/web/src/components/SignUpForm/index.ee.tsx index e3ed3726..eb7a55f6 100644 --- a/packages/web/src/components/SignUpForm/index.ee.tsx +++ b/packages/web/src/components/SignUpForm/index.ee.tsx @@ -13,15 +13,16 @@ import Form from 'components/Form'; import TextField from 'components/TextField'; import { yupResolver } from '@hookform/resolvers/yup'; import { LOGIN } from 'graphql/mutations/login'; +import useFormatMessage from 'hooks/useFormatMessage'; const validationSchema = yup.object().shape({ - fullName: yup.string().trim().required(), - email: yup.string().trim().email().required(), - password: yup.string().required(), + fullName: yup.string().trim().required('signupForm.mandatoryInput'), + email: yup.string().trim().email().required('signupForm.mandatoryInput'), + password: yup.string().required('signupForm.mandatoryInput'), confirmPassword: yup .string() - .required() - .oneOf([yup.ref('password')], 'Passwords must match'), + .required('signupForm.mandatoryInput') + .oneOf([yup.ref('password')], 'signupForm.passwordMustMatch'), }); const initialValues = { @@ -34,6 +35,7 @@ const initialValues = { function SignUpForm() { const navigate = useNavigate(); const authentication = useAuthentication(); + const formatMessage = useFormatMessage(); const [createUser] = useMutation(CREATE_USER); const [login, { loading }] = useMutation(LOGIN); @@ -75,7 +77,7 @@ function SignUpForm() { }} gutterBottom > - Sign Up + {formatMessage('signupForm.title')}
( <> - - + + @@ -144,7 +165,7 @@ function SignUpForm() { fullWidth data-test="signUp-button" > - Sign Up + {formatMessage('signupForm.submit')} )} diff --git a/packages/web/src/locales/en.json b/packages/web/src/locales/en.json index e900e543..ff647d2b 100644 --- a/packages/web/src/locales/en.json +++ b/packages/web/src/locales/en.json @@ -94,5 +94,13 @@ "webhookUrlInfo.title": "Your webhook URL", "webhookUrlInfo.description": "You'll need to configure your application with this webhook URL.", "webhookUrlInfo.helperText": "We've generated a custom webhook URL for you to send requests to. Learn more about webhooks.", - "webhookUrlInfo.copy": "Copy" -} \ No newline at end of file + "webhookUrlInfo.copy": "Copy", + "signupForm.title": "Sign up", + "signupForm.fullNameFieldLabel": "Full name", + "signupForm.emailFieldLabel": "Email", + "signupForm.passwordFieldLabel": "Password", + "signupForm.confirmPasswordFieldLabel": "Confirm password", + "signupForm.submit": "Sign up", + "signupForm.passwordMustMatch": "Passwords must match.", + "signupForm.mandatoryInput": "{inputName} is required." +}