Display DNS deployment URLs in overview section (#21)
All checks were successful
Lint / lint (20.x) (push) Successful in 4m40s
All checks were successful
Lint / lint (20.x) (push) Successful in 4m40s
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75) - Disable `Deploy` button in configure step if account and deployer not selected - Update organization slug - Only display project if current user is project owner Co-authored-by: IshaVenikar <ishavenikar7@gmail.com> Co-authored-by: Adw8 <adwaitgharpure@gmail.com> Reviewed-on: #21
This commit is contained in:
parent
05bd766133
commit
ea9a56eb65
@ -22,8 +22,8 @@ export const createResolvers = async (service: Service): Promise<any> => {
|
|||||||
return service.getOrganizationsByUserId(context.user);
|
return service.getOrganizationsByUserId(context.user);
|
||||||
},
|
},
|
||||||
|
|
||||||
project: async (_: any, { projectId }: { projectId: string }) => {
|
project: async (_: any, { projectId }: { projectId: string }, context: any) => {
|
||||||
return service.getProjectById(projectId);
|
return service.getProjectById(context.user, projectId);
|
||||||
},
|
},
|
||||||
|
|
||||||
projectsInOrganization: async (
|
projectsInOrganization: async (
|
||||||
|
@ -407,8 +407,13 @@ export class Service {
|
|||||||
return dbOrganizations;
|
return dbOrganizations;
|
||||||
}
|
}
|
||||||
|
|
||||||
async getProjectById(projectId: string): Promise<Project | null> {
|
async getProjectById(user: User, projectId: string): Promise<Project | null> {
|
||||||
const dbProject = await this.db.getProjectById(projectId);
|
const dbProject = await this.db.getProjectById(projectId);
|
||||||
|
|
||||||
|
if (dbProject && dbProject.owner.id !== user.id) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return dbProject;
|
return dbProject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "2379cf1f-a232-4ad2-ae14-4d881131cc26",
|
"id": "2379cf1f-a232-4ad2-ae14-4d881131cc26",
|
||||||
"name": "Snowball Tools",
|
"name": "Deploy Tools",
|
||||||
"slug": "snowball-tools-1"
|
"slug": "deploy-tools"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "7eb9b3eb-eb74-4b53-b59a-69884c82a7fb",
|
"id": "7eb9b3eb-eb74-4b53-b59a-69884c82a7fb",
|
||||||
|
@ -515,7 +515,7 @@ const Configure = () => {
|
|||||||
<Button
|
<Button
|
||||||
{...buttonSize}
|
{...buttonSize}
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={isLoading}
|
disabled={isLoading || !selectedDeployer || !selectedAccount}
|
||||||
rightIcon={
|
rightIcon={
|
||||||
isLoading ? (
|
isLoading ? (
|
||||||
<LoadingIcon className="animate-spin" />
|
<LoadingIcon className="animate-spin" />
|
||||||
@ -538,7 +538,9 @@ const Configure = () => {
|
|||||||
<Button
|
<Button
|
||||||
{...buttonSize}
|
{...buttonSize}
|
||||||
type="submit"
|
type="submit"
|
||||||
disabled={isLoading || isPaymentLoading}
|
disabled={
|
||||||
|
isLoading || isPaymentLoading || !selectedAccount
|
||||||
|
}
|
||||||
rightIcon={
|
rightIcon={
|
||||||
isLoading || isPaymentLoading ? (
|
isLoading || isPaymentLoading ? (
|
||||||
<LoadingIcon className="animate-spin" />
|
<LoadingIcon className="animate-spin" />
|
||||||
|
@ -10,7 +10,6 @@ import {
|
|||||||
import SignClient from '@walletconnect/sign-client';
|
import SignClient from '@walletconnect/sign-client';
|
||||||
import { getSdkError } from '@walletconnect/utils';
|
import { getSdkError } from '@walletconnect/utils';
|
||||||
import { SessionTypes } from '@walletconnect/types';
|
import { SessionTypes } from '@walletconnect/types';
|
||||||
import { StargateClient } from '@cosmjs/stargate';
|
|
||||||
|
|
||||||
import { walletConnectModal } from '../utils/web3modal';
|
import { walletConnectModal } from '../utils/web3modal';
|
||||||
import {
|
import {
|
||||||
@ -46,10 +45,6 @@ export const WalletConnectClientProvider = ({
|
|||||||
|
|
||||||
const isSignClientInitializing = useRef<boolean>(false);
|
const isSignClientInitializing = useRef<boolean>(false);
|
||||||
|
|
||||||
const createCosmosClient = useCallback(async (endpoint: string) => {
|
|
||||||
return await StargateClient.connect(endpoint);
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
const onSessionConnect = useCallback(async (session: SessionTypes.Struct) => {
|
const onSessionConnect = useCallback(async (session: SessionTypes.Struct) => {
|
||||||
setSession(session);
|
setSession(session);
|
||||||
}, []);
|
}, []);
|
||||||
@ -166,6 +161,11 @@ export const WalletConnectClientProvider = ({
|
|||||||
if (!session) {
|
if (!session) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!session.namespaces['cosmos']) {
|
||||||
|
console.log('Accounts for cosmos namespace not found');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const cosmosAddresses = session.namespaces['cosmos'].accounts;
|
const cosmosAddresses = session.namespaces['cosmos'].accounts;
|
||||||
|
|
||||||
const cosmosAccounts = cosmosAddresses.map((address) => ({
|
const cosmosAccounts = cosmosAddresses.map((address) => ({
|
||||||
@ -178,7 +178,7 @@ export const WalletConnectClientProvider = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
populateAccounts();
|
populateAccounts();
|
||||||
}, [session, createCosmosClient]);
|
}, [session]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!signClient) {
|
if (!signClient) {
|
||||||
|
@ -92,9 +92,13 @@ const Id = () => {
|
|||||||
Open repo
|
Open repo
|
||||||
</Button>
|
</Button>
|
||||||
</Link>
|
</Link>
|
||||||
|
{(project.deployments.length > 0) &&
|
||||||
|
<Link to={`https://${project.name.toLowerCase()}.${project.deployments[0].deployer.baseDomain}`}>
|
||||||
<Button {...buttonSize} className="h-11 transition-colors">
|
<Button {...buttonSize} className="h-11 transition-colors">
|
||||||
Go to app
|
Go to app
|
||||||
</Button>
|
</Button>
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<WavyBorder />
|
<WavyBorder />
|
||||||
|
@ -180,14 +180,18 @@ const OverviewTabPanel = () => {
|
|||||||
|
|
||||||
{/* DEPLOYMENT */}
|
{/* DEPLOYMENT */}
|
||||||
<OverviewInfo label="Deployment URL" icon={<CursorBoxIcon />}>
|
<OverviewInfo label="Deployment URL" icon={<CursorBoxIcon />}>
|
||||||
|
{project.deployments &&
|
||||||
|
project.deployments.length > 0 &&
|
||||||
|
project.deployments.map((deployment) => (
|
||||||
<div className="flex gap-2 items-center">
|
<div className="flex gap-2 items-center">
|
||||||
<Link to="#">
|
<Link to={`https://${project.name.toLowerCase()}.${deployment.deployer.baseDomain}`}>
|
||||||
<span className="text-controls-primary group hover:border-controls-primary transition-colors border-b border-b-transparent flex gap-2 items-center text-sm tracking-tight">
|
<span className="text-controls-primary group hover:border-controls-primary transition-colors border-b border-b-transparent flex gap-2 items-center text-sm tracking-tight">
|
||||||
{liveDomain?.name}{' '}
|
{`https://${project.name.toLowerCase()}.${deployment.deployer.baseDomain}`}
|
||||||
<LinkIcon className="group-hover:rotate-45 transition-transform" />
|
<LinkIcon className="group-hover:rotate-45 transition-transform" />
|
||||||
</span>
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
|
))}
|
||||||
</OverviewInfo>
|
</OverviewInfo>
|
||||||
|
|
||||||
{/* DEPLOYMENT DATE */}
|
{/* DEPLOYMENT DATE */}
|
||||||
|
@ -17,7 +17,7 @@ const meta: Meta<typeof AddEnvironmentVariableRow> = {
|
|||||||
pathParams: { userId: 'me' },
|
pathParams: { userId: 'me' },
|
||||||
},
|
},
|
||||||
routing: {
|
routing: {
|
||||||
path: '/snowball-tools-1/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings',
|
path: '/deploy-tools/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,7 @@ const meta: Meta<typeof Config> = {
|
|||||||
pathParams: { userId: 'me' },
|
pathParams: { userId: 'me' },
|
||||||
},
|
},
|
||||||
routing: {
|
routing: {
|
||||||
path: '/snowball-tools-1/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings/domains/add/config',
|
path: '/deploy-tools/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings/domains/add/config',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@ -18,7 +18,7 @@ const meta: Meta<typeof DeleteProjectDialog> = {
|
|||||||
pathParams: { userId: 'me' },
|
pathParams: { userId: 'me' },
|
||||||
},
|
},
|
||||||
routing: {
|
routing: {
|
||||||
path: '/snowball-tools-1/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings',
|
path: '/deploy-tools/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@ -17,7 +17,7 @@ const meta: Meta<typeof SetupDomain> = {
|
|||||||
pathParams: { userId: 'me' },
|
pathParams: { userId: 'me' },
|
||||||
},
|
},
|
||||||
routing: {
|
routing: {
|
||||||
path: '/snowball-tools-1/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings/domains',
|
path: '/deploy-tools/projects/6bb3bec2-d71b-4fc0-9e32-4767f68668f4/settings/domains',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user