diff --git a/packages/backend/src/database.ts b/packages/backend/src/database.ts index 5b681c3f..7bcd77bc 100644 --- a/packages/backend/src/database.ts +++ b/packages/backend/src/database.ts @@ -144,6 +144,7 @@ export class Database { .leftJoinAndSelect('deployments.createdBy', 'user') .leftJoinAndSelect('deployments.domain', 'domain') .leftJoinAndSelect('project.owner', 'owner') + .leftJoinAndSelect('project.deployers', 'deployers') .leftJoinAndSelect('project.organization', 'organization') .where('project.id = :projectId', { projectId diff --git a/packages/backend/src/schema.gql b/packages/backend/src/schema.gql index 1d788b67..4a63e584 100644 --- a/packages/backend/src/schema.gql +++ b/packages/backend/src/schema.gql @@ -72,7 +72,7 @@ type Project { repository: String! prodBranch: String! description: String - deployerLrns: [String] + deployers: [Deployer!] auctionId: String fundsReleased: Boolean template: String diff --git a/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx b/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx index 5367553d..3a15caf0 100644 --- a/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx +++ b/packages/frontend/src/components/projects/project/overview/Activity/AuctionCard.tsx @@ -1,5 +1,5 @@ import { useCallback, useEffect, useState } from 'react'; -import { Auction, Project } from 'gql-client'; +import { Auction, Deployer, Project } from 'gql-client'; import { Dialog, @@ -19,7 +19,7 @@ const WAIT_DURATION = 5000; export const AuctionCard = ({ project }: { project: Project }) => { const [auctionStatus, setAuctionStatus] = useState(''); - const [deployerLrns, setDeployerLrns] = useState([]); + const [deployers, setDeployers] = useState([]); const [fundsStatus, setFundsStatus] = useState(false); const [auctionDetails, setAuctionDetails] = useState(null); const [openDialog, setOpenDialog] = useState(false); @@ -36,7 +36,7 @@ export const AuctionCard = ({ project }: { project: Project }) => { const result = await client.getAuctionData(project.auctionId); setAuctionStatus(result.status); setAuctionDetails(result); - setDeployerLrns(project.deployerLrns); + setDeployers(project.deployers); setFundsStatus(project.fundsReleased); }, []); @@ -52,7 +52,7 @@ export const AuctionCard = ({ project }: { project: Project }) => { // Wait for 5 secs since the project is not immediately updated with deployer LRNs await new Promise((resolve) => setTimeout(resolve, WAIT_DURATION)); const updatedProject = await client.getProject(project.id); - setDeployerLrns(updatedProject.project?.deployerLrns || []); + setDeployers(updatedProject.project?.deployers || []); }; fetchUpdatedProject(); } @@ -102,14 +102,14 @@ export const AuctionCard = ({ project }: { project: Project }) => { - {deployerLrns?.length > 0 && ( + {deployers?.length > 0 && (
Deployer LRNs - {deployerLrns.map((lrn, index) => ( + {deployers.map((deployer, index) => (

- {'\u2022'} {lrn} + {'\u2022'} {deployer.deployerLrn}

))}
diff --git a/packages/frontend/src/stories/MockStoriesData.ts b/packages/frontend/src/stories/MockStoriesData.ts index be3ff31a..3d0e46f5 100644 --- a/packages/frontend/src/stories/MockStoriesData.ts +++ b/packages/frontend/src/stories/MockStoriesData.ts @@ -127,7 +127,13 @@ export const project: Project = { template: 'Template', members: [member], auctionId: '7553538436710373822151221341b43f577e07b0525d083cc9b2de98890138a1', - deployerLrns: ['lrn://deployer.apps.snowballtools.com '], + deployers: [ + { + deployerApiUrl: 'https://webapp-deployer-api.example.com', + deployerId: 'bafyreicrtgmkir4evvvysxdqxddf2ftdq2wrzuodgvwnxr4rmubi4obdfu', + deployerLrn: 'lrn://deployer.apps.snowballtools.com ', + } + ], webhooks: ['beepboop'], icon: 'Icon', fundsReleased: true, diff --git a/packages/gql-client/src/queries.ts b/packages/gql-client/src/queries.ts index c41c75a4..0d2ad0f9 100644 --- a/packages/gql-client/src/queries.ts +++ b/packages/gql-client/src/queries.ts @@ -24,7 +24,11 @@ query ($projectId: String!) { updatedAt prodBranch auctionId - deployerLrns + deployers { + deployerApiUrl + deployerId + deployerLrn + } fundsReleased framework repository @@ -76,7 +80,11 @@ query ($organizationSlug: String!) { description framework auctionId - deployerLrns + deployers { + deployerApiUrl + deployerId + deployerLrn + } fundsReleased prodBranch webhooks @@ -199,7 +207,11 @@ query ($searchText: String!) { description framework auctionId - deployerLrns + deployers { + deployerApiUrl + deployerId + deployerLrn + } fundsReleased prodBranch webhooks diff --git a/packages/gql-client/src/types.ts b/packages/gql-client/src/types.ts index af46bfa5..74cf17b1 100644 --- a/packages/gql-client/src/types.ts +++ b/packages/gql-client/src/types.ts @@ -176,7 +176,7 @@ export type Project = { description: string; template: string; framework: string; - deployerLrns: string[]; + deployers: [Deployer] auctionId: string; fundsReleased: boolean; webhooks: string[];