From da0aa15c2b2239350eb7d24ea62bdbec054d3b32 Mon Sep 17 00:00:00 2001 From: Kanak Raj Date: Thu, 25 Jul 2024 13:34:12 +0530 Subject: [PATCH] feat: Add name validation for project creation, removed the description validation (#50) --- studio/src/locales/en.json | 1 + studio/src/pages/home-page.tsx | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/studio/src/locales/en.json b/studio/src/locales/en.json index a997928..9199e2b 100644 --- a/studio/src/locales/en.json +++ b/studio/src/locales/en.json @@ -14,6 +14,7 @@ "callbackForm": "Callback Form", "resetChat": "Reset/Start Chat", "homePage.nameAndDescriptionAlert": "Please enter a name and description", + "homePage.nameRequiredAlert": "Please enter a name for the project", "homePage.deleteProjectError": "Error in deleting project, Please try again later!", "homePage.dslFileUploadMessage": "If you would like to clone, you can upload an existing program (DSL)", "editorPage.devModeHeader": "Dev Mode", diff --git a/studio/src/pages/home-page.tsx b/studio/src/pages/home-page.tsx index 6d1f8d2..1b52cf3 100644 --- a/studio/src/pages/home-page.tsx +++ b/studio/src/pages/home-page.tsx @@ -210,8 +210,9 @@ export const HomePage: React.FunctionComponent = () => { const copyTemplate = (copyTemplateValues: any) => { try { if (token) { - if (copyTemplateValues.name.trim() === '' || copyTemplateValues.description.trim() === '') { - alert(t('homePage.nameAndDescriptionAlert')); + if (copyTemplateValues.name.trim() === '') { + alert(t('homePage.nameRequiredAlert')); + return; } if (disabled) return setDisabled(true)