fix(frontend): show database management entry to local users
This commit is contained in:
@@ -121,7 +121,7 @@ test("keeps a live core session connected and returns when that session is opene
|
|||||||
expect(FakeEventSource.instances).toHaveLength(1);
|
expect(FakeEventSource.instances).toHaveLength(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("hides database management from users without workspace management permission", () => {
|
test("shows database management entry to authenticated users without workspace management permission", () => {
|
||||||
clearAuthState();
|
clearAuthState();
|
||||||
setAuthState({
|
setAuthState({
|
||||||
issuer: "test",
|
issuer: "test",
|
||||||
@@ -135,5 +135,5 @@ test("hides database management from users without workspace management permissi
|
|||||||
|
|
||||||
renderShell();
|
renderShell();
|
||||||
|
|
||||||
expect(screen.queryByRole("button", { name: "Database management" })).not.toBeInTheDocument();
|
expect(screen.getByRole("button", { name: "Database management" })).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -745,22 +745,20 @@ export function AppShell({ canLogout }: AppShellProps) {
|
|||||||
>
|
>
|
||||||
Workspace management
|
Workspace management
|
||||||
</Button>
|
</Button>
|
||||||
{canManageWorkspace && (
|
<Button
|
||||||
<Button
|
variant="ghost"
|
||||||
variant="ghost"
|
size="sm"
|
||||||
size="sm"
|
className={[
|
||||||
className={[
|
"w-full justify-start hover:bg-sidebar-accent",
|
||||||
"w-full justify-start hover:bg-sidebar-accent",
|
activeSurface === "database-management"
|
||||||
activeSurface === "database-management"
|
? "bg-sidebar-accent font-bold text-sidebar-accent-foreground"
|
||||||
? "bg-sidebar-accent font-bold text-sidebar-accent-foreground"
|
: "",
|
||||||
: "",
|
].join(" ")}
|
||||||
].join(" ")}
|
aria-current={activeSurface === "database-management" ? "page" : undefined}
|
||||||
aria-current={activeSurface === "database-management" ? "page" : undefined}
|
onClick={() => setActiveSurface("database-management")}
|
||||||
onClick={() => setActiveSurface("database-management")}
|
>
|
||||||
>
|
Database management
|
||||||
Database management
|
</Button>
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
{canManagePi && (
|
{canManagePi && (
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
|
|||||||
Reference in New Issue
Block a user