diff --git a/src/lib/stores/git.ts b/src/lib/stores/git.ts index dae770d27..c56941d3e 100644 --- a/src/lib/stores/git.ts +++ b/src/lib/stores/git.ts @@ -30,6 +30,8 @@ export function deploymentStatusConverter(status: string) { return 'waiting'; case 'queued': return 'waiting'; + case 'cancelled': + return 'failed'; case 'failed': return 'failed'; } diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte index 1a69a417c..2464ba1af 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/+page.svelte @@ -142,7 +142,10 @@ {/if} {#if showCreateDeployment} - + {/if} {#if showConnectManual} diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte index 1fab279c4..41155fe71 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/deployments/createGitDeploymentModal.svelte @@ -16,7 +16,7 @@ export let show = false; export let site: Models.Site; - let installations = { installations: [], total: 0 }; + export let installations: Models.InstallationList; let hasRepository = !!site?.providerRepositoryId; let selectedRepository: string = site.providerRepositoryId; let branch: string = null; @@ -25,19 +25,14 @@ let error = ''; async function loadInstallations() { - try { - installations = await sdk.forProject.vcs.listInstallations(); - if (!site?.installationId && installations.total > 0) { - installation.set(installations.installations[0]); - } - $installation = installations.installations.find( - (installation) => installation.$id === site.installationId - ); - if (!$installation?.$id) { - $installation = installations.installations[0]; - } - } catch (error) { - console.log(error); + if (!site?.installationId && installations?.total > 0) { + installation.set(installations.installations[0]); + } + $installation = installations.installations.find( + (installation) => installation.$id === site.installationId + ); + if (!$installation?.$id) { + $installation = installations.installations[0]; } } @@ -50,6 +45,7 @@ site.providerRepositoryId ); } + selectedRepository = $repository?.id; const branchList = await sdk.forProject.vcs.listRepositoryBranches( $installation.$id, selectedRepository @@ -98,6 +94,8 @@ error = e.message; } } + + $: console.log($repository);