diff --git a/package-lock.json b/package-lock.json index 459ed0e64..a40029152 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.1", "dependencies": { "@analytics/google-analytics": "^1.0.5", - "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.52", + "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.63", "@aw-labs/icons": "0.0.0-77", "@aw-labs/ui": "0.0.0-77", "@popperjs/core": "^2.11.6", @@ -146,9 +146,9 @@ }, "node_modules/@aw-labs/appwrite-console": { "name": "matej-appwrite-console", - "version": "7.1.52", - "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.52.tgz", - "integrity": "sha512-RuGQH8CjQVjyta9+lxidJxswRKXWYPdoJZp8SyIrXIOs4smYz39UCPpeRuW1XV9si3W2ge2Mm2Zrx/y3PunH1Q==", + "version": "7.1.63", + "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.63.tgz", + "integrity": "sha512-qdQ+mYQzr2bqpIiUc70AG/BbC8YDmpxp/Bx+VuNsOE75/aSD2dRKfMbqcLtcNY9HtnMbX4x1Bo6jmTdE00MDxw==", "dependencies": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" @@ -7741,9 +7741,9 @@ "integrity": "sha512-1Yw7u/COtxx06BfwlI+kVhsa/upKYzmCNrT4c8QDeCY2KMYlnijkUjtHiPU08HxyTIVB5j6d75O0YWVIHwQS8g==" }, "@aw-labs/appwrite-console": { - "version": "npm:matej-appwrite-console@7.1.52", - "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.52.tgz", - "integrity": "sha512-RuGQH8CjQVjyta9+lxidJxswRKXWYPdoJZp8SyIrXIOs4smYz39UCPpeRuW1XV9si3W2ge2Mm2Zrx/y3PunH1Q==", + "version": "npm:matej-appwrite-console@7.1.63", + "resolved": "https://registry.npmjs.org/matej-appwrite-console/-/matej-appwrite-console-7.1.63.tgz", + "integrity": "sha512-qdQ+mYQzr2bqpIiUc70AG/BbC8YDmpxp/Bx+VuNsOE75/aSD2dRKfMbqcLtcNY9HtnMbX4x1Bo6jmTdE00MDxw==", "requires": { "cross-fetch": "3.1.5", "isomorphic-form-data": "2.0.0" diff --git a/package.json b/package.json index c8fa8ad35..165874b91 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "node": ">=16" }, "scripts": { - "dev": "vite dev", + "dev": "vite dev --host 0.0.0.0", "build": "vite build", "preview": "vite preview", "sync": "svelte-kit sync", @@ -21,7 +21,7 @@ "dependencies": { "@analytics/google-analytics": "^1.0.5", "analytics": "^0.8.1", - "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.52", + "@aw-labs/appwrite-console": "npm:matej-appwrite-console@7.1.63", "@aw-labs/icons": "0.0.0-77", "@aw-labs/ui": "0.0.0-77", "@popperjs/core": "^2.11.6", 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 3daf677bb..121dcbd55 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 @@ -24,6 +24,7 @@ import InputSwitch from '$lib/elements/forms/inputSwitch.svelte'; import Variables from '$lib/components/environmentVariables/variables.svelte'; import GitConnection from './gitConnection.svelte'; + import InputSelect from '$lib/elements/forms/inputSelect.svelte'; export let data: PageData; @@ -39,6 +40,7 @@ let entrypoint: string = null; let buildCommand: string = null; let installCommand: string = null; + let branch: string = null; let showGitConnection = false; @@ -55,6 +57,7 @@ entrypoint ??= $func.entrypoint; buildCommand ??= $func.buildCommand; installCommand ??= $func.installCommand; + branch ??= $func.branch; $eventSet = new Set($func.events); }); @@ -73,7 +76,8 @@ $func.buildCommand, $func.installCommand, $func.vcsInstallationId, - $func.repositoryId + $func.repositoryId, + $func.branch ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -104,7 +108,8 @@ $func.buildCommand, $func.installCommand, $func.vcsInstallationId, - $func.repositoryId + $func.repositoryId, + $func.branch ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -135,7 +140,8 @@ $func.buildCommand, $func.installCommand, $func.vcsInstallationId, - $func.repositoryId + $func.repositoryId, + $func.branch ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -166,7 +172,8 @@ $func.buildCommand, $func.installCommand, $func.vcsInstallationId, - $func.repositoryId + $func.repositoryId, + $func.branch ); invalidate(Dependencies.FUNCTION); addNotification({ @@ -197,7 +204,8 @@ $func.buildCommand, $func.installCommand, $func.vcsInstallationId, - $func.repositoryId + $func.repositoryId, + $func.branch ); invalidate(Dependencies.FUNCTION); @@ -229,7 +237,8 @@ $func.buildCommand, $func.installCommand, $func.vcsInstallationId, - $func.repositoryId + $func.repositoryId, + $func.branch ); invalidate(Dependencies.FUNCTION); @@ -261,7 +270,41 @@ buildCommand, installCommand, $func.vcsInstallationId, - $func.repositoryId + $func.repositoryId, + $func.branch + ); + + invalidate(Dependencies.FUNCTION); + addNotification({ + type: 'success', + message: 'Deployment settings has been updated' + }); + trackEvent('submit_function_update_deployment_settings'); + } catch (error) { + addNotification({ + type: 'error', + message: error.message + }); + } + } + + async function updateBranch() { + try { + await sdkForProject.functions.update( + functionId, + $func.name, + $func.execute, + $func.events, + $func.schedule, + $func.timeout, + $func.enabled, + $func.logging, + $func.entrypoint, + $func.buildCommand, + $func.installCommand, + $func.vcsInstallationId, + $func.repositoryId, + branch ); invalidate(Dependencies.FUNCTION); @@ -293,6 +336,7 @@ $func.buildCommand, $func.installCommand, '', + '', '' ); await invalidate(Dependencies.FUNCTION); @@ -399,7 +443,18 @@
SOME TEXT
(Repo name, owner name, link to GitHub, ...)
+2. Select repository: @@ -139,8 +157,8 @@ class="table-col" data-title="Enabled" style="--p-col-width:40"> - + {/each} @@ -160,6 +178,27 @@ {/if}
+ {:else} ++ 3. Select branch: + + {#if branches === null} +
Loading...
+ {:else} +