diff --git a/web-admin/src/components/nav/LeftNav.svelte b/web-admin/src/components/nav/LeftNav.svelte new file mode 100644 index 00000000000..459a7906c85 --- /dev/null +++ b/web-admin/src/components/nav/LeftNav.svelte @@ -0,0 +1,28 @@ + + + + + diff --git a/web-admin/src/components/nav/LeftNavItem.svelte b/web-admin/src/components/nav/LeftNavItem.svelte new file mode 100644 index 00000000000..3687a9a2c8a --- /dev/null +++ b/web-admin/src/components/nav/LeftNavItem.svelte @@ -0,0 +1,25 @@ + + + + {label} + + + diff --git a/web-admin/src/features/embeds/CustomDashboardEmbed.svelte b/web-admin/src/features/embeds/CustomDashboardEmbed.svelte index 96222ae1d59..b9f3699f856 100644 --- a/web-admin/src/features/embeds/CustomDashboardEmbed.svelte +++ b/web-admin/src/features/embeds/CustomDashboardEmbed.svelte @@ -23,4 +23,4 @@ } = dashboard || { items: [], columns: 10, gap: 2 }); - + diff --git a/web-admin/src/features/navigation/TopNavigationBar.svelte b/web-admin/src/features/navigation/TopNavigationBar.svelte index c45f0ea53be..463c373a7c4 100644 --- a/web-admin/src/features/navigation/TopNavigationBar.svelte +++ b/web-admin/src/features/navigation/TopNavigationBar.svelte @@ -29,6 +29,7 @@ import { isMetricsExplorerPage, isProjectPage, + withinOrganization, isPublicURLPage, } from "./nav-utils"; @@ -54,6 +55,7 @@ $: onReportPage = !!report; $: onMetricsExplorerPage = isMetricsExplorerPage($page); $: onPublicURLPage = isPublicURLPage($page); + $: withinOrgPage = withinOrganization($page); $: loggedIn = !!$user.data?.user; $: rillLogoHref = !loggedIn ? "https://www.rilldata.com" : "/"; @@ -155,7 +157,7 @@
+ import { page } from "$app/stores"; + import { createAdminServiceGetOrganization } from "@rilldata/web-admin/client"; + + $: ({ + url: { pathname }, + params: { organization }, + } = $page); + + // Get the list of tabs to display, depending on the user's permissions + $: tabsQuery = createAdminServiceGetOrganization(organization, { + query: { + select: (data) => { + let tabs = [ + { + route: `/${organization}`, + label: "Projects", + }, + ]; + + if (data.permissions.manageOrgMembers) { + // TODO: users page + } + + if (data.permissions.manageOrg) { + // TODO: once settings page is filled in we add these + // tabs.push({ + // route: `/${organization}/-/settings`, + // label: "Settings", + // }); + } + + return tabs; + }, + }, + }); + + $: tabs = $tabsQuery.data; + // 1st entry is always the default page. so findLastIndex will make sure the correct page is matched. + $: selectedIndex = tabs?.findLastIndex((t) => pathname.startsWith(t.route)); + + + +{#if tabs?.length && tabs?.length > 1} + +{:else} + +
+{/if} + + diff --git a/web-admin/src/routes/+layout.svelte b/web-admin/src/routes/+layout.svelte index d7e4cd8af25..f4d63d648d6 100644 --- a/web-admin/src/routes/+layout.svelte +++ b/web-admin/src/routes/+layout.svelte @@ -1,6 +1,11 @@ @@ -60,6 +67,10 @@ createMagicAuthTokens={projectPermissions?.createMagicAuthTokens} manageProjectMembers={projectPermissions?.manageProjectMembers} /> + + {#if withinOnlyOrg} + + {/if} {/if} diff --git a/web-admin/src/routes/[organization]/-/settings/+layout.svelte b/web-admin/src/routes/[organization]/-/settings/+layout.svelte new file mode 100644 index 00000000000..bfcf3494552 --- /dev/null +++ b/web-admin/src/routes/[organization]/-/settings/+layout.svelte @@ -0,0 +1,44 @@ + + +
+

Settings

+
+ + +
+
+ + diff --git a/web-admin/src/routes/[organization]/-/settings/+page.svelte b/web-admin/src/routes/[organization]/-/settings/+page.svelte new file mode 100644 index 00000000000..3c0b0b060f8 --- /dev/null +++ b/web-admin/src/routes/[organization]/-/settings/+page.svelte @@ -0,0 +1 @@ +Coming soon diff --git a/web-admin/src/routes/[organization]/-/settings/billing/+page.svelte b/web-admin/src/routes/[organization]/-/settings/billing/+page.svelte new file mode 100644 index 00000000000..3c0b0b060f8 --- /dev/null +++ b/web-admin/src/routes/[organization]/-/settings/billing/+page.svelte @@ -0,0 +1 @@ +Coming soon diff --git a/web-admin/src/routes/[organization]/-/settings/usage/+page.svelte b/web-admin/src/routes/[organization]/-/settings/usage/+page.svelte new file mode 100644 index 00000000000..3c0b0b060f8 --- /dev/null +++ b/web-admin/src/routes/[organization]/-/settings/usage/+page.svelte @@ -0,0 +1 @@ +Coming soon diff --git a/web-admin/src/routes/[organization]/[project]/-/dashboards/[dashboard]/+page.svelte b/web-admin/src/routes/[organization]/[project]/-/dashboards/[dashboard]/+page.svelte index 901c1c56b63..0b207f9c224 100644 --- a/web-admin/src/routes/[organization]/[project]/-/dashboards/[dashboard]/+page.svelte +++ b/web-admin/src/routes/[organization]/[project]/-/dashboards/[dashboard]/+page.svelte @@ -25,4 +25,4 @@ } = dashboard || { items: [], columns: 10, gap: 2 }); - +