@burdenoff/microfe-integrations 2026.830.1 → 2026.830.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations/IntegrationsAdminRoot.d.ts.map +1 -1
- package/dist/integrations/IntegrationsAdminRoot.js +35 -26
- package/dist/integrations/IntegrationsAdminRoot.js.map +1 -1
- package/dist/integrations/IntegrationsRoot.d.ts.map +1 -1
- package/dist/integrations/IntegrationsRoot.js +47 -38
- package/dist/integrations/IntegrationsRoot.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +151 -152
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodSelector.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodSelector.js +48 -40
- package/dist/integrations/components/AuthMethodSelector.js.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.js +207 -190
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.d.ts.map +1 -1
- package/dist/integrations/components/ConnectionCard.js +102 -98
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/ConnectionStatusBadge.d.ts.map +1 -1
- package/dist/integrations/components/ConnectionStatusBadge.js +9 -5
- package/dist/integrations/components/ConnectionStatusBadge.js.map +1 -1
- package/dist/integrations/components/CredentialStorageSelector.d.ts.map +1 -1
- package/dist/integrations/components/CredentialStorageSelector.js +124 -121
- package/dist/integrations/components/CredentialStorageSelector.js.map +1 -1
- package/dist/integrations/components/ProviderCard.d.ts.map +1 -1
- package/dist/integrations/components/ProviderCard.js +25 -65
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/components/SchemaForm.d.ts.map +1 -1
- package/dist/integrations/components/SchemaForm.js +116 -111
- package/dist/integrations/components/SchemaForm.js.map +1 -1
- package/dist/integrations/hooks/useFormatDate.d.ts +7 -0
- package/dist/integrations/hooks/useFormatDate.d.ts.map +1 -0
- package/dist/integrations/hooks/useFormatDate.js +17 -0
- package/dist/integrations/hooks/useFormatDate.js.map +1 -0
- package/dist/integrations/hooks/useFormatLastUsed.d.ts +9 -0
- package/dist/integrations/hooks/useFormatLastUsed.d.ts.map +1 -0
- package/dist/integrations/hooks/useFormatLastUsed.js +15 -0
- package/dist/integrations/hooks/useFormatLastUsed.js.map +1 -0
- package/dist/integrations/hooks/useLabel.d.ts +13 -0
- package/dist/integrations/hooks/useLabel.d.ts.map +1 -0
- package/dist/integrations/hooks/useLabel.js +20 -0
- package/dist/integrations/hooks/useLabel.js.map +1 -0
- package/dist/integrations/hooks/useTr.d.ts +17 -0
- package/dist/integrations/hooks/useTr.d.ts.map +1 -0
- package/dist/integrations/hooks/useTr.js +14 -0
- package/dist/integrations/hooks/useTr.js.map +1 -0
- package/dist/integrations/pages/AddConnectionWizard.d.ts.map +1 -1
- package/dist/integrations/pages/AddConnectionWizard.js +396 -387
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +128 -128
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.js +210 -181
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +136 -115
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.d.ts.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +76 -77
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.d.ts.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.js +59 -61
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts.map +1 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.js +29 -28
- package/dist/integrations/pages/IntegrationsUserLandingPage.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +99 -141
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +208 -220
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +262 -261
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +745 -0
- package/dist/integrations/translations/en.d.ts.map +1 -0
- package/dist/integrations/utils/integrationsHelpers.js +2 -16
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsOverview.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { formatLastUsed, getStatusDotColor } from '../utils/integrationsHelpers';\nimport type { IntegrationConnection, IntegrationProvider } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection, mapProvider } from '../utils/mappers';\nimport {\n Button,\n GlassCard,\n EmphasisPanel,\n AuroraBackground,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n type NextStep,\n} from '@burdenoff/fe-libs/ui';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n getProviders(pagination: { limit: 100 }) {\n total\n items {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number; items?: Array<Record<string, unknown>> };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providers = (data?.getProviders?.items ?? []).map((item: Record<string, unknown>) =>\n mapProvider(item)\n );\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providers,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n glow = false,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n glow?: boolean;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className={cn(\n 'border-border-seam p-5',\n onClick &&\n 'cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-secondary\">{label}</p>\n <p className=\"text-3xl font-bold text-text-primary mt-1 tabular-nums\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n </GlassCard>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providers, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = (providers ?? []).length;\n const installedProviders = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed'\n ).length;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providers, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n const nextSteps: NextStep[] = [\n {\n id: 'browse-providers',\n label: tx('integrations.overview.nextSteps.browse.label', 'Browse the provider catalog'),\n description: tx(\n 'integrations.overview.nextSteps.browse.description',\n 'See which services you can connect to — Slack, Google Drive, GitHub and more.'\n ),\n icon: <Store size={16} />,\n onClick: () => handleNavigate('providers'),\n done: stats.installedProviders > 0,\n },\n ...(canCreateConnection\n ? [\n {\n id: 'add-connection',\n label: tx('integrations.overview.nextSteps.connect.label', 'Add your first connection'),\n description: tx(\n 'integrations.overview.nextSteps.connect.description',\n 'Authenticate a provider so your workspace can start exchanging data with it.'\n ),\n icon: <Plus size={16} />,\n onClick: () => openAddConnectionDialog(),\n done: (connections ?? []).length > 0,\n } satisfies NextStep,\n ]\n : []),\n {\n id: 'review-activity',\n label: tx('integrations.overview.nextSteps.logs.label', 'Review activity logs'),\n description: tx(\n 'integrations.overview.nextSteps.logs.description',\n 'Track requests and troubleshoot any connection that reports an error.'\n ),\n icon: <Clock size={16} />,\n onClick: () => handleNavigate('logs'),\n done: stats.errorConnections === 0 && stats.activeConnections > 0,\n },\n ];\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-overview-header\"\n >\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n <GradientText>{tx('integrations.overview.title', 'Integrations')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => {\n void refetch();\n }}\n aria-label={tx('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-text-secondary\" />\n </Button>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Plug size={16} />}>\n {tx(\n 'integrations.overview.purpose',\n 'Integrations let your workspace talk to outside tools — sending messages to Slack, syncing files with Google Drive, opening issues in GitHub, and more. Install a provider, add a connection by authenticating once, and the rest of the platform can reuse it. This dashboard summarizes what is connected and what needs attention.'\n )}\n </PagePurpose>\n\n {/* Next steps — onboarding guidance for new users */}\n <NextSteps storageKey=\"integrations-overview\" steps={nextSteps} />\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tx('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tx('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-8 w-12 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n <div className=\"size-12 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tx('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tx('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n glow\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-action-primary-bg/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <EmphasisPanel className=\"overflow-hidden p-0\" data-tour=\"integrations-recent-connections\">\n <div className=\"flex items-center justify-between p-5 border-b border-border-seam\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tx('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tx('integrations.overview.empty.title', 'No connections yet')}\n description={\n canCreateConnection\n ? tx(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tx(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )\n }\n action={\n canCreateConnection ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tx('integrations.overview.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border-seam\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{conn.name}</p>\n <p className=\"text-xs text-text-secondary truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span\n className={cn(\n 'size-2 rounded-full',\n getStatusDotColor(conn.status),\n conn.status === 'active' && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n <span className=\"text-xs text-text-secondary\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </EmphasisPanel>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAwCA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E1B,SAAS,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA4B,GAAgB;EACpF,aAAa;EACb,aAAa;EACb,iBAAiB;EAClB,CAAC;AASF,QAAO;EACL,YARiB,GAAM,cAAc,SAAS,EAAE,EAAE,KAAK,MACvD,EAAY,EAAK,CAClB;EAOC,cANmB,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAAK,MAC3D,EAAc,EAAK,CACpB;EAKC;EACA;EACA;EACD;;AAMH,SAAS,EAAS,EAChB,UACA,UACA,SACA,UAAO,WACP,YACA,UAAO,MAQN;CACD,IAAM,IAAS,EAAiB,EAAK;AAErC,QACE,kBAAC,GAAD;EACE,WAAU;EACJ;EACN,WAAW,EACT,0BACA,KACE,8GACH;EACQ;EACT,MAAM,IAAU,WAAW,KAAA;EAC3B,UAAU,IAAU,IAAI,KAAA;EACxB,WACE,KACK,MAAM;AACL,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,GAAS;MAG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,OAAO,EAAG,qCAAqC,qBAAqB;MACpE,aACE,IACI,EACE,oDACA,4EACD,GACD,EACE,mDACA,2CACD;MAEP,QACE,IACE,kBAAC,GAAD;OAAQ,eAAe,GAAyB;iBAAhD,CACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA,EACjB,EAAG,+CAA+C,iBAAiB,CAC7D;WACP,KAAA;MAEN,CAAA;KAGH,CAAC,KAAW,EAAkB,SAAS,KACtC,kBAAC,OAAD;MAAK,WAAU;gBACZ,EAAkB,KAAK,MACtB,kBAAC,OAAD;OAEE,WAAU;OACV,eAAe,EAAe,eAAe,EAAK,KAAK;OACvD,MAAK;OACL,UAAU;OACV,YAAY,MAAM;AAChB,SAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,EAAe,eAAe,EAAK,KAAK;;iBAT9C;QAaE,kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,GAAD;UAAM,MAAM;UAAI,WAAU;UAAiB,CAAA;SACvC,CAAA;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,KAAD;UAAG,WAAU;oBAAkD,EAAK;UAAS,CAAA,EAC7E,kBAAC,KAAD;UAAG,WAAU;oBAAwC,EAAK,SAAS;UAAS,CAAA,CACxE;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD,EACE,WAAW,EACT,uBACA,EAAkB,EAAK,OAAO,EAC9B,EAAK,WAAW,YAAY,oCAC7B,EACD,CAAA,EACF,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAe,EAAK,WAAW;UAC3B,CAAA,CACH;;QACF;SA/BC,EAAK,GA+BN,CACN;MACE,CAAA;KAEM;;GAGhB,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACpB,QAAS;;IAEhB,CAAA;GACE"}
|
|
1
|
+
{"version":3,"file":"IntegrationsOverview.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { getStatusDotColor } from '../utils/integrationsHelpers';\nimport { useFormatLastUsed } from '../hooks/useFormatLastUsed';\nimport type { IntegrationConnection, IntegrationProvider } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection, mapProvider } from '../utils/mappers';\nimport {\n Button,\n GlassCard,\n EmphasisPanel,\n AuroraBackground,\n GradientText,\n IllustratedEmptyState,\n PagePurpose,\n NextSteps,\n type NextStep,\n} from '@burdenoff/fe-libs/ui';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n getProviders(pagination: { limit: 100 }) {\n total\n items {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number; items?: Array<Record<string, unknown>> };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providers = (data?.getProviders?.items ?? []).map((item: Record<string, unknown>) =>\n mapProvider(item)\n );\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providers,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n glow = false,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n glow?: boolean;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <GlassCard\n treatment=\"metric\"\n glow={glow}\n className={cn(\n 'border-border-seam p-5',\n onClick &&\n 'cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-secondary\">{label}</p>\n <p className=\"text-3xl font-bold text-text-primary mt-1 tabular-nums\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n </GlassCard>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const tr = useTr();\n const formatLastUsed = useFormatLastUsed();\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providers, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = (providers ?? []).length;\n const installedProviders = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed'\n ).length;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providers, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n const nextSteps: NextStep[] = [\n {\n id: 'browse-providers',\n label: tr('integrations.overview.nextSteps.browse.label', 'Browse the provider catalog'),\n description: tr(\n 'integrations.overview.nextSteps.browse.description',\n 'See which services you can connect to — Slack, Google Drive, GitHub and more.'\n ),\n icon: <Store size={16} />,\n onClick: () => handleNavigate('providers'),\n done: stats.installedProviders > 0,\n },\n ...(canCreateConnection\n ? [\n {\n id: 'add-connection',\n label: tr('integrations.overview.nextSteps.connect.label', 'Add your first connection'),\n description: tr(\n 'integrations.overview.nextSteps.connect.description',\n 'Authenticate a provider so your workspace can start exchanging data with it.'\n ),\n icon: <Plus size={16} />,\n onClick: () => openAddConnectionDialog(),\n done: (connections ?? []).length > 0,\n } satisfies NextStep,\n ]\n : []),\n {\n id: 'review-activity',\n label: tr('integrations.overview.nextSteps.logs.label', 'Review activity logs'),\n description: tr(\n 'integrations.overview.nextSteps.logs.description',\n 'Track requests and troubleshoot any connection that reports an error.'\n ),\n icon: <Clock size={16} />,\n onClick: () => handleNavigate('logs'),\n done: stats.errorConnections === 0 && stats.activeConnections > 0,\n },\n ];\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-overview-header\"\n >\n <AuroraBackground intensity=\"subtle\" />\n <div className=\"flex items-center justify-between gap-3\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n <GradientText>{tr('integrations.overview.title', 'Integrations')}</GradientText>\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => {\n void refetch();\n }}\n aria-label={tr('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-text-secondary\" />\n </Button>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Plug size={16} />}>\n {tr(\n 'integrations.overview.purpose',\n 'Integrations let your workspace talk to outside tools — sending messages to Slack, syncing files with Google Drive, opening issues in GitHub, and more. Install a provider, add a connection by authenticating once, and the rest of the platform can reuse it. This dashboard summarizes what is connected and what needs attention.'\n )}\n </PagePurpose>\n\n {/* Next steps — onboarding guidance for new users */}\n <NextSteps storageKey=\"integrations-overview\" steps={nextSteps} />\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tr('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-8 w-12 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n <div className=\"size-12 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tr('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tr('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n glow\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tr('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tr('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-action-primary-bg/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-seam bg-bg-surface',\n 'hover:border-border-strong hover:shadow-[var(--shadow-pop)]',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'text-left transition-[box-shadow,border-color] duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <EmphasisPanel className=\"overflow-hidden p-0\" data-tour=\"integrations-recent-connections\">\n <div className=\"flex items-center justify-between p-5 border-b border-border-seam\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tr('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tr('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('integrations.overview.empty.title', 'No connections yet')}\n description={\n canCreateConnection\n ? tr(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tr(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )\n }\n action={\n canCreateConnection ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tr('integrations.overview.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border-seam\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{conn.name}</p>\n <p className=\"text-xs text-text-secondary truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span\n className={cn(\n 'size-2 rounded-full',\n getStatusDotColor(conn.status),\n conn.status === 'active' && 'motion-safe:animate-vc-glow-pulse'\n )}\n />\n <span className=\"text-xs text-text-secondary\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </EmphasisPanel>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA0CA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E1B,SAAS,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA4B,GAAgB;EACpF,aAAa;EACb,aAAa;EACb,iBAAiB;EAClB,CAAC;AASF,QAAO;EACL,YARiB,GAAM,cAAc,SAAS,EAAE,EAAE,KAAK,MACvD,EAAY,EAAK,CAClB;EAOC,cANmB,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAAK,MAC3D,EAAc,EAAK,CACpB;EAKC;EACA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;GACE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsSettings.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/IntegrationsSettings.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntegrationsSettings.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/IntegrationsSettings.tsx"],"names":[],"mappings":"AAqBA;;GAEG;AACH,wBAAgB,oBAAoB,gCA6QnC"}
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { cn as n } from "../utils/cn.js";
|
|
4
|
+
import { INTEGRATION_PERMISSIONS as r } from "../constants/permissions.js";
|
|
5
|
+
import { nativeCopyText as i, nativeImpact as a } from "../../utils/nativeBridge.js";
|
|
6
|
+
import { useState as o } from "react";
|
|
7
|
+
import { ArrowLeft as s, Check as c, CheckCircle2 as l, Clock as u, Copy as d, Globe as f, Loader2 as p, Save as m, Settings as h, Shield as g } from "lucide-react";
|
|
8
|
+
import { usePermissions as _ } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
8
9
|
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
9
10
|
import { Button as b, EmphasisPanel as x, GlassCard as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
|
|
10
11
|
//#region src/integrations/pages/IntegrationsSettings.tsx
|
|
11
12
|
function w() {
|
|
12
|
-
let { basePath: w = "/", navigate: T, apiGatewayUrl: E } = e(), {
|
|
13
|
-
|
|
14
|
-
return r === e ? n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)).replace(`{${t}}`, String(n)), t) : t : r;
|
|
15
|
-
}, { hasPermission: k, isLoading: A } = _(), j = k(n.INTEGRATION_WRITE), [M, N] = a(30), [P, F] = a(60), [I, L] = a(!0), [R, z] = a(!1), [B, V] = a(!1), [H, U] = a(!1), W = E ? `${E}/integrations/oauth/callback` : `${typeof window < "u" ? window.location.origin : ""}/integrations/oauth/callback`;
|
|
16
|
-
return A ? /* @__PURE__ */ v("div", {
|
|
13
|
+
let { basePath: w = "/", navigate: T, apiGatewayUrl: E } = e(), D = t(), { hasPermission: O, isLoading: k } = _(), A = O(r.INTEGRATION_WRITE), [j, M] = o(30), [N, P] = o(60), [F, I] = o(!0), [L, R] = o(!1), [z, B] = o(!1), [V, H] = o(!1), U = E ? `${E}/integrations/oauth/callback` : `${typeof window < "u" ? window.location.origin : ""}/integrations/oauth/callback`;
|
|
14
|
+
return k ? /* @__PURE__ */ v("div", {
|
|
17
15
|
className: "flex items-center justify-center py-20",
|
|
18
|
-
children: /* @__PURE__ */ v(
|
|
16
|
+
children: /* @__PURE__ */ v(p, {
|
|
19
17
|
size: 48,
|
|
20
18
|
className: "animate-spin text-primary"
|
|
21
19
|
})
|
|
22
|
-
}) :
|
|
20
|
+
}) : A ? /* @__PURE__ */ y("div", {
|
|
23
21
|
className: "space-y-6 p-6 max-w-4xl mx-auto",
|
|
24
22
|
children: [
|
|
25
23
|
/* @__PURE__ */ v("div", {
|
|
@@ -31,70 +29,70 @@ function w() {
|
|
|
31
29
|
variant: "ghost",
|
|
32
30
|
size: "icon",
|
|
33
31
|
onClick: () => T?.(w),
|
|
34
|
-
"aria-label":
|
|
35
|
-
children: /* @__PURE__ */ v(
|
|
32
|
+
"aria-label": D("integrations.settings.actions.backAriaLabel", "Back"),
|
|
33
|
+
children: /* @__PURE__ */ v(s, { size: 20 })
|
|
36
34
|
}),
|
|
37
35
|
/* @__PURE__ */ v("div", {
|
|
38
36
|
className: "p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
39
|
-
children: /* @__PURE__ */ v(
|
|
37
|
+
children: /* @__PURE__ */ v(h, {
|
|
40
38
|
size: 24,
|
|
41
39
|
className: "text-primary"
|
|
42
40
|
})
|
|
43
41
|
}),
|
|
44
42
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("h1", {
|
|
45
43
|
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
46
|
-
children:
|
|
44
|
+
children: D("integrations.settings.title", "Integrations Settings")
|
|
47
45
|
}), /* @__PURE__ */ v("p", {
|
|
48
46
|
className: "text-sm text-text-secondary mt-0.5",
|
|
49
|
-
children:
|
|
47
|
+
children: D("integrations.settings.subtitle", "Configure integration module behavior")
|
|
50
48
|
})] })
|
|
51
49
|
]
|
|
52
50
|
})
|
|
53
51
|
}),
|
|
54
52
|
/* @__PURE__ */ v(C, {
|
|
55
|
-
icon: /* @__PURE__ */ v(
|
|
56
|
-
children:
|
|
53
|
+
icon: /* @__PURE__ */ v(h, { size: 16 }),
|
|
54
|
+
children: D("integrations.settings.purpose", "These workspace-wide settings govern how every integration behaves. Copy the OAuth redirect URI to paste into a provider’s app configuration, set how long connection requests may take, control how often health checks run, and decide whether OAuth tokens refresh automatically before they expire.")
|
|
57
55
|
}),
|
|
58
56
|
/* @__PURE__ */ y(x, {
|
|
59
57
|
className: "space-y-4",
|
|
60
58
|
children: [/* @__PURE__ */ y("h2", {
|
|
61
59
|
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
62
|
-
children: [/* @__PURE__ */ v(
|
|
60
|
+
children: [/* @__PURE__ */ v(f, {
|
|
63
61
|
size: 18,
|
|
64
62
|
className: "text-primary"
|
|
65
|
-
}),
|
|
63
|
+
}), D("integrations.settings.oauth.title", "OAuth Configuration")]
|
|
66
64
|
}), /* @__PURE__ */ y("div", {
|
|
67
65
|
className: "space-y-2",
|
|
68
66
|
children: [
|
|
69
67
|
/* @__PURE__ */ v("label", {
|
|
70
68
|
className: "block text-sm font-medium text-text-primary",
|
|
71
|
-
children:
|
|
69
|
+
children: D("integrations.settings.oauth.redirectUriLabel", "Default OAuth Redirect URI")
|
|
72
70
|
}),
|
|
73
71
|
/* @__PURE__ */ v("p", {
|
|
74
72
|
className: "text-xs text-text-secondary mb-2",
|
|
75
|
-
children:
|
|
73
|
+
children: D("integrations.settings.oauth.redirectUriDescription", "Use this URL as the redirect/callback URI when configuring OAuth applications with providers.")
|
|
76
74
|
}),
|
|
77
75
|
/* @__PURE__ */ y("div", {
|
|
78
76
|
className: "flex items-center gap-2",
|
|
79
77
|
children: [/* @__PURE__ */ v("div", {
|
|
80
78
|
className: "flex-1 px-4 py-2.5 border border-border-seam rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all",
|
|
81
|
-
children:
|
|
79
|
+
children: U
|
|
82
80
|
}), /* @__PURE__ */ v(b, {
|
|
83
81
|
variant: "outline",
|
|
84
82
|
size: "icon",
|
|
85
83
|
onClick: async () => {
|
|
86
|
-
if (
|
|
84
|
+
if (a("light"), !await i(U)) {
|
|
87
85
|
let e = document.createElement("input");
|
|
88
|
-
e.value =
|
|
86
|
+
e.value = U, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
89
87
|
}
|
|
90
|
-
|
|
88
|
+
H(!0), setTimeout(() => H(!1), 2e3);
|
|
91
89
|
},
|
|
92
90
|
className: "flex-shrink-0",
|
|
93
|
-
"aria-label":
|
|
94
|
-
children:
|
|
91
|
+
"aria-label": D("integrations.settings.oauth.copyAriaLabel", "Copy redirect URI"),
|
|
92
|
+
children: V ? /* @__PURE__ */ v(c, {
|
|
95
93
|
size: 16,
|
|
96
94
|
className: "text-status-success-text"
|
|
97
|
-
}) : /* @__PURE__ */ v(
|
|
95
|
+
}) : /* @__PURE__ */ v(d, { size: 16 })
|
|
98
96
|
})]
|
|
99
97
|
})
|
|
100
98
|
]
|
|
@@ -104,50 +102,50 @@ function w() {
|
|
|
104
102
|
className: "border-border-seam p-5 space-y-4",
|
|
105
103
|
children: [/* @__PURE__ */ y("h2", {
|
|
106
104
|
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
107
|
-
children: [/* @__PURE__ */ v(
|
|
105
|
+
children: [/* @__PURE__ */ v(u, {
|
|
108
106
|
size: 18,
|
|
109
107
|
className: "text-primary"
|
|
110
|
-
}),
|
|
108
|
+
}), D("integrations.settings.connection.title", "Connection Settings")]
|
|
111
109
|
}), /* @__PURE__ */ y("div", {
|
|
112
110
|
className: "space-y-4",
|
|
113
111
|
children: [/* @__PURE__ */ y("div", { children: [
|
|
114
112
|
/* @__PURE__ */ v("label", {
|
|
115
113
|
htmlFor: "conn-timeout",
|
|
116
114
|
className: "block text-sm font-semibold mb-2",
|
|
117
|
-
children:
|
|
115
|
+
children: D("integrations.settings.connection.timeoutLabel", "Connection Timeout (seconds)")
|
|
118
116
|
}),
|
|
119
117
|
/* @__PURE__ */ v("p", {
|
|
120
118
|
className: "text-xs text-text-secondary mb-2",
|
|
121
|
-
children:
|
|
119
|
+
children: D("integrations.settings.connection.timeoutDescription", "Maximum time to wait when testing or using a connection.")
|
|
122
120
|
}),
|
|
123
121
|
/* @__PURE__ */ v("input", {
|
|
124
122
|
type: "number",
|
|
125
123
|
id: "conn-timeout",
|
|
126
|
-
value:
|
|
127
|
-
onChange: (e) =>
|
|
124
|
+
value: j,
|
|
125
|
+
onChange: (e) => M(Number(e.target.value)),
|
|
128
126
|
min: 5,
|
|
129
127
|
max: 120,
|
|
130
|
-
"aria-label":
|
|
128
|
+
"aria-label": D("integrations.settings.connection.timeoutLabel", "Connection Timeout (seconds)"),
|
|
131
129
|
className: "w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
132
130
|
})
|
|
133
131
|
] }), /* @__PURE__ */ y("div", { children: [
|
|
134
132
|
/* @__PURE__ */ v("label", {
|
|
135
133
|
htmlFor: "health-interval",
|
|
136
134
|
className: "block text-sm font-semibold mb-2",
|
|
137
|
-
children:
|
|
135
|
+
children: D("integrations.settings.connection.healthCheckLabel", "Health Check Interval (minutes)")
|
|
138
136
|
}),
|
|
139
137
|
/* @__PURE__ */ v("p", {
|
|
140
138
|
className: "text-xs text-text-secondary mb-2",
|
|
141
|
-
children:
|
|
139
|
+
children: D("integrations.settings.connection.healthCheckDescription", "How often to automatically check connection health.")
|
|
142
140
|
}),
|
|
143
141
|
/* @__PURE__ */ v("input", {
|
|
144
142
|
type: "number",
|
|
145
143
|
id: "health-interval",
|
|
146
|
-
value:
|
|
147
|
-
onChange: (e) =>
|
|
144
|
+
value: N,
|
|
145
|
+
onChange: (e) => P(Number(e.target.value)),
|
|
148
146
|
min: 5,
|
|
149
147
|
max: 1440,
|
|
150
|
-
"aria-label":
|
|
148
|
+
"aria-label": D("integrations.settings.connection.healthCheckLabel", "Health Check Interval (minutes)"),
|
|
151
149
|
className: "w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
|
|
152
150
|
})
|
|
153
151
|
] })]
|
|
@@ -157,10 +155,10 @@ function w() {
|
|
|
157
155
|
className: "border-border-seam p-5 space-y-4",
|
|
158
156
|
children: [/* @__PURE__ */ y("h2", {
|
|
159
157
|
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
160
|
-
children: [/* @__PURE__ */ v(
|
|
158
|
+
children: [/* @__PURE__ */ v(g, {
|
|
161
159
|
size: 18,
|
|
162
160
|
className: "text-primary"
|
|
163
|
-
}),
|
|
161
|
+
}), D("integrations.settings.security.title", "Security")]
|
|
164
162
|
}), /* @__PURE__ */ v("div", {
|
|
165
163
|
className: "space-y-4",
|
|
166
164
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -168,19 +166,19 @@ function w() {
|
|
|
168
166
|
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
169
167
|
htmlFor: "auto-refresh",
|
|
170
168
|
className: "text-sm font-semibold text-text-primary",
|
|
171
|
-
children:
|
|
169
|
+
children: D("integrations.settings.security.autoRefreshLabel", "Auto-refresh OAuth Tokens")
|
|
172
170
|
}), /* @__PURE__ */ v("p", {
|
|
173
171
|
className: "text-xs text-text-secondary mt-0.5",
|
|
174
|
-
children:
|
|
172
|
+
children: D("integrations.settings.security.autoRefreshDescription", "Automatically refresh tokens before they expire.")
|
|
175
173
|
})] }), /* @__PURE__ */ v("button", {
|
|
176
174
|
type: "button",
|
|
177
175
|
id: "auto-refresh",
|
|
178
176
|
role: "switch",
|
|
179
|
-
"aria-checked":
|
|
180
|
-
"aria-label":
|
|
181
|
-
onClick: () =>
|
|
182
|
-
className:
|
|
183
|
-
children: /* @__PURE__ */ v("span", { className:
|
|
177
|
+
"aria-checked": F,
|
|
178
|
+
"aria-label": D("integrations.settings.security.autoRefreshLabel", "Auto-refresh OAuth Tokens"),
|
|
179
|
+
onClick: () => I(!F),
|
|
180
|
+
className: n("relative w-11 h-6 rounded-full transition-colors flex-shrink-0", F ? "bg-action-primary-bg" : "bg-bg-sunken"),
|
|
181
|
+
children: /* @__PURE__ */ v("span", { className: n("absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform", F && "translate-x-5") })
|
|
184
182
|
})]
|
|
185
183
|
})
|
|
186
184
|
})]
|
|
@@ -190,38 +188,38 @@ function w() {
|
|
|
190
188
|
children: /* @__PURE__ */ y(b, {
|
|
191
189
|
size: "lg",
|
|
192
190
|
onClick: async () => {
|
|
193
|
-
|
|
191
|
+
R(!0), await new Promise((e) => setTimeout(e, 1e3)), R(!1), B(!0), setTimeout(() => B(!1), 3e3);
|
|
194
192
|
},
|
|
195
|
-
disabled:
|
|
196
|
-
children: [
|
|
193
|
+
disabled: L,
|
|
194
|
+
children: [L ? /* @__PURE__ */ v(p, {
|
|
197
195
|
size: 16,
|
|
198
196
|
className: "animate-spin"
|
|
199
|
-
}) : v(
|
|
197
|
+
}) : v(z ? l : m, { size: 16 }), L ? D("integrations.settings.actions.saving", "Saving...") : z ? D("integrations.settings.actions.saved", "Saved!") : D("integrations.settings.actions.save", "Save Settings")]
|
|
200
198
|
})
|
|
201
199
|
})
|
|
202
200
|
]
|
|
203
201
|
}) : /* @__PURE__ */ y("div", {
|
|
204
202
|
className: "flex flex-col items-center justify-center py-20 text-center p-6",
|
|
205
203
|
children: [
|
|
206
|
-
/* @__PURE__ */ v(
|
|
204
|
+
/* @__PURE__ */ v(g, {
|
|
207
205
|
size: 48,
|
|
208
206
|
className: "text-text-secondary mb-4"
|
|
209
207
|
}),
|
|
210
208
|
/* @__PURE__ */ v("h2", {
|
|
211
209
|
className: "text-xl font-bold text-text-primary mb-2",
|
|
212
|
-
children:
|
|
210
|
+
children: D("integrations.settings.accessDenied.title", "Access Denied")
|
|
213
211
|
}),
|
|
214
212
|
/* @__PURE__ */ v("p", {
|
|
215
213
|
className: "text-sm text-text-secondary mb-6 max-w-sm",
|
|
216
|
-
children:
|
|
214
|
+
children: D("integrations.settings.accessDenied.description", "You don't have permission to manage integration settings.")
|
|
217
215
|
}),
|
|
218
216
|
/* @__PURE__ */ y(b, {
|
|
219
217
|
variant: "outline",
|
|
220
218
|
onClick: () => T?.(w),
|
|
221
219
|
children: [
|
|
222
|
-
/* @__PURE__ */ v(
|
|
220
|
+
/* @__PURE__ */ v(s, { size: 16 }),
|
|
223
221
|
" ",
|
|
224
|
-
|
|
222
|
+
D("integrations.settings.accessDenied.back", "Back to Overview")
|
|
225
223
|
]
|
|
226
224
|
})
|
|
227
225
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsSettings.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Settings,\n ArrowLeft,\n Globe,\n Clock,\n Shield,\n Save,\n Loader2,\n CheckCircle2,\n Copy,\n Check,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { Button, GlassCard, EmphasisPanel, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { nativeCopyText, nativeImpact } from '../../utils/nativeBridge';\n\n/**\n * Integrations Settings — module configuration page.\n */\nexport function IntegrationsSettings() {\n const { basePath = '/', navigate, apiGatewayUrl } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canWrite = hasPermission(INTEGRATION_PERMISSIONS.INTEGRATION_WRITE);\n\n const [connectionTimeout, setConnectionTimeout] = useState(30);\n const [healthCheckInterval, setHealthCheckInterval] = useState(60);\n const [autoRefreshTokens, setAutoRefreshTokens] = useState(true);\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [copiedRedirectUri, setCopiedRedirectUri] = useState(false);\n\n // Compute the default OAuth redirect URI based on the gateway URL\n const oauthRedirectUri = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : `${typeof window !== 'undefined' ? window.location.origin : ''}/integrations/oauth/callback`;\n\n const handleSave = async () => {\n setSaving(true);\n // Simulated save — in production this would call a GraphQL mutation\n await new Promise((resolve) => setTimeout(resolve, 1000));\n setSaving(false);\n setSaved(true);\n setTimeout(() => setSaved(false), 3000);\n };\n\n const handleCopyRedirectUri = async () => {\n void nativeImpact('light');\n const ok = await nativeCopyText(oauthRedirectUri);\n if (!ok) {\n // Last-resort fallback for very old browsers without clipboard or execCommand support\n const input = document.createElement('input');\n input.value = oauthRedirectUri;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n setCopiedRedirectUri(true);\n setTimeout(() => setCopiedRedirectUri(false), 2000);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canWrite) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <Shield size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">\n {tx('integrations.settings.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n {tx(\n 'integrations.settings.accessDenied.description',\n \"You don't have permission to manage integration settings.\"\n )}\n </p>\n <Button variant=\"outline\" onClick={() => navigate?.(basePath)}>\n <ArrowLeft size={16} />{' '}\n {tx('integrations.settings.accessDenied.back', 'Back to Overview')}\n </Button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl mx-auto\">\n {/* Header */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(basePath)}\n aria-label={tx('integrations.settings.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Settings size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tx('integrations.settings.title', 'Integrations Settings')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx('integrations.settings.subtitle', 'Configure integration module behavior')}\n </p>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Settings size={16} />}>\n {tx(\n 'integrations.settings.purpose',\n 'These workspace-wide settings govern how every integration behaves. Copy the OAuth redirect URI to paste into a provider’s app configuration, set how long connection requests may take, control how often health checks run, and decide whether OAuth tokens refresh automatically before they expire.'\n )}\n </PagePurpose>\n\n {/* OAuth Redirect URI */}\n <EmphasisPanel className=\"space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Globe size={18} className=\"text-primary\" />\n {tx('integrations.settings.oauth.title', 'OAuth Configuration')}\n </h2>\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-text-primary\">\n {tx('integrations.settings.oauth.redirectUriLabel', 'Default OAuth Redirect URI')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.oauth.redirectUriDescription',\n 'Use this URL as the redirect/callback URI when configuring OAuth applications with providers.'\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-4 py-2.5 border border-border-seam rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all\">\n {oauthRedirectUri}\n </div>\n <Button\n variant=\"outline\"\n size=\"icon\"\n onClick={handleCopyRedirectUri}\n className=\"flex-shrink-0\"\n aria-label={tx('integrations.settings.oauth.copyAriaLabel', 'Copy redirect URI')}\n >\n {copiedRedirectUri ? (\n <Check size={16} className=\"text-status-success-text\" />\n ) : (\n <Copy size={16} />\n )}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n {/* Connection Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Clock size={18} className=\"text-primary\" />\n {tx('integrations.settings.connection.title', 'Connection Settings')}\n </h2>\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"conn-timeout\" className=\"block text-sm font-semibold mb-2\">\n {tx('integrations.settings.connection.timeoutLabel', 'Connection Timeout (seconds)')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.timeoutDescription',\n 'Maximum time to wait when testing or using a connection.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"conn-timeout\"\n value={connectionTimeout}\n onChange={(e) => setConnectionTimeout(Number(e.target.value))}\n min={5}\n max={120}\n aria-label={tx(\n 'integrations.settings.connection.timeoutLabel',\n 'Connection Timeout (seconds)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <div>\n <label htmlFor=\"health-interval\" className=\"block text-sm font-semibold mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tx(\n 'integrations.settings.connection.healthCheckDescription',\n 'How often to automatically check connection health.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"health-interval\"\n value={healthCheckInterval}\n onChange={(e) => setHealthCheckInterval(Number(e.target.value))}\n min={5}\n max={1440}\n aria-label={tx(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n </div>\n </GlassCard>\n\n {/* Security Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.settings.security.title', 'Security')}\n </h2>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <label htmlFor=\"auto-refresh\" className=\"text-sm font-semibold text-text-primary\">\n {tx('integrations.settings.security.autoRefreshLabel', 'Auto-refresh OAuth Tokens')}\n </label>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tx(\n 'integrations.settings.security.autoRefreshDescription',\n 'Automatically refresh tokens before they expire.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n id=\"auto-refresh\"\n role=\"switch\"\n aria-checked={autoRefreshTokens}\n aria-label={tx(\n 'integrations.settings.security.autoRefreshLabel',\n 'Auto-refresh OAuth Tokens'\n )}\n onClick={() => setAutoRefreshTokens(!autoRefreshTokens)}\n className={cn(\n 'relative w-11 h-6 rounded-full transition-colors flex-shrink-0',\n autoRefreshTokens ? 'bg-action-primary-bg' : 'bg-bg-sunken'\n )}\n >\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform',\n autoRefreshTokens && 'translate-x-5'\n )}\n />\n </button>\n </div>\n </div>\n </GlassCard>\n\n {/* Save Button */}\n <div className=\"flex items-center gap-3\">\n <Button size=\"lg\" onClick={handleSave} disabled={saving}>\n {saving ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : saved ? (\n <CheckCircle2 size={16} />\n ) : (\n <Save size={16} />\n )}\n {saving\n ? tx('integrations.settings.actions.saving', 'Saving...')\n : saved\n ? tx('integrations.settings.actions.saved', 'Saved!')\n : tx('integrations.settings.actions.save', 'Save Settings')}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAuBA,SAAgB,IAAuB;CACrC,IAAM,EAAE,cAAW,KAAK,aAAU,qBAAkB,GAAiB,EAC/D,EAAE,SAAM,GAAS,EACjB,KAAM,GAAa,GAAkB,MAA6C;EACtF,IAAM,IAAa,EAAE,GAAK,EAAO;AAIjC,SAHI,MAAe,IACd,IAEE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAO,CAAC,GAAU,OACjB,EACG,QAAQ,KAAK,EAAS,KAAK,OAAO,EAAW,CAAC,CAC9C,QAAQ,IAAI,EAAS,IAAI,OAAO,EAAW,CAAC,EACjD,EACD,GARmB,IADW;IAW3B,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAW,EAAc,EAAwB,kBAAkB,EAEnE,CAAC,GAAmB,KAAwB,EAAS,GAAG,EACxD,CAAC,GAAqB,KAA0B,EAAS,GAAG,EAC5D,CAAC,GAAmB,KAAwB,EAAS,GAAK,EAC1D,CAAC,GAAQ,KAAa,EAAS,GAAM,EACrC,CAAC,GAAO,KAAY,EAAS,GAAM,EACnC,CAAC,GAAmB,KAAwB,EAAS,GAAM,EAG3D,IAAmB,IACrB,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S,GAAM,EAAE,IAAK;;KAoOI,UAAU;eAAjD,CACG,IACC,kBAAC,GAAD;MAAS,MAAM;MAAI,WAAU;MAAiB,CAAA,GAE9C,EADE,IACD,IAEA,GAFD,EAAc,MAAM,IAAM,CAER,EAEnB,IACG,EAAG,wCAAwC,YAAY,GACvD,IACE,EAAG,uCAAuC,SAAS,GACnD,EAAG,sCAAsC,gBAAgB,CACxD;;IACL,CAAA;GACF;MAtNJ,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,GAAD;IAAQ,MAAM;IAAI,WAAU;IAA6B,CAAA;GACzD,kBAAC,MAAD;IAAI,WAAU;cACX,EAAG,4CAA4C,gBAAgB;IAC7D,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,kDACA,4DACD;IACC,CAAA;GACJ,kBAAC,GAAD;IAAQ,SAAQ;IAAU,eAAe,IAAW,EAAS;cAA7D;KACE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAAC;KACvB,EAAG,2CAA2C,mBAAmB;KAC3D;;GACL"}
|
|
1
|
+
{"version":3,"file":"IntegrationsSettings.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsSettings.tsx"],"sourcesContent":["import { useState } from 'react';\nimport {\n Settings,\n ArrowLeft,\n Globe,\n Clock,\n Shield,\n Save,\n Loader2,\n CheckCircle2,\n Copy,\n Check,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { Button, GlassCard, EmphasisPanel, PagePurpose } from '@burdenoff/fe-libs/ui';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { nativeCopyText, nativeImpact } from '../../utils/nativeBridge';\n\n/**\n * Integrations Settings — module configuration page.\n */\nexport function IntegrationsSettings() {\n const { basePath = '/', navigate, apiGatewayUrl } = useIntegrations();\n const tr = useTr();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canWrite = hasPermission(INTEGRATION_PERMISSIONS.INTEGRATION_WRITE);\n\n const [connectionTimeout, setConnectionTimeout] = useState(30);\n const [healthCheckInterval, setHealthCheckInterval] = useState(60);\n const [autoRefreshTokens, setAutoRefreshTokens] = useState(true);\n const [saving, setSaving] = useState(false);\n const [saved, setSaved] = useState(false);\n const [copiedRedirectUri, setCopiedRedirectUri] = useState(false);\n\n // Compute the default OAuth redirect URI based on the gateway URL\n const oauthRedirectUri = apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : `${typeof window !== 'undefined' ? window.location.origin : ''}/integrations/oauth/callback`;\n\n const handleSave = async () => {\n setSaving(true);\n // Simulated save — in production this would call a GraphQL mutation\n await new Promise((resolve) => setTimeout(resolve, 1000));\n setSaving(false);\n setSaved(true);\n setTimeout(() => setSaved(false), 3000);\n };\n\n const handleCopyRedirectUri = async () => {\n void nativeImpact('light');\n const ok = await nativeCopyText(oauthRedirectUri);\n if (!ok) {\n // Last-resort fallback for very old browsers without clipboard or execCommand support\n const input = document.createElement('input');\n input.value = oauthRedirectUri;\n document.body.appendChild(input);\n input.select();\n document.execCommand('copy');\n document.body.removeChild(input);\n }\n setCopiedRedirectUri(true);\n setTimeout(() => setCopiedRedirectUri(false), 2000);\n };\n\n if (permissionsLoading) {\n return (\n <div className=\"flex items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n </div>\n );\n }\n\n if (!canWrite) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <Shield size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">\n {tr('integrations.settings.accessDenied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n {tr(\n 'integrations.settings.accessDenied.description',\n \"You don't have permission to manage integration settings.\"\n )}\n </p>\n <Button variant=\"outline\" onClick={() => navigate?.(basePath)}>\n <ArrowLeft size={16} />{' '}\n {tr('integrations.settings.accessDenied.back', 'Back to Overview')}\n </Button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-4xl mx-auto\">\n {/* Header */}\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6\">\n <div className=\"flex items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n onClick={() => navigate?.(basePath)}\n aria-label={tr('integrations.settings.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Settings size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tr('integrations.settings.title', 'Integrations Settings')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr('integrations.settings.subtitle', 'Configure integration module behavior')}\n </p>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<Settings size={16} />}>\n {tr(\n 'integrations.settings.purpose',\n 'These workspace-wide settings govern how every integration behaves. Copy the OAuth redirect URI to paste into a provider’s app configuration, set how long connection requests may take, control how often health checks run, and decide whether OAuth tokens refresh automatically before they expire.'\n )}\n </PagePurpose>\n\n {/* OAuth Redirect URI */}\n <EmphasisPanel className=\"space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Globe size={18} className=\"text-primary\" />\n {tr('integrations.settings.oauth.title', 'OAuth Configuration')}\n </h2>\n <div className=\"space-y-2\">\n <label className=\"block text-sm font-medium text-text-primary\">\n {tr('integrations.settings.oauth.redirectUriLabel', 'Default OAuth Redirect URI')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tr(\n 'integrations.settings.oauth.redirectUriDescription',\n 'Use this URL as the redirect/callback URI when configuring OAuth applications with providers.'\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <div className=\"flex-1 px-4 py-2.5 border border-border-seam rounded-lg bg-bg-sunken/30 font-mono text-sm text-text-primary break-all\">\n {oauthRedirectUri}\n </div>\n <Button\n variant=\"outline\"\n size=\"icon\"\n onClick={handleCopyRedirectUri}\n className=\"flex-shrink-0\"\n aria-label={tr('integrations.settings.oauth.copyAriaLabel', 'Copy redirect URI')}\n >\n {copiedRedirectUri ? (\n <Check size={16} className=\"text-status-success-text\" />\n ) : (\n <Copy size={16} />\n )}\n </Button>\n </div>\n </div>\n </EmphasisPanel>\n\n {/* Connection Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Clock size={18} className=\"text-primary\" />\n {tr('integrations.settings.connection.title', 'Connection Settings')}\n </h2>\n <div className=\"space-y-4\">\n <div>\n <label htmlFor=\"conn-timeout\" className=\"block text-sm font-semibold mb-2\">\n {tr('integrations.settings.connection.timeoutLabel', 'Connection Timeout (seconds)')}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tr(\n 'integrations.settings.connection.timeoutDescription',\n 'Maximum time to wait when testing or using a connection.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"conn-timeout\"\n value={connectionTimeout}\n onChange={(e) => setConnectionTimeout(Number(e.target.value))}\n min={5}\n max={120}\n aria-label={tr(\n 'integrations.settings.connection.timeoutLabel',\n 'Connection Timeout (seconds)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n <div>\n <label htmlFor=\"health-interval\" className=\"block text-sm font-semibold mb-2\">\n {tr(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n </label>\n <p className=\"text-xs text-text-secondary mb-2\">\n {tr(\n 'integrations.settings.connection.healthCheckDescription',\n 'How often to automatically check connection health.'\n )}\n </p>\n <input\n type=\"number\"\n id=\"health-interval\"\n value={healthCheckInterval}\n onChange={(e) => setHealthCheckInterval(Number(e.target.value))}\n min={5}\n max={1440}\n aria-label={tr(\n 'integrations.settings.connection.healthCheckLabel',\n 'Health Check Interval (minutes)'\n )}\n className=\"w-full max-w-[200px] px-4 py-2.5 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary\"\n />\n </div>\n </div>\n </GlassCard>\n\n {/* Security Settings */}\n <GlassCard className=\"border-border-seam p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Shield size={18} className=\"text-primary\" />\n {tr('integrations.settings.security.title', 'Security')}\n </h2>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <div>\n <label htmlFor=\"auto-refresh\" className=\"text-sm font-semibold text-text-primary\">\n {tr('integrations.settings.security.autoRefreshLabel', 'Auto-refresh OAuth Tokens')}\n </label>\n <p className=\"text-xs text-text-secondary mt-0.5\">\n {tr(\n 'integrations.settings.security.autoRefreshDescription',\n 'Automatically refresh tokens before they expire.'\n )}\n </p>\n </div>\n <button\n type=\"button\"\n id=\"auto-refresh\"\n role=\"switch\"\n aria-checked={autoRefreshTokens}\n aria-label={tr(\n 'integrations.settings.security.autoRefreshLabel',\n 'Auto-refresh OAuth Tokens'\n )}\n onClick={() => setAutoRefreshTokens(!autoRefreshTokens)}\n className={cn(\n 'relative w-11 h-6 rounded-full transition-colors flex-shrink-0',\n autoRefreshTokens ? 'bg-action-primary-bg' : 'bg-bg-sunken'\n )}\n >\n <span\n className={cn(\n 'absolute top-0.5 left-0.5 size-5 bg-white rounded-full shadow transition-transform',\n autoRefreshTokens && 'translate-x-5'\n )}\n />\n </button>\n </div>\n </div>\n </GlassCard>\n\n {/* Save Button */}\n <div className=\"flex items-center gap-3\">\n <Button size=\"lg\" onClick={handleSave} disabled={saving}>\n {saving ? (\n <Loader2 size={16} className=\"animate-spin\" />\n ) : saved ? (\n <CheckCircle2 size={16} />\n ) : (\n <Save size={16} />\n )}\n {saving\n ? tr('integrations.settings.actions.saving', 'Saving...')\n : saved\n ? tr('integrations.settings.actions.saved', 'Saved!')\n : tr('integrations.settings.actions.save', 'Save Settings')}\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAwBA,SAAgB,IAAuB;CACrC,IAAM,EAAE,cAAW,KAAK,aAAU,qBAAkB,GAAiB,EAC/D,IAAK,GAAO,EACZ,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAW,EAAc,EAAwB,kBAAkB,EAEnE,CAAC,GAAmB,KAAwB,EAAS,GAAG,EACxD,CAAC,GAAqB,KAA0B,EAAS,GAAG,EAC5D,CAAC,GAAmB,KAAwB,EAAS,GAAK,EAC1D,CAAC,GAAQ,KAAa,EAAS,GAAM,EACrC,CAAC,GAAO,KAAY,EAAS,GAAM,EACnC,CAAC,GAAmB,KAAwB,EAAS,GAAM,EAG3D,IAAmB,IACrB,GAAG,EAAc,gCACjB,GAAG,OAAO,SAAW,MAAc,OAAO,SAAS,SAAS,GAAG;AAwDnE,QA7BI,IAEA,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD;GAAS,MAAM;GAAI,WAAU;GAA8B,CAAA;EACvD,CAAA,GAIL,IAsBH,kBAAC,OAAD;EAAK,WAAU;YAAf;GAEE,kBAAC,OAAD;IAAK,WAAU;cACb,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD;OACE,SAAQ;OACR,MAAK;OACL,eAAe,IAAW,EAAS;OACnC,cAAY,EAAG,+CAA+C,OAAO;iBAErE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;OAChB,CAAA;MACT,kBAAC,OAAD;OAAK,WAAU;iBACb,kBAAC,GAAD;QAAU,MAAM;QAAI,WAAU;QAAiB,CAAA;OAC3C,CAAA;MACN,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;OAAI,WAAU;iBACX,EAAG,+BAA+B,wBAAwB;OACxD,CAAA,EACL,kBAAC,KAAD;OAAG,WAAU;iBACV,EAA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|
-
{"version":3,"file":"IntegrationsUserLandingPage.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/IntegrationsUserLandingPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntegrationsUserLandingPage.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/IntegrationsUserLandingPage.tsx"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,gCA6C1C"}
|