From 67ea17b817640d048e6c42531d64ce12c76991a9 Mon Sep 17 00:00:00 2001 From: Arman Date: Thu, 17 Aug 2023 16:20:25 +0200 Subject: [PATCH] fix: template wizard --- package-lock.json | 2 +- package.json | 2 +- .../functions/components/repositories.svelte | 106 +++++++------- src/lib/wizards/functions/cover.svelte | 25 +++- .../functions/steps/templateVariables.svelte | 136 ++++++++++++------ 5 files changed, 172 insertions(+), 99 deletions(-) diff --git a/package-lock.json b/package-lock.json index ead84edd2..6277205a5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "@analytics/google-tag-manager": "^0.5.3", "@appwrite.io/console": "npm:matej-appwrite-console@7.1.125", "@appwrite.io/pink": "0.1.0-next.3", - "@appwrite.io/pink-icons": "0.1.0-next.3", + "@appwrite.io/pink-icons": "^0.1.0-next.3", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", "@sentry/tracing": "^7.44.2", diff --git a/package.json b/package.json index e5085990f..e8ce74b8e 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "@analytics/google-tag-manager": "^0.5.3", "@appwrite.io/console": "npm:matej-appwrite-console@7.1.125", "@appwrite.io/pink": "0.1.0-next.3", - "@appwrite.io/pink-icons": "0.1.0-next.3", + "@appwrite.io/pink-icons": "^0.1.0-next.3", "@popperjs/core": "^2.11.6", "@sentry/svelte": "^7.44.2", "@sentry/tracing": "^7.44.2", diff --git a/src/lib/wizards/functions/components/repositories.svelte b/src/lib/wizards/functions/components/repositories.svelte index eff73528c..809881601 100644 --- a/src/lib/wizards/functions/components/repositories.svelte +++ b/src/lib/wizards/functions/components/repositories.svelte @@ -1,7 +1,7 @@ @@ -23,50 +32,93 @@ Edit the values of the environment variables that will be passed to your function at runtime. -
- {#if $template?.variables?.length} -
-

Environment variables

+ {#if $template?.variables?.length} + {#if requiredVariables?.length} + + + Required variables + + {requiredVariables.length} + - {#each $template.variables as variable} - {#if variable.name === 'APPWRITE_API_KEY'} -
- -
- - - This API key will allow you to interact with the Appwrite - server APIs. Learn more. - -
- - The APPWRITE_API_KEY will be automatically - generated for your project and applied to this function once it's - created. - -
-
- {/if} + + {#each requiredVariables as variable} +
+ - - {@html variable.description} - - {/each} + + {@html variable.description} + +
+ {/each} +
+
+
+ {/if} + + {#if appwriteVariable} +
+ +
+ + + This API key will allow you to interact with the Appwrite server APIs. Learn more. + +
+ + The APPWRITE_API_KEY will be automatically generated + for your project and applied to this function once it's created. + +
{/if} -
+ {#if optionalVariables?.length} + + + Optional variables + + {optionalVariables.length} + + + + {#each optionalVariables as variable} +
+ + + + {@html variable.description} + +
+ {/each} +
+
+
+ {/if} + {/if}