Move plugin settings access from sidebar to app card
Remove the "Extensions" section from the sidebar nav. Instead, each app card on the Apps page shows an "Extension" button when the current user has access to that app's plugin (matched by service ID). The button links to /settings/plugins/:id alongside the existing admin Settings button. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Link } from "react-router-dom";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { getMe, getServices } from "../api/client";
|
||||
import { getMe, getPlugins, getServices } from "../api/client";
|
||||
|
||||
const cardBase: React.CSSProperties = {
|
||||
backgroundColor: "rgb(var(--color-surface))",
|
||||
@@ -34,6 +34,12 @@ export default function AppsPage() {
|
||||
refetchInterval: 30_000,
|
||||
refetchIntervalInBackground: true,
|
||||
});
|
||||
const { data: plugins = [] } = useQuery({
|
||||
queryKey: ["plugins"],
|
||||
queryFn: getPlugins,
|
||||
retry: false,
|
||||
});
|
||||
const pluginIds = new Set(plugins.map((p) => p.id));
|
||||
|
||||
return (
|
||||
<div style={{ padding: 32, maxWidth: 900, margin: "0 auto" }}>
|
||||
@@ -93,6 +99,23 @@ export default function AppsPage() {
|
||||
Settings
|
||||
</Link>
|
||||
)}
|
||||
{pluginIds.has(svc.id) && (
|
||||
<Link
|
||||
to={`/settings/plugins/${svc.id}`}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
style={{
|
||||
padding: "6px 14px",
|
||||
border: "1px solid #ccc",
|
||||
borderRadius: 4,
|
||||
textDecoration: "none",
|
||||
fontSize: 14,
|
||||
color: "#333",
|
||||
}}
|
||||
title="Extension settings"
|
||||
>
|
||||
Extension
|
||||
</Link>
|
||||
)}
|
||||
</div>
|
||||
</CardWrapper>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user