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 b05e5d120..d409af540 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 @@ -37,7 +37,7 @@ - + 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 d09a56b13..7056309f5 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 @@ -1,6 +1,7 @@ import { sdk } from '$lib/stores/sdk'; import { Dependencies } from '$lib/constants'; import type { PageLoad } from './$types'; +import { Query } from '@appwrite.io/console'; export const load: PageLoad = async ({ params, depends }) => { depends(Dependencies.VARIABLES); @@ -28,6 +29,7 @@ export const load: PageLoad = async ({ params, depends }) => { return { variables, - globalVariables + globalVariables, + installations: await sdk.forProject.vcs.listInstallations([Query.limit(10)]) }; }; diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/connectGitModal.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/connectGitModal.svelte deleted file mode 100644 index ced4994d8..000000000 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/connectGitModal.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - - - Connect to Git -

Select a provider to import an existing git repositories.

- -
- - - -
- - - - -
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/gitConfigurationModal.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConfigurationModal.svelte new file mode 100644 index 000000000..d0fe346a8 --- /dev/null +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/gitConfigurationModal.svelte @@ -0,0 +1,112 @@ + + + + Git configuration +

+ Configure a Git repository that will trigger your function deployments when updated. +

+ + + + +

+ Manage organization configuration in your project settings. +

+ {#if repositories?.total} + {#each repositories.repositories as repo} +
+ + {repo.name} +
+ {/each} +
+

Total results: {repositories?.total}

+ +
+ {:else if search} + +
+
+ Sorry we couldn't find "{search}" +

There are no repositories that match your search.

+
+
+ + +
+
+
+ {:else} + +
+
+

You have no repositories.

+

+ Need a hand? Learn more in our + documentation. +

+
+
+
+ {/if} + + + + + +
diff --git a/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte b/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte index 963f06d6e..f156e214a 100644 --- a/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte +++ b/src/routes/console/project-[project]/functions/function-[function]/settings/updateConfiguration.svelte @@ -7,15 +7,18 @@ import { Button, Form, FormList, InputText } from '$lib/elements/forms'; import { addNotification } from '$lib/stores/notifications'; import { sdk } from '$lib/stores/sdk'; + import type { Models } from '@appwrite.io/console'; import { func } from '../store'; - import ConnectGitModal from './connectGitModal.svelte'; + import GitInstallationModal from '$routes/console/project-[project]/settings/GitInstallationModal.svelte'; + import GitConfigurationModal from './gitConfigurationModal.svelte'; + export let installations: Models.InstallationList; const functionId = $page.params.function; let entrypoint: string; let installCmd: string; let buildCmd: string; - let showGitConnect = false; + let showGit = false; async function updateConfiguration() { try { @@ -78,7 +81,7 @@ @@ -108,4 +111,8 @@ - +{#if !installations.total && showGit} + +{:else} + +{/if} diff --git a/src/routes/console/project-[project]/settings/+page.svelte b/src/routes/console/project-[project]/settings/+page.svelte index 00f171ef1..f56d862a7 100644 --- a/src/routes/console/project-[project]/settings/+page.svelte +++ b/src/routes/console/project-[project]/settings/+page.svelte @@ -413,7 +413,7 @@ {#if showGitIstall} - + {/if} {#if showGitDisconnect} diff --git a/src/routes/console/project-[project]/settings/GitInstallationModal.svelte b/src/routes/console/project-[project]/settings/GitInstallationModal.svelte index a9961eec6..2d6eee27e 100644 --- a/src/routes/console/project-[project]/settings/GitInstallationModal.svelte +++ b/src/routes/console/project-[project]/settings/GitInstallationModal.svelte @@ -3,7 +3,7 @@ import Button from '$lib/elements/forms/button.svelte'; import { sdk } from '$lib/stores/sdk'; - export let showGitIstall: boolean; + export let showGitInstall: boolean; function connectGitHub() { sdk.forProject.vcs.createGitHubInstallation( @@ -12,7 +12,7 @@ } - + Connect to Git

Select a provider to import an existing git repositories.

@@ -32,6 +32,6 @@ - +