diff --git a/packages/backend/test/fixtures/users.json b/packages/backend/test/fixtures/users.json index 118beba5..37d26909 100644 --- a/packages/backend/test/fixtures/users.json +++ b/packages/backend/test/fixtures/users.json @@ -1,19 +1,19 @@ [ { "id": "59f4355d-9549-4aac-9b54-eeefceeabef0", - "name": "Snowball", + "name": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", "email": "snowball@snowballtools.xyz", "isVerified": true }, { "id": "e505b212-8da6-48b2-9614-098225dab34b", - "name": "Alice Anderson", + "name": "0xbe0eb53f46cd790cd13851d5eff43d12404d33e8", "email": "alice@snowballtools.xyz", "isVerified": true }, { "id": "cd892fad-9138-4aa2-a62c-414a32776ea7", - "name": "Bob Banner", + "name": "0x8315177ab297ba92a06054ce80a67ed4dbd7ed3a", "email": "bob@snowballtools.xyz", "isVerified": true } diff --git a/packages/frontend/src/components/projects/create/ProjectRepoCard.tsx b/packages/frontend/src/components/projects/create/ProjectRepoCard.tsx index 77099d0a..59a9d57d 100644 --- a/packages/frontend/src/components/projects/create/ProjectRepoCard.tsx +++ b/packages/frontend/src/components/projects/create/ProjectRepoCard.tsx @@ -1,7 +1,8 @@ import React, { useCallback } from 'react'; +import toast from 'react-hot-toast'; import { useNavigate, useParams } from 'react-router-dom'; -import { Chip, IconButton } from '@material-tailwind/react'; +import { Chip, IconButton, Spinner } from '@material-tailwind/react'; import { relativeTimeISO } from '../../../utils/time'; import { GitRepositoryDetails } from '../../../types'; @@ -14,6 +15,7 @@ interface ProjectRepoCardProps { const ProjectRepoCard: React.FC = ({ repository }) => { const client = useGQLClient(); const navigate = useNavigate(); + const [isLoading, setIsLoading] = React.useState(false); const { orgSlug } = useParams(); @@ -22,6 +24,7 @@ const ProjectRepoCard: React.FC = ({ repository }) => { return; } + setIsLoading(true); const { addProject } = await client.addProject(orgSlug!, { name: `${repository.owner!.login}-${repository.name}`, prodBranch: repository.default_branch!, @@ -30,7 +33,13 @@ const ProjectRepoCard: React.FC = ({ repository }) => { template: 'webapp', }); - navigate(`import?projectId=${addProject.id}`); + if (Boolean(addProject)) { + setIsLoading(false); + navigate(`import?projectId=${addProject.id}`); + } else { + setIsLoading(false); + toast.error('Failed to create project'); + } }, [client, repository]); return ( @@ -53,9 +62,13 @@ const ProjectRepoCard: React.FC = ({ repository }) => {

{repository.updated_at && relativeTimeISO(repository.updated_at)}

-
- {'>'} -
+ {isLoading ? ( + + ) : ( +
+ {'>'} +
+ )} ); }; diff --git a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx index 60bc1237..e57a5302 100644 --- a/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx +++ b/packages/frontend/src/components/projects/project/deployments/DeploymentDetailsCard.tsx @@ -87,18 +87,12 @@ const DeploymentDetailsCard = ({ }; return ( -
-
+
+
{deployment.url && ( {deployment.url} )} - ^} - />
{deployment.environment === Environment.Production @@ -107,13 +101,21 @@ const DeploymentDetailsCard = ({
+ ^} + /> +
+
^ {deployment.branch} ^ {deployment.commitHash.substring(0, SHORT_COMMIT_HASH_LENGTH)}{' '} {deployment.commitMessage}
-
+
^ {relativeTimeMs(deployment.createdAt)} ^ {deployment.createdBy.name} diff --git a/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx b/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx index 39d18fa9..8846b47c 100644 --- a/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx +++ b/packages/frontend/src/components/projects/project/deployments/FilterForm.tsx @@ -44,18 +44,18 @@ const FilterForm = ({ value, onChange }: FilterFormProps) => { }, [value]); return ( -
-
+
+
setSearchedBranch(event.target.value)} />
-
+
-
+