mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: git deployments
This commit is contained in:
@@ -30,6 +30,8 @@ export function deploymentStatusConverter(status: string) {
|
||||
return 'waiting';
|
||||
case 'queued':
|
||||
return 'waiting';
|
||||
case 'cancelled':
|
||||
return 'failed';
|
||||
case 'failed':
|
||||
return 'failed';
|
||||
}
|
||||
|
||||
@@ -142,7 +142,10 @@
|
||||
{/if}
|
||||
|
||||
{#if showCreateDeployment}
|
||||
<CreateGitDeploymentModal bind:show={showCreateDeployment} site={data.site} />
|
||||
<CreateGitDeploymentModal
|
||||
bind:show={showCreateDeployment}
|
||||
site={data.site}
|
||||
installations={data.installations} />
|
||||
{/if}
|
||||
{#if showConnectManual}
|
||||
<CreateManualDeploymentModal bind:show={showConnectManual} site={data.site} />
|
||||
|
||||
+12
-14
@@ -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);
|
||||
</script>
|
||||
|
||||
<Modal title="Create Git deployment" bind:show onSubmit={createDeployment} bind:error>
|
||||
|
||||
Reference in New Issue
Block a user