@burdenoff/microfe-planmagnet 2026.930.19 → 2026.930.20
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/index.js +2 -1
- package/dist/planmagnet/PlanMagnetRoutes.d.ts.map +1 -1
- package/dist/planmagnet/PlanMagnetRoutes.js +17 -5
- package/dist/planmagnet/PlanMagnetRoutes.js.map +1 -1
- package/dist/planmagnet/controls/SyncControls.d.ts +101 -0
- package/dist/planmagnet/controls/SyncControls.d.ts.map +1 -0
- package/dist/planmagnet/controls/SyncControls.js +616 -0
- package/dist/planmagnet/controls/SyncControls.js.map +1 -0
- package/dist/planmagnet/index.d.ts +1 -0
- package/dist/planmagnet/index.d.ts.map +1 -1
- package/dist/planmagnet/index.js +1 -0
- package/dist/planmagnet/integrations/routes.d.ts +13 -0
- package/dist/planmagnet/integrations/routes.d.ts.map +1 -0
- package/dist/planmagnet/integrations/routes.js +9 -0
- package/dist/planmagnet/integrations/routes.js.map +1 -0
- package/dist/planmagnet/integrations/syncTypes.d.ts +143 -0
- package/dist/planmagnet/integrations/syncTypes.d.ts.map +1 -0
- package/dist/planmagnet/integrations/syncTypes.js +71 -0
- package/dist/planmagnet/integrations/syncTypes.js.map +1 -0
- package/dist/planmagnet/integrations/useSyncProviderCapabilities.d.ts +8 -0
- package/dist/planmagnet/integrations/useSyncProviderCapabilities.d.ts.map +1 -0
- package/dist/planmagnet/integrations/useSyncProviderCapabilities.js +27 -0
- package/dist/planmagnet/integrations/useSyncProviderCapabilities.js.map +1 -0
- package/dist/planmagnet/pages/IntegrationsNewSyncPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/IntegrationsNewSyncPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/IntegrationsNewSyncPagePage.js +411 -0
- package/dist/planmagnet/pages/IntegrationsNewSyncPagePage.js.map +1 -0
- package/dist/planmagnet/pages/IntegrationsSyncDetailPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/IntegrationsSyncDetailPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/IntegrationsSyncDetailPagePage.js +593 -0
- package/dist/planmagnet/pages/IntegrationsSyncDetailPagePage.js.map +1 -0
- package/dist/planmagnet/pages/IntegrationsSyncsPagePage.d.ts +2 -0
- package/dist/planmagnet/pages/IntegrationsSyncsPagePage.d.ts.map +1 -0
- package/dist/planmagnet/pages/IntegrationsSyncsPagePage.js +267 -0
- package/dist/planmagnet/pages/IntegrationsSyncsPagePage.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { usePlanMagnet as e, usePlanMagnetNavigate as t } from "../providers/PlanMagnetProvider.js";
|
|
2
|
+
import { enumLabel as n } from "../controls/WorkItemControls.js";
|
|
3
|
+
import { ProjectSelect as r } from "../controls/Pickers.js";
|
|
4
|
+
import { detailPath as i, rowLinkProps as a, stopRowActivation as o } from "../utils/rowNavigation.js";
|
|
5
|
+
import { SYNC_STATUSES as s, directionLabel as c, providerLabel as l } from "../integrations/syncTypes.js";
|
|
6
|
+
import { PauseResumeButton as u, RunNowButton as d, SyncHealthSummary as f, SyncRunResultSummary as p, SyncStatusBadge as m, TruncatedText as h } from "../controls/SyncControls.js";
|
|
7
|
+
import { useDeferredValue as g, useState as _ } from "react";
|
|
8
|
+
import { ExternalLink as v, Plug as y, Plus as b, Search as x } from "lucide-react";
|
|
9
|
+
import { gql as S } from "@apollo/client";
|
|
10
|
+
import { useQuery as C } from "@apollo/client/react";
|
|
11
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
12
|
+
import { Button as E, EmptyState as D, Input as O } from "@burdenoff/fe-libs/ui";
|
|
13
|
+
//#region src/planmagnet/pages/IntegrationsSyncsPagePage.tsx
|
|
14
|
+
var k = 20, A = ["ALL", ...s], j = S`
|
|
15
|
+
query SyncsList(
|
|
16
|
+
$workspaceId: ID!
|
|
17
|
+
$filter: PlanmagnetExternalSyncFilter
|
|
18
|
+
$pagination: PlanmagnetPaginationInput
|
|
19
|
+
) {
|
|
20
|
+
planmagnetExternalSyncs(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {
|
|
21
|
+
totalCount
|
|
22
|
+
pageInfo {
|
|
23
|
+
hasNextPage
|
|
24
|
+
endCursor
|
|
25
|
+
}
|
|
26
|
+
items {
|
|
27
|
+
id
|
|
28
|
+
provider
|
|
29
|
+
direction
|
|
30
|
+
status
|
|
31
|
+
projectId
|
|
32
|
+
project {
|
|
33
|
+
id
|
|
34
|
+
name
|
|
35
|
+
}
|
|
36
|
+
externalProjectId
|
|
37
|
+
externalProjectUrl
|
|
38
|
+
conflictStrategy
|
|
39
|
+
fieldMapping
|
|
40
|
+
lastSyncedAt
|
|
41
|
+
lastSyncError
|
|
42
|
+
totalItemsSynced
|
|
43
|
+
createdAt
|
|
44
|
+
updatedAt
|
|
45
|
+
runHealth {
|
|
46
|
+
lastRunAt
|
|
47
|
+
lastStatus
|
|
48
|
+
consecutiveFailures
|
|
49
|
+
runsLast7Days
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
function M() {
|
|
56
|
+
let { workspaceId: s } = e(), S = t(), [M, N] = _(""), [P, F] = _(""), [I, L] = _("ALL"), [R, z] = _(!1), [B, V] = _({}), H = g(M.trim()), U = {
|
|
57
|
+
...H ? { search: H } : {},
|
|
58
|
+
...P ? { projectId: P } : {},
|
|
59
|
+
...I === "ALL" ? {} : { status: I }
|
|
60
|
+
}, { data: W, loading: G, error: K, fetchMore: q } = C(j, {
|
|
61
|
+
variables: {
|
|
62
|
+
workspaceId: s ?? "",
|
|
63
|
+
filter: U,
|
|
64
|
+
pagination: { first: k }
|
|
65
|
+
},
|
|
66
|
+
skip: !s,
|
|
67
|
+
fetchPolicy: "cache-and-network"
|
|
68
|
+
}), J = W?.planmagnetExternalSyncs, Y = J?.items ?? [], X = H !== "" || P !== "" || I !== "ALL", Z = !!J && Y.length === 0 && !X, Q = async () => {
|
|
69
|
+
let e = J?.pageInfo.endCursor;
|
|
70
|
+
if (e) {
|
|
71
|
+
z(!0);
|
|
72
|
+
try {
|
|
73
|
+
await q({
|
|
74
|
+
variables: { pagination: {
|
|
75
|
+
first: k,
|
|
76
|
+
after: e
|
|
77
|
+
} },
|
|
78
|
+
updateQuery: (e, { fetchMoreResult: t }) => ({ planmagnetExternalSyncs: {
|
|
79
|
+
...t.planmagnetExternalSyncs,
|
|
80
|
+
items: [...e.planmagnetExternalSyncs.items, ...t.planmagnetExternalSyncs.items]
|
|
81
|
+
} })
|
|
82
|
+
});
|
|
83
|
+
} finally {
|
|
84
|
+
z(!1);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
return /* @__PURE__ */ T("div", {
|
|
89
|
+
className: "space-y-6 p-6",
|
|
90
|
+
"data-testid": "sync-list",
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ T("div", {
|
|
93
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
94
|
+
children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ T("h1", {
|
|
95
|
+
className: "text-2xl font-semibold flex items-center gap-2",
|
|
96
|
+
children: [/* @__PURE__ */ w(y, { className: "h-5 w-5 text-primary" }), "Integrations"]
|
|
97
|
+
}), /* @__PURE__ */ w("p", {
|
|
98
|
+
className: "text-sm text-muted-foreground",
|
|
99
|
+
children: J ? `${J.totalCount} sync${J.totalCount === 1 ? "" : "s"}` : "Keep a project in step with an external issue tracker"
|
|
100
|
+
})] }), !Z && /* @__PURE__ */ T(E, {
|
|
101
|
+
size: "sm",
|
|
102
|
+
onClick: () => S("/integrations/new-sync-page"),
|
|
103
|
+
"data-testid": "sync-setup",
|
|
104
|
+
children: [/* @__PURE__ */ w(b, { className: "mr-1 h-4 w-4" }), "Set up a sync"]
|
|
105
|
+
})]
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ T("div", {
|
|
108
|
+
className: "flex flex-wrap items-center gap-3",
|
|
109
|
+
children: [/* @__PURE__ */ T("div", {
|
|
110
|
+
className: "relative w-full max-w-sm",
|
|
111
|
+
children: [/* @__PURE__ */ w(x, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ w(O, {
|
|
112
|
+
"aria-label": "Search syncs",
|
|
113
|
+
placeholder: "Search by external project",
|
|
114
|
+
className: "pl-8",
|
|
115
|
+
value: M,
|
|
116
|
+
"data-testid": "sync-list-search",
|
|
117
|
+
onChange: (e) => N(e.target.value)
|
|
118
|
+
})]
|
|
119
|
+
}), /* @__PURE__ */ w("div", {
|
|
120
|
+
className: "w-48",
|
|
121
|
+
"data-testid": "sync-list-project-filter",
|
|
122
|
+
children: /* @__PURE__ */ w(r, {
|
|
123
|
+
id: "sync-list-filter-project",
|
|
124
|
+
value: P,
|
|
125
|
+
onChange: F,
|
|
126
|
+
noneLabel: "Any project"
|
|
127
|
+
})
|
|
128
|
+
})]
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ w("div", {
|
|
131
|
+
className: "flex flex-wrap gap-1",
|
|
132
|
+
role: "group",
|
|
133
|
+
"aria-label": "Filter by status",
|
|
134
|
+
children: A.map((e) => /* @__PURE__ */ w("button", {
|
|
135
|
+
type: "button",
|
|
136
|
+
"aria-pressed": I === e,
|
|
137
|
+
"data-testid": `sync-list-status-${e}`,
|
|
138
|
+
onClick: () => L(e),
|
|
139
|
+
className: `px-3 py-1.5 text-sm rounded-md ${I === e ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted"}`,
|
|
140
|
+
children: e === "ALL" ? "All" : n(e)
|
|
141
|
+
}, e))
|
|
142
|
+
}),
|
|
143
|
+
K && /* @__PURE__ */ T("p", {
|
|
144
|
+
role: "alert",
|
|
145
|
+
className: "text-sm text-destructive",
|
|
146
|
+
children: ["Syncs could not be loaded: ", K.message]
|
|
147
|
+
}),
|
|
148
|
+
G && !W && /* @__PURE__ */ w("p", {
|
|
149
|
+
className: "text-sm text-muted-foreground",
|
|
150
|
+
children: "Loading syncs…"
|
|
151
|
+
}),
|
|
152
|
+
J && Y.length === 0 && /* @__PURE__ */ w(D, {
|
|
153
|
+
icon: /* @__PURE__ */ w(y, { className: "h-8 w-8 text-muted-foreground" }),
|
|
154
|
+
title: X ? "No syncs match" : "No syncs yet",
|
|
155
|
+
description: "A sync keeps a project's work items in step with an external tool such as GitHub Issues — created, updated, and resolved on both sides.",
|
|
156
|
+
action: Z ? /* @__PURE__ */ T(E, {
|
|
157
|
+
size: "sm",
|
|
158
|
+
onClick: () => S("/integrations/new-sync-page"),
|
|
159
|
+
"data-testid": "sync-setup-empty",
|
|
160
|
+
children: [/* @__PURE__ */ w(b, { className: "mr-1 h-4 w-4" }), "Set up a sync"]
|
|
161
|
+
}) : void 0
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ w("ul", {
|
|
164
|
+
className: "space-y-3",
|
|
165
|
+
children: Y.map((e) => {
|
|
166
|
+
let t = a(() => S(i("/integrations/sync-detail-page", e.id)), `${l(e.provider)} sync for ${e.project?.name ?? "unknown project"}`);
|
|
167
|
+
return /* @__PURE__ */ T("li", {
|
|
168
|
+
"data-testid": "sync-row",
|
|
169
|
+
...t,
|
|
170
|
+
className: `rounded-md border p-4 space-y-2 ${t.className}`,
|
|
171
|
+
children: [/* @__PURE__ */ T("div", {
|
|
172
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
173
|
+
children: [/* @__PURE__ */ T("div", {
|
|
174
|
+
className: "min-w-0 space-y-1",
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ T("div", {
|
|
177
|
+
className: "flex flex-wrap items-center gap-2",
|
|
178
|
+
children: [
|
|
179
|
+
/* @__PURE__ */ w("span", {
|
|
180
|
+
className: "text-sm font-medium",
|
|
181
|
+
children: l(e.provider)
|
|
182
|
+
}),
|
|
183
|
+
/* @__PURE__ */ w(m, { status: e.status }),
|
|
184
|
+
/* @__PURE__ */ w("span", {
|
|
185
|
+
className: "text-xs text-muted-foreground",
|
|
186
|
+
children: c(e.direction)
|
|
187
|
+
})
|
|
188
|
+
]
|
|
189
|
+
}),
|
|
190
|
+
/* @__PURE__ */ T("p", {
|
|
191
|
+
className: "text-xs text-muted-foreground",
|
|
192
|
+
children: [
|
|
193
|
+
e.project?.name ?? "Unknown project",
|
|
194
|
+
" · ",
|
|
195
|
+
e.externalProjectUrl ? /* @__PURE__ */ T("a", {
|
|
196
|
+
href: e.externalProjectUrl,
|
|
197
|
+
target: "_blank",
|
|
198
|
+
rel: "noreferrer noopener",
|
|
199
|
+
className: "inline-flex items-center gap-1 text-primary hover:underline",
|
|
200
|
+
onClick: o,
|
|
201
|
+
children: [e.externalProjectId, /* @__PURE__ */ w(v, { className: "h-3 w-3" })]
|
|
202
|
+
}) : e.externalProjectId,
|
|
203
|
+
" · ",
|
|
204
|
+
e.totalItemsSynced,
|
|
205
|
+
" item",
|
|
206
|
+
e.totalItemsSynced === 1 ? "" : "s",
|
|
207
|
+
" synced"
|
|
208
|
+
]
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ w(f, { health: e.runHealth }),
|
|
211
|
+
e.lastSyncError && /* @__PURE__ */ w("p", {
|
|
212
|
+
className: "text-xs text-status-error-text",
|
|
213
|
+
"data-testid": "sync-row-last-error",
|
|
214
|
+
children: /* @__PURE__ */ w(h, {
|
|
215
|
+
text: e.lastSyncError,
|
|
216
|
+
max: 120,
|
|
217
|
+
className: "text-status-error-text"
|
|
218
|
+
})
|
|
219
|
+
})
|
|
220
|
+
]
|
|
221
|
+
}), /* @__PURE__ */ T("div", {
|
|
222
|
+
className: "flex shrink-0 flex-wrap items-center gap-2",
|
|
223
|
+
onClick: o,
|
|
224
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
225
|
+
children: [
|
|
226
|
+
/* @__PURE__ */ w(d, {
|
|
227
|
+
syncId: e.id,
|
|
228
|
+
onResult: (t) => V((n) => ({
|
|
229
|
+
...n,
|
|
230
|
+
[e.id]: t
|
|
231
|
+
}))
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ w(u, {
|
|
234
|
+
syncId: e.id,
|
|
235
|
+
status: e.status
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ w(E, {
|
|
238
|
+
size: "sm",
|
|
239
|
+
variant: "ghost",
|
|
240
|
+
onClick: () => S(i("/integrations/sync-detail-page", e.id)),
|
|
241
|
+
children: "Open"
|
|
242
|
+
})
|
|
243
|
+
]
|
|
244
|
+
})]
|
|
245
|
+
}), B[e.id] && /* @__PURE__ */ w("div", {
|
|
246
|
+
onClick: o,
|
|
247
|
+
onKeyDown: (e) => e.stopPropagation(),
|
|
248
|
+
children: /* @__PURE__ */ w(p, { result: B[e.id] })
|
|
249
|
+
})]
|
|
250
|
+
}, e.id);
|
|
251
|
+
})
|
|
252
|
+
}),
|
|
253
|
+
J?.pageInfo.hasNextPage && /* @__PURE__ */ w(E, {
|
|
254
|
+
size: "sm",
|
|
255
|
+
variant: "outline",
|
|
256
|
+
onClick: () => void Q(),
|
|
257
|
+
disabled: R,
|
|
258
|
+
"data-testid": "sync-list-more",
|
|
259
|
+
children: R ? "Loading…" : `Show more (${Y.length} of ${J.totalCount})`
|
|
260
|
+
})
|
|
261
|
+
]
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
export { M as IntegrationsSyncsPagePage };
|
|
266
|
+
|
|
267
|
+
//# sourceMappingURL=IntegrationsSyncsPagePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntegrationsSyncsPagePage.js","names":[],"sources":["../../../src/planmagnet/pages/IntegrationsSyncsPagePage.tsx"],"sourcesContent":["import { useDeferredValue, useState } from 'react';\nimport { gql } from '@apollo/client';\nimport { useQuery } from '@apollo/client/react';\nimport { Button, EmptyState, Input } from '@burdenoff/fe-libs/ui';\nimport { ExternalLink, Plug, Plus, Search } from 'lucide-react';\nimport { usePlanMagnet, usePlanMagnetNavigate } from '../providers/PlanMagnetProvider';\nimport { ProjectSelect } from '../controls/Pickers';\nimport { enumLabel } from '../controls/WorkItemControls';\nimport {\n PauseResumeButton,\n RunNowButton,\n SyncHealthSummary,\n SyncRunResultSummary,\n SyncStatusBadge,\n TruncatedText,\n} from '../controls/SyncControls';\nimport {\n providerLabel,\n directionLabel,\n type ExternalSyncRow,\n type SyncRunResult,\n SYNC_STATUSES,\n} from '../integrations/syncTypes';\nimport { detailPath, rowLinkProps, stopRowActivation } from '../utils/rowNavigation';\n\n/**\n * Integrations (sync) list (AUT-08/40/09): every ExternalSync of the workspace, with its live health and the\n * actions that don't need the detail page — run now, pause/resume, open. Backend\n * (planmagnetExternalSyncs/CreateExternalSync/…/ResolveSyncConflict) is real and prod-verified for GITHUB\n * (BOFF-4446, AUT-04..25) — this is the page that makes it reachable.\n */\n\nconst PAGE = 20;\nconst STATUS_FILTERS = ['ALL', ...SYNC_STATUSES] as const;\n\nconst SYNCS_LIST = gql`\n query SyncsList(\n $workspaceId: ID!\n $filter: PlanmagnetExternalSyncFilter\n $pagination: PlanmagnetPaginationInput\n ) {\n planmagnetExternalSyncs(workspaceId: $workspaceId, filter: $filter, pagination: $pagination) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n items {\n id\n provider\n direction\n status\n projectId\n project {\n id\n name\n }\n externalProjectId\n externalProjectUrl\n conflictStrategy\n fieldMapping\n lastSyncedAt\n lastSyncError\n totalItemsSynced\n createdAt\n updatedAt\n runHealth {\n lastRunAt\n lastStatus\n consecutiveFailures\n runsLast7Days\n }\n }\n }\n }\n`;\n\nexport function IntegrationsSyncsPagePage() {\n const { workspaceId } = usePlanMagnet();\n const navigate = usePlanMagnetNavigate();\n const [search, setSearch] = useState('');\n const [projectId, setProjectId] = useState('');\n const [status, setStatus] = useState<(typeof STATUS_FILTERS)[number]>('ALL');\n const [loadingMore, setLoadingMore] = useState(false);\n const [runResults, setRunResults] = useState<Record<string, SyncRunResult>>({});\n const term = useDeferredValue(search.trim());\n\n const filter = {\n ...(term ? { search: term } : {}),\n ...(projectId ? { projectId } : {}),\n ...(status !== 'ALL' ? { status } : {}),\n };\n\n const { data, loading, error, fetchMore } = useQuery<{\n planmagnetExternalSyncs: {\n totalCount: number;\n pageInfo: { hasNextPage: boolean; endCursor: string | null };\n items: ExternalSyncRow[];\n };\n }>(SYNCS_LIST, {\n variables: { workspaceId: workspaceId ?? '', filter, pagination: { first: PAGE } },\n skip: !workspaceId,\n fetchPolicy: 'cache-and-network',\n });\n\n const list = data?.planmagnetExternalSyncs;\n const syncs = list?.items ?? [];\n const filtersActive = term !== '' || projectId !== '' || status !== 'ALL';\n // Mirrors QualityGates/Templates pages' own gate: the EmptyState's own \"Set up a sync\" action replaces the\n // header's button only once the list is confirmed empty AND unfiltered, so the two never render together.\n const showsEmptyStateAction = !!list && syncs.length === 0 && !filtersActive;\n\n const loadMore = async () => {\n const after = list?.pageInfo.endCursor;\n if (!after) return;\n setLoadingMore(true);\n try {\n await fetchMore({\n variables: { pagination: { first: PAGE, after } },\n updateQuery: (prev, { fetchMoreResult }) => ({\n planmagnetExternalSyncs: {\n ...fetchMoreResult.planmagnetExternalSyncs,\n items: [\n ...prev.planmagnetExternalSyncs.items,\n ...fetchMoreResult.planmagnetExternalSyncs.items,\n ],\n },\n }),\n });\n } finally {\n setLoadingMore(false);\n }\n };\n\n return (\n <div className=\"space-y-6 p-6\" data-testid=\"sync-list\">\n <div className=\"flex flex-wrap items-center justify-between gap-3\">\n <div>\n <h1 className=\"text-2xl font-semibold flex items-center gap-2\">\n <Plug className=\"h-5 w-5 text-primary\" />\n Integrations\n </h1>\n <p className=\"text-sm text-muted-foreground\">\n {list\n ? `${list.totalCount} sync${list.totalCount === 1 ? '' : 's'}`\n : 'Keep a project in step with an external issue tracker'}\n </p>\n </div>\n {!showsEmptyStateAction && (\n <Button\n size=\"sm\"\n onClick={() => navigate('/integrations/new-sync-page')}\n data-testid=\"sync-setup\"\n >\n <Plus className=\"mr-1 h-4 w-4\" />\n Set up a sync\n </Button>\n )}\n </div>\n\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"relative w-full max-w-sm\">\n <Search className=\"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground\" />\n <Input\n aria-label=\"Search syncs\"\n placeholder=\"Search by external project\"\n className=\"pl-8\"\n value={search}\n data-testid=\"sync-list-search\"\n onChange={(e) => setSearch(e.target.value)}\n />\n </div>\n <div className=\"w-48\" data-testid=\"sync-list-project-filter\">\n <ProjectSelect\n id=\"sync-list-filter-project\"\n value={projectId}\n onChange={setProjectId}\n noneLabel=\"Any project\"\n />\n </div>\n </div>\n <div className=\"flex flex-wrap gap-1\" role=\"group\" aria-label=\"Filter by status\">\n {STATUS_FILTERS.map((s) => (\n <button\n key={s}\n type=\"button\"\n aria-pressed={status === s}\n data-testid={`sync-list-status-${s}`}\n onClick={() => setStatus(s)}\n className={`px-3 py-1.5 text-sm rounded-md ${status === s ? 'bg-primary text-primary-foreground' : 'text-muted-foreground hover:bg-muted'}`}\n >\n {s === 'ALL' ? 'All' : enumLabel(s)}\n </button>\n ))}\n </div>\n\n {error && (\n <p role=\"alert\" className=\"text-sm text-destructive\">\n Syncs could not be loaded: {error.message}\n </p>\n )}\n {/* Only before the first load: a refetch after an action must not blank the page. */}\n {loading && !data && <p className=\"text-sm text-muted-foreground\">Loading syncs…</p>}\n {list && syncs.length === 0 && (\n <EmptyState\n icon={<Plug className=\"h-8 w-8 text-muted-foreground\" />}\n title={filtersActive ? 'No syncs match' : 'No syncs yet'}\n description=\"A sync keeps a project's work items in step with an external tool such as GitHub Issues — created, updated, and resolved on both sides.\"\n action={\n showsEmptyStateAction ? (\n <Button\n size=\"sm\"\n onClick={() => navigate('/integrations/new-sync-page')}\n data-testid=\"sync-setup-empty\"\n >\n <Plus className=\"mr-1 h-4 w-4\" />\n Set up a sync\n </Button>\n ) : undefined\n }\n />\n )}\n\n <ul className=\"space-y-3\">\n {syncs.map((sync) => {\n const rowProps = rowLinkProps(\n () => navigate(detailPath('/integrations/sync-detail-page', sync.id)),\n `${providerLabel(sync.provider)} sync for ${sync.project?.name ?? 'unknown project'}`\n );\n return (\n <li\n key={sync.id}\n data-testid=\"sync-row\"\n {...rowProps}\n className={`rounded-md border p-4 space-y-2 ${rowProps.className}`}\n >\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div className=\"min-w-0 space-y-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-medium\">{providerLabel(sync.provider)}</span>\n <SyncStatusBadge status={sync.status} />\n <span className=\"text-xs text-muted-foreground\">\n {directionLabel(sync.direction)}\n </span>\n </div>\n <p className=\"text-xs text-muted-foreground\">\n {sync.project?.name ?? 'Unknown project'}\n {' · '}\n {sync.externalProjectUrl ? (\n <a\n href={sync.externalProjectUrl}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n className=\"inline-flex items-center gap-1 text-primary hover:underline\"\n onClick={stopRowActivation}\n >\n {sync.externalProjectId}\n <ExternalLink className=\"h-3 w-3\" />\n </a>\n ) : (\n sync.externalProjectId\n )}\n {' · '}\n {sync.totalItemsSynced} item{sync.totalItemsSynced === 1 ? '' : 's'} synced\n </p>\n <SyncHealthSummary health={sync.runHealth} />\n {sync.lastSyncError && (\n <p className=\"text-xs text-status-error-text\" data-testid=\"sync-row-last-error\">\n <TruncatedText\n text={sync.lastSyncError}\n max={120}\n className=\"text-status-error-text\"\n />\n </p>\n )}\n </div>\n <div\n className=\"flex shrink-0 flex-wrap items-center gap-2\"\n onClick={stopRowActivation}\n onKeyDown={(e) => e.stopPropagation()}\n >\n <RunNowButton\n syncId={sync.id}\n onResult={(result) => setRunResults((prev) => ({ ...prev, [sync.id]: result }))}\n />\n <PauseResumeButton syncId={sync.id} status={sync.status} />\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => navigate(detailPath('/integrations/sync-detail-page', sync.id))}\n >\n Open\n </Button>\n </div>\n </div>\n {runResults[sync.id] && (\n <div onClick={stopRowActivation} onKeyDown={(e) => e.stopPropagation()}>\n <SyncRunResultSummary result={runResults[sync.id]} />\n </div>\n )}\n </li>\n );\n })}\n </ul>\n {list?.pageInfo.hasNextPage && (\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => void loadMore()}\n disabled={loadingMore}\n data-testid=\"sync-list-more\"\n >\n {loadingMore ? 'Loading…' : `Show more (${syncs.length} of ${list.totalCount})`}\n </Button>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAgCA,IAAM,IAAO,IACP,IAAiB,CAAC,OAAO,GAAG,EAAc,EAE1C,IAAa,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CtB,SAAgB,IAA4B;CAC1C,IAAM,EAAE,mBAAgB,GAAe,EACjC,IAAW,GAAuB,EAClC,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,CAAC,GAAW,KAAgB,EAAS,GAAG,EACxC,CAAC,GAAQ,KAAa,EAA0C,MAAM,EACtE,CAAC,GAAa,KAAkB,EAAS,GAAM,EAC/C,CAAC,GAAY,KAAiB,EAAwC,EAAE,CAAC,EACzE,IAAO,EAAiB,EAAO,MAAM,CAAC,EAEtC,IAAS;EACb,GAAI,IAAO,EAAE,QAAQ,GAAM,GAAG,EAAE;EAChC,GAAI,IAAY,EAAE,cAAW,GAAG,EAAE;EAClC,GAAI,MAAW,QAAqB,EAAE,GAAf,EAAE,WAAQ;EAClC,EAEK,EAAE,SAAM,YAAS,UAAO,iBAAc,EAMzC,GAAY;EACb,WAAW;GAAE,aAAa,KAAe;GAAI;GAAQ,YAAY,EAAE,OAAO,GAAM;GAAE;EAClF,MAAM,CAAC;EACP,aAAa;EACd,CAAC,EAEI,IAAO,GAAM,yBACb,IAAQ,GAAM,SAAS,EAAE,EACzB,IAAgB,MAAS,MAAM,MAAc,MAAM,MAAW,OAG9D,IAAwB,CAAC,CAAC,KAAQ,EAAM,WAAW,KAAK,CAAC,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