Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ui/src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.';
Expand Down Expand Up @@ -141,7 +141,7 @@ const Modal = (props: ProjectModalProps) => {
maxLength="200"
error={(meta?.error || meta?.submitError) && meta?.touched}
/>
{meta?.error && (
{meta.touched && meta.error && (
<ValidationMessage
testId="cs-description-error"
className="mt-2"
Expand Down
7 changes: 4 additions & 3 deletions ui/src/pages/Projects/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Libraries
import { useEffect, useState } from 'react';
import { PageLayout, EmptyState, Button, Icon, cbModal } from '@contentstack/venus-components';
import { PageLayout, EmptyState, Button, Icon, cbModal, StackCardSkeleton} from '@contentstack/venus-components';
import { jsonToHtml } from '@contentstack/json-rte-serializer';
import HTMLReactParser from 'html-react-parser';
import { useLocation } from 'react-router-dom';
Expand Down Expand Up @@ -67,6 +67,7 @@ const Projects = () => {
},[]);

const fetchProjects = async () => {
setLoadStatus(true);
if (selectedOrganisation?.value) {
const { data, status } = await getAllProjects(selectedOrganisation?.value || ''); //org id will always present
if (status === 200) {
Expand Down Expand Up @@ -171,7 +172,7 @@ const Projects = () => {
{loadStatus ? (
<div className="flex-wrap">
{[...Array(20)].map((e, i) => (
<CardList key={i} />
<StackCardSkeleton key={i} />
))}
</div>
) : (
Expand All @@ -182,7 +183,7 @@ const Projects = () => {
))
)}

{projects && projects?.length === 0 && !searchText && (
{!loadStatus && projects?.length === 0 && !searchText && allProjects?.length === 0 && (
<EmptyState
forPage="emptyStateV2"
heading={emptystate?.heading}
Expand Down