@burdenoff/microfe-integrations 2026.1023.1 → 2026.1102.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/generated/global-types.d.ts +5717 -1663
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +458 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +219 -84
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +77665 -31967
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +16 -0
- package/dist/generated/wspace-types.js.map +1 -0
- package/dist/integrations/IntegrationsAdminRoutes.d.ts.map +1 -1
- package/dist/integrations/IntegrationsAdminRoutes.js +13 -9
- package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.d.ts.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.js +16 -12
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +11 -9
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/ConnectionCard.d.ts.map +1 -1
- package/dist/integrations/components/ConnectionCard.js +71 -48
- package/dist/integrations/components/ConnectionCard.js.map +1 -1
- package/dist/integrations/components/ConnectionSharing.d.ts +18 -0
- package/dist/integrations/components/ConnectionSharing.d.ts.map +1 -0
- package/dist/integrations/components/ConnectionSharing.js +33 -0
- package/dist/integrations/components/ConnectionSharing.js.map +1 -0
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts +16 -0
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts.map +1 -0
- package/dist/integrations/components/ConnectorSubmissionCard.js +192 -0
- package/dist/integrations/components/ConnectorSubmissionCard.js.map +1 -0
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts +22 -0
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts.map +1 -0
- package/dist/integrations/components/ConnectorSubmissionPager.js +36 -0
- package/dist/integrations/components/ConnectorSubmissionPager.js.map +1 -0
- package/dist/integrations/constants/permissions.d.ts +1 -0
- package/dist/integrations/constants/permissions.d.ts.map +1 -1
- package/dist/integrations/constants/permissions.js +1 -0
- package/dist/integrations/constants/permissions.js.map +1 -1
- package/dist/integrations/hooks/useConnections.d.ts +3 -0
- package/dist/integrations/hooks/useConnections.d.ts.map +1 -1
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts +47 -0
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts.map +1 -0
- package/dist/integrations/hooks/useConnectorSubmissions.js +80 -0
- package/dist/integrations/hooks/useConnectorSubmissions.js.map +1 -0
- package/dist/integrations/pages/ConnectionDetail.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +283 -261
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.d.ts.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +197 -161
- package/dist/integrations/pages/ConnectionsList.js.map +1 -1
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts +7 -0
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts.map +1 -0
- package/dist/integrations/pages/ConnectorReviewQueuePage.js +201 -0
- package/dist/integrations/pages/ConnectorReviewQueuePage.js.map +1 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts +6 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts.map +1 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.js +576 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.js.map +1 -0
- package/dist/integrations/pages/ProviderCatalog.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +157 -145
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +15 -8
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/providers/IntegrationsProvider.d.ts.map +1 -1
- package/dist/integrations/providers/IntegrationsProvider.js +19 -18
- package/dist/integrations/providers/IntegrationsProvider.js.map +1 -1
- package/dist/integrations/types/index.d.ts +18 -0
- package/dist/integrations/types/index.d.ts.map +1 -1
- package/dist/integrations/utils/mappers.d.ts +3 -1
- package/dist/integrations/utils/mappers.d.ts.map +1 -1
- package/dist/integrations/utils/mappers.js +16 -3
- package/dist/integrations/utils/mappers.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsAdminRoutes.d.ts","sourceRoot":"","sources":["../../src/integrations/IntegrationsAdminRoutes.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntegrationsAdminRoutes.d.ts","sourceRoot":"","sources":["../../src/integrations/IntegrationsAdminRoutes.tsx"],"names":[],"mappings":"AA4FA;;;;;GAKG;AACH,wBAAgB,uBAAuB,uCAoCtC"}
|
|
@@ -4,14 +4,14 @@ import { AlertTriangle as i, Loader2 as a, RefreshCw as o } from "lucide-react";
|
|
|
4
4
|
import { Navigate as s, Route as c, Routes as l, useLocation as u } from "react-router";
|
|
5
5
|
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
6
6
|
//#region src/integrations/IntegrationsAdminRoutes.tsx
|
|
7
|
-
var p = r(() => import("./pages/IntegrationsSettings.js").then((e) => ({ default: e.IntegrationsSettings }))), m = r(() => import("./pages/ProviderCatalog.js").then((e) => ({ default: e.ProviderCatalog }))), h = r(() => import("./pages/ProviderDetail.js").then((e) => ({ default: e.ProviderDetail }))), g = r(() => import("./pages/ProviderEditorPage.js").then((e) => ({ default: e.ProviderEditorPage })));
|
|
8
|
-
function
|
|
7
|
+
var p = r(() => import("./pages/IntegrationsSettings.js").then((e) => ({ default: e.IntegrationsSettings }))), m = r(() => import("./pages/ProviderCatalog.js").then((e) => ({ default: e.ProviderCatalog }))), h = r(() => import("./pages/ProviderDetail.js").then((e) => ({ default: e.ProviderDetail }))), g = r(() => import("./pages/ConnectorReviewQueuePage.js").then((e) => ({ default: e.ConnectorReviewQueuePage }))), _ = r(() => import("./pages/ProviderEditorPage.js").then((e) => ({ default: e.ProviderEditorPage })));
|
|
8
|
+
function v() {
|
|
9
9
|
return /* @__PURE__ */ d("div", {
|
|
10
10
|
className: "flex items-center justify-center min-h-[400px]",
|
|
11
11
|
children: /* @__PURE__ */ d(a, { className: "size-8 animate-spin text-primary" })
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
var
|
|
14
|
+
var y = class extends t {
|
|
15
15
|
constructor(e) {
|
|
16
16
|
super(e), this.state = {
|
|
17
17
|
hasError: !1,
|
|
@@ -63,10 +63,10 @@ var v = class extends t {
|
|
|
63
63
|
}) : /* @__PURE__ */ d("div", { children: this.props.children }, this.state.retryKey);
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
function
|
|
66
|
+
function b() {
|
|
67
67
|
let { basePath: t } = e(), r = u(), i = t && t !== "/" ? t.endsWith("/") ? t.slice(0, -1) : t : "";
|
|
68
|
-
return i && !(r.pathname === i || r.pathname.startsWith(i + "/")) ? null : /* @__PURE__ */ d(
|
|
69
|
-
fallback: /* @__PURE__ */ d(
|
|
68
|
+
return i && !(r.pathname === i || r.pathname.startsWith(i + "/")) ? null : /* @__PURE__ */ d(y, { children: /* @__PURE__ */ d(n, {
|
|
69
|
+
fallback: /* @__PURE__ */ d(v, {}),
|
|
70
70
|
children: /* @__PURE__ */ f(l, { children: [
|
|
71
71
|
/* @__PURE__ */ d(c, {
|
|
72
72
|
index: !0,
|
|
@@ -81,7 +81,7 @@ function y() {
|
|
|
81
81
|
}),
|
|
82
82
|
/* @__PURE__ */ d(c, {
|
|
83
83
|
path: "providers/new",
|
|
84
|
-
element: /* @__PURE__ */ d(
|
|
84
|
+
element: /* @__PURE__ */ d(_, {})
|
|
85
85
|
}),
|
|
86
86
|
/* @__PURE__ */ d(c, {
|
|
87
87
|
path: "providers/:providerId",
|
|
@@ -89,12 +89,16 @@ function y() {
|
|
|
89
89
|
}),
|
|
90
90
|
/* @__PURE__ */ d(c, {
|
|
91
91
|
path: "providers/:providerId/edit",
|
|
92
|
-
element: /* @__PURE__ */ d(
|
|
92
|
+
element: /* @__PURE__ */ d(_, {})
|
|
93
93
|
}),
|
|
94
94
|
/* @__PURE__ */ d(c, {
|
|
95
95
|
path: "settings",
|
|
96
96
|
element: /* @__PURE__ */ d(p, {})
|
|
97
97
|
}),
|
|
98
|
+
/* @__PURE__ */ d(c, {
|
|
99
|
+
path: "connector-reviews",
|
|
100
|
+
element: /* @__PURE__ */ d(g, {})
|
|
101
|
+
}),
|
|
98
102
|
/* @__PURE__ */ d(c, {
|
|
99
103
|
path: "*",
|
|
100
104
|
element: /* @__PURE__ */ d(s, {
|
|
@@ -106,6 +110,6 @@ function y() {
|
|
|
106
110
|
}) });
|
|
107
111
|
}
|
|
108
112
|
//#endregion
|
|
109
|
-
export {
|
|
113
|
+
export { b as IntegrationsAdminRoutes };
|
|
110
114
|
|
|
111
115
|
//# sourceMappingURL=IntegrationsAdminRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsAdminRoutes.js","names":[],"sources":["../../src/integrations/IntegrationsAdminRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, Component, type ReactNode, type ErrorInfo } from 'react';\nimport { Navigate, Route, Routes, useLocation } from 'react-router';\nimport { Loader2, AlertTriangle, RefreshCw } from 'lucide-react';\nimport { useIntegrations } from './providers/IntegrationsProvider';\n\n// Lazy loaded pages\nconst IntegrationsSettings = lazy(() =>\n import('./pages/IntegrationsSettings').then((m) => ({ default: m.IntegrationsSettings }))\n);\nconst ProviderCatalog = lazy(() =>\n import('./pages/ProviderCatalog').then((m) => ({ default: m.ProviderCatalog }))\n);\nconst ProviderDetail = lazy(() =>\n import('./pages/ProviderDetail').then((m) => ({ default: m.ProviderDetail }))\n);\nconst ProviderEditorPage = lazy(() =>\n import('./pages/ProviderEditorPage').then((m) => ({ default: m.ProviderEditorPage }))\n);\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nclass LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null; retryKey: number }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null, retryKey: 0 };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('[Integrations Admin] Lazy page load failed:', error, errorInfo);\n }\n\n handleRetry = () => {\n // Increment retryKey to force React to remount the lazy tree,\n // which triggers a fresh dynamic import instead of reusing the cached rejection.\n this.setState((prev) => ({ hasError: false, error: null, retryKey: prev.retryKey + 1 }));\n };\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Failed to load page</h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {this.state.error?.message ||\n 'The page chunk could not be loaded. This may be due to a network issue.'}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={this.handleRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <RefreshCw className=\"size-4\" />\n Try Again\n </button>\n </div>\n );\n }\n\n return <div key={this.state.retryKey}>{this.props.children}</div>;\n }\n}\n\n/**\n * Admin-facing routes for the Integrations microfrontend.\n *\n * Includes: Settings (module configuration).\n * Excludes user features: Overview, Providers, Connections, Activity Logs.\n */\nexport function IntegrationsAdminRoutes() {\n const { basePath } = useIntegrations();\n const location = useLocation();\n\n const normalizedBasePath =\n basePath && basePath !== '/' ? (basePath.endsWith('/') ? basePath.slice(0, -1) : basePath) : '';\n\n if (normalizedBasePath) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <LazyErrorBoundary>\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<Navigate to=\"providers\" replace />} />\n <Route path=\"providers\" element={<ProviderCatalog showCreateProviderButton />} />\n <Route path=\"providers/new\" element={<ProviderEditorPage />} />\n <Route path=\"providers/:providerId\" element={<ProviderDetail />} />\n <Route path=\"providers/:providerId/edit\" element={<ProviderEditorPage />} />\n <Route path=\"settings\" element={<IntegrationsSettings />} />\n\n {/* Catch-all: redirect to admin landing */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </LazyErrorBoundary>\n );\n}\n"],"mappings":";;;;;;AAMA,IAAM,IAAuB,QAC3B,OAAO,mCAAgC,MAAM,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAC1F,EACK,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EACK,IAAqB,QACzB,OAAO,iCAA8B,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CACtF;AAKD,SAAS,IAAa;AACpB,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,oCAAqC,CA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C,GAAD,EAAc,CAAA;YAChC,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAY,SAAA;KAAU,CAAA;IAAI,CAAA;GAC7D,kBAAC,GAAD;IAAO,MAAK;IAAY,SAAS,kBAAC,GAAD,EAAiB,0BAAA,IAA2B,CAAA;IAAI,CAAA;GACjF,kBAAC,GAAD;IAAO,MAAK;IAAgB,SAAS,kBAAC,GAAD,EAAsB,CAAA;IAAI,CAAA;GAC/D,kBAAC,GAAD;IAAO,MAAK;IAAwB,SAAS,kBAAC,GAAD,EAAkB,CAAA;IAAI,CAAA;GACnE,kBAAC,GAAD;IAAO,MAAK;IAA6B,SAAS,kBAAC,GAAD,EAAsB,CAAA;IAAI,CAAA;GAC5E,kBAAC,GAAD;IAAO,MAAK;IAAW,SAAS,kBAAC,GAAD,EAAwB,CAAA;IAAI,CAAA;
|
|
1
|
+
{"version":3,"file":"IntegrationsAdminRoutes.js","names":[],"sources":["../../src/integrations/IntegrationsAdminRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, Component, type ReactNode, type ErrorInfo } from 'react';\nimport { Navigate, Route, Routes, useLocation } from 'react-router';\nimport { Loader2, AlertTriangle, RefreshCw } from 'lucide-react';\nimport { useIntegrations } from './providers/IntegrationsProvider';\n\n// Lazy loaded pages\nconst IntegrationsSettings = lazy(() =>\n import('./pages/IntegrationsSettings').then((m) => ({ default: m.IntegrationsSettings }))\n);\nconst ProviderCatalog = lazy(() =>\n import('./pages/ProviderCatalog').then((m) => ({ default: m.ProviderCatalog }))\n);\nconst ProviderDetail = lazy(() =>\n import('./pages/ProviderDetail').then((m) => ({ default: m.ProviderDetail }))\n);\nconst ConnectorReviewQueuePage = lazy(() =>\n import('./pages/ConnectorReviewQueuePage').then((m) => ({\n default: m.ConnectorReviewQueuePage,\n }))\n);\nconst ProviderEditorPage = lazy(() =>\n import('./pages/ProviderEditorPage').then((m) => ({ default: m.ProviderEditorPage }))\n);\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nclass LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null; retryKey: number }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null, retryKey: 0 };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('[Integrations Admin] Lazy page load failed:', error, errorInfo);\n }\n\n handleRetry = () => {\n // Increment retryKey to force React to remount the lazy tree,\n // which triggers a fresh dynamic import instead of reusing the cached rejection.\n this.setState((prev) => ({ hasError: false, error: null, retryKey: prev.retryKey + 1 }));\n };\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Failed to load page</h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {this.state.error?.message ||\n 'The page chunk could not be loaded. This may be due to a network issue.'}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={this.handleRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <RefreshCw className=\"size-4\" />\n Try Again\n </button>\n </div>\n );\n }\n\n return <div key={this.state.retryKey}>{this.props.children}</div>;\n }\n}\n\n/**\n * Admin-facing routes for the Integrations microfrontend.\n *\n * Includes: Settings (module configuration).\n * Excludes user features: Overview, Providers, Connections, Activity Logs.\n */\nexport function IntegrationsAdminRoutes() {\n const { basePath } = useIntegrations();\n const location = useLocation();\n\n const normalizedBasePath =\n basePath && basePath !== '/' ? (basePath.endsWith('/') ? basePath.slice(0, -1) : basePath) : '';\n\n if (normalizedBasePath) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <LazyErrorBoundary>\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<Navigate to=\"providers\" replace />} />\n <Route path=\"providers\" element={<ProviderCatalog showCreateProviderButton />} />\n <Route path=\"providers/new\" element={<ProviderEditorPage />} />\n <Route path=\"providers/:providerId\" element={<ProviderDetail />} />\n <Route path=\"providers/:providerId/edit\" element={<ProviderEditorPage />} />\n <Route path=\"settings\" element={<IntegrationsSettings />} />\n {/* Third-party connector review queue (BOFF-4417) */}\n <Route path=\"connector-reviews\" element={<ConnectorReviewQueuePage />} />\n\n {/* Catch-all: redirect to admin landing */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </LazyErrorBoundary>\n );\n}\n"],"mappings":";;;;;;AAMA,IAAM,IAAuB,QAC3B,OAAO,mCAAgC,MAAM,OAAO,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAC1F,EACK,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EACK,IAA2B,QAC/B,OAAO,uCAAoC,MAAM,OAAO,EACtD,SAAS,EAAE,0BACZ,EAAE,CACJ,EACK,IAAqB,QACzB,OAAO,iCAA8B,MAAM,OAAO,EAAE,SAAS,EAAE,oBAAoB,EAAE,CACtF;AAKD,SAAS,IAAa;AACpB,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kB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ACE,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;YAChC,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAY,SAAA;KAAU,CAAA;IAAI,CAAA;GAC7D,kBAAC,GAAD;IAAO,MAAK;IAAY,SAAS,kBAAC,GAAD,EAAiB,0BAAA,IAA2B,CAAA;IAAI,CAAA;GACjF,kBAAC,GAAD;IAAO,MAAK;IAAgB,SAAS,kBAAC,GAAD,EAAsB,CAAA;IAAI,CAAA;GAC/D,kBAAC,GAAD;IAAO,MAAK;IAAwB,SAAS,kBAAC,GAAD,EAAkB,CAAA;IAAI,CAAA;GACnE,kBAAC,GAAD;IAAO,MAAK;IAA6B,SAAS,kBAAC,GAAD,EAAsB,CAAA;IAAI,CAAA;GAC5E,kBAAC,GAAD;IAAO,MAAK;IAAW,SAAS,kBAAC,GAAD,EAAwB,CAAA;IAAI,CAAA;GAE5D,kBAAC,GAAD;IAAO,MAAK;IAAoB,SAAS,kBAAC,GAAD,EAA4B,CAAA;IAAI,CAAA;GAGzE,kBAAC,GAAD;IAAO,MAAK;IAAI,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAG,SAAA;KAAU,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA,EACO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsUserRoutes.d.ts","sourceRoot":"","sources":["../../src/integrations/IntegrationsUserRoutes.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntegrationsUserRoutes.d.ts","sourceRoot":"","sources":["../../src/integrations/IntegrationsUserRoutes.tsx"],"names":[],"mappings":"AAwIA;;;;;GAKG;AACH,wBAAgB,sBAAsB,uCA8CrC"}
|
|
@@ -7,27 +7,27 @@ import { AlertTriangle as s, Loader2 as c, RefreshCw as l } from "lucide-react";
|
|
|
7
7
|
import { Navigate as u, Route as d, Routes as f, useLocation as p, useNavigate as m, useParams as h } from "react-router";
|
|
8
8
|
import { jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
9
9
|
//#region src/integrations/IntegrationsUserRoutes.tsx
|
|
10
|
-
var v = o(() => import("./pages/ProviderCatalog.js").then((e) => ({ default: e.ProviderCatalog }))), y = o(() => import("./pages/ProviderDetail.js").then((e) => ({ default: e.ProviderDetail }))), b = o(() => import("./pages/ConnectionsList.js").then((e) => ({ default: e.ConnectionsList }))), x = o(() => import("./pages/AddConnectionWizard.js").then((e) => ({ default: e.AddConnectionWizard }))), S = o(() => import("./pages/ConnectionDetail.js").then((e) => ({ default: e.ConnectionDetail }))), C = o(() => import("./pages/ConnectionLogs.js").then((e) => ({ default: e.ConnectionLogs }))),
|
|
10
|
+
var v = o(() => import("./pages/ProviderCatalog.js").then((e) => ({ default: e.ProviderCatalog }))), y = o(() => import("./pages/ProviderDetail.js").then((e) => ({ default: e.ProviderDetail }))), b = o(() => import("./pages/ConnectionsList.js").then((e) => ({ default: e.ConnectionsList }))), x = o(() => import("./pages/AddConnectionWizard.js").then((e) => ({ default: e.AddConnectionWizard }))), S = o(() => import("./pages/ConnectionDetail.js").then((e) => ({ default: e.ConnectionDetail }))), C = o(() => import("./pages/ConnectorSubmissionsPage.js").then((e) => ({ default: e.ConnectorSubmissionsPage }))), w = o(() => import("./pages/ConnectionLogs.js").then((e) => ({ default: e.ConnectionLogs }))), T = new Set([
|
|
11
11
|
"slack-user",
|
|
12
12
|
"teams-user",
|
|
13
13
|
"discord-user"
|
|
14
14
|
]);
|
|
15
|
-
function
|
|
15
|
+
function E() {
|
|
16
16
|
let { basePath: r } = e(), { providerId: i } = h(), { search: a } = p(), o = m(), s = new URLSearchParams(a), c = s.get("providerKey");
|
|
17
|
-
return s.get("returnTo") && s.get("channelId") && c &&
|
|
17
|
+
return s.get("returnTo") && s.get("channelId") && c && T.has(c) ? /* @__PURE__ */ g(x, {}) : /* @__PURE__ */ g(t, {
|
|
18
18
|
open: !0,
|
|
19
19
|
onClose: () => o(n(r ?? "/", "connections")),
|
|
20
20
|
preselectedProviderId: i,
|
|
21
21
|
preselectedProviderKey: c
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function D() {
|
|
25
25
|
return /* @__PURE__ */ g("div", {
|
|
26
26
|
className: "flex items-center justify-center min-h-[400px]",
|
|
27
27
|
children: /* @__PURE__ */ g(c, { className: "size-8 animate-spin text-primary" })
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
var
|
|
30
|
+
var O = class extends i {
|
|
31
31
|
constructor(e) {
|
|
32
32
|
super(e), this.state = {
|
|
33
33
|
hasError: !1,
|
|
@@ -79,10 +79,10 @@ var D = class extends i {
|
|
|
79
79
|
}) : /* @__PURE__ */ g("div", { children: this.props.children }, this.state.retryKey);
|
|
80
80
|
}
|
|
81
81
|
};
|
|
82
|
-
function
|
|
82
|
+
function k() {
|
|
83
83
|
let { basePath: t } = e(), n = p(), i = t && t !== "/" ? t.endsWith("/") ? t.slice(0, -1) : t : "";
|
|
84
|
-
return i && !(n.pathname === i || n.pathname.startsWith(i + "/")) ? null : /* @__PURE__ */ g(
|
|
85
|
-
fallback: /* @__PURE__ */ g(
|
|
84
|
+
return i && !(n.pathname === i || n.pathname.startsWith(i + "/")) ? null : /* @__PURE__ */ g(O, { children: /* @__PURE__ */ g(a, {
|
|
85
|
+
fallback: /* @__PURE__ */ g(D, {}),
|
|
86
86
|
children: /* @__PURE__ */ _(f, { children: [
|
|
87
87
|
/* @__PURE__ */ g(d, {
|
|
88
88
|
index: !0,
|
|
@@ -102,20 +102,24 @@ function O() {
|
|
|
102
102
|
}),
|
|
103
103
|
/* @__PURE__ */ g(d, {
|
|
104
104
|
path: "connections/add",
|
|
105
|
-
element: /* @__PURE__ */ g(
|
|
105
|
+
element: /* @__PURE__ */ g(E, {})
|
|
106
106
|
}),
|
|
107
107
|
/* @__PURE__ */ g(d, {
|
|
108
108
|
path: "connections/add/:providerId",
|
|
109
|
-
element: /* @__PURE__ */ g(
|
|
109
|
+
element: /* @__PURE__ */ g(E, {})
|
|
110
110
|
}),
|
|
111
111
|
/* @__PURE__ */ g(d, {
|
|
112
112
|
path: "connections/:connectionId",
|
|
113
113
|
element: /* @__PURE__ */ g(S, {})
|
|
114
114
|
}),
|
|
115
115
|
/* @__PURE__ */ g(d, {
|
|
116
|
-
path: "
|
|
116
|
+
path: "developer/connectors",
|
|
117
117
|
element: /* @__PURE__ */ g(C, {})
|
|
118
118
|
}),
|
|
119
|
+
/* @__PURE__ */ g(d, {
|
|
120
|
+
path: "logs",
|
|
121
|
+
element: /* @__PURE__ */ g(w, {})
|
|
122
|
+
}),
|
|
119
123
|
/* @__PURE__ */ g(d, {
|
|
120
124
|
path: "*",
|
|
121
125
|
element: /* @__PURE__ */ g(u, {
|
|
@@ -127,6 +131,6 @@ function O() {
|
|
|
127
131
|
}) });
|
|
128
132
|
}
|
|
129
133
|
//#endregion
|
|
130
|
-
export {
|
|
134
|
+
export { k as IntegrationsUserRoutes };
|
|
131
135
|
|
|
132
136
|
//# sourceMappingURL=IntegrationsUserRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsUserRoutes.js","names":[],"sources":["../../src/integrations/IntegrationsUserRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, Component, type ReactNode, type ErrorInfo } from 'react';\nimport { Navigate, Route, Routes, useLocation, useNavigate, useParams } from 'react-router';\nimport { Loader2, AlertTriangle, RefreshCw } from 'lucide-react';\nimport { AddConnectionDialog } from './components/AddConnectionDialog';\nimport { useIntegrations } from './providers/IntegrationsProvider';\nimport { joinPath } from './utils/navigation';\n\n// Eager loaded - primary landing page\nimport { IntegrationsUserLandingPage } from './pages/IntegrationsUserLandingPage';\n\n// Lazy loaded pages\nconst ProviderCatalog = lazy(() =>\n import('./pages/ProviderCatalog').then((m) => ({ default: m.ProviderCatalog }))\n);\nconst ProviderDetail = lazy(() =>\n import('./pages/ProviderDetail').then((m) => ({ default: m.ProviderDetail }))\n);\nconst ConnectionsList = lazy(() =>\n import('./pages/ConnectionsList').then((m) => ({ default: m.ConnectionsList }))\n);\nconst AddConnectionWizard = lazy(() =>\n import('./pages/AddConnectionWizard').then((m) => ({ default: m.AddConnectionWizard }))\n);\nconst ConnectionDetail = lazy(() =>\n import('./pages/ConnectionDetail').then((m) => ({ default: m.ConnectionDetail }))\n);\nconst ConnectionLogs = lazy(() =>\n import('./pages/ConnectionLogs').then((m) => ({ default: m.ConnectionLogs }))\n);\n\nconst BOTLIT_CHANNEL_PROVIDER_KEYS = new Set(['slack-user', 'teams-user', 'discord-user']);\n\n/** Deep links use the same schema-driven dialog as the Connections and provider pages. */\nfunction ConnectionAddRoute() {\n const { basePath } = useIntegrations();\n const { providerId } = useParams<{ providerId: string }>();\n const { search } = useLocation();\n const navigate = useNavigate();\n const params = new URLSearchParams(search);\n const providerKey = params.get('providerKey');\n\n // Botlit's existing channel setup needs its full-page OAuth return redirect.\n // Other deep links (including the FluidGrids channel picker) must honor the\n // shared dialog's provider/method storage policy instead of the old wizard.\n if (\n params.get('returnTo') &&\n params.get('channelId') &&\n providerKey &&\n BOTLIT_CHANNEL_PROVIDER_KEYS.has(providerKey)\n ) {\n return <AddConnectionWizard />;\n }\n\n return (\n <AddConnectionDialog\n open\n onClose={() => navigate(joinPath(basePath ?? '/', 'connections'))}\n preselectedProviderId={providerId}\n preselectedProviderKey={providerKey}\n />\n );\n}\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nclass LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null; retryKey: number }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null, retryKey: 0 };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('[Integrations] Lazy page load failed:', error, errorInfo);\n }\n\n handleRetry = () => {\n // Increment retryKey to force React to remount the lazy tree,\n // which triggers a fresh dynamic import instead of reusing the cached rejection.\n this.setState((prev) => ({ hasError: false, error: null, retryKey: prev.retryKey + 1 }));\n };\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Failed to load page</h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {this.state.error?.message ||\n 'The page chunk could not be loaded. This may be due to a network issue.'}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={this.handleRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <RefreshCw className=\"size-4\" />\n Try Again\n </button>\n </div>\n );\n }\n\n return <div key={this.state.retryKey}>{this.props.children}</div>;\n }\n}\n\n/**\n * User-facing routes for the Integrations microfrontend.\n *\n * Includes: Overview, Providers, Connections, Activity Logs.\n * Excludes admin features: Settings.\n */\nexport function IntegrationsUserRoutes() {\n const { basePath } = useIntegrations();\n const location = useLocation();\n\n const normalizedBasePath =\n basePath && basePath !== '/' ? (basePath.endsWith('/') ? basePath.slice(0, -1) : basePath) : '';\n\n if (normalizedBasePath) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <LazyErrorBoundary>\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route (eager loaded) */}\n <Route index element={<IntegrationsUserLandingPage />} />\n\n {/* Providers (lazy loaded) */}\n <Route path=\"providers\" element={<ProviderCatalog />} />\n <Route path=\"providers/:providerId\" element={<ProviderDetail />} />\n\n {/* Connections (lazy loaded) */}\n <Route path=\"connections\" element={<ConnectionsList />} />\n <Route path=\"connections/add\" element={<ConnectionAddRoute />} />\n <Route path=\"connections/add/:providerId\" element={<ConnectionAddRoute />} />\n <Route path=\"connections/:connectionId\" element={<ConnectionDetail />} />\n\n {/* Logs (lazy loaded) */}\n <Route path=\"logs\" element={<ConnectionLogs />} />\n\n {/* Catch-all route - redirect to overview */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </LazyErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAM,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EACK,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAsB,QAC1B,OAAO,kCAA+B,MAAM,OAAO,EAAE,SAAS,EAAE,qBAAqB,EAAE,CACxF,EACK,IAAmB,QACvB,OAAO,+BAA4B,MAAM,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAClF,EACK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EAEK,IAA+B,IAAI,IAAI;CAAC;CAAc;CAAc;CAAe,CAAC;AAG1F,SAAS,IAAqB;CAC5B,IAAM,EAAE,gBAAa,GAAiB,EAChC,EAAE,kBAAe,GAAmC,EACpD,EAAE,cAAW,GAAa,EAC1B,IAAW,GAAa,EACxB,IAAS,IAAI,gBAAgB,EAAO,EACpC,IAAc,EAAO,I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IntegrationsUserRoutes.js","names":[],"sources":["../../src/integrations/IntegrationsUserRoutes.tsx"],"sourcesContent":["import { lazy, Suspense, Component, type ReactNode, type ErrorInfo } from 'react';\nimport { Navigate, Route, Routes, useLocation, useNavigate, useParams } from 'react-router';\nimport { Loader2, AlertTriangle, RefreshCw } from 'lucide-react';\nimport { AddConnectionDialog } from './components/AddConnectionDialog';\nimport { useIntegrations } from './providers/IntegrationsProvider';\nimport { joinPath } from './utils/navigation';\n\n// Eager loaded - primary landing page\nimport { IntegrationsUserLandingPage } from './pages/IntegrationsUserLandingPage';\n\n// Lazy loaded pages\nconst ProviderCatalog = lazy(() =>\n import('./pages/ProviderCatalog').then((m) => ({ default: m.ProviderCatalog }))\n);\nconst ProviderDetail = lazy(() =>\n import('./pages/ProviderDetail').then((m) => ({ default: m.ProviderDetail }))\n);\nconst ConnectionsList = lazy(() =>\n import('./pages/ConnectionsList').then((m) => ({ default: m.ConnectionsList }))\n);\nconst AddConnectionWizard = lazy(() =>\n import('./pages/AddConnectionWizard').then((m) => ({ default: m.AddConnectionWizard }))\n);\nconst ConnectionDetail = lazy(() =>\n import('./pages/ConnectionDetail').then((m) => ({ default: m.ConnectionDetail }))\n);\nconst ConnectorSubmissionsPage = lazy(() =>\n import('./pages/ConnectorSubmissionsPage').then((m) => ({\n default: m.ConnectorSubmissionsPage,\n }))\n);\nconst ConnectionLogs = lazy(() =>\n import('./pages/ConnectionLogs').then((m) => ({ default: m.ConnectionLogs }))\n);\n\nconst BOTLIT_CHANNEL_PROVIDER_KEYS = new Set(['slack-user', 'teams-user', 'discord-user']);\n\n/** Deep links use the same schema-driven dialog as the Connections and provider pages. */\nfunction ConnectionAddRoute() {\n const { basePath } = useIntegrations();\n const { providerId } = useParams<{ providerId: string }>();\n const { search } = useLocation();\n const navigate = useNavigate();\n const params = new URLSearchParams(search);\n const providerKey = params.get('providerKey');\n\n // Botlit's existing channel setup needs its full-page OAuth return redirect.\n // Other deep links (including the FluidGrids channel picker) must honor the\n // shared dialog's provider/method storage policy instead of the old wizard.\n if (\n params.get('returnTo') &&\n params.get('channelId') &&\n providerKey &&\n BOTLIT_CHANNEL_PROVIDER_KEYS.has(providerKey)\n ) {\n return <AddConnectionWizard />;\n }\n\n return (\n <AddConnectionDialog\n open\n onClose={() => navigate(joinPath(basePath ?? '/', 'connections'))}\n preselectedProviderId={providerId}\n preselectedProviderKey={providerKey}\n />\n );\n}\n\n/**\n * Loading fallback for lazy-loaded pages\n */\nfunction PageLoader() {\n return (\n <div className=\"flex items-center justify-center min-h-[400px]\">\n <Loader2 className=\"size-8 animate-spin text-primary\" />\n </div>\n );\n}\n\n/**\n * Error boundary for lazy-loaded page chunks.\n * Catches chunk-load failures and renders a retry UI instead of an infinite spinner.\n */\nclass LazyErrorBoundary extends Component<\n { children: ReactNode },\n { hasError: boolean; error: Error | null; retryKey: number }\n> {\n constructor(props: { children: ReactNode }) {\n super(props);\n this.state = { hasError: false, error: null, retryKey: 0 };\n }\n\n static getDerivedStateFromError(error: Error) {\n return { hasError: true, error };\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo) {\n console.error('[Integrations] Lazy page load failed:', error, errorInfo);\n }\n\n handleRetry = () => {\n // Increment retryKey to force React to remount the lazy tree,\n // which triggers a fresh dynamic import instead of reusing the cached rejection.\n this.setState((prev) => ({ hasError: false, error: null, retryKey: prev.retryKey + 1 }));\n };\n\n render() {\n if (this.state.hasError) {\n return (\n <div className=\"flex flex-col items-center justify-center min-h-[400px] gap-4 text-center p-6\">\n <div className=\"p-3 rounded-full bg-status-error-bg/10\">\n <AlertTriangle className=\"size-8 text-status-error-text\" />\n </div>\n <div className=\"space-y-2\">\n <h3 className=\"text-lg font-semibold text-text-primary\">Failed to load page</h3>\n <p className=\"text-sm text-text-secondary max-w-md\">\n {this.state.error?.message ||\n 'The page chunk could not be loaded. This may be due to a network issue.'}\n </p>\n </div>\n <button\n type=\"button\"\n onClick={this.handleRetry}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <RefreshCw className=\"size-4\" />\n Try Again\n </button>\n </div>\n );\n }\n\n return <div key={this.state.retryKey}>{this.props.children}</div>;\n }\n}\n\n/**\n * User-facing routes for the Integrations microfrontend.\n *\n * Includes: Overview, Providers, Connections, Activity Logs.\n * Excludes admin features: Settings.\n */\nexport function IntegrationsUserRoutes() {\n const { basePath } = useIntegrations();\n const location = useLocation();\n\n const normalizedBasePath =\n basePath && basePath !== '/' ? (basePath.endsWith('/') ? basePath.slice(0, -1) : basePath) : '';\n\n if (normalizedBasePath) {\n const pathMatches =\n location.pathname === normalizedBasePath ||\n location.pathname.startsWith(normalizedBasePath + '/');\n\n if (!pathMatches) {\n return null;\n }\n }\n\n return (\n <LazyErrorBoundary>\n <Suspense fallback={<PageLoader />}>\n <Routes>\n {/* Tabbed landing - default route (eager loaded) */}\n <Route index element={<IntegrationsUserLandingPage />} />\n\n {/* Providers (lazy loaded) */}\n <Route path=\"providers\" element={<ProviderCatalog />} />\n <Route path=\"providers/:providerId\" element={<ProviderDetail />} />\n\n {/* Connections (lazy loaded) */}\n <Route path=\"connections\" element={<ConnectionsList />} />\n <Route path=\"connections/add\" element={<ConnectionAddRoute />} />\n <Route path=\"connections/add/:providerId\" element={<ConnectionAddRoute />} />\n <Route path=\"connections/:connectionId\" element={<ConnectionDetail />} />\n\n {/* Third-party connector publishing (BOFF-4417) */}\n <Route path=\"developer/connectors\" element={<ConnectorSubmissionsPage />} />\n\n {/* Logs (lazy loaded) */}\n <Route path=\"logs\" element={<ConnectionLogs />} />\n\n {/* Catch-all route - redirect to overview */}\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n </LazyErrorBoundary>\n );\n}\n"],"mappings":";;;;;;;;;AAWA,IAAM,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,I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,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,wEAAwE;IACxE,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;;OAGG;IACH,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,SAAS,CAAC;CACpE;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAIjF;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,YAAuB,EACvB,WAAW,EACX,WAAW,EACX,mBAAmB,GACpB,EAAE,wBAAwB,+
|
|
1
|
+
{"version":3,"file":"AddConnectionDialog.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEpD,OAAO,EAGL,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACvB,MAAM,gCAAgC,CAAC;AAQxC,MAAM,WAAW,wBAAwB;IACvC,iCAAiC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4DAA4D;IAC5D,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,wEAAwE;IACxE,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,yDAAyD;IACzD,mBAAmB,CAAC,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;IACrD;;;OAGG;IACH,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,iFAAiF;IACjF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,uEAAuE;IACvE,mBAAmB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,SAAS,CAAC;CACpE;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAIjF;AAED,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,OAAO,EACP,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,YAAuB,EACvB,WAAW,EACX,WAAW,EACX,mBAAmB,GACpB,EAAE,wBAAwB,+BAsE1B"}
|
|
@@ -12,29 +12,29 @@ function l(e) {
|
|
|
12
12
|
return e ? `${e}/integrations/oauth/callback` : "/integrations/oauth/callback";
|
|
13
13
|
}
|
|
14
14
|
function u({ open: u, onClose: d, preselectedProviderId: f, preselectedProviderKey: p, onConnectionCreated: m, presentation: h = "dialog", pickerTitle: g, extraConfig: _, renderSuccessAction: v }) {
|
|
15
|
-
let y = t(), b = a(), { apiGatewayUrl: x } = e(), { hasPermission:
|
|
15
|
+
let y = t(), b = a(), { apiGatewayUrl: x, defaultConnectionVisibility: S } = e(), { hasPermission: C, isLoading: w } = o(), T = r((e) => e.emit), E = w || C(n.CONNECTION_CREATE), D = !w && C(n.VAULT_CREATE), O = i((e) => {
|
|
16
16
|
switch (e.type) {
|
|
17
17
|
case "connection-created":
|
|
18
|
-
|
|
18
|
+
T("integrations:connection-created", {
|
|
19
19
|
connectionId: e.connectionId,
|
|
20
20
|
providerKey: e.providerKey
|
|
21
21
|
});
|
|
22
22
|
break;
|
|
23
23
|
case "oauth-started":
|
|
24
|
-
|
|
24
|
+
T("integrations:oauth-started", {
|
|
25
25
|
connectionId: e.connectionId,
|
|
26
26
|
providerKey: e.providerKey
|
|
27
27
|
});
|
|
28
28
|
break;
|
|
29
29
|
case "oauth-failed":
|
|
30
|
-
|
|
30
|
+
T("integrations:oauth-failed", {
|
|
31
31
|
connectionId: e.connectionId,
|
|
32
32
|
providerKey: e.providerKey,
|
|
33
33
|
error: e.error
|
|
34
34
|
});
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
}, [
|
|
37
|
+
}, [T]), k = i((e) => m?.(e.id), [m]);
|
|
38
38
|
return /* @__PURE__ */ s(c, {
|
|
39
39
|
open: u,
|
|
40
40
|
onClose: d,
|
|
@@ -45,15 +45,17 @@ function u({ open: u, onClose: d, preselectedProviderId: f, preselectedProviderK
|
|
|
45
45
|
providerKey: p ?? null,
|
|
46
46
|
providerSource: "installed",
|
|
47
47
|
requireVault: !0,
|
|
48
|
-
canCreate:
|
|
49
|
-
canCreateVault:
|
|
48
|
+
canCreate: E,
|
|
49
|
+
canCreateVault: D,
|
|
50
50
|
extraConfig: _,
|
|
51
|
+
showSharingTab: !!S,
|
|
52
|
+
defaultVisibility: S,
|
|
51
53
|
refetchQueriesOnCreate: ["GetConnections"],
|
|
52
54
|
presentation: h,
|
|
53
55
|
pickerTitle: g,
|
|
54
56
|
renderSuccessAction: v,
|
|
55
|
-
onConnectionCreated:
|
|
56
|
-
onEvent:
|
|
57
|
+
onConnectionCreated: k,
|
|
58
|
+
onEvent: O
|
|
57
59
|
});
|
|
58
60
|
}
|
|
59
61
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AddConnectionDialog.js","names":[],"sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"sourcesContent":["/**\n * AddConnectionDialog — \"Add a connection\" for the integrations screens.\n *\n * The dialog is `@burdenoff/fe-libs/connections`' ConnectionDialog, the same\n * one the workflow builder uses for a node's \"New connection\" (BOFF-8174). The\n * two used to be separate implementations and drifted: provider icons\n * (BOFF-8135), Custom OAuth 2.0 credentials and the redirect URL to register\n * (BOFF-8170). This component only supplies what the integrations screens know\n * and the shared dialog cannot: the shell's Apollo client, the gateway's OAuth\n * callback, the translator, this user's permissions, and this module's event\n * bus.\n *\n * Integrations-specific choices:\n * - the picker lists the workspace's installed, enabled providers;\n * - a vault is required, and the dialog offers to create one when allowed;\n * - the host's connection lists refresh after a create.\n */\nimport { useCallback, type ReactNode } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport {\n ConnectionDialog,\n type ConnectionDialogEvent,\n type ConnectionDialogPresentation,\n type CreatedConnection,\n} from '@burdenoff/fe-libs/connections';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { useTr } from '../hooks/useTr';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\n\nexport interface AddConnectionDialogProps {\n /** Whether the dialog is open */\n open: boolean;\n /** Callback to close the dialog */\n onClose: () => void;\n /** Pre-selected provider ID (skips provider picker step) */\n preselectedProviderId?: string | null;\n /** Pre-selected provider key, for links that know a provider by key. */\n preselectedProviderKey?: string | null;\n /** Callback when a connection is successfully created */\n onConnectionCreated?: (connectionId: string) => void;\n /**\n * `dialog` (default): a centred dialog from `sm`. `sheet`: a bottom sheet\n * below `md`, centred from `md` — what `ConnectSourceDialog` uses.\n */\n presentation?: ConnectionDialogPresentation;\n /** Heading while the provider picker shows. Defaults to \"Add new credential\". */\n pickerTitle?: string;\n /**\n * Settings stored on the new connection, e.g. the Botlit channel to return\n * to once OAuth completes.\n */\n extraConfig?: Record<string, unknown>;\n /** Replaces the success panel's button, e.g. \"Link to bot channel\". */\n renderSuccessAction?: (connection: CreatedConnection) => ReactNode;\n}\n\n/** The OAuth callback the gateway serves; providers compare it exactly. */\nexport function oauthCallbackUrl(apiGatewayUrl: string | null | undefined): string {\n return apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : '/integrations/oauth/callback';\n}\n\nexport function AddConnectionDialog({\n open,\n onClose,\n preselectedProviderId,\n preselectedProviderKey,\n onConnectionCreated,\n presentation = 'dialog',\n pickerTitle,\n extraConfig,\n renderSuccessAction,\n}: AddConnectionDialogProps) {\n const tr = useTr();\n const client = useApolloClient();\n const { apiGatewayUrl } = useIntegrations();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const emit = useIntegrationsEventBus((state) => state.emit);\n\n // While permissions load, show the form rather than flashing \"denied\"; the\n // gateway still enforces the grant on create.\n const canCreate = permissionsLoading || hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n // Vaults belong to the security module: creating a connection does not imply\n // being allowed to create one, and offering it would be a button that fails.\n const canCreateVault = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.VAULT_CREATE);\n\n const handleEvent = useCallback(\n (event: ConnectionDialogEvent) => {\n switch (event.type) {\n case 'connection-created':\n emit('integrations:connection-created', {\n connectionId: event.connectionId,\n providerKey: event.providerKey,\n });\n break;\n case 'oauth-started':\n emit('integrations:oauth-started', {\n connectionId: event.connectionId,\n providerKey: event.providerKey,\n });\n break;\n case 'oauth-failed':\n emit('integrations:oauth-failed', {\n connectionId: event.connectionId,\n providerKey: event.providerKey,\n error: event.error,\n });\n break;\n }\n },\n [emit]\n );\n\n const handleCreated = useCallback(\n (connection: CreatedConnection) => onConnectionCreated?.(connection.id),\n [onConnectionCreated]\n );\n\n return (\n <ConnectionDialog\n open={open}\n onClose={onClose}\n client={client}\n callbackUrl={oauthCallbackUrl(apiGatewayUrl)}\n translate={tr}\n providerId={preselectedProviderId ?? null}\n providerKey={preselectedProviderKey ?? null}\n providerSource=\"installed\"\n requireVault\n canCreate={canCreate}\n canCreateVault={canCreateVault}\n extraConfig={extraConfig}\n refetchQueriesOnCreate={['GetConnections']}\n presentation={presentation}\n pickerTitle={pickerTitle}\n renderSuccessAction={renderSuccessAction}\n onConnectionCreated={handleCreated}\n onEvent={handleEvent}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AA4DA,SAAgB,EAAiB,GAAkD;AACjF,QAAO,IACH,GAAG,EAAc,gCACjB;;AAGN,SAAgB,EAAoB,EAClC,SACA,YACA,0BACA,2BACA,wBACA,kBAAe,UACf,gBACA,gBACA,0BAC2B;CAC3B,IAAM,IAAK,GAAO,EACZ,IAAS,GAAiB,EAC1B,EAAE,
|
|
1
|
+
{"version":3,"file":"AddConnectionDialog.js","names":[],"sources":["../../../src/integrations/components/AddConnectionDialog.tsx"],"sourcesContent":["/**\n * AddConnectionDialog — \"Add a connection\" for the integrations screens.\n *\n * The dialog is `@burdenoff/fe-libs/connections`' ConnectionDialog, the same\n * one the workflow builder uses for a node's \"New connection\" (BOFF-8174). The\n * two used to be separate implementations and drifted: provider icons\n * (BOFF-8135), Custom OAuth 2.0 credentials and the redirect URL to register\n * (BOFF-8170). This component only supplies what the integrations screens know\n * and the shared dialog cannot: the shell's Apollo client, the gateway's OAuth\n * callback, the translator, this user's permissions, and this module's event\n * bus.\n *\n * Integrations-specific choices:\n * - the picker lists the workspace's installed, enabled providers;\n * - a vault is required, and the dialog offers to create one when allowed;\n * - the host's connection lists refresh after a create.\n */\nimport { useCallback, type ReactNode } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport {\n ConnectionDialog,\n type ConnectionDialogEvent,\n type ConnectionDialogPresentation,\n type CreatedConnection,\n} from '@burdenoff/fe-libs/connections';\nimport { usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\n\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { useTr } from '../hooks/useTr';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\n\nexport interface AddConnectionDialogProps {\n /** Whether the dialog is open */\n open: boolean;\n /** Callback to close the dialog */\n onClose: () => void;\n /** Pre-selected provider ID (skips provider picker step) */\n preselectedProviderId?: string | null;\n /** Pre-selected provider key, for links that know a provider by key. */\n preselectedProviderKey?: string | null;\n /** Callback when a connection is successfully created */\n onConnectionCreated?: (connectionId: string) => void;\n /**\n * `dialog` (default): a centred dialog from `sm`. `sheet`: a bottom sheet\n * below `md`, centred from `md` — what `ConnectSourceDialog` uses.\n */\n presentation?: ConnectionDialogPresentation;\n /** Heading while the provider picker shows. Defaults to \"Add new credential\". */\n pickerTitle?: string;\n /**\n * Settings stored on the new connection, e.g. the Botlit channel to return\n * to once OAuth completes.\n */\n extraConfig?: Record<string, unknown>;\n /** Replaces the success panel's button, e.g. \"Link to bot channel\". */\n renderSuccessAction?: (connection: CreatedConnection) => ReactNode;\n}\n\n/** The OAuth callback the gateway serves; providers compare it exactly. */\nexport function oauthCallbackUrl(apiGatewayUrl: string | null | undefined): string {\n return apiGatewayUrl\n ? `${apiGatewayUrl}/integrations/oauth/callback`\n : '/integrations/oauth/callback';\n}\n\nexport function AddConnectionDialog({\n open,\n onClose,\n preselectedProviderId,\n preselectedProviderKey,\n onConnectionCreated,\n presentation = 'dialog',\n pickerTitle,\n extraConfig,\n renderSuccessAction,\n}: AddConnectionDialogProps) {\n const tr = useTr();\n const client = useApolloClient();\n const { apiGatewayUrl, defaultConnectionVisibility } = useIntegrations();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const emit = useIntegrationsEventBus((state) => state.emit);\n\n // While permissions load, show the form rather than flashing \"denied\"; the\n // gateway still enforces the grant on create.\n const canCreate = permissionsLoading || hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n // Vaults belong to the security module: creating a connection does not imply\n // being allowed to create one, and offering it would be a button that fails.\n const canCreateVault = !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.VAULT_CREATE);\n\n const handleEvent = useCallback(\n (event: ConnectionDialogEvent) => {\n switch (event.type) {\n case 'connection-created':\n emit('integrations:connection-created', {\n connectionId: event.connectionId,\n providerKey: event.providerKey,\n });\n break;\n case 'oauth-started':\n emit('integrations:oauth-started', {\n connectionId: event.connectionId,\n providerKey: event.providerKey,\n });\n break;\n case 'oauth-failed':\n emit('integrations:oauth-failed', {\n connectionId: event.connectionId,\n providerKey: event.providerKey,\n error: event.error,\n });\n break;\n }\n },\n [emit]\n );\n\n const handleCreated = useCallback(\n (connection: CreatedConnection) => onConnectionCreated?.(connection.id),\n [onConnectionCreated]\n );\n\n return (\n <ConnectionDialog\n open={open}\n onClose={onClose}\n client={client}\n callbackUrl={oauthCallbackUrl(apiGatewayUrl)}\n translate={tr}\n providerId={preselectedProviderId ?? null}\n providerKey={preselectedProviderKey ?? null}\n providerSource=\"installed\"\n requireVault\n canCreate={canCreate}\n canCreateVault={canCreateVault}\n extraConfig={extraConfig}\n showSharingTab={Boolean(defaultConnectionVisibility)}\n defaultVisibility={defaultConnectionVisibility}\n refetchQueriesOnCreate={['GetConnections']}\n presentation={presentation}\n pickerTitle={pickerTitle}\n renderSuccessAction={renderSuccessAction}\n onConnectionCreated={handleCreated}\n onEvent={handleEvent}\n />\n );\n}\n"],"mappings":";;;;;;;;;;AA4DA,SAAgB,EAAiB,GAAkD;AACjF,QAAO,IACH,GAAG,EAAc,gCACjB;;AAGN,SAAgB,EAAoB,EAClC,SACA,YACA,0BACA,2BACA,wBACA,kBAAe,UACf,gBACA,gBACA,0BAC2B;CAC3B,IAAM,IAAK,GAAO,EACZ,IAAS,GAAiB,EAC1B,EAAE,kBAAe,mCAAgC,GAAiB,EAClE,EAAE,kBAAe,WAAW,MAAuB,GAAgB,EACnE,IAAO,GAAyB,MAAU,EAAM,KAAK,EAIrD,IAAY,KAAsB,EAAc,EAAwB,kBAAkB,EAG1F,IAAiB,CAAC,KAAsB,EAAc,EAAwB,aAAa,EAE3F,IAAc,GACjB,MAAiC;AAChC,UAAQ,EAAM,MAAd;GACE,KAAK;AACH,MAAK,mCAAmC;KACtC,cAAc,EAAM;KACpB,aAAa,EAAM;KACpB,CAAC;AACF;GACF,KAAK;AACH,MAAK,8BAA8B;KACjC,cAAc,EAAM;KACpB,aAAa,EAAM;KACpB,CAAC;AACF;GACF,KAAK;AACH,MAAK,6BAA6B;KAChC,cAAc,EAAM;KACpB,aAAa,EAAM;KACnB,OAAO,EAAM;KACd,CAAC;AACF;;IAGN,CAAC,EAAK,CACP,EAEK,IAAgB,GACnB,MAAkC,IAAsB,EAAW,GAAG,EACvE,CAAC,EAAoB,CACtB;AAED,QACE,kBAAC,GAAD;EACQ;EACG;EACD;EACR,aAAa,EAAiB,EAAc;EAC5C,WAAW;EACX,YAAY,KAAyB;EACrC,aAAa,KAA0B;EACvC,gBAAe;EACf,cAAA;EACW;EACK;EACH;EACb,gBAAgB,EAAQ;EACxB,mBAAmB;EACnB,wBAAwB,CAAC,iBAAiB;EAC5B;EACD;EACQ;EACrB,qBAAqB;EACrB,SAAS;EACT,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionCard.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/ConnectionCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAItD,UAAU,mBAAmB;IAC3B,UAAU,EAAE,qBAAqB,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACvD;
|
|
1
|
+
{"version":3,"file":"ConnectionCard.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/ConnectionCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAItD,UAAU,mBAAmB;IAC3B,UAAU,EAAE,qBAAqB,CAAC;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,CAAC,UAAU,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACvD;AAwBD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAmHlD,CAAC"}
|
|
@@ -2,97 +2,120 @@ import { useTr as e } from "../hooks/useTr.js";
|
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { useFormatLastUsed as n } from "../hooks/useFormatLastUsed.js";
|
|
4
4
|
import { ConnectionStatusBadge as r } from "./ConnectionStatusBadge.js";
|
|
5
|
-
import { ChevronRight as i } from "lucide-react";
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { ProviderIcon as
|
|
8
|
-
import { GlassCard as
|
|
5
|
+
import { ChevronRight as i, Lock as a } from "lucide-react";
|
|
6
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { ProviderIcon as l } from "@burdenoff/fe-libs/connections";
|
|
8
|
+
import { GlassCard as u } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
//#region src/integrations/components/ConnectionCard.tsx
|
|
10
|
-
var
|
|
11
|
-
let
|
|
12
|
-
|
|
10
|
+
var d = ({ connection: t }) => {
|
|
11
|
+
let n = e();
|
|
12
|
+
if (t.visibility !== "RESTRICTED") return null;
|
|
13
|
+
let r = n("integrations.connectionCard.private", "Private: only the people it is shared with");
|
|
14
|
+
return /* @__PURE__ */ c("span", {
|
|
15
|
+
className: "inline-flex shrink-0 items-center text-text-secondary",
|
|
16
|
+
title: r,
|
|
17
|
+
"data-testid": "connection-private-badge",
|
|
18
|
+
children: [/* @__PURE__ */ s(a, {
|
|
19
|
+
size: 13,
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}), /* @__PURE__ */ s("span", {
|
|
22
|
+
className: "sr-only",
|
|
23
|
+
children: r
|
|
24
|
+
})]
|
|
25
|
+
});
|
|
26
|
+
}, f = ({ connection: a, displayMode: f = "grid", onClick: p }) => {
|
|
27
|
+
let m = e(), h = n();
|
|
28
|
+
return f === "list" ? /* @__PURE__ */ c(u, {
|
|
13
29
|
className: t("group flex items-center gap-4 p-4 border-border-seam", "cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "animate-in fade-in-0"),
|
|
14
|
-
onClick: () =>
|
|
30
|
+
onClick: () => p?.(a),
|
|
15
31
|
role: "button",
|
|
16
32
|
tabIndex: 0,
|
|
17
33
|
onKeyDown: (e) => {
|
|
18
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
34
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), p?.(a));
|
|
19
35
|
},
|
|
20
36
|
children: [
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
provider:
|
|
37
|
+
/* @__PURE__ */ s(l, {
|
|
38
|
+
provider: a.provider,
|
|
23
39
|
size: 40
|
|
24
40
|
}),
|
|
25
|
-
/* @__PURE__ */
|
|
41
|
+
/* @__PURE__ */ c("div", {
|
|
26
42
|
className: "flex-1 min-w-0",
|
|
27
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ c("div", {
|
|
28
44
|
className: "flex items-center gap-2",
|
|
29
|
-
children: [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ s("h3", {
|
|
47
|
+
className: "font-semibold text-text-primary truncate",
|
|
48
|
+
children: a.name
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ s(d, { connection: a }),
|
|
51
|
+
/* @__PURE__ */ s(r, { status: a.status })
|
|
52
|
+
]
|
|
53
|
+
}), /* @__PURE__ */ c("div", {
|
|
34
54
|
className: "flex items-center gap-2 mt-0.5",
|
|
35
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ s("span", {
|
|
36
56
|
className: "text-sm text-text-secondary",
|
|
37
|
-
children:
|
|
38
|
-
}),
|
|
57
|
+
children: a.provider.name
|
|
58
|
+
}), a.externalAccountEmail && /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("span", {
|
|
39
59
|
className: "text-text-secondary",
|
|
40
60
|
children: "·"
|
|
41
|
-
}), /* @__PURE__ */
|
|
61
|
+
}), /* @__PURE__ */ s("span", {
|
|
42
62
|
className: "text-sm text-text-secondary truncate",
|
|
43
|
-
children:
|
|
63
|
+
children: a.externalAccountEmail
|
|
44
64
|
})] })]
|
|
45
65
|
})]
|
|
46
66
|
}),
|
|
47
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ c("div", {
|
|
48
68
|
className: "flex items-center gap-3 flex-shrink-0",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
69
|
+
children: [/* @__PURE__ */ s("span", {
|
|
50
70
|
className: "text-xs text-text-secondary",
|
|
51
|
-
children:
|
|
52
|
-
}), /* @__PURE__ */
|
|
71
|
+
children: m("integrations.connectionCard.lastUsed", "Last used {{time}}", { time: h(a.lastUsedAt) })
|
|
72
|
+
}), /* @__PURE__ */ s(i, {
|
|
53
73
|
size: 18,
|
|
54
74
|
className: "text-text-secondary group-hover:text-primary transition-colors"
|
|
55
75
|
})]
|
|
56
76
|
})
|
|
57
77
|
]
|
|
58
|
-
}) : /* @__PURE__ */
|
|
78
|
+
}) : /* @__PURE__ */ c(u, {
|
|
59
79
|
className: t("group relative flex flex-col p-5 border-border-seam", "cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", "animate-in fade-in-0"),
|
|
60
|
-
onClick: () =>
|
|
80
|
+
onClick: () => p?.(a),
|
|
61
81
|
role: "button",
|
|
62
82
|
tabIndex: 0,
|
|
63
83
|
onKeyDown: (e) => {
|
|
64
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
84
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), p?.(a));
|
|
65
85
|
},
|
|
66
86
|
children: [
|
|
67
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ c("div", {
|
|
68
88
|
className: "flex items-start justify-between mb-3",
|
|
69
|
-
children: [/* @__PURE__ */
|
|
70
|
-
provider:
|
|
89
|
+
children: [/* @__PURE__ */ s(l, {
|
|
90
|
+
provider: a.provider,
|
|
71
91
|
size: 44
|
|
72
|
-
}), /* @__PURE__ */
|
|
92
|
+
}), /* @__PURE__ */ s(r, { status: a.status })]
|
|
73
93
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
className: "
|
|
76
|
-
children:
|
|
94
|
+
/* @__PURE__ */ c("div", {
|
|
95
|
+
className: "mb-0.5 flex items-center gap-1.5",
|
|
96
|
+
children: [/* @__PURE__ */ s("h3", {
|
|
97
|
+
className: "font-semibold text-text-primary truncate",
|
|
98
|
+
children: a.name
|
|
99
|
+
}), /* @__PURE__ */ s(d, { connection: a })]
|
|
77
100
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ s("p", {
|
|
79
102
|
className: "text-sm text-text-secondary truncate",
|
|
80
|
-
children:
|
|
103
|
+
children: a.provider.name
|
|
81
104
|
}),
|
|
82
|
-
|
|
105
|
+
a.externalAccountEmail && /* @__PURE__ */ s("p", {
|
|
83
106
|
className: "text-xs text-text-secondary truncate mt-1",
|
|
84
|
-
children:
|
|
107
|
+
children: a.externalAccountName || a.externalAccountEmail
|
|
85
108
|
}),
|
|
86
|
-
|
|
109
|
+
a.description && /* @__PURE__ */ s("p", {
|
|
87
110
|
className: "text-sm text-text-secondary line-clamp-2 mt-2",
|
|
88
|
-
children:
|
|
111
|
+
children: a.description
|
|
89
112
|
}),
|
|
90
|
-
/* @__PURE__ */
|
|
113
|
+
/* @__PURE__ */ c("div", {
|
|
91
114
|
className: "flex items-center justify-between mt-auto pt-3 border-t border-border-seam",
|
|
92
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ s("span", {
|
|
93
116
|
className: "text-xs text-text-secondary",
|
|
94
|
-
children:
|
|
95
|
-
}), /* @__PURE__ */
|
|
117
|
+
children: m("integrations.connectionCard.lastUsed", "Last used {{time}}", { time: h(a.lastUsedAt) })
|
|
118
|
+
}), /* @__PURE__ */ s(i, {
|
|
96
119
|
size: 16,
|
|
97
120
|
className: "text-text-secondary group-hover:text-primary transition-colors"
|
|
98
121
|
})]
|
|
@@ -101,6 +124,6 @@ var u = ({ connection: u, displayMode: d = "grid", onClick: f }) => {
|
|
|
101
124
|
});
|
|
102
125
|
};
|
|
103
126
|
//#endregion
|
|
104
|
-
export {
|
|
127
|
+
export { f as ConnectionCard };
|
|
105
128
|
|
|
106
129
|
//# sourceMappingURL=ConnectionCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionCard.js","names":[],"sources":["../../../src/integrations/components/ConnectionCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { ChevronRight } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../hooks/useTr';\nimport { useFormatLastUsed } from '../hooks/useFormatLastUsed';\nimport type { IntegrationConnection } from '../types';\nimport { ProviderIcon } from '@burdenoff/fe-libs/connections';\nimport { ConnectionStatusBadge } from './ConnectionStatusBadge';\n\ninterface ConnectionCardProps {\n connection: IntegrationConnection;\n displayMode?: 'grid' | 'list';\n onClick?: (connection: IntegrationConnection) => void;\n}\n\n/**\n * Card showing connection info (provider icon, connection name, account email, status badge, last used).\n */\nexport const ConnectionCard: FC<ConnectionCardProps> = ({\n connection,\n displayMode = 'grid',\n onClick,\n}) => {\n const tr = useTr();\n const formatLastUsed = useFormatLastUsed();\n\n if (displayMode === 'list') {\n return (\n <GlassCard\n className={cn(\n 'group flex items-center gap-4 p-4 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(connection)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(connection);\n }\n }}\n >\n <ProviderIcon provider={connection.provider} size={40} />\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary truncate\">{connection.name}</h3>\n <ConnectionStatusBadge status={connection.status} />\n </div>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <span className=\"text-sm text-text-secondary\">{connection.provider.name}</span>\n {connection.externalAccountEmail && (\n <>\n <span className=\"text-text-secondary\">·</span>\n <span className=\"text-sm text-text-secondary truncate\">\n {connection.externalAccountEmail}\n </span>\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-3 flex-shrink-0\">\n <span className=\"text-xs text-text-secondary\">\n {tr('integrations.connectionCard.lastUsed', 'Last used {{time}}', {\n time: formatLastUsed(connection.lastUsedAt),\n })}\n </span>\n <ChevronRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </div>\n </GlassCard>\n );\n }\n\n return (\n <GlassCard\n className={cn(\n 'group relative flex flex-col p-5 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(connection)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(connection);\n }\n }}\n >\n <div className=\"flex items-start justify-between mb-3\">\n <ProviderIcon provider={connection.provider} size={44} />\n <ConnectionStatusBadge status={connection.status} />\n </div>\n\n <h3 className=\"font-semibold text-text-primary
|
|
1
|
+
{"version":3,"file":"ConnectionCard.js","names":[],"sources":["../../../src/integrations/components/ConnectionCard.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { ChevronRight, Lock } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { useTr } from '../hooks/useTr';\nimport { useFormatLastUsed } from '../hooks/useFormatLastUsed';\nimport type { IntegrationConnection } from '../types';\nimport { ProviderIcon } from '@burdenoff/fe-libs/connections';\nimport { ConnectionStatusBadge } from './ConnectionStatusBadge';\n\ninterface ConnectionCardProps {\n connection: IntegrationConnection;\n displayMode?: 'grid' | 'list';\n onClick?: (connection: IntegrationConnection) => void;\n}\n\n/**\n * A lock for a connection only the people it is shared with can use (BOFF-9726).\n */\nconst PrivateBadge: FC<{ connection: IntegrationConnection }> = ({ connection }) => {\n const tr = useTr();\n if (connection.visibility !== 'RESTRICTED') return null;\n const label = tr(\n 'integrations.connectionCard.private',\n 'Private: only the people it is shared with'\n );\n return (\n <span\n className=\"inline-flex shrink-0 items-center text-text-secondary\"\n title={label}\n data-testid=\"connection-private-badge\"\n >\n <Lock size={13} aria-hidden=\"true\" />\n <span className=\"sr-only\">{label}</span>\n </span>\n );\n};\n\n/**\n * Card showing connection info (provider icon, connection name, account email, status badge, last used).\n */\nexport const ConnectionCard: FC<ConnectionCardProps> = ({\n connection,\n displayMode = 'grid',\n onClick,\n}) => {\n const tr = useTr();\n const formatLastUsed = useFormatLastUsed();\n\n if (displayMode === 'list') {\n return (\n <GlassCard\n className={cn(\n 'group flex items-center gap-4 p-4 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(connection)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(connection);\n }\n }}\n >\n <ProviderIcon provider={connection.provider} size={40} />\n\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary truncate\">{connection.name}</h3>\n <PrivateBadge connection={connection} />\n <ConnectionStatusBadge status={connection.status} />\n </div>\n <div className=\"flex items-center gap-2 mt-0.5\">\n <span className=\"text-sm text-text-secondary\">{connection.provider.name}</span>\n {connection.externalAccountEmail && (\n <>\n <span className=\"text-text-secondary\">·</span>\n <span className=\"text-sm text-text-secondary truncate\">\n {connection.externalAccountEmail}\n </span>\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex items-center gap-3 flex-shrink-0\">\n <span className=\"text-xs text-text-secondary\">\n {tr('integrations.connectionCard.lastUsed', 'Last used {{time}}', {\n time: formatLastUsed(connection.lastUsedAt),\n })}\n </span>\n <ChevronRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </div>\n </GlassCard>\n );\n }\n\n return (\n <GlassCard\n className={cn(\n 'group relative flex flex-col p-5 border-border-seam',\n 'cursor-pointer hover:shadow-[var(--shadow-pop)] hover:border-border-strong',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n 'animate-in fade-in-0'\n )}\n onClick={() => onClick?.(connection)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(connection);\n }\n }}\n >\n <div className=\"flex items-start justify-between mb-3\">\n <ProviderIcon provider={connection.provider} size={44} />\n <ConnectionStatusBadge status={connection.status} />\n </div>\n\n <div className=\"mb-0.5 flex items-center gap-1.5\">\n <h3 className=\"font-semibold text-text-primary truncate\">{connection.name}</h3>\n <PrivateBadge connection={connection} />\n </div>\n <p className=\"text-sm text-text-secondary truncate\">{connection.provider.name}</p>\n\n {connection.externalAccountEmail && (\n <p className=\"text-xs text-text-secondary truncate mt-1\">\n {connection.externalAccountName || connection.externalAccountEmail}\n </p>\n )}\n\n {connection.description && (\n <p className=\"text-sm text-text-secondary line-clamp-2 mt-2\">{connection.description}</p>\n )}\n\n <div className=\"flex items-center justify-between mt-auto pt-3 border-t border-border-seam\">\n <span className=\"text-xs text-text-secondary\">\n {tr('integrations.connectionCard.lastUsed', 'Last used {{time}}', {\n time: formatLastUsed(connection.lastUsedAt),\n })}\n </span>\n <ChevronRight\n size={16}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;;;;AAmBA,IAAM,KAA2D,EAAE,oBAAiB;CAClF,IAAM,IAAK,GAAO;AAClB,KAAI,EAAW,eAAe,aAAc,QAAO;CACnD,IAAM,IAAQ,EACZ,uCACA,6CACD;AACD,QACE,kBAAC,QAAD;EACE,WAAU;EACV,OAAO;EACP,eAAY;YAHd,CAKE,kBAAC,GAAD;GAAM,MAAM;GAAI,eAAY;GAAS,CAAA,EACrC,kBAAC,QAAD;GAAM,WAAU;aAAW;GAAa,CAAA,CACnC;;GAOE,KAA2C,EACtD,eACA,iBAAc,QACd,iBACI;CACJ,IAAM,IAAK,GAAO,EACZ,IAAiB,GAAmB;AAyD1C,QAvDI,MAAgB,SAEhB,kBAAC,GAAD;EACE,WAAW,EACT,wDACA,8EACA,gGACA,uBACD;EACD,eAAe,IAAU,EAAW;EACpC,MAAK;EACL,UAAU;EACV,YAAY,MAAM;AAChB,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,IAAU,EAAW;;YAb3B;GAiBE,kBAAC,GAAD;IAAc,UAAU,EAAW;IAAU,MAAM;IAAM,CAAA;GAEzD,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,MAAD;OAAI,WAAU;iBAA4C,EAAW;OAAU,CAAA;MAC/E,kBAAC,GAAD,EA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V,kBAAC,KAAD;IAAG,WAAU;cAAiD,EAAW;IAAgB,CAAA;GAG3F,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAG,wCAAwC,sBAAsB,EAChE,MAAM,EAAe,EAAW,WAAW,EAC5C,CAAC;KACG,CAAA,EACP,kBAAC,GAAD;KACE,MAAM;KACN,WAAU;KACV,CAAA,CACE;;GACI"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { IntegrationConnection } from '../types';
|
|
3
|
+
|
|
4
|
+
/** Marks a connection only the people it is shared with can use. */
|
|
5
|
+
export declare const PrivateConnectionBadge: FC<{
|
|
6
|
+
connection: IntegrationConnection;
|
|
7
|
+
}>;
|
|
8
|
+
/**
|
|
9
|
+
* The Share dialog for one connection, against the host's Apollo client and
|
|
10
|
+
* workspace. Renders nothing until the workspace is known.
|
|
11
|
+
*/
|
|
12
|
+
export declare const ConnectionShareDialog: FC<{
|
|
13
|
+
connection: IntegrationConnection;
|
|
14
|
+
open: boolean;
|
|
15
|
+
onClose: () => void;
|
|
16
|
+
onShared: () => void;
|
|
17
|
+
}>;
|
|
18
|
+
//# sourceMappingURL=ConnectionSharing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionSharing.d.ts","sourceRoot":"","sources":["../../../src/integrations/components/ConnectionSharing.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAOhC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD,oEAAoE;AACpE,eAAO,MAAM,sBAAsB,EAAE,EAAE,CAAC;IAAE,UAAU,EAAE,qBAAqB,CAAA;CAAE,CAc5E,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC;IACrC,UAAU,EAAE,qBAAqB,CAAC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAgBA,CAAC"}
|