From 113f6614c08fe487937b81dc30e21ac789572b30 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Tue, 12 Mar 2024 09:01:26 -0300 Subject: fix #8170 --- packages/bank-ui/src/pages/LoginForm.tsx | 7 ++++--- packages/bank-ui/src/pages/RegistrationPage.tsx | 5 +++-- packages/bank-ui/src/pages/admin/AdminHome.tsx | 17 ++++++++++++----- 3 files changed, 19 insertions(+), 10 deletions(-) (limited to 'packages/bank-ui/src') diff --git a/packages/bank-ui/src/pages/LoginForm.tsx b/packages/bank-ui/src/pages/LoginForm.tsx index a097417c3..337cfc8b1 100644 --- a/packages/bank-ui/src/pages/LoginForm.tsx +++ b/packages/bank-ui/src/pages/LoginForm.tsx @@ -29,6 +29,7 @@ import { useSessionState } from "../hooks/session.js"; import { RouteDefinition } from "../route.js"; import { undefinedIfEmpty } from "../utils.js"; import { doAutoFocus } from "./PaytoWireTransferForm.js"; +import { USERNAME_REGEX } from "./RegistrationPage.js"; /** * Collect and submit login data. @@ -63,9 +64,9 @@ export function LoginForm({ const errors = undefinedIfEmpty({ username: !username ? i18n.str`Missing username` - : // : !USERNAME_REGEX.test(username) - // ? i18n.str`Use letters and numbers only, and start with a lowercase letter` - undefined, + : !USERNAME_REGEX.test(username) + ? i18n.str`Use letters, numbers or any of these characters: - . _ ~` + : undefined, password: !password ? i18n.str`Missing password` : undefined, }); diff --git a/packages/bank-ui/src/pages/RegistrationPage.tsx b/packages/bank-ui/src/pages/RegistrationPage.tsx index 2ade465c2..2ce9d96cc 100644 --- a/packages/bank-ui/src/pages/RegistrationPage.tsx +++ b/packages/bank-ui/src/pages/RegistrationPage.tsx @@ -54,7 +54,8 @@ export function RegistrationPage({ ); } -export const USERNAME_REGEX = /^[a-z][a-zA-Z0-9-]*$/; +// eslint-disable-next-line no-useless-escape +export const USERNAME_REGEX = /^[a-zA-Z0-9\-\.\_\~]*$/; export const PHONE_REGEX = /^(\+\d{1,2}\s)?\(?\d{3}\)?[\s.-]\d{3}[\s.-]\d{4}$/; export const EMAIL_REGEX = /^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/; @@ -86,7 +87,7 @@ function RegistrationForm({ username: !username ? i18n.str`Missing username` : !USERNAME_REGEX.test(username) - ? i18n.str`Use letters and numbers only, and start with a lowercase letter` + ? i18n.str`Use letters, numbers or any of these characters: - . _ ~` : undefined, // phone: !phone // ? undefined diff --git a/packages/bank-ui/src/pages/admin/AdminHome.tsx b/packages/bank-ui/src/pages/admin/AdminHome.tsx index b8b28f8a0..613f5c1ef 100644 --- a/packages/bank-ui/src/pages/admin/AdminHome.tsx +++ b/packages/bank-ui/src/pages/admin/AdminHome.tsx @@ -80,7 +80,6 @@ export function AdminHome({ routeHere={routeCreateWireTransfer} onAuthorizationRequired={onAuthorizationRequired} /> - ; } return ( - +
+
+
+

+ Transaction volume report +

+
+
+
-

+

{i18n.str`Trading volume on ${getDateForTimeframe( params.current, metricType, @@ -423,7 +430,7 @@ function Metrics({ />

- ); } -- cgit v1.2.3