mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: bindable issues.
This commit is contained in:
@@ -15,10 +15,10 @@
|
||||
import { formatCurrency } from '$lib/helpers/numbers';
|
||||
|
||||
let {
|
||||
projectName = $bindable(''),
|
||||
id = $bindable(''),
|
||||
projectName = $bindable(),
|
||||
id = $bindable(),
|
||||
regions = [],
|
||||
region = $bindable(''),
|
||||
region = $bindable(),
|
||||
showTitle = true,
|
||||
billingPlan = undefined,
|
||||
projects = undefined,
|
||||
|
||||
@@ -15,10 +15,11 @@
|
||||
import { user } from '$lib/stores/user';
|
||||
|
||||
let isLoading = false;
|
||||
let id: string = ID.unique();
|
||||
let startAnimation = false;
|
||||
let projectName = 'Appwrite project';
|
||||
let region = Region.Fra;
|
||||
|
||||
let projectId = ID.unique();
|
||||
let projectRegion = Region.Fra;
|
||||
let projectName = 'Appwrite Project';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -39,16 +40,16 @@
|
||||
try {
|
||||
const teamId = data.organization.$id;
|
||||
const project = await sdk.forConsole.projects.create({
|
||||
projectId: id ?? ID.unique(),
|
||||
projectId: projectId ?? ID.unique(),
|
||||
name: projectName,
|
||||
teamId,
|
||||
region: isCloud ? region : undefined
|
||||
region: isCloud ? projectRegion : undefined
|
||||
});
|
||||
|
||||
markOnboardingComplete();
|
||||
|
||||
trackEvent(Submit.ProjectCreate, {
|
||||
customId: !!id,
|
||||
customId: !!projectId,
|
||||
teamId
|
||||
});
|
||||
|
||||
@@ -95,11 +96,11 @@
|
||||
alt="Appwrite Logo" />
|
||||
<Card.Base variant="primary" padding="l">
|
||||
<CreateProject
|
||||
regions={$regionsStore?.regions}
|
||||
showTitle
|
||||
bind:projectName
|
||||
bind:id
|
||||
bind:region
|
||||
showTitle={true}>
|
||||
bind:id={projectId}
|
||||
bind:region={projectRegion}
|
||||
regions={$regionsStore?.regions}>
|
||||
{#snippet submit()}
|
||||
<Layout.Stack direction="row" justifyContent="flex-end">
|
||||
<Button.Button
|
||||
|
||||
@@ -16,10 +16,10 @@
|
||||
export let showCreateProjectCloud: boolean;
|
||||
export let regions: Array<Models.ConsoleRegion> = [];
|
||||
|
||||
let id: string = null;
|
||||
let error: string = null;
|
||||
let name: string = 'New project';
|
||||
let region: ConsoleRegion = Region.Fra;
|
||||
let projectId = ID.unique();
|
||||
let projectRegion = Region.Fra;
|
||||
let projectName = 'New project';
|
||||
|
||||
let showSubmissionLoader = false;
|
||||
|
||||
@@ -30,14 +30,18 @@
|
||||
|
||||
try {
|
||||
project = await sdk.forConsole.projects.create({
|
||||
projectId: id ?? ID.unique(),
|
||||
name,
|
||||
projectId: projectId ?? ID.unique(),
|
||||
name: projectName,
|
||||
teamId,
|
||||
region
|
||||
region: projectRegion
|
||||
});
|
||||
|
||||
await goto(`${base}/project-${project.region}-${project.$id}`);
|
||||
trackEvent(Submit.ProjectCreate, { customId: !!id, teamId, region: region });
|
||||
trackEvent(Submit.ProjectCreate, {
|
||||
customId: !!projectId,
|
||||
teamId,
|
||||
region: projectRegion
|
||||
});
|
||||
} catch (e) {
|
||||
error = e.message;
|
||||
trackError(e, Submit.ProjectCreate);
|
||||
@@ -52,10 +56,10 @@
|
||||
}
|
||||
|
||||
onDestroy(() => {
|
||||
id = null;
|
||||
name = null;
|
||||
error = null;
|
||||
region = Region.Fra;
|
||||
projectId = ID.unique();
|
||||
projectName = 'New project';
|
||||
projectRegion = Region.Fra;
|
||||
showCreateProjectCloud = false;
|
||||
});
|
||||
</script>
|
||||
@@ -67,12 +71,12 @@
|
||||
onSubmit={create}
|
||||
bind:error>
|
||||
<CreateProject
|
||||
{regions}
|
||||
{projects}
|
||||
showTitle={false}
|
||||
bind:id
|
||||
bind:projectName={name}
|
||||
bind:region
|
||||
{regions} />
|
||||
bind:projectName
|
||||
bind:id={projectId}
|
||||
bind:region={projectRegion} />
|
||||
<svelte:fragment slot="footer">
|
||||
<Button
|
||||
submit
|
||||
|
||||
Reference in New Issue
Block a user