@burdenoff/microfe-integrations 2026.624.2 → 2026.624.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/integrations/components/ConfirmDialog.js +30 -43
- package/dist/integrations/components/ConfirmDialog.js.map +1 -1
- package/dist/integrations/pages/ConnectionDetail.js +223 -229
- package/dist/integrations/pages/ConnectionDetail.js.map +1 -1
- package/dist/integrations/pages/IntegrationsOverview.js +2 -2
- package/dist/integrations/pages/IntegrationsOverview.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,55 +1,42 @@
|
|
|
1
1
|
import { Loader2 as e } from "lucide-react";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { AlertDialog as r, AlertDialogAction as i, AlertDialogCancel as a, AlertDialogContent as o, AlertDialogDescription as s, AlertDialogFooter as c, AlertDialogHeader as l, AlertDialogTitle as u } from "@burdenoff/fe-libs/ui";
|
|
3
4
|
//#region src/integrations/components/ConfirmDialog.tsx
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
e.target === e.currentTarget && f();
|
|
5
|
+
function d({ open: d, title: f, description: p, confirmLabel: m, cancelLabel: h, loading: g = !1, destructive: _ = !1, icon: v, onConfirm: y, onCancel: b }) {
|
|
6
|
+
return /* @__PURE__ */ t(r, {
|
|
7
|
+
open: d,
|
|
8
|
+
onOpenChange: (e) => {
|
|
9
|
+
e || b();
|
|
10
10
|
},
|
|
11
|
-
children: /* @__PURE__ */ n(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"aria-labelledby": "integrations-confirm-title",
|
|
15
|
-
"aria-describedby": "integrations-confirm-description",
|
|
16
|
-
className: "w-full max-w-md rounded-xl border border-border-subtle bg-bg-surface p-6 shadow-2xl space-y-4",
|
|
17
|
-
children: [/* @__PURE__ */ n("div", {
|
|
11
|
+
children: /* @__PURE__ */ n(o, {
|
|
12
|
+
className: "max-w-md",
|
|
13
|
+
children: [/* @__PURE__ */ t(l, { children: /* @__PURE__ */ n("div", {
|
|
18
14
|
className: "flex items-start gap-3",
|
|
19
|
-
children: [
|
|
15
|
+
children: [v && /* @__PURE__ */ t("div", {
|
|
20
16
|
className: "mt-0.5 text-primary",
|
|
21
|
-
children:
|
|
22
|
-
}), /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
children: i
|
|
26
|
-
}), /* @__PURE__ */ t("p", {
|
|
27
|
-
id: "integrations-confirm-description",
|
|
28
|
-
className: "text-sm text-text-secondary mt-1",
|
|
29
|
-
children: a
|
|
17
|
+
children: v
|
|
18
|
+
}), /* @__PURE__ */ n("div", { children: [/* @__PURE__ */ t(u, { children: f }), /* @__PURE__ */ t(s, {
|
|
19
|
+
className: "mt-1",
|
|
20
|
+
children: p
|
|
30
21
|
})] })]
|
|
31
|
-
}), /* @__PURE__ */ n(
|
|
32
|
-
|
|
33
|
-
children:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
className:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
className: "animate-spin"
|
|
46
|
-
}), o]
|
|
47
|
-
})]
|
|
48
|
-
})]
|
|
22
|
+
}) }), /* @__PURE__ */ n(c, { children: [/* @__PURE__ */ t(a, {
|
|
23
|
+
onClick: b,
|
|
24
|
+
children: h
|
|
25
|
+
}), /* @__PURE__ */ n(i, {
|
|
26
|
+
disabled: g,
|
|
27
|
+
onClick: (e) => {
|
|
28
|
+
e.preventDefault(), y();
|
|
29
|
+
},
|
|
30
|
+
className: _ ? "inline-flex items-center gap-2 bg-status-error-bg text-action-primary-text disabled:opacity-50" : "inline-flex items-center gap-2 disabled:opacity-50",
|
|
31
|
+
children: [g && /* @__PURE__ */ t(e, {
|
|
32
|
+
size: 14,
|
|
33
|
+
className: "animate-spin"
|
|
34
|
+
}), m]
|
|
35
|
+
})] })]
|
|
49
36
|
})
|
|
50
|
-
})
|
|
37
|
+
});
|
|
51
38
|
}
|
|
52
39
|
//#endregion
|
|
53
|
-
export {
|
|
40
|
+
export { d as ConfirmDialog };
|
|
54
41
|
|
|
55
42
|
//# sourceMappingURL=ConfirmDialog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../src/integrations/components/ConfirmDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Loader2 } from 'lucide-react';\n\ninterface ConfirmDialogProps {\n open: boolean;\n title: string;\n description: string;\n confirmLabel: string;\n cancelLabel: string;\n loading?: boolean;\n destructive?: boolean;\n icon?: ReactNode;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport function ConfirmDialog({\n open,\n title,\n description,\n confirmLabel,\n cancelLabel,\n loading = false,\n destructive = false,\n icon,\n onConfirm,\n onCancel,\n}: ConfirmDialogProps) {\n
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../src/integrations/components/ConfirmDialog.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport { Loader2 } from 'lucide-react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@burdenoff/fe-libs/ui';\n\ninterface ConfirmDialogProps {\n open: boolean;\n title: string;\n description: string;\n confirmLabel: string;\n cancelLabel: string;\n loading?: boolean;\n destructive?: boolean;\n icon?: ReactNode;\n onConfirm: () => void;\n onCancel: () => void;\n}\n\nexport function ConfirmDialog({\n open,\n title,\n description,\n confirmLabel,\n cancelLabel,\n loading = false,\n destructive = false,\n icon,\n onConfirm,\n onCancel,\n}: ConfirmDialogProps) {\n return (\n <AlertDialog\n open={open}\n onOpenChange={(next) => {\n if (!next) {\n onCancel();\n }\n }}\n >\n <AlertDialogContent className=\"max-w-md\">\n <AlertDialogHeader>\n <div className=\"flex items-start gap-3\">\n {icon && <div className=\"mt-0.5 text-primary\">{icon}</div>}\n <div>\n <AlertDialogTitle>{title}</AlertDialogTitle>\n <AlertDialogDescription className=\"mt-1\">{description}</AlertDialogDescription>\n </div>\n </div>\n </AlertDialogHeader>\n\n <AlertDialogFooter>\n <AlertDialogCancel onClick={onCancel}>{cancelLabel}</AlertDialogCancel>\n <AlertDialogAction\n disabled={loading}\n onClick={(event) => {\n // Keep the dialog open while the confirm callback runs; the\n // caller controls `open` and closes it once the action resolves.\n event.preventDefault();\n onConfirm();\n }}\n className={\n destructive\n ? 'inline-flex items-center gap-2 bg-status-error-bg text-action-primary-text disabled:opacity-50'\n : 'inline-flex items-center gap-2 disabled:opacity-50'\n }\n >\n {loading && <Loader2 size={14} className=\"animate-spin\" />}\n {confirmLabel}\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n}\n"],"mappings":";;;;AA0BA,SAAgB,EAAc,EAC5B,SACA,UACA,gBACA,iBACA,gBACA,aAAU,IACV,iBAAc,IACd,SACA,cACA,eACqB;AACrB,QACE,kBAAC,GAAD;EACQ;EACN,eAAe,MAAS;AACtB,GAAK,KACH,GAAU;;YAId,kBAAC,GAAD;GAAoB,WAAU;aAA9B,CACE,kBAAC,GAAD,EAAA,UACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KAAQ,kBAAC,OAAD;KAAK,WAAU;eAAuB;KAAW,CAAA,EAC1D,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAmB,GAAyB,CAAA,EAC5C,kBAAC,GAAD;KAAwB,WAAU;eAAQ;KAAqC,CAAA,CAC3E,EAAA,CAAA,CACF;OACY,CAAA,EAEpB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;IAAmB,SAAS;cAAW;IAAgC,CAAA,EACvE,kBAAC,GAAD;IACE,UAAU;IACV,UAAU,MAAU;AAIlB,KADA,EAAM,gBAAgB,EACtB,GAAW;;IAEb,WACE,IACI,mGACA;cAXR,CAcG,KAAW,kBAAC,GAAD;KAAS,MAAM;KAAI,WAAU;KAAiB,CAAA,EACzD,EACiB;MACF,EAAA,CAAA,CACD;;EACT,CAAA"}
|
|
@@ -2,77 +2,78 @@ import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
|
|
|
2
2
|
import { cn as t } from "../utils/cn.js";
|
|
3
3
|
import { INTEGRATION_PERMISSIONS as n } from "../constants/permissions.js";
|
|
4
4
|
import { joinPath as r } from "../utils/navigation.js";
|
|
5
|
-
import { formatDate as i, formatLastUsed as
|
|
6
|
-
import { useConnection as
|
|
7
|
-
import { ProviderIcon as
|
|
8
|
-
import { ConnectionStatusBadge as
|
|
5
|
+
import { formatDate as i, formatLastUsed as ee, getAuthTypeLabel as te } from "../utils/integrationsHelpers.js";
|
|
6
|
+
import { useConnection as ne, useDeleteConnection as re, useRefreshToken as ie, useRevokeConnection as a, useTestConnection as o } from "../hooks/useConnections.js";
|
|
7
|
+
import { ProviderIcon as s } from "../components/ProviderIcon.js";
|
|
8
|
+
import { ConnectionStatusBadge as c } from "../components/ConnectionStatusBadge.js";
|
|
9
9
|
import { INTEGRATION_FEATURE_FLAGS as ae } from "../constants/featureFlags.js";
|
|
10
10
|
import { ConfirmDialog as oe } from "../components/ConfirmDialog.js";
|
|
11
11
|
import { nativeConfirm as se, nativeImpact as ce, nativeNotify as l } from "../../utils/nativeBridge.js";
|
|
12
12
|
import { useState as u } from "react";
|
|
13
|
-
import { Activity as
|
|
14
|
-
import { useParams as
|
|
15
|
-
import { useI18n as
|
|
16
|
-
import { jsx as
|
|
17
|
-
import { useFeatureFlag as
|
|
13
|
+
import { Activity as le, AlertCircle as ue, ArrowLeft as d, CheckCircle2 as f, Clock as de, Key as p, Loader2 as m, Mail as fe, RefreshCw as pe, RotateCcw as h, Shield as g, Trash2 as _, User as me, XCircle as v, Zap as he } from "lucide-react";
|
|
14
|
+
import { useParams as ge } from "react-router-dom";
|
|
15
|
+
import { useI18n as _e, usePermissions as ve } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
16
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
17
|
+
import { useFeatureFlag as ye } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
18
|
+
import { AlertDialog as be, AlertDialogAction as xe, AlertDialogCancel as x, AlertDialogContent as S, AlertDialogDescription as C, AlertDialogFooter as w, AlertDialogHeader as T, AlertDialogTitle as E } from "@burdenoff/fe-libs/ui";
|
|
18
19
|
//#region src/integrations/pages/ConnectionDetail.tsx
|
|
19
|
-
function
|
|
20
|
-
let { connectionId:
|
|
21
|
-
let r =
|
|
20
|
+
function D() {
|
|
21
|
+
let { connectionId: D } = ge(), { basePath: O = "/", navigate: k } = e(), { t: A } = _e(), j = (e, t, n) => {
|
|
22
|
+
let r = A(e, n);
|
|
22
23
|
return r === e ? n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)).replace(`{${t}}`, String(n)), t) : t : r;
|
|
23
|
-
}, { connection:
|
|
24
|
-
|
|
24
|
+
}, { connection: M, loading: Se, error: N, refetch: P } = ne(D ?? ""), { testConnection: Ce, loading: F } = o(), { refreshToken: we, loading: I } = ie(), { revokeConnection: Te, loading: L } = a(), { deleteConnection: R, loading: z } = re(), Ee = ye(ae.OAUTH_REFRESH, !0), { hasPermission: B, isLoading: De } = ve(), V = B(n.CONNECTION_UPDATE), H = B(n.CONNECTION_DELETE), [U, Oe] = u(null), [W, G] = u(null), [ke, K] = u(!1), [q, J] = u(!1), [Ae, Y] = u(!1), X = (e, t) => {
|
|
25
|
+
G({
|
|
25
26
|
type: e,
|
|
26
27
|
message: t
|
|
27
|
-
}), setTimeout(() =>
|
|
28
|
+
}), setTimeout(() => G(null), 5e3);
|
|
28
29
|
};
|
|
29
|
-
if (
|
|
30
|
+
if (Se || De) return /* @__PURE__ */ b("div", {
|
|
30
31
|
className: "flex flex-col items-center justify-center py-20",
|
|
31
|
-
children: [/* @__PURE__ */
|
|
32
|
+
children: [/* @__PURE__ */ y(m, {
|
|
32
33
|
size: 48,
|
|
33
34
|
className: "animate-spin text-primary"
|
|
34
|
-
}), /* @__PURE__ */
|
|
35
|
+
}), /* @__PURE__ */ y("span", {
|
|
35
36
|
className: "mt-6 text-sm font-medium text-text-secondary",
|
|
36
|
-
children:
|
|
37
|
+
children: j("integrations.connectionDetail.loading", "Loading connection details...")
|
|
37
38
|
})]
|
|
38
39
|
});
|
|
39
|
-
if (
|
|
40
|
+
if (N || !M) return /* @__PURE__ */ y("div", {
|
|
40
41
|
className: "p-6 max-w-4xl mx-auto",
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
+
children: /* @__PURE__ */ b("div", {
|
|
42
43
|
className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-6 flex items-start gap-4",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
44
|
+
children: [/* @__PURE__ */ y(ue, {
|
|
44
45
|
size: 24,
|
|
45
46
|
className: "text-status-error-text flex-shrink-0"
|
|
46
|
-
}), /* @__PURE__ */
|
|
47
|
+
}), /* @__PURE__ */ b("div", {
|
|
47
48
|
className: "flex-1",
|
|
48
49
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
+
/* @__PURE__ */ y("h3", {
|
|
50
51
|
className: "font-semibold text-status-error-text mb-1",
|
|
51
|
-
children:
|
|
52
|
+
children: j("integrations.connectionDetail.error.title", "Connection not found")
|
|
52
53
|
}),
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
+
/* @__PURE__ */ y("p", {
|
|
54
55
|
className: "text-sm text-status-error-text mb-3",
|
|
55
|
-
children:
|
|
56
|
+
children: N?.message || j("integrations.connectionDetail.error.description", "The requested connection could not be loaded.")
|
|
56
57
|
}),
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ b("div", {
|
|
58
59
|
className: "flex gap-2",
|
|
59
|
-
children: [/* @__PURE__ */
|
|
60
|
+
children: [/* @__PURE__ */ b("button", {
|
|
60
61
|
type: "button",
|
|
61
|
-
onClick: () =>
|
|
62
|
+
onClick: () => P(),
|
|
62
63
|
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",
|
|
63
64
|
children: [
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
+
/* @__PURE__ */ y(pe, { size: 14 }),
|
|
65
66
|
" ",
|
|
66
|
-
|
|
67
|
+
j("integrations.connectionDetail.error.retry", "Try Again")
|
|
67
68
|
]
|
|
68
|
-
}), /* @__PURE__ */
|
|
69
|
+
}), /* @__PURE__ */ b("button", {
|
|
69
70
|
type: "button",
|
|
70
|
-
onClick: () =>
|
|
71
|
+
onClick: () => k?.(r(O, "connections")),
|
|
71
72
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors",
|
|
72
73
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ y(d, { size: 14 }),
|
|
74
75
|
" ",
|
|
75
|
-
|
|
76
|
+
j("integrations.connectionDetail.error.back", "Back to Connections")
|
|
76
77
|
]
|
|
77
78
|
})]
|
|
78
79
|
})
|
|
@@ -80,387 +81,380 @@ function C() {
|
|
|
80
81
|
})]
|
|
81
82
|
})
|
|
82
83
|
});
|
|
83
|
-
let
|
|
84
|
-
let e = await M
|
|
85
|
-
e && (
|
|
86
|
-
},
|
|
87
|
-
await
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
},
|
|
91
|
-
await
|
|
92
|
-
},
|
|
84
|
+
let je = async () => {
|
|
85
|
+
let e = await Ce(M.id);
|
|
86
|
+
e && (Oe(e), X(e.success ? "success" : "error", e.message));
|
|
87
|
+
}, Me = async () => {
|
|
88
|
+
await we(M.id), X("success", j("integrations.connectionDetail.notifications.refreshSuccess", "Token refreshed successfully")), P();
|
|
89
|
+
}, Ne = async () => {
|
|
90
|
+
Y(!0);
|
|
91
|
+
}, Pe = async () => {
|
|
92
|
+
await Te(M.id), X("success", j("integrations.connectionDetail.notifications.revokeSuccess", "Connection revoked")), Y(!1), P();
|
|
93
|
+
}, Fe = async () => {
|
|
93
94
|
ce("medium");
|
|
94
95
|
let e = await se({
|
|
95
|
-
title:
|
|
96
|
-
message:
|
|
97
|
-
okButtonTitle:
|
|
98
|
-
cancelButtonTitle:
|
|
96
|
+
title: j("integrations.connectionDetail.deleteDialog.title", "Delete Connection"),
|
|
97
|
+
message: j("integrations.connectionDetail.deleteDialog.message", "Delete this connection? This cannot be undone."),
|
|
98
|
+
okButtonTitle: j("integrations.connectionDetail.deleteDialog.confirm", "Delete"),
|
|
99
|
+
cancelButtonTitle: j("integrations.connectionDetail.deleteDialog.cancel", "Cancel")
|
|
99
100
|
});
|
|
100
101
|
if (e === null) {
|
|
101
|
-
|
|
102
|
+
K(!0);
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
e && await Z();
|
|
105
106
|
}, Z = async () => {
|
|
106
107
|
try {
|
|
107
|
-
await
|
|
108
|
+
await R(M.id, q), X("success", j("integrations.connectionDetail.notifications.deleteSuccess", "Connection deleted")), l("success"), K(!1), J(!1), k?.(r(O, "connections"));
|
|
108
109
|
} catch (e) {
|
|
109
|
-
|
|
110
|
+
X("error", e instanceof Error ? e.message : "Failed to delete connection"), l("error");
|
|
110
111
|
}
|
|
111
|
-
}, Q =
|
|
112
|
-
return /* @__PURE__ */
|
|
112
|
+
}, Q = F || I || L || z, $ = !!(M.vaultId || M.credentialSecretId);
|
|
113
|
+
return /* @__PURE__ */ b("div", {
|
|
113
114
|
className: "space-y-6 p-6 max-w-5xl mx-auto",
|
|
114
115
|
children: [
|
|
115
|
-
|
|
116
|
-
className: t("fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-
|
|
117
|
-
children: [
|
|
116
|
+
W && /* @__PURE__ */ b("div", {
|
|
117
|
+
className: t("fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200", W.type === "success" ? "bg-status-success-bg-subtle text-status-success-text border-border-default" : "bg-status-error-bg-subtle text-status-error-text border-border-default"),
|
|
118
|
+
children: [W.type === "success" ? /* @__PURE__ */ y(f, { size: 20 }) : /* @__PURE__ */ y(v, { size: 20 }), /* @__PURE__ */ y("span", {
|
|
118
119
|
className: "font-medium",
|
|
119
|
-
children:
|
|
120
|
+
children: W.message
|
|
120
121
|
})]
|
|
121
122
|
}),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
/* @__PURE__ */ y(be, {
|
|
124
|
+
open: ke,
|
|
125
|
+
onOpenChange: (e) => {
|
|
126
|
+
e || (K(!1), J(!1));
|
|
127
|
+
},
|
|
128
|
+
children: /* @__PURE__ */ b(S, {
|
|
129
|
+
className: "max-w-md",
|
|
126
130
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
-
|
|
129
|
-
children: "Delete connection"
|
|
130
|
-
}), /* @__PURE__ */ x("p", {
|
|
131
|
-
className: "text-sm text-text-secondary mt-1",
|
|
132
|
-
children: "This removes the connection record immediately. You can also remove the mapped vault secret if you no longer need it."
|
|
133
|
-
})] }),
|
|
134
|
-
$ && /* @__PURE__ */ S("label", {
|
|
131
|
+
/* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(E, { children: "Delete connection" }), /* @__PURE__ */ y(C, { children: "This removes the connection record immediately. You can also remove the mapped vault secret if you no longer need it." })] }),
|
|
132
|
+
$ && /* @__PURE__ */ b("label", {
|
|
135
133
|
className: "flex items-start gap-3 rounded-lg border border-border-subtle/60 bg-bg-surface px-4 py-3 cursor-pointer",
|
|
136
|
-
children: [/* @__PURE__ */
|
|
134
|
+
children: [/* @__PURE__ */ y("input", {
|
|
137
135
|
type: "checkbox",
|
|
138
|
-
checked:
|
|
139
|
-
onChange: (e) =>
|
|
136
|
+
checked: q,
|
|
137
|
+
onChange: (e) => J(e.target.checked),
|
|
140
138
|
className: "mt-0.5",
|
|
141
139
|
"aria-label": "Also remove mapped vault secret"
|
|
142
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
143
141
|
className: "text-sm font-medium text-text-primary",
|
|
144
142
|
children: "Also remove mapped vault secret"
|
|
145
|
-
}), /* @__PURE__ */
|
|
143
|
+
}), /* @__PURE__ */ y("p", {
|
|
146
144
|
className: "text-xs text-text-secondary mt-1",
|
|
147
145
|
children: "Use this only if no other connections rely on the same secret."
|
|
148
146
|
})] })]
|
|
149
147
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
className: "
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
className: "animate-spin"
|
|
167
|
-
}) : /* @__PURE__ */ x(y, { size: 14 }), "Delete connection"]
|
|
168
|
-
})]
|
|
169
|
-
})
|
|
148
|
+
/* @__PURE__ */ b(w, { children: [/* @__PURE__ */ y(x, {
|
|
149
|
+
onClick: () => {
|
|
150
|
+
K(!1), J(!1);
|
|
151
|
+
},
|
|
152
|
+
children: "Cancel"
|
|
153
|
+
}), /* @__PURE__ */ b(xe, {
|
|
154
|
+
disabled: z,
|
|
155
|
+
onClick: (e) => {
|
|
156
|
+
e.preventDefault(), Z();
|
|
157
|
+
},
|
|
158
|
+
className: "inline-flex items-center gap-2 bg-status-error-bg text-action-primary-text disabled:opacity-50",
|
|
159
|
+
children: [z ? /* @__PURE__ */ y(m, {
|
|
160
|
+
size: 14,
|
|
161
|
+
className: "animate-spin"
|
|
162
|
+
}) : /* @__PURE__ */ y(_, { size: 14 }), "Delete connection"]
|
|
163
|
+
})] })
|
|
170
164
|
]
|
|
171
165
|
})
|
|
172
166
|
}),
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
open:
|
|
175
|
-
title:
|
|
176
|
-
description:
|
|
177
|
-
confirmLabel:
|
|
178
|
-
cancelLabel:
|
|
167
|
+
/* @__PURE__ */ y(oe, {
|
|
168
|
+
open: Ae,
|
|
169
|
+
title: j("integrations.connectionDetail.confirm.revokeTitle", "Revoke connection"),
|
|
170
|
+
description: j("integrations.connectionDetail.confirm.revoke", "Are you sure you want to revoke this connection? This will disconnect the external service."),
|
|
171
|
+
confirmLabel: j("integrations.connectionDetail.actions.revoke", "Revoke"),
|
|
172
|
+
cancelLabel: j("integrations.connectionDetail.actions.cancel", "Cancel"),
|
|
179
173
|
loading: L,
|
|
180
174
|
destructive: !0,
|
|
181
|
-
icon: /* @__PURE__ */
|
|
182
|
-
onConfirm:
|
|
183
|
-
onCancel: () =>
|
|
175
|
+
icon: /* @__PURE__ */ y(g, { size: 20 }),
|
|
176
|
+
onConfirm: Pe,
|
|
177
|
+
onCancel: () => Y(!1)
|
|
184
178
|
}),
|
|
185
|
-
/* @__PURE__ */
|
|
179
|
+
/* @__PURE__ */ b("div", {
|
|
186
180
|
className: "relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
181
|
+
children: [/* @__PURE__ */ b("div", {
|
|
188
182
|
className: "relative z-10 flex items-center gap-4",
|
|
189
183
|
children: [
|
|
190
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ y("button", {
|
|
191
185
|
type: "button",
|
|
192
|
-
onClick: () =>
|
|
186
|
+
onClick: () => k?.(r(O, "connections")),
|
|
193
187
|
className: "p-2.5 hover:bg-accent rounded-lg transition-all",
|
|
194
|
-
"aria-label":
|
|
195
|
-
children: /* @__PURE__ */
|
|
188
|
+
"aria-label": j("integrations.connectionDetail.actions.backAriaLabel", "Back"),
|
|
189
|
+
children: /* @__PURE__ */ y(d, { size: 20 })
|
|
196
190
|
}),
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
provider:
|
|
191
|
+
/* @__PURE__ */ y(s, {
|
|
192
|
+
provider: M.provider,
|
|
199
193
|
size: 56
|
|
200
194
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ b("div", {
|
|
202
196
|
className: "flex-1",
|
|
203
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ b("div", {
|
|
204
198
|
className: "flex items-center gap-3",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
199
|
+
children: [/* @__PURE__ */ y("h1", {
|
|
206
200
|
className: "text-2xl sm:text-3xl font-bold text-text-primary",
|
|
207
|
-
children:
|
|
208
|
-
}), /* @__PURE__ */
|
|
209
|
-
status:
|
|
201
|
+
children: M.name
|
|
202
|
+
}), /* @__PURE__ */ y(c, {
|
|
203
|
+
status: M.status,
|
|
210
204
|
size: "md"
|
|
211
205
|
})]
|
|
212
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ b("p", {
|
|
213
207
|
className: "text-sm text-text-secondary mt-0.5",
|
|
214
208
|
children: [
|
|
215
|
-
|
|
209
|
+
M.provider.name,
|
|
216
210
|
" · ",
|
|
217
|
-
|
|
211
|
+
te(M.provider.authType)
|
|
218
212
|
]
|
|
219
213
|
})]
|
|
220
214
|
})
|
|
221
215
|
]
|
|
222
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ y("div", { className: "absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0" })]
|
|
223
217
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ b("div", {
|
|
225
219
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ b("div", {
|
|
227
221
|
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
222
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
229
223
|
className: "font-semibold text-text-primary flex items-center gap-2",
|
|
230
|
-
children: [/* @__PURE__ */
|
|
224
|
+
children: [/* @__PURE__ */ y(le, {
|
|
231
225
|
size: 18,
|
|
232
226
|
className: "text-primary"
|
|
233
|
-
}),
|
|
234
|
-
}), /* @__PURE__ */
|
|
227
|
+
}), j("integrations.connectionDetail.sections.info", "Connection Info")]
|
|
228
|
+
}), /* @__PURE__ */ b("div", {
|
|
235
229
|
className: "space-y-3",
|
|
236
230
|
children: [
|
|
237
|
-
|
|
231
|
+
M.description && /* @__PURE__ */ b("div", {
|
|
238
232
|
className: "py-2 border-b border-border-subtle/50",
|
|
239
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ y("span", {
|
|
240
234
|
className: "text-xs text-text-secondary uppercase tracking-wide",
|
|
241
|
-
children:
|
|
242
|
-
}), /* @__PURE__ */
|
|
235
|
+
children: j("integrations.connectionDetail.fields.description", "Description")
|
|
236
|
+
}), /* @__PURE__ */ y("p", {
|
|
243
237
|
className: "text-sm text-text-primary mt-0.5",
|
|
244
|
-
children:
|
|
238
|
+
children: M.description
|
|
245
239
|
})]
|
|
246
240
|
}),
|
|
247
|
-
/* @__PURE__ */
|
|
241
|
+
/* @__PURE__ */ b("div", {
|
|
248
242
|
className: "flex items-center justify-between py-2 border-b border-border-subtle/50",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
243
|
+
children: [/* @__PURE__ */ y("span", {
|
|
250
244
|
className: "text-sm text-text-secondary",
|
|
251
|
-
children:
|
|
252
|
-
}), /* @__PURE__ */
|
|
245
|
+
children: j("integrations.connectionDetail.fields.provider", "Provider")
|
|
246
|
+
}), /* @__PURE__ */ y("span", {
|
|
253
247
|
className: "text-sm font-medium text-text-primary",
|
|
254
|
-
children:
|
|
248
|
+
children: M.provider.name
|
|
255
249
|
})]
|
|
256
250
|
}),
|
|
257
|
-
|
|
251
|
+
M.externalAccountEmail && /* @__PURE__ */ b("div", {
|
|
258
252
|
className: "flex items-center justify-between py-2 border-b border-border-subtle/50",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
253
|
+
children: [/* @__PURE__ */ b("span", {
|
|
260
254
|
className: "text-sm text-text-secondary flex items-center gap-1",
|
|
261
255
|
children: [
|
|
262
|
-
/* @__PURE__ */
|
|
256
|
+
/* @__PURE__ */ y(fe, { size: 14 }),
|
|
263
257
|
" ",
|
|
264
|
-
|
|
258
|
+
j("integrations.connectionDetail.fields.account", "Account")
|
|
265
259
|
]
|
|
266
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ y("span", {
|
|
267
261
|
className: "text-sm font-medium text-text-primary",
|
|
268
|
-
children:
|
|
262
|
+
children: M.externalAccountEmail
|
|
269
263
|
})]
|
|
270
264
|
}),
|
|
271
|
-
|
|
265
|
+
M.externalAccountName && /* @__PURE__ */ b("div", {
|
|
272
266
|
className: "flex items-center justify-between py-2 border-b border-border-subtle/50",
|
|
273
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ b("span", {
|
|
274
268
|
className: "text-sm text-text-secondary flex items-center gap-1",
|
|
275
269
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ y(me, { size: 14 }),
|
|
277
271
|
" ",
|
|
278
|
-
|
|
272
|
+
j("integrations.connectionDetail.fields.name", "Name")
|
|
279
273
|
]
|
|
280
|
-
}), /* @__PURE__ */
|
|
274
|
+
}), /* @__PURE__ */ y("span", {
|
|
281
275
|
className: "text-sm font-medium text-text-primary",
|
|
282
|
-
children:
|
|
276
|
+
children: M.externalAccountName
|
|
283
277
|
})]
|
|
284
278
|
}),
|
|
285
|
-
|
|
279
|
+
M.errorMessage && /* @__PURE__ */ b("div", {
|
|
286
280
|
className: "py-2 border-b border-border-subtle/50",
|
|
287
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ y("span", {
|
|
288
282
|
className: "text-xs text-status-error-text uppercase tracking-wide",
|
|
289
|
-
children:
|
|
290
|
-
}), /* @__PURE__ */
|
|
283
|
+
children: j("integrations.connectionDetail.fields.error", "Error")
|
|
284
|
+
}), /* @__PURE__ */ y("p", {
|
|
291
285
|
className: "text-sm text-status-error-text mt-0.5 bg-status-error-bg-subtle rounded-lg p-2",
|
|
292
|
-
children:
|
|
286
|
+
children: M.errorMessage
|
|
293
287
|
})]
|
|
294
288
|
}),
|
|
295
|
-
/* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ b("div", {
|
|
296
290
|
className: "flex items-center justify-between py-2 border-b border-border-subtle/50",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ b("span", {
|
|
298
292
|
className: "text-sm text-text-secondary flex items-center gap-1",
|
|
299
293
|
children: [
|
|
300
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ y(de, { size: 14 }),
|
|
301
295
|
" ",
|
|
302
|
-
|
|
296
|
+
j("integrations.connectionDetail.fields.lastUsed", "Last Used")
|
|
303
297
|
]
|
|
304
|
-
}), /* @__PURE__ */
|
|
298
|
+
}), /* @__PURE__ */ y("span", {
|
|
305
299
|
className: "text-sm text-text-primary",
|
|
306
|
-
children:
|
|
300
|
+
children: ee(M.lastUsedAt)
|
|
307
301
|
})]
|
|
308
302
|
}),
|
|
309
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ b("div", {
|
|
310
304
|
className: "flex items-center justify-between py-2 border-b border-border-subtle/50",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
305
|
+
children: [/* @__PURE__ */ y("span", {
|
|
312
306
|
className: "text-sm text-text-secondary",
|
|
313
|
-
children:
|
|
314
|
-
}), /* @__PURE__ */
|
|
307
|
+
children: j("integrations.connectionDetail.fields.healthCheck", "Health Check")
|
|
308
|
+
}), /* @__PURE__ */ y("span", {
|
|
315
309
|
className: "text-sm text-text-primary",
|
|
316
|
-
children: i(
|
|
310
|
+
children: i(M.lastHealthCheck)
|
|
317
311
|
})]
|
|
318
312
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ b("div", {
|
|
320
314
|
className: "flex items-center justify-between py-2",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ y("span", {
|
|
322
316
|
className: "text-sm text-text-secondary",
|
|
323
|
-
children:
|
|
324
|
-
}), /* @__PURE__ */
|
|
317
|
+
children: j("integrations.connectionDetail.fields.created", "Created")
|
|
318
|
+
}), /* @__PURE__ */ y("span", {
|
|
325
319
|
className: "text-sm text-text-primary",
|
|
326
|
-
children: i(
|
|
320
|
+
children: i(M.createdAt)
|
|
327
321
|
})]
|
|
328
322
|
})
|
|
329
323
|
]
|
|
330
324
|
})]
|
|
331
|
-
}), /* @__PURE__ */
|
|
325
|
+
}), /* @__PURE__ */ b("div", {
|
|
332
326
|
className: "space-y-4",
|
|
333
327
|
children: [
|
|
334
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ b("div", {
|
|
335
329
|
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5",
|
|
336
|
-
children: [/* @__PURE__ */
|
|
330
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
337
331
|
className: "font-semibold text-text-primary flex items-center gap-2 mb-3",
|
|
338
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ y(g, {
|
|
339
333
|
size: 18,
|
|
340
334
|
className: "text-primary"
|
|
341
|
-
}),
|
|
342
|
-
}),
|
|
335
|
+
}), j("integrations.connectionDetail.sections.scopes", "Granted Scopes")]
|
|
336
|
+
}), M.grantedScopes.length > 0 ? /* @__PURE__ */ y("div", {
|
|
343
337
|
className: "flex flex-wrap gap-2",
|
|
344
|
-
children:
|
|
338
|
+
children: M.grantedScopes.map((e) => /* @__PURE__ */ y("span", {
|
|
345
339
|
className: "text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono",
|
|
346
340
|
children: e
|
|
347
341
|
}, e))
|
|
348
|
-
}) : /* @__PURE__ */
|
|
342
|
+
}) : /* @__PURE__ */ y("p", {
|
|
349
343
|
className: "text-sm text-text-secondary",
|
|
350
|
-
children:
|
|
344
|
+
children: j("integrations.connectionDetail.scopes.empty", "No scopes granted.")
|
|
351
345
|
})]
|
|
352
346
|
}),
|
|
353
|
-
|
|
354
|
-
className: t("rounded-xl border p-5",
|
|
347
|
+
U && /* @__PURE__ */ b("div", {
|
|
348
|
+
className: t("rounded-xl border p-5", U.success ? "border-border-default bg-status-success-bg-subtle" : "border-border-default bg-status-error-bg-subtle"),
|
|
355
349
|
children: [
|
|
356
|
-
/* @__PURE__ */
|
|
357
|
-
className: t("font-semibold flex items-center gap-2 mb-2",
|
|
358
|
-
children: [
|
|
350
|
+
/* @__PURE__ */ b("h2", {
|
|
351
|
+
className: t("font-semibold flex items-center gap-2 mb-2", U.success ? "text-status-success-text" : "text-status-error-text"),
|
|
352
|
+
children: [U.success ? /* @__PURE__ */ y(f, { size: 18 }) : /* @__PURE__ */ y(v, { size: 18 }), U.success ? j("integrations.connectionDetail.testResult.passed", "Connection Test Passed") : j("integrations.connectionDetail.testResult.failed", "Connection Test Failed")]
|
|
359
353
|
}),
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
className: t("text-sm",
|
|
362
|
-
children:
|
|
354
|
+
/* @__PURE__ */ y("p", {
|
|
355
|
+
className: t("text-sm", U.success ? "text-status-success-text" : "text-status-error-text"),
|
|
356
|
+
children: U.message
|
|
363
357
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
358
|
+
/* @__PURE__ */ y("p", {
|
|
365
359
|
className: "text-xs text-text-secondary mt-1",
|
|
366
|
-
children:
|
|
360
|
+
children: j("integrations.connectionDetail.testResult.latency", "Latency: {latency}ms", { latency: U.latencyMs })
|
|
367
361
|
})
|
|
368
362
|
]
|
|
369
363
|
}),
|
|
370
|
-
$ && /* @__PURE__ */
|
|
364
|
+
$ && /* @__PURE__ */ b("div", {
|
|
371
365
|
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
366
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
373
367
|
className: "font-semibold text-text-primary flex items-center gap-2 mb-3",
|
|
374
|
-
children: [/* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ y(p, {
|
|
375
369
|
size: 18,
|
|
376
370
|
className: "text-primary"
|
|
377
371
|
}), "Credential Storage"]
|
|
378
|
-
}), /* @__PURE__ */
|
|
372
|
+
}), /* @__PURE__ */ b("div", {
|
|
379
373
|
className: "space-y-2 text-sm",
|
|
380
374
|
children: [
|
|
381
|
-
|
|
375
|
+
M.vaultId && /* @__PURE__ */ b("div", {
|
|
382
376
|
className: "flex items-center justify-between gap-3",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ y("span", {
|
|
384
378
|
className: "text-text-secondary",
|
|
385
379
|
children: "Vault"
|
|
386
|
-
}), /* @__PURE__ */
|
|
380
|
+
}), /* @__PURE__ */ y("span", {
|
|
387
381
|
className: "font-medium text-text-primary break-all",
|
|
388
|
-
children:
|
|
382
|
+
children: M.vaultId
|
|
389
383
|
})]
|
|
390
384
|
}),
|
|
391
|
-
|
|
385
|
+
M.credentialSecretName && /* @__PURE__ */ b("div", {
|
|
392
386
|
className: "flex items-center justify-between gap-3",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ y("span", {
|
|
394
388
|
className: "text-text-secondary",
|
|
395
389
|
children: "Secret"
|
|
396
|
-
}), /* @__PURE__ */
|
|
390
|
+
}), /* @__PURE__ */ y("span", {
|
|
397
391
|
className: "font-medium text-text-primary break-all",
|
|
398
|
-
children:
|
|
392
|
+
children: M.credentialSecretName
|
|
399
393
|
})]
|
|
400
394
|
}),
|
|
401
|
-
|
|
395
|
+
M.credentialSecretId && /* @__PURE__ */ b("div", {
|
|
402
396
|
className: "flex items-center justify-between gap-3",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
397
|
+
children: [/* @__PURE__ */ y("span", {
|
|
404
398
|
className: "text-text-secondary",
|
|
405
399
|
children: "Secret ID"
|
|
406
|
-
}), /* @__PURE__ */
|
|
400
|
+
}), /* @__PURE__ */ y("span", {
|
|
407
401
|
className: "font-mono text-xs text-text-primary break-all",
|
|
408
|
-
children:
|
|
402
|
+
children: M.credentialSecretId
|
|
409
403
|
})]
|
|
410
404
|
})
|
|
411
405
|
]
|
|
412
406
|
})]
|
|
413
407
|
}),
|
|
414
|
-
(
|
|
408
|
+
(V || H) && /* @__PURE__ */ b("div", {
|
|
415
409
|
className: "rounded-xl border border-border-subtle/50 bg-bg-surface p-5",
|
|
416
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ b("h2", {
|
|
417
411
|
className: "font-semibold text-text-primary flex items-center gap-2 mb-3",
|
|
418
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ y(p, {
|
|
419
413
|
size: 18,
|
|
420
414
|
className: "text-primary"
|
|
421
|
-
}),
|
|
422
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), j("integrations.connectionDetail.sections.actions", "Actions")]
|
|
416
|
+
}), /* @__PURE__ */ b("div", {
|
|
423
417
|
className: "flex flex-wrap gap-2",
|
|
424
418
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
419
|
+
/* @__PURE__ */ b("button", {
|
|
426
420
|
type: "button",
|
|
427
|
-
onClick:
|
|
421
|
+
onClick: je,
|
|
428
422
|
disabled: Q,
|
|
429
423
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
|
|
430
|
-
children: [
|
|
424
|
+
children: [F ? /* @__PURE__ */ y(m, {
|
|
431
425
|
size: 14,
|
|
432
426
|
className: "animate-spin"
|
|
433
|
-
}) : /* @__PURE__ */
|
|
427
|
+
}) : /* @__PURE__ */ y(he, { size: 14 }), j("integrations.connectionDetail.actions.test", "Test Connection")]
|
|
434
428
|
}),
|
|
435
|
-
|
|
429
|
+
V && M.provider.authType === "oauth2" && Ee && /* @__PURE__ */ b("button", {
|
|
436
430
|
type: "button",
|
|
437
|
-
onClick:
|
|
431
|
+
onClick: Me,
|
|
438
432
|
disabled: Q,
|
|
439
433
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors disabled:opacity-50",
|
|
440
|
-
children: [
|
|
434
|
+
children: [I ? /* @__PURE__ */ y(m, {
|
|
441
435
|
size: 14,
|
|
442
436
|
className: "animate-spin"
|
|
443
|
-
}) : /* @__PURE__ */
|
|
437
|
+
}) : /* @__PURE__ */ y(h, { size: 14 }), j("integrations.connectionDetail.actions.refreshToken", "Refresh Token")]
|
|
444
438
|
}),
|
|
445
|
-
|
|
439
|
+
H && /* @__PURE__ */ b("button", {
|
|
446
440
|
type: "button",
|
|
447
|
-
onClick:
|
|
441
|
+
onClick: Ne,
|
|
448
442
|
disabled: Q,
|
|
449
443
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-warning-text hover:bg-status-warning-bg-subtle transition-colors disabled:opacity-50",
|
|
450
|
-
children: [L ? /* @__PURE__ */
|
|
444
|
+
children: [L ? /* @__PURE__ */ y(m, {
|
|
451
445
|
size: 14,
|
|
452
446
|
className: "animate-spin"
|
|
453
|
-
}) : /* @__PURE__ */
|
|
447
|
+
}) : /* @__PURE__ */ y(g, { size: 14 }), j("integrations.connectionDetail.actions.revoke", "Revoke")]
|
|
454
448
|
}),
|
|
455
|
-
|
|
449
|
+
H && /* @__PURE__ */ b("button", {
|
|
456
450
|
type: "button",
|
|
457
|
-
onClick:
|
|
451
|
+
onClick: Fe,
|
|
458
452
|
disabled: Q,
|
|
459
453
|
className: "inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-error-text hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50",
|
|
460
|
-
children: [
|
|
454
|
+
children: [z ? /* @__PURE__ */ y(m, {
|
|
461
455
|
size: 14,
|
|
462
456
|
className: "animate-spin"
|
|
463
|
-
}) : /* @__PURE__ */
|
|
457
|
+
}) : /* @__PURE__ */ y(_, { size: 14 }), j("integrations.connectionDetail.actions.delete", "Delete")]
|
|
464
458
|
})
|
|
465
459
|
]
|
|
466
460
|
})]
|
|
@@ -472,6 +466,6 @@ function C() {
|
|
|
472
466
|
});
|
|
473
467
|
}
|
|
474
468
|
//#endregion
|
|
475
|
-
export {
|
|
469
|
+
export { D as ConnectionDetail };
|
|
476
470
|
|
|
477
471
|
//# sourceMappingURL=ConnectionDetail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectionDetail.js","names":[],"sources":["../../../src/integrations/pages/ConnectionDetail.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n RefreshCw,\n Shield,\n Clock,\n Activity,\n CheckCircle2,\n XCircle,\n Key,\n RotateCcw,\n Zap,\n Mail,\n User,\n Trash2,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\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 { joinPath } from '../utils/navigation';\nimport { formatDate, formatLastUsed, getAuthTypeLabel } from '../utils/integrationsHelpers';\nimport {\n useConnection,\n useTestConnection,\n useRefreshToken,\n useRevokeConnection,\n useDeleteConnection,\n} from '../hooks/useConnections';\nimport { ProviderIcon } from '../components/ProviderIcon';\nimport { ConnectionStatusBadge } from '../components/ConnectionStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\n/**\n * Connection Detail — Single connection view with info, scopes, and action buttons.\n */\nexport function ConnectionDetail() {\n const { connectionId } = useParams<{ connectionId: string }>();\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n\n const { connection, loading, error, refetch } = useConnection(connectionId ?? '');\n const { testConnection, loading: testing } = useTestConnection();\n const { refreshToken, loading: refreshing } = useRefreshToken();\n const { revokeConnection, loading: revoking } = useRevokeConnection();\n const { deleteConnection, loading: deleting } = useDeleteConnection();\n const canRefreshToken = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.OAUTH_REFRESH, true);\n\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canUpdate = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_UPDATE);\n const canDelete = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_DELETE);\n\n const [testResult, setTestResult] = useState<{\n success: boolean;\n message: string;\n latencyMs: number;\n } | null>(null);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\n const [deleteVaultSecret, setDeleteVaultSecret] = useState(false);\n const [revokeDialogOpen, setRevokeDialogOpen] = useState(false);\n\n const showNotification = (type: 'success' | 'error', message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n if (loading || permissionsLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-text-secondary\">\n {tx('integrations.connectionDetail.loading', 'Loading connection details...')}\n </span>\n </div>\n );\n }\n\n if (error || !connection) {\n return (\n <div className=\"p-6 max-w-4xl mx-auto\">\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-6 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 {tx('integrations.connectionDetail.error.title', 'Connection not found')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">\n {error?.message ||\n tx(\n 'integrations.connectionDetail.error.description',\n 'The requested connection could not be loaded.'\n )}\n </p>\n <div className=\"flex gap-2\">\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} />{' '}\n {tx('integrations.connectionDetail.error.retry', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={14} />{' '}\n {tx('integrations.connectionDetail.error.back', 'Back to Connections')}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n const handleTest = async () => {\n const result = await testConnection(connection.id);\n if (result) {\n setTestResult(result);\n showNotification(result.success ? 'success' : 'error', result.message);\n }\n };\n\n const handleRefresh = async () => {\n await refreshToken(connection.id);\n showNotification(\n 'success',\n tx(\n 'integrations.connectionDetail.notifications.refreshSuccess',\n 'Token refreshed successfully'\n )\n );\n refetch();\n };\n\n const handleRevoke = async () => {\n setRevokeDialogOpen(true);\n };\n\n const confirmRevoke = async () => {\n await revokeConnection(connection.id);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.revokeSuccess', 'Connection revoked')\n );\n setRevokeDialogOpen(false);\n refetch();\n };\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: tx('integrations.connectionDetail.deleteDialog.title', 'Delete Connection'),\n message: tx(\n 'integrations.connectionDetail.deleteDialog.message',\n 'Delete this connection? This cannot be undone.'\n ),\n okButtonTitle: tx('integrations.connectionDetail.deleteDialog.confirm', 'Delete'),\n cancelButtonTitle: tx('integrations.connectionDetail.deleteDialog.cancel', 'Cancel'),\n });\n if (result === null) {\n setDeleteDialogOpen(true);\n return;\n }\n if (result) {\n await confirmDelete();\n }\n };\n\n const confirmDelete = async () => {\n try {\n await deleteConnection(connection.id, deleteVaultSecret);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.deleteSuccess', 'Connection deleted')\n );\n void nativeNotify('success');\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n navigate?.(joinPath(basePath, 'connections'));\n } catch (error) {\n showNotification(\n 'error',\n error instanceof Error ? error.message : 'Failed to delete connection'\n );\n void nativeNotify('error');\n }\n };\n\n const actionLoading = testing || refreshing || revoking || deleting;\n const usesVaultCredentials = Boolean(connection.vaultId || connection.credentialSecretId);\n\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {/* Notification */}\n {notification && (\n <div\n className={cn(\n 'fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-300',\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n )}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <XCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n {deleteDialogOpen && (\n <div className=\"fixed inset-0 z-50 flex items-center justify-center bg-foreground/40 px-4\">\n <div className=\"w-full max-w-md rounded-xl border border-border-subtle bg-bg-surface p-6 shadow-2xl space-y-4\">\n <div>\n <h2 className=\"text-lg font-semibold text-text-primary\">Delete connection</h2>\n <p className=\"text-sm text-text-secondary mt-1\">\n This removes the connection record immediately. You can also remove the mapped vault\n secret if you no longer need it.\n </p>\n </div>\n\n {usesVaultCredentials && (\n <label className=\"flex items-start gap-3 rounded-lg border border-border-subtle/60 bg-bg-surface px-4 py-3 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={deleteVaultSecret}\n onChange={(event) => setDeleteVaultSecret(event.target.checked)}\n className=\"mt-0.5\"\n aria-label=\"Also remove mapped vault secret\"\n />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Also remove mapped vault secret\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n Use this only if no other connections rely on the same secret.\n </p>\n </div>\n </label>\n )}\n\n <div className=\"flex justify-end gap-3\">\n <button\n type=\"button\"\n onClick={() => {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }}\n className=\"px-4 py-2 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n Cancel\n </button>\n <button\n type=\"button\"\n onClick={confirmDelete}\n disabled={deleting}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-status-error-bg text-action-primary-text disabled:opacity-50\"\n >\n {deleting ? <Loader2 size={14} className=\"animate-spin\" /> : <Trash2 size={14} />}\n Delete connection\n </button>\n </div>\n </div>\n </div>\n )}\n\n <ConfirmDialog\n open={revokeDialogOpen}\n title={tx('integrations.connectionDetail.confirm.revokeTitle', 'Revoke connection')}\n description={tx(\n 'integrations.connectionDetail.confirm.revoke',\n 'Are you sure you want to revoke this connection? This will disconnect the external service.'\n )}\n confirmLabel={tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n cancelLabel={tx('integrations.connectionDetail.actions.cancel', 'Cancel')}\n loading={revoking}\n destructive\n icon={<Shield size={20} />}\n onConfirm={confirmRevoke}\n onCancel={() => setRevokeDialogOpen(false)}\n />\n\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label={tx('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"flex-1\">\n <div className=\"flex items-center gap-3\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">{connection.name}</h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n </div>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {connection.provider.name} · {getAuthTypeLabel(connection.provider.authType)}\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {/* Connection Info */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Activity size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.info', 'Connection Info')}\n </h2>\n <div className=\"space-y-3\">\n {connection.description && (\n <div className=\"py-2 border-b border-border-subtle/50\">\n <span className=\"text-xs text-text-secondary uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-sm text-text-primary mt-0.5\">{connection.description}</p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.provider', 'Provider')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.provider.name}\n </span>\n </div>\n {connection.externalAccountEmail && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Mail size={14} /> {tx('integrations.connectionDetail.fields.account', 'Account')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountEmail}\n </span>\n </div>\n )}\n {connection.externalAccountName && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <User size={14} /> {tx('integrations.connectionDetail.fields.name', 'Name')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountName}\n </span>\n </div>\n )}\n {connection.errorMessage && (\n <div className=\"py-2 border-b border-border-subtle/50\">\n <span className=\"text-xs text-status-error-text uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.error', 'Error')}\n </span>\n <p className=\"text-sm text-status-error-text mt-0.5 bg-status-error-bg-subtle rounded-lg p-2\">\n {connection.errorMessage}\n </p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Clock size={14} />{' '}\n {tx('integrations.connectionDetail.fields.lastUsed', 'Last Used')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatLastUsed(connection.lastUsedAt)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.healthCheck', 'Health Check')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatDate(connection.lastHealthCheck)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.created', 'Created')}\n </span>\n <span className=\"text-sm text-text-primary\">{formatDate(connection.createdAt)}</span>\n </div>\n </div>\n </div>\n\n {/* Scopes & Actions */}\n <div className=\"space-y-4\">\n {/* Granted Scopes */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h2>\n {connection.grantedScopes.length > 0 ? (\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </div>\n\n {/* Test Result */}\n {testResult && (\n <div\n className={cn(\n 'rounded-xl border p-5',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <h2\n className={cn(\n 'font-semibold flex items-center gap-2 mb-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tx('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tx('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </h2>\n <p\n className={cn(\n 'text-sm',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tx('integrations.connectionDetail.testResult.latency', 'Latency: {latency}ms', {\n latency: testResult.latencyMs,\n })}\n </p>\n </div>\n )}\n\n {usesVaultCredentials && (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n Credential Storage\n </h2>\n <div className=\"space-y-2 text-sm\">\n {connection.vaultId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Vault</span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.vaultId}\n </span>\n </div>\n )}\n {connection.credentialSecretName && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Secret</span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.credentialSecretName}\n </span>\n </div>\n )}\n {connection.credentialSecretId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Secret ID</span>\n <span className=\"font-mono text-xs text-text-primary break-all\">\n {connection.credentialSecretId}\n </span>\n </div>\n )}\n </div>\n </div>\n )}\n\n {/* Actions — hidden entirely when user has no action permissions */}\n {(canUpdate || canDelete) && (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.actions', 'Actions')}\n </h2>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={handleTest}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50\"\n >\n {testing ? <Loader2 size={14} className=\"animate-spin\" /> : <Zap size={14} />}\n {tx('integrations.connectionDetail.actions.test', 'Test Connection')}\n </button>\n {canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken && (\n <button\n type=\"button\"\n onClick={handleRefresh}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors disabled:opacity-50\"\n >\n {refreshing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <RotateCcw size={14} />\n )}\n {tx('integrations.connectionDetail.actions.refreshToken', 'Refresh Token')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleRevoke}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-warning-text hover:bg-status-warning-bg-subtle transition-colors disabled:opacity-50\"\n >\n {revoking ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Shield size={14} />\n )}\n {tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-error-text hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50\"\n >\n {deleting ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Trash2 size={14} />\n )}\n {tx('integrations.connectionDetail.actions.delete', 'Delete')}\n </button>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AA0CA,SAAgB,IAAmB;CACjC,IAAM,EAAE,oBAAiB,IAAqC,EACxD,EAAE,cAAW,KAAK,gBAAa,GAAiB,EAChD,EAAE,SAAM,IAAS,EACjB,KAAM,GAAa,GAAkB,MAA6C;EACtF,IAAM,IAAa,EAAE,GAAK,EAAO;AAIjC,SAHI,MAAe,IACd,IAEE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAO,CAAC,GAAU,OACjB,EACG,QAAQ,KAAK,EAAS,KAAK,OAAO,EAAW,CAAC,CAC9C,QAAQ,IAAI,EAAS,IAAI,OAAO,EAAW,CAAC,EACjD,EACD,GARmB,IADW;IAY3B,EAAE,eAAY,YAAS,UAAO,eAAY,EAAc,KAAgB,GAAG,EAC3E,EAAE,mBAAgB,SAAS,MAAY,IAAmB,EAC1D,EAAE,iBAAc,SAAS,MAAe,IAAiB,EACzD,EAAE,qBAAkB,SAAS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;UACE,MAAK;UACL,SAAS;UACT,UAAU;UACV,WAAU;oBAJZ,CAMG,IACC,kBAAC,GAAD;WAAS,MAAM;WAAI,WAAU;WAAiB,CAAA,GAE9C,kBAAC,IAAD,EAAW,MAAM,IAAM,CAAA,EAExB,EAAG,sDAAsD,gBAAgB,CACnE;;SAEV,KACC,kBAAC,UAAD;UACE,MAAK;UACL,SAAS;UACT,UAAU;UACV,WAAU;oBAJZ,CAMG,IACC,kBAAC,GAAD;WAAS,MAAM;WAAI,WAAU;WAAiB,CAAA,GAE9C,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EAErB,EAAG,gDAAgD,SAAS,CACtD;;SAEV,KACC,kBAAC,UAAD;UACE,MAAK;UACL,SAAS;UACT,UAAU;UACV,WAAU;oBAJZ,CAMG,IACC,kBAAC,GAAD;WAAS,MAAM;WAAI,WAAU;WAAiB,CAAA,GAE9C,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EAErB,EAAG,gDAAgD,SAAS,CACtD;;SAEP;UACF;;MAEJ;OACF;;GACF"}
|
|
1
|
+
{"version":3,"file":"ConnectionDetail.js","names":[],"sources":["../../../src/integrations/pages/ConnectionDetail.tsx"],"sourcesContent":["import { useState } from 'react';\nimport { useParams } from 'react-router-dom';\nimport {\n ArrowLeft,\n Loader2,\n AlertCircle,\n RefreshCw,\n Shield,\n Clock,\n Activity,\n CheckCircle2,\n XCircle,\n Key,\n RotateCcw,\n Zap,\n Mail,\n User,\n Trash2,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\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 { joinPath } from '../utils/navigation';\nimport { formatDate, formatLastUsed, getAuthTypeLabel } from '../utils/integrationsHelpers';\nimport {\n useConnection,\n useTestConnection,\n useRefreshToken,\n useRevokeConnection,\n useDeleteConnection,\n} from '../hooks/useConnections';\nimport { ProviderIcon } from '../components/ProviderIcon';\nimport { ConnectionStatusBadge } from '../components/ConnectionStatusBadge';\nimport { ConfirmDialog } from '../components/ConfirmDialog';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@burdenoff/fe-libs/ui';\nimport { nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\n\n/**\n * Connection Detail — Single connection view with info, scopes, and action buttons.\n */\nexport function ConnectionDetail() {\n const { connectionId } = useParams<{ connectionId: string }>();\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n\n const { connection, loading, error, refetch } = useConnection(connectionId ?? '');\n const { testConnection, loading: testing } = useTestConnection();\n const { refreshToken, loading: refreshing } = useRefreshToken();\n const { revokeConnection, loading: revoking } = useRevokeConnection();\n const { deleteConnection, loading: deleting } = useDeleteConnection();\n const canRefreshToken = useFeatureFlag(INTEGRATION_FEATURE_FLAGS.OAUTH_REFRESH, true);\n\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canUpdate = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_UPDATE);\n const canDelete = hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_DELETE);\n\n const [testResult, setTestResult] = useState<{\n success: boolean;\n message: string;\n latencyMs: number;\n } | null>(null);\n const [notification, setNotification] = useState<{\n type: 'success' | 'error';\n message: string;\n } | null>(null);\n const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);\n const [deleteVaultSecret, setDeleteVaultSecret] = useState(false);\n const [revokeDialogOpen, setRevokeDialogOpen] = useState(false);\n\n const showNotification = (type: 'success' | 'error', message: string) => {\n setNotification({ type, message });\n setTimeout(() => setNotification(null), 5000);\n };\n\n if (loading || permissionsLoading) {\n return (\n <div className=\"flex flex-col items-center justify-center py-20\">\n <Loader2 size={48} className=\"animate-spin text-primary\" />\n <span className=\"mt-6 text-sm font-medium text-text-secondary\">\n {tx('integrations.connectionDetail.loading', 'Loading connection details...')}\n </span>\n </div>\n );\n }\n\n if (error || !connection) {\n return (\n <div className=\"p-6 max-w-4xl mx-auto\">\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-6 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 {tx('integrations.connectionDetail.error.title', 'Connection not found')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">\n {error?.message ||\n tx(\n 'integrations.connectionDetail.error.description',\n 'The requested connection could not be loaded.'\n )}\n </p>\n <div className=\"flex gap-2\">\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} />{' '}\n {tx('integrations.connectionDetail.error.retry', 'Try Again')}\n </button>\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors\"\n >\n <ArrowLeft size={14} />{' '}\n {tx('integrations.connectionDetail.error.back', 'Back to Connections')}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n }\n\n const handleTest = async () => {\n const result = await testConnection(connection.id);\n if (result) {\n setTestResult(result);\n showNotification(result.success ? 'success' : 'error', result.message);\n }\n };\n\n const handleRefresh = async () => {\n await refreshToken(connection.id);\n showNotification(\n 'success',\n tx(\n 'integrations.connectionDetail.notifications.refreshSuccess',\n 'Token refreshed successfully'\n )\n );\n refetch();\n };\n\n const handleRevoke = async () => {\n setRevokeDialogOpen(true);\n };\n\n const confirmRevoke = async () => {\n await revokeConnection(connection.id);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.revokeSuccess', 'Connection revoked')\n );\n setRevokeDialogOpen(false);\n refetch();\n };\n\n const handleDelete = async () => {\n void nativeImpact('medium');\n const result = await nativeConfirm({\n title: tx('integrations.connectionDetail.deleteDialog.title', 'Delete Connection'),\n message: tx(\n 'integrations.connectionDetail.deleteDialog.message',\n 'Delete this connection? This cannot be undone.'\n ),\n okButtonTitle: tx('integrations.connectionDetail.deleteDialog.confirm', 'Delete'),\n cancelButtonTitle: tx('integrations.connectionDetail.deleteDialog.cancel', 'Cancel'),\n });\n if (result === null) {\n setDeleteDialogOpen(true);\n return;\n }\n if (result) {\n await confirmDelete();\n }\n };\n\n const confirmDelete = async () => {\n try {\n await deleteConnection(connection.id, deleteVaultSecret);\n showNotification(\n 'success',\n tx('integrations.connectionDetail.notifications.deleteSuccess', 'Connection deleted')\n );\n void nativeNotify('success');\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n navigate?.(joinPath(basePath, 'connections'));\n } catch (error) {\n showNotification(\n 'error',\n error instanceof Error ? error.message : 'Failed to delete connection'\n );\n void nativeNotify('error');\n }\n };\n\n const actionLoading = testing || refreshing || revoking || deleting;\n const usesVaultCredentials = Boolean(connection.vaultId || connection.credentialSecretId);\n\n return (\n <div className=\"space-y-6 p-6 max-w-5xl mx-auto\">\n {/* Notification */}\n {notification && (\n <div\n className={cn(\n 'fixed top-4 right-4 z-50 flex items-center gap-3 px-5 py-3 rounded-xl shadow-2xl border-2 animate-in slide-in-from-top-4 duration-200',\n notification.type === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text border-border-default'\n : 'bg-status-error-bg-subtle text-status-error-text border-border-default'\n )}\n >\n {notification.type === 'success' ? <CheckCircle2 size={20} /> : <XCircle size={20} />}\n <span className=\"font-medium\">{notification.message}</span>\n </div>\n )}\n\n <AlertDialog\n open={deleteDialogOpen}\n onOpenChange={(next) => {\n if (!next) {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }\n }}\n >\n <AlertDialogContent className=\"max-w-md\">\n <AlertDialogHeader>\n <AlertDialogTitle>Delete connection</AlertDialogTitle>\n <AlertDialogDescription>\n This removes the connection record immediately. You can also remove the mapped vault\n secret if you no longer need it.\n </AlertDialogDescription>\n </AlertDialogHeader>\n\n {usesVaultCredentials && (\n <label className=\"flex items-start gap-3 rounded-lg border border-border-subtle/60 bg-bg-surface px-4 py-3 cursor-pointer\">\n <input\n type=\"checkbox\"\n checked={deleteVaultSecret}\n onChange={(event) => setDeleteVaultSecret(event.target.checked)}\n className=\"mt-0.5\"\n aria-label=\"Also remove mapped vault secret\"\n />\n <div>\n <p className=\"text-sm font-medium text-text-primary\">\n Also remove mapped vault secret\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n Use this only if no other connections rely on the same secret.\n </p>\n </div>\n </label>\n )}\n\n <AlertDialogFooter>\n <AlertDialogCancel\n onClick={() => {\n setDeleteDialogOpen(false);\n setDeleteVaultSecret(false);\n }}\n >\n Cancel\n </AlertDialogCancel>\n <AlertDialogAction\n disabled={deleting}\n onClick={(event) => {\n event.preventDefault();\n confirmDelete();\n }}\n className=\"inline-flex items-center gap-2 bg-status-error-bg text-action-primary-text disabled:opacity-50\"\n >\n {deleting ? <Loader2 size={14} className=\"animate-spin\" /> : <Trash2 size={14} />}\n Delete connection\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n\n <ConfirmDialog\n open={revokeDialogOpen}\n title={tx('integrations.connectionDetail.confirm.revokeTitle', 'Revoke connection')}\n description={tx(\n 'integrations.connectionDetail.confirm.revoke',\n 'Are you sure you want to revoke this connection? This will disconnect the external service.'\n )}\n confirmLabel={tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n cancelLabel={tx('integrations.connectionDetail.actions.cancel', 'Cancel')}\n loading={revoking}\n destructive\n icon={<Shield size={20} />}\n onConfirm={confirmRevoke}\n onCancel={() => setRevokeDialogOpen(false)}\n />\n\n {/* Header */}\n <div className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\">\n <div className=\"relative z-10 flex items-center gap-4\">\n <button\n type=\"button\"\n onClick={() => navigate?.(joinPath(basePath, 'connections'))}\n className=\"p-2.5 hover:bg-accent rounded-lg transition-all\"\n aria-label={tx('integrations.connectionDetail.actions.backAriaLabel', 'Back')}\n >\n <ArrowLeft size={20} />\n </button>\n <ProviderIcon provider={connection.provider} size={56} />\n <div className=\"flex-1\">\n <div className=\"flex items-center gap-3\">\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">{connection.name}</h1>\n <ConnectionStatusBadge status={connection.status} size=\"md\" />\n </div>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {connection.provider.name} · {getAuthTypeLabel(connection.provider.authType)}\n </p>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n <div className=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n {/* Connection Info */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 space-y-4\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2\">\n <Activity size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.info', 'Connection Info')}\n </h2>\n <div className=\"space-y-3\">\n {connection.description && (\n <div className=\"py-2 border-b border-border-subtle/50\">\n <span className=\"text-xs text-text-secondary uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.description', 'Description')}\n </span>\n <p className=\"text-sm text-text-primary mt-0.5\">{connection.description}</p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.provider', 'Provider')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.provider.name}\n </span>\n </div>\n {connection.externalAccountEmail && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Mail size={14} /> {tx('integrations.connectionDetail.fields.account', 'Account')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountEmail}\n </span>\n </div>\n )}\n {connection.externalAccountName && (\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <User size={14} /> {tx('integrations.connectionDetail.fields.name', 'Name')}\n </span>\n <span className=\"text-sm font-medium text-text-primary\">\n {connection.externalAccountName}\n </span>\n </div>\n )}\n {connection.errorMessage && (\n <div className=\"py-2 border-b border-border-subtle/50\">\n <span className=\"text-xs text-status-error-text uppercase tracking-wide\">\n {tx('integrations.connectionDetail.fields.error', 'Error')}\n </span>\n <p className=\"text-sm text-status-error-text mt-0.5 bg-status-error-bg-subtle rounded-lg p-2\">\n {connection.errorMessage}\n </p>\n </div>\n )}\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary flex items-center gap-1\">\n <Clock size={14} />{' '}\n {tx('integrations.connectionDetail.fields.lastUsed', 'Last Used')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatLastUsed(connection.lastUsedAt)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2 border-b border-border-subtle/50\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.healthCheck', 'Health Check')}\n </span>\n <span className=\"text-sm text-text-primary\">\n {formatDate(connection.lastHealthCheck)}\n </span>\n </div>\n <div className=\"flex items-center justify-between py-2\">\n <span className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.fields.created', 'Created')}\n </span>\n <span className=\"text-sm text-text-primary\">{formatDate(connection.createdAt)}</span>\n </div>\n </div>\n </div>\n\n {/* Scopes & Actions */}\n <div className=\"space-y-4\">\n {/* Granted Scopes */}\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Shield size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.scopes', 'Granted Scopes')}\n </h2>\n {connection.grantedScopes.length > 0 ? (\n <div className=\"flex flex-wrap gap-2\">\n {connection.grantedScopes.map((scope) => (\n <span\n key={scope}\n className=\"text-xs px-2.5 py-1 rounded-full bg-bg-sunken text-text-secondary font-mono\"\n >\n {scope}\n </span>\n ))}\n </div>\n ) : (\n <p className=\"text-sm text-text-secondary\">\n {tx('integrations.connectionDetail.scopes.empty', 'No scopes granted.')}\n </p>\n )}\n </div>\n\n {/* Test Result */}\n {testResult && (\n <div\n className={cn(\n 'rounded-xl border p-5',\n testResult.success\n ? 'border-border-default bg-status-success-bg-subtle'\n : 'border-border-default bg-status-error-bg-subtle'\n )}\n >\n <h2\n className={cn(\n 'font-semibold flex items-center gap-2 mb-2',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.success ? <CheckCircle2 size={18} /> : <XCircle size={18} />}\n {testResult.success\n ? tx('integrations.connectionDetail.testResult.passed', 'Connection Test Passed')\n : tx('integrations.connectionDetail.testResult.failed', 'Connection Test Failed')}\n </h2>\n <p\n className={cn(\n 'text-sm',\n testResult.success ? 'text-status-success-text' : 'text-status-error-text'\n )}\n >\n {testResult.message}\n </p>\n <p className=\"text-xs text-text-secondary mt-1\">\n {tx('integrations.connectionDetail.testResult.latency', 'Latency: {latency}ms', {\n latency: testResult.latencyMs,\n })}\n </p>\n </div>\n )}\n\n {usesVaultCredentials && (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n Credential Storage\n </h2>\n <div className=\"space-y-2 text-sm\">\n {connection.vaultId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Vault</span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.vaultId}\n </span>\n </div>\n )}\n {connection.credentialSecretName && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Secret</span>\n <span className=\"font-medium text-text-primary break-all\">\n {connection.credentialSecretName}\n </span>\n </div>\n )}\n {connection.credentialSecretId && (\n <div className=\"flex items-center justify-between gap-3\">\n <span className=\"text-text-secondary\">Secret ID</span>\n <span className=\"font-mono text-xs text-text-primary break-all\">\n {connection.credentialSecretId}\n </span>\n </div>\n )}\n </div>\n </div>\n )}\n\n {/* Actions — hidden entirely when user has no action permissions */}\n {(canUpdate || canDelete) && (\n <div className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5\">\n <h2 className=\"font-semibold text-text-primary flex items-center gap-2 mb-3\">\n <Key size={18} className=\"text-primary\" />\n {tx('integrations.connectionDetail.sections.actions', 'Actions')}\n </h2>\n <div className=\"flex flex-wrap gap-2\">\n <button\n type=\"button\"\n onClick={handleTest}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50\"\n >\n {testing ? <Loader2 size={14} className=\"animate-spin\" /> : <Zap size={14} />}\n {tx('integrations.connectionDetail.actions.test', 'Test Connection')}\n </button>\n {canUpdate && connection.provider.authType === 'oauth2' && canRefreshToken && (\n <button\n type=\"button\"\n onClick={handleRefresh}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-subtle hover:bg-accent transition-colors disabled:opacity-50\"\n >\n {refreshing ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <RotateCcw size={14} />\n )}\n {tx('integrations.connectionDetail.actions.refreshToken', 'Refresh Token')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleRevoke}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-warning-text hover:bg-status-warning-bg-subtle transition-colors disabled:opacity-50\"\n >\n {revoking ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Shield size={14} />\n )}\n {tx('integrations.connectionDetail.actions.revoke', 'Revoke')}\n </button>\n )}\n {canDelete && (\n <button\n type=\"button\"\n onClick={handleDelete}\n disabled={actionLoading}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg border border-border-default text-status-error-text hover:bg-status-error-bg-subtle transition-colors disabled:opacity-50\"\n >\n {deleting ? (\n <Loader2 size={14} className=\"animate-spin\" />\n ) : (\n <Trash2 size={14} />\n )}\n {tx('integrations.connectionDetail.actions.delete', 'Delete')}\n </button>\n )}\n </div>\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,IAAmB;CACjC,IAAM,EAAE,oBAAiB,IAAqC,EACxD,EAAE,cAAW,KAAK,gBAAa,GAAiB,EAChD,EAAE,SAAM,IAAS,EACjB,KAAM,GAAa,GAAkB,MAA6C;EACtF,IAAM,IAAa,EAAE,GAAK,EAAO;AAIjC,SAHI,MAAe,IACd,IAEE,OAAO,QAAQ,EAAO,CAAC,QAC3B,GAAO,CAAC,GAAU,OACjB,EACG,QAAQ,KAAK,EAAS,KAAK,OAAO,EAAW,CAAC,CAC9C,QAAQ,IAAI,EAAS,IAAI,OAAO,EAAW,CAAC,EACjD,EACD,GARmB,IADW;IAY3B,EAAE,eAAY,aAAS,UAAO,eAAY,GAAc,KAAgB,GAAG,EAC3E,EAAE,oBAAgB,S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,WAAU;WAAiB,CAAA,GAAG,kBAAC,IAAD,EAAK,MAAM,IAAM,CAAA,EAC5E,EAAG,8CAA8C,kBAAkB,CAC7D;;SACR,KAAa,EAAW,SAAS,aAAa,YAAY,MACzD,kBAAC,UAAD;UACE,MAAK;UACL,SAAS;UACT,UAAU;UACV,WAAU;oBAJZ,CAMG,IACC,kBAAC,GAAD;WAAS,MAAM;WAAI,WAAU;WAAiB,CAAA,GAE9C,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA,EAExB,EAAG,sDAAsD,gBAAgB,CACnE;;SAEV,KACC,kBAAC,UAAD;UACE,MAAK;UACL,SAAS;UACT,UAAU;UACV,WAAU;oBAJZ,CAMG,IACC,kBAAC,GAAD;WAAS,MAAM;WAAI,WAAU;WAAiB,CAAA,GAE9C,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EAErB,EAAG,gDAAgD,SAAS,CACtD;;SAEV,KACC,kBAAC,UAAD;UACE,MAAK;UACL,SAAS;UACT,UAAU;UACV,WAAU;oBAJZ,CAMG,IACC,kBAAC,GAAD;WAAS,MAAM;WAAI,WAAU;WAAiB,CAAA,GAE9C,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA,EAErB,EAAG,gDAAgD,SAAS,CACtD;;SAEP;UACF;;MAEJ;OACF;;GACF"}
|
|
@@ -116,7 +116,7 @@ function M({ label: e, value: n, icon: r, tone: i = "primary", onClick: a }) {
|
|
|
116
116
|
className: "text-sm font-medium text-text-secondary",
|
|
117
117
|
children: e
|
|
118
118
|
}), /* @__PURE__ */ O("p", {
|
|
119
|
-
className: "text-3xl font-bold text-text-primary mt-1",
|
|
119
|
+
className: "text-3xl font-bold text-text-primary mt-1 tabular-nums",
|
|
120
120
|
children: n
|
|
121
121
|
})] }), /* @__PURE__ */ O("div", {
|
|
122
122
|
className: t("p-3 rounded-xl", o.surface),
|
|
@@ -179,7 +179,7 @@ function N() {
|
|
|
179
179
|
}), /* @__PURE__ */ O("div", { className: "absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0" })]
|
|
180
180
|
}),
|
|
181
181
|
B && /* @__PURE__ */ k("div", {
|
|
182
|
-
className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-
|
|
182
|
+
className: "rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200",
|
|
183
183
|
children: [/* @__PURE__ */ O("div", {
|
|
184
184
|
className: "p-2.5 rounded-lg bg-status-error-bg-subtle",
|
|
185
185
|
children: /* @__PURE__ */ O(f, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrationsOverview.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { formatLastUsed, getStatusDotColor } from '../utils/integrationsHelpers';\nimport type { IntegrationConnection, IntegrationProvider } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection, mapProvider } from '../utils/mappers';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n getProviders(pagination: { limit: 100 }) {\n total\n items {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number; items?: Array<Record<string, unknown>> };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providers = (data?.getProviders?.items ?? []).map((item: Record<string, unknown>) =>\n mapProvider(item)\n );\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providers,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <div\n className={cn(\n 'relative overflow-hidden rounded-xl border border-border-subtle/50 bg-bg-surface p-5',\n 'hover:shadow-md hover:border-primary/30 transition-all duration-200',\n onClick && 'cursor-pointer'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-secondary\">{label}</p>\n <p className=\"text-3xl font-bold text-text-primary mt-1\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n <div className=\"absolute bottom-0 right-0 size-32 bg-gradient-to-tl from-primary/5 to-transparent rounded-full blur-2xl -z-0\" />\n </div>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providers, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = (providers ?? []).length;\n const installedProviders = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed'\n ).length;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providers, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\"\n data-tour=\"integrations-overview-header\"\n >\n <div className=\"relative z-10 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10 backdrop-blur-sm\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tx('integrations.overview.title', 'Integrations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"p-2 rounded-lg hover:bg-accent transition-colors\"\n aria-label={tx('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-text-secondary\" />\n </button>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-300\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tx('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tx('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 animate-pulse\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-bg-sunken rounded\" />\n <div className=\"h-8 w-12 bg-bg-sunken rounded\" />\n </div>\n <div className=\"size-12 bg-bg-sunken rounded-xl\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tx('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tx('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-subtle/50 bg-bg-surface',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-action-primary-bg/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-subtle/50 bg-bg-surface',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <div\n className=\"rounded-xl border border-border-subtle/50 bg-bg-surface overflow-hidden\"\n data-tour=\"integrations-recent-connections\"\n >\n <div className=\"flex items-center justify-between p-5 border-b border-border-subtle/50\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tx('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <div className=\"flex flex-col items-center justify-center py-12 px-6 text-center\">\n <div className=\"p-4 rounded-full bg-bg-sunken/50 mb-4\">\n <Plug size={32} className=\"text-text-secondary\" />\n </div>\n <h3 className=\"font-semibold text-text-primary mb-1\">\n {tx('integrations.overview.empty.title', 'No connections yet')}\n </h3>\n <p className=\"text-sm text-text-secondary mb-4 max-w-sm\">\n {canCreateConnection\n ? tx(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tx(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )}\n </p>\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <Plus size={16} />\n {tx('integrations.overview.actions.addConnection', 'Add Connection')}\n </button>\n )}\n </div>\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border/50\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{conn.name}</p>\n <p className=\"text-xs text-text-secondary truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span className={cn('size-2 rounded-full', getStatusDotColor(conn.status))} />\n <span className=\"text-xs text-text-secondary\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E1B,SAAS,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA4B,GAAgB;EACpF,aAAa;EACb,aAAa;EACb,iBAAiB;EAClB,CAAC;AASF,QAAO;EACL,YARiB,GAAM,cAAc,SAAS,EAAE,EAAE,KAAK,MACvD,EAAY,EAAK,CAClB;EAOC,cANmB,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAAK,MAC3D,EAAc,EAAK,CACpB;EAKC;EACA;EACA;EACD;;AAMH,SAAS,EAAS,EAChB,UACA,UACA,SACA,UAAO,WACP,cAOC;CACD,IAAM,IAAS,EAAiB,EAAK;AAErC,QACE,kBAAC,OAAD;EACE,WAAW,EACT,wFACA,uEACA,KAAW,iBACZ;EACQ;EACT,MAAM,IAAU,WAAW,KAAA;EAC3B,UAAU,IAAU,IAAI,KAAA;EACxB,WACE,KACK,MAAM;AAC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kBAAC,OAAD;SAAK,WAAU;mBACb,kBAAC,GAAD;UAAM,MAAM;UAAI,WAAU;UAAiB,CAAA;SACvC,CAAA;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,KAAD;UAAG,WAAU;oBAAkD,EAAK;UAAS,CAAA,EAC7E,kBAAC,KAAD;UAAG,WAAU;oBAAwC,EAAK,SAAS;UAAS,CAAA,CACxE;;QACN,kBAAC,OAAD;SAAK,WAAU;mBAAf,CACE,kBAAC,QAAD,EAAM,WAAW,EAAG,uBAAuB,EAAkB,EAAK,OAAO,CAAC,EAAI,CAAA,EAC9E,kBAAC,QAAD;UAAM,WAAU;oBACb,EAAe,EAAK,WAAW;UAC3B,CAAA,CACH;;QACF;SAzBC,EAAK,GAyBN,CACN;MACE,CAAA;KAEJ;;GAGN,kBAAC,GAAD;IACE,MAAM;IACN,SAAS;IACT,2BAA2B;AACpB,QAAS;;IAEhB,CAAA;GACE"}
|
|
1
|
+
{"version":3,"file":"IntegrationsOverview.js","names":[],"sources":["../../../src/integrations/pages/IntegrationsOverview.tsx"],"sourcesContent":["import { useMemo } from 'react';\nimport {\n Plug,\n Link2,\n AlertCircle,\n Clock,\n Store,\n Plus,\n ArrowRight,\n RefreshCw,\n Loader2,\n CheckCircle2,\n XCircle,\n LayoutDashboard,\n} from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { useI18n, usePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { INTEGRATION_PERMISSIONS } from '../constants/permissions';\nimport { useIntegrationsStore } from '../store/integrationsStore';\nimport { joinPath } from '../utils/navigation';\nimport { formatLastUsed, getStatusDotColor } from '../utils/integrationsHelpers';\nimport type { IntegrationConnection, IntegrationProvider } from '../types';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { AddConnectionDialog } from '../components/AddConnectionDialog';\nimport { getAccentClasses } from '../utils/appearance';\nimport { mapConnection, mapProvider } from '../utils/mappers';\n\nconst OVERVIEW_QUERY = gql`\n query IntegrationsOverviewQuery {\n getProviders(pagination: { limit: 100 }) {\n total\n items {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n getConnections(pagination: { limit: 100 }) {\n total\n items {\n id\n name\n description\n status\n lastHealthCheck\n lastUsedAt\n errorMessage\n externalAccountId\n externalAccountEmail\n externalAccountName\n grantedScopes\n config\n metadata\n createdBy\n createdAt\n updatedAt\n provider {\n id\n key\n name\n description\n category\n authType\n icon\n color\n website\n docsUrl\n pluginStatus\n pluginVersion\n pluginAuthor\n isBuiltIn\n isEnabled\n displayOrder\n supportedFeatures\n connectionCount\n createdAt\n updatedAt\n }\n }\n }\n }\n`;\n\ninterface OverviewQueryData {\n getProviders?: { total?: number; items?: Array<Record<string, unknown>> };\n getConnections?: { total?: number; items?: Array<Record<string, unknown>> };\n}\n\nfunction useOverviewData() {\n const { data, loading, error, refetch } = useQuery<OverviewQueryData>(OVERVIEW_QUERY, {\n errorPolicy: 'all',\n fetchPolicy: 'cache-first',\n nextFetchPolicy: 'cache-first',\n });\n\n const providers = (data?.getProviders?.items ?? []).map((item: Record<string, unknown>) =>\n mapProvider(item)\n );\n const connections = (data?.getConnections?.items ?? []).map((item: Record<string, unknown>) =>\n mapConnection(item)\n );\n\n return {\n providers,\n connections,\n loading,\n error,\n refetch,\n };\n}\n\n/**\n * Stat card for overview metrics\n */\nfunction StatCard({\n label,\n value,\n icon,\n tone = 'primary',\n onClick,\n}: {\n label: string;\n value: number;\n icon: React.ReactNode;\n tone?: 'primary' | 'success' | 'warning' | 'info' | 'neutral';\n onClick?: () => void;\n}) {\n const accent = getAccentClasses(tone);\n\n return (\n <div\n className={cn(\n 'relative overflow-hidden rounded-xl border border-border-subtle/50 bg-bg-surface p-5',\n 'hover:shadow-md hover:border-primary/30 transition-all duration-200',\n onClick && 'cursor-pointer'\n )}\n onClick={onClick}\n role={onClick ? 'button' : undefined}\n tabIndex={onClick ? 0 : undefined}\n onKeyDown={\n onClick\n ? (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick();\n }\n }\n : undefined\n }\n >\n <div className=\"flex items-center justify-between\">\n <div>\n <p className=\"text-sm font-medium text-text-secondary\">{label}</p>\n <p className=\"text-3xl font-bold text-text-primary mt-1 tabular-nums\">{value}</p>\n </div>\n <div className={cn('p-3 rounded-xl', accent.surface)}>{icon}</div>\n </div>\n <div className=\"absolute bottom-0 right-0 size-32 bg-gradient-to-tl from-primary/5 to-transparent rounded-full blur-2xl -z-0\" />\n </div>\n );\n}\n\n/**\n * Integrations Overview — Dashboard page with stats, recent connections, and quick actions.\n */\nexport function IntegrationsOverview() {\n const { basePath = '/', navigate } = useIntegrations();\n const { t } = useI18n();\n const tx = (key: string, fallback: string, params?: Record<string, string | number>) => {\n const translated = t(key, params);\n if (translated !== key) return translated;\n if (!params) return fallback;\n\n return Object.entries(params).reduce(\n (value, [paramKey, paramValue]) =>\n value\n .replace(`{{${paramKey}}}`, String(paramValue))\n .replace(`{${paramKey}}`, String(paramValue)),\n fallback\n );\n };\n const { addConnectionDialogOpen, openAddConnectionDialog, closeAddConnectionDialog } =\n useIntegrationsStore();\n const { hasPermission, isLoading: permissionsLoading } = usePermissions();\n const canCreateConnection =\n !permissionsLoading && hasPermission(INTEGRATION_PERMISSIONS.CONNECTION_CREATE);\n\n const { providers, connections, loading, error, refetch } = useOverviewData();\n\n // Compute stats\n const stats = useMemo(() => {\n const totalProviders = (providers ?? []).length;\n const installedProviders = (providers ?? []).filter(\n (p: IntegrationProvider) => p.pluginStatus === 'installed'\n ).length;\n const activeConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'active'\n ).length;\n const pendingAuth = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'pending_auth'\n ).length;\n const errorConnections = (connections ?? []).filter(\n (c: IntegrationConnection) => c.status === 'error'\n ).length;\n\n return { totalProviders, installedProviders, activeConnections, pendingAuth, errorConnections };\n }, [providers, connections]);\n\n // Recent connections (last 5 by updatedAt)\n const recentConnections = useMemo(() => {\n return [...(connections ?? [])]\n .sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime())\n .slice(0, 5);\n }, [connections]);\n\n const handleNavigate = (path: string) => {\n if (!navigate) return;\n navigate(joinPath(basePath, path));\n };\n\n return (\n <div className=\"space-y-6 p-6 max-w-7xl mx-auto\">\n {/* Header */}\n <div\n className=\"relative overflow-hidden rounded-xl bg-gradient-to-br from-primary/5 via-primary/3 to-background border border-border-subtle/50 p-6 shadow-sm\"\n data-tour=\"integrations-overview-header\"\n >\n <div className=\"relative z-10 flex items-center justify-between\">\n <div className=\"flex items-center gap-3\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10 backdrop-blur-sm\">\n <LayoutDashboard size={24} className=\"text-primary\" />\n </div>\n <div>\n <h1 className=\"text-2xl sm:text-3xl font-bold text-text-primary\">\n {tx('integrations.overview.title', 'Integrations')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.subtitle',\n 'Connect your workspace to external services and tools'\n )}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"p-2 rounded-lg hover:bg-accent transition-colors\"\n aria-label={tx('integrations.overview.actions.refreshAriaLabel', 'Refresh')}\n >\n <RefreshCw size={18} className=\"text-text-secondary\" />\n </button>\n </div>\n </div>\n <div className=\"absolute top-0 right-0 size-64 bg-gradient-to-br from-primary/10 to-transparent rounded-full blur-3xl -z-0\" />\n </div>\n\n {/* Error State */}\n {error && (\n <div className=\"rounded-xl border border-border-default bg-status-error-bg-subtle p-5 flex items-start gap-4 animate-in fade-in-0 duration-200\">\n <div className=\"p-2.5 rounded-lg bg-status-error-bg-subtle\">\n <AlertCircle size={24} className=\"text-status-error-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-status-error-text mb-1\">\n {tx('integrations.overview.error.title', 'Failed to load integrations data')}\n </h3>\n <p className=\"text-sm text-status-error-text mb-3\">{error.message}</p>\n <button\n type=\"button\"\n onClick={() => {\n void refetch();\n }}\n className=\"inline-flex items-center gap-2 px-3 py-1.5 text-sm font-medium rounded-lg bg-status-error-bg-subtle text-status-error-text hover:bg-status-error-bg-subtle/80 transition-colors\"\n >\n <RefreshCw size={14} />\n {tx('integrations.overview.error.retry', 'Try Again')}\n </button>\n </div>\n </div>\n )}\n\n {/* Loading State */}\n {loading && !error && (\n <div className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\">\n {[...Array(4)].map((_, i) => (\n <div key={i} className=\"rounded-xl border border-border-subtle/50 bg-bg-surface p-5 animate-pulse\">\n <div className=\"flex items-center justify-between\">\n <div className=\"space-y-2\">\n <div className=\"h-3 w-20 bg-bg-sunken rounded\" />\n <div className=\"h-8 w-12 bg-bg-sunken rounded\" />\n </div>\n <div className=\"size-12 bg-bg-sunken rounded-xl\" />\n </div>\n </div>\n ))}\n </div>\n )}\n\n {/* Stats Cards */}\n {!loading && !error && (\n <div\n className=\"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4\"\n data-tour=\"integrations-stats-cards\"\n >\n <StatCard\n label={tx('integrations.overview.stats.installedProviders', 'Installed Providers')}\n value={stats.installedProviders}\n icon={<Store size={24} className=\"text-primary\" />}\n tone=\"primary\"\n onClick={() => handleNavigate('providers')}\n />\n <StatCard\n label={tx('integrations.overview.stats.activeConnections', 'Active Connections')}\n value={stats.activeConnections}\n icon={<CheckCircle2 size={24} className=\"text-status-success-text\" />}\n tone=\"success\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.pendingAuth', 'Pending Auth')}\n value={stats.pendingAuth}\n icon={<Clock size={24} className=\"text-status-warning-text\" />}\n tone=\"warning\"\n onClick={() => handleNavigate('connections')}\n />\n <StatCard\n label={tx('integrations.overview.stats.errors', 'Errors')}\n value={stats.errorConnections}\n icon={<XCircle size={24} className=\"text-status-error-text\" />}\n tone=\"neutral\"\n onClick={() => handleNavigate('connections')}\n />\n </div>\n )}\n\n {/* Quick Actions */}\n <div className=\"grid grid-cols-1 sm:grid-cols-2 gap-4\" data-tour=\"integrations-quick-actions\">\n <button\n type=\"button\"\n onClick={() => handleNavigate('providers')}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-subtle/50 bg-bg-surface',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-action-primary-bg/10\">\n <Store size={24} className=\"text-primary\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.browseProviders.title', 'Browse Providers')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.browseProviders.description',\n 'Discover and install integration plugins'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className={cn(\n 'flex items-center gap-4 p-5 rounded-xl border border-border-subtle/50 bg-bg-surface',\n 'hover:bg-accent/30 hover:border-primary/30 hover:shadow-md',\n 'text-left transition-all duration-200 group'\n )}\n >\n <div className=\"p-3 rounded-xl bg-status-success-bg-subtle\">\n <Plus size={24} className=\"text-status-success-text\" />\n </div>\n <div className=\"flex-1\">\n <h3 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.quickActions.addConnection.title', 'Add Connection')}\n </h3>\n <p className=\"text-sm text-text-secondary mt-0.5\">\n {tx(\n 'integrations.overview.quickActions.addConnection.description',\n 'Connect to an external service'\n )}\n </p>\n </div>\n <ArrowRight\n size={18}\n className=\"text-text-secondary group-hover:text-primary transition-colors\"\n />\n </button>\n )}\n </div>\n\n {/* Recent Connections */}\n <div\n className=\"rounded-xl border border-border-subtle/50 bg-bg-surface overflow-hidden\"\n data-tour=\"integrations-recent-connections\"\n >\n <div className=\"flex items-center justify-between p-5 border-b border-border-subtle/50\">\n <div className=\"flex items-center gap-2\">\n <Link2 size={18} className=\"text-primary\" />\n <h2 className=\"font-semibold text-text-primary\">\n {tx('integrations.overview.recentConnections.title', 'Recent Connections')}\n </h2>\n </div>\n <button\n type=\"button\"\n onClick={() => handleNavigate('connections')}\n className=\"text-sm text-primary hover:underline\"\n >\n {tx('integrations.overview.recentConnections.viewAll', 'View all')}\n </button>\n </div>\n\n {loading && (\n <div className=\"flex items-center justify-center py-12\">\n <Loader2 size={24} className=\"animate-spin text-text-secondary\" />\n </div>\n )}\n\n {!loading && recentConnections.length === 0 && (\n <div className=\"flex flex-col items-center justify-center py-12 px-6 text-center\">\n <div className=\"p-4 rounded-full bg-bg-sunken/50 mb-4\">\n <Plug size={32} className=\"text-text-secondary\" />\n </div>\n <h3 className=\"font-semibold text-text-primary mb-1\">\n {tx('integrations.overview.empty.title', 'No connections yet')}\n </h3>\n <p className=\"text-sm text-text-secondary mb-4 max-w-sm\">\n {canCreateConnection\n ? tx(\n 'integrations.overview.empty.canCreateDescription',\n 'Create your first connection to start integrating with external services.'\n )\n : tx(\n 'integrations.overview.empty.readOnlyDescription',\n 'No connections have been configured yet.'\n )}\n </p>\n {canCreateConnection && (\n <button\n type=\"button\"\n onClick={() => openAddConnectionDialog()}\n className=\"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium rounded-lg bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors\"\n >\n <Plus size={16} />\n {tx('integrations.overview.actions.addConnection', 'Add Connection')}\n </button>\n )}\n </div>\n )}\n\n {!loading && recentConnections.length > 0 && (\n <div className=\"divide-y divide-border/50\">\n {recentConnections.map((conn) => (\n <div\n key={conn.id}\n className=\"flex items-center gap-4 px-5 py-3.5 hover:bg-accent/30 cursor-pointer transition-colors\"\n onClick={() => handleNavigate(`connections/${conn.id}`)}\n role=\"button\"\n tabIndex={0}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleNavigate(`connections/${conn.id}`);\n }\n }}\n >\n <div className=\"size-8 rounded-lg flex items-center justify-center flex-shrink-0 bg-action-primary-bg/10\">\n <Plug size={16} className=\"text-primary\" />\n </div>\n <div className=\"flex-1 min-w-0\">\n <p className=\"text-sm font-medium text-text-primary truncate\">{conn.name}</p>\n <p className=\"text-xs text-text-secondary truncate\">{conn.provider.name}</p>\n </div>\n <div className=\"flex items-center gap-2 flex-shrink-0\">\n <span className={cn('size-2 rounded-full', getStatusDotColor(conn.status))} />\n <span className=\"text-xs text-text-secondary\">\n {formatLastUsed(conn.lastUsedAt)}\n </span>\n </div>\n </div>\n ))}\n </div>\n )}\n </div>\n\n {/* Add Connection Dialog */}\n <AddConnectionDialog\n open={addConnectionDialogOpen}\n onClose={closeAddConnectionDialog}\n onConnectionCreated={() => {\n void refetch();\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA6BA,IAAM,IAAiB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8E1B,SAAS,IAAkB;CACzB,IAAM,EAAE,SAAM,YAAS,UAAO,eAAY,EAA4B,GAAgB;EACpF,aAAa;EACb,aAAa;EACb,iBAAiB;EAClB,CAAC;AASF,QAAO;EACL,YARiB,GAAM,cAAc,SAAS,EAAE,EAAE,KAAK,MACvD,EAAY,EAAK,CAClB;EAOC,cANmB,GAAM,gBAAgB,SAAS,EAAE,EAAE,KAAK,MAC3D,EAAc,EAAK,CACpB;EAKC;EACA;EACA;EACD;;AAMH,SAAS,EAAS,EAChB,UACA,UACA,SACA,UAAO,WACP,cAOC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