From 22bd0e21891898240c52ccf0b0361e321d58e8dc Mon Sep 17 00:00:00 2001 From: ernstmul Date: Wed, 2 Apr 2025 11:33:19 +0200 Subject: [PATCH] Move to reuse existing routing --- src/lib/components/breadcrumbs.svelte | 24 +- .../studio/sidebarOrganization.svelte | 10 +- src/lib/layout/container.svelte | 17 +- src/lib/layout/shellStudio.svelte | 75 +++++++ src/routes/(console)/+layout.svelte | 36 +-- .../organization-[organization]/+page.svelte | 205 ++++++++++-------- src/routes/(studio)/+layout.svelte | 3 - 7 files changed, 241 insertions(+), 129 deletions(-) create mode 100644 src/lib/layout/shellStudio.svelte diff --git a/src/lib/components/breadcrumbs.svelte b/src/lib/components/breadcrumbs.svelte index ffa48e0b6..194d0b6e9 100644 --- a/src/lib/components/breadcrumbs.svelte +++ b/src/lib/components/breadcrumbs.svelte @@ -80,7 +80,7 @@ title: 'Switch Organization', items: organizations.map((organization) => ({ name: organization.name, - href: `/console/organization-${organization?.$id}` + href: `${base}/organization-${organization?.$id}` })) }, bottom: { @@ -101,7 +101,7 @@ items: [ { name: 'Organization overview', - href: `/console/organization-${selectedOrg?.$id}` + href: `${base}/organization-${selectedOrg?.$id}` } ] }, @@ -139,12 +139,12 @@ if (index < 4) { return { name: project.name, - href: `/console/project-${project.$id}/overview` + href: `${base}/project-${project.$id}/overview` }; } else if (index === 4) { return { name: 'All projects', - href: `/console/organization-${selectedOrg?.$id}` + href: `${base}/organization-${selectedOrg?.$id}` }; } return null; @@ -156,7 +156,7 @@ { name: 'Create project', trailingIcon: IconPlus, - href: `/console/organization-${selectedOrg?.$id}?create-project` + href: `${base}/organization-${selectedOrg?.$id}?create-project` } ] }, @@ -167,7 +167,7 @@ { name: 'Create project', trailingIcon: IconPlus, - href: `/console/organization-${selectedOrg?.$id}?create-project` + href: `${base}/organization-${selectedOrg?.$id}?create-project` } ] } @@ -221,7 +221,7 @@ {#if selectedOrg}
- Organization overview
@@ -241,7 +241,7 @@
{organization.name}
@@ -272,7 +272,7 @@
{organization.name}
@@ -317,7 +317,7 @@ {#if index < 4}
- {project.name}
@@ -325,7 +325,7 @@
All projects
@@ -337,7 +337,7 @@ Create project diff --git a/src/lib/components/studio/sidebarOrganization.svelte b/src/lib/components/studio/sidebarOrganization.svelte index 84e7b405a..0af4c1ef8 100644 --- a/src/lib/components/studio/sidebarOrganization.svelte +++ b/src/lib/components/studio/sidebarOrganization.svelte @@ -11,15 +11,15 @@ {organization.name} - Projects - Members - Usage - Billing - Settings diff --git a/src/lib/layout/container.svelte b/src/lib/layout/container.svelte index abe25a4a9..a104f9f43 100644 --- a/src/lib/layout/container.svelte +++ b/src/lib/layout/container.svelte @@ -1,5 +1,6 @@ -
-
- - - +{#if isStudio} + +{:else} +
+
+ + + +
-
+{/if} diff --git a/src/routes/(console)/+layout.svelte b/src/routes/(console)/+layout.svelte index e8f555fc0..c2dbb2932 100644 --- a/src/routes/(console)/+layout.svelte +++ b/src/routes/(console)/+layout.svelte @@ -3,6 +3,7 @@ import { BillingPlan, INTERVAL } from '$lib/constants'; import Footer from '$lib/layout/footer.svelte'; import Shell from '$lib/layout/shell.svelte'; + import ShellStudio from '$lib/layout/shellStudio.svelte'; import { app } from '$lib/stores/app'; import { newOrgModal, organization, type Organization } from '$lib/stores/organization'; import { database, checkForDatabaseBackupPolicies } from '$lib/stores/database'; @@ -32,7 +33,7 @@ import { openMigrationWizard } from './(migration-wizard)'; import { project } from './project-[project]/store'; import { feedback } from '$lib/stores/feedback'; - import { hasStripePublicKey, isCloud, VARS } from '$lib/system'; + import { hasStripePublicKey, isCloud, isStudio, VARS } from '$lib/system'; import { stripe } from '$lib/stores/stripe'; import MobileSupportModal from './wizard/support/mobileSupportModal.svelte'; import { showSupportModal } from './wizard/support/store'; @@ -329,21 +330,24 @@ - - - -