From 93afc0be7aff118c9d7f6c613800005d5c70f22b Mon Sep 17 00:00:00 2001 From: IshaVenikar Date: Wed, 30 Oct 2024 10:00:21 +0530 Subject: [PATCH 1/6] Disable deploy button when account is not selected --- .../components/projects/create/Configure.tsx | 4 +- .../project/overview/Activity/AuctionCard.tsx | 40 +++++++++---------- .../src/context/WalletConnectContext.tsx | 12 +++--- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/packages/frontend/src/components/projects/create/Configure.tsx b/packages/frontend/src/components/projects/create/Configure.tsx index 9dca4915..0d003eed 100644 --- a/packages/frontend/src/components/projects/create/Configure.tsx +++ b/packages/frontend/src/components/projects/create/Configure.tsx @@ -538,7 +538,9 @@ const Configure = () => { - + {(project.deployments.length > 0) && + + + + } -- 2.45.2 From 7b974b7f6b6c6f1d0b1ca0886e2ebf50776fda29 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 30 Oct 2024 17:49:51 +0530 Subject: [PATCH 6/6] Only display project if current user is project owner --- packages/backend/src/resolvers.ts | 4 ++-- packages/backend/src/service.ts | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/resolvers.ts b/packages/backend/src/resolvers.ts index 3fe9a9be..e20b7e0c 100644 --- a/packages/backend/src/resolvers.ts +++ b/packages/backend/src/resolvers.ts @@ -22,8 +22,8 @@ export const createResolvers = async (service: Service): Promise => { return service.getOrganizationsByUserId(context.user); }, - project: async (_: any, { projectId }: { projectId: string }) => { - return service.getProjectById(projectId); + project: async (_: any, { projectId }: { projectId: string }, context: any) => { + return service.getProjectById(context.user, projectId); }, projectsInOrganization: async ( diff --git a/packages/backend/src/service.ts b/packages/backend/src/service.ts index b142ad67..5da16954 100644 --- a/packages/backend/src/service.ts +++ b/packages/backend/src/service.ts @@ -407,8 +407,13 @@ export class Service { return dbOrganizations; } - async getProjectById(projectId: string): Promise { + async getProjectById(user: User, projectId: string): Promise { const dbProject = await this.db.getProjectById(projectId); + + if (dbProject && dbProject.owner.id !== user.id) { + return null; + } + return dbProject; } -- 2.45.2