Skip to content

Commit

Permalink
feat: Add name validation for project creation, removed the descripti…
Browse files Browse the repository at this point in the history
…on validation (#50)
  • Loading branch information
kanak8278 authored Jul 25, 2024
1 parent 834c15a commit da0aa15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions studio/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions studio/src/pages/home-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit da0aa15

Please sign in to comment.