From ef1448ca6a020c2115f701f6c441ab8e220fde5e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 15 Apr 2021 19:31:04 +0100 Subject: [PATCH] Clean up create app modal error messages --- .../src/components/start/CreateAppModal.svelte | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/builder/src/components/start/CreateAppModal.svelte b/packages/builder/src/components/start/CreateAppModal.svelte index d5eb606037..fbc1b8e4d7 100644 --- a/packages/builder/src/components/start/CreateAppModal.svelte +++ b/packages/builder/src/components/start/CreateAppModal.svelte @@ -14,6 +14,7 @@ import analytics from "analytics" import { onMount } from "svelte" import Logo from "/assets/bb-logo.svg" + import { capitalise } from "../../helpers" export let template @@ -24,18 +25,18 @@ const steps = [Info, User] let validators = [ { - applicationName: string().required("Your application must have a name."), + applicationName: string().required("Your application must have a name"), }, { email: string() .email() - .required("Your application needs a first user."), + .required("Your application needs a first user"), password: string().required( - "Please enter a password for your first user." + "Please enter a password for your first user" ), roleId: string() .nullable() - .required("You need to select a role for your user."), + .required("You need to select a role for your user"), }, ] @@ -68,7 +69,7 @@ await obj.validate(values, { abortEarly: false }) } catch (validationErrors) { validationErrors.inner.forEach(error => { - $errors[error.path] = error.message + $errors[error.path] = capitalise(error.message) }) } valid = await obj.isValid(values)