diff --git a/ui/src/components/Modal/index.tsx b/ui/src/components/Modal/index.tsx index a2c0aa628..f5e369f1c 100644 --- a/ui/src/components/Modal/index.tsx +++ b/ui/src/components/Modal/index.tsx @@ -57,7 +57,7 @@ const Modal = (props: ProjectModalProps) => { const nameValidation = (value: string) => { if (!value) { setInputValue(false); - return; + return 'Project name is required.'; } else if (!/^[^\s].*$/.test(value)) { setInputValue(false); return 'Please enter project name.'; @@ -141,7 +141,7 @@ const Modal = (props: ProjectModalProps) => { maxLength="200" error={(meta?.error || meta?.submitError) && meta?.touched} /> - {meta?.error && ( + {meta.touched && meta.error && ( { },[]); const fetchProjects = async () => { + setLoadStatus(true); if (selectedOrganisation?.value) { const { data, status } = await getAllProjects(selectedOrganisation?.value || ''); //org id will always present if (status === 200) { @@ -171,7 +172,7 @@ const Projects = () => { {loadStatus ? (
{[...Array(20)].map((e, i) => ( - + ))}
) : ( @@ -182,7 +183,7 @@ const Projects = () => { )) )} - {projects && projects?.length === 0 && !searchText && ( + {!loadStatus && projects?.length === 0 && !searchText && allProjects?.length === 0 && (