diff --git a/src/components/PeerGroupSelector.tsx b/src/components/PeerGroupSelector.tsx index e3b6037b..5cfaa61e 100644 --- a/src/components/PeerGroupSelector.tsx +++ b/src/components/PeerGroupSelector.tsx @@ -76,7 +76,7 @@ interface MultiSelectProps { closeOnSelect?: boolean; resource?: PolicyRuleResource; onResourceChange?: (resource?: PolicyRuleResource) => void; - placeholder?: string; + placeholder?: React.ReactNode | string; customTrigger?: React.ReactNode; align?: "start" | "end"; side?: "top" | "bottom"; @@ -397,7 +397,9 @@ export function PeerGroupSelector({ })} {values.length == 0 && !resource && ( - {placeholder} + + {placeholder} + )} diff --git a/src/modules/reverse-proxy/ReverseProxyModal.tsx b/src/modules/reverse-proxy/ReverseProxyModal.tsx index 7070a487..693a3abc 100644 --- a/src/modules/reverse-proxy/ReverseProxyModal.tsx +++ b/src/modules/reverse-proxy/ReverseProxyModal.tsx @@ -791,6 +791,7 @@ export default function ReverseProxyModal({ onOpenChange={setSsoModalOpen} key={ssoModalOpen ? "sso1" : "sso0"} currentGroups={bearerGroups} + isEnabled={bearerEnabled} onSave={(groups) => { setTimeout(() => { setBearerGroups(groups); diff --git a/src/modules/reverse-proxy/auth/AuthSSOModal.tsx b/src/modules/reverse-proxy/auth/AuthSSOModal.tsx index 4050ebbd..d9bc3c39 100644 --- a/src/modules/reverse-proxy/auth/AuthSSOModal.tsx +++ b/src/modules/reverse-proxy/auth/AuthSSOModal.tsx @@ -5,11 +5,15 @@ import { PeerGroupSelector } from "@components/PeerGroupSelector"; import { GradientFadedBackground } from "@components/ui/GradientFadedBackground"; import React, { useState } from "react"; import { Group } from "@/interfaces/Group"; +import { useUsers } from "@/contexts/UsersProvider"; +import Badge from "@components/Badge"; +import { CircleUser } from "lucide-react"; type Props = { open: boolean; onOpenChange: (open: boolean) => void; currentGroups: Group[]; + isEnabled: boolean; onSave: (groups: Group[]) => void; onRemove: () => void; }; @@ -18,17 +22,17 @@ export default function AuthSSOModal({ open, onOpenChange, currentGroups, + isEnabled, onSave, onRemove, }: Readonly) { + const { users } = useUsers(); const [groups, setGroups] = useState(currentGroups); - const isEditing = currentGroups.length > 0; + const isEditing = isEnabled; const handleSave = () => { - if (groups.length > 0) { - onOpenChange(false); - onSave(groups); - } + onOpenChange(false); + onSave(groups); }; const handleRemove = () => { @@ -51,7 +55,17 @@ export default function AuthSSOModal({ + + + All Users + + Select user groups... + + } + users={users} + hideAllGroup={true} />
{isEditing ? ( @@ -63,11 +77,7 @@ export default function AuthSSOModal({ -
@@ -79,12 +89,8 @@ export default function AuthSSOModal({ -