From a70fc6ab71178de2c31611cd75e5ccb444ae5cb8 Mon Sep 17 00:00:00 2001 From: Neeraj Date: Tue, 29 Oct 2024 17:51:50 +0530 Subject: [PATCH] Display deployer base domain in overview tab --- packages/backend/src/database.ts | 1 + packages/backend/src/schema.gql | 1 + packages/frontend/src/pages/components/modals.tsx | 1 + .../src/pages/org-slug/projects/id/Overview.tsx | 10 +++++----- packages/frontend/src/stories/MockStoriesData.ts | 2 ++ packages/gql-client/src/queries.ts | 3 +++ packages/gql-client/src/types.ts | 1 + 7 files changed, 14 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/database.ts b/packages/backend/src/database.ts index bae1769c..71b2323b 100644 --- a/packages/backend/src/database.ts +++ b/packages/backend/src/database.ts @@ -140,6 +140,7 @@ export class Database { ) .leftJoinAndSelect('deployments.createdBy', 'user') .leftJoinAndSelect('deployments.domain', 'domain') + .leftJoinAndSelect('deployments.deployer', 'deployer') .leftJoinAndSelect('project.owner', 'owner') .leftJoinAndSelect('project.deployers', 'deployers') .leftJoinAndSelect('project.organization', 'organization') diff --git a/packages/backend/src/schema.gql b/packages/backend/src/schema.gql index b8a292a6..ff51098a 100644 --- a/packages/backend/src/schema.gql +++ b/packages/backend/src/schema.gql @@ -143,6 +143,7 @@ type Deployer { paymentAddress: String createdAt: String! updatedAt: String! + baseDomain: String } type AuthResult { diff --git a/packages/frontend/src/pages/components/modals.tsx b/packages/frontend/src/pages/components/modals.tsx index cf734d31..35688b26 100644 --- a/packages/frontend/src/pages/components/modals.tsx +++ b/packages/frontend/src/pages/components/modals.tsx @@ -41,6 +41,7 @@ const deployment: Deployment = { deployerId: 'bafyreicrtgmkir4evvvysxdqxddf2ftdq2wrzuodgvwnxr4rmubi4obdfu', deployerLrn: 'lrn://example/deployers/webapp-deployer-api.example.com', minimumPayment: '1000alnt', + baseDomain: 'pwa.wireitin.com' }, status: DeploymentStatus.Ready, createdBy: { diff --git a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx index 9346deb0..8e840bb3 100644 --- a/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx +++ b/packages/frontend/src/pages/org-slug/projects/id/Overview.tsx @@ -129,16 +129,16 @@ const OverviewTabPanel = () => { {project.name} - {project.baseDomains && - project.baseDomains.length > 0 && - project.baseDomains.map((baseDomain, index) => ( + {project.deployments && + project.deployments.length > 0 && + project.deployments.map((deployment, index) => (

- {baseDomain} + {deployment.deployer.baseDomain}

))} diff --git a/packages/frontend/src/stories/MockStoriesData.ts b/packages/frontend/src/stories/MockStoriesData.ts index d6dbb544..f4ffca20 100644 --- a/packages/frontend/src/stories/MockStoriesData.ts +++ b/packages/frontend/src/stories/MockStoriesData.ts @@ -107,6 +107,7 @@ export const deployment0: Deployment = { deployerId: 'bafyreicrtgmkir4evvvysxdqxddf2ftdq2wrzuodgvwnxr4rmubi4obdfu', deployerLrn: 'lrn://deployer.apps.snowballtools.com ', minimumPayment: '1000alnt', + baseDomain: 'pwa.wireitin.com' }, applicationDeploymentRequestId: 'bafyreiaycvq6imoppnpwdve4smj6t6ql5svt5zl3x6rimu4qwyzgjorize', @@ -134,6 +135,7 @@ export const project: Project = { deployerId: 'bafyreicrtgmkir4evvvysxdqxddf2ftdq2wrzuodgvwnxr4rmubi4obdfu', deployerLrn: 'lrn://deployer.apps.snowballtools.com ', minimumPayment: '1000alnt', + baseDomain: 'pwa.wireitin.com' }, ], paymentAddress: '0x657868687686rb4787987br8497298r79284797487', diff --git a/packages/gql-client/src/queries.ts b/packages/gql-client/src/queries.ts index 467e0583..48760dbd 100644 --- a/packages/gql-client/src/queries.ts +++ b/packages/gql-client/src/queries.ts @@ -57,6 +57,9 @@ query ($projectId: String!) { commitHash createdAt environment + deployer { + baseDomain + } domain { status branch diff --git a/packages/gql-client/src/types.ts b/packages/gql-client/src/types.ts index b4685706..3c690fc6 100644 --- a/packages/gql-client/src/types.ts +++ b/packages/gql-client/src/types.ts @@ -119,6 +119,7 @@ export type Deployer = { deployerLrn: string; deployerId: string; deployerApiUrl: string; + baseDomain: string; minimumPayment: string | null; }