hide config for agent skills to manager (perm not allowed) (#2469)

This commit is contained in:
Timothy Carambat 2024-10-14 14:25:22 -07:00 committed by GitHub
parent b658f5012d
commit 1a0ddfcd20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,8 +8,10 @@ import Admin from "@/models/admin";
import * as Skeleton from "react-loading-skeleton";
import "react-loading-skeleton/dist/skeleton.css";
import paths from "@/utils/paths";
import useUser from "@/hooks/useUser";
export default function WorkspaceAgentConfiguration({ workspace }) {
const { user } = useUser();
const [settings, setSettings] = useState({});
const [hasChanges, setHasChanges] = useState(false);
const [saving, setSaving] = useState(false);
@ -84,6 +86,8 @@ export default function WorkspaceAgentConfiguration({ workspace }) {
workspace={workspace}
setHasChanges={setHasChanges}
/>
{(!user || user?.role === "admin") && (
<>
{!hasChanges && (
<div className="flex flex-col gap-y-4">
<a
@ -93,12 +97,15 @@ export default function WorkspaceAgentConfiguration({ workspace }) {
Configure Agent Skills
</a>
<p className="text-white text-opacity-60 text-xs font-medium">
Customize and enhance the default agent's capabilities by enabling
or disabling specific skills. These settings will be applied
across all workspaces.
Customize and enhance the default agent's capabilities by
enabling or disabling specific skills. These settings will be
applied across all workspaces.
</p>
</div>
)}
</>
)}
{hasChanges && (
<button
type="submit"