From 63a165666aaf4cd69a6b31b824c23de17e961271 Mon Sep 17 00:00:00 2001 From: Weiko Date: Thu, 10 Apr 2025 15:36:59 +0200 Subject: [PATCH] fix error messages margin (#11508) ## Context Fixing error messages margin in various places Reset password Screenshot 2025-04-10 at 15 17 00 Api key Screenshot 2025-04-10 at 15 16 21 Also setting overflow on api key label in api keys table Screenshot 2025-04-10 at 15 16 15 --- .../modules/auth/sign-in-up/hooks/useSignInUpForm.ts | 5 +---- .../components/SettingsApiKeysFieldItemTableRow.tsx | 9 +++++++-- .../playground/components/PlaygroundSetupForm.tsx | 12 +++++------- .../modules/ui/input/components/InputErrorHelper.tsx | 2 ++ .../twenty-front/src/pages/auth/PasswordReset.tsx | 8 ++++++-- .../settings/developers/api-keys/SettingsApiKeys.tsx | 8 ++++---- 6 files changed, 25 insertions(+), 19 deletions(-) diff --git a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts index f91f55a33..ace1cbd63 100644 --- a/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts +++ b/packages/twenty-front/src/modules/auth/sign-in-up/hooks/useSignInUpForm.ts @@ -22,10 +22,7 @@ const makeValidationSchema = (signInUpStep: SignInUpStep) => signInUpStep === SignInUpStep.Password ? z .string() - .regex( - PASSWORD_REGEX, - 'Password must contain at least 8 characters', - ) + .regex(PASSWORD_REGEX, 'Password must be min. 8 characters') : z.string().optional(), captchaToken: z.string().default(''), }) diff --git a/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysFieldItemTableRow.tsx b/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysFieldItemTableRow.tsx index 9452a06a1..9e3b080e2 100644 --- a/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysFieldItemTableRow.tsx +++ b/packages/twenty-front/src/modules/settings/developers/components/SettingsApiKeysFieldItemTableRow.tsx @@ -4,7 +4,10 @@ import styled from '@emotion/styled'; import { ApiFieldItem } from '@/settings/developers/types/api-key/ApiFieldItem'; import { TableCell } from '@/ui/layout/table/components/TableCell'; import { TableRow } from '@/ui/layout/table/components/TableRow'; -import { IconChevronRight } from 'twenty-ui/display'; +import { + IconChevronRight, + OverflowingTextWithTooltip, +} from 'twenty-ui/display'; import { MOBILE_VIEWPORT } from 'twenty-ui/theme'; export const StyledApisFieldTableRow = styled(TableRow)` @@ -41,7 +44,9 @@ export const SettingsApiKeysFieldItemTableRow = ({ return ( - {fieldItem.name} + + + { return true; } catch (error) { - throw new Error( - t`Failed to validate API key. Please check your API key and try again.`, - ); + throw new Error(t`Invalid API key`); } }; diff --git a/packages/twenty-front/src/modules/ui/input/components/InputErrorHelper.tsx b/packages/twenty-front/src/modules/ui/input/components/InputErrorHelper.tsx index 51293a7ed..5f3d46909 100644 --- a/packages/twenty-front/src/modules/ui/input/components/InputErrorHelper.tsx +++ b/packages/twenty-front/src/modules/ui/input/components/InputErrorHelper.tsx @@ -4,6 +4,8 @@ import React from 'react'; const StyledInputErrorHelper = styled.div` color: ${({ theme }) => theme.color.red}; font-size: ${({ theme }) => theme.font.size.xs}; + position: absolute; + margin-top: ${({ theme }) => theme.spacing(0.25)}; `; export const InputErrorHelper = ({ diff --git a/packages/twenty-front/src/pages/auth/PasswordReset.tsx b/packages/twenty-front/src/pages/auth/PasswordReset.tsx index f07b822c7..55c0442d0 100644 --- a/packages/twenty-front/src/pages/auth/PasswordReset.tsx +++ b/packages/twenty-front/src/pages/auth/PasswordReset.tsx @@ -36,7 +36,7 @@ const validationSchema = z passwordResetToken: z.string(), newPassword: z .string() - .regex(PASSWORD_REGEX, 'Password must contain at least 8 characters'), + .regex(PASSWORD_REGEX, 'Password must be min. 8 characters'), }) .required(); @@ -71,6 +71,10 @@ const StyledInputContainer = styled.div` margin-bottom: ${({ theme }) => theme.spacing(3)}; `; +const StyledMainButton = styled(MainButton)` + margin-top: ${({ theme }) => theme.spacing(2)}; +`; + export const PasswordReset = () => { const { t } = useLingui(); const { enqueueSnackBar } = useSnackBar(); @@ -237,7 +241,7 @@ export const PasswordReset = () => { /> - theme.spacing(2)}; `;