From b4b3cf27df71be30cade7ce2c73b1152423c6f0e Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 12 Apr 2024 14:24:12 +0200 Subject: [PATCH] feat: initial commit testing --- src/lib/layout/index.ts | 3 + src/lib/layout/wizard.svelte | 27 ++----- src/lib/layout/wizardHeader.svelte | 33 ++++++++ src/lib/layout/wizardMainWrapper.svelte | 6 ++ src/lib/layout/wizardPage.svelte | 11 +++ .../wiz/(1)/first/+layout.ts | 5 ++ .../wiz/(1)/first/+page.svelte | 1 + .../wiz/(1)/first/header.svelte | 5 ++ .../wiz/+layout@.svelte | 38 +++++++++ .../create-file/(1)/upload/+page.svelte | 77 +++++++++++++++++++ .../(2)/set-permissions/+page.svelte | 39 ++++++++++ .../bucket-[bucket]/create-file/+layout.ts | 17 ++++ .../create-file/+layout@.svelte | 28 +++++++ 13 files changed, 270 insertions(+), 20 deletions(-) create mode 100644 src/lib/layout/wizardHeader.svelte create mode 100644 src/lib/layout/wizardMainWrapper.svelte create mode 100644 src/lib/layout/wizardPage.svelte create mode 100644 src/routes/console/organization-[organization]/wiz/(1)/first/+layout.ts create mode 100644 src/routes/console/organization-[organization]/wiz/(1)/first/+page.svelte create mode 100644 src/routes/console/organization-[organization]/wiz/(1)/first/header.svelte create mode 100644 src/routes/console/organization-[organization]/wiz/+layout@.svelte create mode 100644 src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(1)/upload/+page.svelte create mode 100644 src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(2)/set-permissions/+page.svelte create mode 100644 src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout.ts create mode 100644 src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout@.svelte diff --git a/src/lib/layout/index.ts b/src/lib/layout/index.ts index cf1bd6e4b..21818a761 100644 --- a/src/lib/layout/index.ts +++ b/src/lib/layout/index.ts @@ -10,6 +10,9 @@ export { default as Shell } from './shell.svelte'; export { default as Logs } from './logs.svelte'; export { default as Wizard } from './wizard.svelte'; export { default as WizardStep } from './wizardStep.svelte'; +export { default as WizardHeader } from './wizardHeader.svelte'; +export { default as WizardPage } from './wizardPage.svelte'; +export { default as WizardMainWrapper } from './wizardMainWrapper.svelte'; export { default as Breadcrumbs } from './breadcrumbs.svelte'; export { default as Unauthenticated } from './unauthenticated.svelte'; export { default as Usage, type UsagePeriods } from './usage.svelte'; diff --git a/src/lib/layout/wizard.svelte b/src/lib/layout/wizard.svelte index b55c4ff3c..dd8f19a40 100644 --- a/src/lib/layout/wizard.svelte +++ b/src/lib/layout/wizard.svelte @@ -3,7 +3,8 @@ number, { label: string; - component: typeof SvelteComponent; + component?: typeof SvelteComponent; + href?: string; optional?: boolean; disabled?: boolean; } @@ -19,6 +20,8 @@ import { wizard } from '$lib/stores/wizard'; import { createEventDispatcher, type SvelteComponent } from 'svelte'; import WizardExitModal from './wizardExitModal.svelte'; + import WizardHeader from './wizardHeader.svelte'; + import WizardMainWrapper from './wizardMainWrapper.svelte'; export let title: string; export let steps: WizardStepsType; @@ -132,24 +135,8 @@ -
-
-
-
- -
-
{title}
- - - -
- + +
-
+ {#if showExitModal} + export let title: string; + export let header: string = ''; + export let href: string = null; + + +
+
{title}
+ + {#if header} + {header} + {:else} + + {/if} + + {#if href} + + + {:else} + + {/if} +
diff --git a/src/lib/layout/wizardMainWrapper.svelte b/src/lib/layout/wizardMainWrapper.svelte new file mode 100644 index 000000000..013912612 --- /dev/null +++ b/src/lib/layout/wizardMainWrapper.svelte @@ -0,0 +1,6 @@ +
+
+
+
+ +
diff --git a/src/lib/layout/wizardPage.svelte b/src/lib/layout/wizardPage.svelte new file mode 100644 index 000000000..6019b4623 --- /dev/null +++ b/src/lib/layout/wizardPage.svelte @@ -0,0 +1,11 @@ + + +
+
+ + +
diff --git a/src/routes/console/organization-[organization]/wiz/(1)/first/+layout.ts b/src/routes/console/organization-[organization]/wiz/(1)/first/+layout.ts new file mode 100644 index 000000000..24df18fd6 --- /dev/null +++ b/src/routes/console/organization-[organization]/wiz/(1)/first/+layout.ts @@ -0,0 +1,5 @@ +export async function load() { + return { + wizardTitle: 'page 1' + }; +} diff --git a/src/routes/console/organization-[organization]/wiz/(1)/first/+page.svelte b/src/routes/console/organization-[organization]/wiz/(1)/first/+page.svelte new file mode 100644 index 000000000..9daeafb98 --- /dev/null +++ b/src/routes/console/organization-[organization]/wiz/(1)/first/+page.svelte @@ -0,0 +1 @@ +test diff --git a/src/routes/console/organization-[organization]/wiz/(1)/first/header.svelte b/src/routes/console/organization-[organization]/wiz/(1)/first/header.svelte new file mode 100644 index 000000000..9699366d1 --- /dev/null +++ b/src/routes/console/organization-[organization]/wiz/(1)/first/header.svelte @@ -0,0 +1,5 @@ + + + diff --git a/src/routes/console/organization-[organization]/wiz/+layout@.svelte b/src/routes/console/organization-[organization]/wiz/+layout@.svelte new file mode 100644 index 000000000..25abd5afa --- /dev/null +++ b/src/routes/console/organization-[organization]/wiz/+layout@.svelte @@ -0,0 +1,38 @@ + + + + + + + +
+ +
+
diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(1)/upload/+page.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(1)/upload/+page.svelte new file mode 100644 index 000000000..4a9e98f93 --- /dev/null +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(1)/upload/+page.svelte @@ -0,0 +1,77 @@ + + + + Create file + Upload a file to add it to your bucket. + + {#if isCloud} + {@const size = humanFileSize(sizeToBytes(service, 'MB', 1000))} + {@const plan = tierToPlan($organization?.billingPlan)} + +

+ The {plan.name} plan has a maximum upload file size limit of {Math.floor( + parseInt(size.value) + )}{size.unit}. + {#if $organization?.billingPlan === BillingPlan.STARTER} + Upgrade to allow files of a larger size. + {/if} +

+ + {#if $organization?.billingPlan === BillingPlan.STARTER} +
+ +
+ {/if} +
+
+ {/if} + + +
+ +
+ + {#if !showCustomId} +
+ (showCustomId = !showCustomId)}> + +
+ {:else} +
+ +
+ {/if} +
+
+ + diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(2)/set-permissions/+page.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(2)/set-permissions/+page.svelte new file mode 100644 index 000000000..f80e98214 --- /dev/null +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/(2)/set-permissions/+page.svelte @@ -0,0 +1,39 @@ + + + + Update Permissions + + Choose who can access your buckets and files. For more information, check out the + + Permissions Guide + . + + {#if $bucket.fileSecurity} +
+ + File security enabled + Users will be able to access this file if they have been granted + either File or Bucket permissions. + +
+
+ +
+ {:else} + + File security disabled + If you want to assign file permissions, navigate to Bucket settings and enable file security. + Otherwise, only Bucket permissions will be used. + + {/if} +
diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout.ts b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout.ts new file mode 100644 index 000000000..9e1d6def0 --- /dev/null +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout.ts @@ -0,0 +1,17 @@ +import { get } from 'svelte/store'; +import { sdk } from '$lib/stores/sdk'; +import { page } from '$app/stores'; + +export async function load({ params }) { + const bucket = get(page)?.data?.bucket; + + if (!bucket) { + return { + bucket: await sdk.forProject.storage.getBucket(params.bucket) + }; + } else { + return { + bucket + }; + } +} diff --git a/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout@.svelte b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout@.svelte new file mode 100644 index 000000000..f9428f17d --- /dev/null +++ b/src/routes/console/project-[project]/storage/bucket-[bucket]/create-file/+layout@.svelte @@ -0,0 +1,28 @@ + + + + + + + +
+ +
+