commit 55ae4dd7036aaab9b40592c81f37e82148434b57
parent 76042e8ddcee595d332c0e9c83b49d2f21895de2
Author: Sebastian <sebasjm@gmail.com>
Date: Fri, 7 Jun 2024 14:03:35 -0300
better regex domain + path
Diffstat:
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx b/packages/merchant-backoffice-ui/src/components/form/InputPaytoForm.tsx
@@ -105,13 +105,12 @@ function validateEthereum_path1(
* bank.com/path/subpath/
*/
const DOMAIN_REGEX =
- /^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9](?:\.[a-zA-Z]{2,})+(:[0-9]+)?(\/[a-zA-Z0-9-.]+)*\/?$/;
+ /^[a-zA-Z0-9][a-zA-Z0-9-_]{1,61}[a-zA-Z0-9-_](?:\.[a-zA-Z0-9-_]{2,})+(:[0-9]+)?(\/[a-zA-Z0-9-.]+)*\/?$/;
function validateTalerBank_path1(
addr: string,
i18n: ReturnType<typeof useTranslationContext>["i18n"],
): string | undefined {
- console.log(addr, DOMAIN_REGEX.test(addr));
try {
const valid = DOMAIN_REGEX.test(addr);
if (valid) return undefined;
diff --git a/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatePage.tsx b/packages/merchant-backoffice-ui/src/paths/instance/otp_devices/create/CreatePage.tsx
@@ -101,7 +101,7 @@ export function CreatePage({ onCreate, onBack }: Props): VNode {
/>
<Input<Entity>
name="otp_device_description"
- label={i18n.str`Descripiton`}
+ label={i18n.str`Descripton`}
tooltip={i18n.str`Useful to identify the device physically`}
/>
<InputSelector<Entity>