mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Merge remote-tracking branch 'origin/main' into feat-baa
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
},
|
||||
},
|
||||
"overrides": {
|
||||
"minimatch": "10.2.1",
|
||||
"minimatch": "10.2.3",
|
||||
"vite": "npm:rolldown-vite@latest",
|
||||
},
|
||||
"packages": {
|
||||
@@ -1086,7 +1086,7 @@
|
||||
|
||||
"min-indent": ["min-indent@1.0.1", "", {}, "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="],
|
||||
|
||||
"minimatch": ["minimatch@10.2.1", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-MClCe8IL5nRRmawL6ib/eT4oLyeKMGCghibcDWK+J0hh0Q8kqSdia6BvbRMVk6mPa6WqUa5uR2oxt6C5jd533A=="],
|
||||
"minimatch": ["minimatch@10.2.3", "", { "dependencies": { "brace-expansion": "^5.0.2" } }, "sha512-Rwi3pnapEqirPSbWbrZaa6N3nmqq4Xer/2XooiOKyV3q12ML06f7MOuc5DVH8ONZIFhwIYQ3yzPH4nt7iWHaTg=="],
|
||||
|
||||
"minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],
|
||||
|
||||
|
||||
+1
-1
@@ -89,6 +89,6 @@
|
||||
},
|
||||
"overrides": {
|
||||
"vite": "npm:rolldown-vite@latest",
|
||||
"minimatch": "10.2.1"
|
||||
"minimatch": "10.2.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,6 +52,12 @@
|
||||
}
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if ($installation?.$id) {
|
||||
selectedInstallationId = $installation.$id;
|
||||
}
|
||||
});
|
||||
|
||||
async function connectRepo() {
|
||||
try {
|
||||
if (repositoryBehaviour === 'new') {
|
||||
@@ -105,13 +111,29 @@
|
||||
{product}
|
||||
action="button"
|
||||
{callbackState}
|
||||
connect={(e) => {
|
||||
connect={async (e) => {
|
||||
trackEvent(Click.ConnectRepositoryClick, {
|
||||
from: product
|
||||
});
|
||||
repository.set(e);
|
||||
repositoryName = e.name;
|
||||
selectedRepository = e.id;
|
||||
if (!selectedInstallationId && $installation?.$id) {
|
||||
selectedInstallationId = $installation.$id;
|
||||
}
|
||||
try {
|
||||
await connect(selectedInstallationId, e.id);
|
||||
show = false;
|
||||
addNotification({
|
||||
type: 'success',
|
||||
message: 'Repository connected successfully'
|
||||
});
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message: error?.message ?? 'Failed to connect repository'
|
||||
});
|
||||
}
|
||||
}} />
|
||||
{/if}
|
||||
</Layout.Stack>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
import { Query, VCSDetectionType, type Models } from '@appwrite.io/console';
|
||||
import { getFrameworkIcon } from '$lib/stores/sites';
|
||||
import { connectGitHub } from '$lib/stores/git';
|
||||
import { addNotification } from '$lib/stores/notifications';
|
||||
import { page } from '$app/state';
|
||||
import Card from '../card.svelte';
|
||||
import SkeletonRepoList from './skeletonRepoList.svelte';
|
||||
@@ -274,9 +275,20 @@
|
||||
variant="secondary"
|
||||
style="flex-shrink: 0;"
|
||||
disabled={!!connectingRepositoryId}
|
||||
on:click={() => {
|
||||
on:click={async () => {
|
||||
connectingRepositoryId = repo.id;
|
||||
connect(repo);
|
||||
try {
|
||||
await Promise.resolve(connect(repo));
|
||||
} catch (error) {
|
||||
addNotification({
|
||||
type: 'error',
|
||||
message:
|
||||
error?.message ??
|
||||
'Failed to connect repository'
|
||||
});
|
||||
} finally {
|
||||
connectingRepositoryId = null;
|
||||
}
|
||||
}}>
|
||||
Connect
|
||||
</PinkButton.Button>
|
||||
|
||||
@@ -53,5 +53,5 @@
|
||||
The deployment for pull request #{data.providerPullRequestId}
|
||||
is awaiting approval. When authorized, deployments will be started.
|
||||
</Typography.Title>
|
||||
<Button on:click={approveDeployment} secondary>Approve Deployment</Button>
|
||||
<Button on:click={approveDeployment} secondary disabled={loading}>Approve Deployment</Button>
|
||||
</Layout.Stack>
|
||||
|
||||
+37
-19
@@ -14,6 +14,7 @@
|
||||
import { IconPlus } from '@appwrite.io/pink-icons-svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { realtime, sdk } from '$lib/stores/sdk';
|
||||
import { sortBranches } from '$lib/stores/vcs';
|
||||
import { invalidate } from '$app/navigation';
|
||||
import { Dependencies } from '$lib/constants';
|
||||
import CreateCliModal from './createCliModal.svelte';
|
||||
@@ -40,28 +41,45 @@
|
||||
});
|
||||
|
||||
async function connect(selectedInstallationId: string, selectedRepository: string) {
|
||||
let nextBranch = data.site?.providerBranch ?? 'main';
|
||||
try {
|
||||
await sdk.forProject(page.params.region, page.params.project).sites.update({
|
||||
siteId: data.site.$id,
|
||||
name: data.site.name,
|
||||
framework: data.site.framework as Framework,
|
||||
enabled: data.site.enabled,
|
||||
logging: data.site.logging || undefined,
|
||||
timeout: data.site.timeout,
|
||||
installCommand: data.site.installCommand,
|
||||
buildCommand: data.site.buildCommand,
|
||||
outputDirectory: data.site.outputDirectory,
|
||||
buildRuntime: data.site.buildRuntime as BuildRuntime,
|
||||
adapter: data.site.adapter as Adapter,
|
||||
fallbackFile: data.site.fallbackFile,
|
||||
installationId: selectedInstallationId,
|
||||
providerRepositoryId: selectedRepository,
|
||||
providerBranch: 'main'
|
||||
});
|
||||
invalidate(Dependencies.SITE);
|
||||
const branchList = await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.vcs.listRepositoryBranches({
|
||||
installationId: selectedInstallationId,
|
||||
providerRepositoryId: selectedRepository
|
||||
});
|
||||
const sorted = sortBranches(branchList.branches);
|
||||
nextBranch =
|
||||
sorted.find((branch) => branch.name === data.site?.providerBranch)?.name ??
|
||||
sorted.find((branch) => branch.name === 'main' || branch.name === 'master')?.name ??
|
||||
sorted[0]?.name ??
|
||||
nextBranch;
|
||||
} catch {
|
||||
return;
|
||||
// Ignore branch lookup failures; fallback to default.
|
||||
}
|
||||
|
||||
await sdk.forProject(page.params.region, page.params.project).sites.update({
|
||||
siteId: data.site.$id,
|
||||
name: data.site.name,
|
||||
framework: data.site.framework as Framework,
|
||||
enabled: data.site.enabled,
|
||||
logging: data.site.logging || undefined,
|
||||
timeout: data.site.timeout,
|
||||
installCommand: data.site.installCommand,
|
||||
buildCommand: data.site.buildCommand,
|
||||
outputDirectory: data.site.outputDirectory,
|
||||
buildRuntime: data.site.buildRuntime as BuildRuntime,
|
||||
adapter: data.site.adapter as Adapter,
|
||||
fallbackFile: data.site.fallbackFile,
|
||||
installationId: selectedInstallationId,
|
||||
providerRepositoryId: selectedRepository,
|
||||
providerBranch: nextBranch,
|
||||
providerSilentMode: data.site?.providerSilentMode ?? undefined,
|
||||
providerRootDirectory: data.site?.providerRootDirectory ?? undefined,
|
||||
specification: data.site?.specification || undefined
|
||||
});
|
||||
invalidate(Dependencies.SITE);
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
+37
-21
@@ -116,30 +116,46 @@
|
||||
}
|
||||
|
||||
async function connect(selectedInstallationId: string, selectedRepository: string) {
|
||||
let nextBranch = site?.providerBranch ?? 'main';
|
||||
try {
|
||||
await sdk.forProject(page.params.region, page.params.project).sites.update({
|
||||
siteId: site.$id,
|
||||
name: site.name,
|
||||
framework: site.framework as Framework,
|
||||
enabled: site?.enabled,
|
||||
logging: site?.logging || undefined,
|
||||
timeout: site?.timeout,
|
||||
installCommand: site?.installCommand,
|
||||
buildCommand: site?.buildCommand,
|
||||
outputDirectory: site?.outputDirectory,
|
||||
buildRuntime: site?.buildRuntime as BuildRuntime,
|
||||
adapter: site.adapter as Adapter,
|
||||
fallbackFile: site?.fallbackFile,
|
||||
installationId: selectedInstallationId,
|
||||
providerRepositoryId: selectedRepository,
|
||||
providerBranch: 'main',
|
||||
specification: site?.specification || undefined
|
||||
});
|
||||
|
||||
invalidate(Dependencies.SITE);
|
||||
const branchList = await sdk
|
||||
.forProject(page.params.region, page.params.project)
|
||||
.vcs.listRepositoryBranches({
|
||||
installationId: selectedInstallationId,
|
||||
providerRepositoryId: selectedRepository
|
||||
});
|
||||
const sorted = sortBranches(branchList.branches);
|
||||
nextBranch =
|
||||
sorted.find((branch) => branch.name === site?.providerBranch)?.name ??
|
||||
sorted.find((branch) => branch.name === 'main' || branch.name === 'master')?.name ??
|
||||
sorted[0]?.name ??
|
||||
nextBranch;
|
||||
} catch {
|
||||
return;
|
||||
// Ignore branch lookup failures; fallback to default.
|
||||
}
|
||||
|
||||
await sdk.forProject(page.params.region, page.params.project).sites.update({
|
||||
siteId: site.$id,
|
||||
name: site.name,
|
||||
framework: site.framework as Framework,
|
||||
enabled: site?.enabled,
|
||||
logging: site?.logging || undefined,
|
||||
timeout: site?.timeout,
|
||||
installCommand: site?.installCommand,
|
||||
buildCommand: site?.buildCommand,
|
||||
outputDirectory: site?.outputDirectory,
|
||||
buildRuntime: site?.buildRuntime as BuildRuntime,
|
||||
adapter: site.adapter as Adapter,
|
||||
fallbackFile: site?.fallbackFile,
|
||||
installationId: selectedInstallationId,
|
||||
providerRepositoryId: selectedRepository,
|
||||
providerBranch: nextBranch,
|
||||
providerSilentMode: site?.providerSilentMode ?? undefined,
|
||||
providerRootDirectory: site?.providerRootDirectory ?? undefined,
|
||||
specification: site?.specification || undefined
|
||||
});
|
||||
|
||||
invalidate(Dependencies.SITE);
|
||||
}
|
||||
|
||||
$: if (site?.installationId && site?.providerRepositoryId) {
|
||||
|
||||
Reference in New Issue
Block a user