diff --git a/apps/Frontend/src/components/settings/selenium-settings-card.jsx b/apps/Frontend/src/components/settings/selenium-settings-card.jsx new file mode 100644 index 00000000..a97756ad --- /dev/null +++ b/apps/Frontend/src/components/settings/selenium-settings-card.jsx @@ -0,0 +1,106 @@ +import { useState, useEffect } from "react"; +import { useQuery, useMutation } from "@tanstack/react-query"; +import { Card, CardContent } from "@/components/ui/card"; +import { CheckCircle } from "lucide-react"; +import { useToast } from "@/hooks/use-toast"; +import { apiRequest, queryClient } from "@/lib/queryClient"; + +export function SeleniumSettingsCard() { + const { toast } = useToast(); + const [paymentGroupId, setPaymentGroupId] = useState(""); + + const { data: settings, isLoading } = useQuery({ + queryKey: ["/api/selenium-settings"], + queryFn: async () => { + const res = await apiRequest("GET", "/api/selenium-settings"); + if (!res.ok) return null; + return res.json(); + }, + }); + + useEffect(() => { + if (settings) { + setPaymentGroupId(settings.paymentGroupId ?? ""); + } + }, [settings]); + + const saveMutation = useMutation({ + mutationFn: async (data) => { + const res = await apiRequest("PUT", "/api/selenium-settings", data); + if (!res.ok) { + const err = await res.json().catch(() => null); + throw new Error(err?.message || "Failed to save Selenium settings"); + } + return res.json(); + }, + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ["/api/selenium-settings"] }); + toast({ title: "Selenium Settings Saved" }); + }, + onError: (err) => { + toast({ title: "Error", description: err?.message || "Failed to save settings", variant: "destructive" }); + }, + }); + + if (isLoading) { + return ( + + + Loading... + + + ); + } + + return ( + + + + + Selenium Settings + {settings?.paymentGroupId && ( + + Configured + + )} + + + Configure values used by Selenium automation workers (United eligibility, claim, and pre-auth). + + + + { + e.preventDefault(); + saveMutation.mutate({ paymentGroupId }); + }} + > + + + Payment Group ID + + + The office name as it appears in the United/DentalHub portal dropdown (e.g. "Summit Dental Care" or "Broadway Dental"). + + setPaymentGroupId(e.target.value)} + className="mt-1 p-2 border rounded w-full" + placeholder="e.g. Summit Dental Care" + /> + + + + {saveMutation.isPending ? "Saving..." : "Save Settings"} + + + + + ); +} diff --git a/apps/Frontend/src/pages/settings-page.jsx b/apps/Frontend/src/pages/settings-page.jsx index 6ad740dd..3f9ef1d7 100644 --- a/apps/Frontend/src/pages/settings-page.jsx +++ b/apps/Frontend/src/pages/settings-page.jsx @@ -19,6 +19,7 @@ import { OfficeContactCard } from "@/components/settings/office-contact-card"; import { ProcedureTimeslotCard } from "@/components/settings/procedure-timeslot-card"; import { InsuranceContactCard } from "@/components/settings/insurance-contact-card"; import { AiChatSettingsCard } from "@/components/settings/ai-chat-settings-card"; +import { SeleniumSettingsCard } from "@/components/settings/selenium-settings-card"; export default function SettingsPage() { const { toast } = useToast(); const { user: currentUser } = useAuth(); @@ -232,6 +233,8 @@ export default function SettingsPage() { return ; case "insurancecontact": return ; + case "selenium": + return ; default: return null; }
Loading...
+ Configure values used by Selenium automation workers (United eligibility, claim, and pre-auth). +
+ The office name as it appears in the United/DentalHub portal dropdown (e.g. "Summit Dental Care" or "Broadway Dental"). +