Skip to content

Commit

Permalink
Merge pull request #577 from appwrite/fix/potential-includes-error
Browse files Browse the repository at this point in the history
Migrations: Fix migration from Cloud to Self-Hosted
  • Loading branch information
TorstenDittmann authored Oct 4, 2023
2 parents af8453d + f192c60 commit ffb7476
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/lib/stores/migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const providerResources: Record<Provider, Resource[]> = {

export const migrationFormToResources = (
formData: MigrationFormData,
provider?: Provider
provider: Provider
): Resource[] => {
const resources: Resource[] = [];
const addResource = (resource: Resource) => {
Expand Down
16 changes: 8 additions & 8 deletions src/routes/console/(migration-wizard)/resource-form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@
</ul>

<ul class="u-flex u-flex-vertical u-margin-block-start-16">
{#if resources.includes('user')}
{#if resources?.includes('user')}
<li class="checkbox-field">
<input
type="checkbox"
Expand All @@ -263,7 +263,7 @@
<div />
<span>Import all users</span>

{#if resources.includes('team')}
{#if resources?.includes('team')}
<ul>
<li class="checkbox-field">
<input
Expand All @@ -288,7 +288,7 @@
</li>
{/if}

{#if resources.includes('database')}
{#if resources?.includes('database')}
<li class="checkbox-field">
<input
type="checkbox"
Expand All @@ -307,7 +307,7 @@
<div />
<span>Import all databases, including collections, indexes and attributes</span>

{#if resources.includes('document')}
{#if resources?.includes('document')}
<ul>
<li class="checkbox-field">
<input
Expand All @@ -332,7 +332,7 @@
</li>
{/if}

{#if resources.includes('function') && isVersionAtLeast(version, '1.4.0')}
{#if resources?.includes('function') && isVersionAtLeast(version, '1.4.0')}
<li class="checkbox-field">
<input
type="checkbox"
Expand All @@ -351,7 +351,7 @@
<div />
<span>Import all functions and their active deployment</span>
<ul>
{#if resources.includes('envVar')}
{#if resources?.includes('envVar')}
<li class="checkbox-field">
<input
type="checkbox"
Expand All @@ -364,7 +364,7 @@
<span>Import all environment variables</span>
</li>
{/if}
{#if resources.includes('deployment')}
{#if resources?.includes('deployment')}
<li class="checkbox-field">
<input
type="checkbox"
Expand All @@ -381,7 +381,7 @@
</li>
{/if}

{#if resources.includes('bucket') && resources.includes('file')}
{#if resources?.includes('bucket') && resources?.includes('file')}
<li class="checkbox-field">
<input
type="checkbox"
Expand Down
2 changes: 1 addition & 1 deletion src/routes/console/(migration-wizard)/wizard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
};
const onFinish = async () => {
const resources = migrationFormToResources($formData);
if ($provider.provider !== 'appwrite') return;
const resources = migrationFormToResources($formData, $provider.provider);
await getSdkForProject($selectedProject).migrations.createAppwriteMigration(
resources,
Expand Down

4 comments on commit ffb7476

@vercel
Copy link

@vercel vercel bot commented on ffb7476 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

console-cloud – ./

console-cloud-git-main-appwrite.vercel.app
console-cloud-appwrite.vercel.app
console-cloud.vercel.app

@vercel
Copy link

@vercel vercel bot commented on ffb7476 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ffb7476 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ffb7476 Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

console-preview – ./

console-preview-git-main-appwrite.vercel.app
console-preview-appwrite.vercel.app
console-next.vercel.app

Please sign in to comment.