@burdenoff/microfe-integrations 2026.1107.2 → 2026.1109.1
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/dev/main.d.ts +0 -2
- package/dist/generated/global-operations.d.ts +4 -2
- package/dist/generated/global-types.d.ts +2 -22
- package/dist/generated/wspace-operations.d.ts +995 -705
- package/dist/generated/wspace-operations.js +180 -167
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4 -24
- package/dist/generated/wspace-types.js +1 -2
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/integrations/ConnectSourceDialog.d.ts +0 -2
- package/dist/integrations/ConnectSourceDialog.js +13 -14
- package/dist/integrations/ConnectSourceDialog.js.map +1 -1
- package/dist/integrations/ConnectionsPanel.d.ts +0 -2
- package/dist/integrations/ConnectionsPanel.js +5 -6
- package/dist/integrations/ConnectionsPanel.js.map +1 -1
- package/dist/integrations/IntegrationsAdminRoot.d.ts +0 -2
- package/dist/integrations/IntegrationsAdminRoot.js +14 -11
- package/dist/integrations/IntegrationsAdminRoot.js.map +1 -1
- package/dist/integrations/IntegrationsAdminRoutes.d.ts +1 -2
- package/dist/integrations/IntegrationsAdminRoutes.js +1 -2
- package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
- package/dist/integrations/IntegrationsRoot.d.ts +0 -2
- package/dist/integrations/IntegrationsRoot.js +9 -6
- package/dist/integrations/IntegrationsRoot.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.d.ts +1 -2
- package/dist/integrations/IntegrationsUserRoutes.js +7 -8
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts +1 -3
- package/dist/integrations/components/AddConnectionDialog.js +12 -15
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts +0 -2
- package/dist/integrations/components/AuthMethodsEditor.js +1 -2
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -1
- package/dist/integrations/components/ConfirmDialog.d.ts +1 -3
- package/dist/integrations/components/ConfirmDialog.js +1 -2
- package/dist/integrations/components/ConfirmDialog.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.d.ts +0 -2
- package/dist/integrations/components/ConnectionCard.js +9 -10
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/ConnectionModalFrame.d.ts +0 -2
- package/dist/integrations/components/ConnectionModalFrame.js +2 -3
- package/dist/integrations/components/ConnectionModalFrame.js.map +1 -1
- package/dist/integrations/components/ConnectionSharing.d.ts +0 -2
- package/dist/integrations/components/ConnectionSharing.js +7 -8
- package/dist/integrations/components/ConnectionSharing.js.map +1 -1
- package/dist/integrations/components/ConnectionStatusBadge.d.ts +0 -2
- package/dist/integrations/components/ConnectionStatusBadge.js +1 -2
- package/dist/integrations/components/ConnectionStatusBadge.js.map +1 -1
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts +2 -4
- package/dist/integrations/components/ConnectorSubmissionCard.js +8 -9
- package/dist/integrations/components/ConnectorSubmissionCard.js.map +1 -1
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts +1 -2
- package/dist/integrations/components/ConnectorSubmissionPager.js +1 -2
- package/dist/integrations/components/ConnectorSubmissionPager.js.map +1 -1
- package/dist/integrations/components/MailMessageBody.d.ts +1 -3
- package/dist/integrations/components/MailMessageBody.js +4 -5
- package/dist/integrations/components/MailMessageBody.js.map +1 -1
- package/dist/integrations/components/ProviderCard.d.ts +0 -2
- package/dist/integrations/components/ProviderCard.js +8 -9
- package/dist/integrations/components/ProviderCard.js.map +1 -1
- package/dist/integrations/constants/featureFlags.d.ts +0 -1
- package/dist/integrations/constants/featureFlags.js +1 -2
- package/dist/integrations/constants/featureFlags.js.map +1 -1
- package/dist/integrations/constants/permissions.d.ts +0 -1
- package/dist/integrations/constants/permissions.js +1 -2
- package/dist/integrations/constants/permissions.js.map +1 -1
- package/dist/integrations/events/integrations-events.d.ts +0 -1
- package/dist/integrations/events/useIntegrationsEventBus.d.ts +0 -2
- package/dist/integrations/events/useIntegrationsEventBus.js +1 -2
- package/dist/integrations/events/useIntegrationsEventBus.js.map +1 -1
- package/dist/integrations/hooks/useConnections.d.ts +3 -14
- package/dist/integrations/hooks/useConnections.js +74 -75
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts +2 -10
- package/dist/integrations/hooks/useConnectorSubmissions.js +23 -24
- package/dist/integrations/hooks/useConnectorSubmissions.js.map +1 -1
- package/dist/integrations/hooks/useFormatDate.d.ts +0 -1
- package/dist/integrations/hooks/useFormatDate.js +1 -2
- package/dist/integrations/hooks/useFormatDate.js.map +1 -1
- package/dist/integrations/hooks/useFormatLastUsed.d.ts +0 -1
- package/dist/integrations/hooks/useFormatLastUsed.js +1 -2
- package/dist/integrations/hooks/useFormatLastUsed.js.map +1 -1
- package/dist/integrations/hooks/useLabel.d.ts +0 -2
- package/dist/integrations/hooks/useLabel.js +1 -2
- package/dist/integrations/hooks/useLabel.js.map +1 -1
- package/dist/integrations/hooks/useLogs.d.ts +1 -6
- package/dist/integrations/hooks/useLogs.js +6 -7
- package/dist/integrations/hooks/useLogs.js.map +1 -1
- package/dist/integrations/hooks/useMailbox.d.ts +19 -43
- package/dist/integrations/hooks/useMailbox.js +46 -47
- package/dist/integrations/hooks/useMailbox.js.map +1 -1
- package/dist/integrations/hooks/useProviders.d.ts +3 -14
- package/dist/integrations/hooks/useProviders.js +42 -43
- package/dist/integrations/hooks/useProviders.js.map +1 -1
- package/dist/integrations/hooks/useTr.d.ts +0 -1
- package/dist/integrations/hooks/useTr.js +1 -2
- package/dist/integrations/hooks/useTr.js.map +1 -1
- package/dist/integrations/index.d.ts +0 -1
- package/dist/integrations/index.js +9 -8
- package/dist/integrations/pages/AddConnectionWizard.d.ts +1 -2
- package/dist/integrations/pages/AddConnectionWizard.js +291 -306
- package/dist/integrations/pages/AddConnectionWizard.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.d.ts +1 -2
- package/dist/integrations/pages/ConnectionDetail.js +241 -246
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionLogs.d.ts +1 -2
- package/dist/integrations/pages/ConnectionLogs.js +154 -155
- package/dist/integrations/pages/ConnectionLogs.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.d.ts +1 -2
- package/dist/integrations/pages/ConnectionsList.js +40 -41
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts +1 -2
- package/dist/integrations/pages/ConnectorReviewQueuePage.js +9 -10
- package/dist/integrations/pages/ConnectorReviewQueuePage.js.map +1 -1
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts +1 -2
- package/dist/integrations/pages/ConnectorSubmissionsPage.js +138 -139
- package/dist/integrations/pages/ConnectorSubmissionsPage.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.d.ts +1 -2
- package/dist/integrations/pages/IntegrationsOverview.js +35 -36
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/dist/integrations/pages/IntegrationsSettings.d.ts +1 -2
- package/dist/integrations/pages/IntegrationsSettings.js +7 -8
- package/dist/integrations/pages/IntegrationsSettings.js.map +1 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts +1 -2
- package/dist/integrations/pages/IntegrationsUserLandingPage.js +1 -2
- package/dist/integrations/pages/IntegrationsUserLandingPage.js.map +1 -1
- package/dist/integrations/pages/MailboxInbox.d.ts +1 -2
- package/dist/integrations/pages/MailboxInbox.js +135 -140
- package/dist/integrations/pages/MailboxInbox.js.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.d.ts +1 -2
- package/dist/integrations/pages/ProviderCatalog.js +107 -108
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.d.ts +1 -2
- package/dist/integrations/pages/ProviderDetail.js +21 -22
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.d.ts +1 -2
- package/dist/integrations/pages/ProviderEditorPage.js +261 -264
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/dist/integrations/providers/IntegrationsProvider.d.ts +0 -2
- package/dist/integrations/providers/IntegrationsProvider.js +109 -96
- package/dist/integrations/providers/IntegrationsProvider.js.map +1 -1
- package/dist/integrations/store/integrationsStore.d.ts +0 -2
- package/dist/integrations/store/integrationsStore.js +1 -2
- package/dist/integrations/store/integrationsStore.js.map +1 -1
- package/dist/integrations/store/mailboxStore.d.ts +0 -2
- package/dist/integrations/store/mailboxStore.js +1 -2
- package/dist/integrations/store/mailboxStore.js.map +1 -1
- package/dist/integrations/translations/en.d.ts +0 -1
- package/dist/integrations/types/index.d.ts +0 -1
- package/dist/integrations/utils/appearance.d.ts +0 -1
- package/dist/integrations/utils/appearance.js +1 -2
- package/dist/integrations/utils/appearance.js.map +1 -1
- package/dist/integrations/utils/cn.d.ts +0 -2
- package/dist/integrations/utils/cn.js +2 -3
- package/dist/integrations/utils/cn.js.map +1 -1
- package/dist/integrations/utils/constants.d.ts +0 -1
- package/dist/integrations/utils/constants.js +1 -2
- package/dist/integrations/utils/constants.js.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.d.ts +0 -2
- package/dist/integrations/utils/integrationsHelpers.js +1 -2
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/dist/integrations/utils/mailHtml.d.ts +0 -2
- package/dist/integrations/utils/mailHtml.js +3 -4
- package/dist/integrations/utils/mailHtml.js.map +1 -1
- package/dist/integrations/utils/mappers.d.ts +0 -2
- package/dist/integrations/utils/mappers.js +2 -3
- package/dist/integrations/utils/mappers.js.map +1 -1
- package/dist/integrations/utils/navigation.d.ts +0 -1
- package/dist/integrations/utils/navigation.js +2 -8
- package/dist/integrations/utils/navigation.js.map +1 -1
- package/dist/integrations/utils/paths.d.ts +0 -1
- package/dist/integrations/utils/paths.js +1 -2
- package/dist/integrations/utils/paths.js.map +1 -1
- package/dist/node_modules/clsx/dist/clsx.js +8 -7
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -1
- package/dist/node_modules/dompurify/dist/purify.es.js +20 -36
- package/dist/node_modules/dompurify/dist/purify.es.js.map +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +229 -167
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +0 -1
- package/dist/utils/nativeBridge.js +1 -2
- package/package.json +63 -49
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/integrations/ConnectSourceDialog.d.ts.map +0 -1
- package/dist/integrations/ConnectionsPanel.d.ts.map +0 -1
- package/dist/integrations/IntegrationsAdminRoot.d.ts.map +0 -1
- package/dist/integrations/IntegrationsAdminRoutes.d.ts.map +0 -1
- package/dist/integrations/IntegrationsRoot.d.ts.map +0 -1
- package/dist/integrations/IntegrationsUserRoutes.d.ts.map +0 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +0 -1
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +0 -1
- package/dist/integrations/components/ConfirmDialog.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionCard.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionModalFrame.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionSharing.d.ts.map +0 -1
- package/dist/integrations/components/ConnectionStatusBadge.d.ts.map +0 -1
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts.map +0 -1
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts.map +0 -1
- package/dist/integrations/components/MailMessageBody.d.ts.map +0 -1
- package/dist/integrations/components/ProviderCard.d.ts.map +0 -1
- package/dist/integrations/constants/featureFlags.d.ts.map +0 -1
- package/dist/integrations/constants/permissions.d.ts.map +0 -1
- package/dist/integrations/events/integrations-events.d.ts.map +0 -1
- package/dist/integrations/events/useIntegrationsEventBus.d.ts.map +0 -1
- package/dist/integrations/hooks/useConnections.d.ts.map +0 -1
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts.map +0 -1
- package/dist/integrations/hooks/useFormatDate.d.ts.map +0 -1
- package/dist/integrations/hooks/useFormatLastUsed.d.ts.map +0 -1
- package/dist/integrations/hooks/useLabel.d.ts.map +0 -1
- package/dist/integrations/hooks/useLogs.d.ts.map +0 -1
- package/dist/integrations/hooks/useMailbox.d.ts.map +0 -1
- package/dist/integrations/hooks/useProviders.d.ts.map +0 -1
- package/dist/integrations/hooks/useTr.d.ts.map +0 -1
- package/dist/integrations/index.d.ts.map +0 -1
- package/dist/integrations/pages/AddConnectionWizard.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectionDetail.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectionLogs.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectionsList.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts.map +0 -1
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts.map +0 -1
- package/dist/integrations/pages/IntegrationsOverview.d.ts.map +0 -1
- package/dist/integrations/pages/IntegrationsSettings.d.ts.map +0 -1
- package/dist/integrations/pages/IntegrationsUserLandingPage.d.ts.map +0 -1
- package/dist/integrations/pages/MailboxInbox.d.ts.map +0 -1
- package/dist/integrations/pages/ProviderCatalog.d.ts.map +0 -1
- package/dist/integrations/pages/ProviderDetail.d.ts.map +0 -1
- package/dist/integrations/pages/ProviderEditorPage.d.ts.map +0 -1
- package/dist/integrations/providers/IntegrationsProvider.d.ts.map +0 -1
- package/dist/integrations/store/integrationsStore.d.ts.map +0 -1
- package/dist/integrations/store/mailboxStore.d.ts.map +0 -1
- package/dist/integrations/translations/en.d.ts.map +0 -1
- package/dist/integrations/types/index.d.ts.map +0 -1
- package/dist/integrations/utils/appearance.d.ts.map +0 -1
- package/dist/integrations/utils/cn.d.ts.map +0 -1
- package/dist/integrations/utils/constants.d.ts.map +0 -1
- package/dist/integrations/utils/integrationsHelpers.d.ts.map +0 -1
- package/dist/integrations/utils/mailHtml.d.ts.map +0 -1
- package/dist/integrations/utils/mappers.d.ts.map +0 -1
- package/dist/integrations/utils/navigation.d.ts.map +0 -1
- package/dist/integrations/utils/paths.d.ts.map +0 -1
- package/dist/utils/nativeBridge.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionLogs.js","names":[],"sources":["../../../src/integrations/pages/ConnectionLogs.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n FileText,\n Search,\n Filter,\n X,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n Loader2,\n ChevronLeft,\n ChevronRight,\n Info,\n AlertTriangle,\n Bug,\n Activity,\n Download,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { useFormatDate } from '../hooks/useFormatDate';\nimport { useIntegrationLogs } from '../hooks/useLogs';\nimport { LOG_LEVEL_OPTIONS, LOG_ACTION_OPTIONS, DEFAULT_PAGE_SIZE } from '../utils/constants';\nimport type { IntegrationLog, LogLevel, LogAction } from '../types';\nimport { Button, EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nfunction getLogLevelIcon(level: LogLevel) {\n switch (level) {\n case 'error':\n return <AlertCircle size={14} className=\"text-status-error-text\" />;\n case 'warn':\n return <AlertTriangle size={14} className=\"text-status-warning-text\" />;\n case 'info':\n return <Info size={14} className=\"text-status-info-text\" />;\n case 'debug':\n return <Bug size={14} className=\"text-text-tertiary\" />;\n default:\n return <Activity size={14} className=\"text-text-tertiary\" />;\n }\n}\n\nfunction getLogLevelColor(level: LogLevel): string {\n switch (level) {\n case 'error':\n return 'text-status-error-text bg-status-error-bg-subtle border-border-default';\n case 'warn':\n return 'text-status-warning-text bg-status-warning-bg-subtle border-border-default';\n case 'info':\n return 'text-status-info-text bg-status-info-bg-subtle border-border-default';\n case 'debug':\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n default:\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n }\n}\n\nfunction toCsvCell(value: string | number | null): string {\n const text = String(value ?? '');\n return `\"${text.replaceAll('\"', '\"\"')}\"`;\n}\n\nfunction downloadLogsCsv(logs: IntegrationLog[], tr: ReturnType<typeof useTr>) {\n const header = [\n tr('integrations.logs.csv.createdAt', 'Created At'),\n tr('integrations.logs.csv.level', 'Level'),\n tr('integrations.logs.csv.action', 'Action'),\n tr('integrations.logs.csv.message', 'Message'),\n tr('integrations.logs.csv.requestMethod', 'Request Method'),\n tr('integrations.logs.csv.requestUrl', 'Request URL'),\n tr('integrations.logs.csv.status', 'Status'),\n ];\n const rows = logs.map((log) => [\n log.createdAt,\n log.level,\n log.action,\n log.message,\n log.requestMethod,\n log.requestUrl,\n log.responseStatus,\n ]);\n const csv = [header, ...rows].map((row) => row.map(toCsvCell).join(',')).join('\\n');\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = tr('integrations.logs.csv.filename', 'integration-logs-{{date}}.csv', {\n date: new Date().toISOString().slice(0, 10),\n });\n link.click();\n URL.revokeObjectURL(url);\n}\n\n/**\n * Connection Logs — activity log view with filtering and pagination.\n */\nexport function ConnectionLogs() {\n const { basePath = '/', navigate } = useIntegrations();\n const tr = useTr();\n const formatDate = useFormatDate();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canReadLogs = hasPermission(INTEGRATION_PERMISSIONS.LOG_READ);\n const canExportCsv = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.CSV_EXPORT, true);\n\n const idPrefix = useId();\n const levelFilterId = `${idPrefix}-level`;\n const actionFilterId = `${idPrefix}-action`;\n const [searchQuery, setSearchQuery] = useState('');\n const [levelFilter, setLevelFilter] = useState<LogLevel | 'all'>('all');\n const [actionFilter, setActionFilter] = useState<LogAction | 'all'>('all');\n const [showFilters, setShowFilters] = useState(false);\n const [currentPage, setCurrentPage] = useState(1);\n\n const { logs, total, loading, error, refetch } = useIntegrationLogs({\n level: levelFilter === 'all' ? undefined : levelFilter,\n action: actionFilter === 'all' ? undefined : actionFilter,\n page: currentPage,\n pageSize: DEFAULT_PAGE_SIZE,\n skip: permissionsLoading || !canReadLogs,\n });\n\n // Client-side search filter\n const filteredLogs = useMemo(() => {\n if (!searchQuery) return logs ?? [];\n const q = searchQuery.toLowerCase();\n return (logs ?? []).filter(\n (log: IntegrationLog) =>\n log.message.toLowerCase().includes(q) ||\n (log.requestUrl?.toLowerCase().includes(q) ?? false)\n );\n }, [logs, searchQuery]);\n\n const totalPages = Math.ceil((total ?? 0) / DEFAULT_PAGE_SIZE);\n\n const hasActiveFilters = searchQuery || levelFilter !== 'all' || actionFilter !== 'all';\n\n const handleClearFilters = () => {\n setSearchQuery('');\n setLevelFilter('all');\n setActionFilter('all');\n setCurrentPage(1);\n };\n\n const handleExport = () => {\n downloadLogsCsv(filteredLogs, tr);\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 (!canReadLogs) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <AlertCircle size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">\n {tr('integrations.logs.denied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n {tr(\n 'integrations.logs.denied.description',\n \"You don't have permission to view activity logs.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={16} /> {tr('integrations.logs.denied.back', 'Back to Overview')}\n </button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl 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.logs.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <FileText 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.logs.title', 'Activity Logs')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr('integrations.logs.subtitle', 'Track integration activity and debug issues')}\n </p>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<FileText size={16} />}>\n {tr(\n 'integrations.logs.purpose',\n 'Every request an integration makes — token refreshes, API calls, errors — is recorded here. Use this timeline to confirm a connection is working, see exactly what a provider returned, and debug failures (filter by level or action, then export to CSV to share with support).'\n )}\n </PagePurpose>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label={tr('integrations.logs.search.ariaLabel', 'Search activity logs')}\n placeholder={tr('integrations.logs.search.placeholder', 'Search logs...')}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full pl-10 pr-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 <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n aria-expanded={showFilters}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} /> {tr('integrations.logs.filters.show', 'Filter')}\n </button>\n {canExportCsv && (\n <Button variant=\"outline\" onClick={handleExport} disabled={filteredLogs.length === 0}>\n <Download size={16} /> {tr('integrations.logs.actions.exportCsv', 'Export CSV')}\n </Button>\n )}\n <Button variant=\"outline\" onClick={() => refetch()}>\n <RefreshCw size={16} /> {tr('integrations.logs.actions.refresh', 'Refresh')}\n </Button>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />{' '}\n {tr('integrations.logs.filters.panelTitle', 'Filters')}\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text flex items-center gap-1\"\n >\n <X size={14} /> {tr('integrations.logs.filters.clearAll', 'Clear All')}\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={levelFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.logs.filters.logLevel', 'Log Level')}\n </label>\n <select\n id={levelFilterId}\n value={levelFilter}\n onChange={(e) => {\n setLevelFilter(e.target.value as LogLevel | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.logs.filters.logLevelAll', 'All Levels')}\n </option>\n {LOG_LEVEL_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.logLevel.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={actionFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.logs.filters.action', 'Action')}\n </label>\n <select\n id={actionFilterId}\n value={actionFilter}\n onChange={(e) => {\n setActionFilter(e.target.value as LogAction | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.logs.filters.actionAll', 'All Actions')}\n </option>\n {LOG_ACTION_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.logAction.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.logs.error.title', 'Error loading logs')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\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} /> {tr('integrations.common.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\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 {/* Logs List — the page's primary emphasis zone */}\n {!loading && !error && (\n <>\n {filteredLogs.length > 0 ? (\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"flex items-center gap-2 p-5 border-b border-border-seam\">\n <Activity size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tr('integrations.logs.timeline.title', 'Activity Timeline')}\n </h2>\n </div>\n <div className=\"divide-y divide-border-seam\">\n {filteredLogs.map((log: IntegrationLog) => (\n <div\n key={log.id}\n className=\"flex items-start gap-3 px-5 py-3.5 hover:bg-accent/30 transition-colors\"\n >\n <div className=\"mt-0.5\">{getLogLevelIcon(log.level)}</div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-medium',\n getLogLevelColor(log.level)\n )}\n >\n {log.level.toUpperCase()}\n </span>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary\">\n {log.action.replace(/_/g, ' ')}\n </span>\n {log.responseStatus && (\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-mono',\n log.responseStatus >= 400\n ? 'text-status-error-text bg-status-error-bg-subtle border-border-default'\n : 'text-status-success-text bg-status-success-bg-subtle border-border-default'\n )}\n >\n {log.responseStatus}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-primary mt-1\">{log.message}</p>\n {log.requestUrl && (\n <p className=\"text-xs text-text-secondary font-mono mt-0.5 truncate\">\n {log.requestMethod && (\n <span className=\"font-semibold\">{log.requestMethod} </span>\n )}\n {log.requestUrl}\n </p>\n )}\n </div>\n <span className=\"text-xs text-text-secondary whitespace-nowrap flex-shrink-0\">\n {formatDate(log.createdAt)}\n </span>\n </div>\n ))}\n </div>\n </EmphasisPanel>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={\n hasActiveFilters\n ? tr('integrations.logs.empty.filteredTitle', 'No matching logs')\n : tr('integrations.logs.empty.title', 'No activity logs yet')\n }\n description={\n hasActiveFilters\n ? tr('integrations.logs.empty.filteredDescription', 'Try adjusting your filters.')\n : tr(\n 'integrations.logs.empty.description',\n 'Activity logs will appear here once you start using integrations.'\n )\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} /> {tr('integrations.logs.empty.clearFilters', 'Clear Filters')}\n </Button>\n ) : undefined\n }\n />\n )}\n\n {/* Pagination */}\n {totalPages > 1 && (\n <div className=\"flex items-center justify-between px-2\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'integrations.logs.pagination.showing',\n 'Showing {{start}}-{{end}} of {{total}}',\n {\n start: (currentPage - 1) * DEFAULT_PAGE_SIZE + 1,\n end: Math.min(currentPage * DEFAULT_PAGE_SIZE, total ?? 0),\n total: total ?? 0,\n }\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}\n disabled={currentPage === 1}\n aria-label={tr('integrations.logs.pagination.previous', 'Previous page')}\n className=\"p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronLeft size={16} />\n </button>\n <span className=\"text-sm text-text-primary px-3 py-1.5 rounded-lg bg-bg-sunken\">\n {tr('integrations.logs.pagination.pageOf', '{{page}} / {{total}}', {\n page: currentPage,\n total: totalPages,\n })}\n </span>\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.min(totalPages, p + 1))}\n disabled={currentPage === totalPages}\n aria-label={tr('integrations.logs.pagination.next', 'Next page')}\n className=\"p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronRight size={16} />\n </button>\n </div>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,SAAS,EAAgB,GAAiB;AACxC,SAAQ,GAAR;EACE,KAAK,QACH,QAAO,kBAAC,GAAD;GAAa,MAAM;GAAI,WAAU;GAA2B,CAAA;EACrE,KAAK,OACH,QAAO,kBAAC,GAAD;GAAe,MAAM;GAAI,WAAU;GAA6B,CAAA;EACzE,KAAK,OACH,QAAO,kBAAC,GAAD;GAAM,MAAM;GAAI,WAAU;GAA0B,CAAA;EAC7D,KAAK,QACH,QAAO,kBAAC,GAAD;GAAK,MAAM;GAAI,WAAU;GAAuB,CAAA;EACzD,QACE,QAAO,kBAAC,GAAD;GAAU,MAAM;GAAI,WAAU;GAAuB,CAAA;;;AAIlE,SAAS,EAAiB,GAAyB;AACjD,SAAQ,GAAR;EACE,KAAK,QACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,QACH,QAAO;EACT,QACE,QAAO;;;AAIb,SAAS,EAAU,GAAuC;AAExD,QAAO,IADM,OAAO,KAAS,GAAG,CAChB,WAAW,MAAK,OAAK,CAAC;;AAGxC,SAAS,EAAgB,GAAwB,GAA8B;CAmB7E,IAAM,IAAM,CAlBG;EACb,EAAG,mCAAmC,aAAa;EACnD,EAAG,+BAA+B,QAAQ;EAC1C,EAAG,gCAAgC,SAAS;EAC5C,EAAG,iCAAiC,UAAU;EAC9C,EAAG,uCAAuC,iBAAiB;EAC3D,EAAG,oCAAoC,cAAc;EACrD,EAAG,gCAAgC,SAAS;EAC7C,EAUoB,GATR,EAAK,KAAK,MAAQ;EAC7B,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACJ,EAAI;EACL,CAAC,CAC2B,C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;IAAa,MAAM;IAAI,WAAU;IAA6B,CAAA;GAC9D,kBAAC,MAAD;IAAI,WAAU;cACX,EAAG,kCAAkC,gBAAgB;IACnD,CAAA;GACL,kBAAC,KAAD;IAAG,WAAU;cACV,EACC,wCACA,mDACD;IACC,CAAA;GACJ,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,IAAW,EAAS;IACnC,WAAU;cAHZ;KAKE,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;;KAAE,EAAG,iCAAiC,mBAAmB;KACzE;;GACL"}
|
|
1
|
+
{"version":3,"file":"ConnectionLogs.js","names":["_Fragment","getLogLevelIcon","level","AlertCircle","AlertTriangle","Info","Bug","Activity","getLogLevelColor","toCsvCell","value","downloadLogsCsv","csv","tr","logs","log","row","blob","url","link","ConnectionLogs","useIntegrations","useTr","formatDate","useFormatDate","permissionsLoading","usePermissions","canReadLogs","hasPermission","INTEGRATION_PERMISSIONS","canExportCsv","useFeatureFlag","INTEGRATION_FEATURE_FLAGS","idPrefix","useId","levelFilterId","actionFilterId","searchQuery","setSearchQuery","useState","levelFilter","setLevelFilter","actionFilter","setActionFilter","showFilters","setShowFilters","currentPage","setCurrentPage","useIntegrationLogs","filteredLogs","useMemo","q","totalPages","total","hasActiveFilters","handleClearFilters","Loader2","Button","navigate","basePath","ArrowLeft","FileText","PagePurpose","Search","cn","Filter","Download","refetch","RefreshCw","X","LOG_LEVEL_OPTIONS","opt","LOG_ACTION_OPTIONS","error","loading","Fragment","EmphasisPanel","IllustratedEmptyState","p","ChevronLeft","ChevronRight"],"sources":["../../../src/integrations/pages/ConnectionLogs.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n FileText,\n Search,\n Filter,\n X,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\n Loader2,\n ChevronLeft,\n ChevronRight,\n Info,\n AlertTriangle,\n Bug,\n Activity,\n Download,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useTr } from '../hooks/useTr';\nimport { useFeatureFlag } from '@burdenoff/fe-libs/shared/feature-flags';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { INTEGRATION_FEATURE_FLAGS } from '../constants/featureFlags';\nimport { useFormatDate } from '../hooks/useFormatDate';\nimport { useIntegrationLogs } from '../hooks/useLogs';\nimport { LOG_LEVEL_OPTIONS, LOG_ACTION_OPTIONS, DEFAULT_PAGE_SIZE } from '../utils/constants';\nimport type { IntegrationLog, LogLevel, LogAction } from '../types';\nimport { Button, EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nfunction getLogLevelIcon(level: LogLevel) {\n switch (level) {\n case 'error':\n return <AlertCircle size={14} className=\"text-status-error-text\" />;\n case 'warn':\n return <AlertTriangle size={14} className=\"text-status-warning-text\" />;\n case 'info':\n return <Info size={14} className=\"text-status-info-text\" />;\n case 'debug':\n return <Bug size={14} className=\"text-text-tertiary\" />;\n default:\n return <Activity size={14} className=\"text-text-tertiary\" />;\n }\n}\n\nfunction getLogLevelColor(level: LogLevel): string {\n switch (level) {\n case 'error':\n return 'text-status-error-text bg-status-error-bg-subtle border-border-default';\n case 'warn':\n return 'text-status-warning-text bg-status-warning-bg-subtle border-border-default';\n case 'info':\n return 'text-status-info-text bg-status-info-bg-subtle border-border-default';\n case 'debug':\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n default:\n return 'text-text-secondary bg-bg-sunken border-border-subtle';\n }\n}\n\nfunction toCsvCell(value: string | number | null): string {\n const text = String(value ?? '');\n return `\"${text.replaceAll('\"', '\"\"')}\"`;\n}\n\nfunction downloadLogsCsv(logs: IntegrationLog[], tr: ReturnType<typeof useTr>) {\n const header = [\n tr('integrations.logs.csv.createdAt', 'Created At'),\n tr('integrations.logs.csv.level', 'Level'),\n tr('integrations.logs.csv.action', 'Action'),\n tr('integrations.logs.csv.message', 'Message'),\n tr('integrations.logs.csv.requestMethod', 'Request Method'),\n tr('integrations.logs.csv.requestUrl', 'Request URL'),\n tr('integrations.logs.csv.status', 'Status'),\n ];\n const rows = logs.map((log) => [\n log.createdAt,\n log.level,\n log.action,\n log.message,\n log.requestMethod,\n log.requestUrl,\n log.responseStatus,\n ]);\n const csv = [header, ...rows].map((row) => row.map(toCsvCell).join(',')).join('\\n');\n const blob = new Blob([csv], { type: 'text/csv;charset=utf-8' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = tr('integrations.logs.csv.filename', 'integration-logs-{{date}}.csv', {\n date: new Date().toISOString().slice(0, 10),\n });\n link.click();\n URL.revokeObjectURL(url);\n}\n\n/**\n * Connection Logs — activity log view with filtering and pagination.\n */\nexport function ConnectionLogs() {\n const { basePath = '/', navigate } = useIntegrations();\n const tr = useTr();\n const formatDate = useFormatDate();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canReadLogs = hasPermission(INTEGRATION_PERMISSIONS.LOG_READ);\n const canExportCsv = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.CSV_EXPORT, true);\n\n const idPrefix = useId();\n const levelFilterId = `${idPrefix}-level`;\n const actionFilterId = `${idPrefix}-action`;\n const [searchQuery, setSearchQuery] = useState('');\n const [levelFilter, setLevelFilter] = useState<LogLevel | 'all'>('all');\n const [actionFilter, setActionFilter] = useState<LogAction | 'all'>('all');\n const [showFilters, setShowFilters] = useState(false);\n const [currentPage, setCurrentPage] = useState(1);\n\n const { logs, total, loading, error, refetch } = useIntegrationLogs({\n level: levelFilter === 'all' ? undefined : levelFilter,\n action: actionFilter === 'all' ? undefined : actionFilter,\n page: currentPage,\n pageSize: DEFAULT_PAGE_SIZE,\n skip: permissionsLoading || !canReadLogs,\n });\n\n // Client-side search filter\n const filteredLogs = useMemo(() => {\n if (!searchQuery) return logs ?? [];\n const q = searchQuery.toLowerCase();\n return (logs ?? []).filter(\n (log: IntegrationLog) =>\n log.message.toLowerCase().includes(q) ||\n (log.requestUrl?.toLowerCase().includes(q) ?? false)\n );\n }, [logs, searchQuery]);\n\n const totalPages = Math.ceil((total ?? 0) / DEFAULT_PAGE_SIZE);\n\n const hasActiveFilters = searchQuery || levelFilter !== 'all' || actionFilter !== 'all';\n\n const handleClearFilters = () => {\n setSearchQuery('');\n setLevelFilter('all');\n setActionFilter('all');\n setCurrentPage(1);\n };\n\n const handleExport = () => {\n downloadLogsCsv(filteredLogs, tr);\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 (!canReadLogs) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20 text-center p-6\">\n <AlertCircle size={48} className=\"text-text-secondary mb-4\" />\n <h2 className=\"text-xl font-bold text-text-primary mb-2\">\n {tr('integrations.logs.denied.title', 'Access Denied')}\n </h2>\n <p className=\"text-sm text-text-secondary mb-6 max-w-sm\">\n {tr(\n 'integrations.logs.denied.description',\n \"You don't have permission to view activity logs.\"\n )}\n </p>\n <button\n type=\"button\"\n onClick={() => navigate?.(basePath)}\n className=\"inline-flex items-center gap-2 px-4 py-2.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={16} /> {tr('integrations.logs.denied.back', 'Back to Overview')}\n </button>\n </div>\n );\n }\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl 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.logs.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <FileText 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.logs.title', 'Activity Logs')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr('integrations.logs.subtitle', 'Track integration activity and debug issues')}\n </p>\n </div>\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose icon={<FileText size={16} />}>\n {tr(\n 'integrations.logs.purpose',\n 'Every request an integration makes — token refreshes, API calls, errors — is recorded here. Use this timeline to confirm a connection is working, see exactly what a provider returned, and debug failures (filter by level or action, then export to CSV to share with support).'\n )}\n </PagePurpose>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary\"\n />\n <input\n type=\"text\"\n aria-label={tr('integrations.logs.search.ariaLabel', 'Search activity logs')}\n placeholder={tr('integrations.logs.search.placeholder', 'Search logs...')}\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"w-full pl-10 pr-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 <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n aria-expanded={showFilters}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} /> {tr('integrations.logs.filters.show', 'Filter')}\n </button>\n {canExportCsv && (\n <Button variant=\"outline\" onClick={handleExport} disabled={filteredLogs.length === 0}>\n <Download size={16} /> {tr('integrations.logs.actions.exportCsv', 'Export CSV')}\n </Button>\n )}\n <Button variant=\"outline\" onClick={() => refetch()}>\n <RefreshCw size={16} /> {tr('integrations.logs.actions.refresh', 'Refresh')}\n </Button>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />{' '}\n {tr('integrations.logs.filters.panelTitle', 'Filters')}\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text flex items-center gap-1\"\n >\n <X size={14} /> {tr('integrations.logs.filters.clearAll', 'Clear All')}\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={levelFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.logs.filters.logLevel', 'Log Level')}\n </label>\n <select\n id={levelFilterId}\n value={levelFilter}\n onChange={(e) => {\n setLevelFilter(e.target.value as LogLevel | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.logs.filters.logLevelAll', 'All Levels')}\n </option>\n {LOG_LEVEL_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.logLevel.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={actionFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.logs.filters.action', 'Action')}\n </label>\n <select\n id={actionFilterId}\n value={actionFilter}\n onChange={(e) => {\n setActionFilter(e.target.value as LogAction | 'all');\n setCurrentPage(1);\n }}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.logs.filters.actionAll', 'All Actions')}\n </option>\n {LOG_ACTION_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.logAction.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.logs.error.title', 'Error loading logs')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\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} /> {tr('integrations.common.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\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 {/* Logs List — the page's primary emphasis zone */}\n {!loading && !error && (\n <>\n {filteredLogs.length > 0 ? (\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"flex items-center gap-2 p-5 border-b border-border-seam\">\n <Activity size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tr('integrations.logs.timeline.title', 'Activity Timeline')}\n </h2>\n </div>\n <div className=\"divide-y divide-border-seam\">\n {filteredLogs.map((log: IntegrationLog) => (\n <div\n key={log.id}\n className=\"flex items-start gap-3 px-5 py-3.5 hover:bg-accent/30 transition-colors\"\n >\n <div className=\"mt-0.5\">{getLogLevelIcon(log.level)}</div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-medium',\n getLogLevelColor(log.level)\n )}\n >\n {log.level.toUpperCase()}\n </span>\n <span className=\"text-xs px-2 py-0.5 rounded-full bg-bg-sunken text-text-secondary\">\n {log.action.replace(/_/g, ' ')}\n </span>\n {log.responseStatus && (\n <span\n className={cn(\n 'text-xs px-2 py-0.5 rounded-full border font-mono',\n log.responseStatus >= 400\n ? 'text-status-error-text bg-status-error-bg-subtle border-border-default'\n : 'text-status-success-text bg-status-success-bg-subtle border-border-default'\n )}\n >\n {log.responseStatus}\n </span>\n )}\n </div>\n <p className=\"text-sm text-text-primary mt-1\">{log.message}</p>\n {log.requestUrl && (\n <p className=\"text-xs text-text-secondary font-mono mt-0.5 truncate\">\n {log.requestMethod && (\n <span className=\"font-semibold\">{log.requestMethod} </span>\n )}\n {log.requestUrl}\n </p>\n )}\n </div>\n <span className=\"text-xs text-text-secondary whitespace-nowrap flex-shrink-0\">\n {formatDate(log.createdAt)}\n </span>\n </div>\n ))}\n </div>\n </EmphasisPanel>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={\n hasActiveFilters\n ? tr('integrations.logs.empty.filteredTitle', 'No matching logs')\n : tr('integrations.logs.empty.title', 'No activity logs yet')\n }\n description={\n hasActiveFilters\n ? tr('integrations.logs.empty.filteredDescription', 'Try adjusting your filters.')\n : tr(\n 'integrations.logs.empty.description',\n 'Activity logs will appear here once you start using integrations.'\n )\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} /> {tr('integrations.logs.empty.clearFilters', 'Clear Filters')}\n </Button>\n ) : undefined\n }\n />\n )}\n\n {/* Pagination */}\n {totalPages > 1 && (\n <div className=\"flex items-center justify-between px-2\">\n <p className=\"text-sm text-text-secondary\">\n {tr(\n 'integrations.logs.pagination.showing',\n 'Showing {{start}}-{{end}} of {{total}}',\n {\n start: (currentPage - 1) * DEFAULT_PAGE_SIZE + 1,\n end: Math.min(currentPage * DEFAULT_PAGE_SIZE, total ?? 0),\n total: total ?? 0,\n }\n )}\n </p>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.max(1, p - 1))}\n disabled={currentPage === 1}\n aria-label={tr('integrations.logs.pagination.previous', 'Previous page')}\n className=\"p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronLeft size={16} />\n </button>\n <span className=\"text-sm text-text-primary px-3 py-1.5 rounded-lg bg-bg-sunken\">\n {tr('integrations.logs.pagination.pageOf', '{{page}} / {{total}}', {\n page: currentPage,\n total: totalPages,\n })}\n </span>\n <button\n type=\"button\"\n onClick={() => setCurrentPage((p) => Math.min(totalPages, p + 1))}\n disabled={currentPage === totalPages}\n aria-label={tr('integrations.logs.pagination.next', 'Next page')}\n className=\"p-2 rounded-lg border border-border-subtle hover:bg-accent disabled:opacity-50 transition-colors\"\n >\n <ChevronRight size={16} />\n </button>\n </div>\n </div>\n )}\n </>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AA+BA,SAASC,EAAgB,GAAiB;CACxC,QAAQC,GAAR;EACE,KAAK,SACH,OAAO,kBAACC,GAAD;GAAa,MAAM;GAAI,WAAU;EAA0B,CAAA;EACpE,KAAK,QACH,OAAO,kBAACC,GAAD;GAAe,MAAM;GAAI,WAAU;EAA4B,CAAA;EACxE,KAAK,QACH,OAAO,kBAACC,GAAD;GAAM,MAAM;GAAI,WAAU;EAAyB,CAAA;EAC5D,KAAK,SACH,OAAO,kBAACC,GAAD;GAAK,MAAM;GAAI,WAAU;EAAsB,CAAA;EACxD,SACE,OAAO,kBAACC,GAAD;GAAU,MAAM;GAAI,WAAU;EAAsB,CAAA;CAC/D;AACF;AAEA,SAASC,GAAiB,GAAyB;CACjD,QAAQN,GAAR;EACE,KAAK,SACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,QACH,OAAO;EACT,KAAK,S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,UAAUhC,MAAgBM;OAC1B,cAAYvC,EAAG,qCAAqC,WAAW;OAC/D,WAAU;OAEV,UAAA,kBAACmE,IAAD,EAAc,MAAM,GAAK,CAAA;MACnB,CAAA;KACL;IACF,CAAA,CAAA;GAEP,CAAA,CAAA,EAAA,CAAA;EAED;C,KA1UH,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,kBAAC7E,GAAD;IAAa,MAAM;IAAI,WAAU;GAA4B,CAAA;GAC7D,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAU,EAAG,kCAAkC,eAAe;GACnD,CAAA;GACJ,kBAAC,KAAD;IAAG,WAAU;IACV,UAAAA,EACC,wCACA,kDACF;GACC,CAAA;GACH,kBAAC,UAAD;IACE,MAAK;IACL,eAAe6C,IAAWC,CAAQ;IAClC,WAAU;IAHZ,UAAA;KAKE,kBAACC,GAAD,EAAW,MAAM,GAAK,CAAA;KAAC;KAAE/C,EAAG,iCAAiC,kBAAkB;IACzE;;EACL;;AA0TX"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Connections List — list of all connections with search and status filter.
|
|
3
3
|
*/
|
|
4
|
-
export declare function ConnectionsList(): import(
|
|
5
|
-
//# sourceMappingURL=ConnectionsList.d.ts.map
|
|
4
|
+
export declare function ConnectionsList(): import('react').JSX.Element;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { useIntegrations as n } from "../providers/IntegrationsProvider.js";
|
|
3
4
|
import { INTEGRATION_PERMISSIONS as ee } from "../constants/permissions.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { usePermissions as oe } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
5
|
+
import { useIntegrationsStore as te } from "../store/integrationsStore.js";
|
|
6
|
+
import { useConnections as r } from "../hooks/useConnections.js";
|
|
7
|
+
import { joinPath as i } from "../utils/navigation.js";
|
|
8
|
+
import { ConnectionCard as a } from "../components/ConnectionCard.js";
|
|
9
|
+
import { AddConnectionDialog as ne } from "../components/AddConnectionDialog.js";
|
|
10
|
+
import { CONNECTION_STATUS_OPTIONS as o, PROVIDER_CATEGORIES as s } from "../utils/constants.js";
|
|
11
|
+
import { ConnectionAccessFilter as c } from "../../generated/wspace-types.js";
|
|
12
|
+
import { useId as l, useMemo as u, useState as d } from "react";
|
|
13
|
+
import { AlertCircle as f, ArrowLeft as p, Filter as m, Grid3x3 as re, Link2 as h, List as ie, Plus as g, RefreshCw as ae, Search as oe, X as _ } from "lucide-react";
|
|
14
|
+
import { usePermissions as v } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
15
15
|
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
16
16
|
import { Button as x, EmphasisPanel as S, IllustratedEmptyState as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
mine:
|
|
20
|
-
shared:
|
|
17
|
+
// src/integrations/pages/ConnectionsList.tsx
|
|
18
|
+
var se = {
|
|
19
|
+
mine: c.OwnedByMe,
|
|
20
|
+
shared: c.SharedWithMe
|
|
21
21
|
};
|
|
22
|
-
function
|
|
23
|
-
let { basePath:
|
|
22
|
+
function T() {
|
|
23
|
+
let { basePath: c = "/", navigate: T, onConnectionSelect: ce, connectionsDocsUrl: E } = n(), D = t(), { viewMode: O, setViewMode: k, connectionFilter: A, updateConnectionFilter: j, addConnectionDialogOpen: M, openAddConnectionDialog: N, closeAddConnectionDialog: P } = te(), [F, I] = d("all"), { connections: L, loading: R, answered: z, error: B, refetch: V } = r(F === "all" ? void 0 : { access: se[F] }), H = !R && !B && !z, { hasPermission: U, isLoading: W } = v(), G = !W && U(ee.CONNECTION_CREATE), [K, le] = d(!1), q = l(), J = `${q}-status`, Y = `${q}-category`, X = `${q}-access`, ue = F !== "all" || (L ?? []).some((e) => e.myAccess !== void 0), Z = u(() => {
|
|
24
24
|
let e = L ?? [];
|
|
25
25
|
if (A.search) {
|
|
26
26
|
let t = A.search.toLowerCase();
|
|
@@ -35,7 +35,7 @@ function E() {
|
|
|
35
35
|
category: "all"
|
|
36
36
|
}), I("all");
|
|
37
37
|
}, de = (e) => {
|
|
38
|
-
|
|
38
|
+
ce?.(e), T?.(i(c, `connections/${e.id}`));
|
|
39
39
|
};
|
|
40
40
|
return /* @__PURE__ */ b("div", {
|
|
41
41
|
className: "space-y-6 p-6 max-w-7xl mx-auto",
|
|
@@ -52,9 +52,9 @@ function E() {
|
|
|
52
52
|
variant: "ghost",
|
|
53
53
|
size: "icon",
|
|
54
54
|
className: "shrink-0",
|
|
55
|
-
onClick: () =>
|
|
55
|
+
onClick: () => T?.(c),
|
|
56
56
|
"aria-label": D("integrations.connections.actions.backAriaLabel", "Back to overview"),
|
|
57
|
-
children: /* @__PURE__ */ y(
|
|
57
|
+
children: /* @__PURE__ */ y(p, { size: 20 })
|
|
58
58
|
}),
|
|
59
59
|
/* @__PURE__ */ y("div", {
|
|
60
60
|
className: "shrink-0 p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
@@ -83,7 +83,7 @@ function E() {
|
|
|
83
83
|
}),
|
|
84
84
|
/* @__PURE__ */ y(w, {
|
|
85
85
|
icon: /* @__PURE__ */ y(h, { size: 16 }),
|
|
86
|
-
learnMoreHref:
|
|
86
|
+
learnMoreHref: E,
|
|
87
87
|
learnMoreLabel: D("integrations.connections.learnMore", "Learn more"),
|
|
88
88
|
children: D("integrations.connections.purpose", "A connection is one authenticated link between your workspace and an external service (for example, \"Marketing Slack\" or \"Finance Google Drive\"). Use this page to see every connection at a glance, check its health, search by provider or account, and open one to test, refresh, or revoke its access.")
|
|
89
89
|
}),
|
|
@@ -95,7 +95,7 @@ function E() {
|
|
|
95
95
|
/* @__PURE__ */ b("div", {
|
|
96
96
|
className: "flex-1 relative group",
|
|
97
97
|
"data-tour": "integrations-connections-search",
|
|
98
|
-
children: [/* @__PURE__ */ y(
|
|
98
|
+
children: [/* @__PURE__ */ y(oe, {
|
|
99
99
|
size: 18,
|
|
100
100
|
className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors"
|
|
101
101
|
}), /* @__PURE__ */ y("input", {
|
|
@@ -110,8 +110,8 @@ function E() {
|
|
|
110
110
|
/* @__PURE__ */ b("button", {
|
|
111
111
|
type: "button",
|
|
112
112
|
onClick: () => le(!K),
|
|
113
|
-
className:
|
|
114
|
-
children: [/* @__PURE__ */ y(
|
|
113
|
+
className: e("inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all", K || Q ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface text-text-primary border-border-subtle hover:bg-accent"),
|
|
114
|
+
children: [/* @__PURE__ */ y(m, { size: 16 }), K ? D("integrations.connections.filters.hide", "Hide") : D("integrations.connections.filters.show", "Filter")]
|
|
115
115
|
}),
|
|
116
116
|
/* @__PURE__ */ b("div", {
|
|
117
117
|
className: "flex items-center border border-border-subtle rounded-lg overflow-hidden",
|
|
@@ -119,13 +119,13 @@ function E() {
|
|
|
119
119
|
children: [/* @__PURE__ */ y("button", {
|
|
120
120
|
type: "button",
|
|
121
121
|
onClick: () => k("grid"),
|
|
122
|
-
className:
|
|
122
|
+
className: e("p-2.5 transition-colors", O === "grid" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
123
123
|
"aria-label": D("integrations.connections.view.gridAriaLabel", "Grid view"),
|
|
124
|
-
children: /* @__PURE__ */ y(
|
|
124
|
+
children: /* @__PURE__ */ y(re, { size: 16 })
|
|
125
125
|
}), /* @__PURE__ */ y("button", {
|
|
126
126
|
type: "button",
|
|
127
127
|
onClick: () => k("list"),
|
|
128
|
-
className:
|
|
128
|
+
className: e("p-2.5 transition-colors", O === "list" ? "bg-action-primary-bg text-action-primary-text" : "hover:bg-accent"),
|
|
129
129
|
"aria-label": D("integrations.connections.view.listAriaLabel", "List view"),
|
|
130
130
|
children: /* @__PURE__ */ y(ie, { size: 16 })
|
|
131
131
|
})]
|
|
@@ -137,7 +137,7 @@ function E() {
|
|
|
137
137
|
className: "flex items-center justify-between mb-4",
|
|
138
138
|
children: [/* @__PURE__ */ b("h3", {
|
|
139
139
|
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
140
|
-
children: [/* @__PURE__ */ y(
|
|
140
|
+
children: [/* @__PURE__ */ y(m, {
|
|
141
141
|
size: 16,
|
|
142
142
|
className: "text-primary"
|
|
143
143
|
}), D("integrations.connections.filters.panelTitle", "Filters")]
|
|
@@ -146,7 +146,7 @@ function E() {
|
|
|
146
146
|
onClick: $,
|
|
147
147
|
className: "text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1",
|
|
148
148
|
children: [
|
|
149
|
-
/* @__PURE__ */ y(
|
|
149
|
+
/* @__PURE__ */ y(_, { size: 14 }),
|
|
150
150
|
" ",
|
|
151
151
|
D("integrations.connections.filters.clearAll", "Clear All")
|
|
152
152
|
]
|
|
@@ -168,7 +168,7 @@ function E() {
|
|
|
168
168
|
children: [/* @__PURE__ */ y("option", {
|
|
169
169
|
value: "all",
|
|
170
170
|
children: D("integrations.connections.filters.statusAll", "All Statuses")
|
|
171
|
-
}),
|
|
171
|
+
}), o.map((e) => /* @__PURE__ */ y("option", {
|
|
172
172
|
value: e.value,
|
|
173
173
|
children: D(`integrations.status.${e.value}`, e.label)
|
|
174
174
|
}, e.value))]
|
|
@@ -188,7 +188,7 @@ function E() {
|
|
|
188
188
|
children: [/* @__PURE__ */ y("option", {
|
|
189
189
|
value: "all",
|
|
190
190
|
children: D("integrations.connections.filters.categoryAll", "All Categories")
|
|
191
|
-
}),
|
|
191
|
+
}), s.map((e) => /* @__PURE__ */ y("option", {
|
|
192
192
|
value: e.value,
|
|
193
193
|
children: D(`integrations.category.${e.value}`, e.label)
|
|
194
194
|
}, e.value))]
|
|
@@ -228,7 +228,7 @@ function E() {
|
|
|
228
228
|
}),
|
|
229
229
|
B && /* @__PURE__ */ b("div", {
|
|
230
230
|
className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4",
|
|
231
|
-
children: [/* @__PURE__ */ y(
|
|
231
|
+
children: [/* @__PURE__ */ y(f, {
|
|
232
232
|
size: 24,
|
|
233
233
|
className: "text-status-error-text flex-shrink-0"
|
|
234
234
|
}), /* @__PURE__ */ b("div", {
|
|
@@ -247,7 +247,7 @@ function E() {
|
|
|
247
247
|
onClick: () => V(),
|
|
248
248
|
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",
|
|
249
249
|
children: [
|
|
250
|
-
/* @__PURE__ */ y(
|
|
250
|
+
/* @__PURE__ */ y(ae, { size: 14 }),
|
|
251
251
|
" ",
|
|
252
252
|
D("integrations.common.retry", "Try Again")
|
|
253
253
|
]
|
|
@@ -256,7 +256,7 @@ function E() {
|
|
|
256
256
|
})]
|
|
257
257
|
}),
|
|
258
258
|
(R || H) && /* @__PURE__ */ y("div", {
|
|
259
|
-
className:
|
|
259
|
+
className: e(O === "grid" ? "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4" : "space-y-3"),
|
|
260
260
|
children: [...[
|
|
261
261
|
,
|
|
262
262
|
,
|
|
@@ -306,8 +306,8 @@ function E() {
|
|
|
306
306
|
]
|
|
307
307
|
})]
|
|
308
308
|
}), Z.length > 0 ? /* @__PURE__ */ y("div", {
|
|
309
|
-
className:
|
|
310
|
-
children: Z.map((e) => /* @__PURE__ */ y(
|
|
309
|
+
className: e("p-5", O === "grid" ? "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4" : "space-y-3"),
|
|
310
|
+
children: Z.map((e) => /* @__PURE__ */ y(a, {
|
|
311
311
|
connection: e,
|
|
312
312
|
displayMode: O,
|
|
313
313
|
onClick: de
|
|
@@ -320,7 +320,7 @@ function E() {
|
|
|
320
320
|
variant: "outline",
|
|
321
321
|
onClick: $,
|
|
322
322
|
children: [
|
|
323
|
-
/* @__PURE__ */ y(
|
|
323
|
+
/* @__PURE__ */ y(_, { size: 14 }),
|
|
324
324
|
" ",
|
|
325
325
|
D("integrations.connections.empty.clearFilters", "Clear Filters")
|
|
326
326
|
]
|
|
@@ -334,7 +334,7 @@ function E() {
|
|
|
334
334
|
}) : void 0
|
|
335
335
|
})]
|
|
336
336
|
}),
|
|
337
|
-
/* @__PURE__ */ y(
|
|
337
|
+
/* @__PURE__ */ y(ne, {
|
|
338
338
|
open: M,
|
|
339
339
|
onClose: P,
|
|
340
340
|
onConnectionCreated: () => {
|
|
@@ -344,7 +344,6 @@ function E() {
|
|
|
344
344
|
]
|
|
345
345
|
});
|
|
346
346
|
}
|
|
347
|
-
|
|
348
|
-
export { E as ConnectionsList };
|
|
347
|
+
export { T as ConnectionsList };
|
|
349
348
|
|
|
350
349
|
//# sourceMappingURL=ConnectionsList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionsList.js","names":[],"sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n Search,\n Filter,\n X,\n Grid3x3,\n List,\n Plus,\n Link2,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\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 { useConnections } from '../hooks/useConnections';\nimport { joinPath } from '../utils/navigation';\nimport { ConnectionCard } from '../components/ConnectionCard';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { CONNECTION_STATUS_OPTIONS, PROVIDER_CATEGORIES } from '../utils/constants';\nimport type { IntegrationConnection, ConnectionStatus, ProviderCategory } from '../types';\nimport { ConnectionAccessFilter } from '../../generated/wspace-types';\nimport { Button, EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\n/** BOFF-9726: the person's own connections, or someone else's shared with them. */\ntype AccessFilter = 'all' | 'mine' | 'shared';\n\n/** The server narrows the list, so it is not limited to the first page of connections. */\nconst SERVER_ACCESS: Record<Exclude<AccessFilter, 'all'>, ConnectionAccessFilter> = {\n mine: ConnectionAccessFilter.OwnedByMe,\n shared: ConnectionAccessFilter.SharedWithMe,\n};\n\n/**\n * Connections List — list of all connections with search and status filter.\n */\nexport function ConnectionsList() {\n const { basePath = '/', navigate, onConnectionSelect, connectionsDocsUrl } = useIntegrations();\n const tr = useTr();\n const {\n viewMode,\n setViewMode,\n connectionFilter,\n updateConnectionFilter,\n addConnectionDialogOpen,\n openAddConnectionDialog,\n closeAddConnectionDialog,\n } = useIntegrationsStore();\n\n // BOFF-9726: narrow to the person's own connections, or to those shared\n // with them. Offered once the service reports how the person reaches them.\n const [accessFilter, setAccessFilter] = useState<AccessFilter>('all');\n const { connections, loading, answered, error, refetch } = useConnections(\n accessFilter === 'all' ? undefined : { access: SERVER_ACCESS[accessFilter] }\n );\n\n /**\n * ★★ NEVER CLAIM \"no connections\" UNTIL THE SERVER HAS SAID SO.\n *\n * Measured in production 2026-09-13: this page rendered \"No connections yet\"\n * while the workspace held 46 connections — 8 ACTIVE (Gmail, GitHub, Google\n * Sheets, Linear, Anthropic), 1 EXPIRED, 37 PENDING_AUTH. The assistant, asked\n * the same question through the API, listed all 46. The loading state never\n * appeared and no error was shown, so the page presented a confident, wrong\n * answer and the user reasonably believed they had nothing connected.\n *\n * The cause is that `loading: false, error: undefined, data: undefined` — what\n * Apollo returns for a SKIPPED query, and equally for one resolved from an\n * empty cache entry — is indistinguishable here from \"asked and found none\".\n * `answered` closes that gap: it is false until `data.getConnections` exists.\n *\n * Gating the empty state is the point. Rendering the unanswered case as\n * loading is a presentation choice; claiming emptiness we never verified is a\n * correctness bug.\n */\n const unanswered = !loading && !error && !answered;\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [showFilters, setShowFilters] = useState(false);\n const idPrefix = useId();\n const statusFilterId = `${idPrefix}-status`;\n const categoryFilterId = `${idPrefix}-category`;\n const accessFilterId = `${idPrefix}-access`;\n // Stays offered while a filter is on, even when it matches nothing.\n const sharingKnown =\n accessFilter !== 'all' ||\n (connections ?? []).some((c: IntegrationConnection) => c.myAccess !== undefined);\n\n const filteredConnections = useMemo(() => {\n let result = connections ?? [];\n\n if (connectionFilter.search) {\n const q = connectionFilter.search.toLowerCase();\n result = result.filter(\n (c: IntegrationConnection) =>\n c.name.toLowerCase().includes(q) ||\n c.provider.name.toLowerCase().includes(q) ||\n (c.externalAccountEmail?.toLowerCase().includes(q) ?? false)\n );\n }\n\n if (connectionFilter.status !== 'all') {\n result = result.filter((c: IntegrationConnection) => c.status === connectionFilter.status);\n }\n\n if (connectionFilter.providerId) {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.id === connectionFilter.providerId\n );\n }\n\n if (connectionFilter.category !== 'all') {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.category === connectionFilter.category\n );\n }\n\n return result.sort(\n (a: IntegrationConnection, b: IntegrationConnection) =>\n new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()\n );\n }, [connections, connectionFilter]);\n\n const hasActiveFilters =\n connectionFilter.search ||\n connectionFilter.status !== 'all' ||\n connectionFilter.providerId ||\n connectionFilter.category !== 'all' ||\n accessFilter !== 'all';\n\n const handleClearFilters = () => {\n updateConnectionFilter({ search: '', status: 'all', providerId: null, category: 'all' });\n setAccessFilter('all');\n };\n\n const handleConnectionClick = (connection: IntegrationConnection) => {\n onConnectionSelect?.(connection);\n navigate?.(joinPath(basePath, `connections/${connection.id}`));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-connections-header\"\n >\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex min-w-0 items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"shrink-0\"\n onClick={() => navigate?.(basePath)}\n aria-label={tr('integrations.connections.actions.backAriaLabel', 'Back to overview')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"shrink-0 p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Link2 size={24} className=\"text-primary\" />\n </div>\n <div className=\"min-w-0\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tr('integrations.connections.title', 'Connections')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr('integrations.connections.subtitle', 'Manage your integration connections')}\n </p>\n </div>\n </div>\n {canCreate && (\n <Button className=\"shrink-0\" onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n )}\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose\n icon={<Link2 size={16} />}\n learnMoreHref={connectionsDocsUrl}\n learnMoreLabel={tr('integrations.connections.learnMore', 'Learn more')}\n >\n {tr(\n 'integrations.connections.purpose',\n 'A connection is one authenticated link between your workspace and an external service (for example, \"Marketing Slack\" or \"Finance Google Drive\"). Use this page to see every connection at a glance, check its health, search by provider or account, and open one to test, refresh, or revoke its access.'\n )}\n </PagePurpose>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\" data-tour=\"integrations-connections-search\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder={tr(\n 'integrations.connections.search.placeholder',\n 'Search connections...'\n )}\n value={connectionFilter.search}\n onChange={(e) => updateConnectionFilter({ search: e.target.value })}\n className=\"w-full pl-10 pr-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 transition-all\"\n aria-label={tr('integrations.connections.search.ariaLabel', 'Search connections')}\n />\n </div>\n\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} />\n {showFilters\n ? tr('integrations.connections.filters.hide', 'Hide')\n : tr('integrations.connections.filters.show', 'Filter')}\n </button>\n\n <div\n className=\"flex items-center border border-border-subtle rounded-lg overflow-hidden\"\n data-tour=\"integrations-connections-view-toggle\"\n >\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'grid'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.gridAriaLabel', 'Grid view')}\n >\n <Grid3x3 size={16} />\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'list'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.listAriaLabel', 'List view')}\n >\n <List size={16} />\n </button>\n </div>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />\n {tr('integrations.connections.filters.panelTitle', 'Filters')}\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1\"\n >\n <X size={14} /> {tr('integrations.connections.filters.clearAll', 'Clear All')}\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={statusFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.statusLabel', 'Status')}\n </label>\n <select\n id={statusFilterId}\n value={connectionFilter.status}\n onChange={(e) =>\n updateConnectionFilter({ status: e.target.value as ConnectionStatus | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.statusAll', 'All Statuses')}\n </option>\n {CONNECTION_STATUS_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.status.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={categoryFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.categoryLabel', 'Category')}\n </label>\n <select\n id={categoryFilterId}\n value={connectionFilter.category}\n onChange={(e) =>\n updateConnectionFilter({ category: e.target.value as ProviderCategory | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.categoryAll', 'All Categories')}\n </option>\n {PROVIDER_CATEGORIES.map((cat) => (\n <option key={cat.value} value={cat.value}>\n {tr(`integrations.category.${cat.value}`, cat.label)}\n </option>\n ))}\n </select>\n </div>\n {sharingKnown && (\n <div className=\"space-y-2\">\n <label\n htmlFor={accessFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.accessLabel', 'Access')}\n </label>\n <select\n id={accessFilterId}\n value={accessFilter}\n onChange={(e) => setAccessFilter(e.target.value as AccessFilter)}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n data-testid=\"connections-access-filter\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.accessAll', 'All I can see')}\n </option>\n <option value=\"mine\">\n {tr('integrations.connections.filters.accessMine', 'Owned by me')}\n </option>\n <option value=\"shared\">\n {tr('integrations.connections.filters.accessShared', 'Shared with me')}\n </option>\n </select>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.connections.error.title', 'Error loading connections')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\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} /> {tr('integrations.common.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {(loading || unanswered) && (\n <div\n className={cn(\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {[...Array(6)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-11 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Connections — the page's primary emphasis zone */}\n {!loading && !error && !unanswered && (\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"flex items-center justify-between gap-2 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.connections.results.title', 'Your Connections')}\n {filteredConnections.length > 0 && (\n <span className=\"ml-2 text-sm font-normal text-text-secondary tabular-nums\">\n ({filteredConnections.length})\n </span>\n )}\n </h2>\n </div>\n {canCreate && filteredConnections.length > 0 && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => openAddConnectionDialog()}>\n <Plus size={14} /> {tr('integrations.connections.actions.add', 'Add')}\n </Button>\n )}\n </div>\n\n {filteredConnections.length > 0 ? (\n <div\n className={cn(\n 'p-5',\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {filteredConnections.map((conn: IntegrationConnection) => (\n <ConnectionCard\n key={conn.id}\n connection={conn}\n displayMode={viewMode}\n onClick={handleConnectionClick}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={\n hasActiveFilters\n ? tr('integrations.connections.empty.filteredTitle', 'No matching connections')\n : tr('integrations.connections.empty.title', 'No connections yet')\n }\n description={\n hasActiveFilters\n ? tr(\n 'integrations.connections.empty.filteredDescription',\n 'Try adjusting your search or filters.'\n )\n : canCreate\n ? tr(\n 'integrations.connections.empty.description',\n 'Add a connection to start integrating with external services.'\n )\n : tr(\n 'integrations.connections.empty.readOnlyDescription',\n 'No connections are configured yet. Contact your workspace admin to add one.'\n )\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} />{' '}\n {tr('integrations.connections.empty.clearFilters', 'Clear Filters')}\n </Button>\n ) : canCreate ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={14} />{' '}\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n </EmphasisPanel>\n )}\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,IAAM,IAA8E;CAClF,MAAM,EAAuB;CAC7B,QAAQ,EAAuB;CAChC;AAKD,SAAgB,IAAkB;CAChC,IAAM,EAAE,cAAW,KAAK,aAAU,wBAAoB,2BAAuB,GAAiB,EACxF,IAAK,GAAO,EACZ,EACJ,aACA,gBACA,qBACA,2BACA,4BACA,4BACA,gCACE,GAAsB,EAIpB,CAAC,GAAc,KAAmB,EAAuB,MAAM,EAC/D,EAAE,gBAAa,YAAS,aAAU,UAAO,eAAY,GACzD,MAAiB,QAAQ,KAAA,IAAY,EAAE,QAAQ,EAAc,IAAe,CAC7E,EAqBK,IAAa,CAAC,KAAW,CAAC,KAAS,CAAC,GACpC,EAAE,kBAAe,WAAW,MAAuB,IAAgB,EACnE,IAAY,CAAC,KAAsB,EAAc,GAAwB,kBAAkB,EAC3F,CAAC,GAAa,MAAkB,EAAS,GAAM,EAC/C,IAAW,GAAO,EAClB,IAAiB,GAAG,EAAS,UAC7B,IAAmB,G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D,EAAM,MAAM,IAAM,CAAA;;OAAE,EAAG,wCAAwC,MAAM;OAC9D;QAEP;QAEL,EAAoB,SAAS,IAC5B,kBAAC,OAAD;KACE,WAAW,EACT,OACA,MAAa,SACT,yDACA,YACL;eAEA,EAAoB,KAAK,MACxB,kBAAC,IAAD;MAEE,YAAY;MACZ,aAAa;MACb,SAAS;MACT,EAJK,EAAK,GAIV,CACF;KACE,CAAA,GAEN,kBAAC,GAAD;KACE,cAAc,IAAmB,iBAAiB;KAClD,OACE,IACI,EAAG,gDAAgD,0BAA0B,GAC7E,EAAG,wCAAwC,qBAAqB;KAEtE,aACE,IACI,EACE,sDACA,wCACD,GACD,IACE,EACE,8CACA,gEACD,GACD,EACE,sDACA,8EACD;KAET,QACE,IACE,kBAAC,GAAD;MAAQ,SAAQ;MAAU,SAAS;gBAAnC;OACE,kBAAC,GAAD,EAAG,MAAM,IAAM,CAAA;OAAC;OACf,EAAG,+CAA+C,gBAAgB;OAC5D;UACP,IACF,kBAAC,GAAD;MAAQ,eAAe,GAAyB;gBAAhD;OACE,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;OAAC;OAClB,EAAG,kDAAkD,iBAAiB;OAChE;UACP,KAAA;KAEN,CAAA,CAEU;;GAGlB,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACzB,QAAS;;IAEX,CAAA;GACE"}
|
|
1
|
+
{"version":3,"file":"ConnectionsList.js","names":["SERVER_ACCESS","ConnectionAccessFilter","ConnectionsList","useIntegrations","tr","useTr","useIntegrationsStore","accessFilter","setAccessFilter","useState","useConnections","unanswered","loading","error","answered","permissionsLoading","usePermissions","canCreate","hasPermission","INTEGRATION_PERMISSIONS","showFilters","setShowFilters","idPrefix","useId","statusFilterId","categoryFilterId","accessFilterId","sharingKnown","connections","c","filteredConnections","useMemo","result","connectionFilter","q","b","a","hasActiveFilters","handleClearFilters","updateConnectionFilter","handleConnectionClick","onConnectionSelect","connection","navigate","joinPath","basePath","Button","ArrowLeft","Link2","openAddConnectionDialog","Plus","PagePurpose","connectionsDocsUrl","Search","cn","Filter","setViewMode","viewMode","Grid3x3","List","X","CONNECTION_STATUS_OPTIONS","opt","PROVIDER_CATEGORIES","cat","AlertCircle","refetch","RefreshCw","i","EmphasisPanel","ConnectionCard","conn","IllustratedEmptyState","AddConnectionDialog","addConnectionDialogOpen","closeAddConnectionDialog"],"sources":["../../../src/integrations/pages/ConnectionsList.tsx"],"sourcesContent":["import { useState, useMemo, useId } from 'react';\nimport {\n Search,\n Filter,\n X,\n Grid3x3,\n List,\n Plus,\n Link2,\n AlertCircle,\n RefreshCw,\n ArrowLeft,\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 { useConnections } from '../hooks/useConnections';\nimport { joinPath } from '../utils/navigation';\nimport { ConnectionCard } from '../components/ConnectionCard';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { CONNECTION_STATUS_OPTIONS, PROVIDER_CATEGORIES } from '../utils/constants';\nimport type { IntegrationConnection, ConnectionStatus, ProviderCategory } from '../types';\nimport { ConnectionAccessFilter } from '../../generated/wspace-types';\nimport { Button, EmphasisPanel, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\n/** BOFF-9726: the person's own connections, or someone else's shared with them. */\ntype AccessFilter = 'all' | 'mine' | 'shared';\n\n/** The server narrows the list, so it is not limited to the first page of connections. */\nconst SERVER_ACCESS: Record<Exclude<AccessFilter, 'all'>, ConnectionAccessFilter> = {\n mine: ConnectionAccessFilter.OwnedByMe,\n shared: ConnectionAccessFilter.SharedWithMe,\n};\n\n/**\n * Connections List — list of all connections with search and status filter.\n */\nexport function ConnectionsList() {\n const { basePath = '/', navigate, onConnectionSelect, connectionsDocsUrl } = useIntegrations();\n const tr = useTr();\n const {\n viewMode,\n setViewMode,\n connectionFilter,\n updateConnectionFilter,\n addConnectionDialogOpen,\n openAddConnectionDialog,\n closeAddConnectionDialog,\n } = useIntegrationsStore();\n\n // BOFF-9726: narrow to the person's own connections, or to those shared\n // with them. Offered once the service reports how the person reaches them.\n const [accessFilter, setAccessFilter] = useState<AccessFilter>('all');\n const { connections, loading, answered, error, refetch } = useConnections(\n accessFilter === 'all' ? undefined : { access: SERVER_ACCESS[accessFilter] }\n );\n\n /**\n * ★★ NEVER CLAIM \"no connections\" UNTIL THE SERVER HAS SAID SO.\n *\n * Measured in production 2026-09-13: this page rendered \"No connections yet\"\n * while the workspace held 46 connections — 8 ACTIVE (Gmail, GitHub, Google\n * Sheets, Linear, Anthropic), 1 EXPIRED, 37 PENDING_AUTH. The assistant, asked\n * the same question through the API, listed all 46. The loading state never\n * appeared and no error was shown, so the page presented a confident, wrong\n * answer and the user reasonably believed they had nothing connected.\n *\n * The cause is that `loading: false, error: undefined, data: undefined` — what\n * Apollo returns for a SKIPPED query, and equally for one resolved from an\n * empty cache entry — is indistinguishable here from \"asked and found none\".\n * `answered` closes that gap: it is false until `data.getConnections` exists.\n *\n * Gating the empty state is the point. Rendering the unanswered case as\n * loading is a presentation choice; claiming emptiness we never verified is a\n * correctness bug.\n */\n const unanswered = !loading && !error && !answered;\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreate = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n const [showFilters, setShowFilters] = useState(false);\n const idPrefix = useId();\n const statusFilterId = `${idPrefix}-status`;\n const categoryFilterId = `${idPrefix}-category`;\n const accessFilterId = `${idPrefix}-access`;\n // Stays offered while a filter is on, even when it matches nothing.\n const sharingKnown =\n accessFilter !== 'all' ||\n (connections ?? []).some((c: IntegrationConnection) => c.myAccess !== undefined);\n\n const filteredConnections = useMemo(() => {\n let result = connections ?? [];\n\n if (connectionFilter.search) {\n const q = connectionFilter.search.toLowerCase();\n result = result.filter(\n (c: IntegrationConnection) =>\n c.name.toLowerCase().includes(q) ||\n c.provider.name.toLowerCase().includes(q) ||\n (c.externalAccountEmail?.toLowerCase().includes(q) ?? false)\n );\n }\n\n if (connectionFilter.status !== 'all') {\n result = result.filter((c: IntegrationConnection) => c.status === connectionFilter.status);\n }\n\n if (connectionFilter.providerId) {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.id === connectionFilter.providerId\n );\n }\n\n if (connectionFilter.category !== 'all') {\n result = result.filter(\n (c: IntegrationConnection) => c.provider.category === connectionFilter.category\n );\n }\n\n return result.sort(\n (a: IntegrationConnection, b: IntegrationConnection) =>\n new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime()\n );\n }, [connections, connectionFilter]);\n\n const hasActiveFilters =\n connectionFilter.search ||\n connectionFilter.status !== 'all' ||\n connectionFilter.providerId ||\n connectionFilter.category !== 'all' ||\n accessFilter !== 'all';\n\n const handleClearFilters = () => {\n updateConnectionFilter({ search: '', status: 'all', providerId: null, category: 'all' });\n setAccessFilter('all');\n };\n\n const handleConnectionClick = (connection: IntegrationConnection) => {\n onConnectionSelect?.(connection);\n navigate?.(joinPath(basePath, `connections/${connection.id}`));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"rounded-xl border border-border-seam bg-accent-wash p-6\"\n data-tour=\"integrations-connections-header\"\n >\n <div className=\"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between\">\n <div className=\"flex min-w-0 items-center gap-4\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"shrink-0\"\n onClick={() => navigate?.(basePath)}\n aria-label={tr('integrations.connections.actions.backAriaLabel', 'Back to overview')}\n >\n <ArrowLeft size={20} />\n </Button>\n <div className=\"shrink-0 p-2.5 rounded-lg bg-action-primary-bg/10\">\n <Link2 size={24} className=\"text-primary\" />\n </div>\n <div className=\"min-w-0\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tr('integrations.connections.title', 'Connections')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tr('integrations.connections.subtitle', 'Manage your integration connections')}\n </p>\n </div>\n </div>\n {canCreate && (\n <Button className=\"shrink-0\" onClick={() => openAddConnectionDialog()}>\n <Plus size={16} />\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n )}\n </div>\n </div>\n\n {/* Page purpose */}\n <PagePurpose\n icon={<Link2 size={16} />}\n learnMoreHref={connectionsDocsUrl}\n learnMoreLabel={tr('integrations.connections.learnMore', 'Learn more')}\n >\n {tr(\n 'integrations.connections.purpose',\n 'A connection is one authenticated link between your workspace and an external service (for example, \"Marketing Slack\" or \"Finance Google Drive\"). Use this page to see every connection at a glance, check its health, search by provider or account, and open one to test, refresh, or revoke its access.'\n )}\n </PagePurpose>\n\n {/* Search & Filters */}\n <div className=\"space-y-4\">\n <div className=\"flex flex-col sm:flex-row gap-3\">\n <div className=\"flex-1 relative group\" data-tour=\"integrations-connections-search\">\n <Search\n size={18}\n className=\"absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary group-focus-within:text-primary transition-colors\"\n />\n <input\n type=\"text\"\n placeholder={tr(\n 'integrations.connections.search.placeholder',\n 'Search connections...'\n )}\n value={connectionFilter.search}\n onChange={(e) => updateConnectionFilter({ search: e.target.value })}\n className=\"w-full pl-10 pr-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 transition-all\"\n aria-label={tr('integrations.connections.search.ariaLabel', 'Search connections')}\n />\n </div>\n\n <button\n type=\"button\"\n onClick={() => setShowFilters(!showFilters)}\n className={cn(\n 'inline-flex items-center gap-2 px-4 py-2.5 rounded-lg border text-sm font-medium transition-all',\n showFilters || hasActiveFilters\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n <Filter size={16} />\n {showFilters\n ? tr('integrations.connections.filters.hide', 'Hide')\n : tr('integrations.connections.filters.show', 'Filter')}\n </button>\n\n <div\n className=\"flex items-center border border-border-subtle rounded-lg overflow-hidden\"\n data-tour=\"integrations-connections-view-toggle\"\n >\n <button\n type=\"button\"\n onClick={() => setViewMode('grid')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'grid'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.gridAriaLabel', 'Grid view')}\n >\n <Grid3x3 size={16} />\n </button>\n <button\n type=\"button\"\n onClick={() => setViewMode('list')}\n className={cn(\n 'p-2.5 transition-colors',\n viewMode === 'list'\n ? 'bg-action-primary-bg text-action-primary-text'\n : 'hover:bg-accent'\n )}\n aria-label={tr('integrations.connections.view.listAriaLabel', 'List view')}\n >\n <List size={16} />\n </button>\n </div>\n </div>\n\n {showFilters && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-5 animate-in slide-in-from-top-2 duration-200\">\n <div className=\"flex items-center justify-between mb-4\">\n <h3 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Filter size={16} className=\"text-primary\" />\n {tr('integrations.connections.filters.panelTitle', 'Filters')}\n </h3>\n {hasActiveFilters && (\n <button\n type=\"button\"\n onClick={handleClearFilters}\n className=\"text-sm text-text-secondary hover:text-status-error-text transition-colors flex items-center gap-1\"\n >\n <X size={14} /> {tr('integrations.connections.filters.clearAll', 'Clear All')}\n </button>\n )}\n </div>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\">\n <div className=\"space-y-2\">\n <label\n htmlFor={statusFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.statusLabel', 'Status')}\n </label>\n <select\n id={statusFilterId}\n value={connectionFilter.status}\n onChange={(e) =>\n updateConnectionFilter({ status: e.target.value as ConnectionStatus | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.statusAll', 'All Statuses')}\n </option>\n {CONNECTION_STATUS_OPTIONS.map((opt) => (\n <option key={opt.value} value={opt.value}>\n {tr(`integrations.status.${opt.value}`, opt.label)}\n </option>\n ))}\n </select>\n </div>\n <div className=\"space-y-2\">\n <label\n htmlFor={categoryFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.categoryLabel', 'Category')}\n </label>\n <select\n id={categoryFilterId}\n value={connectionFilter.category}\n onChange={(e) =>\n updateConnectionFilter({ category: e.target.value as ProviderCategory | 'all' })\n }\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.categoryAll', 'All Categories')}\n </option>\n {PROVIDER_CATEGORIES.map((cat) => (\n <option key={cat.value} value={cat.value}>\n {tr(`integrations.category.${cat.value}`, cat.label)}\n </option>\n ))}\n </select>\n </div>\n {sharingKnown && (\n <div className=\"space-y-2\">\n <label\n htmlFor={accessFilterId}\n className=\"block text-sm font-medium text-text-primary\"\n >\n {tr('integrations.connections.filters.accessLabel', 'Access')}\n </label>\n <select\n id={accessFilterId}\n value={accessFilter}\n onChange={(e) => setAccessFilter(e.target.value as AccessFilter)}\n className=\"w-full px-3 py-2 border border-border-subtle rounded-lg bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary\"\n data-testid=\"connections-access-filter\"\n >\n <option value=\"all\">\n {tr('integrations.connections.filters.accessAll', 'All I can see')}\n </option>\n <option value=\"mine\">\n {tr('integrations.connections.filters.accessMine', 'Owned by me')}\n </option>\n <option value=\"shared\">\n {tr('integrations.connections.filters.accessShared', 'Shared with me')}\n </option>\n </select>\n </div>\n )}\n </div>\n </div>\n )}\n </div>\n\n {/* Error */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4\">\n <AlertCircle size={24} className=\"text-status-error-text flex-shrink-0\" />\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tr('integrations.connections.error.title', 'Error loading connections')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => refetch()}\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} /> {tr('integrations.common.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading */}\n {(loading || unanswered) && (\n <div\n className={cn(\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {[...Array(6)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-seam bg-bg-surface p-5\">\n <div className=\"flex items-start gap-3\">\n <div className=\"size-11 bg-bg-sunken rounded-xl animate-vc-shimmer\" />\n <div className=\"flex-1 space-y-2\">\n <div className=\"h-4 w-3/4 bg-bg-sunken rounded animate-vc-shimmer\" />\n <div className=\"h-3 w-1/2 bg-bg-sunken rounded animate-vc-shimmer\" />\n </div>\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Connections — the page's primary emphasis zone */}\n {!loading && !error && !unanswered && (\n <EmphasisPanel className=\"overflow-hidden p-0\">\n <div className=\"flex items-center justify-between gap-2 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.connections.results.title', 'Your Connections')}\n {filteredConnections.length > 0 && (\n <span className=\"ml-2 text-sm font-normal text-text-secondary tabular-nums\">\n ({filteredConnections.length})\n </span>\n )}\n </h2>\n </div>\n {canCreate && filteredConnections.length > 0 && (\n <Button size=\"sm\" variant=\"outline\" onClick={() => openAddConnectionDialog()}>\n <Plus size={14} /> {tr('integrations.connections.actions.add', 'Add')}\n </Button>\n )}\n </div>\n\n {filteredConnections.length > 0 ? (\n <div\n className={cn(\n 'p-5',\n viewMode === 'grid'\n ? 'grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4'\n : 'space-y-3'\n )}\n >\n {filteredConnections.map((conn: IntegrationConnection) => (\n <ConnectionCard\n key={conn.id}\n connection={conn}\n displayMode={viewMode}\n onClick={handleConnectionClick}\n />\n ))}\n </div>\n ) : (\n <IllustratedEmptyState\n illustration={hasActiveFilters ? 'empty-search' : 'empty-data'}\n title={\n hasActiveFilters\n ? tr('integrations.connections.empty.filteredTitle', 'No matching connections')\n : tr('integrations.connections.empty.title', 'No connections yet')\n }\n description={\n hasActiveFilters\n ? tr(\n 'integrations.connections.empty.filteredDescription',\n 'Try adjusting your search or filters.'\n )\n : canCreate\n ? tr(\n 'integrations.connections.empty.description',\n 'Add a connection to start integrating with external services.'\n )\n : tr(\n 'integrations.connections.empty.readOnlyDescription',\n 'No connections are configured yet. Contact your workspace admin to add one.'\n )\n }\n action={\n hasActiveFilters ? (\n <Button variant=\"outline\" onClick={handleClearFilters}>\n <X size={14} />{' '}\n {tr('integrations.connections.empty.clearFilters', 'Clear Filters')}\n </Button>\n ) : canCreate ? (\n <Button onClick={() => openAddConnectionDialog()}>\n <Plus size={14} />{' '}\n {tr('integrations.connections.actions.addConnection', 'Add Connection')}\n </Button>\n ) : undefined\n }\n />\n )}\n </EmphasisPanel>\n )}\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() =>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,5 +3,4 @@
|
|
|
3
3
|
* console. Oldest pending first, so the queue is worked in service-level order.
|
|
4
4
|
* The service refuses every action here to anyone but a super admin.
|
|
5
5
|
*/
|
|
6
|
-
export declare function ConnectorReviewQueuePage(): import(
|
|
7
|
-
//# sourceMappingURL=ConnectorReviewQueuePage.d.ts.map
|
|
6
|
+
export declare function ConnectorReviewQueuePage(): import('react').JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { cn as e } from "../utils/cn.js";
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
3
|
import { ConnectorSubmissionStatus as n } from "../../generated/wspace-types.js";
|
|
4
4
|
import { useConnectorReviewQueue as r, useReviewConnectorSubmission as i } from "../hooks/useConnectorSubmissions.js";
|
|
5
5
|
import { ConnectorSubmissionCard as a } from "../components/ConnectorSubmissionCard.js";
|
|
@@ -8,7 +8,7 @@ import { useId as s, useState as c } from "react";
|
|
|
8
8
|
import { Check as l, ClipboardCheck as u, Loader2 as d, Shield as f, X as p } from "lucide-react";
|
|
9
9
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
10
|
import { Button as _, IllustratedEmptyState as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
11
|
-
|
|
11
|
+
// src/integrations/pages/ConnectorReviewQueuePage.tsx
|
|
12
12
|
var b = [
|
|
13
13
|
[
|
|
14
14
|
n.PendingReview,
|
|
@@ -32,7 +32,7 @@ var b = [
|
|
|
32
32
|
]
|
|
33
33
|
];
|
|
34
34
|
function x() {
|
|
35
|
-
let x =
|
|
35
|
+
let x = t(), S = s(), [C, w] = c(n.PendingReview), [T, E] = c(null), [D, O] = c(""), [k, A] = c(""), [j, M] = c(0), { submissions: N, total: P, hasMore: F, stats: I, loading: L, error: R } = r(C, j), { approve: z, reject: B, loading: V } = i(), H = (e, t) => {
|
|
36
36
|
O(""), A(""), E({
|
|
37
37
|
submission: e,
|
|
38
38
|
kind: t
|
|
@@ -81,7 +81,7 @@ function x() {
|
|
|
81
81
|
className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-1.5 text-text-primary",
|
|
82
82
|
children: x("integrations.connectorReview.stats.pending", "{{count}} pending", { count: I.pending })
|
|
83
83
|
}), /* @__PURE__ */ h("span", {
|
|
84
|
-
className:
|
|
84
|
+
className: e("rounded-lg border border-border-seam px-3 py-1.5", I.overdue > 0 ? "bg-status-warning-bg-subtle text-status-warning-text" : "bg-bg-surface text-text-secondary"),
|
|
85
85
|
children: x("integrations.connectorReview.stats.overdue", "{{count}} overdue", { count: I.overdue })
|
|
86
86
|
})]
|
|
87
87
|
})
|
|
@@ -95,11 +95,11 @@ function x() {
|
|
|
95
95
|
className: "flex flex-wrap gap-2",
|
|
96
96
|
role: "group",
|
|
97
97
|
"aria-label": "Status filter",
|
|
98
|
-
children: b.map(([
|
|
98
|
+
children: b.map(([t, n, r]) => /* @__PURE__ */ h("button", {
|
|
99
99
|
type: "button",
|
|
100
|
-
"aria-pressed": C ===
|
|
101
|
-
onClick: () => W(
|
|
102
|
-
className:
|
|
100
|
+
"aria-pressed": C === t,
|
|
101
|
+
onClick: () => W(t),
|
|
102
|
+
className: e("rounded-lg border px-3 py-1.5 text-sm font-medium transition-colors", C === t ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface text-text-primary border-border-subtle hover:bg-accent"),
|
|
103
103
|
children: x(n, r)
|
|
104
104
|
}, r))
|
|
105
105
|
}),
|
|
@@ -195,7 +195,6 @@ function x() {
|
|
|
195
195
|
]
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
//#endregion
|
|
199
198
|
export { x as ConnectorReviewQueuePage };
|
|
200
199
|
|
|
201
200
|
//# sourceMappingURL=ConnectorReviewQueuePage.js.map
|