mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-07 02:58:11 +00:00
fix(web): move tool permissions into the connector Manage menu
"Tools" as an inline link next to the connection chips read as decoration and did not say what it did. It is now a "Tool permissions" item in the same Manage menu as connect and disconnect, which is where you already look to change something about a connection. The menu was admin-only (isAdmin && !personalOnly), so putting the entry there unchanged would have hidden it from non-admins and from custom MCP servers — backwards, since tool permissions apply to your own connection. The menu now renders whenever you have something to manage, with the workspace connect and disconnect entry still gated on admin. Non-admins previously got a bare "Disconnect" pill; that action moved into the menu rather than disappearing. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
2600b946ea
commit
f801afc991
1 changed files with 20 additions and 27 deletions
|
|
@ -124,6 +124,8 @@ function AppCard({
|
|||
const anyConnected = userConnected || orgConnected
|
||||
const showOrgChip = !personalOnly && (orgConnected || isAdmin)
|
||||
const adminMenu = isAdmin && !personalOnly
|
||||
// Tool permissions apply to your own connection, so the menu is not admin-only.
|
||||
const showMenu = adminMenu || userConnected
|
||||
|
||||
return (
|
||||
<div className="flex min-w-0 flex-col justify-between gap-3 rounded-xl bg-[#14161A] p-4 shadow-[inset_2.42px_2.42px_4.263px_rgba(11,15,21,0.7)]">
|
||||
|
|
@ -165,19 +167,8 @@ function AppCard({
|
|||
) : null}
|
||||
</>
|
||||
)}
|
||||
{toolsHref && anyConnected ? (
|
||||
<Link
|
||||
href={toolsHref}
|
||||
className={cn(
|
||||
dmSans125ClassName(),
|
||||
"shrink-0 text-[12px] font-medium text-[#8B929E] underline-offset-2 transition-colors hover:text-[#FAFAFA] hover:underline",
|
||||
)}
|
||||
>
|
||||
Tools
|
||||
</Link>
|
||||
) : null}
|
||||
</div>
|
||||
{adminMenu ? (
|
||||
{showMenu ? (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<button
|
||||
|
|
@ -212,6 +203,11 @@ function AppCard({
|
|||
background: "linear-gradient(180deg, #0A0E14 0%, #05070A 100%)",
|
||||
}}
|
||||
>
|
||||
{toolsHref && userConnected ? (
|
||||
<DropdownMenuItem asChild className={menuItemClass}>
|
||||
<Link href={toolsHref}>Tool permissions</Link>
|
||||
</DropdownMenuItem>
|
||||
) : null}
|
||||
<DropdownMenuItem
|
||||
className={menuItemClass}
|
||||
onClick={() =>
|
||||
|
|
@ -220,23 +216,20 @@ function AppCard({
|
|||
>
|
||||
{userConnected ? "Disconnect my account" : "Connect my account"}
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem
|
||||
className={menuItemClass}
|
||||
onClick={() =>
|
||||
orgConnected ? onDisconnect(true) : onConnect(true)
|
||||
}
|
||||
>
|
||||
{orgConnected
|
||||
? "Disconnect workspace"
|
||||
: "Connect for workspace"}
|
||||
</DropdownMenuItem>
|
||||
{adminMenu ? (
|
||||
<DropdownMenuItem
|
||||
className={menuItemClass}
|
||||
onClick={() =>
|
||||
orgConnected ? onDisconnect(true) : onConnect(true)
|
||||
}
|
||||
>
|
||||
{orgConnected
|
||||
? "Disconnect workspace"
|
||||
: "Connect for workspace"}
|
||||
</DropdownMenuItem>
|
||||
) : null}
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
) : userConnected ? (
|
||||
<PillButton onClick={() => onDisconnect(false)} disabled={busy}>
|
||||
{busy && <Loader2 className="size-3.5 animate-spin" />}
|
||||
Disconnect
|
||||
</PillButton>
|
||||
) : personalOnly ? null : (
|
||||
<PillButton onClick={() => onConnect(false)} disabled={busy}>
|
||||
{busy && <Loader2 className="size-3.5 animate-spin" />}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue