From 1ccaaed8be78a6b6fa9a32c6c3f46c2ca97f50ca Mon Sep 17 00:00:00 2001 From: jtricerolph Date: Tue, 7 Jul 2026 12:52:37 +0000 Subject: [PATCH] AdminSettings: Workforce location picker with fetch button Co-Authored-By: Claude Sonnet 4.6 --- src/pages/AdminSettings.tsx | 65 ++++++++++++++++++++++++++++++++----- 1 file changed, 56 insertions(+), 9 deletions(-) diff --git a/src/pages/AdminSettings.tsx b/src/pages/AdminSettings.tsx index 7bb10d5..78aaf53 100644 --- a/src/pages/AdminSettings.tsx +++ b/src/pages/AdminSettings.tsx @@ -33,6 +33,7 @@ const FIELD_LABELS: Record = { client_id: 'Client ID', host: 'Host', port: 'Port', database: 'Database', graphql_endpoint: 'GraphQL Endpoint', bearer_token: 'Bearer Token', email: 'Email', sync_hours: 'Sync Interval (hours)', user: 'Username', pass: 'Password', + location_id: 'Default Location', } export function AdminSettings({ user }: { user: User }) { @@ -96,6 +97,8 @@ function IntegrationCard({ integration, onSaved }: { integration: Integration; o const [testing, setTesting] = useState(false) const [testResult, setTestResult] = useState<{ ok: boolean; error?: string } | null>(null) const [enabled, setEnabled] = useState(integration.enabled) + const [wfLocations, setWfLocations] = useState<{ id: string; name: string; short_name: string | null }[]>([]) + const [fetchingLocs, setFetchingLocs] = useState(false) function openForm() { const initial: Record = {} @@ -175,15 +178,59 @@ function IntegrationCard({ integration, onSaved }: { integration: Integration; o
{/* Config fields (plaintext) */} - {Object.entries(integration.config).map(([k]) => ( - - ))} + {Object.entries(integration.config).map(([k]) => { + if (integration.slug === 'workforce' && k === 'location_id') { + return ( +
+ + Default Location + +
+ + +
+
+ ) + } + return ( + + ) + })} {/* Secret fields (encrypted) */} {Object.entries(integration.secrets).map(([k, v]) => (