From 91decd4fb5237f7f14a61d1412a46cb1e38d22a0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matej=20Ba=C4=8Do?=
Date: Fri, 21 Apr 2023 00:42:12 +0200
Subject: [PATCH 1/3] Implement VCS
---
package-lock.json | 9 +-
package.json | 2 +-
src/lib/actions/analytics.ts | 2 +
src/lib/constants.ts | 1 +
src/lib/stores/sdk.ts | 6 +-
.../function-[function]/settings/+page.svelte | 58 ++++++-
.../function-[function]/settings/+page.ts | 3 +-
.../settings/gitConnection.svelte | 162 ++++++++++++++++++
.../settings/git-installations/+page.svelte | 122 +++++++++++++
.../settings/git-installations/+page.ts | 11 ++
.../settings/git-installations/delete.svelte | 51 ++++++
.../wizard/cnameTable.svelte | 44 +++++
.../git-installations/wizard/step1.svelte | 47 +++++
.../git-installations/wizard/step2.svelte | 13 ++
.../git-installations/wizard/step3.svelte | 25 +++
.../git-installations/wizard/step4.svelte | 53 ++++++
.../git-installations/wizard/store.ts | 4 +
.../wizard/verificationBox.svelte | 57 ++++++
.../project-[project]/settings/header.svelte | 5 +
19 files changed, 662 insertions(+), 13 deletions(-)
create mode 100644 src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/+page.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/+page.ts
create mode 100644 src/routes/console/project-[project]/settings/git-installations/delete.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/wizard/cnameTable.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/wizard/step1.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/wizard/step2.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/wizard/step3.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/wizard/step4.svelte
create mode 100644 src/routes/console/project-[project]/settings/git-installations/wizard/store.ts
create mode 100644 src/routes/console/project-[project]/settings/git-installations/wizard/verificationBox.svelte
diff --git a/package-lock.json b/package-lock.json
index 46a8434389..b441e7168c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,7 +7,7 @@
"name": "@appwrite/console",
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "0.1.0",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.19",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
@@ -147,9 +147,10 @@
"integrity": "sha512-1Yw7u/COtxx06BfwlI+kVhsa/upKYzmCNrT4c8QDeCY2KMYlnijkUjtHiPU08HxyTIVB5j6d75O0YWVIHwQS8g=="
},
"node_modules/@appwrite.io/console": {
- "version": "0.1.0",
- "resolved": "https://registry.npmjs.org/@appwrite.io/console/-/console-0.1.0.tgz",
- "integrity": "sha512-GzCRUmaXAVgpGwxBNI3PrtCLHz7CM+epBHDDTHw8B2u61KbijGBO3GrwreXy91fy00RJiEzGlMSRzDgwsF3Tsg==",
+ "name": "khushboo-console-vcs",
+ "version": "0.0.19",
+ "resolved": "https://registry.npmjs.org/khushboo-console-vcs/-/khushboo-console-vcs-0.0.19.tgz",
+ "integrity": "sha512-Dj9Zc7+q3IDJ7v+hHNAYMrm4b2EW6K8aSWME202+YjHEQfc8l4/p23Z876w/GI4uBSGnNtqnhYzd6kHYvUJ9yA==",
"dependencies": {
"cross-fetch": "3.1.5",
"isomorphic-form-data": "2.0.0"
diff --git a/package.json b/package.json
index 0e7ec8d6e1..60518ea686 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
},
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "0.1.0",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.19",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
diff --git a/src/lib/actions/analytics.ts b/src/lib/actions/analytics.ts
index 84c178cc46..daf9185a45 100644
--- a/src/lib/actions/analytics.ts
+++ b/src/lib/actions/analytics.ts
@@ -173,6 +173,8 @@ export enum Submit {
FunctionUpdateSchedule = 'submit_function_update_schedule',
FunctionUpdateTimeout = 'submit_function_update_timeout',
FunctionUpdateEvents = 'submit_function_update_events',
+ FunctionUpdateVcs = 'submit_function_update_vcs',
+ InstallationDelete = 'submit_installation_delete',
DeploymentCreate = 'submit_deployment_create',
DeploymentDelete = 'submit_deployment_delete',
DeploymentUpdate = 'submit_deployment_update',
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 2b3b701257..c37501aecb 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -32,6 +32,7 @@ export enum Dependencies {
KEY = 'dependency:key',
KEYS = 'dependency:keys',
DOMAINS = 'dependency:domains',
+ INSTALLATIONS = 'dependency:installations',
WEBHOOK = 'dependency:webhook',
WEBHOOKS = 'dependency:webhooks'
}
diff --git a/src/lib/stores/sdk.ts b/src/lib/stores/sdk.ts
index 481b930ead..2f0d81a90f 100644
--- a/src/lib/stores/sdk.ts
+++ b/src/lib/stores/sdk.ts
@@ -12,7 +12,8 @@ import {
Projects,
Storage,
Teams,
- Users
+ Users,
+ Vcs
} from '@appwrite.io/console';
const endpoint = VARS.APPWRITE_ENDPOINT ?? `${globalThis?.location?.origin}/v1`;
@@ -33,7 +34,8 @@ const sdkForProject = {
project: new Project(clientProject),
storage: new Storage(clientProject),
teams: new Teams(clientProject),
- users: new Users(clientProject)
+ users: new Users(clientProject),
+ vcs: new Vcs(clientProject)
};
export const sdk = {
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
index 94aadbc6cd..30dc450b84 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
@@ -28,6 +28,7 @@
import Variable from '../../createVariable.svelte';
import { execute, func } from '../store';
import UploadVariables from './uploadVariables.svelte';
+ import GitConnection from './gitConnection.svelte';
import {
Table,
TableBody,
@@ -45,6 +46,7 @@
const functionId = $page.params.function;
let showDelete = false;
let selectedVar: Models.Variable = null;
+ let showGitConnection = false;
let showVariablesUpload = false;
let showVariablesModal = false;
let showVariablesDropdown = [];
@@ -71,7 +73,9 @@
$func.events || undefined,
$func.schedule || undefined,
$func.timeout || undefined,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -97,7 +101,9 @@
$func.events || undefined,
$func.schedule || undefined,
$func.timeout || undefined,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -123,7 +129,9 @@
$func.events || undefined,
functionSchedule,
$func.timeout || undefined,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -149,7 +157,9 @@
$func.events || undefined,
$func.schedule || undefined,
timeout,
- $func.enabled
+ $func.enabled,
+ $func.vcsInstallationId || undefined,
+ $func.repositoryId || undefined
);
await invalidate(Dependencies.FUNCTION);
addNotification({
@@ -166,6 +176,34 @@
}
}
+ async function disconnectVcs() {
+ try {
+ await sdk.forProject.functions.update(
+ functionId,
+ $func.name,
+ $func.execute || undefined,
+ $func.events || undefined,
+ $func.schedule || undefined,
+ timeout,
+ $func.enabled,
+ '',
+ ''
+ );
+ await invalidate(Dependencies.FUNCTION);
+ addNotification({
+ type: 'success',
+ message: 'Git has been disconnected'
+ });
+ trackEvent(Submit.FunctionUpdateVcs);
+ } catch (error) {
+ addNotification({
+ type: 'error',
+ message: error.message
+ });
+ trackError(error, Submit.FunctionUpdateVcs);
+ }
+ }
+
async function handleVariableCreated(event: CustomEvent) {
const variable = event.detail;
@@ -286,7 +324,14 @@
- ($execute = $func)}>Execute now
+
+ {#if $func.vcsInstallationId}
+ Disconnect Git
+ {:else}
+ (showGitConnection = true)}>Connect Git
+ {/if}
+ ($execute = $func)}>Execute now
+
@@ -518,3 +563,6 @@
{#if showVariablesUpload}
{/if}
+{#if showGitConnection}
+
+{/if}
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.ts b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.ts
index 803c98e163..d6333d6021 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.ts
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.ts
@@ -6,6 +6,7 @@ export const load: PageLoad = async ({ params, depends }) => {
depends(Dependencies.VARIABLES);
return {
- variables: await sdk.forProject.functions.listVariables(params.function)
+ variables: await sdk.forProject.functions.listVariables(params.function),
+ installations: await sdk.forProject.vcs.listInstallations()
};
};
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
new file mode 100644
index 0000000000..8baf54e45d
--- /dev/null
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
@@ -0,0 +1,162 @@
+
+
+ {}} bind:error>
+ Connect Git
+
+ {#if selectedInstallation === null}
+ 1. Select installation:
+ {#if installations.installations.length > 0}
+
+
+
+ {#each installations.installations as installation (installation.$id)}
+
+
+
+
+
+
+
+
+ {installation.organization}
+
+
+
+
+
+
+ selectInstallation(installation)}
+ >Select
+
+
+ {/each}
+
+
+
+ {:else}
+
+ goto(
+ `${base}/console/project-${$page.params.project}/settings/git-installations`
+ )}>
+
+
+
No installation found. Create one to continue.
+
+
+
+ {/if}
+ {:else}
+
+ 2. Select repository:
+
+ {#if repositories === null}
+
Loading...
+ {:else if repositories.repositories.length > 0}
+
+
+
+ {#each repositories.repositories as repository (repository.id)}
+
+
+
+
+
+
+
+
+ {repository.name}
+
+
+
+
+
+
+ connectRepository(repository)}
+ >Connect
+
+
+ {/each}
+
+
+
+ {:else}
+ {}}>
+
+
+
+ No repository found. You might be missing permissions on your Git
+ provider.
+
+
+
+
+ {/if}
+
+ {/if}
+
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/+page.svelte b/src/routes/console/project-[project]/settings/git-installations/+page.svelte
new file mode 100644
index 0000000000..ee903864d7
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/+page.svelte
@@ -0,0 +1,122 @@
+
+
+
+
+ Git Installations
+
+
+
+ (showCreateDropdown = !showCreateDropdown)}
+ event="create_installation">
+
+ Create installation
+
+
+
+ {#each providers as provider}
+ {
+ provider.redirect();
+ showCreateDropdown = false;
+ }}>
+ {provider.name}
+
+ {/each}
+
+
+
+ {#if data.installations.total}
+
+
+ Installation ID
+ Installation Organization
+ Provider
+
+
+
+ {#each data.installations.installations as installation}
+
+
+ {installation.$id}
+
+
+ {installation.organization}
+
+ {installation.provider}
+
+
+ {
+ const provider = providers.find(
+ (provider) => provider.name === installation.provider
+ );
+ if (provider) {
+ provider.redirect();
+ }
+ }}>
+
+
+ {
+ showDelete = true;
+ selectedInstallation = installation;
+ }}>
+
+
+
+
+
+
+ {/each}
+
+
+ {:else}
+ {}} />
+ {/if}
+
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/+page.ts b/src/routes/console/project-[project]/settings/git-installations/+page.ts
new file mode 100644
index 0000000000..30e0df40f9
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/+page.ts
@@ -0,0 +1,11 @@
+import { Dependencies } from '$lib/constants';
+import { sdk } from '$lib/stores/sdk';
+import type { PageLoad } from './$types';
+
+export const load: PageLoad = async ({ depends }) => {
+ depends(Dependencies.INSTALLATIONS);
+
+ return {
+ installations: await sdk.forProject.vcs.listInstallations()
+ };
+};
diff --git a/src/routes/console/project-[project]/settings/git-installations/delete.svelte b/src/routes/console/project-[project]/settings/git-installations/delete.svelte
new file mode 100644
index 0000000000..09c2185c65
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/delete.svelte
@@ -0,0 +1,51 @@
+
+
+
+ Delete Installation
+ {#if selectedInstallation}
+
+ Are you sure you want to delete {selectedInstallation.$id} from '{$project.name}'?
+
+ {/if}
+
+ (showDelete = false)}>Cancel
+ Delete
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/wizard/cnameTable.svelte b/src/routes/console/project-[project]/settings/git-installations/wizard/cnameTable.svelte
new file mode 100644
index 0000000000..55eff51702
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/wizard/cnameTable.svelte
@@ -0,0 +1,44 @@
+
+
+
+
+ Type
+ Name
+ Value
+
+
+
+
+ CNAME
+ {cnameValue}
+
+ {target}
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/wizard/step1.svelte b/src/routes/console/project-[project]/settings/git-installations/wizard/step1.svelte
new file mode 100644
index 0000000000..082f70ea93
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/wizard/step1.svelte
@@ -0,0 +1,47 @@
+
+
+
+ Add your domain
+
+ Use your self-owned domain as the endpoint of your Appwrite API.
+
+
+
+
+
+
+
+ You can find a list of domain providers and their DNS setting documentation here . If your domain provider isn't listed, please contact us, and we'll include their
+ settings as well.
+
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/wizard/step2.svelte b/src/routes/console/project-[project]/settings/git-installations/wizard/step2.svelte
new file mode 100644
index 0000000000..52e4aca17e
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/wizard/step2.svelte
@@ -0,0 +1,13 @@
+
+
+
+ Add a CNAME record
+
+ In order to continue, set the following record on your DNS provider
+
+
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/wizard/step3.svelte b/src/routes/console/project-[project]/settings/git-installations/wizard/step3.svelte
new file mode 100644
index 0000000000..74598ab47a
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/wizard/step3.svelte
@@ -0,0 +1,25 @@
+
+
+
+ Add a CNAME record
+
+ In order to continue, set the following record on your DNS provider
+
+
+
+
+
+
Changes may take some time to take effect depending on your provider.
+
+
+
+
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/wizard/step4.svelte b/src/routes/console/project-[project]/settings/git-installations/wizard/step4.svelte
new file mode 100644
index 0000000000..91b0a575a9
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/wizard/step4.svelte
@@ -0,0 +1,53 @@
+
+
+
+ Add a CNAME record
+
+ In order to continue, set the following record on your DNS provider
+
+
+
+
+
+
+
+
+ {#if !certificate}
+
+ {:else}
+
+ {/if}
+
+ {!certificate ? 'Generating SSL certificate' : 'Generated SSL certificate'}
+
+
+
+
+
diff --git a/src/routes/console/project-[project]/settings/git-installations/wizard/store.ts b/src/routes/console/project-[project]/settings/git-installations/wizard/store.ts
new file mode 100644
index 0000000000..aaaa1db080
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/wizard/store.ts
@@ -0,0 +1,4 @@
+import type { Models } from '@appwrite.io/console';
+import { writable } from 'svelte/store';
+
+export const domain = writable>({ $id: '', domain: '' });
diff --git a/src/routes/console/project-[project]/settings/git-installations/wizard/verificationBox.svelte b/src/routes/console/project-[project]/settings/git-installations/wizard/verificationBox.svelte
new file mode 100644
index 0000000000..fec80c01f3
--- /dev/null
+++ b/src/routes/console/project-[project]/settings/git-installations/wizard/verificationBox.svelte
@@ -0,0 +1,57 @@
+
+
+
+ {#if isVerified}
+
+ verified
+
+
Domain has been verified
+ {:else}
+ {#if isVerifying}
+
+ {:else}
+
+ failed
+
+ {/if}
+
+
Domain is pending verification
+ {/if}
+ {#if !isVerified}
+
Verify
+ {/if}
+
diff --git a/src/routes/console/project-[project]/settings/header.svelte b/src/routes/console/project-[project]/settings/header.svelte
index b6c51f014b..bf539d5b7c 100644
--- a/src/routes/console/project-[project]/settings/header.svelte
+++ b/src/routes/console/project-[project]/settings/header.svelte
@@ -21,6 +21,11 @@
href: `${path}/webhooks`,
title: 'Webhooks',
event: 'webhooks'
+ },
+ {
+ href: `${path}/git-installations`,
+ title: 'Git Installations',
+ event: 'vcs'
}
];
From 52858d5e47337c6ef0fc1b84c88fa0c3eb338b0a Mon Sep 17 00:00:00 2001
From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com>
Date: Tue, 9 May 2023 03:50:41 +0530
Subject: [PATCH 2/3] Added owner name as param to updateFunction
---
package-lock.json | 8 ++++----
package.json | 2 +-
.../functions/function-[function]/settings/+page.svelte | 1 +
.../function-[function]/settings/gitConnection.svelte | 3 ++-
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index b441e7168c..01265b6351 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,7 +7,7 @@
"name": "@appwrite/console",
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.19",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.22",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
@@ -148,9 +148,9 @@
},
"node_modules/@appwrite.io/console": {
"name": "khushboo-console-vcs",
- "version": "0.0.19",
- "resolved": "https://registry.npmjs.org/khushboo-console-vcs/-/khushboo-console-vcs-0.0.19.tgz",
- "integrity": "sha512-Dj9Zc7+q3IDJ7v+hHNAYMrm4b2EW6K8aSWME202+YjHEQfc8l4/p23Z876w/GI4uBSGnNtqnhYzd6kHYvUJ9yA==",
+ "version": "0.0.22",
+ "resolved": "https://registry.npmjs.org/khushboo-console-vcs/-/khushboo-console-vcs-0.0.22.tgz",
+ "integrity": "sha512-xkdS67AjUma73DYGWtpCCqhrngaPSRNz2N+YfzhrOMxFFFz2Fpz8c2PppFjsnjlSNCkynSPAl34tAaBZ7V8mbQ==",
"dependencies": {
"cross-fetch": "3.1.5",
"isomorphic-form-data": "2.0.0"
diff --git a/package.json b/package.json
index 60518ea686..dadd07e930 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
},
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.19",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.22",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
index 30dc450b84..48fa83c8af 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/+page.svelte
@@ -187,6 +187,7 @@
timeout,
$func.enabled,
'',
+ '',
''
);
await invalidate(Dependencies.FUNCTION);
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
index 8baf54e45d..5f2f9a410b 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
@@ -39,7 +39,8 @@
$page.data.function.timeout || undefined,
$page.data.function.enabled,
selectedInstallation.$id,
- `${repository.id}`
+ `${repository.id}`,
+ `${repository.owner.login}`
);
show = false;
From 09ea0db3ee8ed39cfeefaa7aa32b5ace2e81161e Mon Sep 17 00:00:00 2001
From: Khushboo Verma <43381712+vermakhushboo@users.noreply.github.com>
Date: Mon, 22 May 2023 15:14:20 +0530
Subject: [PATCH 3/3] Add search repos UI
---
package-lock.json | 8 ++++----
package.json | 2 +-
.../settings/gitConnection.svelte | 15 +++++++++++++--
3 files changed, 18 insertions(+), 7 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 01265b6351..e7a9968717 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -7,7 +7,7 @@
"name": "@appwrite/console",
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.22",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.23",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
@@ -148,9 +148,9 @@
},
"node_modules/@appwrite.io/console": {
"name": "khushboo-console-vcs",
- "version": "0.0.22",
- "resolved": "https://registry.npmjs.org/khushboo-console-vcs/-/khushboo-console-vcs-0.0.22.tgz",
- "integrity": "sha512-xkdS67AjUma73DYGWtpCCqhrngaPSRNz2N+YfzhrOMxFFFz2Fpz8c2PppFjsnjlSNCkynSPAl34tAaBZ7V8mbQ==",
+ "version": "0.0.23",
+ "resolved": "https://registry.npmjs.org/khushboo-console-vcs/-/khushboo-console-vcs-0.0.23.tgz",
+ "integrity": "sha512-WY5Izd49Ys9kdw7+SIWexT0dZF34L7eDe0J1WR4RjRyTGeb9Fk4S/57QRhCYGtVOZsnLBwmhoIMHg/XIo98ICQ==",
"dependencies": {
"cross-fetch": "3.1.5",
"isomorphic-form-data": "2.0.0"
diff --git a/package.json b/package.json
index dadd07e930..691876c08a 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
},
"dependencies": {
"@analytics/google-analytics": "^1.0.5",
- "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.22",
+ "@appwrite.io/console": "npm:khushboo-console-vcs@0.0.23",
"@appwrite.io/pink": "^0.0.6-rc.10",
"@popperjs/core": "^2.11.6",
"@sentry/svelte": "^7.44.2",
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
index 5f2f9a410b..afb3429fff 100644
--- a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
+++ b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConnection.svelte
@@ -21,13 +21,22 @@
async function selectInstallation(installation: Models.Installation) {
try {
selectedInstallation = installation;
-
- repositories = await sdk.forProject.vcs.listRepositories(selectedInstallation.$id);
} catch (e) {
error = e.message;
}
}
+ async function searchRepositories(searchQuery: string) {
+ repositories = await sdk.forProject.vcs.listRepositories(
+ selectedInstallation.$id,
+ searchQuery || undefined
+ );
+ }
+
+ $: if (selectedInstallation) {
+ searchRepositories(inputValue);
+ }
+
async function connectRepository(repository: Models.Repository) {
try {
await sdk.forProject.functions.update(
@@ -54,6 +63,7 @@
error = e.message;
}
}
+ let inputValue = '';
{}} bind:error>
@@ -109,6 +119,7 @@
2. Select repository:
+
{#if repositories === null}
Loading...
{:else if repositories.repositories.length > 0}