diff --git a/src/lib/wizards/functions/createTemplate.svelte b/src/lib/wizards/functions/createTemplate.svelte
index dca6b544f..5d9fe8a18 100644
--- a/src/lib/wizards/functions/createTemplate.svelte
+++ b/src/lib/wizards/functions/createTemplate.svelte
@@ -14,6 +14,7 @@
import TemplateConfiguration from './steps/templateConfiguration.svelte';
import RepositoryBehaviour from './steps/repositoryBehaviour.svelte';
import CreateRepository from './steps/createRepository.svelte';
+ import TemplateVariables from './steps/templateVariables.svelte';
async function create() {
const runtimeDetail = $template.runtimes.find((r) => r.name === $templateConfig.runtime);
@@ -60,18 +61,22 @@
const stepsComponents: WizardStepsType = new Map();
stepsComponents.set(1, {
- label: 'Function configuration',
+ label: 'Template configuration',
component: TemplateConfiguration
});
stepsComponents.set(2, {
+ label: 'Variables',
+ component: TemplateVariables
+ });
+ stepsComponents.set(3, {
label: 'Repository behaviour',
component: RepositoryBehaviour
});
- stepsComponents.set(3, {
+ stepsComponents.set(4, {
label: 'Select repository',
component: CreateRepository
});
- stepsComponents.set(4, {
+ stepsComponents.set(5, {
label: 'Git configuration',
component: GitConfiguration
});
diff --git a/src/lib/wizards/functions/steps/templateConfiguration.svelte b/src/lib/wizards/functions/steps/templateConfiguration.svelte
index 048bc67d4..e5a5f950b 100644
--- a/src/lib/wizards/functions/steps/templateConfiguration.svelte
+++ b/src/lib/wizards/functions/steps/templateConfiguration.svelte
@@ -10,42 +10,8 @@
import { WizardStep } from '$lib/layout';
import { sdk } from '$lib/stores/sdk';
import { template, templateConfig } from '../store';
- import { scopes } from '$lib/constants';
- import { addNotification } from '$lib/stores/notifications';
let showCustomId = false;
- let generatingApiKey = false;
- let showApiKeyCheck = false;
-
- async function generateApiKey() {
- if (generatingApiKey) {
- return;
- }
-
- generatingApiKey = true;
-
- try {
- const key = await await sdk.forConsole.projects.createKey(
- $page.params.project,
- 'Generated for Template',
- scopes.map((scope) => scope.scope)
- );
- $templateConfig.variables['APPWRITE_API_KEY'] = key.secret;
- showApiKeyCheck = true;
-
- addNotification({
- type: 'success',
- message: 'Key generated successfully.'
- });
- } catch (error) {
- addNotification({
- type: 'error',
- message: error.message
- });
- } finally {
- generatingApiKey = false;
- }
- }
async function beforeSubmit() {
if (!$templateConfig.runtime) {
@@ -56,10 +22,6 @@
if (!variable.required) {
continue;
}
-
- if (!$templateConfig.variables[variable.name]) {
- throw new Error(`Please set ${variable.name} variable.`);
- }
}
}
@@ -84,30 +46,13 @@
Environment variables
- -- By clicking generate button, an API key will be - automatically generated in the background, and filled into - input field. This API key will be granted all scopes and - will never expire. -
-- - {@html variable.description} -
-Environment variables
+ ++ By clicking generate button, an API key will be + automatically generated in the background, and filled into + input field. This API key will be granted all scopes and + will never expire. +
++ + {@html variable.description} +
+